App-sitelenmute
view release on metacpan or search on metacpan
share/view/index.js view on Meta::CPAN
var econt; // picture container
var ebuff; // picture buffer
var oimg; // old image
var eimg; // new image
var cthumb; // current thumbnail
var mthumb; // thumbnail measurement cache
var eidx; // current index
var tthr; // throbber timeout
var imgs; // image list
var first; // first image
var idle; // general idle timer
var idleMouse; // idle mouse timer
var clayout; // current layout
var csr; // current scaling ratio
var sdir; // scrolling direction
var slideshow; // slideshow status
Element.Events.hashchange =
{
onAdd: function()
{
var hash = window.location.hash;
share/view/mootools-core-1.4.js view on Meta::CPAN
return this;}});Fx.implement({getTransition:function(){var a=this.options.transition||Fx.Transitions.Sine.easeInOut;if(typeof a=="string"){var b=a.split(":");
a=Fx.Transitions;a=a[b[0]]||a[b[0].capitalize()];if(b[1]){a=a["ease"+b[1].capitalize()+(b[2]?b[2].capitalize():"")];}}return a;}});Fx.Transition=function(c,b){b=Array.from(b);
var a=function(d){return c(d,b);};return Object.append(a,{easeIn:a,easeOut:function(d){return 1-c(1-d,b);},easeInOut:function(d){return(d<=0.5?c(2*d,b):(2-c(2*(1-d),b)))/2;
}});};Fx.Transitions={linear:function(a){return a;}};Fx.Transitions.extend=function(a){for(var b in a){Fx.Transitions[b]=new Fx.Transition(a[b]);}};Fx.Transitions.extend({Pow:function(b,a){return Math.pow(b,a&&a[0]||6);
},Expo:function(a){return Math.pow(2,8*(a-1));},Circ:function(a){return 1-Math.sin(Math.acos(a));},Sine:function(a){return 1-Math.cos(a*Math.PI/2);},Back:function(b,a){a=a&&a[0]||1.618;
return Math.pow(b,2)*((a+1)*b-a);},Bounce:function(f){var e;for(var d=0,c=1;1;d+=c,c/=2){if(f>=(7-4*d)/11){e=c*c-Math.pow((11-6*d-11*f)/4,2);break;}}return e;
},Elastic:function(b,a){return Math.pow(2,10*--b)*Math.cos(20*b*Math.PI*(a&&a[0]||1)/3);}});["Quad","Cubic","Quart","Quint"].each(function(b,a){Fx.Transitions[b]=new Fx.Transition(function(c){return Math.pow(c,a+2);
});});(function(){var d=function(){},a=("onprogress" in new Browser.Request);var c=this.Request=new Class({Implements:[Chain,Events,Options],options:{url:"",data:"",headers:{"X-Requested-With":"XMLHttpRequest",Accept:"text/javascript, text/html, appl...
this.setOptions(e);this.headers=this.options.headers;},onStateChange:function(){var e=this.xhr;if(e.readyState!=4||!this.running){return;}this.running=false;
this.status=0;Function.attempt(function(){var f=e.status;this.status=(f==1223)?204:f;}.bind(this));e.onreadystatechange=d;if(a){e.onprogress=e.onloadstart=d;
}clearTimeout(this.timer);this.response={text:this.xhr.responseText||"",xml:this.xhr.responseXML};if(this.options.isSuccess.call(this,this.status)){this.success(this.response.text,this.response.xml);
}else{this.failure();}},isSuccess:function(){var e=this.status;return(e>=200&&e<300);},isRunning:function(){return !!this.running;},processScripts:function(e){if(this.options.evalResponse||(/(ecma|java)script/).test(this.getHeader("Content-type"))){r...
}return e.stripScripts(this.options.evalScripts);},success:function(f,e){this.onSuccess(this.processScripts(f),e);},onSuccess:function(){this.fireEvent("complete",arguments).fireEvent("success",arguments).callChain();
},failure:function(){this.onFailure();},onFailure:function(){this.fireEvent("complete").fireEvent("failure",this.xhr);},loadstart:function(e){this.fireEvent("loadstart",[e,this.xhr]);
},progress:function(e){this.fireEvent("progress",[e,this.xhr]);},timeout:function(){this.fireEvent("timeout",this.xhr);},setHeader:function(e,f){this.headers[e]=f;
return this;},getHeader:function(e){return Function.attempt(function(){return this.xhr.getResponseHeader(e);}.bind(this));},check:function(){if(!this.running){return true;
}switch(this.options.link){case"cancel":this.cancel();return true;case"chain":this.chain(this.caller.pass(arguments,this));return false;}return false;},send:function(o){if(!this.check(o)){return this;
}this.options.isSuccess=this.options.isSuccess||this.isSuccess;this.running=true;var l=typeOf(o);if(l=="string"||l=="element"){o={data:o};}var h=this.options;
o=Object.append({data:h.data,url:h.url,method:h.method},o);var j=o.data,f=String(o.url),e=o.method.toLowerCase();switch(typeOf(j)){case"element":j=document.id(j).toQueryString();
break;case"object":case"hash":j=Object.toQueryString(j);}if(this.options.format){var m="format="+this.options.format;j=(j)?m+"&"+j:m;}if(this.options.emulation&&!["get","post"].contains(e)){var k="_method="+e;
j=(j)?k+"&"+j:k;e="post";}if(this.options.urlEncoded&&["post","put"].contains(e)){var g=(this.options.encoding)?"; charset="+this.options.encoding:"";this.headers["Content-type"]="application/x-www-form-urlencoded"+g;
}if(!f){f=document.location.pathname;}var i=f.lastIndexOf("/");if(i>-1&&(i=f.indexOf("#"))>-1){f=f.substr(0,i);}if(this.options.noCache){f+=(f.contains("?")?"&":"?")+String.uniqueID();
}if(j&&e=="get"){f+=(f.contains("?")?"&":"?")+j;j=null;}var n=this.xhr;if(a){n.onloadstart=this.loadstart.bind(this);n.onprogress=this.progress.bind(this);
}n.open(e.toUpperCase(),f,this.options.async,this.options.user,this.options.password);if(this.options.user&&"withCredentials" in n){n.withCredentials=true;
}n.onreadystatechange=this.onStateChange.bind(this);Object.each(this.headers,function(q,p){try{n.setRequestHeader(p,q);}catch(r){this.fireEvent("exception",[p,q]);
}},this);this.fireEvent("request");n.send(j);if(!this.options.async){this.onStateChange();}else{if(this.options.timeout){this.timer=this.timeout.delay(this.options.timeout,this);
}}return this;},cancel:function(){if(!this.running){return this;}this.running=false;var e=this.xhr;e.abort();clearTimeout(this.timer);e.onreadystatechange=d;
if(a){e.onprogress=e.onloadstart=d;}this.xhr=new Browser.Request();this.fireEvent("cancel");return this;}});var b={};["get","post","put","delete","GET","POST","PUT","DELETE"].each(function(e){b[e]=function(g){var f={method:e};
if(g!=null){f.data=g;}return this.send(f);};});c.implement(b);Element.Properties.send={set:function(e){var f=this.get("send").cancel();f.setOptions(e);
return this;},get:function(){var e=this.retrieve("send");if(!e){e=new c({data:this,link:"cancel",method:this.get("method")||"post",url:this.get("action")});
this.store("send",e);}return e;}};Element.implement({send:function(e){var f=this.get("send");f.send({data:this,url:e||f.options.url});return this;}});})();
Request.HTML=new Class({Extends:Request,options:{update:false,append:false,evalScripts:true,filter:false,headers:{Accept:"text/html, application/xml, text/xml, */*"}},success:function(f){var e=this.options,c=this.response;
c.html=f.stripScripts(function(h){c.javascript=h;});var d=c.html.match(/<body[^>]*>([\s\S]*?)<\/body>/i);if(d){c.html=d[1];}var b=new Element("div").set("html",c.html);
c.tree=b.childNodes;c.elements=b.getElements(e.filter||"*");if(e.filter){c.tree=c.elements;}if(e.update){var g=document.id(e.update).empty();if(e.filter){g.adopt(c.elements);
}else{g.set("html",c.html);}}else{if(e.append){var a=document.id(e.append);if(e.filter){c.elements.reverse().inject(a);}else{a.adopt(b.getChildren());}}}if(e.evalScripts){Browser.exec(c.javascript);
}this.onSuccess(c.tree,c.elements,c.html,c.javascript);}});Element.Properties.load={set:function(a){var b=this.get("load").cancel();b.setOptions(a);return this;
},get:function(){var a=this.retrieve("load");if(!a){a=new Request.HTML({data:this,link:"cancel",update:this,method:"get"});this.store("load",a);}return a;
share/view/mootools-idle.js view on Meta::CPAN
requires:
core/1.2.4:
- Class.Extras
- Element.Event
provides:
- IdleTimer
inspiration:
- Inspired by Nicholas C. Zakas' Idle Timer (http://yuilibrary.com/gallery/show/idletimer) Copyright (c) 2009 Nicholas C. Zakas, [YUI BSD](http://developer.yahoo.com/yui/license.html)
- Also inspired by Paul Irish's jQuery idleTimer (http://paulirish.com/2009/jquery-idletimer-plugin/) Copyright (c) 2009 Paul Irish, [MIT License](http://opensource.org/licenses/mit-license.php)
...
*/
IdleTimer = new Class({
Implements: [Events, Options],
options: {
/*
onStart: function(){},
share/view/mootools-idle.js view on Meta::CPAN
this.activeBound = this.active.bind(this);
this.isIdle = false;
this.started = false;
this.lastPos = false;
},
/**
* Stops any existing timeouts and removes the bound events
*/
stop: function() {
clearTimeout(this.timer);
// Remove bound events
for(var i = 0; i < this.options.events.length; i++) {
this.element.removeEvent(this.options.events[i], this.activeBound);
}
this.bound = false;
this.started = false;
this.lastPos = false;
this.fireEvent('stop');
return this;
share/view/mootools-idle.js view on Meta::CPAN
if(e.event.type == 'mousemove')
{
// Fix https://code.google.com/p/chromium/issues/detail?id=103041
var pos = [e.event.clientX, e.event.clientY];
if(this.lastPos === false ||
(this.lastPos[0] != pos[0] && this.lastPos[1] != pos[1]))
this.lastPos = pos;
else
return;
}
clearTimeout(this.timer);
if(this.isIdle) this.fireEvent('active');
this.isIdle = false;
this.start();
},
/**
* Fired when the user becomes idle
*/
idle: function() {
if(this.timer) clearTimeout(this.timer); // If called manually, timer will have to be removed
this.isIdle = true;
this.fireEvent('idle');
},
/**
* Starts the timer which eventually will reach idle() if the user is inactive
*/
start: function() {
if(this.timer) clearTimeout(this.timer); // If called twice, timer will have to be removed
this.timer = this.idle.delay(this.options.timeout, this);
this.lastActive = Date.now();
if(!this.bound) this.bind();
this.started = true;
return this;
},
/**
* Bind events to the element
*/
bind: function() {
share/view/mootools-idle.js view on Meta::CPAN
* Will also attempt to fix any difference in the old and new timeout values,
* unless you pass true as whenActive - in this case the new timeout will be
* in play the next time the user is active again.
*/
setTimeout: function(newTime, whenActive) {
var old = this.options.timeout;
this.options.timeout = newTime;
if(whenActive) return this; // The developer wants to wait until the next time the user is active before setting the new timeout
// In all cases, we need a new timer
clearTimeout(this.timer);
// Fire a new timeout event
this.fireEvent('timeoutChanged', newTime);
// How much time has ellapsed since we were last active?
var elapsed = this.getIdleTime();
if(elapsed < newTime && this.isIdle) {
// Set as active, cause the new "idle" time has not been reached
this.fireEvent('active');
this.isIdle = false;
} else if(elapsed >= newTime) {
// We've not reached the limit before, but with the new timeout, we now have.
this.idle();
return this;
}
// Set new timer
this.timer = this.idle.delay(newTime - elapsed, this);
return this;
}
});
Element.Properties.idle = {
set: function(options) {
var idle = this.retrieve('idle');
if (idle) idle.stop();
( run in 1.177 second using v1.01-cache-2.11-cpan-49f99fa48dc )