|
1 /*! intel-appframework - v2.1.0 - 2014-09-25 */ |
|
2 |
|
3 /* |
|
4 Intel |
|
5 @api private |
|
6 */ |
|
7 if(!window.af||"function"!==typeof af){var af=function(a){function n(a,c,d){var b=r.createDocumentFragment();if(d){for(d=a.length-1;0<=d;d--)b.insertBefore(a[d],b.firstChild);c.insertBefore(b,c.firstChild)}else{for(d=0;d<a.length;d++)b.appendChild(a[d]);c.appendChild(b)}}function l(a){return a in G?G[a]:G[a]=RegExp("(^|\\s)"+a+"(\\s|$)")}function k(a){for(var c=0;c<a.length;c++)a.indexOf(a[c])!==c&&(a.splice(c,1),c--);return a}function f(a,c){var d=[];if(a==q)return d;for(;a;a=a.nextSibling)1===a.nodeType&& |
|
8 a!==c&&d.push(a);return d}function h(a,c){try{return c.querySelectorAll(a)}catch(d){return[]}}function g(a,c){if(a)if(a.nodeType)c[c.length++]=a;else for(var d=0,b=a.length;d<b;d++)c[c.length++]=a[d]}function b(){}function e(c,d){c.os={};c.os.webkit=d.match(/WebKit\/([\d.]+)/)?!0:!1;c.os.android=d.match(/(Android)\s+([\d.]+)/)||d.match(/Silk-Accelerated/)?!0:!1;c.os.androidICS=c.os.android&&d.match(/(Android)\s4/)?!0:!1;c.os.ipad=d.match(/(iPad).*OS\s([\d_]+)/)?!0:!1;c.os.iphone=!c.os.ipad&&d.match(/(iPhone\sOS)\s([\d_]+)/)? |
|
9 !0:!1;c.os.ios7=(c.os.ipad||c.os.iphone)&&d.match(/7_/)||(c.os.ipad||c.os.iphone)&&d.match(/8_/)?!0:!1;c.os.webos=d.match(/(webOS|hpwOS)[\s\/]([\d.]+)/)?!0:!1;c.os.touchpad=c.os.webos&&d.match(/TouchPad/)?!0:!1;c.os.ios=c.os.ipad||c.os.iphone;c.os.playbook=d.match(/PlayBook/)?!0:!1;c.os.blackberry10=d.match(/BB10/)?!0:!1;c.os.blackberry=c.os.playbook||c.os.blackberry10||d.match(/BlackBerry/)?!0:!1;c.os.chrome=d.match(/Chrome/)?!0:!1;c.os.opera=d.match(/Opera/)?!0:!1;c.os.fennec=d.match(/fennec/i)? |
|
10 !0:d.match(/Firefox/)?!0:!1;c.os.ie=d.match(/MSIE 10.0/i)||d.match(/Trident\/7/i)?!0:!1;c.os.ieTouch=c.os.ie&&d.toLowerCase().match(/touch/i)?!0:!1;c.os.tizen=d.match(/Tizen/i)?!0:!1;c.os.supportsTouch=a.DocumentTouch&&r instanceof a.DocumentTouch||"ontouchstart"in a;c.os.kindle=d.match(/Silk-Accelerated/)?!0:!1;c.feat={};var b=r.documentElement.getElementsByTagName("head")[0];c.feat.nativeTouchScroll="undefined"!==typeof b.style["-webkit-overflow-scrolling"]&&(c.os.ios||c.os.blackberry10);c.feat.cssPrefix= |
|
11 c.os.webkit?"Webkit":c.os.fennec?"Moz":c.os.ie?"ms":c.os.opera?"O":"";c.feat.cssTransformStart=!c.os.opera?"3d(":"(";c.feat.cssTransformEnd=!c.os.opera?",0)":")";c.os.android&&!c.os.webkit&&(c.os.android=!1);for(var b=["Webkit","Moz","ms","O"],p=0;p<b.length;p++)""===r.documentElement.style[b[p]+"Transform"]&&(c.feat.cssPrefix=b[p])}function c(a){return a._afmid||(a._afmid=Q++)}function d(a,d,b,e){d=p(d);if(d.ns)var f=t(d.ns);return(x[c(a)]||[]).filter(function(a){return a&&(!d.e||a.e===d.e)&&(!d.ns|| |
|
12 f.test(a.ns))&&(!b||a.fn===b||"function"===typeof a.fn&&"function"===typeof b&&a.fn===b)&&(!e||a.sel===e)})}function p(a){a=(""+a).split(".");return{e:a[0],ns:a.slice(1).sort().join(" ")}}function t(a){return RegExp("(?:^| )"+a.replace(" "," .* ?")+"(?: |$)")}function J(a,c,d){m.isObject(a)?m.each(a,d):a.split(/\s/).forEach(function(a){d(a,c)})}function y(a,d,b,e,f){var h=c(a),g=x[h]||(x[h]=[]);J(d,b,function(c,d){var b=f&&f(d,c),E=b||d,I=function(c){if(!c.ns||t(c.ns).test(h.ns)){var d=E.apply(a, |
|
13 [c].concat(c.data));!1===d&&c.preventDefault();return d}},h=m.extend(p(c),{fn:d,proxy:I,sel:e,del:b,i:g.length});g.push(h);a.addEventListener(h.e,I,!1)})}function u(a,b,p,e){var f=c(a);J(b||"",p,function(c,b){d(a,c,b,e).forEach(function(c){delete x[f][c.i];a.removeEventListener(c.e,c.proxy,!1)})})}function F(a){var c=m.extend({originalEvent:a},a);m.each(R,function(d,b){c[d]=function(){this[b]=S;if("stopImmediatePropagation"===d||"stopPropagation"===d)if(a.cancelBubble=!0,!a[d])return;return a[d].apply(a, |
|
14 arguments)};c[b]=T});return c}function z(a,c,d,b,p){y(a,c,d,b,function(c){return function(d){var e,E=m(d.target).closest(b,a).get(0);if(E)return e=m.extend(F(d),{currentTarget:E,liveFired:a,delegateTarget:a,data:p}),c.apply(E,[e].concat([].slice.call(arguments,1)))}})}function s(a,d){if(d&&a.dispatchEvent){var b=m.Event("destroy",{bubbles:!1});a.dispatchEvent(b)}if((b=c(a))&&x[b]){for(var p in x[b])a.removeEventListener(x[b][p].e,x[b][p].proxy,!1);delete x[b]}}function A(a,c){if(a){var d=a.childNodes; |
|
15 if(d&&0<d.length)for(var b=0;b<d.length;b++)A(d[b],c);s(a,c)}}var q,r=a.document,B=[],K=B.slice,G={},U=1,V=/<(\w+)[^>]*>/,w={},C={},L={columncount:!0,fontweight:!0,lineheight:!0,"column-count":!0,"font-weight":!0,"line-height":!0,opacity:!0,orphans:!0,widows:!0,zIndex:!0,"z-index":!0,zoom:!0},D="object"===typeof MSApp,v=function(a,c){this.length=0;if(a){if(a instanceof v&&c==q)return a;if(af.isFunction(a))return af(r).ready(a);if(af.isArray(a)&&a.length!=q){for(var d=0;d<a.length;d++)this[this.length++]= |
|
16 a[d];return this}if(af.isObject(a)&&af.isObject(c)){if(a.length==q)a.parentNode==c&&(this[this.length++]=a);else for(d=0;d<a.length;d++)a[d].parentNode==c&&(this[this.length++]=a[d]);return this}if(af.isObject(a)&&c==q)return this[this.length++]=a,this;if(c!==q){if(c instanceof v)return c.find(a)}else c=r}else return this;return this.selector(a,c)},m=function(a,c){return new v(a,c)};m.is$=function(a){return a instanceof v};m.map=function(a,c){var d,b=[],p;if(m.isArray(a))for(p=0;p<a.length;p++)d= |
|
17 c.apply(a[p],[a[p],p]),d!==q&&b.push(d);else if(m.isObject(a))for(p in a)a.hasOwnProperty(p)&&"length"!==p&&(d=c(a[p],[a[p],p]),d!==q&&b.push(d));return b};m.each=function(a,c){var d;if(m.isArray(a))for(d=0;d<a.length&&!1!==c(d,a[d]);d++);else if(m.isObject(a))for(d in a)if(a.hasOwnProperty(d)&&"length"!==d&&!1===c(d,a[d]))break;return a};m.extend=function(a){a==q&&(a=this);if(1===arguments.length){for(var c in a)this[c]=a[c];return this}K.call(arguments,1).forEach(function(c){for(var d in c)a[d]= |
|
18 c[d]});return a};m.isArray=function(a){return a instanceof Array&&a.push!=q};m.isFunction=function(a){return"function"===typeof a&&!(a instanceof RegExp)};m.isObject=function(a){return"object"===typeof a&&null!==a};m.fn=v.prototype={namespace:"appframework",constructor:v,forEach:B.forEach,reduce:B.reduce,push:B.push,indexOf:B.indexOf,concat:B.concat,selector:function(a,c){a=a.trim();if("#"===a[0]&&-1===a.indexOf(".")&&-1===a.indexOf(",")&&-1===a.indexOf(" ")&&-1===a.indexOf(">"))c===r?g(c.getElementById(a.replace("#", |
|
19 "")),this):g(h(a,c),this);else if("<"===a[0]&&">"===a[a.length-1]||-1!==a.indexOf("<")&&-1!==a.indexOf(">")){var d=r.createElement("div");D?MSApp.execUnsafeLocalFunction(function(){d.innerHTML=a.trim()}):d.innerHTML=a.trim();g(d.childNodes,this)}else g(h(a,c),this);return this},oldElement:void 0,sort:B.sort,slice:B.slice,length:0,setupOld:function(a){if(a==q)return m();a.oldElement=this;return a},map:function(a){var c,d=[],b;for(b=0;b<this.length;b++)c=a.apply(this[b],[b,this[b]]),c!==q&&d.push(c); |
|
20 return m(d)},each:function(a){this.forEach(function(c,d){a.call(c,d,c)});return this},ready:function(a){"complete"===r.readyState||"loaded"===r.readyState||!m.os.ie&&"interactive"===r.readyState?a():r.addEventListener("DOMContentLoaded",a,!1);return this},find:function(a){if(0===this.length)return this;for(var c=[],d,b=0;b<this.length;b++){d=m(a,this[b]);for(var p=0;p<d.length;p++)c.push(d[p])}return m(k(c))},html:function(a,c){var d=function(){p.innerHTML=a};if(0===this.length)return this;if(a=== |
|
21 q)return this[0].innerHTML;for(var b=0;b<this.length;b++)if(!1!==c&&m.cleanUpContent(this[b],!1,!0),D){var p=this[b];MSApp.execUnsafeLocalFunction(d)}else this[b].innerHTML=a;return this},text:function(a){if(0===this.length)return this;if(a===q)return this[0].textContent;for(var c=0;c<this.length;c++)this[c].textContent=a;return this},css:function(c,d,b){b=b!=q?b:this[0];if(0===this.length)return this;if(d==q&&"string"===typeof c)return b.style[c]?b.style[c]:a.getComputedStyle(b)[c];for(b=0;b<this.length;b++)if(m.isObject(c))for(var p in c)this[b].style[p]= |
|
22 "number"===typeof c[p]&&!L[p.toLowerCase()]?c[p]+"px":c[p];else this[b].style[c]="number"===typeof d&&!L[c.toLowerCase()]?d+"px":d;return this},vendorCss:function(a,c,d){return this.css(m.feat.cssPrefix+a,c,d)},cssTranslate:function(a){return this.vendorCss("Transform","translate"+m.feat.cssTransformStart+a+m.feat.cssTransformEnd)},computedStyle:function(c){if(!(0===this.length||c==q))return a.getComputedStyle(this[0],"")[c]},empty:function(){for(var a=0;a<this.length;a++)m.cleanUpContent(this[a], |
|
23 !1,!0),this[a].textContent="";return this},hide:function(){if(0===this.length)return this;for(var a=0;a<this.length;a++)"none"!==this.css("display",null,this[a])&&(this[a].setAttribute("afmOldStyle",this.css("display",null,this[a])),this[a].style.display="none");return this},show:function(){if(0===this.length)return this;for(var a=0;a<this.length;a++)"none"===this.css("display",null,this[a])&&(this[a].style.display=this[a].getAttribute("afmOldStyle")?this[a].getAttribute("afmOldStyle"):"block",this[a].removeAttribute("afmOldStyle")); |
|
24 return this},toggle:function(a){if(0===this.length)return this;for(var c=!0===a,d=0;d<this.length;d++)if("none"!==this.css("display",null,this[d])&&(a==q||!1===c))this[d].setAttribute("afmOldStyle",this.css("display",null,this[d])),this[d].style.display="none";else if("none"===this.css("display",null,this[d])&&(a==q||!0===c))this[d].style.display=this[d].getAttribute("afmOldStyle")?this[d].getAttribute("afmOldStyle"):"block",this[d].removeAttribute("afmOldStyle");return this},val:function(a){if(0=== |
|
25 this.length)return a===q?void 0:this;if(a==q)return this[0].value;for(var c=0;c<this.length;c++)this[c].value=a;return this},attr:function(a,c){if(0===this.length)return c===q?void 0:this;if(c===q&&!m.isObject(a))return this[0].afmCacheId&&w[this[0].afmCacheId]&&w[this[0].afmCacheId][a]?w[this[0].afmCacheId][a]:this[0].getAttribute(a);for(var d=0;d<this.length;d++)if(m.isObject(a))for(var b in a)m(this[d]).attr(b,a[b]);else m.isArray(c)||m.isObject(c)||m.isFunction(c)?(this[d].afmCacheId||(this[d].afmCacheId= |
|
26 m.uuid()),w[this[d].afmCacheId]||(w[this[d].afmCacheId]={}),w[this[d].afmCacheId][a]=c):(null===c?this[d].removeAttribute(a):this[d].setAttribute(a,c),this[d].afmCacheId&&w[this[d].afmCacheId][a]&&delete w[this[d].afmCacheId][a]);return this},removeAttr:function(a){for(var c=function(c){d[b].removeAttribute(c);d[b].afmCacheId&&w[d[b].afmCacheId]&&delete w[d[b].afmCacheId][a]},d=this,b=0;b<this.length;b++)a.split(/\s+/g).forEach(c);return this},prop:function(a,c){if(0===this.length)return c===q?void 0: |
|
27 this;if(c===q&&!m.isObject(a)){var d;return this[0].afmCacheId&&C[this[0].afmCacheId]&&C[this[0].afmCacheId][a]?C[this[0].afmCacheId][a]:!(d=this[0][a])&&a in this[0]?this[0][a]:d}for(d=0;d<this.length;d++)if(m.isObject(a))for(var b in a)m(this[d]).prop(b,a[b]);else m.isArray(c)||m.isObject(c)||m.isFunction(c)?(this[d].afmCacheId||(this[d].afmCacheId=m.uuid()),C[this[d].afmCacheId]||(C[this[d].afmCacheId]={}),C[this[d].afmCacheId][a]=c):null===c&&void 0!==c?m(this[d]).removeProp(a):(m(this[d]).removeProp(a), |
|
28 this[d][a]=c);return this},removeProp:function(a){for(var c=function(c){d[b][c]&&(d[b][c]=void 0);d[b].afmCacheId&&C[d[b].afmCacheId]&&delete C[d[b].afmCacheId][a]},d=this,b=0;b<this.length;b++)a.split(/\s+/g).forEach(c);return this},remove:function(a){a=m(this).filter(a);if(a==q)return this;for(var c=0;c<a.length;c++)m.cleanUpContent(a[c],!0,!0),a[c]&&a[c].parentNode&&a[c].parentNode.removeChild(a[c]);return this},addClass:function(a){var c=function(a){e.hasClass(a,e[d])||p.push(a)};if(a==q)return this; |
|
29 for(var d=0;d<this.length;d++){var b=this[d].className,p=[],e=this;a.split(/\s+/g).forEach(c);this[d].className+=(b?" ":"")+p.join(" ");this[d].className=this[d].className.trim()}return this},removeClass:function(a){if(a==q)return this;for(var c=function(a){b=b.replace(l(a)," ")},d=0;d<this.length;d++){if(a==q){this[d].className="";break}var b=this[d].className;"object"===typeof this[d].className&&(b=" ");a.split(/\s+/g).forEach(c);this[d].className=0<b.length?b.trim():""}return this},toggleClass:function(a, |
|
30 c){if(a==q)return this;for(var d=0;d<this.length;d++)"boolean"!==typeof c&&(c=this.hasClass(a,this[d])),m(this[d])[c?"removeClass":"addClass"](a);return this},replaceClass:function(a,c){if(a==q||c==q)return this;for(var d=function(a){p=p.replace(l(a)," ")},b=0;b<this.length;b++)if(a==q)this[b].className=c;else{var p=this[b].className;a.split(/\s+/g).concat(c.split(/\s+/g)).forEach(d);p=p.trim();this[b].className=0<p.length?(p+" "+c).trim():c}return this},hasClass:function(a,c){if(0===this.length)return!1; |
|
31 c||(c=this[0]);return l(a).test(c.className)},append:function(c,d,b){if(c&&c.length!=q&&0===c.length)return this;if(m.isArray(c)||m.isObject(c))c=m(c);var p;d&&m(this).add(d);for(d=0;d<this.length;d++)if(c.length&&"string"!==typeof c)c=m(c),n(c,this[d],b);else{var e=V.test(c)?m(c):void 0;if(e==q||0===e.length)e=r.createTextNode(c);if(e instanceof v)for(var f=0,t=e.length;f<t;f++)p=e[f],p.nodeName!=q&&"script"===p.nodeName.toLowerCase()&&(!p.type||"text/javascript"===p.type.toLowerCase())?a.eval(p.innerHTML): |
|
32 n(m(p),this[d],b);else b!=q?this[d].insertBefore(e,this[d].firstChild):this[d].appendChild(e)}return this},appendTo:function(a){m(a).append(this);return this},prependTo:function(a){m(a).append(this,null,!0);return this},prepend:function(a){return this.append(a,null,1)},insertBefore:function(a,c){if(0===this.length)return this;a=m(a).get(0);if(!a)return this;for(var d=0;d<this.length;d++)c?a.parentNode.insertBefore(this[d],a.nextSibling):a.parentNode.insertBefore(this[d],a);return this},insertAfter:function(a){this.insertBefore(a, |
|
33 !0)},get:function(a){a=a==q?null:a;0>a&&(a+=this.length);if(null===a){a=[];for(var c=0;c<this.length;c++)a.push(this[c]);return a}return this[a]?this[a]:void 0},offset:function(){var c;if(0===this.length)return this;if(this[0]===a)return{left:0,top:0,right:0,bottom:0,width:a.innerWidth,height:a.innerHeight};c=this[0].getBoundingClientRect();return{left:c.left+a.pageXOffset,top:c.top+a.pageYOffset,right:c.right+a.pageXOffset,bottom:c.bottom+a.pageYOffset,width:c.right-c.left,height:c.bottom-c.top}}, |
|
34 height:function(c){return 0===this.length?this:c!=q?this.css("height",c):this[0]===this[0].window?a.innerHeight:this[0].nodeType===this[0].DOCUMENT_NODE?this[0].documentElement.offsetHeight:(c=this.computedStyle("height").replace("px",""))?+c:this.offset().height},width:function(c){return 0===this.length?this:c!=q?this.css("width",c):this[0]===this[0].window?a.innerWidth:this[0].nodeType===this[0].DOCUMENT_NODE?this[0].documentElement.offsetWidth:(c=this.computedStyle("width").replace("px",""))?+c: |
|
35 this.offset().width},parent:function(a,c){if(0===this.length)return this;for(var d=[],b=0;b<this.length;b++)for(var p=this[b];p.parentNode&&p.parentNode!==r&&!(d.push(p.parentNode),p.parentNode&&(p=p.parentNode),!c););return this.setupOld(m(k(d)).filter(a))},parents:function(a){return this.parent(a,!0)},children:function(a){if(0===this.length)return this;for(var c=[],d=0;d<this.length;d++)c=c.concat(f(this[d].firstChild));return this.setupOld(m(c).filter(a))},siblings:function(a){if(0===this.length)return this; |
|
36 for(var c=[],d=0;d<this.length;d++)this[d].parentNode&&(c=c.concat(f(this[d].parentNode.firstChild,this[d])));return this.setupOld(m(c).filter(a))},contents:function(a){if(0===this.length)return this;for(var c=[],d=0;d<this.length;d++)this[d].parentNode&&g(this[d].childNodes,c);return this.setupOld(m(c).filter(a))},closest:function(a,c){if(0===this.length)return this;var d=this[0],b=m(a,c);if(0===b.length)return m();for(;d&&-1===b.indexOf(d);)d=d!==c&&d!==r&&d.parentNode;return m(d)},filter:function(a){if(0=== |
|
37 this.length||a==q)return this;for(var c=[],d=0;d<this.length;d++){var b=this[d];b.parentNode&&0<=m(a,b.parentNode).indexOf(b)&&c.push(b)}return this.setupOld(m(k(c)))},not:function(a){if(0===this.length)return this;for(var c=[],d=0;d<this.length;d++){var b=this[d];b.parentNode&&-1===m(a,b.parentNode).indexOf(b)&&c.push(b)}return this.setupOld(m(k(c)))},data:function(a,c){return this.attr("data-"+a,c)},end:function(){return this.oldElement!=q?this.oldElement:m()},clone:function(a){a=!1===a?!1:!0;if(0=== |
|
38 this.length)return this;for(var c=[],d=0;d<this.length;d++)c.push(this[d].cloneNode(a));return m(c)},size:function(){return this.length},serialize:function(){if(0===this.length)return"";for(var a=function(a){var d=a.getAttribute("type");if("fieldset"!==a.nodeName.toLowerCase()&&(!a.disabled&&"submit"!==d&&"reset"!==d&&"button"!==d&&("radio"!==d&&"checkbox"!==d||a.checked))&&a.getAttribute("name"))if("select-multiple"===a.type)for(d=0;d<a.options.length;d++)a.options[d].selected&&c.push(a.getAttribute("name")+ |
|
39 "="+encodeURIComponent(a.options[d].value));else c.push(a.getAttribute("name")+"="+encodeURIComponent(a.value))},c=[],d=0;d<this.length;d++)this.slice.call(this[d].elements).forEach(a);return c.join("&")},eq:function(a){return m(this.get(a))},index:function(a){return a?this.indexOf(m(a)[0]):this.parent().children().indexOf(this[0])},is:function(a){return!!a&&0<this.filter(a).length},add:function(a){a=m(a);var c,d=a.length;for(c=0;c<d;c++)this[this.length++]=a[c];return this}};m.ajaxSettings={type:"GET", |
|
40 beforeSend:b,success:b,error:b,complete:b,context:void 0,timeout:0,crossDomain:null,processData:!0};m.jsonP=function(c){if(D)return c.type="get",c.dataType=null,m.get(c);var d="jsonp_callback"+ ++U,b="",p,e=r.createElement("script");a[d]=function(p){clearTimeout(b);m(e).remove();delete a[d];c.success.call(void 0,p)};if(-1!==c.url.indexOf("callback=?"))e.src=c.url.replace(/=\?/,"="+d);else{p=c.jsonp?c.jsonp:"callback";if(-1===c.url.indexOf("?"))c.url+="?"+p+"="+d;else if(-1!==c.url.indexOf("callback=")){p= |
|
41 c.url.indexOf("callback=")+9;var f=c.url.indexOf(p);-1===f&&(f=c.url.length);p=c.url.substr(p,f);c.url=c.url.replace("callback="+p,"callback="+d);p=p.replace("window.","");c.success=a[p]}else c.url+="&"+p+"="+d;e.src=c.url}c.error&&(e.onerror=function(){clearTimeout(b);c.error.call(void 0,"","error")});m("head").append(e);0<c.timeout&&(b=setTimeout(function(){c.error.call(void 0,"","timeout")},c.timeout));return{}};m.ajax=function(c){var d,p=m.Deferred();"string"===typeof c&&(c={url:c});var e=c|| |
|
42 {},f;for(f in m.ajaxSettings)"undefined"===typeof e[f]&&(e[f]=m.ajaxSettings[f]);try{e.url||(e.url=a.location);e.headers||(e.headers={});if(!("async"in e)||!1!==e.async)e.async=!0;e.processData&&m.isObject(e.data)&&(e.data=m.param(e.data));"get"===e.type.toLowerCase()&&e.data&&(-1===e.url.indexOf("?")?e.url+="?"+e.data:e.url+="&"+e.data);e.data&&(!e.contentType&&!1!==e.contentType)&&(e.contentType="application/x-www-form-urlencoded; charset=UTF-8");if(e.dataType)switch(e.dataType){case "script":e.dataType= |
|
43 "text/javascript, application/javascript";break;case "json":e.dataType="application/json";break;case "xml":e.dataType="application/xml, text/xml";break;case "html":e.dataType="text/html";break;case "text":e.dataType="text/plain";break;case "jsonp":return m.jsonP(c);default:e.dataType="text/html"}else e.dataType="text/html";if(/=\?/.test(e.url))return m.jsonP(e);null===e.crossDomain&&(e.crossDomain=/^([\w-]+:)?\/\/([^\/]+)/.test(e.url)&&RegExp.$2!==a.location.host);e.crossDomain||(e.headers=m.extend({"X-Requested-With":"XMLHttpRequest"}, |
|
44 e.headers));var t,h=e.context,g=/^([\w-]+:)\/\//.test(e.url)?RegExp.$1:a.location.protocol;d=new a.XMLHttpRequest;m.extend(d,p.promise);d.onreadystatechange=function(){var c=e.dataType;if(4===d.readyState){clearTimeout(t);var b,f=!1,k=d.getResponseHeader("content-type");k||(k="");if(200<=d.status&&300>d.status||0===d.status&&"file:"===g){if("application/json"===k||"application/json"===c&&!/^\s*$/.test(d.responseText))try{b=JSON.parse(d.responseText)}catch(P){f=P}else if(-1!==k.indexOf("javascript"))try{b= |
|
45 d.responseText,a.eval(b)}catch(l){console.log(l)}else"application/xml, text/xml"===c?b=d.responseXML:"text/html"===c?(b=d.responseText,m.parseJS(b)):b=d.responseText;0===d.status&&0===b.length&&(f=!0);f?(e.error.call(h,d,"parsererror",f),p.reject.call(h,d,"parsererror",f)):(p.resolve.call(h,b,"success",d),e.success.call(h,b,"success",d))}else f=!0,p.reject.call(h,d,"error"),e.error.call(h,d,"error");e.complete.call(h,d,f?"error":"success")}};d.open(e.type,e.url,e.async);e.withCredentials&&(d.withCredentials= |
|
46 !0);e.contentType&&(e.headers["Content-Type"]=e.contentType);for(var k in e.headers)"string"===typeof e.headers[k]&&d.setRequestHeader(k,e.headers[k]);if(!1===e.beforeSend.call(h,d,e))return d.abort(),!1;0<e.timeout&&(t=setTimeout(function(){d.onreadystatechange=b;d.abort();e.error.call(h,d,"timeout")},e.timeout));d.send(e.data)}catch(l){p.resolve(h,d,"error",l),e.error.call(h,d,"error",l)}return d};m.get=function(a,c){return this.ajax({url:a,success:c})};m.post=function(a,c,d,b){m.isFunction(c)&& |
|
47 (d=c,c={});"string"===typeof d&&(b=d,d=function(){});b===q&&(b="html");return this.ajax({url:a,type:"POST",data:c,dataType:b,success:d})};m.getJSON=function(a,c,d,b){"function"===typeof c&&(b=d,d=c,c={});return this.ajax({url:a,data:c,success:d,error:b,dataType:"json"})};m.getScript=function(a,c){if(/^([\w-]+:)?\/\/([^\/]+)/.test(a)){var d=m.Deferred(),b=m.create("script",{async:!0,src:a}).get(0);b.onload=function(){c&&c();d.resolve.call(this,"success");m(this).remove()};b.onerror=function(){m(this).remove(); |
|
48 d.reject.call(this,"success")};r.head.appendChild(b);return d.promise}return this.ajax({url:a,success:c,dataType:"script"})};m.param=function(a,c){var d=[];if(a instanceof v)a.each(function(){d.push((c?c+"["+this.id+"]":this.id)+"="+encodeURIComponent(this.value))});else for(var b in a)if(!m.isFunction(a[b])){var e=c?c+"["+b+"]":b,p=a[b];d.push(m.isObject(p)?m.param(p,e):e+"="+encodeURIComponent(p))}return d.join("&")};m.parseJSON=function(a){return JSON.parse(a)};m.parseXML=function(a){if(D)MSApp.execUnsafeLocalFunction(function(){return(new DOMParser).parseFromString(a, |
|
49 "text/xml")});else return(new DOMParser).parseFromString(a,"text/xml")};e(m,navigator.userAgent);m.__detectUA=e;m.uuid=function(){var a=function(){return(65536*(1+Math.random())|0).toString(16).substring(1)};return a()+a()+"-"+a()+"-"+a()+"-"+a()+"-"+a()+a()+a()};m.getCssMatrix=function(c){m.is$(c)&&(c=c.get(0));var d=a.WebKitCSSMatrix||a.MSCSSMatrix;if(c===q)return d?new d:{a:0,b:0,c:0,d:0,e:0,f:0};c=a.getComputedStyle(c);c=c.webkitTransform||c.transform||c[m.feat.cssPrefix+"Transform"];return d? |
|
50 new d(c):c?(d=c.replace(/[^0-9\-.,]/g,"").split(","),{a:+d[0],b:+d[1],c:+d[2],d:+d[3],e:+d[4],f:+d[5]}):{a:0,b:0,c:0,d:0,e:0,f:0}};m.create=function(a,c){var d,b=new v;if(c||"<"!==a[0]){c.html&&(c.innerHTML=c.html,delete c.html);d=r.createElement(a);for(var e in c)d[e]=c[e];b[b.length++]=d}else d=r.createElement("div"),D?MSApp.execUnsafeLocalFunction(function(){d.innerHTML=a.trim()}):d.innerHTML=a,g(d.childNodes,b);return b};m.query=function(a,c){if(!a)return new v;c=c||r;return(new v).selector(a, |
|
51 c)};var x=[],Q=1;m.event={add:y,remove:u};m.fn.bind=function(a,c){for(var d=0,b=this.length;d<b;d++)y(this[d],a,c);return this};m.fn.unbind=function(a,c){for(var d=0,b=this.length;d<b;d++)u(this[d],a,c);return this};m.fn.one=function(a,c){return this.each(function(d,b){y(this,a,c,null,function(a,c){return function(){u(b,c,a);return a.apply(b,arguments)}})})};var S=function(){return!0},T=function(){return!1},R={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped", |
|
52 stopPropagation:"isPropagationStopped"};m.fn.delegate=function(a,c,d,b){m.isFunction(d)&&(b=d,d=null);for(var e=0,p=this.length;e<p;e++)z(this[e],c,b,a,d);return this};m.fn.undelegate=function(a,c,d){for(var b=0,e=this.length;b<e;b++)u(this[b],c,d,a);return this};m.fn.on=function(a,c,d,b){m.isFunction(d)&&(b=d,d=null);return c===q||m.isFunction(c)?this.bind(a,c):this.delegate(c,a,d,b)};m.fn.off=function(a,c,d){return c===q||m.isFunction(c)?this.unbind(a,c):this.undelegate(c,a,d)};m.fn.trigger=function(a, |
|
53 c,d){"string"===typeof a&&(d=d||{},a=p(a),d.ns=a.ns,a=m.Event(a.e,d));a.data=c;c=0;for(d=this.length;c<d;c++)this[c].dispatchEvent(a);return this};m.Event=function(a,c){var d=r.createEvent("Events"),b=!0;if(c)for(var e in c)"bubbles"===e?b=!!c[e]:d[e]=c[e];d.initEvent(a,b,!0,null,null,null,null,null,null,null,null,null,null,null,null);return d};m.bind=function(a,c,d){if(a){a.__events||(a.__events={});m.isArray(c)||(c=[c]);for(var b=0;b<c.length;b++)a.__events[c[b]]||(a.__events[c[b]]=[]),a.__events[c[b]].push(d)}}; |
|
54 m.trigger=function(a,c,d){if(a){var b=!0;if(!a.__events)return b;m.isArray(c)||(c=[c]);m.isArray(d)||(d=[]);for(var e=0;e<c.length;e++)if(a.__events[c[e]])for(var p=a.__events[c[e]].slice(0),f=0;f<p.length;f++)m.isFunction(p[f])&&!1===p[f].apply(a,d)&&(b=!1);return b}};m.unbind=function(a,c,d){if(a.__events)if(c==q)delete a.__events;else{m.isArray(c)||(c=[c]);for(var b=0;b<c.length;b++)if(a.__events[c[b]])for(var e=a.__events[c[b]],p=0;p<e.length;p++)if(d==q&&delete e[p],e[p]===d){e.splice(p,1);break}}}; |
|
55 m.proxy=function(a,c,d){return function(){return d?a.apply(c,d):a.apply(c,arguments)}};var W=function(a,c){for(var d=0;d<a.length;d++)A(a[d],c)};m.cleanUpContent=function(a,c,d){if(a){var b=a.childNodes;b&&0<b.length&&m.asap(W,{},[K.apply(b,[0]),d]);c&&s(a,d)}};var H=[],M=[],N=[];m.asap=function(c,d,b){if(!m.isFunction(c))throw"$.asap - argument is not a valid function";H.push(c);M.push(d?d:{});N.push(b?b:[]);a.postMessage("afm-asap","*")};a.addEventListener("message",function(c){c.source===a&&"afm-asap"=== |
|
56 c.data&&(c.stopPropagation(),0<H.length&&H.shift().apply(M.shift(),N.shift()))},!0);var O={};m.parseJS=function(c){if(c){if("string"===typeof c){var d=r.createElement("div");D?MSApp.execUnsafeLocalFunction(function(){d.innerHTML=c}):d.innerHTML=c;c=d}var b=c.getElementsByTagName("script");c=null;for(var e=0;e<b.length;e++)if(0<b[e].src.length&&!O[b[e].src]&&!D){var p=r.createElement("script");p.type=b[e].type;p.src=b[e].src;r.getElementsByTagName("head")[0].appendChild(p);O[b[e].src]=1;p=null}else a.eval(b[e].innerHTML)}}; |
|
57 "click keydown keyup keypress submit load resize change select error".split(" ").forEach(function(a){m.fn[a]=function(c){return c?this.bind(a,c):this.trigger(a)}});["focus","blur"].forEach(function(a){m.fn[a]=function(c){if(0!==this.length){if(c)this.bind(a,c);else for(c=0;c<this.length;c++)try{this[c][a]()}catch(d){}return this}}});m.Deferred=function(){return{reject:function(){},resolve:function(){},promise:{then:function(){},fail:function(){}}}};return m}(window);window.jq=af;"$"in window||(window.$= |
|
58 af);"function"===typeof define&&define.amd?define("appframework",[],function(){return af}):"undefined"!==typeof module&&module.exports&&(module.exports.af=af,module.exports.$=af);window.numOnly||(window.numOnly=function(a){if(void 0===a||""===a)return 0;if(isNaN(parseFloat(a)))if(a.replace)a=a.replace(/[^0-9.-]/g,"");else return 0;return parseFloat(a)})};/* |
|
59 BSD - https://github.com/cburgmer/ayepromise/commit/299eb65b5ce227873b2f1724c8f5b2bfa723680a |
|
60 https://github.com/cburgmer/ayepromise |
|
61 */ |
|
62 (function(a,n){a.ayepromise=n()})(this,function(){var a={},n=function(){var a=!1;return function(h){return function(){a||(a=!0,h.apply(null,arguments))}}},l=function(a){var h=a&&a.then;if(null!==a&&"object"===typeof a&&"function"===typeof h)return function(){return h.apply(a,arguments)}},k=function(f,h){var g=a.defer(),b=function(a,c){setTimeout(function(){var d;try{d=a(c)}catch(b){g.reject(b);return}d===g.promise?g.reject(new TypeError("Cannot resolve promise with itself")):g.resolve(d)},1)};return{promise:g.promise, |
|
63 callFulfilled:function(a){f&&f.call?b(f,a):g.resolve(a)},callRejected:function(a){h&&h.call?b(h,a):g.reject(a)}}};a.defer=function(){var a=0,h,g=[],b=function(c){a=1;h=c;g.forEach(function(a){a.callFulfilled(h)})},e=function(c){a=2;h=c;g.forEach(function(a){a.callRejected(h)})},c=function(c,d){var b=k(c,d);g.push(b);1===a?b.callFulfilled(h):2===a&&b.callRejected(h);return b.promise},d=function(a){var c;try{c=l(a)}catch(p){e(p);return}if(c){a=c;c=n();try{a(c(d),c(e))}catch(f){c(e)(f)}}else b(a)},p= |
|
64 n();return{resolve:p(d),reject:p(e),promise:{then:c,fail:function(a){return c(null,a)}}}};return a});(function(a){a.Deferred=ayepromise.defer})(af);/* |
|
65 MIT - https://github.com/darius/requestAnimationFrame/commit/4f27a5a21902a883330da4663bea953b2f96cb15#diff-9879d6db96fd29134fc802214163b95a |
|
66 |
|
67 http://paulirish.com/2011/requestanimationframe-for-smart-animating/ |
|
68 http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating |
|
69 requestAnimationFrame polyfill by Erik M?ller. fixes from Paul Irish and Tino Zijdel |
|
70 MIT license |
|
71 |
|
72 Adapted from https://gist.github.com/paulirish/1579671 which derived from |
|
73 http://paulirish.com/2011/requestanimationframe-for-smart-animating/ |
|
74 http://my.opera.com/emoller/blog/2011/12/20/requestanimationframe-for-smart-er-animating |
|
75 |
|
76 requestAnimationFrame polyfill by Erik M?ller. |
|
77 Fixes from Paul Irish, Tino Zijdel, Andrew Mao, Klemen Slavi?, Darius Bacon |
|
78 2011 - Intel |
|
79 Intel |
|
80 2011 Intel |
|
81 @author Intel |
|
82 @version 2.0 |
|
83 */ |
|
84 (function(a){a.fn.actionsheet=function(a){for(var k,f=0;f<this.length;f++)k=new n(this[f],a);return 1===this.length?k:this};var n=function(){var l=function(k,f){if(this.el="string"===typeof k||k instanceof String?document.getElementById(k):k){if(this instanceof l){if("object"===typeof f)for(var h in f)this[h]=f[h]}else return new l(k,f);var g=this,b;h=function(){};if("string"===typeof f)b=a("<div id='af_actionsheet'><div style='width:100%'>"+f+"<a href='javascript:;' class='cancel'>Cancel</a></div></div>"); |
|
85 else if("object"===typeof f){b=a("<div id='af_actionsheet'><div style='width:100%'></div></div>");var e=a(b.children().get(0));f.push({text:"Cancel",cssClasses:"cancel"});for(var c=0;c<f.length;c++){var d=a("<a href='javascript:;'>"+(f[c].text||"TEXT NOT ENTERED")+"</a>");d[0].onclick=f[c].handler||h;f[c].cssClasses&&0<f[c].cssClasses.length&&d.addClass(f[c].cssClasses);e.append(d)}}a(k).find("#af_actionsheet").remove();a(k).find("#af_action_mask").remove();a(k).append(b);b.vendorCss("Transition", |
|
86 "all 0ms");b.cssTranslate("0,0");b.css("top",window.innerHeight+"px");this.el.style.overflow="hidden";b.on("click","a",function(){g.hideSheet();return!1});this.activeSheet=b;a(k).append("<div id='af_action_mask' style='position:absolute;top:0px;left:0px;right:0px;bottom:0px;z-index:9998;background:rgba(0,0,0,.4)'/>");setTimeout(function(){b.vendorCss("Transition","all 300ms");b.cssTranslate("0,"+-b.height()+"px")},10);a("#af_action_mask").bind("touchstart touchmove touchend click",function(a){a.preventDefault(); |
|
87 a.stopPropagation()})}else window.alert("Could not find element for actionsheet "+k)};l.prototype={activeSheet:null,hideSheet:function(){var k=this;this.activeSheet.off("click","a",function(){k.hideSheet()});a(this.el).find("#af_action_mask").unbind("click").remove();this.activeSheet.vendorCss("Transition","all 0ms");var f=this.activeSheet,h=this.el;setTimeout(function(){f.vendorCss("Transition","all 300ms");f.cssTranslate("0,0px");setTimeout(function(){f.remove();f=null;h.style.overflow="none"}, |
|
88 500)},10)}};return l}()})(af); |
|
89 (function(a){var n=[],l=function(b,e){var c,d;c="string"===typeof b||b instanceof String?document.getElementById(b):a.is$(b)?b[0]:b;c.afCSS3AnimateId||(c.afCSS3AnimateId=a.uuid());d=c.afCSS3AnimateId;n[d]?(n[d].animate(e),c=n[d]):(c=g(c,e),n[d]=c);return c};a.fn.css3Animate=function(a){!a.complete&&a.callback&&(a.complete=a.callback);var e=l(this[0],a);a.complete=null;a.sucess=null;a.failure=null;for(var c=1;c<this.length;c++)e.link(this[c],a);return e};a.css3AnimateQueue=function(){return new g.queue}; |
|
90 var k=a.feat.cssTransformStart,f=a.feat.cssTransformEnd,h=a.feat.cssPrefix.replace(/-/g,"")+"TransitionEnd",h=a.os.fennec||""===a.feat.cssPrefix||a.os.ie?"transitionend":h,h=h.replace(h.charAt(0),h.charAt(0).toLowerCase()),g=function(){var b=function(e,c){if(!(this instanceof b))return new b(e,c);this.callbacksStack=[];this.activeEvent=null;this.countStack=0;this.isActive=!1;this.el=e;this.linkFinishedProxy=a.proxy(this.linkFinished,this);if(this.el){this.animate(c);var d=this;af(this.el).bind("destroy", |
|
91 function(){var a=d.el.afCSS3AnimateId;d.callbacksStack=[];n[a]&&delete n[a]})}};b.prototype={animate:function(b){this.isActive&&this.cancel();this.isActive=!0;if(b){var c=!!b.addClass,d,p,t=numOnly(b.time);if(c)b.removeClass?af(this.el).replaceClass(b.removeClass,b.addClass):af(this.el).addClass(b.addClass);else{0===t&&(b.time=0);b.y||(b.y=0);b.x||(b.x=0);b.previous&&(d=new a.getCssMatrix(this.el),b.y+=numOnly(d.f),b.x+=numOnly(d.e));b.origin||(b.origin="0% 0%");b.scale||(b.scale="1");b.rotateY|| |
|
92 (b.rotateY="0");b.rotateX||(b.rotateX="0");b.skewY||(b.skewY="0");b.skewX||(b.skewX="0");b.timingFunction||(b.timingFunction="linear");if("number"===typeof b.x||-1===b.x.indexOf("%")&&-1===b.x.toLowerCase().indexOf("px")&&-1===b.x.toLowerCase().indexOf("deg"))b.x=parseInt(b.x,10)+"px";if("number"===typeof b.y||-1===b.y.indexOf("%")&&-1===b.y.toLowerCase().indexOf("px")&&-1===b.y.toLowerCase().indexOf("deg"))b.y=parseInt(b.y,10)+"px";d="translate"+k+b.x+","+b.y+f+" scale("+parseFloat(b.scale)+") rotate("+ |
|
93 b.rotateX+")";a.os.opera||(d+=" rotateY("+b.rotateY+")");d+=" skew("+b.skewX+","+b.skewY+")";this.el.style[a.feat.cssPrefix+"Transform"]=d;this.el.style[a.feat.cssPrefix+"BackfaceVisibility"]="hidden";void 0!==b.opacity&&(this.el.style.opacity=b.opacity);b.width&&(this.el.style.width=b.width);b.height&&(this.el.style.height=b.height);this.el.style[a.feat.cssPrefix+"TransitionProperty"]="all";-1===(""+b.time).indexOf("s")?(d="ms",p=b.time+d):-1!==b.time.indexOf("ms")?(d="ms",p=b.time):(d="s",p=b.time+ |
|
94 d);b.delay&&(this.el.style[a.feat.cssPrefix+"TransitionDelay"]=b.delay);this.el.style[a.feat.cssPrefix+"TransitionDuration"]=p;this.el.style[a.feat.cssPrefix+"TransitionTimingFunction"]=b.timingFunction;this.el.style[a.feat.cssPrefix+"TransformOrigin"]=b.origin}this.callbacksStack.push({complete:b.complete,success:b.success,failure:b.failure});this.countStack++;var g=this;p=window.getComputedStyle(this.el);c&&(c=p[a.feat.cssPrefix+"TransitionDuration"],t=numOnly(c),b.time=t,-1!==c.indexOf("ms")?d= |
|
95 "ms":(d="s",b.time*=1E3));0===t||"ms"===d&&5>t||"none"===p.display?a.asap(a.proxy(this.finishAnimation,this,[!1])):(this.activeEvent=function(a){clearTimeout(g.timeout);g.finishAnimation(a);g.el.removeEventListener(h,g.activeEvent,!1)},g.timeout=setTimeout(this.activeEvent,numOnly(b.time)+50),this.el.addEventListener(h,this.activeEvent,!1))}else window.alert("Please provide configuration options for animation of "+this.el.id)},addCallbackHook:function(a){a&&this.callbacksStack.push(a);this.countStack++; |
|
96 return this.linkFinishedProxy},linkFinished:function(a){a?this.cancel():this.finishAnimation()},finishAnimation:function(a){a&&a.preventDefault&&a.preventDefault();this.isActive&&(this.countStack--,0===this.countStack&&this.fireCallbacks(!1))},fireCallbacks:function(a){this.clearEvents();var c=this.callbacksStack;this.cleanup();for(var d=0;d<c.length;d++){var b=c[d].complete,f=c[d].success,h=c[d].failure;"function"===typeof b&&b(a);a&&"function"===typeof h?h():"function"===typeof f&&f()}},cancel:function(){this.isActive&& |
|
97 this.fireCallbacks(!0)},cleanup:function(){this.callbacksStack=[];this.isActive=!1;this.countStack=0},clearEvents:function(){this.activeEvent&&this.el.removeEventListener(h,this.activeEvent,!1);this.activeEvent=null},link:function(a,c){var d={complete:c.complete,success:c.success,failure:c.failure};c.complete=this.addCallbackHook(d);c.success=null;c.failure=null;l(a,c);c.complete=d.complete;c.success=d.success;c.failure=d.failure;return this}};return b}();g.queue=function(){return{elements:[],push:function(a){this.elements.push(a)}, |
|
98 pop:function(){return this.elements.pop()},run:function(){var a=this;if(0!==this.elements.length&&("function"===typeof this.elements[0]&&this.shift()(),0!==this.elements.length)){var e=this.shift();0<this.elements.length&&(e.complete=function(c){c||a.run()});g(document.getElementById(e.id),e)}},shift:function(){return this.elements.shift()}}}})(af);Date.now||(Date.now=function(){return(new Date).getTime()}); |
|
99 (function(){for(var a=["webkit","moz","ms"],n=0;n<a.length&&!window.requestAnimationFrame;++n){var l=a[n];window.requestAnimationFrame=window[l+"RequestAnimationFrame"];window.cancelAnimationFrame=window[l+"CancelAnimationFrame"]||window[l+"CancelRequestAnimationFrame"]}if(/iP(ad|hone|od).*OS 6/.test(window.navigator.userAgent)||!window.requestAnimationFrame||!window.cancelAnimationFrame){var k=0;window.requestAnimationFrame=function(a){var h=Date.now(),g=Math.max(k+16,h);return setTimeout(function(){a(k= |
|
100 g)},g-h)};window.cancelAnimationFrame=clearTimeout}})(); |
|
101 (function(a){var n=[];a.fn.animateCss=function(f){var h,g="string"===typeof this[0]||this[0]instanceof String?document.getElementById(this[0]):a.is$(this[0])?this[0][0]:this[0];g.afAnimateId||(g.afAnimateId=a.uuid());h=g.afAnimateId;n[h]?(f&&n[h].animate(f),f=n[h]):(f=l(g,f),n[h]=f);return f};var l=function(a,h){if(!(this instanceof l))return new l(a,h);if(this.el=a){h&&this.animate(h);var g=this;af(this.el).bind("destroy",function(){var a=g.el.afAnimateId;n[a]&&delete n[a]})}};l.prototype={animationTimer:null, |
|
102 isAnimating:!1,startX:0,startY:0,runTime:0,endX:0,endY:0,currX:0,currY:0,animationStartTime:0,pauseTime:0,completeCB:null,easingFn:"linear",animateOpts:{},updateCb:null,animate:function(f){this.isAnimating||(this.isAnimating=!0,window.cancelAnimationFrame(this.animationTimer),f||(f={x:0,y:0,duration:0}),this.easingFn=f.easing||"linear",this.completeCB=f.complete||null,this.updateCB=f.update||null,this.runTime=numOnly(f.duration),f.complete&&delete f.complete,this.animateOpts=f,this.startTime=Date.now(), |
|
103 this.startMatrix=a.getCssMatrix(this.el),0===this.runTime&&this.doAnimate())},start:function(){this.doAnimate()},doAnimate:function(){var a=Date.now(),h,g=this;0===this.runTime||a>=this.startTime+this.runTime?(g.setPosition(this.animateOpts.x,this.animateOpts.y),g.isAnimating=!1,this.updateCB&&this.updateCB({x:this.animateOpts.x,y:this.animateOpts.y}),this.completeCB&&this.completeCB()):(a=(a-this.startTime)/this.runTime,h=k[this.easingFn](1<a?1:a),a=(this.animateOpts.x-this.startMatrix.e)*h+this.startMatrix.e, |
|
104 h=(this.animateOpts.y-this.startMatrix.f)*h+this.startMatrix.f,this.setPosition(a,h),this.updateCB&&this.updateCB({x:a,y:h}),this.isAnimating&&(this.animationTimer=window.requestAnimationFrame(function(){g.doAnimate()})))},setPosition:function(f,h){this.el.style[a.feat.cssPrefix+"Transform"]="matrix3d( 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, "+f+", "+h+", 0, 1 )";this.currX=f;this.currY=h},stop:function(){this.isAnimating=!1;window.cancelAnimationFrame(this.animationTimer);this.pauseTime=Date.now()-this.startTime}, |
|
105 resume:function(){this.isAnimating=!0;this.startTime=Date.now()-this.pauseTime;this.doAnimate()}};var k={linear:function(a){return a},easeOutSine:function(a){return Math.sin(a*Math.PI/2)}}})(af); |
|
106 (function(a){a.passwordBox=function(){return new n};var n=function(){this.oldPasswords={}};n.prototype={showPasswordPlainText:!1,getOldPasswords:function(l){var k=l&&document.getElementById(l)?document.getElementById(l):document;if(k){l=k.getElementsByTagName("input");for(k=0;k<l.length;k++)"password"===l[k].type&&a.os.webkit&&(l[k].type="text",a(l[k]).vendorCss("TextSecurity","disc"))}else window.alert("Could not find container element for passwordBox "+l)},changePasswordVisiblity:function(l,k){l= |
|
107 parseInt(l,10);var f=document.getElementById(k);1===l?a(f).vendorCss("TextSecurity","none"):a(f).vendorCss("TextSecurity","disc");a.os.webkit||(f.type=1===l?"text":"password")}}})(af); |
|
108 (function(a){function n(){if(a.os.android&&!a.os.chrome&&a.os.webkit){var f=!1;a.bind(a.touchLayer,["cancel-enter-edit","exit-edit"],function(){if(f){f=!1;for(var a in l){var b;l[a].el?b=!0:(delete l[a],b=!1);b&&l[a].androidFormsMode&&l[a].stopFormsMode()}}})}k=!0}var l=[];a.fn.scroller=function(h){for(var g,b,e=0;e<this.length;e++)g=this[e],g.afScrollerId||(g.afScrollerId=a.uuid()),b=g.afScrollerId,l[b]?g=l[b]:(h||(h={}),a.feat.nativeTouchScroll||(h.useJsScroll=!0),g=f(this[e],h),l[b]=g);return 1=== |
|
109 this.length?g:this};var k=!1,f=function(){function f(c,d){var b=document.createElement("div");b.style.position="absolute";b.style.width=c+"px";b.style.height=d+"px";b.style[a.feat.cssPrefix+"BorderRadius"]="2px";b.style.borderRadius="2px";b.style.display="none";b.className="scrollBar";b.style.background="black";return b}var g,b,e=function(c,d){this.el=c;this.afEl=a(this.el);for(var b in d)this[b]=d[b]};e.prototype={refresh:!1,refreshContent:"Pull to Refresh",refreshHangTimeout:2E3,refreshHeight:60, |
|
110 refreshElement:null,refreshCancelCB:null,refreshRunning:!1,scrollTop:0,scrollLeft:0,preventHideRefresh:!0,verticalScroll:!0,horizontalScroll:!1,refreshTriggered:!1,moved:!1,eventsActive:!1,rememberEventsActive:!1,scrollingLocked:!1,autoEnable:!0,blockFormsFix:!1,loggedPcentY:0,loggedPcentX:0,infinite:!1,infiniteEndCheck:!1,infiniteTriggered:!1,scrollSkip:!1,scrollTopInterval:null,scrollLeftInterval:null,bubbles:!0,lockBounce:!1,initScrollProgress:!1,_scrollTo:function(a,d){d=parseInt(d,10);if(0=== |
|
111 d||isNaN(d))this.el.scrollTop=Math.abs(a.y),this.el.scrollLeft=Math.abs(a.x);else{var b=(this.el.scrollTop-a.y)/Math.ceil(d/10),e=(this.el.scrollLeft-a.x)/Math.ceil(d/10),f=this,h=Math.ceil(this.el.scrollTop-a.y)/b,g=Math.ceil(this.el.scrollLeft-a.x)/b,k=0,l=0;f.scrollTopInterval=window.setInterval(function(){f.el.scrollTop-=b;l++;l>=h&&(f.el.scrollTop=a.y,clearInterval(f.scrollTopInterval))},10);f.scrollLeftInterval=window.setInterval(function(){f.el.scrollLeft-=e;k++;k>=g&&(f.el.scrollLeft=a.x, |
|
112 clearInterval(f.scrollLeftInterval))},10)}},enable:function(){},disable:function(){},hideScrollbars:function(){},addPullToRefresh:function(){},_scrollToTop:function(a){this._scrollTo({x:0,y:0},a)},_scrollToBottom:function(a){this._scrollTo({x:0,y:this.el.scrollHeight-this.el.offsetHeight},a)},scrollToBottom:function(a){return this._scrollToBottom(a)},scrollToTop:function(a){return this._scrollToTop(a)},init:function(c,d){this.el=c;this.afEl=a(this.el);this.defaultProperties();for(var b in d)this[b]= |
|
113 d[b];var e=this,f=function(){e.eventsActive&&(!a.feat.nativeTouchScroll&&(!a.ui||a.ui.activeDiv===e.container))&&e.adjustScroll()};this.afEl.bind("destroy",function(){e.disable(!0);var c=e.el.afScrollerId;l[c]&&delete l[c];a.unbind(a.touchLayer,"orientationchange-reshape",f)});a.bind(a.touchLayer,"orientationchange-reshape",f);a(window).bind("resize",f)},needsFormsFix:function(c){return this.useJsScroll&&this.isEnabled()&&"none"!==this.el.style.display&&0<a(c).closest(this.afEl).size()},handleEvent:function(a){if(!this.scrollingLocked)switch(a.type){case "touchstart":clearInterval(this.scrollTopInterval); |
|
114 this.preventHideRefresh=!this.refreshRunning;this.moved=!1;if(a.target.getAttribute("no-scroll"))return a.preventDefault();this.onTouchStart(a);this.bubbles||a.stopPropagation();break;case "touchmove":this.onTouchMove(a);this.bubbles||a.stopPropagation();break;case "touchend":this.onTouchEnd(a);this.bubbles||a.stopPropagation();break;case "scroll":this.onScroll(a)}},coreAddPullToRefresh:function(c){c&&(this.refreshElement=c);null===this.refreshElement?(c=document.getElementById(this.container.id+ |
|
115 "_pulldown"),c=null!==c?a(c):a("<div id='"+this.container.id+"_pulldown' class='afscroll_refresh' style='position:relative;height:60px;text-align:center;line-height:60px;font-weight:bold;'>"+this.refreshContent+"</div>")):c=a(this.refreshElement);c=c.get(0);this.refreshContainer=a("<div style='overflow:hidden;height:0;width:100%;display:none;background:inherit;-webkit-backface-visibility: hidden !important;'></div>");a(this.el).prepend(this.refreshContainer.prepend(c));this.refreshContainer=this.refreshContainer[0]}, |
|
116 fireRefreshRelease:function(c){if(this.refresh&&c&&(this.setRefreshContent("Refreshing..."),c=!1!==a.trigger(this,"refresh-release",[c]),this.preventHideRefresh=!1,this.refreshRunning=!0,c)){var d=this;0<this.refreshHangTimeout&&(this.refreshCancelCB=setTimeout(function(){d.hideRefresh()},this.refreshHangTimeout))}},setRefreshContent:function(c){a(this.container).find(".afscroll_refresh").html(c)},lock:function(){this.scrollingLocked||(this.scrollingLocked=!0,(this.rememberEventsActive=this.eventsActive)&& |
|
117 this.disable())},unlock:function(){this.scrollingLocked&&(this.scrollingLocked=!1,this.rememberEventsActive&&this.enable())},scrollToItem:function(c,d){a.is$(c)||(c=a(c));var b,e;"bottom"===d?(b=c.offset(),b=b.top-this.afEl.offset().bottom+b.height,b+=4):(b=c.offset().top,b-=document.body.scrollTop,e=this.afEl.offset().top,document.body.scrollTop<e&&(b-=e),b-=4);this.scrollBy({y:b,x:0},0)},setPaddings:function(c,d){var b=a(this.el),e=numOnly(b.css("paddingTop"));b.css("paddingTop",c+"px").css("paddingBottom", |
|
118 d+"px");this.scrollBy({y:c-e,x:0})},divide:function(a,d){return 0!==d?a/d:0},isEnabled:function(){return this.eventsActive},addInfinite:function(){this.infinite=!0},clearInfinite:function(){this.infiniteTriggered=!1;this.scrollSkip=!0},scrollTo:function(a,d){return this._scrollTo(a,d)},updateP2rHackPosition:function(){}};g=function(c,d){this.init(c,d);if(d.hasParent)this.container=this.el.parentNode;else{var b=a.create("div",{});b.append(a(this.el).contents());a(this.el).append(b);this.container= |
|
119 this.el;this.el=b.get(0)}this.container.afScrollerId=c.afScrollerId;this.afEl=a(this.container);"hidden"!==this.container.style.overflow&&(this.container.style.overflow="hidden");this.addPullToRefresh(null,!0);d.autoEnable&&(this.autoEnable=d.autoEnable);this.autoEnable&&this.enable(!0);this.verticalScroll&&(!0===this.verticalScroll&&!0===this.scrollBars)&&(b=f(5,20),b.style.top="0px",this.vScrollCSS&&(b.className=this.vScrollCSS),b.style.display="none",this.container.appendChild(b),this.vscrollBar= |
|
120 b);this.horizontalScroll&&(!0===this.horizontalScroll&&!0===this.scrollBars)&&(b=f(20,5),b.style.bottom="0px",this.hScrollCSS&&(b.className=this.hScrollCSS),b.style.display="none",this.container.appendChild(b),this.hscrollBar=b);this.horizontalScroll&&(this.el.style.cssFloat="left");this.el.hasScroller=!0};b=function(c,d){d.nativeParent&&(c=c.parentNode);this.init(c,d);var b=a(c);if(!0===d.replaceParent){var e=b.parent();b.css("height",e.height()).css("width",e.width());b.insertBefore(b.parent()); |
|
121 e.remove()}this.container=this.el;b.css("-webkit-overflow-scrolling","touch");d.autoEnable&&(this.autoEnable=d.autoEnable);this.autoEnable&&this.enable()};b.prototype=new e;g.prototype=new e;b.prototype.defaultProperties=function(){this.refreshContainer=null;this.dX=this.cX=this.dY=this.cY=0;this.cancelPropagation=!1;this.yReset=this.xReset=this.loggedPcentX=this.loggedPcentY=0;var a=this;this.adjustScrollOverflowProxy=function(){a.afEl.css("overflow","auto");a.afEl.parent().css("overflow","hidden")}}; |
|
122 b.prototype.enable=function(a){this.eventsActive||(this.eventsActive=!0,this.el.style.overflow="auto",a?this.scrollToTop(0):this.adjustScroll(),this.el.addEventListener("touchstart",this,!1),this.el.addEventListener("scroll",this,!1),this.updateP2rHackPosition())};b.prototype.disable=function(c){this.eventsActive&&(this.logPos(this.el.scrollLeft,this.el.scrollTop),!c&&!a.ui&&(this.el.style.overflow="hidden"),this.el.removeEventListener("touchstart",this,!1),this.el.removeEventListener("touchmove", |
|
123 this,!1),this.el.removeEventListener("touchend",this,!1),this.el.removeEventListener("scroll",this,!1),this.eventsActive=!1)};b.prototype.addPullToRefresh=function(a,d){d||(this.refresh=!0);this.refresh&&!0===this.refresh&&(this.coreAddPullToRefresh(a),this.refreshContainer.style.position="absolute",this.refreshContainer.style.top="-60px",this.refreshContainer.style.height="60px",this.refreshContainer.style.display="block",this.updateP2rHackPosition())};b.prototype.updateP2rHackPosition=function(){if(!this.refresh)return a(this.el).find(".p2rhack").remove(); |
|
124 var c=a(this.el).find(".p2rhack");0===c.length&&(a(this.el).append("<div class='p2rhack' style='position:absolute;width:1px;height:1px;opacity:0;background:transparent;z-index:-1;-webkit-transform:translate3d(-1px,0,0);'></div>"),c=a(this.el).find(".p2rhack"));c.css("top",this.el.scrollHeight+this.refreshHeight+1+"px")};b.prototype.onTouchStart=function(a){this.lastScrollInfo={top:0};this.xReset=this.yReset=0;this.verticalScroll&&(0===this.el.scrollTop&&this.refresh&&(this.el.scrollTop=1,this.yReset= |
|
125 -1),this.el.scrollTop===this.el.scrollHeight-this.el.clientHeight&&this.infinite&&(this.el.scrollTop-=1,this.yReset=1));this.horizontalScroll&&(0===this.el.scrollLeft&&(this.el.scrollLeft=1,this.xReset=-1),this.el.scrollLeft===this.el.scrollWidth-this.el.clientWidth&&(this.el.scrollLeft-=1,this.xReset=1));this.refreshCancelCB&&clearTimeout(this.refreshCancelCB);this.refresh&&this.el.addEventListener("touchend",this,!1);this.el.addEventListener("touchmove",this,!1);this.dY=a.touches[0].pageY;this.dX= |
|
126 a.touches[0].pageX;this.startTop=this.el.scrollTop;this.startLeft=this.el.scrollLeft;(this.refresh||this.infinite)&&this.refresh&&0>this.dY&&this.showRefresh()};b.prototype.onTouchMove=function(c){var d=c.touches[0].pageY-this.dY,b=c.touches[0].pageX-this.dX,e=this.el.scrollHeight-this.el.scrollTop===this.el.clientHeight&&0>d,f=this.el.scrollWidth-this.el.scrollLeft===this.el.clientWidth&&0>b,h="input"!==c.target.tagName.toLowerCase();this.verticalScroll&&0===this.startTop&&0===this.el.scrollTop&& |
|
127 0<d&&h&&c.preventDefault();this.horizontalScroll&&0===this.startTop&&0===this.el.scrollLeft&&0<b&&h&&c.preventDefault();this.verticalScroll&&e&&h&&c.preventDefault();this.horizontalScroll&&f&&h&&c.preventDefault();this.moved||(a.trigger(this,"scrollstart",[this.el,{x:b,y:d}]),a.trigger(a.touchLayer,"scrollstart",[this.el,{x:b,y:d}]),this.refresh||this.el.addEventListener("touchend",this,!1),this.moved=!0);this.horizontalScroll&&Math.abs(d)>Math.abs(b)&&c.preventDefault();this.refresh&&this.el.scrollTop< |
|
128 -this.refreshHeight?this.showRefresh():this.refresh&&this.refreshTriggered&&this.refreshRunning&&this.el.scrollTop>this.refreshHeight?(this.refreshRunning=this.refreshTriggered=!1,this.refreshCancelCB&&clearTimeout(this.refreshCancelCB),this.hideRefresh(!1),this.setRefreshContent("Pull to Refresh"),a.trigger(this,"refresh-cancel")):this.refresh&&(this.refreshTriggered&&!this.refreshRunning&&this.el.scrollTop>-this.refreshHeight)&&(this.refreshRunning=this.refreshTriggered=!1,this.refreshCancelCB&& |
|
129 clearTimeout(this.refreshCancelCB),this.hideRefresh(!1),this.setRefreshContent("Pull to Refresh"),a.trigger(this,"refresh-cancel"));this.cY=d;this.cX=b;this.lastScrollInfo.top=this.cY;this.initScrollProgress&&(a.trigger(this,"scroll",[{x:-this.el.scrollLeft,y:-this.el.scrollTop}]),a.trigger(a.touchLayer,"scroll",[{x:-this.el.scrollLeft,y:-this.el.scrollTop}]))};b.prototype.showRefresh=function(){this.refreshTriggered||(this.refreshTriggered=!0,this.setRefreshContent("Release to Refresh"),a.trigger(this, |
|
130 "refresh-trigger"))};b.prototype.onTouchEnd=function(){var c=this.el.scrollTop<=-this.refreshHeight;this.fireRefreshRelease(c,!0);this.moved||(this.el.scrollTop+=this.yReset,this.el.scrollLeft+=this.xReset);if(c&&this.refresh){var d=a.create("<div style='height:"+this.el.clientHeight+this.refreshHeight+"px;width:1px;-webkit-transform:translated3d(-1px,0,0)'></div>");a(this.el).append(d);this.refreshContainer.style.top="0px";this.refreshContainer.style.position="";setTimeout(function(){d.remove()})}this.el.removeEventListener("touchmove", |
|
131 this,!1);this.el.removeEventListener("touchend",this,!1);this.infiniteEndCheck=!0;this.infinite&&(!this.infiniteTriggered&&this.el.scrollTop>=this.el.scrollHeight-this.el.clientHeight)&&(this.infiniteTriggered=!0,a.trigger(this,"infinite-scroll"),this.infiniteEndCheck=!0);this.touchEndFired=!0;var b=this,e=this.el.scrollTop,f=this.el.scrollLeft,h=0;clearInterval(b.nativePolling);b.nativePolling=setInterval(function(){h++;25===h&&b.initScrollProgress&&(a.trigger(b,"scroll",[{x:-b.el.scrollLeft+b.cX, |
|
132 y:-b.el.scrollTop+b.cY}]),a.trigger(a.touchLayer,"scroll",[{x:-b.el.scrollLeft+b.cX,y:-b.el.scrollTop+b.cY}]));if(200<=h)clearInterval(b.nativePolling),b.initScrollProgress&&(a.trigger(b,"scroll",[{x:-b.el.scrollLeft,y:-b.el.scrollTop}]),a.trigger(a.touchLayer,"scroll",[{x:-b.el.scrollLeft,y:-b.el.scrollTop}]));else if(b.el.scrollTop!==e||b.el.scrollLeft!==f)clearInterval(b.nativePolling),a.trigger(a.touchLayer,"scrollend",[b.el]),a.trigger(b,"scrollend",[b.el]),b.initScrollProgress&&(a.trigger(b, |
|
133 "scroll",[{x:-b.el.scrollLeft,y:-b.el.scrollTop}]),a.trigger(a.touchLayer,"scroll",[{x:-b.el.scrollLeft,y:-b.el.scrollTop}]))},20)};b.prototype.hideRefresh=function(c){if(!this.preventHideRefresh){var d=this,b=function(c){d.refreshContainer.style.top="-60px";d.refreshContainer.style.position="absolute";d.dY=d.cY=0;c||(d.el.style[a.feat.cssPrefix+"Transform"]="none",d.el.style[a.feat.cssPrefix+"TransitionProperty"]="none",d.el.scrollTop=0,d.logPos(d.el.scrollLeft,0),d.refreshRunning=!1,d.setRefreshContent("Pull to Refresh"), |
|
134 a.trigger(d,"refresh-finish"))};!1===c||!d.afEl.css3Animate?b():d.afEl.css3Animate({y:d.el.scrollTop-d.refreshHeight+"px",x:"0%",time:"325ms",complete:b});this.refreshTriggered=!1}};b.prototype.hideScrollbars=function(){};b.prototype.scrollTo=function(a,d){this.logPos(a.x,a.y);a.x*=-1;a.y*=-1;return this._scrollTo(a,d)};b.prototype.scrollBy=function(a,d){a.x+=this.el.scrollLeft;a.y+=this.el.scrollTop;this.logPos(this.el.scrollLeft,this.el.scrollTop);return this._scrollTo(a,d)};b.prototype.scrollToBottom= |
|
135 function(a){this._scrollToBottom(a);this.logPos(this.el.scrollLeft,this.el.scrollTop)};b.prototype.onScroll=function(){this.infinite&&this.touchEndFired?this.touchEndFired=!1:this.scrollSkip?this.scrollSkip=!1:(this.infinite&&(!this.infiniteTriggered&&this.el.scrollTop>=this.el.scrollHeight-this.el.clientHeight)&&(this.infiniteTriggered=!0,a.trigger(this,"infinite-scroll"),this.infiniteEndCheck=!0),this.infinite&&(this.infiniteEndCheck&&this.infiniteTriggered)&&(this.infiniteEndCheck=!1,a.trigger(this, |
|
136 "infinite-scroll-end")))};b.prototype.logPos=function(a,d){this.loggedPcentX=this.divide(a,this.el.scrollWidth);this.loggedPcentY=this.divide(d,this.el.scrollHeight);this.scrollLeft=a;this.scrollTop=d;isNaN(this.loggedPcentX)&&(this.loggedPcentX=0);isNaN(this.loggedPcentY)&&(this.loggedPcentY=0)};b.prototype.adjustScroll=function(){this.adjustScrollOverflowProxy();this.el.scrollLeft=this.loggedPcentX*this.el.scrollWidth;this.el.scrollTop=this.loggedPcentY*this.el.scrollHeight;this.logPos(this.el.scrollLeft, |
|
137 this.el.scrollTop)};g.prototype.defaultProperties=function(){this.boolScrollLock=!1;this.elementInfo=this.currentScrollingObject=null;this.verticalScroll=!0;this.horizontalScroll=!1;this.scrollBars=!0;this.hscrollBar=this.vscrollBar=null;this.vScrollCSS=this.hScrollCSS="scrollBar";this.firstEventInfo=null;this.moved=!1;this.preventPullToRefresh=!0;this.refreshSafeKeep=this.androidFormsMode=this.isScrolling=!1;this.lastScrollbar="";this.scrollingFinishCB=this.container=this.finishScrollingObject=null; |
|
138 this.androidPerfHack=this.loggedPcentX=this.loggedPcentY=0};g.prototype.enable=function(a){this.eventsActive||(this.eventsActive=!0,a?this.scrollerMoveCSS({x:0,y:0},0):this.adjustScroll(),this.container.addEventListener("touchstart",this,!1),this.container.addEventListener("touchmove",this,!1),this.container.addEventListener("touchend",this,!1))};g.prototype.adjustScroll=function(){var a=this.getViewportSize();this.scrollerMoveCSS({x:Math.round(this.loggedPcentX*(this.el.clientWidth-a.w)),y:Math.round(this.loggedPcentY* |
|
139 (this.el.clientHeight-a.h))},0)};g.prototype.disable=function(){if(this.eventsActive){var a=this.getCSSMatrix(this.el);this.logPos(numOnly(a.e)-numOnly(this.container.scrollLeft),numOnly(a.f)-numOnly(this.container.scrollTop));this.container.removeEventListener("touchstart",this,!1);this.container.removeEventListener("touchmove",this,!1);this.container.removeEventListener("touchend",this,!1);this.eventsActive=!1}};g.prototype.addPullToRefresh=function(a,d){d||(this.refresh=!0);this.refresh&&!0=== |
|
140 this.refresh&&(this.coreAddPullToRefresh(a),this.el.style.overflow="visible")};g.prototype.hideScrollbars=function(){this.hscrollBar&&(this.hscrollBar.style.display="none",this.hscrollBar.style[a.feat.cssPrefix+"TransitionDuration"]="0ms");this.vscrollBar&&(this.vscrollBar.style.display="none",this.vscrollBar.style[a.feat.cssPrefix+"TransitionDuration"]="0ms")};g.prototype.getViewportSize=function(){var a=window.getComputedStyle(this.container);isNaN(numOnly(a.paddingTop))&&window.alert(typeof a.paddingTop+ |
|
141 "::"+a.paddingTop+":");return{h:this.container.clientHeight>window.innerHeight?window.innerHeight:this.container.clientHeight-numOnly(a.paddingTop)-numOnly(a.paddingBottom),w:this.container.clientWidth>window.innerWidth?window.innerWidth:this.container.clientWidth-numOnly(a.paddingLeft)-numOnly(a.paddingRight)}};g.prototype.onTouchStart=function(c){this.moved=!1;this.currentScrollingObject=null;a(this.el).animateCss().stop();if(this.container&&(this.refreshCancelCB&&(clearTimeout(this.refreshCancelCB), |
|
142 this.refreshCancelCB=null),this.scrollingFinishCB&&(clearTimeout(this.scrollingFinishCB),this.scrollingFinishCB=null),!(1!==c.touches.length||this.boolScrollLock)&&!(c.touches[0].target&&void 0!==c.touches[0].target.type&&"select"===c.touches[0].target.tagName.toLowerCase()))){var d={top:0,left:0,speedY:0,speedX:0,absSpeedY:0,absSpeedX:0,deltaY:0,deltaX:0,absDeltaY:0,absDeltaX:0,y:0,x:0,duration:0};this.elementInfo={};var b=this.getViewportSize();this.elementInfo.bottomMargin=b.h;this.elementInfo.maxTop= |
|
143 this.el.clientHeight-this.elementInfo.bottomMargin;0>this.elementInfo.maxTop&&(this.elementInfo.maxTop=0);this.elementInfo.divHeight=this.el.clientHeight;this.elementInfo.rightMargin=b.w;this.elementInfo.maxLeft=this.el.clientWidth-this.elementInfo.rightMargin;0>this.elementInfo.maxLeft&&(this.elementInfo.maxLeft=0);this.elementInfo.divWidth=this.el.clientWidth;this.elementInfo.hasVertScroll=this.verticalScroll||0<this.elementInfo.maxTop;this.elementInfo.hasHorScroll=0<this.elementInfo.maxLeft;this.elementInfo.requiresVScrollBar= |
|
144 this.vscrollBar&&this.elementInfo.hasVertScroll;this.elementInfo.requiresHScrollBar=this.hscrollBar&&this.elementInfo.hasHorScroll;this.saveEventInfo(c);this.saveFirstEventInfo(c);c=this.getCSSMatrix(this.el);d.top=numOnly(c.f)-numOnly(this.container.scrollTop);d.left=numOnly(c.e)-numOnly(this.container.scrollLeft);this.container.scrollTop=this.container.scrollLeft=0;this.currentScrollingObject=this.el;this.refresh&&0===d.top?(this.refreshContainer.style.display="block",this.refreshHeight=this.refreshContainer.firstChild.clientHeight, |
|
145 this.refreshContainer.firstChild.style.top=-this.refreshHeight+"px",this.refreshContainer.style.overflow="visible",this.preventPullToRefresh=!1):0>d.top&&(this.preventPullToRefresh=!0,this.refresh&&(this.refreshContainer.style.overflow="hidden"));d.x=d.left;d.y=d.top;this.setVScrollBar(d,0,0)&&(this.vscrollBar.style.right="0px",this.vscrollBar.style[a.feat.cssPrefix+"Transition"]="",a(this.vscrollBar).animateCss().stop());this.setHScrollBar(d,0,0)&&(this.container.clientHeight>window.innerHeight? |
|
146 this.hscrollBar.style.top=window.innerHeight-numOnly(this.hscrollBar.style.height)+"px":this.hscrollBar.style.bottom=numOnly(this.hscrollBar.style.height),this.hscrollBar.style[a.feat.cssPrefix+"Transition"]="",a(this.hscrollBar).animateCss().stop());this.lastScrollInfo=d;this.hasMoved=!1;0===this.elementInfo.maxTop&&0===this.elementInfo.maxLeft&&this.lockBounce?this.scrollToTop(0):this.scrollerMoveCSS(this.lastScrollInfo,0);this.scrollerMoveCSS(this.lastScrollInfo,0)}};g.prototype.getCSSMatrix=function(c){if(this.androidFormsMode){var d= |
|
147 parseInt(c.style.marginTop,10);c=parseInt(c.style.marginLeft,10);isNaN(d)&&(d=0);isNaN(c)&&(c=0);return{f:d,e:c}}return a.getCssMatrix(c)};g.prototype.saveEventInfo=function(a){this.lastEventInfo={pageX:a.touches[0].pageX,pageY:a.touches[0].pageY,time:a.timeStamp}};g.prototype.saveFirstEventInfo=function(a){this.firstEventInfo={pageX:a.touches[0].pageX,pageY:a.touches[0].pageY,time:a.timeStamp}};g.prototype.setVScrollBar=function(a,d,b){if(!this.elementInfo.requiresVScrollBar)return!1;var e=parseFloat(this.elementInfo.bottomMargin/ |
|
148 this.elementInfo.divHeight)*this.elementInfo.bottomMargin+"px";numOnly(e)>this.elementInfo.bottomMargin&&(e=this.elementInfo.bottomMargin+"px");e!==this.vscrollBar.style.height&&(this.vscrollBar.style.height=e);a=this.elementInfo.bottomMargin-numOnly(this.vscrollBar.style.height)-(this.elementInfo.maxTop+a.y)/this.elementInfo.maxTop*(this.elementInfo.bottomMargin-numOnly(this.vscrollBar.style.height));a>this.elementInfo.bottomMargin&&(a=this.elementInfo.bottomMargin);0>a&&(a=0);this.scrollbarMoveCSS(this.vscrollBar, |
|
149 {x:0,y:a},d,b);return!0};g.prototype.setHScrollBar=function(a,d,b){if(!this.elementInfo.requiresHScrollBar)return!1;var e=parseFloat(this.elementInfo.rightMargin/this.elementInfo.divWidth)*this.elementInfo.rightMargin+"px";e!==this.hscrollBar.style.width&&(this.hscrollBar.style.width=e);a=this.elementInfo.rightMargin-numOnly(this.hscrollBar.style.width)-(this.elementInfo.maxLeft+a.x)/this.elementInfo.maxLeft*(this.elementInfo.rightMargin-numOnly(this.hscrollBar.style.width));a>this.elementInfo.rightMargin&& |
|
150 (a=this.elementInfo.rightMargin);0>a&&(a=0);this.scrollbarMoveCSS(this.hscrollBar,{x:a,y:0},d,b);return!0};g.prototype.onTouchMove=function(c){if(null!==this.currentScrollingObject&&(!c.target||!(c.target.getAttribute("type")&&-1!==c.target.getAttribute("type").toLowerCase().indexOf("range")))){var d=this.calculateMovement(c);this.calculateTarget(d);this.lastScrollInfo=d;this.moved||(a.trigger(this,"scrollstart",[this.el,{x:this.lastScrollInfo.top,y:this.lastScrollInfo.left}]),a.trigger(a.touchLayer, |
|
151 "scrollstart",[this.el,{x:this.lastScrollInfo.top,y:this.lastScrollInfo.left}]),this.elementInfo.requiresVScrollBar&&(this.vscrollBar.style.display="block"),this.elementInfo.requiresHScrollBar&&(this.hscrollBar.style.display="block"));this.moved=!0;this.refresh&&0===d.top?(this.refreshContainer.style.display="block",this.refreshHeight=this.refreshContainer.firstChild.clientHeight,this.refreshContainer.firstChild.style.top=-this.refreshHeight+"px",this.refreshContainer.style.overflow="visible",this.preventPullToRefresh= |
|
152 !1):0>d.top&&(this.preventPullToRefresh=!0,this.refresh&&(this.refreshContainer.style.overflow="hidden"));this.saveEventInfo(c);if(!1===this.isScrolling&&(this.isScrolling=!0,this.onScrollStart))this.onScrollStart();c=this.getCSSMatrix(this.el);this.lastScrollInfo.top=numOnly(c.f);this.lastScrollInfo.left=numOnly(c.e);this.recalculateDeltaY(this.lastScrollInfo);this.recalculateDeltaX(this.lastScrollInfo);this.checkYboundary(this.lastScrollInfo);this.elementInfo.hasHorScroll&&this.checkXboundary(this.lastScrollInfo); |
|
153 c=0<this.lastScrollInfo.y&&0<this.lastScrollInfo.deltaY;var b=this.lastScrollInfo.y<-this.elementInfo.maxTop&&0>this.lastScrollInfo.deltaY,e;if(c||b)d=c?this.lastScrollInfo.y:-this.lastScrollInfo.y-this.elementInfo.maxTop,d=(this.container.clientHeight-d)/this.container.clientHeight,0.5>d&&(d=0.5),e=0,c&&0<this.lastScrollInfo.top||b&&this.lastScrollInfo.top<-this.elementInfo.maxTop?e=this.lastScrollInfo.top:b&&(e=-this.elementInfo.maxTop),b=this.lastScrollInfo.deltaY*d,1>Math.abs(this.lastScrollInfo.deltaY* |
|
154 d)&&(b=c?1:-1),this.lastScrollInfo.y=e+b;if(this.elementInfo.hasHorScroll&&(c=0<this.lastScrollInfo.x&&0<this.lastScrollInfo.deltaX,b=this.lastScrollInfo.x<-this.elementInfo.maxLeft&&0>this.lastScrollInfo.deltaX,c||b))d=c?this.lastScrollInfo.x:-this.lastScrollInfo.x-this.elementInfo.maxLeft,d=(this.container.clientWidth-d)/this.container.clientWidth,0.5>d&&(d=0.5),e=0,c&&0<this.lastScrollInfo.left||b&&this.lastScrollInfo.left<-this.elementInfo.maxLeft?e=this.lastScrollInfo.left:b&&(e=-this.elementInfo.maxLeft), |
|
155 b=this.lastScrollInfo.deltaX*d,1>Math.abs(this.lastScrollInfo.deltaX*d)&&(b=c?1:-1),this.lastScrollInfo.x=e+b;this.lockBounce&&!this.refresh&&(0<this.lastScrollInfo.x?this.lastScrollInfo.x=0:-1*this.lastScrollInfo.x>this.elementInfo.maxLeft&&(this.lastScrollInfo.x=-1*this.elementInfo.maxLeft),0<this.lastScrollInfo.y?this.lastScrollInfo.y=0:-1*this.lastScrollInfo.y>this.elementInfo.maxTop&&(this.lastScrollInfo.y=-1*this.elementInfo.maxTop));this.scrollerMoveCSS(this.lastScrollInfo,0);this.setVScrollBar(this.lastScrollInfo, |
|
156 0,0);this.setHScrollBar(this.lastScrollInfo,0,0);this.refresh&&!this.preventPullToRefresh&&(!this.refreshTriggered&&this.lastScrollInfo.top>this.refreshHeight?(this.refreshTriggered=!0,this.setRefreshContent("Release to Refresh"),a.trigger(this,"refresh-trigger")):this.refreshTriggered&&this.lastScrollInfo.top<this.refreshHeight&&(this.refreshTriggered=!1,this.setRefreshContent("Pull to Refresh"),a.trigger(this,"refresh-cancel")));this.infinite&&!this.infiniteTriggered&&Math.abs(this.lastScrollInfo.top)> |
|
157 this.el.clientHeight-this.container.clientHeight&&(this.infiniteTriggered=!0,a.trigger(this,"infinite-scroll"))}};g.prototype.calculateMovement=function(a,d){var b={top:0,left:0,speedY:0,speedX:0,absSpeedY:0,absSpeedX:0,deltaY:0,deltaX:0,absDeltaY:0,absDeltaX:0,y:0,x:0,duration:0},e=d?this.firstEventInfo:this.lastEventInfo,f=d?a.pageX:a.touches[0].pageX,h=d?a.pageY:a.touches[0].pageY,g=d?a.time:a.timeStamp;b.deltaY=this.elementInfo.hasVertScroll?h-e.pageY:0;b.deltaX=this.elementInfo.hasHorScroll? |
|
158 f-e.pageX:0;b.time=g;b.duration=g-e.time;return b};g.prototype.calculateTarget=function(a){a.y=this.lastScrollInfo.y+a.deltaY;a.x=this.lastScrollInfo.x+a.deltaX;0<Math.abs(a.deltaY)&&(a.y+=(0<a.deltaY?1:-1)*this.elementInfo.divHeight*this.androidPerfHack);0<Math.abs(a.deltaX)&&(a.x+=(0<a.deltaX?1:-1)*this.elementInfo.divWidth*this.androidPerfHack)};g.prototype.checkYboundary=function(a){var d=this.container.clientHeight/2,b=this.elementInfo.maxTop+d;if(a.y>d)a.y=d;else if(-a.y>b)a.y=-b;else return; |
|
159 this.recalculateDeltaY(a)};g.prototype.checkXboundary=function(a){var d=this.container.clientWidth/2,b=this.elementInfo.maxLeft+d;if(a.x>d)a.x=d;else if(-a.x>b)a.x=-b;else return;this.recalculateDeltaX(a)};g.prototype.recalculateDeltaY=function(a){var d=Math.abs(a.deltaY);a.deltaY=a.y-a.top;var b=Math.abs(a.deltaY);a.duration=a.duration*b/d};g.prototype.recalculateDeltaX=function(a){var d=Math.abs(a.deltaX);a.deltaX=a.x-a.left;var b=Math.abs(a.deltaX);a.duration=a.duration*b/d};g.prototype.hideRefresh= |
|
160 function(b){var d=this;if(!this.preventHideRefresh){var e=function(){d.setRefreshContent("Pull to Refresh");a.trigger(d,"refresh-finish")};this.scrollerMoveCSS({x:0,y:0},325);!1===b||!d.afEl.css3Animate?e():d.afEl.css3Animate({time:"325ms",complete:e});this.refreshTriggered=!1}};g.prototype.setMomentum=function(a){a.speedY=this.divide(a.deltaY,a.duration);a.speedX=this.divide(a.deltaX,a.duration);a.absSpeedY=Math.abs(a.speedY);a.absSpeedX=Math.abs(a.speedX);a.absDeltaY=Math.abs(a.deltaY);a.absDeltaX= |
|
161 Math.abs(a.deltaX);if(0<a.absDeltaY){if(a.deltaY=(0>a.deltaY?-1:1)*a.absSpeedY*a.absSpeedY/0.0024,a.absDeltaY=Math.abs(a.deltaY),a.duration=a.absSpeedY/0.0012,a.speedY=a.deltaY/a.duration,a.absSpeedY=Math.abs(a.speedY),0.12>a.absSpeedY||5>a.absDeltaY)a.deltaY=a.absDeltaY=a.duration=a.speedY=a.absSpeedY=0}else if(a.absDeltaX){if(a.deltaX=(0>a.deltaX?-1:1)*a.absSpeedX*a.absSpeedX/0.0024,a.absDeltaX=Math.abs(a.deltaX),a.duration=a.absSpeedX/0.0012,a.speedX=a.deltaX/a.duration,a.absSpeedX=Math.abs(a.speedX), |
|
162 0.12>a.absSpeedX||5>a.absDeltaX)a.deltaX=a.absDeltaX=a.duration=a.speedX=a.absSpeedX=0}else a.duration=0};g.prototype.onTouchEnd=function(){var b=this;if(null!==this.currentScrollingObject&&this.moved){this.finishScrollingObject=this.currentScrollingObject;this.currentScrollingObject=null;var d=this.calculateMovement(this.lastEventInfo,!0);this.androidFormsMode||this.setMomentum(d);this.calculateTarget(d);var e=this.getCSSMatrix(this.el);d.top=numOnly(e.f);d.left=numOnly(e.e);this.checkYboundary(d); |
|
163 this.elementInfo.hasHorScroll&&this.checkXboundary(d);e=!this.preventPullToRefresh&&(d.top>this.refreshHeight||d.y>this.refreshHeight);this.fireRefreshRelease(e,0<d.top);if(this.refresh&&e)d.y=this.refreshHeight,d.duration=325;else if(0<=d.y)d.y=0,0<=d.top&&(d.duration=325);else if(-d.y>this.elementInfo.maxTop||0===this.elementInfo.maxTop)d.y=-this.elementInfo.maxTop,-d.top>this.elementInfo.maxTop&&(d.duration=325);if(this.elementInfo.hasHorScroll)if(0<=d.x)d.x=0,0<=d.left&&this.refresh&&(d.duration= |
|
164 325);else if(-d.x>this.elementInfo.maxLeft||0===this.elementInfo.maxLeft)d.x=-this.elementInfo.maxLeft,-d.left>this.elementInfo.maxLeft&&this.refresh&&(d.duration=325);if(d.x===d.left&&d.y===d.top||this.androidFormsMode)d.duration=0;setTimeout(function(){b.scrollerMoveCSS(d,d.duration,"cubic-bezier(0.33,0.66,0.66,1)")});this.setVScrollBar(d,d.duration,"cubic-bezier(0.33,0.66,0.66,1)");this.setHScrollBar(d,d.duration,"cubic-bezier(0.33,0.66,0.66,1)");this.setFinishCalback(d.duration);this.infinite&& |
|
165 !this.infiniteTriggered&&Math.abs(d.y)>=this.el.clientHeight-this.container.clientHeight&&(b=this,setTimeout(function(){b.infiniteTriggered=!0;a.trigger(b,"infinite-scroll")},d.duration-50))}};g.prototype.setFinishCalback=function(b){var d=this;this.scrollingFinishCB=setTimeout(function(){d.hideScrollbars();a.trigger(a.touchLayer,"scrollend",[d.el]);a.trigger(d,"scrollend",[d.el]);d.isScrolling=!1;d.elementInfo=null;d.infinite&&d.infiniteTriggered&&a.trigger(d,"infinite-scroll-end")},b)};g.prototype.startFormsMode= |
|
166 function(){if(!this.blockFormsFix){var b=this.getCSSMatrix(this.el);this.refreshSafeKeep=this.refresh;this.refresh=!1;this.androidFormsMode=!0;this.el.style[a.feat.cssPrefix+"Transform"]="none";this.el.style[a.feat.cssPrefix+"Transition"]="none";this.el.style[a.feat.cssPrefix+"Perspective"]="none";this.scrollerMoveCSS({x:numOnly(b.e),y:numOnly(b.f)},0);this.container.style[a.feat.cssPrefix+"Perspective"]="none";this.container.style[a.feat.cssPrefix+"BackfaceVisibility"]="visible";this.vscrollBar&& |
|
167 (this.vscrollBar.style[a.feat.cssPrefix+"Transform"]="none",this.vscrollBar.style[a.feat.cssPrefix+"Transition"]="none",this.vscrollBar.style[a.feat.cssPrefix+"Perspective"]="none",this.vscrollBar.style[a.feat.cssPrefix+"BackfaceVisibility"]="visible");this.hscrollBar&&(this.hscrollBar.style[a.feat.cssPrefix+"Transform"]="none",this.hscrollBar.style[a.feat.cssPrefix+"Transition"]="none",this.hscrollBar.style[a.feat.cssPrefix+"Perspective"]="none",this.hscrollBar.style[a.feat.cssPrefix+"BackfaceVisibility"]= |
|
168 "visible")}};g.prototype.stopFormsMode=function(){if(!this.blockFormsFix){var b=this.getCSSMatrix(this.el);this.refresh=this.refreshSafeKeep;this.androidFormsMode=!1;this.el.style[a.feat.cssPrefix+"Perspective"]=1E3;this.el.style.marginTop=0;this.el.style.marginLeft=0;this.el.style[a.feat.cssPrefix+"Transition"]="0ms linear";this.scrollerMoveCSS({x:numOnly(b.e),y:numOnly(b.f)},0);this.container.style[a.feat.cssPrefix+"Perspective"]=1E3;this.container.style[a.feat.cssPrefix+"BackfaceVisibility"]="hidden"; |
|
169 this.vscrollBar&&(this.vscrollBar.style[a.feat.cssPrefix+"Perspective"]=1E3,this.vscrollBar.style[a.feat.cssPrefix+"BackfaceVisibility"]="hidden");this.hscrollBar&&(this.hscrollBar.style[a.feat.cssPrefix+"Perspective"]=1E3,this.hscrollBar.style[a.feat.cssPrefix+"BackfaceVisibility"]="hidden")}};g.prototype.scrollerMoveCSS=function(b,d,e){d||(d=0);e||(e="linear");d=numOnly(d);var f=this;this.el&&this.el.style&&(this.eventsActive&&(this.androidFormsMode?(this.el.style.marginTop=Math.round(b.y)+"px", |
|
170 this.el.style.marginLeft=Math.round(b.x)+"px"):(d={x:b.x,y:b.y,duration:d,easing:"easeOutSine"},f.initScrollProgress&&(d.update=function(b){a.trigger(f,"scroll",[b]);a.trigger(a.touchLayer,"scroll",[b])}),a(this.el).animateCss(d).start())),this.logPos(b.x,b.y))};g.prototype.logPos=function(a,b){var e;e=this.elementInfo?{h:this.elementInfo.bottomMargin,w:this.elementInfo.rightMargin}:this.getViewportSize();this.loggedPcentX=this.divide(a,this.el.clientWidth-e.w);this.loggedPcentY=this.divide(b,this.el.clientHeight- |
|
171 e.h);this.scrollTop=b;this.scrollLeft=a};g.prototype.scrollbarMoveCSS=function(b,d,e,f){e||(e=0);b&&b.style&&(this.androidFormsMode?(b.style.marginTop=Math.round(d.y)+"px",b.style.marginLeft=Math.round(d.x)+"px"):a(b).animateCss({x:d.x,y:d.y,duration:e,easing:"easeOutSine"}).start())};g.prototype.scrollTo=function(a,b){b||(b=0);this.scrollerMoveCSS(a,b)};g.prototype.scrollBy=function(a,b){var e=this.getCSSMatrix(this.el),f=numOnly(e.f),e=numOnly(e.e);this.scrollTo({y:f-a.y,x:e-a.x},b)};g.prototype.scrollToBottom= |
|
172 function(a){this.scrollTo({y:-1*(this.el.clientHeight-this.container.clientHeight),x:0},a)};g.prototype.scrollToTop=function(a){this.scrollTo({x:0,y:0},a)};return function(c,d){var p;if(!k&&a.touchLayer&&a.isObject(a.touchLayer))n();else if(!a.touchLayer||!a.isObject(a.touchLayer))a.touchLayer={};if(p="string"===typeof c||c instanceof String?document.getElementById(c):c){var f=a(p);d.hasParent&&(f=f.parent());f.hasClass("x-scroll")&&(d.horizontalScroll=!0);f.hasClass("y-scroll")&&(d.verticalScroll= |
|
173 !0);return a.os.desktop?new e(p,d):d.useJsScroll?new g(p,d):new b(p,d)}window.alert("Could not find element for scroller "+c)}}()})(af); |
|
174 (function(a){function n(f,h,g){!0===g&&(this.getAttribute("multiple")||a.selectBox.updateMaskValue(this.parentNode.id,this.text,this.value),this.parentNode.value=this.value);return g}function l(f,h,g){this.options[g]&&(this.getAttribute("multiple")||a.selectBox.updateMaskValue(this.linker,this.options[g].value,this.options[g].text),this.value=this.options[g].value);return g}function k(f){var h=f.target;a(h.linker).remove();delete h.linker;f.stopPropagation()}a.selectBox={scroller:null,currLinker:null, |
|
175 getOldSelects:function(f){if(a.os.android&&!a.os.androidICS)if(a.fn.scroller){var h=f&&document.getElementById(f)?document.getElementById(f):document;if(h){f=h.getElementsByTagName("select");for(h=0;h<f.length;h++){var g=f[h];g.style.display="none";var b=a.create("div",{className:"afFakeSelect"});b.get(0).linker=f[h];g.linker=b.get(0);b.insertAfter(f[h]);g.watch("selectedIndex",l);for(var e=0;e<g.options.length;e++)g.options[e].watch("selected",n),g.options[e].selected&&b.html(g.options[e].text); |
|
176 a(g).one("destroy",k)}this.createHtml()}else window.alert("Could not find container element for af.selectBox "+f)}else window.alert("This library requires af.scroller")},updateDropdown:function(a){if(a)for(var h=0;h<a.options.length;h++)a.options[h].selected&&(a.linker.innerHTML=a.options[h].text)},initDropDown:function(f){if(!f.disabled&&f&&f.options&&0!==f.options.length){var h=0,g=a("#afSelectBoxfix");g.html("<ul></ul>");for(var g=g.find("ul"),b=0;b<f.options.length;b++){f.options[b].watch("selected", |
|
177 n);var e=f.options[b].selected?"selected":"";e&&(h=b+1);e=a.create("li",{html:f.options[b].text,className:e});e.data("ind",b);g.append(e)}a("#afModalMask").show();try{if(0<h&&"multiple"!==f.getAttribute("multiple")){f=0;var c=numOnly(g.find("li").computedStyle("height")),d=numOnly(a("#afSelectBoxContainer").computedStyle("height"));h*c>=d&&(f=(h-1)*-c);this.scroller.scrollTo({x:0,y:f})}}catch(p){console.log("error init dropdown"+p)}h="block"===a("#afSelectClose").css("display")?numOnly(a("#afSelectClose").height()): |
|
178 0;a("#afSelectWrapper").height(numOnly(a("#afSelectBoxContainer").height())-h+"px")}},updateMaskValue:function(f,h,g){a(f).html(g)},setDropDownValue:function(f,h){if(f){var g=a(f);h=parseInt(h,10);isNaN(h)||(f.getAttribute("multiple")?(g=a("#afSelectBoxfix li:nth-child("+(h+1)+")"),g.hasClass("selected")?g.removeClass("selected"):g.addClass("selected")):(f.selectedIndex=h,g.find("option").prop("selected",!1),g.find("option:nth-child("+(h+1)+")").prop("selected",!0),this.scroller.scrollTo({x:0,y:0}), |
|
179 this.hideDropDown()),a(f).trigger("change"))}},hideDropDown:function(){a("#afModalMask").hide();a("#afSelectBoxfix").html("")},createHtml:function(){var f=this;document.getElementById("afSelectBoxfix")||a(document).ready(function(){a(document).on("click",".afFakeSelect",function(){this.linker.disabled||(f.currLinker=this,"multiple"===this.linker.getAttribute("multiple")?a("#afSelectClose").show():a("#afSelectClose").hide(),f.initDropDown(this.linker))});var h=a.create("div",{id:"afSelectBoxContainer"}), |
|
180 g=a.create("div",{id:"afSelectBoxfix"}),b=a.create("div",{id:"afSelectWrapper"});b.css("position","relative");b.append(g);var g=a.create("div",{id:"afSelectClose",html:"<a id='afSelectDone'>Done</a> <a id='afSelectCancel'>Cancel</a>"}),e=a.create("div",{id:"afModalMask"}),c=a("#afui");h.prepend(g).append(b);e.append(h);0<c.length?c.append(e):document.body.appendChild(e.get(0));f.scroller=a.query("#afSelectBoxfix").scroller({scroller:!1,verticalScroll:!0,vScrollCSS:"afselectscrollBarV",hasParent:!0}); |
|
181 a("#afModalMask").on("click",function(b){0===a(b.target).closest("#afSelectBoxContainer").length&&f.hideDropDown()});a("#afSelectBoxfix").on("click","li",function(b){b=a(b.target);f.setDropDownValue(f.currLinker.linker,b.data("ind"))});a("#afSelectBoxContainer").on("click","a",function(b){if("afSelectCancel"===b.target.id)return f.hideDropDown();var c=a(f.currLinker.linker);c.find("option").prop("selected",!1);a("#afSelectBoxfix li").each(function(){var b=a(this);if(b.hasClass("selected")){var d= |
|
182 parseInt(b.data("ind"),10);c.find("option:nth-child("+(d+1)+")").prop("selected",!0);f.currLinker.innerHTML=b.html()}});f.hideDropDown();b.stopPropagation();b.preventDefault();return!1})})}};HTMLElement.prototype.watch||(HTMLElement.prototype.watch=function(a,h){var g=this[a],b=g,e=function(){return b},c=function(d){g=b;return b=h.call(this,a,g,d)};delete this[a]&&(HTMLElement.defineProperty?HTMLElement.defineProperty(this,a,{get:e,set:c,enumerable:!1,configurable:!0}):HTMLElement.prototype.__defineGetter__&& |
|
183 HTMLElement.prototype.__defineSetter__&&(HTMLElement.prototype.__defineGetter__.call(this,a,e),HTMLElement.prototype.__defineSetter__.call(this,a,c)))});HTMLElement.prototype.unwatch||(HTMLElement.prototype.unwatch=function(a){var h=this[a];delete this[a];this[a]=h})})(af); |
|
184 (function(a){function n(a,e,c,d){var p=Math.abs(a-e),f=Math.abs(c-d);return p>=f?0<a-e?"Left":"Right":0<c-d?"Up":"Down"}function l(){k.last&&Date.now()-k.last>=h&&(k.el.trigger("longTap"),k={})}var k={},f,h=750,g;a(document).ready(function(){var b;a(document.body).bind("touchstart",function(e){e.originalEvent&&(e=e.originalEvent);if(e.touches&&0!==e.touches.length){var c=Date.now(),d=c-(k.last||c);e.touches&&0!==e.touches.length&&(k.el=a("tagName"in e.touches[0].target?e.touches[0].target:e.touches[0].target.parentNode), |
|
185 f&&clearTimeout(f),k.x1=e.touches[0].pageX,k.y1=e.touches[0].pageY,k.x2=k.y2=0,0<d&&250>=d&&(k.isDoubleTap=!0),k.last=c,g=setTimeout(l,h),a.ui.useAutoPressed&&!k.el.data("ignore-pressed")&&k.el.addClass("pressed"),b&&(a.ui.useAutoPressed&&!b.data("ignore-pressed")&&b[0]!==k.el[0])&&b.removeClass("pressed"),b=k.el)}}).bind("touchmove",function(a){a.originalEvent&&(a=a.originalEvent);k.x2=a.touches[0].pageX;k.y2=a.touches[0].pageY;(3<Math.abs(k.x2-k.x1)||3<Math.abs(k.y2-k.y1))&&clearTimeout(g)}).bind("touchend", |
|
186 function(b){b.originalEvent&&(b=b.originalEvent);k.el&&(a.ui.useAutoPressed&&!k.el.data("ignore-pressed")&&k.el.removeClass("pressed"),k.isDoubleTap?(k.el.trigger("doubleTap"),k={}):0<k.x2||0<k.y2?((30<Math.abs(k.x1-k.x2)||30<Math.abs(k.y1-k.y2))&&k.el.trigger("swipe")&&k.el.trigger("swipe"+n(k.x1,k.x2,k.y1,k.y2),k),k.x1=k.x2=k.y1=k.y2=k.last=0):"last"in k&&(k.el.trigger("tap"),f=setTimeout(function(){f=null;k.el&&k.el.trigger("singleTap");k={}},250)))}).bind("touchcancel",function(){k.el&&(a.ui.useAutoPressed&& |
|
187 !k.el.data("ignore-pressed"))&&k.el.removeClass("pressed");k={};clearTimeout(g)})});"swipe swipeLeft swipeRight swipeUp swipeDown doubleTap tap singleTap longTap".split(" ").forEach(function(b){a.fn[b]=function(a){return this.bind(b,a)}})})(af); |
|
188 (function(a){a.touchLayer=function(b){a.touchLayer=new c(b);return a.touchLayer};var n=["input","select","textarea","range"],l=["button","radio","checkbox","range","date"],k=a.os.ios||a.os.androidICS&&a.os.chrome,f=a.os.blackberry,h=a.os.blackberry||a.os.fennec||a.os.android&&!a.os.androidICS,g=a.os.ios&&!a.os.ios7,b=!1,e=!1,c=function(b){this.clearTouchVars();b.addEventListener("touchstart",this,!1);b.addEventListener("touchmove",this,!1);b.addEventListener("touchend",this,!1);b.addEventListener("click", |
|
189 this,!1);b.addEventListener("focusin",this,!1);document.addEventListener("scroll",this,!1);window.addEventListener("resize",this,!1);window.addEventListener("orientationchange",this,!1);this.layer=b;this.scrollEndedProxy_=a.proxy(this.scrollEnded,this);this.exitEditProxy_=a.proxy(this.exitExit,this,[]);this.launchFixUIProxy_=a.proxy(this.launchFixUI,this);var c=this;this.scrollTimeoutExpireProxy_=function(){c.scrollTimeout_=null;c.scrollTimeoutEl_.addEventListener("scroll",c.scrollEndedProxy_,!1)}; |
|
190 this.retestAndFixUIProxy_=function(){a.os.android&&!a.os.chrome&&(c.layer.style.height="100%");a.asap(c.testAndFixUI,c,arguments)};document.addEventListener("click",function(a){if(e)return a.preventDefault(),a.stopPropagation(),!1;void 0!==a.clientX&&null!==c.lastTouchStartX&&(2>Math.abs(c.lastTouchStartX-a.clientX)&&2>Math.abs(c.lastTouchStartY-a.clientY))&&(a.preventDefault(),a.stopPropagation())},!0);a.bind(this,"scrollstart",function(b){c.isScrolling=!0;c.scrollingEl_=b;a.feat.nativeTouchScroll|| |
|
191 (c.scrollerIsScrolling=!0);c.fireEvent("UIEvents","scrollstart",b,!1,!1)});a.bind(this,"scrollend",function(b){c.isScrolling=!1;a.feat.nativeTouchScroll||(c.scrollerIsScrolling=!1);c.fireEvent("UIEvents","scrollend",b,!1,!1)});this.hideAddressBar(0,1);this.launchFixUI(5)};c.prototype={dX:0,dY:0,cX:0,cY:0,touchStartX:null,touchStartY:null,layer:null,scrollingEl_:null,scrollTimeoutEl_:null,scrollTimeout_:null,reshapeTimeout_:null,scrollEndedProxy_:null,exitEditProxy_:null,launchFixUIProxy_:null,reHideAddressBarTimeout_:null, |
|
192 retestAndFixUIProxy_:null,panElementId:"header",blockClicks:!1,allowDocumentScroll_:!1,ignoreNextResize_:!1,blockPossibleClick_:!1,isScrolling:!1,isScrollingVertical_:!1,wasPanning_:!1,isPanning_:!1,isFocused_:!1,justBlurred_:!1,requiresNativeTap:!1,holdingReshapeType_:null,trackingClick:!1,scrollerIsScrolling:!1,handleEvent:function(a){switch(a.type){case "touchstart":this.onTouchStart(a);break;case "touchmove":this.onTouchMove(a);break;case "touchend":this.onTouchEnd(a);break;case "click":this.onClick(a); |
|
193 break;case "blur":this.onBlur(a);break;case "scroll":this.onScroll(a);break;case "orientationchange":this.onOrientationChange(a);break;case "resize":this.onResize(a);break;case "focusin":this.onFocusIn(a)}},launchFixUI:function(a){a||(a=2);if(null===this.reHideAddressBarTimeout_)return this.testAndFixUI(0,a)},resetFixUI:function(){this.reHideAddressBarTimeout_&&clearTimeout(this.reHideAddressBarTimeout_);this.reHideAddressBarTimeout_=null},testAndFixUI:function(b,c){var e=this.getReferenceHeight(), |
|
194 f=this.getCurrentHeight();if(e!==f&&!(0.97*f<e&&0.97*e<f))return this.hideAddressBar(b,c),!0;a.os.android&&this.resetFixUI();return!1},hideAddressBar:function(b,c){if(!a.ui||!a.ui.isIntel)if(b>=c)this.resetFixUI();else if(a.os.ios7)window.scrollTo(1,1);else if(a.os.desktop||a.os.kindle)this.layer.style.height="100%";else if(a.os.android){window.scrollTo(1,1);this.layer.style.height=this.isFocused_||window.innerHeight>=window.outerHeight?window.innerHeight+"px":window.outerHeight+"px";var e=b+1;this.reHideAddressBarTimeout_= |
|
195 setTimeout(this.retestAndFixUIProxy_,250*e,e,c)}else this.isFocused_||(document.documentElement.style.height="5000px",window.scrollTo(0,0),document.documentElement.style.height=window.innerHeight+"px",this.layer.style.height=window.innerHeight+"px")},getReferenceHeight:function(){return window.innerHeight},getCurrentHeight:function(){return a.os.android?window.innerHeight:numOnly(document.documentElement.style.height)},onOrientationChange:function(){this.focusedElement&&this.focusedElement.blur(); |
|
196 !this.holdingReshapeType_&&this.reshapeTimeout_?this.fireReshapeEvent("orientationchange"):this.previewReshapeEvent("orientationchange");a.os.android&&a.os.chrome&&(this.layer.style.height="100%")},onResize:function(){this.ignoreNextResize_?this.ignoreNextResize_=!1:this.launchFixUI()&&this.reshapeAction()},onClick:function(b){var c=b.target&&void 0!==b.target.tagName?b.target.tagName.toLowerCase():"";if(-1!==n.indexOf(c)&&(!this.isFocused_||b.target!==this.focusedElement)){c=b.target&&void 0!==b.target.type? |
|
197 b.target.type.toLowerCase():"";if(-1===l.indexOf(c)){this.isFocused_&&this.focusedElement.removeEventListener("blur",this,!1);this.focusedElement=b.target;this.focusedElement.addEventListener("blur",this,!1);if(!this.isFocused_&&!this.justBlurred_)if(a.trigger(this,"enter-edit",[b.target]),a.os.ios){var e=this;setTimeout(function(){e.fireReshapeEvent("enter-edit")},300)}else this.previewReshapeEvent("enter-edit");this.isFocused_=!0}else this.isFocused_=!1;this.justBlurred_=!1;this.allowDocumentScroll_= |
|
198 !0;k&&b.target.focus()}else a.os.blackberry10&&this.isFocused_&&this.focusedElement.blur()},previewReshapeEvent:function(a){var b=this;this.reshapeTimeout_=setTimeout(function(){b.fireReshapeEvent(a);b.reshapeTimeout_=null;b.holdingReshapeType_=null},750);this.holdingReshapeType_=a},fireReshapeEvent:function(b){a.trigger(this,"reshape");a.trigger(this,b?b+"-reshape":"unknown-reshape")},reshapeAction:function(){this.reshapeTimeout_?(clearTimeout(this.reshapeTimeout_),this.fireReshapeEvent(this.holdingReshapeType_), |
|
199 this.reshapeTimeout_=this.holdingReshapeType_=null):this.previewReshapeEvent()},onFocusIn:function(a){if(!this.isFocused_)this.onClick(a)},onBlur:function(b){a.os.android&&b.target===window||(this.isFocused_=!1,this.focusedElement&&this.focusedElement.removeEventListener("blur",this,!1),this.focusedElement=null,this.justBlurred_=!0,a.asap(this.exitEditProxy_,this,[b.target]))},exitExit:function(b){this.justBlurred_=!1;if(!this.isFocused_)if(a.trigger(this,"exit-edit",[b]),this.allowDocumentScroll_= |
|
200 !1,a.os.ios){var c=this;setTimeout(function(){c.fireReshapeEvent("exit-edit")},300)}else this.previewReshapeEvent("exit-edit")},onScroll:function(a){!this.allowDocumentScroll_&&(!this.isPanning_&&a.target===document)&&(this.allowDocumentScroll_=!0,this.wasPanning_?(this.wasPanning_=!1,setTimeout(this.launchFixUIProxy_,2E3,[2])):this.launchFixUI())},onTouchStart:function(d){this.dX=d.touches[0].pageX;this.dY=d.touches[0].pageY;this.lastTimestamp=d.timeStamp;this.lastTouchStartX=this.lastTouchStartY= |
|
201 null;if(a.os.ios){if(b===d.touches[0].identifier)return e=!0,d.preventDefault(),b=!1;b=d.touches[0].identifier;e=!1}if(this.scrollerIsScrolling)return this.moved=!0,this.scrollerIsScrolling=!1,d.preventDefault(),!1;this.trackingClick=!0;(g||a.feat.nativeTouchScroll)&&this.checkDOMTree(d.target,this.layer);this.isScrolling&&(null!==this.scrollTimeout_?(clearTimeout(this.scrollTimeout_),this.scrollTimeout_=null,this.scrollTimeoutEl_!==this.scrollingEl_?this.scrollEnded(!1):this.blockPossibleClick_= |
|
202 !0):(this.scrollEnded(!0),this.blockPossibleClick_=!1));if(a.os.android&&d&&d.target&&d.target.getAttribute&&"ignore"===d.target.getAttribute("data-touchlayer")||this.isFocused_&&!a.os.blackberry10)this.allowDocumentScroll_=this.requiresNativeTap=!0;else if(h&&d.target&&void 0!==d.target.tagName){var c=d.target.tagName.toLowerCase();-1!==n.indexOf(c)&&(this.requiresNativeTap=!0)}else d.target&&(void 0!==d.target.tagName&&"input"===d.target.tagName.toLowerCase()&&"range"===d.target.type)&&(this.requiresNativeTap= |
|
203 !0);!a.os.chrome&&(!a.os.fennec&&!a.os.androidICS)&&(!this.isPanning_&&!this.requiresNativeTap?(this.isScrolling&&!a.feat.nativeTouchScroll||!this.isScrolling)&&d.preventDefault():this.isScrollingVertical_&&this.demandVerticalScroll())},demandVerticalScroll:function(){0>=this.scrollingEl_.scrollTop?this.scrollingEl_.scrollTop=1:this.scrollingEl_.scrollTop+this.scrollingEl_.clientHeight>=this.scrollingEl_.scrollHeight&&(this.scrollingEl_.scrollTop=this.scrollingEl_.scrollHeight-this.scrollingEl_.clientHeight- |
|
204 1)},ignoreScrolling:function(a){return void 0===a.scrollWidth||void 0===a.clientWidth||void 0===a.scrollHeight||void 0===a.clientHeight?!0:!1},allowsVerticalScroll:function(a,b){var c=b.overflowY;return"scroll"===c||"auto"===c&&a.scrollHeight>a.clientHeight?!0:!1},allowsHorizontalScroll:function(a,b){var c=b.overflowX;return"scroll"===c||"auto"===c&&a.scrollWidth>a.clientWidth?!0:!1},checkDOMTree:function(b,c){if(g&&this.panElementId===b.id)this.isPanning_=!0;else{if(a.feat.nativeTouchScroll){if(this.ignoreScrolling(b))return; |
|
205 var e=window.getComputedStyle(b);if(this.allowsVerticalScroll(b,e)){this.isScrollingVertical_=!0;this.scrollingEl_=b;this.isScrolling=!0;return}this.allowsHorizontalScroll(b,e)&&(this.isScrollingVertical_=!1,this.scrollingEl_=null,this.isScrolling=!0)}b!==c&&b.parentNode&&this.checkDOMTree(b.parentNode,c)}},scrollEnded:function(a){null!==this.scrollTimeoutEl_&&(a&&this.scrollTimeoutEl_.removeEventListener("scroll",this.scrollEndedProxy_,!1),this.fireEvent("UIEvents","scrollend",this.scrollTimeoutEl_, |
|
206 !1,!1),this.scrollTimeoutEl_=null)},onTouchMove:function(b){var c=this.moved;this.moved=!0;f&&(this.cY=b.touches[0].pageY-this.dY,this.cX=b.touches[0].pageX-this.dX);this.isPanning_||(this.isScrolling&&(c||this.fireEvent("UIEvents","scrollstart",this.scrollingEl_,!1,!1),this.speedY=(this.lastY-b.touches[0].pageY)/(b.timeStamp-this.lastTimestamp),this.lastY=b.touches[0].pageY,this.lastX=b.touches[0].pageX,this.lastTimestamp=b.timeStamp),!a.os.blackberry10&&!this.requiresNativeTap&&(!this.isScrolling|| |
|
207 !a.feat.nativeTouchScroll&&!this.requiresNativeTap)&&b.preventDefault())},onTouchEnd:function(b){var c=this.moved;f&&(c=c&&!(10>Math.abs(this.cX)&&10>Math.abs(this.cY)));if(!a.os.ios||!this.requiresNativeTap)this.allowDocumentScroll_=!1;if(this.isPanning_&&c)this.wasPanning_=!0;else if(!c&&!this.requiresNativeTap){this.scrollerIsScrolling=!1;if(!this.trackingClick)return;b.preventDefault();if(!this.blockClicks&&!this.blockPossibleClick_){var c=b.target,e=b.changedTouches?b.changedTouches[0]:b.touches[0]; |
|
208 3===c.nodeType&&(c=c.parentNode);this.fireEvent("Event","click",c,!0,b.mouseToTouch,e[0]);this.lastTouchStartX=this.dX;this.lastTouchStartY=this.dY}}else c&&(this.isScrolling&&(this.scrollTimeoutEl_=this.scrollingEl_,0.01>Math.abs(this.speedY)?this.scrollEnded(!1):this.scrollTimeout_=setTimeout(this.scrollTimeoutExpireProxy_,30)),this.requiresNativeTap&&(this.isFocused_||a.trigger(this,"cancel-enter-edit",[b.target])));a.os.blackberry10&&(this.lastTouchStartX=this.dX,this.lastTouchStartY=this.dY); |
|
209 this.clearTouchVars()},clearTouchVars:function(){this.speedY=this.lastY=this.cY=this.cX=this.dX=this.dY=0;this.trackingClick=this.blockPossibleClick_=this.requiresNativeTap=this.isScrollingVertical_=this.isScrolling=this.isPanning_=this.moved=!1},fireEvent:function(b,c,e,f,h,g){var k=document.createEvent(b);k.initEvent(c,f,!0);g&&a.each(g,function(a,b){k.key=b});h&&(k.mouseToTouch=!0);e.dispatchEvent(k)}}})(af); |
|
210 (function(a){a.fn.popup=function(a){return new l(this[0],a)};var n=[],l=function(){var f=function(f,g){if(this.container="string"===typeof f||f instanceof String?document.getElementById(f):f)try{if("string"===typeof g||"number"===typeof g)g={message:g,cancelOnly:"true",cancelText:"OK"};this.id=g.id=g.id||a.uuid();this.addCssClass=g.addCssClass?g.addCssClass:"";this.suppressTitle=g.suppressTitle||this.suppressTitle;this.title=g.suppressTitle?"":g.title||"Alert";this.message=g.message||"";this.cancelText= |
|
211 g.cancelText||"Cancel";this.cancelCallback=g.cancelCallback||function(){};this.cancelClass=g.cancelClass||"button";this.doneText=g.doneText||"Done";this.doneCallback=g.doneCallback||function(){};this.doneClass=g.doneClass||"button";this.cancelOnly=g.cancelOnly||!1;this.onShow=g.onShow||function(){};this.autoCloseDone=void 0!==g.autoCloseDone?g.autoCloseDone:!0;n.push(this);1===n.length&&this.show()}catch(b){console.log("error adding popup "+b)}else window.alert("Error finding container for popup "+ |
|
212 f)};f.prototype={id:null,addCssClass:null,title:null,message:null,cancelText:null,cancelCallback:null,cancelClass:null,doneText:null,doneCallback:null,doneClass:null,cancelOnly:!1,onShow:null,autoCloseDone:!0,suppressTitle:!1,show:function(){var f=this,g="<div id='"+this.id+"' class='afPopup hidden "+this.addCssClass+"'><header>"+this.title+"</header><div>"+this.message+"</div><footer><a href='javascript:;' class='"+this.cancelClass+"' id='cancel'>"+this.cancelText+"</a><a href='javascript:;' class='"+ |
|
213 this.doneClass+"' id='action'>"+this.doneText+"</a><div style='clear:both'></div></footer></div>";a(this.container).append(a(g));var b=a.query("#"+this.id);b.bind("close",function(){f.hide()});this.cancelOnly&&(b.find("A#action").hide(),b.find("A#cancel").addClass("center"));b.find("A").each(function(){var b=a(this);b.bind("click",function(a){"cancel"===b.attr("id")?(f.cancelCallback.call(f.cancelCallback,f),f.hide()):(f.doneCallback.call(f.doneCallback,f),f.autoCloseDone&&f.hide());a.preventDefault()})}); |
|
214 f.positionPopup();a.blockUI(0.5);b.bind("orientationchange",function(){f.positionPopup()});b.find("header").show();b.find("footer").show();setTimeout(function(){b.removeClass("hidden").addClass("show");f.onShow(f)},50)},hide:function(){var f=this;a.query("#"+f.id).addClass("hidden");a.unblockUI();!a.os.ie&&!a.os.android?setTimeout(function(){f.remove()},250):f.remove()},remove:function(){var f=a.query("#"+this.id);f.unbind("close");f.find("BUTTON#action").unbind("click");f.find("BUTTON#cancel").unbind("click"); |
|
215 f.unbind("orientationchange").remove();n.splice(0,1);0<n.length&&n[0].show()},positionPopup:function(){var f=a.query("#"+this.id);f.css("top",window.innerHeight/2.5+window.pageYOffset-f[0].clientHeight/2+"px");f.css("left",window.innerWidth/2-f[0].clientWidth/2+"px")}};return f}(),k=!1;a.blockUI=function(f){k||(f=f?" style='opacity:"+f+";'":"",a.query("BODY").prepend(a("<div id='mask'"+f+"></div>")),a.query("BODY DIV#mask").bind("touchstart",function(a){a.preventDefault()}),a.query("BODY DIV#mask").bind("touchmove", |
|
216 function(a){a.preventDefault()}),k=!0)};a.unblockUI=function(){k=!1;a.query("BODY DIV#mask").unbind("touchstart");a.query("BODY DIV#mask").unbind("touchmove");a("BODY DIV#mask").remove()}})(af); |
|
217 (function(a){var n=window.location.pathname+window.location.search,l=window.location.hash,k=l,f=function(){function b(){e.useOSThemes&&(a("#afui").removeClass("ios ios7 win8 tizen bb android light dark firefox"),a.os.android?a("#afui").addClass("android"):a.os.ie?a("#afui").addClass("win8"):a.os.blackberry||a.os.blackberry10||a.os.playbook?(a("#afui").addClass("bb"),e.backButtonText="Back"):a.os.ios7?a("#afui").addClass("ios7"):a.os.ios?a("#afui").addClass("ios"):a.os.tizen?a("#afui").addClass("tizen"): |
|
218 a.os.fennec&&(a("#afui").addClass("firefox"),e.animateHeaders=!1));if(a.os.ios){a("head").find("#iosBlurrHack").remove();var b;b="-webkit-backface-visibility: hidden;-webkit-perspective:1000;";a("head").append("<style id='iosBlurrHack'>#afui .y-scroll > *, #afui .x-scroll > * {"+b+"}</style>")}else a.os.android&&!a.os.androidICS?e.transitionTime="150ms":a.os.fennec&&e.ready(function(){window.addEventListener("deviceorientation",function(){var b=numOnly(a("#header").css("height"))+numOnly(a("#navbar").css("height")); |
|
219 a("#content").css("height",window.innerHeight-b)})});a.os.ios7&&a("#afui").hasClass("ios7")&&e.overlayStatusbar&&(e.ready(function(){a("#afui").addClass("overlayStatusbar")}),a(document.body).css("background","rgb(249,249,249)"))}var e=this;this.availableTransitions={};this.availableTransitions["default"]=this.availableTransitions.none=this.noTransition;if("function"===typeof define&&define.amd||"undefined"!==typeof module&&module.exports)e.autoLaunch=!1;var c=function(){var c=document.getElementById("afui"); |
|
220 if(null===c){c=document.createElement("div");c.id="afui";for(var f=document.body;f&&f.firstChild;)c.appendChild(f.firstChild);a(document.body).prepend(c)}e.isIntel="intel"in window&&window.intel&&window.intel.xdk&&"app"in window.intel.xdk;a.os.supportsTouch&&a.touchLayer(c);b()};if("complete"===document.readyState||"loaded"===document.readyState)if(c(),e.init)e.autoBoot();else a(window).one("afui:init",function(){e.autoBoot()});else a(document).ready(function(){c();if(e.init)e.autoBoot();else a(window).one("afui:init", |
|
221 function(){e.autoBoot()})},!1);"intel"in window||(window.intel={xdk:{}},window.intel.xdk.webRoot="");window.addEventListener("popstate",function(){if(e.useInternalRouting){var a=e.getPanelId(document.location.hash);"#"!==document.location.href.replace(document.location.origin+"/","")&&(""===a&&1===e.history.length&&(a="#"+e.firstDiv.id),""!==a&&0!==af(a).filter(".panel").length&&a!=="#"+e.activeDiv.id&&e.goBack())}},!1)};f.prototype={init:!1,transitionTime:"230ms",showLoading:!0,loadingText:"Loading Content", |
|
222 loadContentQueue:[],isIntel:!1,titlebar:"",navbar:"",header:"",viewportContainer:"",remotePages:{},history:[],homeDiv:"",screenWidth:"",content:"",modalWindow:"",customFooter:!1,defaultFooter:"",defaultHeader:null,customMenu:!1,customAside:!1,defaultAside:"",defaultMenu:"",_readyFunc:null,doingTransition:!1,passwordBox:a.passwordBox?new a.passwordBox:!1,selectBox:a.selectBox?a.selectBox:!1,ajaxUrl:"",transitionType:"slide",scrollingDivs:{},firstDiv:"",hasLaunched:!1,isLaunching:!1,launchCompleted:!1, |
|
223 activeDiv:"",customClickHandler:"",menuAnimation:null,togglingSideMenu:!1,sideMenuWidth:"200px",handheldMinWidth:"768",trimBackButtonText:!0,useOSThemes:!0,overlayStatusbar:!1,lockPageBounce:!0,animateHeaders:!0,useAutoPressed:!0,horizontalScroll:!1,_currentHeaderID:"defaultHeader",useInternalRouting:!0,autoBoot:function(){this.hasLaunched=!0;var a=this;if(this.autoLaunch)if(this.isIntel){var e=function(){a.launch();document.removeEventListener("intel.xdk.device.ready",e)};document.addEventListener("intel.xdk.device.ready", |
|
224 e)}else this.launch()},css3animate:function(b,e){b=a(b);return b.css3Animate(e)},dispatchPanelEvent:function(a,e){if("string"===typeof a&&window[a])return window[a](e);if(-1!==a.indexOf(".")){var c=window,d=a.split("."),f=d.length,g=0;for(g;g<f-1;g++)if(c=c[d[g]],void 0===c)return;return c[d[g]](e)}},enableTabBar:function(){a(document).on("click",".button-grouped.tabbed",function(b){var e=a(b.target);e.closest(".tabbed").find(".button").data("ignore-pressed","true").removeClass("pressed");e.closest(".button").addClass("pressed"); |
|
225 setTimeout(function(){e.closest(".button").addClass("pressed")})})},disableTabBar:function(){a(document).off("click",".button-grouped.tabbed");a(".button-grouped.tabbed .button").removeAttr("data-ignore-pressed")},setLeftSideMenuWidth:function(b){this.sideMenuWidth=b;b=(b+"").replace("px","")+"px";var e=numOnly(window.innerWidth)-numOnly(b);a("head").find("style#afui_sideMenuWidth").remove();b="@media handheld, only screen and (min-width: 768px) {#afui > #navbar.hasMenu.splitview, #afui > #header.hasMenu.splitview, #afui > #content.hasMenu.splitview { margin-left:"+ |
|
226 b+" !important; width: "+e+"px !important;}}#afui #menu {width:"+b+" !important}";a("head").append("<style id='afui_sideMenuWidth'>"+b+"</style>")},setSideMenuWidth:function(){this.setLeftSideMenuWidth.apply(this,arguments)},setRightSideMenuWidth:function(b){this.sideMenuWidth=b;b=(b+"").replace("px","")+"px";a("head").find("style#afui_asideMenuWidth").remove();a("head").append("<style id='afui_asideMenuWidth'>#afui #aside_menu {width:"+b+" !important}</style>")},disableNativeScrolling:function(){a.feat.nativeTouchScroll= |
|
227 !1},manageHistory:!0,loadDefaultHash:!0,useAjaxCacheBuster:!1,actionsheet:function(b){return a.query("#afui").actionsheet(b)},popup:function(b){return a.query("#afui").popup(b)},blockUI:function(b){a.blockUI(b)},unblockUI:function(){a.unblockUI()},removeFooterMenu:function(){a.query("#navbar").hide();this.showNavMenu=!1},showNavMenu:!0,autoLaunch:!0,showBackbutton:!0,showBackButton:!0,backButtonText:"",resetScrollers:!1,ready:function(b){if(this.launchCompleted)b();else a(document).one("afui:ready", |
|
228 function(){b()})},setBackButtonStyle:function(b){a.query("#header .backButton").get(0).className=b},goBack:function(a){if(a=Math.min(Math.abs(~~a||1),this.history.length))a=this.history.splice(-a).shift(),this.loadContent(a.target+"",0,1,a.transition),this.transitionType=a.transition,this.updateHash(a.target)},clearHistory:function(){this.history=[];this.setBackButtonVisibility(!1)},pushHistory:function(b,e,c,d){this.history.push({target:b,transition:c});try{this.manageHistory&&(window.history.pushState(e, |
|
229 e,n+"#"+e+d),a(window).trigger("hashchange",null,{newUrl:n+"#"+e+d,oldUrl:n+b}))}catch(f){}},updateHash:function(b){if(this.manageHistory){k=b=-1===b.indexOf("#")?"#"+b:b;var e=window.location.hash,c=this.getPanelId(b).substring(1);try{window.history.replaceState(c,c,n+b),a(window).trigger("hashchange",null,{newUrl:n+b,oldUrl:n+e})}catch(d){}}},getPanelId:function(a){var e=a.indexOf("/");return-1===e?a:a.substring(0,e)},updateBadge:function(b,e,c,d){void 0===c&&(c="");b=a(b);var f=b.find("span.af-badge"); |
|
230 0===f.length?("absolute"!==b.css("position")&&b.css("position","relative"),f=a.create("span",{className:"af-badge "+c,html:e}),b.append(f)):f.html(e);f.removeClass("tl bl br tr");f.addClass(c);void 0===d&&(d="red");a.isObject(d)?f.css(d):d&&f.css("background",d);f.data("ignore-pressed","true")},removeBadge:function(b){a(b).find("span.af-badge").remove()},toggleNavMenu:function(b){this.showNavMenu&&("none"!==a.query("#navbar").css("display")&&(void 0!==b&&!0!==b||void 0===b)?a.query("#navbar").hide(): |
|
231 (void 0===b||void 0!==b&&!0===b)&&a.query("#navbar").show())},toggleHeaderMenu:function(b){"none"!==a.query("#header").css("display")&&(void 0!==b&&!0!==b||void 0===b)?a.query("#header").hide():(void 0===b||void 0!==b&&!0===b)&&a.query("#header").show()},toggleAsideMenu:function(){this.toggleRightSideMenu.apply(this,arguments)},toggleRightSideMenu:function(a,e,c){if(this.isAsideMenuEnabled())return this.toggleLeftSideMenu(a,e,c,!0)},toggleLeftSideMenu:function(b,e,c,d){if(!(!this.isSideMenuEnabled()&& |
|
232 !this.isAsideMenuEnabled()||this.togglingSideMenu))if(d||this.isSideMenuEnabled())if(d||!(a.ui.splitview&&window.innerWidth>=a.ui.handheldMinWidth)){var f=this,g=a.query("#menu"),h=a.query("#aside_menu"),k=a.query("#content, #header, #navbar"),l=a.query(".afui_panel_mask");c=c||this.transitionTime;var n=this.isSideMenuOn(),z=d?"-"+numOnly(h.css("width")):numOnly(g.css("width"));0===l.length&&window.innerWidth<a.ui.handheldMinWidth&&(k.append("<div class='afui_panel_mask'></div>"),l=a.query(".afui_panel_mask"), |
|
233 a(".afui_panel_mask").bind("click",function(){a.ui.toggleSideMenu(!1,null,null,d)}));var s=this.getSideMenuPosition();n&&!d&&0>s?n=!1:n&&(d&&0<s)&&(n=!1);if(2===b||!n&&(void 0!==b&&!1!==b||void 0===b))this.togglingSideMenu=!0,d?h.show():g.show(),f.css3animate(k,{x:z,time:c,complete:function(b){f.togglingSideMenu=!1;k.vendorCss("Transition","");e&&e(b);0!==l.length&&window.innerWidth<a.ui.handheldMinWidth&&l.show()}});else if(void 0===b||void 0!==b&&!1===b)this.togglingSideMenu=!0,f.css3animate(k, |
|
234 {x:"0px",time:c,complete:function(b){k.vendorCss("Transition","");k.vendorCss("Transform","");f.togglingSideMenu=!1;e&&e(b);a.ui.splitview||g.hide();h.hide();0!==l.length&&window.innerWidth<a.ui.handheldMinWidth&&l.hide()}})}},toggleSideMenu:function(){this.toggleLeftSideMenu.apply(this,arguments)},disableSideMenu:function(){this.disableLeftSideMenu()},disableLeftSideMenu:function(){var b=a.query("#content, #header, #navbar");this.isSideMenuOn()?this.toggleSideMenu(!1,function(a){a||b.removeClass("hasMenu")}): |
|
235 b.removeClass("hasMenu")},enableLeftSideMenu:function(){a.query("#content, #header, #navbar").addClass("hasMenu")},enableSideMenu:function(){return this.enableLeftSideMenu()},disableRightSideMenu:function(){var b=a.query("#content, #header, #navbar");this.isSideMenuOn()?this.toggleSideMenu(!1,function(a){a||b.removeClass("hasAside")}):b.removeClass("hasAside")},enableRightSideMenu:function(){a.query("#content, #header, #navbar").addClass("hasAside")},isSideMenuEnabled:function(){return a.query("#content").hasClass("hasMenu")}, |
|
236 isAsideMenuEnabled:function(){return a.query("#content").hasClass("hasAside")},isSideMenuOn:function(){var a=0!==this.getSideMenuPosition()?!0:!1;return(this.isSideMenuEnabled()||this.isAsideMenuEnabled)&&a},getSideMenuPosition:function(){return numOnly(parseFloat(a.getCssMatrix(a("#content")).e))},splitview:!0,disableSplitView:function(){a.query("#content, #header, #navbar, #menu").removeClass("splitview");this.splitview=!1},prevFooter:null,updateNavbarElements:function(b){if(this.prevFooter)if(this.prevFooter.data("parent")){var e= |
|
237 this.scrollingDivs.hasOwnProperty(this.prevFooter.data("parent"));a.feat.nativeTouchScroll||a.os.desktop||!e?this.prevFooter.appendTo("#"+this.prevFooter.data("parent")):this.prevFooter.appendTo(a("#"+this.prevFooter.data("parent")).find(".afScrollPanel"))}else this.prevFooter.appendTo("#afui");a.is$(b)||(b=a.query("#"+b));a.query("#navbar").append(b);this.prevFooter=b;b=a.query("#navbar > footer > a:not(.button)");0<b.length&&(b.data("ignore-pressed","true").data("resetHistory","true"),e=parseFloat(100/ |
|
238 b.length),b.css("width",e+"%"));b=a.query("#navbar footer");if(0!==b.length){b=b.get(0).childNodes;for(e=0;e<b.length;e++)3===b[e].nodeType&&b[e].parentNode.removeChild(b[e])}},prevHeader:null,updateHeaderElements:function(b,e){var c=this;a.is$(b)||(b=a.query("#"+b));if(b!==this.prevHeader)if(this._currentHeaderID=b.prop("id"),this.prevHeader){var d=this.scrollingDivs.hasOwnProperty(this.prevHeader.data("parent"));a.query("#header").append(b);if(a.ui.animateHeaders){var f=e?"100px":"-100px",g=e?"-100px": |
|
239 "100px";c.prevHeader.addClass("ignore");c.css3animate(b,{x:g,opacity:0.3,time:"1ms"});c.css3animate(c.prevHeader,{x:f,y:0,opacity:0.3,time:c.transitionTime,delay:numOnly(c.transitionTime)/5+"ms",complete:function(){c.prevHeader.data("parent")?a.feat.nativeTouchScroll||a.os.desktop||!d?c.prevHeader.appendTo("#"+c.prevHeader.data("parent")):c.prevHeader.appendTo(a("#"+c.prevHeader.data("parent")).find(".afScrollPanel")):c.prevHeader.appendTo("#afui");c.prevHeader.removeClass("ignore");c.css3animate(c.prevHeader, |
|
240 {x:g,opacity:1,time:"1ms"});c.prevHeader=b}});c.css3animate(b,{x:"0px",opacity:1,time:c.transitionTime})}else c.prevHeader.data("parent")?a.feat.nativeTouchScroll||a.os.desktop||!d?this.prevHeader.appendTo("#"+this.prevHeader.data("parent")):this.prevHeader.appendTo(a("#"+this.prevHeader.data("parent")).find(".afScrollPanel")):c.prevHeader.appendTo("#afui"),c.prevHeader=b}else a.query("#header").append(b),this.prevHeader=b},previAsideMenu:null,updateAsideElements:function(){return this.updateRightSideMenuElements.apply(this, |
|
241 arguments)},updateRightSideMenuElements:function(b){if(!(void 0===b||null===b)){var e=a.query("#aside_menu_scroller");this.prevAsideMenu&&(this.prevAsideMenu.insertBefore("#afui #aside_menu"),this.prevAsideMenu=null);a.is$(b)||(b=a.query("#"+b));a(b).attr("title")&&(a(b).prepend(a.create("header",{className:"header"}).append(a.create("h1",{html:a(b).attr("title")}).get(0))),a(b).removeAttr("title"));e.html("");e.append(b);this.prevAsideMenu=b;this.scrollingDivs.aside_menu_scroller.hideScrollbars(); |
|
242 this.scrollingDivs.aside_menu_scroller.scrollToTop()}},updateSideMenu:function(a){return this.updateSideMenuElements(a)},updateSideMenuElements:function(){return this.updateLeftSideMenuElements.apply(this,arguments)},updateLeftSideMenuElements:function(b){if(!(void 0===b||null===b)){var e=a.query("#menu_scroller");this.prevMenu&&(this.prevMenu.insertBefore("#afui #menu"),this.prevMenu=null);a.is$(b)||(b=a.query("#"+b));a(b).attr("title")&&(a(b).prepend(a.create("header",{className:"header"}).append(a.create("h1", |
|
243 {html:a(b).attr("title")}).get(0))),a(b).removeAttr("title"));e.html("");e.append(b);this.prevMenu=b;this.scrollingDivs.menu_scroller.hideScrollbars();this.scrollingDivs.menu_scroller.scrollToTop()}},setTitle:function(b){"defaultHeader"===this._currentHeaderID&&a.query("#header header:not(.ignore) #pageTitle").html(b)},setBackButtonText:function(b){"defaultHeader"===this._currentHeaderID&&(this.trimBackButtonText&&7<=b.length&&(b=b.substring(0,5)+"..."),0<this.backButtonText.length?a.query("#header header:not(.ignore) .backButton").html(this.backButtonText): |
|
244 a.query("#header header:not(.ignore) .backButton").html(b))},setBackButtonVisibility:function(b){b?a.query("#header .backButton").css("visibility","visible"):a.query("#header .backButton").css("visibility","hidden")},showMask:function(b){b||(b=this.loadingText||"");a.query("#afui_mask>h1").html(b);a.query("#afui_mask").show()},hideMask:function(){a.query("#afui_mask").hide()},modalReference_:null,showModal:function(b,e){this.modalTransition=e||"up";var c=a.query("#modalContainer");"string"===typeof b&& |
|
245 (b="#"+b.replace("#",""));var d=a.query(b);this.modalReference_=d;var f=a.query("#afui_modal");if(d.length){var g=this.scrollingDivs.hasOwnProperty(d.attr("id")),h;a.feat.nativeTouchScroll||a.os.desktop||!g?(h=d.contents(),c.append(h)):(h=a(d.get(0).childNodes[0]).contents(),c.children().eq(0).append(h));this.runTransition(this.modalTransition,this.modalTransContainer,this.modalWindow,!1);a(this.modalWindow).css("display","");a(this.modalWindow).addClass("display","flexContainer");g?this.scrollingDivs.modal_container.enable(this.resetScrollers): |
|
246 this.scrollingDivs.modal_container.disable();c.addClass("panel").show();"none"===d.data("header")?f.find("#modalHeader").hide():0<h.filter("header").length?f.find("#modalHeader").append(h.filter("header")).show():f.find("#modalHeader").append(a.create("header",{}).append(a.create("h1",{html:d.data("title")}).get(0)).append(a.create("a",{className:"button icon close"}).attr("onclick","$.ui.hideModal()").get(0))).show();if("none"===d.data("footer"))f.find("#modalFooter").hide();else if(0<h.filter("footer").length){f.find("#modalFooter").append(h.filter("footer")).show(); |
|
247 f=a.query("#modalFooter > footer > a:not(.button)");0<f.length&&(g=parseFloat(100/f.length),f.css("width",g+"%"));f=a.query("#modalFooter footer");if(0===f.length)return;f=f.get(0).childNodes;for(g=0;g<f.length;g++)3===f[g].nodeType&&f[g].parentNode.removeChild(f[g])}else f.find("#modalFooter").hide();this.scrollToTop("modal");c.data("panel",b);c=d.get(0);(f=c.getAttribute("data-load"))&&this.dispatchPanelEvent(f,c);d.trigger("loadpanel")}},hideModal:function(){var b=this,e=a.query("#modalContainer"); |
|
248 if(this.modalReference_){var c=this.scrollingDivs.hasOwnProperty(this.modalReference_.attr("id"));this.runTransition(b.modalTransition,b.modalWindow,b.modalTransContainer,!0);this.scrollingDivs.modal_container.disable();var d=a.query(e.data("panel")),f=d.data("unload");f&&this.dispatchPanelEvent(f,d.get(0));d.trigger("unloadpanel");setTimeout(function(){a.feat.nativeTouchScroll||a.os.desktop||!c?(b.modalReference_.append(a("#modalHeader header")),b.modalReference_.append(e.contents()),b.modalReference_.append(a("#modalFooter footer"))): |
|
249 (b.modalReference_.children().eq(0).append(a("#modalHeader header")),a(b.modalReference_.get(0).childNodes[0]).append(e.children().eq(0).contents()),b.modalReference_.children().eq(0).append(a("#modalFooter footer")));b.modalReference_=null},this.transitionTime)}},updatePanel:function(b,e){b="#"+b.replace("#","");var c=a.query(b).get(0);if(c){var d=a.create("div",{html:e}),d=d.children(".panel")&&0<d.children(".panel").length?d.children(".panel").get(0):d.get(0);c.getAttribute("js-scrolling")&&("yes"=== |
|
250 c.getAttribute("js-scrolling").toLowerCase()||"true"===c.getAttribute("js-scrolling").toLowerCase())?(a.cleanUpContent(c.childNodes[0],!1,!0),a(c.childNodes[0]).html(e)):(a.cleanUpContent(c,!1,!0),a(c).html(e));var f=this.scrollingDivs[c.id];f&&f.refresh&&f.addPullToRefresh();d.getAttribute("data-title")&&c.setAttribute("data-title",d.getAttribute("data-title"))}},updateContentDiv:function(a,e){return this.updatePanel(a,e)},addContentDiv:function(b,e,c,d,f){var g;"string"===typeof b?(-1===b.lastIndexOf("#", |
|
251 1)&&(b="#"+b),g=a.query(b).get(0)):(g=a.is$(b)?b.get(0):b,b=g.id);g?e=g:(e=a.create("div",{html:e}),e=e.children(".panel")&&0<e.children(".panel").length?e.children(".panel").get(0):e.get(0),!e.getAttribute("data-title")&&c&&e.setAttribute("data-title",c),c=e.id?e.id:b.replace("#",""),e.id=c,e.id!==b&&e.setAttribute("data-crc",b.replace("#","")));e.className="panel";c=e.id;this.addDivAndScroll(e,d,f);return c},addDivAndScroll:function(b,e,c,d){var f=!1,g,h=b.style.overflow,h="hidden"!==h&&"visible"!== |
|
252 h;d=d||this.content;!a.feat.nativeTouchScroll&&(h&&!a.os.desktop)&&b.setAttribute("js-scrolling","true");if(b.getAttribute("js-scrolling")&&("yes"===b.getAttribute("js-scrolling").toLowerCase()||"true"===b.getAttribute("js-scrolling").toLowerCase()))h=f=!0;g=b.getAttribute("data-title")||b.title;b.title="";b.setAttribute("data-title",g);if(a(b).hasClass("no-scroll")||b.getAttribute("scrolling")&&"no"===b.getAttribute("scrolling"))f=h=!1,b.removeAttribute("js-scrolling");f?(g=b,d.appendChild(b),!1!== |
|
253 this.selectBox&&this.selectBox.getOldSelects(g.id),!1!==this.passwordBox&&this.passwordBox.getOldPasswords(g.id)):(d.appendChild(b),g=b,b.style["-webkit-overflow-scrolling"]="none");h&&(this.scrollingDivs[g.id]=a(b).scroller({scrollBars:!0,verticalScroll:!0,horizontalScroll:this.horizontalScroll,vScrollCSS:"afScrollbar",refresh:e,useJsScroll:f,lockBounce:this.lockPageBounce,autoEnable:!1}),a(b).addClass("y-scroll"),this.horizontalScroll&&a(b).addClass("x-scroll"),c&&a.bind(this.scrollingDivs[g.id], |
|
254 "refresh-release",function(a){if(a)return c(),!1}),f&&a(b).children().eq(0).addClass("afScrollPanel"));return g.id},scrollToTop:function(a,e){e=e||"300ms";a=a.replace("#","");this.scrollingDivs[a]&&this.scrollingDivs[a].scrollToTop(e)},scrollToBottom:function(a,e){a=a.replace("#","");this.scrollingDivs[a]&&this.scrollingDivs[a].scrollToBottom(e)},parsePanelFunctions:function(b,e,c){var d=b.getAttribute("data-footer"),f=b.getAttribute("data-header");d&&"none"===d.toLowerCase()?(this.toggleNavMenu(!1), |
|
255 d=!1):this.toggleNavMenu(!0);d&&this.customFooter!==d?(this.customFooter=d,this.updateNavbarElements(d)):d!==this.customFooter&&(this.customFooter&&this.updateNavbarElements(this.defaultFooter),this.customFooter=!1);f&&"none"===f.toLowerCase()?(this.toggleHeaderMenu(!1),f=!1):this.toggleHeaderMenu(!0);f&&this.customHeader!==f?(this.customHeader=f,this.updateHeaderElements(f,c)):f!==this.customHeader&&(this.customHeader&&this.updateHeaderElements(this.defaultHeader,c),this.customHeader=!1);d=a(b).find("footer"); |
|
256 0<d.length&&(this.customFooter=b.id,d.data("parent",b.id),this.updateNavbarElements(d));d=a(b).find("header");0<d.length&&(this.customHeader=b.id,d.data("parent",b.id),this.updateHeaderElements(d,c));b.getAttribute("data-tab")&&(a.query("#navbar>footer>a:not(.button)").removeClass("pressed"),a.query("#navbar #"+b.getAttribute("data-tab")).addClass("pressed"));(c=b.getAttribute("data-left-menu")||b.getAttribute("data-nav"))&&this.customMenu!==c?(this.customMenu=c,this.updateSideMenuElements(c)):c!== |
|
257 this.customMenu&&(this.customMenu&&this.updateSideMenuElements(this.defaultMenu),this.customMenu=!1);(c=b.getAttribute("data-right-menu")||b.getAttribute("data-aside"))&&this.customAside!==c?(this.customAside=c,this.updateAsideElements(c)):c!==this.customAside&&(this.customAside&&this.updateAsideElements(this.defaultAside),this.customAside=!1);e&&((c=e.getAttribute("data-unload"))&&this.dispatchPanelEvent(c,e),a(e).trigger("unloadpanel"));(c=b.getAttribute("data-load"))&&this.dispatchPanelEvent(c, |
|
258 b);a(b).trigger("loadpanel");this.isSideMenuOn()&&this.toggleSideMenu(!1)},parseScriptTags:function(b){b&&a.fn&&"appframework"===a.fn.namespace&&a.parseJS(b)},loadContent:function(b,e,c,d,f){if(this.doingTransition)this.loadContentQueue.push([b,e,c,d,f]);else if(0!==b.length){var h=!0;f=f||document.createElement("a");if(-1===b.indexOf("#")){var k="url"+g(b),l=a.query("div.panel[data-crc='"+k+"']");0<a.query("#"+b).length?h=!1:0<l.length?(h=!1,"true"===f.getAttribute("data-refresh-ajax")||f.refresh&& |
|
259 !0===f.refresh||this.isAjaxApp?h=!0:b="#"+l.get(0).id):0<a.query("#"+k).length&&(h=!1,"true"===f.getAttribute("data-refresh-ajax")||f.refresh&&!0===f.refresh||this.isAjaxApp?h=!0:b="#"+k)}-1===b.indexOf("#")&&h?this.loadAjax(b,e,c,d,f):this.loadDiv(b,e,c,d)}},loadDiv:function(b,e,c,d){var f=this,g=b.replace("#",""),h=g.indexOf("/"),l="";-1!==h&&(l=g.substr(h),g=g.substr(0,h));if(g=a.query("#"+g).get(0))if(g===this.activeDiv&&!c)this.isSideMenuOn()&&this.toggleSideMenu(!1);else{this.transitionType= |
|
260 d;var n=this.activeDiv;b=g;if("true"===g.getAttribute("data-modal")||"true"===g.getAttribute("modal"))return this.showModal(g.id);n!==b&&(e?(this.clearHistory(),this.pushHistory("#"+this.firstDiv.id,g.id,d,l)):c||this.pushHistory(k,g.id,d,l),k="#"+g.id+l,this.doingTransition=!0,n.style.display="block",b.style.display="block",this.runTransition(d,n,b,c),this.parsePanelFunctions(g,n,c),this.loadContentData(g,e,c,d),a.feat.nativeTouchScroll?setTimeout(function(){f.scrollingDivs[n.id]&&f.scrollingDivs[n.id].disable()}, |
|
261 numOnly(f.transitionTime)+50):"undefined"!==typeof f.scrollingDivs[n.id]&&f.scrollingDivs[n.id].disable())}else a(document).trigger("missingpanel",null,{missingTarget:b})},loadContentData:function(b,e,c){var d;c?0<this.history.length&&(c=this.history[this.history.length-1],d=c.target.indexOf("/"),c=-1!==d?c.target.substr(0,d):c.target,(c=a.query(c).get(0))?this.setBackButtonText(c.getAttribute("data-title")):this.setBackButtonText("Back")):this.activeDiv.getAttribute("data-title")?this.setBackButtonText(this.activeDiv.getAttribute("data-title")): |
|
262 this.setBackButtonText("Back");b.getAttribute("data-title")&&this.setTitle(b.getAttribute("data-title"));e&&(this.setBackButtonText(this.firstDiv.getAttribute("data-title")),b===this.firstDiv&&(this.history.length=0));a("#header #menubadge").css("float","right");0===this.history.length?(this.setBackButtonVisibility(!1),this.history=[],a("#header #menubadge").css("float","left")):this.setBackButtonVisibility(this.showBackButton&&this.showBackbutton);this.activeDiv=b;this.scrollingDivs[this.activeDiv.id]&& |
|
263 this.scrollingDivs[this.activeDiv.id].enable(this.resetScrollers)},loadAjax:function(b,e,c,d,f){if(!("afui_ajax"===this.activeDiv.id&&b===this.ajaxUrl)){var h="url"+g(b),k=this;-1===b.indexOf("http")&&(b=intel.xdk.webRoot+b);var l=new XMLHttpRequest;f&&"object"!==typeof f&&(f=document.createElement("a"),f.setAttribute("data-persist-ajax",!0));f=f||document.createElement("a");l.onreadystatechange=function(){if(4===l.readyState&&200===l.status){this.doingTransition=!1;var g,n=!1;g=a.query("#"+h);var s= |
|
264 "",A=function(a){(a=k.scrollingDivs[a])&&a.refresh&&a.hideRefresh()};if(0<g.length)A(h),k.updatePanel(h,l.responseText),g.get(0).setAttribute("data-title",f.title?f.title:b);else if(f.getAttribute("data-persist-ajax")||k.isAjaxApp){var q="true"===f.getAttribute("data-pull-scroller")?!0:!1;g=q?function(){setTimeout(function(){f.refresh=!0;k.loadContent(b,e,c,d,f);f.refresh=!1},500)}:null;var r=a(l.responseText);r.hasClass("panel")?(s=r.get(0).className,h=r.attr("id"),r=r.get(0).innerHTML):(s=r.className, |
|
265 r=r.html());A(h);0<a("#"+h).length?k.updatePanel("#"+h,r):0<a("div.panel[data-crc='"+h+"']").length?(k.updatePanel(a("div.panel[data-crc='"+h+"']").get(0).id,r),h=a("div.panel[data-crc='"+h+"']").get(0).id):h=k.addContentDiv(h,l.responseText,f.title?f.title:b,q,g)}else k.updatePanel("afui_ajax",l.responseText),a.query("#afui_ajax").attr("data-title",f.title?f.title:b),k.loadContent("#afui_ajax",e,c,d),n=!0;A=document.createElement("div");a(A).html(l.responseText);k.parseScriptTags(A);if(n)k.showLoading&& |
|
266 k.hideMask();else{if(s){n=s.split(" ");for(s=0;s<n.length;s++)"panel"!==n[s].trim()&&a("#"+h).addClass(n[s])}k.loadContent("#"+h,e,c,d);k.showLoading&&k.hideMask();return null}}else 4===l.readyState&&a.ui.hideMask()};this.ajaxUrl=b;var n=this.useAjaxCacheBuster?b+(b.split("?")[1]?"&":"?")+"cache="+1E16*Math.random():b;l.open("GET",n,!0);l.setRequestHeader("X-Requested-With","XMLHttpRequest");l.send();this.showLoading&&this.showMask()}},runTransition:function(a,e,c,d){this.availableTransitions[a]|| |
|
267 (a="default");"none"===e.style.display&&(e.style.display="block");"none"===c.style.display&&(c.style.display="block");this.availableTransitions[a].call(this,e,c,d)},launch:function(){if(!1===this.hasLaunched||this.launchCompleted)this.hasLaunched=!0;else{if(this.isLaunching)return!0;this.isLaunching=!0;var b=this;this.viewportContainer=af.query("#afui");this.navbar=af.query("#navbar").get(0);this.content=af.query("#content").get(0);this.header=af.query("#header").get(0);this.menu=af.query("#menu").get(0); |
|
268 this.viewportContainer.on("click","a",function(a){b.useInternalRouting&&h(a,a.currentTarget)});var e=null;a.bind(a.touchLayer,"enter-edit",function(a){e=a});a.os.android&&(a.bind(a.touchLayer,"enter-edit-reshape",function(){var c=a(e),d=c.closest(b.activeDiv);if(d&&0<d.size())if(a.os.androidICS){var f=b.scrollingDivs[b.activeDiv.id],g=f.scrollTop;f.scrollBy({x:0,y:(c.offset().top-d.offset().top+g)/2})}else if(a.os.android||a.os.blackberry)f=c.offset(),d=d.offset(),f.bottom>d.bottom&&f.height<d.height&& |
|
269 b.scrollingDivs[b.activeDiv.id].scrollToItem(c,"bottom")}),a.bind(a.touchLayer,"exit-edit-reshape",function(){b.activeDiv&&(b.activeDiv.id&&b.scrollingDivs.hasOwnProperty(b.activeDiv.id))&&b.scrollingDivs[b.activeDiv.id].setPaddings(0,0)}));this.navbar||(this.navbar=a.create("div",{id:"navbar"}).get(0),this.viewportContainer.append(this.navbar));this.header||(this.header=a.create("div",{id:"header"}).get(0),this.viewportContainer.prepend(this.header));this.content||(this.content=a.create("div",{id:"content"}).get(0), |
|
270 a(this.content).insertAfter(this.header));this.menu||(this.menu=a.create("div",{id:"menu",html:"<div id='menu_scroller'></div>"}).get(0),this.viewportContainer.append(this.menu),this.menu.style.overflow="hidden",this.scrollingDivs.menu_scroller=a.query("#menu_scroller").scroller({scrollBars:!0,verticalScroll:!0,vScrollCSS:"afScrollbar",useJsScroll:!a.feat.nativeTouchScroll,autoEnable:!0,lockBounce:this.lockPageBounce,hasParent:!0}),a.feat.nativeTouchScroll&&a.query("#menu_scroller").css("height", |
|
271 "100%"),this.asideMenu=a.create("div",{id:"aside_menu",html:"<div id='aside_menu_scroller'></div>"}).get(0),this.viewportContainer.append(this.asideMenu),this.asideMenu.style.overflow="hidden",this.scrollingDivs.aside_menu_scroller=a.query("#aside_menu_scroller").scroller({scrollBars:!0,verticalScroll:!0,vScrollCSS:"afScrollbar",useJsScroll:!a.feat.nativeTouchScroll,autoEnable:!0,lockBounce:this.lockPageBounce,hasParent:!0}),a.feat.nativeTouchScroll&&a.query("#aside_menu_scroller").css("height","100%")); |
|
272 a(this.header).html("<a class='backButton button'></a> <h1 id='pageTitle'></h1>"+this.header.innerHTML);this.backButton=a.query("#header .backButton").css("visibility","hidden");a(document).on("click","#header .backButton",function(a){a.preventDefault();b.goBack()});this.titlebar=a.query("#header #pageTitle").get(0);this.addContentDiv("afui_ajax","");var c=a.create("div",{id:"afui_mask",className:"ui-loader",html:"<span class='ui-icon ui-icon-loading spin'></span><h1>Loading Content</h1>"}).css({"z-index":2E4, |
|
273 display:"none"});document.body.appendChild(c.get(0));c=a.create("div",{id:"afui_modal"}).get(0);a(c).hide();c.appendChild(a.create("div",{id:"modalHeader",className:"header"}).get(0));c.appendChild(a.create("div",{id:"modalContainer"}).get(0));c.appendChild(a.create("div",{id:"modalFooter",className:"footer"}).get(0));this.modalTransContainer=a.create("div",{id:"modalTransContainer"}).appendTo(c).get(0);this.viewportContainer.append(c);this.scrollingDivs.modal_container=a.query("#modalContainer").scroller({scrollBars:!0, |
|
274 vertical:!0,vScrollCSS:"afScrollbar",lockBounce:this.lockPageBounce});this.modalWindow=c;for(var d={},c=this.viewportContainer.get(0).querySelectorAll(".panel"),f=0;f<c.length;f++){var g=c[f],n=g,y=g.previousSibling;g.parentNode&&"content"!==g.parentNode.id?(n.getAttribute("selected")&&(this.firstDiv=g),this.addDivAndScroll(n),a.query("#content").append(g)):g.parsedContent||(g.parsedContent=1,n.getAttribute("selected")&&(this.firstDiv=g),this.addDivAndScroll(g),a(g).insertAfter(y));g.getAttribute("data-defer")&& |
|
275 (d[g.id]=g.getAttribute("data-defer"));this.firstDiv||(this.firstDiv=g);g=null}var c=null,u=!1,F=Object.keys(d).length,c=function(c){a.ajax({url:intel.xdk.webRoot+d[c],success:function(d){0<d.length&&(b.updatePanel(c,d),b.parseScriptTags(a.query("#"+c).get(0)));z++;z>=F&&(u=!1,a(document).trigger("defer:loaded"))},error:function(){console.log("Error with deferred load "+intel.xdk.webRoot+d[c]);z++;z>=F&&(u=!1,a(document).trigger("defer:loaded"))}})};if(0<F){var u=!0,z=0,s;for(s in d)c(s)}if(this.firstDiv)if(this.activeDiv= |
|
276 this.firstDiv,this.scrollingDivs[this.activeDiv.id]&&this.scrollingDivs[this.activeDiv.id].enable(),s=function(){a.query("#navbar").append(a.create("footer",{id:"defaultNav"}).append(a.query("#navbar").children()));b.defaultFooter="defaultNav";b.prevFooter=a.query("#defaultNav");b.updateNavbarElements(b.prevFooter);var c=a.query("nav").get(0);c&&(b.defaultMenu=a(c),b.updateSideMenuElements(b.defaultMenu),b.prevMenu=b.defaultMenu);if(c=a.query("aside").get(0))b.defaultAside=a(c),b.updateAsideElements(b.defaultAside), |
|
277 b.prevAsideMenu=b.defaultAside;b.defaultHeader="defaultHeader";a.query("#header").append(a.create("header",{id:"defaultHeader"}).append(a.query("#header").children()));b.prevHeader=a.query("#defaultHeader");a.query("#header").addClass("header");a.query("#navbar").addClass("footer");a.query("#navbar").on("click","footer>a:not(.button)",function(b){a.query("#navbar>footer>a").not(b.currentTarget).removeClass("pressed");a(b.currentTarget).addClass("pressed")});0<a.query("nav").length&&(c=b.splitview? |
|
278 " splitview":"",a.query("#afui #header").addClass("hasMenu"+c),a.query("#afui #content").addClass("hasMenu"+c),a.query("#afui #navbar").addClass("hasMenu"+c),a.query("#afui #menu").addClass("hasMenu"+c),a.query("#afui #aside_menu").addClass(c));0<a.query("aside").length&&a.query("#afui #header, #afui #content, #afui #navbar").addClass("hasAside");a.query("#afui #menu").addClass("tabletMenu");a.ui.splitview&&window.innerWidth>parseInt(a.ui.handheldMinWidth,10)&&(a.ui.sideMenuWidth=a("#menu").css("width")+ |
|
279 "px");var c=b.getPanelId(l),d=null!==c&&c==="#"+b.firstDiv.id;0<c.length&&b.loadDefaultHash&&!d?b.loadContent(l,!0,!1,"none"):(k="#"+b.firstDiv.id,b.firstDiv.style.display="block",b.parsePanelFunctions(b.firstDiv),b.loadContentData(b.firstDiv),a.query("#header .backButton").css("visibility","hidden"),("true"===b.firstDiv.getAttribute("data-modal")||"true"===b.firstDiv.getAttribute("modal"))&&b.showModal(b.firstDiv.id));b.launchCompleted=!0;a.query("#afui #splashscreen").remove();a.os.fennec?a(document).trigger("afui:ready"): |
|
280 setTimeout(function(){a(document).trigger("afui:ready")})},u)a(document).one("defer:loaded",s);else s();else setTimeout(function(){a(document).trigger("afui:ready")});a.bind(b,"content-loaded",function(){if(0<b.loadContentQueue.length){var a=b.loadContentQueue.splice(0,1)[0];b.loadContent(a[0],a[1],a[2],a[3],a[4])}});(window.navigator.standalone||this.isIntel)&&this.blockPageScroll();this.enableTabBar();this.topClickScroll()}},topClickScroll:function(){var a=this;document.getElementById("header").addEventListener("click", |
|
281 function(e){15>=e.clientY&&"h1"===e.target.nodeName.toLowerCase()&&a.scrollingDivs[a.activeDiv.id].scrollToTop("100")})},blockPageScroll:function(){a.query("#afui #header").bind("touchmove",function(a){a.preventDefault()})},noTransition:function(a,e){e.style.display="block";a.style.display="block";this.clearAnimations(e);this.css3animate(a,{x:"0%",y:0});this.finishTransition(a);e.style.zIndex=2;a.style.zIndex=1},finishTransition:function(b,e){b.style.display="none";this.doingTransition=!1;b&&a(b).trigger("unloadpanelcomplete"); |
|
282 e&&a(e).trigger("loadpanelcomplete");e&&this.clearAnimations(e);b&&this.clearAnimations(b);a.trigger(this,"content-loaded")},clearAnimations:function(b){b.style[a.feat.cssPrefix+"Transform"]="none";b.style[a.feat.cssPrefix+"Transition"]="none"}};var h=function(b,e){var c=document.getElementById("afui");if(e!==c){if("a"!==e.tagName.toLowerCase()&&e.parentNode)return h(b,e.parentNode);if("undefined"!==e.tagName&&"a"===e.tagName.toLowerCase()){if(!1!==("function"===typeof a.ui.customClickHandler?a.ui.customClickHandler: |
|
283 !1)&&a.ui.customClickHandler(e,b))return b.preventDefault();if(!(-1!==e.href.toLowerCase().indexOf("javascript:")||e.getAttribute("data-ignore")))if(-1===e.hash.indexOf("#")&&0<e.target.length)0!==e.href.toLowerCase().indexOf("javascript:")&&(a.ui.isIntel?(b.preventDefault(),intel.xdk.device.launchExternal(e.href)):a.os.desktop||(b.target.target="_blank"));else{var c=e.href,d=location.protocol+"//"+location.hostname+":"+location.port+location.pathname;0===c.indexOf(d)&&(c=c.substring(d.length));if("#"=== |
|
284 c||c.indexOf("#")===c.length-1||0===c.length&&0===e.hash.length)return b.preventDefault();d=/^((http|https|file):\/\/)/;-1!==e.href.indexOf(":")&&d.test(e.href)&&b.preventDefault();var d=e.getAttribute("data-transition"),f=e.getAttribute("data-resetHistory"),f=f&&"true"===f.toLowerCase()?!0:!1,c=0<e.hash.length?e.hash:c;a.ui.loadContent(c,f,0,d,e)}}}},g=function(a,e){void 0===e&&(e=0);var c=0,c=0;e^=-1;for(var d=0,f=a.length;d<f;d++)c=(e^a.charCodeAt(d))&255,c="0x"+"00000000 77073096 EE0E612C 990951BA 076DC419 706AF48F E963A535 9E6495A3 0EDB8832 79DCB8A4 E0D5E91E 97D2D988 09B64C2B 7EB17CBD E7B82D07 90BF1D91 1DB71064 6AB020F2 F3B97148 84BE41DE 1ADAD47D 6DDDE4EB F4D4B551 83D385C7 136C9856 646BA8C0 FD62F97A 8A65C9EC 14015C4F 63066CD9 FA0F3D63 8D080DF5 3B6E20C8 4C69105E D56041E4 A2677172 3C03E4D1 4B04D447 D20D85FD A50AB56B 35B5A8FA 42B2986C DBBBC9D6 ACBCF940 32D86CE3 45DF5C75 DCD60DCF ABD13D59 26D930AC 51DE003A C8D75180 BFD06116 21B4F4B5 56B3C423 CFBA9599 B8BDA50F 2802B89E 5F058808 C60CD9B2 B10BE924 2F6F7C87 58684C11 C1611DAB B6662D3D 76DC4190 01DB7106 98D220BC EFD5102A 71B18589 06B6B51F 9FBFE4A5 E8B8D433 7807C9A2 0F00F934 9609A88E E10E9818 7F6A0DBB 086D3D2D 91646C97 E6635C01 6B6B51F4 1C6C6162 856530D8 F262004E 6C0695ED 1B01A57B 8208F4C1 F50FC457 65B0D9C6 12B7E950 8BBEB8EA FCB9887C 62DD1DDF 15DA2D49 8CD37CF3 FBD44C65 4DB26158 3AB551CE A3BC0074 D4BB30E2 4ADFA541 3DD895D7 A4D1C46D D3D6F4FB 4369E96A 346ED9FC AD678846 DA60B8D0 44042D73 33031DE5 AA0A4C5F DD0D7CC9 5005713C 270241AA BE0B1010 C90C2086 5768B525 206F85B3 B966D409 CE61E49F 5EDEF90E 29D9C998 B0D09822 C7D7A8B4 59B33D17 2EB40D81 B7BD5C3B C0BA6CAD EDB88320 9ABFB3B6 03B6E20C 74B1D29A EAD54739 9DD277AF 04DB2615 73DC1683 E3630B12 94643B84 0D6D6A3E 7A6A5AA8 E40ECF0B 9309FF9D 0A00AE27 7D079EB1 F00F9344 8708A3D2 1E01F268 6906C2FE F762575D 806567CB 196C3671 6E6B06E7 FED41B76 89D32BE0 10DA7A5A 67DD4ACC F9B9DF6F 8EBEEFF9 17B7BE43 60B08ED5 D6D6A3E8 A1D1937E 38D8C2C4 4FDFF252 D1BB67F1 A6BC5767 3FB506DD 48B2364B D80D2BDA AF0A1B4C 36034AF6 41047A60 DF60EFC3 A867DF55 316E8EEF 4669BE79 CB61B38C BC66831A 256FD2A0 5268E236 CC0C7795 BB0B4703 220216B9 5505262F C5BA3BBE B2BD0B28 2BB45A92 5CB36A04 C2D7FFA7 B5D0CF31 2CD99E8B 5BDEAE1D 9B64C2B0 EC63F226 756AA39C 026D930A 9C0906A9 EB0E363F 72076785 05005713 95BF4A82 E2B87A14 7BB12BAE 0CB61B38 92D28E9B E5D5BE0D 7CDCEFB7 0BDBDF21 86D3D2D4 F1D4E242 68DDB3F8 1FDA836E 81BE16CD F6B9265B 6FB077E1 18B74777 88085AE6 FF0F6A70 66063BCA 11010B5C 8F659EFF F862AE69 616BFFD3 166CCF45 A00AE278 D70DD2EE 4E048354 3903B3C2 A7672661 D06016F7 4969474D 3E6E77DB AED16A4A D9D65ADC 40DF0B66 37D83BF0 A9BCAE53 DEBB9EC5 47B2CF7F 30B5FFE9 BDBDF21C CABAC28A 53B39330 24B4A3A6 BAD03605 CDD70693 54DE5729 23D967BF B3667A2E C4614AB8 5D681B02 2A6F2B94 B40BBE37 C30C8EA1 5A05DF1B 2D02EF8D".substr(9* |
|
285 c,8),e=e>>>8^c;return(e^-1)>>>0};a.ui=new f;a.ui.init=!0;a(window).trigger("afui:preinit");a(window).trigger("afui:init")})(af); |
|
286 (function(a){var n=function(){a.ui.isIntel=!0;setTimeout(function(){document.getElementById("afui").style.height="100%";document.body.style.height="100%";document.documentElement.style.minHeight=window.innerHeight},30);document.removeEventListener("intel.xdk.device.ready",n)};document.addEventListener("intel.xdk.device.ready",n);a.feat.nativeTouchScroll&&document.addEventListener("orientationchange",function(){if(a.ui.scrollingDivs[a.ui.activeDiv.id]){var l=a.ui.scrollingDivs[a.ui.activeDiv.id];l&& |
|
287 (0===l.el.scrollTop&&(l.disable(),setTimeout(function(){l.enable()},300)),l.refresh&&l.updateP2rHackPosition())}})})(af); |
|
288 (function(a){a.availableTransitions.fade=function(n,l,k){var f=this;k?(l.style.zIndex=1,n.style.zIndex=2,f.clearAnimations(l),f.css3animate(n,{x:"0%",time:a.transitionTime,opacity:0.1,complete:function(a){a?f.finishTransition(n,l):(f.css3animate(n,{x:"-100%",opacity:1,complete:function(){f.finishTransition(n)}}),l.style.zIndex=2,n.style.zIndex=1)}})):(n.style.zIndex=1,l.style.zIndex=2,l.style.opacity=0,f.css3animate(l,{x:"0%",opacity:0.1,complete:function(){f.css3animate(l,{x:"0%",time:a.transitionTime, |
|
289 opacity:1,complete:function(a){a?f.finishTransition(n,l):(f.clearAnimations(l),f.css3animate(n,{x:"-100%",y:0,complete:function(){f.finishTransition(n)}}))}})}}))}})(af.ui); |
|
290 (function(a){a.availableTransitions.flip=function(n,l,k){var f=this;k||(n.style.zIndex=1,l.style.zIndex=2);f.css3animate(l,{x:"100%",scale:0.8,rotateY:"180deg",complete:function(){f.css3animate(l,{x:"0%",scale:1,time:a.transitionTime,rotateY:"0deg",complete:function(){f.clearAnimations(l)}})}});f.css3animate(n,{x:"100%",time:a.transitionTime,scale:0.8,rotateY:"180deg",complete:function(){f.css3animate(n,{x:"-100%",opacity:1,scale:1,rotateY:"0deg",complete:function(){f.finishTransition(n)}});l.style.zIndex= |
|
291 2;n.style.zIndex=1}})}})(af.ui); |
|
292 (function(a){a.availableTransitions.pop=function(n,l,k){var f=this;k?(l.style.zIndex=1,n.style.zIndex=2,f.clearAnimations(l),f.css3animate(n,{x:"0%",time:a.transitionTime,opacity:0.1,scale:0.2,origin:"50% 50%",complete:function(a){a?f.finishTransition(n):(f.css3animate(n,{x:"-100%",opacity:1,complete:function(){f.finishTransition(n)}}),l.style.zIndex=2,n.style.zIndex=1)}})):(n.style.zIndex=1,l.style.zIndex=2,f.css3animate(l,{x:"0%",scale:0.2,origin:"50% 50%",opacity:0.1,time:"0ms",complete:function(){f.css3animate(l, |
|
293 {x:"0%",time:a.transitionTime,scale:1,opacity:1,origin:"0% 0%",complete:function(a){a?f.finishTransition(n,l):(f.clearAnimations(l),f.css3animate(n,{x:"100%",y:0,complete:function(){f.finishTransition(n)}}))}})}}))}})(af.ui); |
|
294 (function(a){function n(l,k,f){var h=this;f?h.css3animate(l,{x:"0%",y:"0%",complete:function(){h.css3animate(l,{x:"100%",time:a.transitionTime,complete:function(){h.finishTransition(l,k)}}).link(k,{x:"0%",time:a.transitionTime})}}).link(k,{x:"-100%",y:"0%"}):h.css3animate(l,{x:"0%",y:"0%",complete:function(){h.css3animate(l,{x:"-100%",time:a.transitionTime,complete:function(){h.finishTransition(l,k)}}).link(k,{x:"0%",time:a.transitionTime})}}).link(k,{x:"100%",y:"0%"})}a.availableTransitions.slide= |
|
295 n;a.availableTransitions["default"]=n})(af.ui);(function(a){a.availableTransitions.down=function(n,l,k){var f=this;k?(n.style.zIndex=2,l.style.zIndex=1,f.css3animate(n,{y:"0%",x:"0%",complete:function(){f.css3animate(n,{y:"-100%",time:a.transitionTime,complete:function(){f.finishTransition(n,l)}})}})):(n.style.zIndex=1,l.style.zIndex=2,f.css3animate(l,{y:"-100%",x:"0%",time:"10ms",complete:function(){f.css3animate(l,{y:"0%",time:a.transitionTime,complete:function(){f.finishTransition(n,l)}})}}))}})(af.ui); |
|
296 (function(a){a.availableTransitions.up=function(n,l,k){var f=this;k?(n.style.zIndex=2,l.style.zIndex=1,f.css3animate(n,{y:"0%",x:"0%",complete:function(){f.css3animate(n,{y:"100%",time:a.transitionTime,complete:function(){f.finishTransition(n,l)}})}})):(n.style.zIndex=1,l.style.zIndex=2,f.css3animate(l,{y:"100%",x:"0%",time:"10ms",complete:function(){f.css3animate(l,{y:"0%",time:a.transitionTime,complete:function(){f.finishTransition(n,l)}})}}))}})(af.ui); |
|
297 (function(a){function n(){a.ui.isWin8=!0;a.os.ie&&a.ui.isSideMenuEnabled()&&a.ui.ready(function(){if(!a.ui.tilesLoaded){a.ui.tilesLoaded=!0;if(window.innerWidth>a.ui.handheldMinWidth)return!0;a.ui.slideSideMenu&&(a.ui.slideSideMenu=!1);a.query("#afui #navbar footer").append("<a id='metroMenu' onclick='$.ui.toggleSideMenu()'>\u2022\u2022\u2022</a>");var l=a.query("#afui #navbar").find("a").not(".button");if(0<l.length){l.data("ignore-pressed","true").data("resetHistory","true");var k=parseFloat(100/ |
|
298 l.length);l.css("width",k+"%")}var f=a.ui.updateNavbarElements;a.ui.updateNavbarElements=function(){f.apply(a.ui,arguments);1!==a.query("#afui #navbar #metroMenu").length&&a.query("#afui #navbar footer").append("<a id='metroMenu' onclick='$.ui.toggleSideMenu()'>\u2022\u2022\u2022</a>")};a.ui.isSideMenuOn=function(){var f=0>parseInt(a.getCssMatrix(a("#navbar")).f,10)?!0:!1;return this.isSideMenuEnabled()&&f};a.ui.toggleRightSideMenu=function(f,g,b){if(this.isAsideMenuEnabled()&&!this.togglingAsideMenu){var e= |
|
299 this,c=a("#menu"),d=a.query("#aside_menu"),k=a.query("#content, #header, #navbar"),l=a.query(".afui_panel_mask");b=b||this.transitionTime;var n="block"===a("#aside_menu").css("display"),y="-"+e.sideMenuWidth;0===l.length&&window.innerWidth<a.ui.handheldMinWidth&&(k.append("<div class='afui_panel_mask'></div>"),l=a.query(".afui_panel_mask"),a(".afui_panel_mask").bind("click",function(){a.ui.toggleSideMenu(!1,null,null,!0)}));var u=this.getSideMenuPosition();n&&0<u&&(n=!1);if(2===f||!n&&(void 0!== |
|
300 f&&!1!==f||void 0===f))this.togglingSideMenu=!0,d.show(),e.css3animate(k,{x:y,time:b,complete:function(b){e.togglingSideMenu=!1;k.vendorCss("Transition","");g&&g(b);0!==l.length&&window.innerWidth<a.ui.handheldMinWidth&&l.show()}});else if(void 0===f||void 0!==f&&!1===f)this.togglingSideMenu=!0,e.css3animate(k,{x:"0px",time:b,complete:function(b){k.vendorCss("Transition","");k.vendorCss("Transform","");e.togglingSideMenu=!1;g&&g(b);a.ui.splitview||c.hide();d.hide();0!==l.length&&window.innerWidth< |
|
301 a.ui.handheldMinWidth&&l.hide()}})}};a.ui.toggleLeftSideMenu=function(f,g){if(this.isSideMenuEnabled()&&!this.togglingSideMenu){this.togglingSideMenu=!0;var b=this,e=a.query("#menu"),c=a.query("#navbar"),d=this.isSideMenuOn();if(2===f||!d&&(void 0!==f&&!1!==f||void 0===f))e.show(),b.css3animate(c,{y:"-150px",time:a.ui.transitionTime,complete:function(){b.togglingSideMenu=!1;g&&g(!0)}}),b.css3animate(e,{y:"0px",time:a.ui.transitionTime});else if(void 0===f||void 0!==f&&!1===f)b.css3animate(c,{y:"0", |
|
302 time:a.ui.transitionTime,complete:function(){b.togglingSideMenu=!1;g&&g(!0);e.hide()}}),b.css3animate(e,{y:"150px",time:a.ui.transitionTime})}}}})}if(!a)throw"This plugin requires AFUi";a.ui?a.ui.ready(function(){n()}):a(document).ready(function(){n()})})(af); |