mirror of
https://github.com/radareorg/radare2.git
synced 2024-11-24 05:40:10 +00:00
Initial import of the /new lungo.js based web ui
This commit is contained in:
parent
07d27512ee
commit
6e27dc0d76
47
shlr/www/new/app.css
Normal file
47
shlr/www/new/app.css
Normal file
@ -0,0 +1,47 @@
|
||||
#main article li.contrast {
|
||||
font-size: 0.95em;
|
||||
}
|
||||
|
||||
#main article li.feature strong {
|
||||
margin-top: 8px;
|
||||
margin-bottom: 10px;
|
||||
display: block;
|
||||
}
|
||||
|
||||
#touchevents-console {
|
||||
background: #292f34;
|
||||
color: white;
|
||||
font-size: 3.0em;
|
||||
line-height: 2.2em;
|
||||
text-align: center;
|
||||
}
|
||||
|
||||
li {
|
||||
padding-top: 128px !important;
|
||||
padding-bottom: 128px !important;
|
||||
}
|
||||
|
||||
#touchevents .list li:not(.anchor) {
|
||||
padding: 64px 8px;
|
||||
}
|
||||
|
||||
#scroll h1 {
|
||||
line-height: 44px;
|
||||
background: black;
|
||||
color: white;
|
||||
text-indent: 10px;
|
||||
}
|
||||
|
||||
#scroll img {
|
||||
min-width: 256px;
|
||||
min-height: 128px;
|
||||
background: #333;
|
||||
}
|
||||
#scroll .anchor img {
|
||||
width: 100%;
|
||||
margin-bottom: 4px;
|
||||
}
|
||||
#scroll .horizontal img {
|
||||
height: 100%;
|
||||
margin-right: 4px;
|
||||
}
|
76
shlr/www/new/app/disasm.html
Normal file
76
shlr/www/new/app/disasm.html
Normal file
@ -0,0 +1,76 @@
|
||||
<article id="disasm" class="list scroll">
|
||||
<div style="position:absolute;background.color:red;z-index:10">
|
||||
<pre>
|
||||
.-
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
`-
|
||||
|
||||
|
||||
.-
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
`-
|
||||
.-
|
||||
|
|
||||
|
|
||||
`-
|
||||
</pre>
|
||||
</div>
|
||||
<ul style="margin-left:20px">
|
||||
<li style="background-color:#c0c0c0">
|
||||
<table><tr><td>
|
||||
<strong>Function</strong>
|
||||
</td><td style="padding-left:10px">
|
||||
<a href="see_fun">entry0</a>
|
||||
</td></tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>
|
||||
<table><tr><td>
|
||||
<a href="">0x8048000</a>
|
||||
</td><td class=code>
|
||||
push 0x0
|
||||
</td></tr>
|
||||
</table>
|
||||
</li>
|
||||
<li class=code>mov rbp, rsp</li>
|
||||
<li class=code>and rsp, 0xfffffffffffffff0</li>
|
||||
<li class=code>mov rdi, [rbp+0x8]</li>
|
||||
<li class=comment>; This is a comment test
|
||||
; multiline 2
|
||||
</li>
|
||||
<li class=code>lea rsi, [rbp+0x10]</li>
|
||||
<li class=code>mov edx, edi</li>
|
||||
<li class=code>add edx, 0x1</li>
|
||||
<li class=code>shl edx, 0x3</li>
|
||||
<li class=code>add rdx, rsi</li>
|
||||
<li class=code>mov rcx, rdx</li>
|
||||
<li class=code>jmp 0x10000149d</li>
|
||||
<li class=code>add rcx, 0x8</li>
|
||||
<li class=code>cmp qword [rcx], 0x0</li>
|
||||
<li class=code>jnz 0x100001499</li>
|
||||
<li class=code>add rcx, 0x8</li>
|
||||
<li class=code>call dword 0x100002404</li>
|
||||
<li class=code>mov edi, eax</li>
|
||||
<li class=code>call dword 0x100004dce</li>
|
||||
<li class=code>hlt</li>
|
||||
<li class=code>push rbp</li>
|
||||
<li class=code>mov rbp, rsp</li>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
12
shlr/www/new/app/settings.html
Normal file
12
shlr/www/new/app/settings.html
Normal file
@ -0,0 +1,12 @@
|
||||
<article id="settings" class="list scroll">
|
||||
JAJAJAJ
|
||||
This is settings!!1
|
||||
mayhaeeem
|
||||
|
||||
<input type="checkbox">
|
||||
<select>
|
||||
<option>foo</option>
|
||||
<option>bar</option>
|
||||
<option>cow</option>
|
||||
</select>
|
||||
</article>
|
BIN
shlr/www/new/icon.png
Normal file
BIN
shlr/www/new/icon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 1.5 KiB |
355
shlr/www/new/index.html
Normal file
355
shlr/www/new/index.html
Normal file
@ -0,0 +1,355 @@
|
||||
<html>
|
||||
<head>
|
||||
<meta charset="utf-8"></meta>
|
||||
<title>r2wui</title>
|
||||
<meta name="viewport" content="initial-scale=1.0, maximum-scale=1.0, user-scalable=no" />
|
||||
<meta name="apple-mobile-web-app-capable" content="yes">
|
||||
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
||||
<meta name="format-detection" content="telephone=no">
|
||||
<link rel="stylesheet" href="./style.css" />
|
||||
<link rel="stylesheet" href="./app.css" />
|
||||
<link rel="stylesheet" href="./lungo.css" />
|
||||
<link rel="stylesheet" href="./lungo.icon.css" />
|
||||
<link rel="stylesheet" href="./lungo.icon.brand.css" />
|
||||
<link rel="stylesheet" href="./lungo.theme.default.css" />
|
||||
<!-- iPhone -->
|
||||
<link href="icon.png" sizes="57x57" rel="apple-touch-icon">
|
||||
<script src="window.js">
|
||||
|
||||
</script>
|
||||
</head>
|
||||
<body class="app">
|
||||
<section id="main" data-transition="slide">
|
||||
<header class="">
|
||||
<nav class="left box">
|
||||
<a href="#features" data-router="aside" data-icon="menu"></a>
|
||||
</nav>
|
||||
<div class="left">
|
||||
<div class="centered title with-subtitle">
|
||||
r2wui
|
||||
<small class="subtitle">radare2 web frontend</small>
|
||||
</div>
|
||||
</div>
|
||||
</header>
|
||||
<article id="disasm" class="list scroll">
|
||||
<div style="position:absolute;background.color:red;z-index:10">
|
||||
<pre>
|
||||
.-
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
`-
|
||||
|
||||
|
||||
.-
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
|
|
||||
`-
|
||||
.-
|
||||
|
|
||||
|
|
||||
`-
|
||||
</pre>
|
||||
</div>
|
||||
<ul style="margin-left:20px">
|
||||
<li style="background-color:#c0c0c0">
|
||||
<table><tr><td>
|
||||
<strong>Function</strong>
|
||||
</td><td style="padding-left:10px">
|
||||
<a href="see_fun">entry0</a>
|
||||
</td></tr>
|
||||
</table>
|
||||
</li>
|
||||
<li>
|
||||
<table><tr><td>
|
||||
<a href="">0x8048000</a>
|
||||
</td><td class=code>
|
||||
push 0x0
|
||||
</td></tr>
|
||||
</table>
|
||||
</li>
|
||||
<li class=code>mov rbp, rsp</li>
|
||||
<li class=code>and rsp, 0xfffffffffffffff0</li>
|
||||
<li class=code>mov rdi, [rbp+0x8]</li>
|
||||
<li class=comment>; This is a comment test
|
||||
; multiline 2
|
||||
</li>
|
||||
<li class=code>lea rsi, [rbp+0x10]</li>
|
||||
<li class=code>mov edx, edi</li>
|
||||
<li class=code>add edx, 0x1</li>
|
||||
<li class=code>shl edx, 0x3</li>
|
||||
<li class=code>add rdx, rsi</li>
|
||||
<li class=code>mov rcx, rdx</li>
|
||||
<li class=code>jmp 0x10000149d</li>
|
||||
<li class=code>add rcx, 0x8</li>
|
||||
<li class=code>cmp qword [rcx], 0x0</li>
|
||||
<li class=code>jnz 0x100001499</li>
|
||||
<li class=code>add rcx, 0x8</li>
|
||||
<li class=code>call dword 0x100002404</li>
|
||||
<li class=code>mov edi, eax</li>
|
||||
<li class=code>call dword 0x100004dce</li>
|
||||
<li class=code>hlt</li>
|
||||
<li class=code>push rbp</li>
|
||||
<li class=code>mov rbp, rsp</li>
|
||||
<li class=code>and rsp, 0xfffffffffffffff0</li>
|
||||
<li class=code>mov rdi, [rbp+0x8]</li>
|
||||
<li class=comment>; This is a comment test
|
||||
; multiline 2
|
||||
</li>
|
||||
<li class=code>lea rsi, [rbp+0x10]</li>
|
||||
<li class=code>mov edx, edi</li>
|
||||
<li class=code>add edx, 0x1</li>
|
||||
<li class=code>shl edx, 0x3</li>
|
||||
<li class=code>add rdx, rsi</li>
|
||||
<li class=code>mov rcx, rdx</li>
|
||||
<li class=code>jmp 0x10000149d</li>
|
||||
<li class=code>add rcx, 0x8</li>
|
||||
<li class=code>cmp qword [rcx], 0x0</li>
|
||||
<li class=code>jnz 0x100001499</li>
|
||||
<li class=code>add rcx, 0x8</li>
|
||||
<li class=code>call dword 0x100002404</li>
|
||||
<li class=code>mov edi, eax</li>
|
||||
<li class=code>call dword 0x100004dce</li>
|
||||
<li class=code>hlt</li>
|
||||
<li class=code>push rbp</li>
|
||||
<li class=code>mov rbp, rsp</li>
|
||||
</li>
|
||||
</ul>
|
||||
<!-- BUG: ff and chrome fail when left:60% -> scroll is wrong. use hardcoded pixels -->
|
||||
<div id="exampleB" style="position:fixed!important;top:50px;left:780;width:250px;height:450px;background-color:#e0e0e0;border: 1px solid black;z-index:99">
|
||||
<div id="exampleBHandle" style="height:20px;left:0px;top:0px;cursor:move;width:248px;background-color:#20a0e0;font-weight:bold;color:white;border:1px solid black"> Registers</div>
|
||||
<div style="margin:5px">
|
||||
<br /><br />
|
||||
<pre>
|
||||
eax = 0x33441100
|
||||
ebx = 0x00000000
|
||||
ecx = 0x00000005
|
||||
edx = 0x08049204
|
||||
|
||||
esp = 0x0bff428a
|
||||
ebp = 0x0bff428a
|
||||
eip = 0x08048520
|
||||
|
||||
</pre>
|
||||
<div class="two columns left" style="width:100px">
|
||||
<a href="#" class="button big theme" data-label="" data-icon="right">Step</a>
|
||||
</div>
|
||||
<div class="two columns right" style="width:120px">
|
||||
<a href="#" class="button big red" data-label="" data-icon="plus">Continue</a>
|
||||
</div>
|
||||
</div>
|
||||
|
||||
|
||||
</div>
|
||||
|
||||
<script type="text/javascript">
|
||||
var exampA = null;
|
||||
var exampB = null;
|
||||
function initialize()
|
||||
{
|
||||
exampA = new dragObject("exampleB", null, new Position(300,0), new Position(570,200), null, null, exampleAEnd, false);
|
||||
exampB = new dragObject("exampleB", "exampleBHandle");
|
||||
}
|
||||
function buttonClicked()
|
||||
{
|
||||
var button = document.getElementById('dragButton');
|
||||
if(exampA.IsListening())
|
||||
{
|
||||
exampA.StopListening(true);
|
||||
exampB.StopListening(true);
|
||||
button.value = "Resume Listening";
|
||||
}
|
||||
else
|
||||
{
|
||||
exampA.StartListening();
|
||||
exampB.StartListening();
|
||||
button.value = "Stop Listening";
|
||||
}
|
||||
}
|
||||
function exampleAEnd()
|
||||
{
|
||||
// alert("Drag Ended.");
|
||||
}
|
||||
initialize();
|
||||
</script>
|
||||
<!-- -->
|
||||
</article>
|
||||
<article id="settings" class="indented" data-title="">
|
||||
<p style="left-margin:14px;top-margin:14px;">
|
||||
<p style="font-size:18px">Settings</p>
|
||||
|
||||
<form>
|
||||
<br />
|
||||
<strong>
|
||||
Endian
|
||||
</strong>
|
||||
<label class="select">
|
||||
<select class="custom">
|
||||
<option value="1">HTML5 Jedi</option>
|
||||
<option value="2">Two</option>
|
||||
<option value="3">Three</option>
|
||||
</select>
|
||||
</label>
|
||||
<div class="one row">
|
||||
<input type="range" min="0" max="1" class="checkbox left" value="0">
|
||||
<input type="range" min="0" max="1" class="checkbox right active" value="1">
|
||||
</div>
|
||||
<div id="progress-normal" data-progress="25%"></div>
|
||||
|
||||
<div class="four columns left">
|
||||
<a href="#" class="button big theme" data-label="Accept" data-icon="check"></a>
|
||||
</div>
|
||||
<div class="four columns right">
|
||||
<a href="#" class="button big red" data-label="Cancel" data-icon="close"></a>
|
||||
</div>
|
||||
|
||||
</form>
|
||||
</p>
|
||||
</article>
|
||||
<article id="test" class="list scroll">
|
||||
JAJAJAJ
|
||||
</article>
|
||||
<footer class="toolbar">
|
||||
<nav>
|
||||
<a href="#" data-icon="left"></a>
|
||||
<a href="#" data-icon="right"></a>
|
||||
<a href="#" data-icon="chat">Comments </a>
|
||||
<a href="#" data-icon="book">Bookmarks </a>
|
||||
<a href="#" data-icon="user">Symbols </a>
|
||||
<a href="#" data-icon="map">Sections</a>
|
||||
</nav>
|
||||
</footer>
|
||||
</section>
|
||||
|
||||
<aside id="features" class="left">
|
||||
<header data-title="Options"></header>
|
||||
<article class="list">
|
||||
<ul>
|
||||
<li class=current>
|
||||
<a href="#disasm" data-router="article" data-icon="user">
|
||||
<strong>Disassembly</strong>
|
||||
<small>Disassemble code</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#hex" data-router="article" data-icon="pencil">
|
||||
<strong>Hexdump</strong>
|
||||
<small>Dump data in hexadecimal</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#hex" data-router="article" data-icon="search">
|
||||
<strong>Search</strong>
|
||||
<small>Search bytes or strings</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#debug" data-router="article" data-icon="right">
|
||||
<strong>Debug</strong>
|
||||
<small>Dump data in hexadecimal</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#fs" data-router="article" data-icon="user">
|
||||
<strong>Filesystems</strong>
|
||||
<small>Walk the filesystems</small>
|
||||
</a>
|
||||
</li>
|
||||
<li> <a href="#"> <hr size=1px width=100% style="color:white;" /> </a> </li>
|
||||
<li>
|
||||
<a href="#info" data-router="article" data-icon="info">
|
||||
<strong>Information</strong>
|
||||
<small>Show header and file information</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#symbols" data-router="article" data-icon="menu">
|
||||
<strong>Symbols</strong>
|
||||
<small>Exported symbols of the binary</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#imports" data-router="article" data-icon="menu">
|
||||
<strong>Imports</strong>
|
||||
<small>Symbols imported by the binary</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#functions" data-router="article" data-icon="menu">
|
||||
<strong>Functions</strong>
|
||||
<small>Symbols imported by the binary</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#sections" data-router="article" data-icon="menu">
|
||||
<strong>Sections</strong>
|
||||
<small>Symbols imported by the binary</small>
|
||||
</a>
|
||||
</li>
|
||||
<li>
|
||||
<a href="#strings" data-router="article" data-icon="menu">
|
||||
<strong>Strings</strong>
|
||||
<small>Symbols imported by the binary</small>
|
||||
</a>
|
||||
</li>
|
||||
<li> <a href="#"> <hr size=1px width=100% style="color:white;" /> </a> </li>
|
||||
<li>
|
||||
<a href="#settings" data-router="article" data-icon="settings">
|
||||
<strong>Settings</strong>
|
||||
<small>Change configuration options</small>
|
||||
</a>
|
||||
</li>
|
||||
</ul>
|
||||
</article>
|
||||
</aside>
|
||||
|
||||
<script src="./quo.js"></script>
|
||||
<script src="./lungo.js"></script>
|
||||
<script>
|
||||
//sugars: ['map','pull'],
|
||||
Lungo.init ({
|
||||
name: 'r2wui',
|
||||
version: 0.1,
|
||||
sugars: ['map'],
|
||||
resources: [
|
||||
'app/disasm.html',
|
||||
'app/settings.html',
|
||||
]
|
||||
});
|
||||
|
||||
|
||||
//Lungo.Router.aside("", left_menu);
|
||||
Lungo.Router.article("test","list-indented");
|
||||
var afterNotification = function(){
|
||||
//Do something
|
||||
};
|
||||
|
||||
/**
|
||||
Lungo.Notification.show("Success", "Successful operation",
|
||||
"check", true, 1, afterNotification);
|
||||
*/
|
||||
|
||||
|
||||
/*
|
||||
resources: {
|
||||
sections: ['app/foo.html'],
|
||||
asides: ['app/features.html' ],
|
||||
templates: ['app/list.html' ],
|
||||
}
|
||||
*/
|
||||
</script>
|
||||
</body>
|
||||
</html>
|
1
shlr/www/new/lungo.css
Normal file
1
shlr/www/new/lungo.css
Normal file
File diff suppressed because one or more lines are too long
121
shlr/www/new/lungo.icon.brand.css
Normal file
121
shlr/www/new/lungo.icon.brand.css
Normal file
File diff suppressed because one or more lines are too long
197
shlr/www/new/lungo.icon.css
Normal file
197
shlr/www/new/lungo.icon.css
Normal file
File diff suppressed because one or more lines are too long
38
shlr/www/new/lungo.js
Normal file
38
shlr/www/new/lungo.js
Normal file
@ -0,0 +1,38 @@
|
||||
/*
|
||||
http://www.github.com/tapquo/lungo/blob/master/LICENSE.txt
|
||||
@version 2.0
|
||||
@link https://github.com/TapQuo/Lungo.js
|
||||
|
||||
@author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
|
||||
*/
|
||||
var Lungo=Lungo||{};Lungo.VERSION="2.0";Lungo.Attributes||(Lungo.Attributes={});Lungo.Element||(Lungo.Element={});Lungo.Data||(Lungo.Data={});Lungo.Sugar||(Lungo.Sugar={});Lungo.View||(Lungo.View={});Lungo.Boot||(Lungo.Boot={});Lungo.Device||(Lungo.Device={});Lungo.ready||(Lungo.ready=Quo().ready);Lungo.init=function(b){b&&b.resources&&Lungo.Boot.Resources.init(b.resources);Lungo.Boot.Layout.init();Lungo.Boot.Events.init();Lungo.Boot.Data.init();Lungo.Boot.Section.init();Lungo.Boot.Article.init()};Lungo.Core=function(b,g){var a=Array.prototype,i=function(c,d){return g.isOwnProperty(c,d)},e=function(c){return g.toType(c)},h=function(c){return a.slice.call(c,0)};return{log:function(c,d){b.Core.isMobile()||console[c===1?"log":c===2?"warn":"error"](d)},execute:function(){var c=h(arguments),d=c.shift();e(d)==="function"&&d.apply(null,c)},bind:function(c,d){return function(){return d.apply(c,h(arguments))}},mix:function(){for(var c=c||{},d=0,j=arguments.length;d<j;d++){var f=arguments[d],k;for(k in f)if(i(f,
|
||||
k))c[k]=f[k]}return c},isOwnProperty:i,toType:e,toArray:h,isMobile:function(){return g.isMobile()},environment:function(){return g.environment()},orderByProperty:function(c,d,j){var f=j==="desc"?-1:1;return c.sort(function(k,m){return k[d]<m[d]?-f:k[d]>m[d]?f:0})},parseUrl:function(c){var d=c.lastIndexOf("#");if(d>0)c=c.substring(d);else if(d===-1)c="#"+c;return c},findByProperty:function(c,d,j){for(var f=null,k=0,m=c.length;k<m;k++){var n=c[k];if(n[d]==j){f=n;break}}return f}}}(Lungo,Quo);Lungo.dom=function(b){return $$(b)};Lungo.Service=function(b,g){var a={MINUTE:"minute",HOUR:"hour",DAY:"day"},i=function(e,h){var c=false,d=b.Data.Storage.persistent("lungojs_service_cache");if(d){d=d[e];c=(new Date).getTime();d=(new Date(d)).getTime();var j=c-d;c=h.split(" ");d=c[1];j=j/1E3/60;if(d.indexOf(a.HOUR)>=0)j/=60;else if(d.indexOf(a.DAY)>=0)j=j/60/24;c=j<c[0]?true:false}return c};return{get:function(e,h,c,d){return g.get(e,h,c,d)},post:function(e,h,c,d){return g.post(e,h,c,d)},json:function(e,h,c){return g.json(e,h,c)},cache:function(e,
|
||||
h,c,d,j){var f=e+g.serializeParameters(h);if(i(f,c)){if(e=b.Data.Storage.persistent(f))return d.call(d,e)}else return g.get(e,h,function(k){var m=b.Data.Storage.persistent("lungojs_service_cache")||{};m[f]=new Date;b.Data.Storage.persistent("lungojs_service_cache",m);b.Data.Storage.persistent(f,k);d.call(d,k)},j)},Settings:g.ajaxSettings}}(Lungo,Quo);Lungo.Constants={ELEMENT:{SECTION:"section",ARTICLE:"article",ASIDE:"aside",BODY:"body",DIV:"div",LIST:"<ul></ul>",LI:"li",SPAN:"<span> </span>"},CLASS:{ACTIVE:"active",ASIDE:"aside",SHOW:"show",HIDE:"hide",CURRENT:"current",RIGHT:"right",LEFT:"left",HORIZONTAL:"horizontal",SMALL:"small"},TRIGGER:{LOAD:"load",UNLOAD:"unload"},ATTRIBUTE:{ID:"id",HREF:"href",TITLE:"title",ARTICLE:"article",CLASS:"class",WIDTH:"width",HEIGHT:"height",PIXEL:"px",PERCENT:"%",ROUTER:"router",FIRST:"first",LAST:"last",
|
||||
EMPTY:""},BINDING:{START:"{{",END:"}}",KEY:"value",SELECTOR:"{{value}}"},ERROR:{DATABASE:"ERROR: Connecting to Data.Sql.",DATABASE_TRANSACTION:"ERROR: Data.Sql >> ",ROUTER:"ERROR: The target does not exists >>",LOADING_RESOURCE:"ERROR: Loading resource: "}};Lungo.Events=function(b){return{init:function(g){for(event in g){var a=event.indexOf(" ");if(a>0){var i=event.substring(0,a);a=event.substring(a+1);b.dom(a).on(i,g[event])}}}}}(Lungo);Lungo.Notification=function(b,g){var a=[],i=null,e=null,h=b.Constants.BINDING,c={BODY:"body",NOTIFICATION:".notification",MODAL:".notification .window",MODAL_HREF:".notification .window a",WINDOW_CLOSABLE:".notification > .url .close",CONFIRM_BUTTONS:".notification .confirm a.button"},d={MODAL:"modal",VISIBLE:"visible",SHOW:"show",WORKING:"working",INPUT:"input"},j=function(){e.removeClass("show");setTimeout(function(){i.style("display","none").removeClass("url").removeClass("confirm").removeClass("modal")},
|
||||
150)},f=function(l,o,r,s,t,u){k(false);e.addClass(s||"info").addClass("special notify");m(q(l,o,r));n(t,u)},k=function(l,o){i.style("display")==="none"&&i.show();l&&i.addClass(d.MODAL)||i.removeClass(d.MODAL);e.removeClass(d.SHOW).removeClass(d.WORKING);e.removeClass("url").removeClass("notify").removeClass("confirm").removeClass("special").removeClass("working");e.removeClass("error").removeClass("alert").removeClass("success");o&&e.addClass(d.WORKING)},m=function(l){e.html(l);setTimeout(function(){e.addClass(d.SHOW)},
|
||||
1)},n=function(l,o){l!==g&&l!==0&&setTimeout(function(){j();o&&setTimeout(o,200)},l*1E3)},q=function(l,o,r){o=!o?" ":o;return'<span class="icon '+r+'"></span><strong>'+l+"</strong><small>"+o+"</small>"},p=function(l,o){return'<a href="#" data-callback="'+o+'" class="button '+l.color+'" data-icon="'+l.icon+'">'+l.label+"</a>"};b.dom(c.BODY).append('<div class="notification"><div class="window"></div></div>');i=b.dom(c.NOTIFICATION);e=i.children(".window");(function(){e.tap(function(){e.hasClass("notify")&&
|
||||
j()});b.dom(c.CONFIRM_BUTTONS).tap(function(){var l=b.dom(this);(l=a[l.data("callback")].callback)&&l.call(l);j()});b.dom(c.WINDOW_CLOSABLE).tap(j)})();return{show:function(l,o,r,s,t,u){k(true,s);m(q(l,o,r));n(t,u)},hide:j,error:function(l,o,r,s,t){f(l,o,r,"error",s,t)},alert:function(l,o,r,s,t){f(l,o,r,"alert",s,t)},success:function(l,o,r,s,t){f(l,o,r,"success",s,t)},confirm:function(l){a=l;k(true);var o="<p>"+q(l.title,l.description,l.icon)+"</p><hr/>";o+=p(l.accept,"accept");o+=p(l.cancel,"cancel");
|
||||
e.addClass("special confirm");m(o)},html:function(l,o){k(true);e.addClass("url");l+=o?'<span class="icon close"></span>':"";m(l)},loading:function(){k(true);var l=b.Attributes.Data.Loading.html.replace(h.START+h.KEY+h.END,"icon loading white");m(l)}}}(Lungo);Lungo.Fallback=function(b){return{androidInputs:function(g,a){environment=b.Core.environment();if(environment.isMobile&&environment.os.name==="android"&&environment.os.version<"4")for(var i=b.dom(g+" input, "+g+" textarea, "+g+" select"),e=0,h=i.length;e<h;e++)a?i[e].removeAttribute("disabled"):i[e].setAttribute("disabled","disabled")},fixPositionInAndroid:function(){env=b.Core.environment();b.Element.Cache.sections.style("position",env.isMobile&&env.os.name==="Android"&&env.os.version<"3"?"absolute":
|
||||
"fixed")}}}(Lungo);Lungo.Router=function(b){var g=b.Constants.CLASS,a=b.Constants.ELEMENT,i=b.Constants.TRIGGER,e=b.Constants.ATTRIBUTE,h=function(c){c=b.Core.parseUrl(c);var d=b.Element.Cache.section;if(c!=="#"+d.attr("id")?true:false){var j=d.siblings(a.SECTION+c);if(j.length>0){if(target_transition=j.data("transition")){d.data("transition-origin",d.data("transition"));d.data("transition",target_transition)}d.removeClass(g.SHOW).addClass(g.HIDE);j.addClass(g.SHOW);b.Element.Cache.section=j;b.Element.Cache.article=
|
||||
j.find(a.ARTICLE+"."+g.CURRENT);b.Router.History.add(c);d.trigger(i.UNLOAD);j.trigger(i.LOAD)}}};return{section:h,article:function(c,d,j){d=b.Core.parseUrl(d);var f=b.Element.Cache.article;if(d!=="#"+f.attr("id")?true:false){h(c);c=b.Element.Cache.section.find(a.ARTICLE+d);if(c.length>0){if(f.parent("section").attr("id")!==c.parent("section").attr("id"))f=b.Element.Cache.section.children(a.ARTICLE);f.removeClass(g.CURRENT).trigger(i.UNLOAD);c.addClass(g.CURRENT).trigger(i.LOAD);b.Element.Cache.article=
|
||||
c;b.View.Article.switchNavItems(d);b.View.Article.switchReferenceItems(d,b.Element.Cache.section);j&&b.View.Article.title(j.data(e.TITLE))}}},aside:function(c,d){d=b.Core.parseUrl(d);b.View.Aside.toggle(d)},back:function(){var c=b.Element.Cache.section;c.removeClass(g.SHOW);b.Router.History.removeLast();target=c.siblings(a.SECTION+b.Router.History.current());var d=target.data("transition-origin");target.data("transition",d);target.removeClass(g.HIDE).addClass(g.SHOW);d=b.Element.Cache.section=target;
|
||||
c.trigger(i.UNLOAD);d.trigger(i.LOAD)}}}(Lungo);Lungo.Router.History=function(){var b=[],g=function(){return b[b.length-1]};return{add:function(a){a!==g()&&b.push(a)},current:g,removeLast:function(){b.length-=1}}}();Lungo.View.Article=function(b){var g=b.Constants.CLASS,a=b.Constants.ATTRIBUTE,i={NAVIGATION_ITEM:'a[href][data-router="article"]',REFERENCE_LINK:" a[href][data-article]",TITLE_OF_ARTICLE:"header .title, footer .title",ASIDE_REFERENCE_LIST:"li a.current, li.current"};return{title:function(e){e&&b.Element.Cache.section.find(i.TITLE_OF_ARTICLE).text(e)},switchReferenceItems:function(e,h){e=e.replace("#","");for(var c=h.find(i.REFERENCE_LINK),d=0,j=c.length;d<j;d++){var f=b.dom(c[d]);f.data(a.ARTICLE)===
|
||||
e?f.show():f.hide()}},switchNavItems:function(e){b.Element.Cache.section.find(i.NAVIGATION_ITEM).removeClass(g.CURRENT);e='a[href="'+e+'"][data-router="article"]';b.Element.Cache.section.find(e).addClass(g.CURRENT);if(b.Element.Cache.aside){aside=b.Element.Cache.aside;aside.find(i.ASIDE_REFERENCE_LIST).removeClass(g.CURRENT);aside.find(e).addClass(g.CURRENT).parent().addClass(g.CURRENT)}}}}(Lungo);Lungo.View.Aside=function(b){var g=b.Constants.ELEMENT,a=b.Constants.CLASS,i=b.Constants.ATTRIBUTE,e=function(c){var d=null,j=b.Element.Cache.asides.length;if(j==1){if("#"+b.Element.Cache.asides[0].id==c)d=b.dom(b.Element.Cache.asides[0])}else if(j>1)d=b.Element.Cache.asides.siblings(g.ASIDE+c);return d},h=function(c){c=c.attr(i.CLASS);var d="";if(c){d+=c.indexOf(a.RIGHT)>-1?a.RIGHT+" ":"";d+=c.indexOf(a.SMALL)>-1?a.SMALL+" ":""}return d};return{toggle:function(c){if(aside=e(c))aside.hasClass(a.SHOW)?
|
||||
b.View.Aside.hide():b.View.Aside.show(aside);aside=null},show:function(c){if(b.Core.toType(c)=="string")c=e(b.Core.parseUrl(c));if(c){b.Element.Cache.aside=c;var d=h(c);c.addClass(a.SHOW);b.Element.Cache.section.addClass(d).addClass(a.ASIDE)}},hide:function(){var c=b.Element.Cache.aside;if(c){b.Element.Cache.section.removeClass(a.ASIDE).removeClass(a.RIGHT).removeClass(a.SMALL);var d=h(c);d&&b.Element.Cache.section.removeClass(d);setTimeout(function(){c.removeClass(a.SHOW);b.Element.Cache.aside=null},
|
||||
250)}}}}(Lungo);Lungo.Element.Cache={sections:null,section:null,article:null,asides:null,aside:null,navigation:null};Lungo.Element.Carousel=function(b,g){var a={index:0,speed:300,callback:g,container:b,element:b.children[0],slide:undefined,slides:[],slides_length:0,width:0,start:{},isScrolling:undefined,deltaX:0},i=function(){a.container.style.overflow="hidden";a.element.style.listStyle="none";a.element.style.margin=0;a.slides=a.element.children;a.slides_length=a.slides.length;if(a.slides_length<2)return null;a.width="getBoundingClientRect"in a.container?a.container.getBoundingClientRect().width:a.container.offsetWidth;
|
||||
if(!a.width)return null;a.container.style.visibility="hidden";a.element.style.width=a.slides.length*a.width+"px";for(var c=a.slides.length;c--;){var d=a.slides[c];d.style.width=a.width+"px";d.style.display="table-cell";d.style.verticalAlign="top"}e(a.index,0);a.container.style.visibility="visible"},e=function(c,d){var j=a.element.style;if(d==undefined)d=a.speed;j.webkitTransitionDuration=j.MozTransitionDuration=j.msTransitionDuration=j.OTransitionDuration=j.transitionDuration=d+"ms";j.MozTransform=
|
||||
j.webkitTransform="translate3d("+-(c*a.width)+"px,0,0)";j.msTransform=j.OTransform="translateX("+-(c*a.width)+"px)";a.index=c},h=function(){a.callback&&a.callback.apply(a.callback,[a.index,a.slides[a.index]])};i();a.element.addEventListener("touchstart",function(c){a.start={pageX:c.touches[0].pageX,pageY:c.touches[0].pageY,time:Number(new Date)};a.isScrolling=undefined;a.deltaX=0;a.element.style.MozTransitionDuration=a.element.style.webkitTransitionDuration=0;c.stopPropagation()},false);a.element.addEventListener("touchmove",
|
||||
function(c){if(!(c.touches.length>1||c.scale&&c.scale!==1)){a.deltaX=c.touches[0].pageX-a.start.pageX;if(typeof a.isScrolling=="undefined")a.isScrolling=!!(a.isScrolling||Math.abs(a.deltaX)<Math.abs(c.touches[0].pageY-a.start.pageY));if(!a.isScrolling){c.preventDefault();a.deltaX/=!a.index&&a.deltaX>0||a.index==a.slides_length-1&&a.deltaX<0?Math.abs(a.deltaX)/a.width+1:1;a.element.style.MozTransform=a.element.style.webkitTransform="translate3d("+(a.deltaX-a.index*a.width)+"px,0,0)";c.stopPropagation()}}},
|
||||
false);a.element.addEventListener("touchend",function(c){var d=Number(new Date)-a.start.time<250&&Math.abs(a.deltaX)>20||Math.abs(a.deltaX)>a.width/2,j=!a.index&&a.deltaX>0||a.index==a.slides_length-1&&a.deltaX<0;a.isScrolling||e(a.index+(d&&!j?a.deltaX<0?1:-1:0),a.speed);c.stopPropagation()},false);a.element.addEventListener("webkitTransitionEnd",h,false);a.element.addEventListener("msTransitionEnd",h,false);a.element.addEventListener("oTransitionEnd",h,false);a.element.addEventListener("transitionend",
|
||||
h,false);window.addEventListener("resize",i,false);return{prev:function(){a.index&&e(a.index-1,a.speed)},next:function(){a.index<a.slides_length-1?e(a.index+1,a.speed):e(0,a.speed)},position:function(){return a.index}}};Lungo.Element.count=function(b,g){var a=Lungo.dom(b);a.children(".bubble.count").remove();if(a&&g){html=Lungo.Attributes.Data.Count.html.replace(Lungo.Constants.BINDING.SELECTOR,g);a.append(html)}};Lungo.Element.loading=function(b,g){var a=Lungo.dom(b);if(a){var i=null;if(g)i=Lungo.Attributes.Data.Loading.html.replace(Lungo.Constants.BINDING.SELECTOR,g);a.html(i)}};Lungo.Element.progress=function(b,g){var a=Lungo.dom(b);if(a){g+=Lungo.Constants.ATTRIBUTE.PERCENT;a.find(".value").style(Lungo.Constants.ATTRIBUTE.WIDTH,g)}};Lungo.Element.Pull=function(b,g){var a=0,i=false,e=$$(b),h=e.siblings('div[data-control="pull"]'),c;c=Lungo.Core.mix({onPull:"Pull down to refresh",onRelease:"Release to...",onRefresh:"Loading...",callback:undefined},g);var d=function(){j(0,true);setTimeout(function(){i=false;document.removeEventListener("touchmove",q,false)},300);a=0},j=function(p,l){var o=p>100?100:p;l&&e.addClass("pull");e.style("-webkit-transform","translate(0, "+o+"px)");l&&setTimeout(function(){e.removeClass("pull")},300)},
|
||||
f=function(){i=true;document.addEventListener("touchmove",q,false);k(c.onRefresh);m(true);j(60,true);c.callback&&c.callback.apply(this)},k=function(p){h.find("strong").html(p)},m=function(p){p?h.addClass("refresh"):h.removeClass("refresh")},n=function(p){p?h.addClass("rotate"):h.removeClass("rotate")},q=function(p){p.preventDefault()};(function(){var p=false,l={};e.bind("touchstart",function(o){if(e[0].scrollTop<=1){p=true;l=$$.isMobile()?o.touches[0].pageY:o.pageY}}).bind("touchmove",function(o){if(!i&&
|
||||
p){current_y=$$.isMobile()?o.touches[0].pageY:o.pageY;a=current_y-l;if(a>=0){e.style("overflow-y","hidden");j(a,false);m(false);if(a>60){k(c.onRelease);n(true)}else{k(c.onPull);n(false)}}}}).bind("touchend",function(){if(p){e.style("overflow-y","scroll");a>60?f():d()}INI_TOUCH={};p=false})})();return{hide:d}};Lungo.Data.Cache=function(b,g){var a={},i=function(h){return arguments.length===1?a[h]:a[arguments[0]]?a[arguments[0]][arguments[1]]:g},e=function(h){return a[h]?true:false};return{set:function(h,c){a[h]=e(h)?b.Core.mix(i(h),c):c},get:i,remove:function(h){if(arguments.length===1)delete a[h];else delete a[arguments[0]][arguments[1]]},exists:e}}(Lungo);Lungo.Data.Sql=function(b){var g=b.Constants.ERROR,a={name:"lungo_db",version:"1.0",size:65536,schema:[]},i=null,e=function(f,k){b.Core.log(1,"lng.Data.Sql >> "+f);i.transaction(function(m){m.executeSql(f,[],function(n,q){c(k,q)},function(n){n.executedQuery=f;j.apply(null,arguments)})})},h=function(f,k){var m="",n;for(n in f)if(b.Core.isOwnProperty(f,n)){var q=f[n];if(m)m+=" "+k+" ";m+=n+"=";m+=isNaN(q)?'"'+q+'"':q}return m},c=function(f,k){b.Core.toType(f)==="function"&&setTimeout(f,100,k)},d=function(f,
|
||||
k){var m="",n="",q;for(q in k)if(b.Core.isOwnProperty(k,q)){var p=k[q];m+=m?", "+q:q;if(n)n+=", ";n+=isNaN(p)?'"'+p+'"':p}e("INSERT INTO "+f+" ("+m+") VALUES ("+n+")")},j=function(f,k){throw Error(g.DATABASE_TRANSACTION+k.code+": "+k.message+" \n Executed query: "+f.executedQuery);};return{init:function(f){a=b.Core.mix(a,f);if(i=openDatabase(a.name,a.version,a.name,a.size)){f=a.schema;var k=f.length;if(k)for(var m=0;m<k;m++){var n=f[m];n.drop===true&&e("DROP TABLE IF EXISTS "+n.name);var q=n.name;
|
||||
n=n.fields;var p="",l=void 0;for(l in n)if(b.Core.isOwnProperty(n,l)){if(p)p+=", ";p+=l+" "+n[l]}e("CREATE TABLE IF NOT EXISTS "+q+" ("+p+");")}}else throw Error(g.DATABASE);},select:function(f,k,m){k=k?" WHERE "+h(k,"AND"):"";e("SELECT * FROM "+f+k,function(n){for(var q=[],p=0,l=n.rows.length;p<l;p++)q.push(n.rows.item(p));c(m,q)})},insert:function(f,k){if(b.Core.toType(k)==="object")d(f,k);else for(row in k)d(f,k[row])},update:function(f,k,m){f="UPDATE "+f+" SET "+h(k,",");if(m)f+=" WHERE "+h(m,
|
||||
"AND");e(f)},drop:function(f,k){var m=k?" WHERE "+h(k,"AND"):"";e("DELETE FROM "+f+m+";")},execute:e}}(Lungo);Lungo.Data.Storage=function(){var b={PERSISTENT:"localStorage",SESSION:"sessionStorage"},g=function(a,i,e){a=window[a];if(e){a=a;e=e;e=JSON.stringify(e);a.setItem(i,e)}else if(e===null)a.removeItem(i);else{value=a.getItem(i);return JSON.parse(value)}};return{session:function(a,i){return g(b.SESSION,a,i)},persistent:function(a,i){return g(b.PERSISTENT,a,i)}}}(Lungo);Lungo.Attributes.Data={Search:{tag:"search",selector:"*",html:'<input type="search" placeholder="{{value}}"/><a href="#" class="button" data-icon="search"></a>'},Count:{tag:"count",selector:"*",html:'<span class="bubble count">{{value}}</span>'},Pull:{tag:"pull",selector:"section",html:'<div class="{{value}}" data-control="pull" data-icon="down" data-loading="black"> <strong>title</strong> </div>'},Progress:{tag:"progress",selector:"*",html:'<div class="progress"> <span class="bar"><span class="value" style="width:{{value}};"></span></span> </div>'},
|
||||
Label:{tag:"label",selector:"a",html:"<abbr>{{value}}</abbr>"},Icon:{tag:"icon",selector:"*",html:'<span class="icon {{value}}"></span>'},Image:{tag:"image",selector:"*",html:'<img src="{{value}}" class="icon" />'},Title:{tag:"title",selector:"header, footer, article",html:'<span class="title centered">{{value}}</span>'},Loading:{tag:"loading",selector:"*",html:'<div class="loading {{value}}"> <span class="top"></span> <span class="right"></span> <span class="bottom"></span> <span class="left"></span> </div>'},
|
||||
Back:{tag:"back",selector:"header, footer",html:'<nav class="left"><a href="#back" data-router="section" class="left"><span class="icon {{value}}"></span></a></nav>'}};Lungo.Boot.Resources=function(b,g){var a=b.Constants.ELEMENT,i=b.Constants.ERROR,e=function(h){return g.ajax({url:h,async:false,dataType:"html",error:function(){console.error(i.LOADING_RESOURCE+h)}})};return{init:function(h){for(var c=0,d=h.length;c<d;c++){resource=h[c];try{var j=e(resource);b.Core.toType(j)==="string"&&b.dom(a.BODY).append(j)}catch(f){b.Core.log(3,f.message)}}}}}(Lungo,Quo);Lungo.Boot.Stats=function(b){var g=function(){b.Service.post("http://www.lungojs.com/stats/",{name:b.App.get("name"),version:b.App.get("version"),icon:b.App.get("icon")},function(){})};return{init:function(){b.Core.isMobile()&&g()}}}(Lungo);Lungo.Boot.Layout=function(b){var g=null,a=null,i=b.Constants.ELEMENT,e=b.Constants.ATTRIBUTE,h=function(){if(!location.hash||!g.addEventListener){g.scrollTo(0,1);var c=1,d=setInterval(function(){if(a.body){clearInterval(d);c="scrollTop"in a.body?a.body.scrollTop:1;g.scrollTo(0,c===1?0:1)}},15);g.addEventListener("load",function(){setTimeout(function(){g.scrollTo(0,c===1?0:1)},0)},false)}};return{init:function(){if(b.Core.isMobile()){g=window;a=g.document;if(g.innerHeight==356){b.dom(i.BODY).style(e.HEIGHT,
|
||||
416+e.PIXEL);h()}}}}}(Lungo);Lungo.Boot.Events=function(b){var g=b.Constants.ATTRIBUTE,a=b.Constants.CLASS,i=b.Constants.ELEMENT,e={HREF_TARGET:"a[href][data-router]",HREF_TARGET_FROM_ASIDE:"aside a[href][data-router]",INPUT_CHECKBOX:"input[type=range].checkbox"},h=function(f){f.preventDefault();f=b.dom(this);switch(f.data(g.ROUTER)){case i.SECTION:f=f.attr(g.HREF);j(f);break;case i.ARTICLE:var k=b.Router.History.current(),m=f.attr(g.HREF);b.Router.article(k,m,f);break;case i.ASIDE:k=b.Router.History.current();f=f.attr(g.HREF);
|
||||
b.Router.aside(k,f)}},c=function(f){window.innerWidth<768&&b.View.Aside.hide();f&&f.preventDefault()},d=function(f){f.preventDefault();f=b.dom(this);var k=f.val()>0?0:1;f.toggleClass("active").attr("value",k)},j=function(f){c();f=b.Core.parseUrl(f);if(f==="#back")b.Router.back();else{var k=b.Element.Cache.aside;k&&k.hasClass(a.SHOW)?setTimeout(function(){b.Router.section(f)},250):b.Router.section(f)}};return{init:function(){b.dom(e.HREF_TARGET).tap(h);b.dom(e.HREF_TARGET_FROM_ASIDE).tap(c);b.dom(e.INPUT_CHECKBOX).touch(d)}}}(Lungo);Lungo.Boot.Data=function(b){var g=b.Constants.BINDING;return{init:function(){var a=b.Attributes.Data,i;for(i in a)if(b.Core.isOwnProperty(a,i))for(var e=a[i],h=b.dom(e.selector),c=0,d=h.length;c<d;c++){var j=b.dom(h[c]),f=e,k=j.data(f.tag);if(k){f=f.html.replace(g.START+g.KEY+g.END,k);j.prepend(f)}}}}}(Lungo);Lungo.Boot.Section=function(b){var g=b.Constants.ELEMENT,a=b.Constants.CLASS,i=b.Constants.ATTRIBUTE;return{init:function(){b.Element.Cache.sections=b.dom(g.SECTION);b.Element.Cache.asides=b.dom(g.ASIDE);b.Fallback.fixPositionInAndroid();var e=b.Element.Cache.sections.first();b.Element.Cache.section=e;b.Element.Cache.article=e.children(g.ARTICLE).first();var h="#"+e.attr(i.ID);e.addClass(a.CURRENT);b.Router.History.add(h);e=0;for(h=b.Element.Cache.sections.length;e<h;e++){var c=b.dom(b.Element.Cache.sections[e]),
|
||||
d=c.children(g.ARTICLE).first();d.addClass(a.CURRENT);(d=d.attr(i.ID))&&b.View.Article.switchReferenceItems(d,c)}e=null;h=0;for(c=b.Element.Cache.asides.length;h<c;h++){e=b.dom(b.Element.Cache.asides[h]);e.children(g.ARTICLE).addClass(a.CURRENT)}}}}(Lungo);Lungo.Boot.Article=function(b){var g=b.Constants.ATTRIBUTE,a=b.Constants.ELEMENT,i={LIST_IN_ARTICLE:"article.list, aside.list",CHECKBOX_IN_ARTICLE:".checkbox",ARTICLE_SCROLLABLE:"article.scroll"},e=function(j,f){for(var k=b.dom(j),m=0,n=k.length;m<n;m++){var q=b.dom(k[m]);b.Core.execute(f,q)}},h=function(j){if(j.children().length===0){j.attr(g.ID);j.append(a.LIST)}},c=function(j){j.append(a.SPAN)},d=function(j){j[0].addEventListener("touchstart",function(){scrollTop=this.scrollTop;if(scrollTop<=1)this.scrollTop=
|
||||
1;if(scrollTop+this.offsetHeight>=this.scrollHeight)this.scrollTop=this.scrollHeight-this.offsetHeight-1},false)};return{init:function(){e(i.LIST_IN_ARTICLE,h);e(i.CHECKBOX_IN_ARTICLE,c);e(i.ARTICLE_SCROLLABLE,d)}}}(Lungo);
|
413
shlr/www/new/lungo.theme.default.css
Normal file
413
shlr/www/new/lungo.theme.default.css
Normal file
@ -0,0 +1,413 @@
|
||||
/**
|
||||
* Stylesheet
|
||||
*
|
||||
* @namespace Lungo.Theme
|
||||
* @class Default
|
||||
*
|
||||
* @author Javier Jimenez Villar <javi@tapquo.com> || @soyjavi
|
||||
*/
|
||||
.app {
|
||||
background: #000;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
}
|
||||
.theme,
|
||||
li.theme,
|
||||
a.theme {
|
||||
background: #25aeeb;
|
||||
}
|
||||
.theme:active,
|
||||
li.theme:active,
|
||||
a.theme:active {
|
||||
background: #2a95d3;
|
||||
}
|
||||
/* @group <header> & <footer> & <article> */
|
||||
section > header {
|
||||
background-color: #2a95d3;
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -2px 0 rgba(255,255,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.5);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -2px 0 rgba(255,255,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.5);
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -2px 0 rgba(255,255,255,0.1), inset 0 -1px 0 rgba(0,0,0,0.5);
|
||||
}
|
||||
section > header .title {
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
section > header .subtitle {
|
||||
color: #fff;
|
||||
opacity: 0.7;
|
||||
}
|
||||
section > footer {
|
||||
background-color: #222222;
|
||||
-webkit-box-shadow: inset 0 3px 0 #333333;
|
||||
-moz-box-shadow: inset 0 3px 0 #333333;
|
||||
box-shadow: inset 0 3px 0 #333333;
|
||||
}
|
||||
section > footer > nav a {
|
||||
-webkit-box-shadow: 1px 0 0 #151515;
|
||||
-moz-box-shadow: 1px 0 0 #151515;
|
||||
box-shadow: 1px 0 0 #151515;
|
||||
}
|
||||
section > footer > nav a.current {
|
||||
color: #ffffff;
|
||||
background: #111111;
|
||||
-webkit-box-shadow: -1px 0 0 #252525, 1px 0 0 #252525, inset 0 3px 0 #2A95D3;
|
||||
-moz-box-shadow: -1px 0 0 #252525, 1px 0 0 #252525, inset 0 3px 0 #2A95D3;
|
||||
box-shadow: -1px 0 0 #252525, 1px 0 0 #252525, inset 0 3px 0 #2A95D3;
|
||||
}
|
||||
section > article,
|
||||
section > [data-control="pull"] {
|
||||
background: #f4f5f5;
|
||||
}
|
||||
[data-control="pull"] {
|
||||
color: #666;
|
||||
text-shadow: 0 1px 0 white;
|
||||
}
|
||||
aside {
|
||||
color: #fff;
|
||||
background: #191919;
|
||||
}
|
||||
aside header,
|
||||
aside footer {
|
||||
background: #111111;
|
||||
text-shadow: none;
|
||||
}
|
||||
aside header {
|
||||
-webkit-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
|
||||
-moz-box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
|
||||
box-shadow: inset 0 -1px 0 rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
aside article {
|
||||
background: none;
|
||||
}
|
||||
aside nav a.current .icon {
|
||||
color: white;
|
||||
}
|
||||
aside nav a:not(.current) .icon {
|
||||
color: #888888;
|
||||
}
|
||||
aside .list li {
|
||||
background: none;
|
||||
border-bottom-color: #222222;
|
||||
}
|
||||
aside .list li.current {
|
||||
background: #2a95d3;
|
||||
border-bottom-color: #2a95d3;
|
||||
}
|
||||
aside .list li.current strong,
|
||||
aside .list li.current small,
|
||||
aside .list li.current .icon {
|
||||
color: #fff;
|
||||
}
|
||||
aside .list li strong,
|
||||
aside .list li small,
|
||||
aside .list li .icon {
|
||||
color: #888888;
|
||||
}
|
||||
section.aside {
|
||||
-webkit-box-shadow: -1px 0 0 rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: -1px 0 0 rgba(0,0,0,0.2);
|
||||
box-shadow: -1px 0 0 rgba(0,0,0,0.2);
|
||||
}
|
||||
section.aside.right {
|
||||
-webkit-box-shadow: 4px 0 8px rgba(0,0,0,0.5);
|
||||
-moz-box-shadow: 4px 0 8px rgba(0,0,0,0.5);
|
||||
box-shadow: 4px 0 8px rgba(0,0,0,0.5);
|
||||
}
|
||||
/* @end */
|
||||
/* @group <nav> */
|
||||
header nav a {
|
||||
color: #fff;
|
||||
}
|
||||
header nav.box:not(.right) a {
|
||||
-webkit-box-shadow: 1px 0 0 rgba(255,255,255,0.2), inset -1px 0 0 rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 1px 0 0 rgba(255,255,255,0.2), inset -1px 0 0 rgba(0,0,0,0.2);
|
||||
box-shadow: 1px 0 0 rgba(255,255,255,0.2), inset -1px 0 0 rgba(0,0,0,0.2);
|
||||
}
|
||||
header nav.box.right a {
|
||||
-webkit-box-shadow: -1px 0 0 rgba(255,255,255,0.2), inset 1px 0 0 rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: -1px 0 0 rgba(255,255,255,0.2), inset 1px 0 0 rgba(0,0,0,0.2);
|
||||
box-shadow: -1px 0 0 rgba(255,255,255,0.2), inset 1px 0 0 rgba(0,0,0,0.2);
|
||||
}
|
||||
header nav.box a:active {
|
||||
background: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
header nav.button a {
|
||||
border-radius: 1px;
|
||||
background-image: -webkit-linear-gradient(top , rgba(0, 0, 0, 0) , rgba(0, 0, 0, 0.1));
|
||||
background-image: -moz-linear-gradient(top , rgba(0, 0, 0, 0) , rgba(0, 0, 0, 0.1));
|
||||
background-image: -ms-linear-gradient(top , rgba(0, 0, 0, 0) , rgba(0, 0, 0, 0.1));
|
||||
background-image: -o-linear-gradient(top , rgba(0, 0, 0, 0) , rgba(0, 0, 0, 0.1));
|
||||
background-image: linear-gradient(top , rgba(0, 0, 0, 0) , rgba(0, 0, 0, 0.1));
|
||||
box-shadow: 0 1px 0 rgba(255, 255, 255, 0.2), inset 0 0 3px rgba(0, 0, 0, 0.3), inset 0 1px 1px rgba(0, 0, 0, 0.5);
|
||||
}
|
||||
header nav.button a:active {
|
||||
background: rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
section > nav.groupbar {
|
||||
background-color: #222222;
|
||||
}
|
||||
section > nav.groupbar > a.current {
|
||||
-webkit-box-shadow: inset 0 -3px 0 #2a95d3;
|
||||
-moz-box-shadow: inset 0 -3px 0 #2a95d3;
|
||||
box-shadow: inset 0 -3px 0 #2a95d3;
|
||||
}
|
||||
footer > nav > a,
|
||||
nav.groupbar > a {
|
||||
color: #888888;
|
||||
}
|
||||
footer > nav > a.current,
|
||||
nav.groupbar > a.current {
|
||||
color: #ffffff;
|
||||
}
|
||||
/* @end */
|
||||
/* @group <aside> */
|
||||
/* @group .list */
|
||||
.list li {
|
||||
background: #fff;
|
||||
border-bottom: inset 1px #dddddd;
|
||||
}
|
||||
.list li,
|
||||
.list li a {
|
||||
color: #2a2a2a;
|
||||
}
|
||||
.list li.dark {
|
||||
background: #444444;
|
||||
}
|
||||
.list li.dark,
|
||||
.list li.dark a {
|
||||
color: #fff;
|
||||
}
|
||||
.list li.selectable:active,
|
||||
.list li.theme {
|
||||
background: #25aeeb;
|
||||
}
|
||||
.list li.selectable:active,
|
||||
.list li.theme,
|
||||
.list li.selectable:active a,
|
||||
.list li.theme a {
|
||||
color: #fff;
|
||||
}
|
||||
.list li.light {
|
||||
background: #dddddd;
|
||||
text-shadow: 0 1px 0 #eee;
|
||||
}
|
||||
.list li.light,
|
||||
.list li.light a {
|
||||
color: #888888;
|
||||
}
|
||||
.list li.anchor {
|
||||
background: #222222;
|
||||
border-bottom: none;
|
||||
}
|
||||
.list li.anchor,
|
||||
.list li.anchor a {
|
||||
color: #fff !important;
|
||||
}
|
||||
.list li small,
|
||||
.list li .right:not(.bubble) {
|
||||
opacity: 0.8;
|
||||
}
|
||||
.list:not(.indented) li.dark,
|
||||
.list:not(.indented) li.theme,
|
||||
.list:not(.indented) li.light {
|
||||
border-bottom-color: rgba(0, 0, 0, 0.1);
|
||||
}
|
||||
/* @end */
|
||||
/* @group widgets */
|
||||
.splash {
|
||||
background: #222222;
|
||||
color: #fff;
|
||||
text-shadow: 0 1px 0px rgba(0, 0, 0, 0.2);
|
||||
}
|
||||
/* @group .button */
|
||||
a.button {
|
||||
-webkit-border-radius: 1px;
|
||||
-moz-border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
-webkit-box-shadow: inset 0 2px 0 rgba(255,255,255, 0.2);
|
||||
-moz-box-shadow: inset 0 2px 0 rgba(255,255,255, 0.2);
|
||||
box-shadow: inset 0 2px 0 rgba(255,255,255, 0.2);
|
||||
font-weight: bold;
|
||||
text-shadow: 0 -1px 0 rgba(0, 0, 0, 0.3);
|
||||
}
|
||||
a.button:active {
|
||||
-webkit-box-shadow: inset 0 10px 30px rgba(0,0,0,0.2), inset 0 -2px 4px rgba(0,0,0,0.3);
|
||||
-moz-box-shadow: inset 0 10px 30px rgba(0,0,0,0.2), inset 0 -2px 4px rgba(0,0,0,0.3);
|
||||
box-shadow: inset 0 10px 30px rgba(0,0,0,0.2), inset 0 -2px 4px rgba(0,0,0,0.3);
|
||||
}
|
||||
/* @end */
|
||||
/* @group <form> */
|
||||
label {
|
||||
color: #999;
|
||||
}
|
||||
input:not([type=range]),
|
||||
textarea,
|
||||
select {
|
||||
border: 1px solid #d0d4c6;
|
||||
-webkit-border-radius: 1px;
|
||||
-moz-border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
color: #858585;
|
||||
font-family: Helvetica, Arial, sans-serif;
|
||||
background: #fff;
|
||||
}
|
||||
input:not([type=range]):focus,
|
||||
textarea:focus,
|
||||
select:focus {
|
||||
color: #484a49;
|
||||
border-color: #2a95d3;
|
||||
-webkit-box-shadow: 0 0 1px #25aeeb;
|
||||
-moz-box-shadow: 0 0 1px #25aeeb;
|
||||
box-shadow: 0 0 1px #25aeeb;
|
||||
}
|
||||
input:not([type=range])[disabled],
|
||||
textarea[disabled],
|
||||
select[disabled] {
|
||||
background: #ddd;
|
||||
border-color: #999;
|
||||
color: #999;
|
||||
}
|
||||
.select:after {
|
||||
background: #d0d4c6;
|
||||
color: white;
|
||||
border-top-right-radius: 1px;
|
||||
border-bottom-right-radius: 1px;
|
||||
}
|
||||
/* @group range */
|
||||
input[type=range] {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
-webkit-border-radius: 1px;
|
||||
-moz-border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
input[type=range]:not(.checkbox) {
|
||||
background-color: #c7c7c7;
|
||||
}
|
||||
input[type=range]:not(.checkbox):active {
|
||||
background-color: #25aeeb;
|
||||
}
|
||||
input[type=range].checkbox {
|
||||
background-color: #aaaaaa;
|
||||
color: rgba(255, 255, 255, 0.6);
|
||||
}
|
||||
input[type=range].checkbox.active {
|
||||
background-color: #25aeeb;
|
||||
}
|
||||
input[type=range]::-webkit-slider-thumb {
|
||||
border-radius: 1px;
|
||||
-webkit-box-shadow: 1px 0 rgba(0,0,0,0.2), -1px 0 rgba(0,0,0,0.2), 0 1px rgba(0,0,0,0.2), 0 -1px rgba(0,0,0,0.2);
|
||||
-moz-box-shadow: 1px 0 rgba(0,0,0,0.2), -1px 0 rgba(0,0,0,0.2), 0 1px rgba(0,0,0,0.2), 0 -1px rgba(0,0,0,0.2);
|
||||
box-shadow: 1px 0 rgba(0,0,0,0.2), -1px 0 rgba(0,0,0,0.2), 0 1px rgba(0,0,0,0.2), 0 -1px rgba(0,0,0,0.2);
|
||||
background: #fff;
|
||||
}
|
||||
input[type=range]::-webkit-slider-thumb::after {
|
||||
background: #ddd;
|
||||
}
|
||||
/* @end */
|
||||
/* @group .progress */
|
||||
.progress .labels {
|
||||
font-size: 12px;
|
||||
font-weight: bold;
|
||||
line-height: 18px;
|
||||
color: #858585;
|
||||
}
|
||||
.progress .bar {
|
||||
-webkit-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
-moz-box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
box-shadow: inset 0 1px 2px rgba(0,0,0,0.1);
|
||||
background: #c7c7c7;
|
||||
-webkit-border-radius: 1px;
|
||||
-moz-border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
.progress .bar .value {
|
||||
background-color: #25aeeb;
|
||||
-webkit-border-radius: 1px;
|
||||
-moz-border-radius: 1px;
|
||||
border-radius: 1px;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
.progress .bar .value .label {
|
||||
float: right;
|
||||
margin-right: 3px;
|
||||
font-weight: bold;
|
||||
color: rgba(0, 0, 0, 0.6);
|
||||
text-shadow: 0 1px 0 rgba(255, 255, 255, 0.2) !important;
|
||||
font-size: 12px;
|
||||
}
|
||||
/* @end */
|
||||
/* @group .bubble */
|
||||
.bubble {
|
||||
color: #fff;
|
||||
-webkit-border-radius: 2px;
|
||||
-moz-border-radius: 2px;
|
||||
border-radius: 2px;
|
||||
-webkit-background-clip: padding-box;
|
||||
-moz-background-clip: padding;
|
||||
background-clip: padding-box;
|
||||
}
|
||||
.bubble.count {
|
||||
background: #2a95d3;
|
||||
}
|
||||
header .count {
|
||||
background: #222222 !important;
|
||||
}
|
||||
footer .bubble {
|
||||
-webkit-box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.5);
|
||||
-moz-box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.5);
|
||||
box-shadow: inset 0 1px 1px rgba(255,255,255,0.3), 0 1px 2px rgba(0,0,0,0.5);
|
||||
}
|
||||
article .list .bubble {
|
||||
-webkit-box-shadow: inset 1px 0 0 rgba(0,0,0,0.3), inset 0 1px 0 rgba(0,0,0,0.3), inset -1px 0 0 rgba(0,0,0,0.3), inset 0 -1px 0 rgba(0,0,0,0.3);
|
||||
-moz-box-shadow: inset 1px 0 0 rgba(0,0,0,0.3), inset 0 1px 0 rgba(0,0,0,0.3), inset -1px 0 0 rgba(0,0,0,0.3), inset 0 -1px 0 rgba(0,0,0,0.3);
|
||||
box-shadow: inset 1px 0 0 rgba(0,0,0,0.3), inset 0 1px 0 rgba(0,0,0,0.3), inset -1px 0 0 rgba(0,0,0,0.3), inset 0 -1px 0 rgba(0,0,0,0.3);
|
||||
}
|
||||
aside .list .bubble {
|
||||
background: rgba(0, 0, 0, 0.25);
|
||||
}
|
||||
/* @end */
|
||||
/* @group .bubble */
|
||||
.notification {
|
||||
color: #fff;
|
||||
}
|
||||
.notification .window.confirm {
|
||||
background: #333;
|
||||
}
|
||||
.notification .window.notify {
|
||||
text-shadow: 0 1px 0px rgba(0, 0, 0, 0.1);
|
||||
-webkit-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.2), 0px 1px 2px rgba(0,0,0,0.25);
|
||||
-moz-box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.2), 0px 1px 2px rgba(0,0,0,0.25);
|
||||
box-shadow: inset 0 1px 0 rgba(255,255,255,0.2), inset 0 -1px 0 rgba(0,0,0,0.2), 0px 1px 2px rgba(0,0,0,0.25);
|
||||
}
|
||||
.notification .window.notify.error {
|
||||
background: #e33100;
|
||||
}
|
||||
.notification .window.notify.alert {
|
||||
background: #ffb515;
|
||||
}
|
||||
.notification .window.notify.success {
|
||||
background: #009600;
|
||||
}
|
||||
.notification .window.url .close {
|
||||
background: #000;
|
||||
border: solid 2px #fff;
|
||||
box-shadow: 0 0 4px black;
|
||||
}
|
26
shlr/www/new/quo.js
Normal file
26
shlr/www/new/quo.js
Normal file
@ -0,0 +1,26 @@
|
||||
/* QuoJS 2.2.0 | http://quojs.tapquo.com | Copyright (C) 2011,2012 Javi Jiménez Villar (@soyjavi) */
|
||||
(function(){var a;a=function(){var i,h,b;h=[];b=function(f,n){f=f||h;f.__proto__=b.prototype;f.selector=n||"";return f};i=function(f,n){var p;if(f){p=i.getDOMObject(f,n);if(n)f+=" "+n;return b(p,f)}else return b()};i.extend=function(f){Array.prototype.slice.call(arguments,1).forEach(function(n){var p,s;s=[];for(p in n)s.push(f[p]=n[p]);return s});return f};b.prototype=i.fn={};return i}();window.Quo=a;"$$"in window||(window.$$=a)}).call(this);(function(){(function(a){var i,h,b,f,n,p,s,r;i=[];f=Object.prototype;b=/^\s*<(\w+|!)[^>]*>/;n=document.createElement("table");p=document.createElement("tr");h={tr:document.createElement("tbody"),tbody:n,thead:n,tfoot:n,td:p,th:p,"*":document.createElement("div")};a.toType=function(j){return f.toString.call(j).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};a.isOwnProperty=function(j,m){return f.hasOwnProperty.call(j,m)};a.getDOMObject=function(j,m){var l,d,c;l=null;d=[1,9,11];c=a.toType(j);if(c==="array")l=
|
||||
s(j);else if(c==="string"&&b.test(j)){l=a.fragment(j.trim(),RegExp.$1);j=null}else if(c==="string"){l=a.query(document,j);if(m)l=l.length===1?a.query(l[0],m):a.map(function(){return a.query(l,m)})}else if(d.indexOf(j.nodeType)>=0||j===window){l=[j];j=null}return l};a.map=function(j,m){var l,d,c;c=[];l=void 0;if(a.toType(j)==="array")for(l=0;l<j.length;){d=m(j[l],l);d!=null&&c.push(d);l++}else for(l in j){d=m(j[l],l);d!=null&&c.push(d)}return r(c)};a.each=function(j,m){var l;l=void 0;if(a.toType(j)===
|
||||
"array")for(l=0;l<j.length;){if(m.call(j[l],l,j[l])===false)break;l++}else for(l in j)if(m.call(j[l],l,j[l])===false)break;return j};a.mix=function(){var j,m,l,d,c;l={};j=0;for(d=arguments.length;j<d;){m=arguments[j];for(c in m)if(a.isOwnProperty(m,c)&&m[c]!==undefined)l[c]=m[c];j++}return l};a.fragment=function(j,m){var l;if(m==null)m="*";m in h||(m="*");l=h[m];l.innerHTML=""+j;return a.each(Array.prototype.slice.call(l.childNodes),function(){return l.removeChild(this)})};a.fn.map=function(j){return a.map(this,
|
||||
function(m,l){return j.call(m,l,m)})};a.fn.instance=function(j){return this.map(function(){return this[j]})};a.fn.filter=function(j){return a([].filter.call(this,function(m){return m.parentNode&&a.query(m.parentNode,j).indexOf(m)>=0}))};a.fn.forEach=i.forEach;a.fn.indexOf=i.indexOf;s=function(j){return j.filter(function(m){return m!==void 0&&m!==null})};r=function(j){return j.length>0?[].concat.apply([],j):j}})(Quo)}).call(this);(function(){(function(a){a.fn.attr=function(i,h){return a.toType(i)==="string"&&h===void 0?this[0].getAttribute(i):this.each(function(){return this.setAttribute(i,h)})};a.fn.data=function(i,h){return this.attr("data-"+i,h)};a.fn.val=function(i){return a.toType(i)==="string"?this.each(function(){return this.value=i}):this.length>0?this[0].value:null};a.fn.show=function(){return this.style("display","block")};a.fn.hide=function(){return this.style("display","none")};a.fn.height=function(){return this.offset().height};
|
||||
a.fn.width=function(){return this.offset().width};a.fn.offset=function(){var i;i=this[0].getBoundingClientRect();return{left:i.left+window.pageXOffset,top:i.top+window.pageYOffset,width:i.width,height:i.height}};a.fn.remove=function(){return this.each(function(){if(this.parentNode!=null)return this.parentNode.removeChild(this)})}})(Quo)}).call(this);(function(){(function(a){var i,h,b,f,n,p,s;b=null;i=/WebKit\/([\d.]+)/;h={Android:/(Android)\s+([\d.]+)/,ipad:/(iPad).*OS\s([\d_]+)/,iphone:/(iPhone\sOS)\s([\d_]+)/,blackberry:/(BlackBerry).*Version\/([\d.]+)/,webos:/(webOS|hpwOS)[\s\/]([\d.]+)/};a.isMobile=function(){b=b||n();return b.isMobile};a.environment=function(){return b=b||n()};a.isOnline=function(){return navigator.onLine};n=function(){var r,j;j=navigator.userAgent;r={};r.browser=f(j);r.os=p(j);r.isMobile=!!r.os;r.screen=s();return r};f=
|
||||
function(r){var j;return(j=r.match(i))?j[0]:r};p=function(r){var j,m,l;j=null;for(m in h)if(l=r.match(h[m])){j={name:m==="iphone"||m==="ipad"?"ios":m,version:l[2].replace("_",".")};break}return j};s=function(){return{width:window.innerWidth,height:window.innerHeight}}})(Quo)}).call(this);(function(){(function(a){var i;a.fn.text=function(h){return h||a.toType(h)==="number"?this.each(function(){return this.textContent=h}):this[0].textContent};a.fn.html=function(h){var b;b=a.toType(h);return h||b==="number"||b==="null"?this.each(function(){if(b==="string"||b==="number"||b==="null")return this.innerHTML=h;else{this.innerHTML=null;return this.appendChild(h)}}):this[0].innerHTML};a.fn.append=function(h){return this.each(function(){if(a.toType(h)==="string"){if(h)return this.appendChild(i(h))}else return this.insertBefore(h)})};
|
||||
a.fn.prepend=function(h){return this.each(function(){var b;if(a.toType(h)==="string")return this.innerHTML=h+this.innerHTML;else{b=this.parentNode;return b.insertBefore(h,b.firstChild)}})};a.fn.replaceWith=function(h){return this.each(function(){var b;if(a.toType(h)==="string")h=i(h);(b=this.parentNode)&&b.insertBefore(h,this);return a(this).remove()})};a.fn.empty=function(){return this.each(function(){this.innerHTML=null})};i=function(h){var b;b=document.createElement("div");b.innerHTML=h;return b.firstChild}})(Quo)}).call(this);(function(){(function(a){var i,h;a.query=function(b,f){var n;n=b.querySelectorAll(f);return n=Array.prototype.slice.call(n)};a.fn.find=function(b){var f;f=this.length===1?Quo.query(this[0],b):this.map(function(){return Quo.query(this,b)});return a(f)};a.fn.parent=function(b){var f;f=b?h(this):this.instance("parentNode");return i(f,b)};a.fn.siblings=function(b){var f;f=this.map(function(n,p){return Array.prototype.slice.call(p.parentNode.children).filter(function(s){return s!==p})});return i(f,b)};
|
||||
a.fn.children=function(b){var f;f=this.map(function(){return Array.prototype.slice.call(this.children)});return i(f,b)};a.fn.get=function(b){return b===undefined?this:this[b]};a.fn.first=function(){return a(this[0])};a.fn.last=function(){return a(this[this.length-1])};a.fn.closest=function(b,f){var n,p;p=this[0];n=a(b);for(n.length||(p=null);p&&n.indexOf(p)<0;)p=p!==f&&p!==document&&p.parentNode;return a(p)};a.fn.each=function(b){this.forEach(function(f,n){return b.call(f,n,f)});return this};h=function(b){var f;
|
||||
for(f=[];b.length>0;)b=a.map(b,function(n){if((n=n.parentNode)&&n!==document&&f.indexOf(n)<0){f.push(n);return n}});return f};i=function(b,f){return f===undefined?a(b):a(b).filter(f)}})(Quo)}).call(this);(function(){(function(a){var i,h;a.fn.addClass=function(b){return this.each(function(){if(!h(b,this.className)){this.className+=" "+b;return this.className=this.className.trim()}})};a.fn.removeClass=function(b){return this.each(function(){if(b){if(h(b,this.className))return this.className=this.className.replace(b," ").replace(/\s+/g," ").trim()}else return this.className=""})};a.fn.toggleClass=function(b){return this.each(function(){if(h(b,this.className))return this.className=this.className.replace(b,
|
||||
" ");else{this.className+=" "+b;return this.className=this.className.trim()}})};a.fn.hasClass=function(b){return h(b,this[0].className)};a.fn.style=function(b,f){return f?this.each(function(){return this.style[b]=f}):this[0].style[b]||i(this[0],b)};h=function(b,f){return f.split(/\s+/g).indexOf(b)>=0};i=function(b,f){return document.defaultView.getComputedStyle(b,"")[f]}})(Quo)}).call(this);(function(){(function(a){var i,h,b,f,n,p,s,r,j,m,l;i={TYPE:"GET",MIME:"json"};b={script:"text/javascript, application/javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"};h=0;a.ajaxSettings={type:i.TYPE,async:true,success:{},error:{},context:null,dataType:i.MIME,headers:{},xhr:function(){return new window.XMLHttpRequest},crossDomain:false,timeout:0};a.ajax=function(d){var c,e,k;e=a.mix(a.ajaxSettings,d);if(e.type===i.TYPE)e.url+=a.serializeParameters(e.data,
|
||||
"?");else e.data=a.serializeParameters(e.data);if(f(e.url))return a.jsonp(e);k=e.xhr();k.onreadystatechange=function(){if(k.readyState===4){clearTimeout(c);return j(k,e)}};k.open(e.type,e.url,e.async);r(k,e);if(e.timeout>0)c=setTimeout(function(){return l(k,e)},e.timeout);try{k.send(e.data)}catch(q){k=q;p("Resource not found",k,e)}return e.async?k:n(k,e)};a.jsonp=function(d){var c,e,k,q;if(d.async){e="jsonp"+ ++h;k=document.createElement("script");q={abort:function(){a(k).remove();if(e in window)return window[e]=
|
||||
{}}};c=void 0;window[e]=function(v){clearTimeout(c);a(k).remove();delete window[e];return m(v,q,d)};k.src=d.url.replace(/=\?/,"="+e);a("head").append(k);if(d.timeout>0)c=setTimeout(function(){return l(q,d)},d.timeout);return q}else return console.error("QuoJS.ajax: Unable to make jsonp synchronous call.")};a.get=function(d,c,e,k){return a.ajax({url:d,data:c,success:e,dataType:k})};a.post=function(d,c,e,k){return s("POST",d,c,e,k)};a.put=function(d,c,e,k){return s("PUT",d,c,e,k)};a["delete"]=function(d,
|
||||
c,e,k){return s("DELETE",d,c,e,k)};a.json=function(d,c,e){return a.ajax({url:d,data:c,success:e,dataType:i.MIME})};a.serializeParameters=function(d,c){var e,k;if(c==null)c="";k=c;for(e in d)if(d.hasOwnProperty(e)){if(k!==c)k+="&";k+=e+"="+d[e]}return k===c?"":k};j=function(d,c){if(d.status>=200&&d.status<300||d.status===0)c.async&&m(n(d,c),d,c);else p("QuoJS.ajax: Unsuccesful request",d,c)};m=function(d,c,e){e.success.call(e.context,d,c)};p=function(d,c,e){e.error.call(e.context,d,c,e)};r=function(d,
|
||||
c){var e;if(c.contentType)c.headers["Content-Type"]=c.contentType;if(c.dataType)c.headers.Accept=b[c.dataType];for(e in c.headers)d.setRequestHeader(e,c.headers[e])};l=function(d,c){d.onreadystatechange={};d.abort();p("QuoJS.ajax: Timeout exceeded",d,c)};s=function(d,c,e,k,q){return a.ajax({type:d,url:c,data:e,success:k,dataType:q,contentType:"application/x-www-form-urlencoded"})};n=function(d,c){var e;if(e=d.responseText)if(c.dataType===i.MIME)try{e=JSON.parse(e)}catch(k){e=k;p("QuoJS.ajax: Parse Error",
|
||||
d,c)}else if(c.dataType==="xml")e=d.responseXML;return e};f=function(d){return/=\?/.test(d)}})(Quo)}).call(this);(function(){(function(a){var i,h;i=/complete|loaded|interactive/;h={touch:"touchstart",tap:"tap"};["touch","tap"].forEach(function(b){a.fn[b]=function(f){return a(document.body).delegate(this.selector,h[b],f)};return this});a.fn.on=function(b,f,n){return f===undefined||a.toType(f)==="function"?this.bind(b,f):this.delegate(f,b,n)};a.fn.off=function(b,f,n){return f===undefined||a.toType(f)==="function"?this.unbind(b,f):this.undelegate(f,b,n)};a.fn.ready=function(b){i.test(document.readyState)?b(a):
|
||||
a.fn.addEvent(document,"DOMContentLoaded",function(){return b(a)});return this}})(Quo)}).call(this);(function(){(function(a){var i,h,b,f,n,p,s,r,j,m,l;i=1;f={};b={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};h={touchstart:"mousedown",touchmove:"mousemove",touchend:"mouseup",tap:"click",doubletap:"dblclick",orientationchange:"resize"};a.Event=function(d,c){var e,k;e=document.createEvent("Events");e.initEvent(d,true,true,null,null,null,null,null,null,null,null,null,null,null,null);if(c)for(k in c)e[k]=c[k];return e};
|
||||
a.fn.bind=function(d,c){return this.each(function(){m(this,d,c)})};a.fn.unbind=function(d,c){return this.each(function(){l(this,d,c)})};a.fn.delegate=function(d,c,e){return this.each(function(k,q){m(q,c,e,d,function(v){return function(y){var x,u;if(u=a(y.target).closest(d,q).get(0)){x=a.extend(n(y),{currentTarget:u,liveFired:q});return v.apply(u,[x].concat([].slice.call(arguments,1)))}}})})};a.fn.undelegate=function(d,c,e){return this.each(function(){l(this,c,e,d)})};a.fn.trigger=function(d,c){if(a.toType(d)===
|
||||
"string")d=a.Event(d,c);return this.each(function(){this.dispatchEvent(d)})};a.fn.addEvent=function(d,c,e){return d.addEventListener?d.addEventListener(c,e,false):d.attachEvent?d.attachEvent("on"+c,e):d["on"+c]=e};a.fn.removeEvent=function(d,c,e){return d.removeEventListener?d.removeEventListener(c,e,false):d.detachEvent?d.detachEvent("on"+c,e):d["on"+c]=null};m=function(d,c,e,k,q){var v;c=s(c);v=j(d);v=f[v]||(f[v]=[]);q=q&&q(e,c);c={event:c,callback:e,selector:k,proxy:p(q,e,d),delegate:q,index:v.length};
|
||||
v.push(c);return a.fn.addEvent(d,c.event,c.proxy)};l=function(d,c,e,k){var q;c=s(c);q=j(d);return r(q,c,e,k).forEach(function(v){delete f[q][v.index];return a.fn.removeEvent(d,v.event,v.proxy)})};j=function(d){return d._id||(d._id=i++)};s=function(d){return(a.isMobile()?d:h[d])||d};p=function(d,c,e){c=d||c;return function(k){var q;q=c.apply(e,[k].concat(k.data));q===false&&k.preventDefault();return q}};r=function(d,c,e,k){return(f[d]||[]).filter(function(q){return q&&(!c||q.event===c)&&(!e||q.fn===
|
||||
e)&&(!k||q.selector===k)})};n=function(d){var c;c=a.extend({originalEvent:d},d);a.each(b,function(e,k){c[e]=function(){this[k]=function(){return true};return d[e].apply(d,arguments)};return c[k]=function(){return false}});return c}})(Quo)}).call(this);(function(){(function(a){var i,h,b,f,n,p,s,r,j,m,l,d,c,e,k,q,v,y,x,u;b={};h=[];i=[];f=void 0;["doubleTap","hold","swipe","swiping","swipeLeft","swipeRight","swipeUp","swipeDown","rotate","rotating","rotateLeft","rotateRight","pinch","pinching","pinchIn","pinchOut","drag","dragLeft","dragRight","dragUp","dragDown"].forEach(function(g){a.fn[g]=function(o){return this.on(g,o)}});a(document).ready(function(){return e()});e=function(){var g;g=a(document.body);g.bind("touchstart",v);g.bind("touchmove",
|
||||
q);g.bind("touchend",k);return g.bind("touchcancel",r)};v=function(g){var o,t,w;t=Date.now();o=t-(b.last||t);f&&clearTimeout(f);w=l(g);g=w.length;h=m(w,g);b.el=a(y(w[0].target));b.fingers=g;b.last=t;if(g===1){b.isDoubleTap=o>0&&o<=250;return setTimeout(d,650)}else if(g===2){b.initial_angle=parseInt(n(h),10);b.initial_distance=parseInt(j(h),10);b.angle_difference=0;return b.distance_difference=0}};q=function(g){var o,t;if(b.el){t=l(g);o=t.length;if(o===b.fingers){i=m(t,o);c(g)&&u("swiping");if(o===
|
||||
2){s();p();g.preventDefault()}}else r()}return true};c=function(){var g,o;g=false;if(i[0]){g=Math.abs(h[0].x-i[0].x)>30;o=Math.abs(h[0].y-i[0].y)>30;g=b.el&&(g||o)}return g};k=function(){var g;if(b.isDoubleTap){u("doubleTap");return r()}else if(b.fingers===1)if(c()){u("swipe");g=x(h[0].x,i[0].x,h[0].y,i[0].y);u("swipe"+g);return r()}else{u("tap");return f=setTimeout(r,250)}else if(b.fingers===2){g=false;if(b.angle_difference!==0){u("rotate",{angle:b.angle_difference});g=b.angle_difference>0?"rotateRight":
|
||||
"rotateLeft";u(g,{angle:b.angle_difference});g=true}if(b.distance_difference!==0){u("pinch",{angle:b.distance_difference});g=b.distance_difference>0?"pinchOut":"pinchIn";u(g,{distance:b.distance_difference});g=true}if(!g&&i[0])if(Math.abs(h[0].x-i[0].x)>10||Math.abs(h[0].y-i[0].y)>10){u("drag");g=x(h[0].x,i[0].x,h[0].y,i[0].y);u("drag"+g)}return r()}};m=function(g,o){var t,w;w=[];for(t=0;t<o;){w.push({x:g[t].pageX,y:g[t].pageY});t++}return w};s=function(){var g,o,t;g=parseInt(n(i),10);g=parseInt(b.initial_angle-
|
||||
g,10);if(Math.abs(g)>20||b.angle_difference!==0){o=0;for(t=b.angle_difference<0?"-":"+";Math.abs(g-b.angle_difference)>90&&o++<10;)eval("diff "+t+"= 180;");b.angle_difference=parseInt(g,10);return u("rotating",{angle:b.angle_difference})}};p=function(){var g;g=parseInt(j(i),10);g=b.initial_distance-g;if(Math.abs(g)>10){b.distance_difference=g;return u("pinching",{distance:g})}};u=function(g,o){if(b.el){o=o||{};if(i[0]){o.iniTouch=b.fingers>1?h:h[0];o.currentTouch=b.fingers>1?i:i[0]}return b.el.trigger(g,
|
||||
o)}};r=function(){h=[];i=[];b={};return clearTimeout(f)};n=function(g){var o;o=g[0];g=g[1];o=Math.atan((g.y-o.y)*-1/(g.x-o.x))*(180/Math.PI);return o<0?o+180:o};j=function(g){var o;o=g[0];g=g[1];return Math.sqrt((g.x-o.x)*(g.x-o.x)+(g.y-o.y)*(g.y-o.y))*-1};l=function(g){return a.isMobile()?g.touches:[g]};y=function(g){return"tagName"in g?g:g.parentNode};x=function(g,o,t,w){return Math.abs(g-o)>=Math.abs(t-w)?g-o>0?"Left":"Right":t-w>0?"Up":"Down"};d=function(){if(b.last&&Date.now()-b.last>=650)return u("hold")}})(Quo)}).call(this);
|
14
shlr/www/new/style.css
Normal file
14
shlr/www/new/style.css
Normal file
@ -0,0 +1,14 @@
|
||||
.code {
|
||||
padding-left:10px;
|
||||
font-family:monospace;
|
||||
font-size:14px;
|
||||
}
|
||||
|
||||
.comment {
|
||||
background-color:#c0c0ff !important;
|
||||
color:blue;
|
||||
padding-left:10px;
|
||||
font-family:monospace;
|
||||
font-size:14px;
|
||||
white-space: pre-wrap;
|
||||
}
|
273
shlr/www/new/window.js
Normal file
273
shlr/www/new/window.js
Normal file
@ -0,0 +1,273 @@
|
||||
/* http://www.switchonthecode.com/tutorials/javascript-draggable-elements */
|
||||
function hookEvent(element, eventName, callback)
|
||||
{
|
||||
if(typeof(element) == "string")
|
||||
element = document.getElementById(element);
|
||||
if(element == null)
|
||||
return;
|
||||
if(element.addEventListener)
|
||||
{
|
||||
element.addEventListener(eventName, callback, false);
|
||||
}
|
||||
else if(element.attachEvent)
|
||||
element.attachEvent("on" + eventName, callback);
|
||||
}
|
||||
|
||||
function unhookEvent(element, eventName, callback)
|
||||
{
|
||||
if(typeof(element) == "string")
|
||||
element = document.getElementById(element);
|
||||
if(element == null)
|
||||
return;
|
||||
if(element.removeEventListener)
|
||||
element.removeEventListener(eventName, callback, false);
|
||||
else if(element.detachEvent)
|
||||
element.detachEvent("on" + eventName, callback);
|
||||
}
|
||||
|
||||
function cancelEvent(e)
|
||||
{
|
||||
e = e ? e : window.event;
|
||||
if(e.stopPropagation)
|
||||
e.stopPropagation();
|
||||
if(e.preventDefault)
|
||||
e.preventDefault();
|
||||
e.cancelBubble = true;
|
||||
e.cancel = true;
|
||||
e.returnValue = false;
|
||||
return false;
|
||||
}
|
||||
|
||||
function Position(x, y)
|
||||
{
|
||||
this.X = x;
|
||||
this.Y = y;
|
||||
|
||||
this.Add = function(val)
|
||||
{
|
||||
var newPos = new Position(this.X, this.Y);
|
||||
if(val != null)
|
||||
{
|
||||
if(!isNaN(val.X))
|
||||
newPos.X += val.X;
|
||||
if(!isNaN(val.Y))
|
||||
newPos.Y += val.Y
|
||||
}
|
||||
return newPos;
|
||||
}
|
||||
|
||||
this.Subtract = function(val)
|
||||
{
|
||||
var newPos = new Position(this.X, this.Y);
|
||||
if(val != null)
|
||||
{
|
||||
if(!isNaN(val.X))
|
||||
newPos.X -= val.X;
|
||||
if(!isNaN(val.Y))
|
||||
newPos.Y -= val.Y
|
||||
}
|
||||
return newPos;
|
||||
}
|
||||
|
||||
this.Min = function(val)
|
||||
{
|
||||
var newPos = new Position(this.X, this.Y)
|
||||
if(val == null)
|
||||
return newPos;
|
||||
|
||||
if(!isNaN(val.X) && this.X > val.X)
|
||||
newPos.X = val.X;
|
||||
if(!isNaN(val.Y) && this.Y > val.Y)
|
||||
newPos.Y = val.Y;
|
||||
|
||||
return newPos;
|
||||
}
|
||||
|
||||
this.Max = function(val)
|
||||
{
|
||||
var newPos = new Position(this.X, this.Y)
|
||||
if(val == null)
|
||||
return newPos;
|
||||
|
||||
if(!isNaN(val.X) && this.X < val.X)
|
||||
newPos.X = val.X;
|
||||
if(!isNaN(val.Y) && this.Y < val.Y)
|
||||
newPos.Y = val.Y;
|
||||
|
||||
return newPos;
|
||||
}
|
||||
|
||||
this.Bound = function(lower, upper)
|
||||
{
|
||||
var newPos = this.Max(lower);
|
||||
return newPos.Min(upper);
|
||||
}
|
||||
|
||||
this.Check = function()
|
||||
{
|
||||
var newPos = new Position(this.X, this.Y);
|
||||
if(isNaN(newPos.X))
|
||||
newPos.X = 0;
|
||||
if(isNaN(newPos.Y))
|
||||
newPos.Y = 0;
|
||||
return newPos;
|
||||
}
|
||||
|
||||
this.Apply = function(element)
|
||||
{
|
||||
if(typeof(element) == "string")
|
||||
element = document.getElementById(element);
|
||||
if(element == null)
|
||||
return;
|
||||
if(!isNaN(this.X))
|
||||
element.style.left = this.X + 'px';
|
||||
if(!isNaN(this.Y))
|
||||
element.style.top = this.Y + 'px';
|
||||
}
|
||||
}
|
||||
|
||||
function absoluteCursorPostion(eventObj)
|
||||
{
|
||||
eventObj = eventObj ? eventObj : window.event;
|
||||
|
||||
if(isNaN(window.scrollX))
|
||||
return new Position(eventObj.clientX + document.documentElement.scrollLeft + document.body.scrollLeft,
|
||||
eventObj.clientY + document.documentElement.scrollTop + document.body.scrollTop);
|
||||
else
|
||||
return new Position(eventObj.clientX + window.scrollX, eventObj.clientY + window.scrollY);
|
||||
}
|
||||
|
||||
function dragObject(element, attachElement, lowerBound, upperBound, startCallback, moveCallback, endCallback, attachLater)
|
||||
{
|
||||
if(typeof(element) == "string")
|
||||
element = document.getElementById(element);
|
||||
if(element == null)
|
||||
return;
|
||||
|
||||
if(lowerBound != null && upperBound != null)
|
||||
{
|
||||
var temp = lowerBound.Min(upperBound);
|
||||
upperBound = lowerBound.Max(upperBound);
|
||||
lowerBound = temp;
|
||||
}
|
||||
|
||||
var cursorStartPos = null;
|
||||
var elementStartPos = null;
|
||||
var dragging = false;
|
||||
var listening = false;
|
||||
var disposed = false;
|
||||
|
||||
function touch2move (x) {
|
||||
var ev = {}
|
||||
ev.target = x.target;
|
||||
ev.clientX = x.targetTouches[0].pageX;
|
||||
ev.clientY = x.targetTouches[0].pageY;
|
||||
return ev;
|
||||
}
|
||||
function dragTouchStart(eventObj) {
|
||||
if (x.touches.length >1) return;
|
||||
dragStart(touch2move (x));
|
||||
}
|
||||
function dragTouchGo(eventObj) {
|
||||
if (x.touches.length >1) return;
|
||||
dragGo(touch2move (x));
|
||||
}
|
||||
|
||||
function dragStart(eventObj)
|
||||
{
|
||||
if(dragging || !listening || disposed) return;
|
||||
dragging = true;
|
||||
|
||||
if(startCallback != null)
|
||||
startCallback(eventObj, element);
|
||||
|
||||
cursorStartPos = absoluteCursorPostion(eventObj);
|
||||
|
||||
elementStartPos = new Position(parseInt(element.style.left), parseInt(element.style.top));
|
||||
|
||||
elementStartPos = elementStartPos.Check();
|
||||
|
||||
hookEvent(document, "mousemove", dragGo);
|
||||
hookEvent(document, "touchmove", dragTouchGo);
|
||||
hookEvent(document, "mouseup", dragStopHook);
|
||||
|
||||
return cancelEvent(eventObj);
|
||||
}
|
||||
|
||||
function dragGo(eventObj)
|
||||
{
|
||||
if(!dragging || disposed) return;
|
||||
|
||||
var newPos = absoluteCursorPostion(eventObj);
|
||||
newPos = newPos.Add(elementStartPos).Subtract(cursorStartPos);
|
||||
newPos = newPos.Bound(lowerBound, upperBound)
|
||||
newPos.Apply(element);
|
||||
if(moveCallback != null)
|
||||
moveCallback(newPos, element);
|
||||
|
||||
return cancelEvent(eventObj);
|
||||
}
|
||||
|
||||
function dragStopHook(eventObj)
|
||||
{
|
||||
dragStop();
|
||||
return cancelEvent(eventObj);
|
||||
}
|
||||
|
||||
function dragStop()
|
||||
{
|
||||
if(!dragging || disposed) return;
|
||||
unhookEvent(document, "mousemove", dragGo);
|
||||
unhookEvent(document, "mouseup", dragStopHook);
|
||||
cursorStartPos = null;
|
||||
elementStartPos = null;
|
||||
if(endCallback != null)
|
||||
endCallback(element);
|
||||
dragging = false;
|
||||
}
|
||||
|
||||
this.Dispose = function()
|
||||
{
|
||||
if(disposed) return;
|
||||
this.StopListening(true);
|
||||
element = null;
|
||||
attachElement = null
|
||||
lowerBound = null;
|
||||
upperBound = null;
|
||||
startCallback = null;
|
||||
moveCallback = null
|
||||
endCallback = null;
|
||||
disposed = true;
|
||||
}
|
||||
|
||||
this.StartListening = function()
|
||||
{
|
||||
if(listening || disposed) return;
|
||||
listening = true;
|
||||
hookEvent(attachElement, "mousedown", dragStart);
|
||||
hookEvent(attachElement, "touchstart", dragTouchStart);
|
||||
}
|
||||
|
||||
this.StopListening = function(stopCurrentDragging)
|
||||
{
|
||||
if(!listening || disposed) return;
|
||||
unhookEvent(attachElement, "mousedown", dragStart);
|
||||
unhookEvent(attachElement, "touchend", dragStart);
|
||||
listening = false;
|
||||
|
||||
if(stopCurrentDragging && dragging)
|
||||
dragStop();
|
||||
}
|
||||
|
||||
this.IsDragging = function(){ return dragging; }
|
||||
this.IsListening = function() { return listening; }
|
||||
this.IsDisposed = function() { return disposed; }
|
||||
|
||||
if(typeof(attachElement) == "string")
|
||||
attachElement = document.getElementById(attachElement);
|
||||
if(attachElement == null)
|
||||
attachElement = element;
|
||||
|
||||
if(!attachLater)
|
||||
this.StartListening();
|
||||
}
|
Loading…
Reference in New Issue
Block a user