1 |
- function Mantis(){}Mantis.info={};var _HasOwnProperty={}.hasOwnProperty,_EmptyArray=[],_EmptyFn=function(){},_RE={objType:/\s([a-z|A-Z]+)/,isTag:/\s([a-z|A-Z]+)/,replace2s:/(\s|,){2,}/g,fnName:/function\s+([^\(]+)/i,paramUrl:/=(https?:\/\/[^&]+)/g,domain:/(\w+):\/\/([\w\.-]+)/,pic:/\.(jpg|png|jpeg|gif)/i};String.prototype.matchOf=function(e,t){var n=this.match(e);if(n){return n[t>=0?t:n.length+t]}return false};Function.prototype.fnName=function(){return this.name||this.toString().matchOf(_RE.fnName,1)||md5(this.toString())};Math.angle=function(e,t){if(e.length&&p.length==2)t=e[1],e=e[0];var n=Math.atan((t.y-e.y)*-1/(t.x-e.x))*(180/Math.PI)>>0;return n<0?n+180:n};Math.distance=function(e,t){if(e.length&&p.length==2)t=e[1],e=e[0];return Math.abs(Math.sqrt(Math.pow(t.x-e.x,2)+Math.pow(t.y-e.y,2)))>>0};function isType(e,t){var n=Object.prototype.toString.call(e).matchOf(_RE.objType,1).toLowerCase();if(n=="object"){if(JSON.stringify(e).substr(0,1)=="{")n="json"}else if(n.indexOf("element")!=-1){n="node"}return t?n==t:n}function isset(e){return typeof e!="undefined"}function toJSON(e){if(typeof e=="string"){try{return JSON.parse(e.replace(/`/g,'"'))}catch(t){return e}}return e}function toStr(e){var t=isType(e);if(t=="array"||t=="json"){return JSON.stringify(e)}else if(t=="string"||t=="number"){return e}return""}function toXML(e){return(new DOMParser).parseFromString(e,"text/xml")}function toFn(fn){if(fn){if(typeof fn=="function")return fn;if(typeof fn=="string"){if(/[^\w_]/.test(fn)){try{eval("fn = function(){"+fn+"}");return fn}catch(e){}}else if(window[fn]&&typeof window[fn]=="function")return window[fn]}}return false}function clone(e){var t=isType(e);if(t=="array"){return e.slice()}else if(t=="json"){var n={};for(var r in e){et[r]=typeof e[r]=="object"?clone(e[r]):e[r]}return n}return e}function keys(e){if(Object.keys)return Object.keys(e);var t=[];for(var n in e){t.push(n)}return t}function uniq(e){return e.filter(function(e,t,n){return n.indexOf(e)==t})}function extend(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];if(r&&typeof r=="object")for(var i in r){e[i]=r[i]}}return e}function concat(e){for(var t=1,n=arguments.length;t<n;t++){var r=arguments[t];for(var t in r){if(!isset(e[key]))e[key]=r[key]}}return e}function slice(e,t,n){return Array.prototype.slice.call(e,t,n)}var $$=function(e){e.URIInfo=function(e,t){var n={href:e,param:"",port:"http://",domain:"",file:"",path:""};e=e.split("?");if(e.length>1)n.param=e[1];e=e[0];if(e.indexOf("://")!=-1){e=e.replace(_RE.domain,function(e,t,r){return n.port=t,n.domain=r,""})}e=e.trim("/").split("/");if(e[e.length-1].indexOf(".")!=-1){n.file=e.pop()}n.path=e.join("/");return t?n[t]:n};e.URLGet=function(e,t){t=decodeURIComponent((t?"?"+(t.indexOf("?")>=0?t.split("?")[1]:t):null)||window.location.search);if("string"==typeof e)return is.match(e+"=([^&]+)&?",t,1);if(t.length>3){for(var n,r={},i=t.replace(/\s/g,"").substr(1).split("&"),o=0;i.length>o;o++)n=i[o].split("="),n[1]&&(r[n[0]]=n[1]);return r}return""};e.arr2div=function(t){var n="",r,i="div",o;if(typeof t=="string"){t=toJSON(t.replace(/'/g,"`").replace(/"/g,"'").replace(e.arr2div.re[0],'$1"$2",').replace(e.arr2div.re[1],"]").replace(_RE.replace2s,"$1"))}for(var a=0,s=t.length;a<s;a++){r=t[a];if(typeof r=="string"){i="div",o="";r=r.replace(/'/g,'"').replace(/\`/g,"'").replace(e.arr2div.re[2],function(e){i=e;return""}).replace(e.arr2div.re[3],function(e,t,n){switch(t){case"#":return' id="'+n+'"';case".":return' class="'+n+'"';case":":o=n;return""}}).replace(_RE.replace2s," ");n+="<"+i+r+">"+o+(typeof t[a+1]=="object"?e.arr2div(t[++a]):"")+"</"+i+">"}else{n+="<div>"+e.arr2div(r)+"</div>"}}return n};e.arr2div.re=[/(\[|,)\s*([^,\[\]]+)/g,/,+\]/g,/^\w+/g,/([#|\.|:])([\w- ]+)/g];return e}(Mantis);function CallbackList(e){this.list=[];this.type=e||"once";this.timing=null;this.state=""}CallbackList.prototype.check=function(){return this.list.length};CallbackList.prototype.add=function(e,t,n,r){if(isType(e)=="arguments"){return CallbackList.prototype.add.apply(this,e)}if(t=="rm"){return this.rm(e)}else if(typeof t=="number"){r=n;n=t;t=0}var i=this.find(t||e);if(i){return i.id}t=t||e.fnName();n=n||1;this.list.push({fn:e,level:n,id:t,type:r||0});this.sort();return t};CallbackList.prototype.rm=function(e){if(typeof e=="function"){var t=e.fnName();for(var n=0;n<this.list.length;n++){var r=this.list[n].fn.fnName();if(t==r){return this.list.splice(n,1)}}}else{for(var n=0;n<this.list.length;n++){var i=this.list[n].id;if(e==i){return this.list.splice(n,1)}}}return false};CallbackList.prototype.done=function(e){if(typeof e=="string"){for(var t=this.list.length-1;t>=0;t--){var n=this.list[t];if(e==n.id){if(typeof n.fn=="function"){n.fn.apply(n,arguments)}this.list.splice(t,1)}}}else{var n=this.list.pop();if(typeof n.fn=="function"){n.fn.apply(n,arguments)}}return this};CallbackList.prototype.bomb=function(){for(var e=this.list.length-1;e>=0;e--){var t=this.list[e];if(typeof t.fn=="function"){var n=t.fn.apply(t,arguments)}if(n=="stop")break;if(this.type=="once"||t.type=="once")this.list.splice(e,1)}return this};CallbackList.prototype.sort=function(){this.list.sort(function(e,t){return e.level-t.level});return this};CallbackList.prototype.find=function(e){if(typeof e=="function"){var t=e.fnName();for(var n=0;n<this.list.length;n++){var r=this.list[n].fn.fnName();if(t==r){return this.list[n]}}}else{for(var n=0;n<this.list.length;n++){var i=this.list[n].id;if(e==i){return this.list[n]}}}return false};CallbackList.prototype.level=function(e,t){this.find(e).level=t;this.sort();return this};CallbackList.prototype.wait=function(e){var t=this;clearTimeout(t.timing);t.timing=setTimeout(function(){t.bomb()},e);return this};var md5=function(){var e=0,t="",n=8;var r=function(e,t){t=t&&typeof r[t]!="undefined"?t:"hex";return r[t](e)};function i(e,t){e[t>>5]|=128<<t%32,e[(t+64>>>9<<4)+14]=t;for(var n=1732584193,r=-271733879,i=-1732584194,o=271733878,u=0;e.length>u;u+=16){var d=n,h=r,p=i,v=o;n=a(n,r,i,o,e[u+0],7,-680876936),o=a(o,n,r,i,e[u+1],12,-389564586),i=a(i,o,n,r,e[u+2],17,606105819),r=a(r,i,o,n,e[u+3],22,-1044525330),n=a(n,r,i,o,e[u+4],7,-176418897),o=a(o,n,r,i,e[u+5],12,1200080426),i=a(i,o,n,r,e[u+6],17,-1473231341),r=a(r,i,o,n,e[u+7],22,-45705983),n=a(n,r,i,o,e[u+8],7,1770035416),o=a(o,n,r,i,e[u+9],12,-1958414417),i=a(i,o,n,r,e[u+10],17,-42063),r=a(r,i,o,n,e[u+11],22,-1990404162),n=a(n,r,i,o,e[u+12],7,1804603682),o=a(o,n,r,i,e[u+13],12,-40341101),i=a(i,o,n,r,e[u+14],17,-1502002290),r=a(r,i,o,n,e[u+15],22,1236535329),n=s(n,r,i,o,e[u+1],5,-165796510),o=s(o,n,r,i,e[u+6],9,-1069501632),i=s(i,o,n,r,e[u+11],14,643717713),r=s(r,i,o,n,e[u+0],20,-373897302),n=s(n,r,i,o,e[u+5],5,-701558691),o=s(o,n,r,i,e[u+10],9,38016083),i=s(i,o,n,r,e[u+15],14,-660478335),r=s(r,i,o,n,e[u+4],20,-405537848),n=s(n,r,i,o,e[u+9],5,568446438),o=s(o,n,r,i,e[u+14],9,-1019803690),i=s(i,o,n,r,e[u+3],14,-187363961),r=s(r,i,o,n,e[u+8],20,1163531501),n=s(n,r,i,o,e[u+13],5,-1444681467),o=s(o,n,r,i,e[u+2],9,-51403784),i=s(i,o,n,r,e[u+7],14,1735328473),r=s(r,i,o,n,e[u+12],20,-1926607734),n=f(n,r,i,o,e[u+5],4,-378558),o=f(o,n,r,i,e[u+8],11,-2022574463),i=f(i,o,n,r,e[u+11],16,1839030562),r=f(r,i,o,n,e[u+14],23,-35309556),n=f(n,r,i,o,e[u+1],4,-1530992060),o=f(o,n,r,i,e[u+4],11,1272893353),i=f(i,o,n,r,e[u+7],16,-155497632),r=f(r,i,o,n,e[u+10],23,-1094730640),n=f(n,r,i,o,e[u+13],4,681279174),o=f(o,n,r,i,e[u+0],11,-358537222),i=f(i,o,n,r,e[u+3],16,-722521979),r=f(r,i,o,n,e[u+6],23,76029189),n=f(n,r,i,o,e[u+9],4,-640364487),o=f(o,n,r,i,e[u+12],11,-421815835),i=f(i,o,n,r,e[u+15],16,530742520),r=f(r,i,o,n,e[u+2],23,-995338651),n=c(n,r,i,o,e[u+0],6,-198630844),o=c(o,n,r,i,e[u+7],10,1126891415),i=c(i,o,n,r,e[u+14],15,-1416354905),r=c(r,i,o,n,e[u+5],21,-57434055),n=c(n,r,i,o,e[u+12],6,1700485571),o=c(o,n,r,i,e[u+3],10,-1894986606),i=c(i,o,n,r,e[u+10],15,-1051523),r=c(r,i,o,n,e[u+1],21,-2054922799),n=c(n,r,i,o,e[u+8],6,1873313359),o=c(o,n,r,i,e[u+15],10,-30611744),i=c(i,o,n,r,e[u+6],15,-1560198380),r=c(r,i,o,n,e[u+13],21,1309151649),n=c(n,r,i,o,e[u+4],6,-145523070),o=c(o,n,r,i,e[u+11],10,-1120210379),i=c(i,o,n,r,e[u+2],15,718787259),r=c(r,i,o,n,e[u+9],21,-343485551),n=l(n,d),r=l(r,h),i=l(i,p),o=l(o,v)}return[n,r,i,o]}function o(e,t,n,r,i,o){return l(d(l(l(t,e),l(r,o)),i),n)}function a(e,t,n,r,i,a,s){return o(t&n|~t&r,e,t,i,a,s)}function s(e,t,n,r,i,a,s){return o(t&r|n&~r,e,t,i,a,s)}function f(e,t,n,r,i,a,s){return o(t^n^r,e,t,i,a,s)}function c(e,t,n,r,i,a,s){return o(n^(t|~r),e,t,i,a,s)}function u(e,t){var r=h(e);r.length>16&&(r=i(r,e.length*n));for(var o=Array(16),a=Array(16),s=0;16>s;s++)o[s]=909522486^r[s],a[s]=1549556828^r[s];var f=i(o.concat(h(t)),512+t.length*n);return i(a.concat(f),640)}function l(e,t){var n=(65535&e)+(65535&t),r=(e>>16)+(t>>16)+(n>>16);return r<<16|65535&n}function d(e,t){return e<<t|e>>>32-t}function h(e){for(var t=[],r=(1<<n)-1,i=0;e.length*n>i;i+=n)t[i>>5]|=(e.charCodeAt(i/n)&r)<<i%32;return t}function p(e){for(var t="",r=(1<<n)-1,i=0;32*e.length>i;i+=n)t+=String.fromCharCode(e[i>>5]>>>i%32&r);return t}function v(t){for(var n=e?"0123456789ABCDEF":"0123456789abcdef",r="",i=0;4*t.length>i;i++)r+=n.charAt(15&t[i>>2]>>8*(i%4)+4)+n.charAt(15&t[i>>2]>>8*(i%4));return r}function m(e){for(var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",r="",i=0;4*e.length>i;i+=3)for(var o=(255&e[i>>2]>>8*(i%4))<<16|(255&e[i+1>>2]>>8*((i+1)%4))<<8|255&e[i+2>>2]>>8*((i+2)%4),a=0;4>a;a++)r+=8*i+6*a>32*e.length?t:n.charAt(63&o>>6*(3-a));return r}r.hex=function(e){return v(i(h(e),e.length*n))};r.b64=function(e){return m(i(h(e),e.length*n))};r.str=function(e){return p(i(h(e),e.length*n))};r.hex_hmac=function(e,t){return v(u(e,t))};r.b64_hmac=function(e,t){return m(u(e,t))};r.str_hmac=function(e,t){return p(u(e,t))};return r}();(function(e){var t=document;var n={};n.tr=t.createElement("tbody");n.tbody=n.thead=n.tfoot=t.createElement("table");n.td=n.th=t.createElement("tr");n["*"]=t.createElement("div");n["**"]=t.getElementsByTagName("div");var r=Node.prototype||n["*"].constructor,o=NodeList.prototype||n["**"].constructor;r.matchSelector=n["*"].matchesSelector||n["*"].mozMatchesSelector||n["*"].webkitMatchesSelector||n["*"].msMatchesSelector;o.nodeType=-1;e.cookie=function(e,t,n){cookie=document.cookie;if(typeof e=="string"){if(t){if(n){var r=new Date;r.setTime(r.getTime()+864e5*n),n=r.toGMTString()}var i=e+"="+encodeURIComponent(toStr(t));n&&(i+="; expires="+n);arguments[3]&&(i+="; domain="+arguments[3]),arguments[4]&&(i+="; path="+arguments[4]),arguments[5]&&(i+="; secure");return document.cookie=i,true}return toJSON(decodeURIComponent(cookie.matchOf("(?:^|;)\\s*"+e.replace(/([-.*+?^${}()|[\]\/\\])/g,"\\$1")+"=([^;]*)",1)))}else if(typeof e=="object"){n=t;var i="";n&&(i+="; expires="+n);arguments[2]&&(i+="; domain="+arguments[2]),arguments[3]&&(i+="; path="+arguments[3]),arguments[4]&&(i+="; secure");for(var o in e){document.cookie=o+"="+encodeURIComponent(toStr(e[o]))+i}return true}var a={};t=cookie.replace(/\s/g,"").split(";");for(var s=0;t.length>s;s++){var f=t[s].split("=");f[1]&&(a[f[0]]=decodeURIComponent(toJSON(f[1])))}return a};e.localData=function(e,t){if(typeof localStorage=="undefined")return false;if(typeof e=="string"){if(t=="del"){return localStorage.removeItem(e),true}else if(t){return localStorage[e]=toStr(t),true}return toJSON(localStorage[e])}else if(typeof e=="object"){for(var n in e){localStorage[n]=toStr(e[n])}return true}return localStorage};(function(e){var t=navigator?navigator["userAgent"].toLowerCase().replace(/mozilla[^\s]+/i,""):"";e.device=t.matchOf(/(ipad|iphone|ipod|android|windows phone)/i,1);e.device=e.device=="windows phone"?"windows_phone":e.device||"desktop";if(e.device=="desktop"){e.os=t.matchOf(/(windows|linux|mac|macintosh)/i,1);e.osVer=0;e.brand=e.os}else{e.os=/ipad|iphone|ipod/.test(e.device)?"ios":e.device;t=t.replace(/(?:os|android|windows phone)[\s\/\-]*([\d\.]+)/,function(t,n){e.osVer=parseFloat(n);return""});e.brand=e.device=="android"?t.matchOf(/(?:en-us|zh-cn);([\w-]+)/,1):e.os=="ios"?"apple":e.device}t=t.replace(/(webkit|msie|gecko)[\W\D]*([\d\.]+)/,function(t,n,r){e.core=n;e.coreVer=parseFloat(r);return""});t=t.replace(/\s*([\w-]+)\/[\d\.]+$/,function(t,n,r){e.browsers=n;return""});if(!e.browsers||e.browsers=="safari"&&(t.indexOf("version")==-1||!/mac|ios/.test(e.os))){e.browsers=t.matchOf(/\s*[\w-]+\/[\d\.]+/g,-1);e.browsers=e.browsers?e.browsers.replace(/\/[\d\.]+|\s/g,""):false}e.browsers=e.browsers||e.brand||e.core||e.device;e.hasTouch=typeof window["ontouchstart"]!="undefined";e.ieTouch=typeof window["onmspointerdown"]!="undefined";e.touchStart=e.hasTouch?"touchstart":e.ieTouch?"mspointerdown":"mousedown";e.touchMove=e.hasTouch?"touchmove":e.ieTouch?"mspointermove":"mousemove";e.touchEnd=e.hasTouch?"touchend":e.ieTouch?"mspointerup":"mouseup";e.touchCancel=e.hasTouch?"touchcancel":e.ieTouch?"mspointercancel":"mousecancel";e.eventListener=typeof window["addEventListener"]!="undefined";e.attachEvent=typeof window["attachEvent"]!="undefined"})(e.info);e.style={};(function(e){var t=n["*"].style;var r=/^(?:webkit|ms|moz)(\w)/;for(var i in t){e[(i.matchOf(r,1)||i).toLowerCase()]=i}if(typeof t["webkitTransition"]!="undefined"){e.vendor="webkit"}else if(typeof t["msTransition"]!="undefined")e.vendor="ms";else if(typeof t["mozTransition"]!="undefined")e.vendor="moz";else e.vendor="";e.hasTransform=typeof e["transform"]=="string";e.has3d=typeof window["WebKitCSSMatrix"]!="undefined"&&typeof(new WebKitCSSMatrix)["m11"]!="undefined";e.css3Key=function(n){if(e[n])return e[n];if(typeof t[n]=="undefined"&&e.vendor){var r=e.vendor+n.substr(0,1).toUpperCase()+n.substr(1);if(typeof t[r]!="undefined"){return r}return""}return n};e.reCss3key=function(n){n=n.replace(/([A-Z])/g,function(e,t){return"-"+t.toLowerCase()});if(!(typeof t[n]!="undefined")){var r=e.vendor?("-"+e.vendor+"-"+n).toLowerCase():n;if(typeof t[r]!="undefined")return r}return n}})(e.style);e.hackKey=function(t){if("on"+t.toLowerCase()in n["*"])return t;if(e.info.vendor=="ms")return t.toLowerCase();t=e.info.vendor?e.info.vendor+t.substr(0,1).toUpperCase()+t.substr(1):t;return t};e.nodeInit=function(e){if(e.length){this.length=e.length;this.nodeType=-1;for(var t=0;t<this.length;t++){this[t]=e[t]}return this}return false};e.nodeProto=function(e,t){if(typeof e=="object"){for(var n in e){r[n]=e[n];o[n]=e[n];Mantis.prototype[n]=e[n]}}else{r[e]=t;o[e]=t;Mantis.prototype[e]=t}};e.nodeProto("template",function(e){var t=this.nodeType==-1,n=t?this[i]:this;do{if(!t)return this;n=this[++i]}while(n);return this});e.nodeProto("find",function(e){var t=this.nodeType==-1,n=t?this[i]:this;return getElements(e,n)});e.nodeProto("findWrap",function(e){var t=this.nodeType==-1,n=t?this[i]:this;while(n.nodeName!="BODY"){if(n.matchSelector(e)){return n}n=n.parentNode}return false});e.nodeProto("next",function(t){var n=this.nodeType==-1,r=n?this[i]:this;r=r["nextSibling"];if(t){var o=[];while(r){if(r.matchSelector(t)){o.push(r)}r=r["nextSibling"]}return new e.nodeInit(o)}return r});e.nodeProto("prev",function(t){var n=this.nodeType==-1,r=n?this[i]:this;r=r["previousSibling"];if(t){var o=[];while(r){if(r.matchSelector(t)){o.push(r)}r=r["previousSibling"]}return new e.nodeInit(o)}return r});e.nodeProto("rm",function(e){var t=this.nodeType==-1,n=t?this[i]:this;do{if(!e)n.parentNode.removeChild(n);else n.find(e).rm();if(!t)return this;n=this[++i]}while(n);return n});e.nodeProto("css",function(t,n,r){var i=this.nodeType==-1,o=i?this[u]:this;var a={},s=false;if(typeof t=="object"){a=t}else if(n){a[t]=n}else{t=e.style.css3Key(t);var f=o.style[t]||document.defaultView.getComputedStyle(o,null).getPropertyValue(t)||getComputedStyle(o,null)[t];return parseFloat(f)?parseFloat(f):f}for(var c in a){t=e.style.css3Key(c);a[t]=a[c]===false?false:a[c]+(typeof a[c]=="number"?"px":"");if(c!=t){delete a[c]}}do{for(var u in a){if(a[u]==false){try{o.style.removeProperty(u)}catch(l){var d=new RegExp(u+":[^;]+;");o.style.cssText=o.style.cssText.replace(d,"")}}else o.style[u]=a[u]}if(!i)return this;o=this[++u]}while(o);return o});e.nodeProto("attr",function(e,t){var n=0,r=this.nodeType==-1,i=r?this[n]:this;do{if(!t)return i?isset(i[e])?i[e]:i.getAttribute(e):false;isset(i[e])?i[e]=t:i.setAttribute(e,t);if(!r)return this;i=this[++n]}while(i);return this});e.nodeProto("addAttr",function(e,t){var n=0,r=this.nodeType==-1,i=r?this[n]:this;var t=t.replace(_RE.replace2s," ").trim(),o={};this.rmAttr(e,t,o);if(t){do{var a=o[n]||"";a=(a+" "+t).trim();isset(i[e])?i[e]=a:i.setAttribute(e,a);if(!r)return this;i=this[++n]}while(i)}return this});e.nodeProto("rmAttr",function(e,t,n){var r=0,i=this.nodeType==-1,o=i?this[r]:this;var a=t?t.replace(_RE.replace2s," ").trim().split(" "):"";do{if(a){var s=isset(o[e])?o[e]:o.getAttribute(e);if(!s){if(n)n[r]="";return}s=s.split(" ");for(var f=a.length-1;f>=0;f--){var c=s.indexOf(a[f]);if(c>=0)s.splice(c,1)}s=s.join(" ").replace(_RE.replace2s," ").trim();if(n)n[r]=s;if(!n)isset(o[e])?o[e]=s:o.setAttribute(e,s)}else if(!n)isset(o[e])?o[e]="":o.removeAttribute(e);if(!i)return this;o=this[++r]}while(o);return this});e.nodeProto("cls",function(e){this.attr("className",e);return this});e.nodeProto("addCls",function(e){this.addAttr("className",e);return this});e.nodeProto("rmCls",function(e){this.rmAttr("className",e);return this});e.nodeProto("html",function(e){var t=0,n=this.nodeType==-1,r=n?this[t]:this;if(arguments.length==0)return r.innerHTML;do{r.innerHTML=e;if(!n)return this;r=this[++t]}while(r);return this});e.nodeProto("forEach",Array.prototype.forEach);e.nodeProto("slice",function(){if(this.nodeType==-1)return new e.nodeInit(Array.prototype.slice.apple(this,arguments));return this});e.nodeProto("indexOf",Array.prototype.indexOf);_resizeCallback=new CallbackList("keep"),_readyCallback=new CallbackList;e.onresize=function(t,n){var r=e.info.device=="desktop"?"resize":"orientationchange";if(n){window.removeEventListener(r,t,false)}else{window.addEventListener(r,t,false)}};e.resize=function(){_resizeCallback.add.apply(_resizeCallback,arguments)};e.onresize(function(){_resizeCallback.wait(50)});e.isReady=false;e.onready=function(e,n){if(t.isReady&&!n)return e();if(!n)t.isReady=t.readyState=="complete"||t.readyState=="loaded"||t.readyState=="interactive";if(t.isReady&&!n){setTimeout(e,10)}else{t[n?"removeEventListener":"addEventListener"]("DOMContentLoaded",e,false)}};e.ready=function(){_readyCallback.add.apply(_readyCallback,arguments)};e.onready(function(){e.isReady=true;_readyCallback.bomb()})})(Mantis);function getElements(e,t,n){if(_RE.isTag.test(e)){return}if(t&&t.nodeType){if(t.nodeType==1){return t.querySelectorAll(e)}else if(t.nodeType==-1&&t.length){var r=t.length,i=[];for(var o=0;o<r;o++){if(n&&t[o].matchSelector(e)){i.push(t[o])}i=i.concat(t[o].querySelectorAll(e).slice())}return new Mantis.nodeInit(i)}}return document.querySelectorAll(e)}function getElement(e,t){if(_RE.isTag.test(e)){return}if(t&&t.nodeType){if(t.nodeType==1){return t.querySelector(e)}else if(t.nodeType==-1&&t.length){return t[0].querySelector(e)}}return document.querySelector(e)}function createElement(){}(function(e){var t=new CallbackList({type:"keep"}),n=false,r=new CallbackList({type:"keep"}),i=false,o=new CallbackList({type:"keep"}),a=new CallbackList({type:"keep"});e.device=function(){};e.device.ondeviceorientation=function(){var e=r.add(arguments);if(r.check()){if(!i){i=true;window.ondeviceorientation=function(e){if(r.check()){r.bomb(e)}else{window.ondeviceorientation=i=null}}}}else{window.ondeviceorientation=i=null}return e};e.device.ondevicemotion=function(){var e=t.add(arguments);if(t.check()){if(!n){n=true;window.ondevicemotion=function(e){if(t.check()){t.bomb(e)}else{window.ondevicemotion=n=null}}}}else{window.ondevicemotion=n=null}return e};function s(e){var t=e.accelerationIncludingGravity,n=e.timeStamp||Date.now();if(n-s.now<50)return;var r=t.x>>0,i=t.y>>0,a=t.z>>0;if(n-s.last>800){if(s.num>=2){o.bomb(s.num,e)}s.num=0,s.last=s.now=n}else{var f=Math.abs(r*.2+i+a*1.5-s.x-s.y-s.z);if(f>20){s.num++}}s.x=r,s.y=i,s.z=a,s.now=n}s.last=Date.now();s.now=Date.now();s.num=0;s.x=0;s.y=0;s.z=0;e.device.shake=function(){var t=o.add(arguments);if(o.check()){e.device.ondevicemotion(s)}else{e.device.ondevicemotion(s,"rm")}return t};function f(e){var t=e.accelerationIncludingGravity,n=e.timeStamp||Date.now();if(n-f.last<50)return;var r=t.x>>0,i=t.y>>0,o=t.z>>0;a.bomb(r,i,o,e)}f.last=Date.now();e.device.motion=function(){var t=a.add(arguments);if(a.check()){e.device.ondevicemotion(f)}else{e.device.ondevicemotion(f,"rm")}return t}})(Mantis);
|