/** * * /$$ * | $$ * | $$ /$$ /$$ /$$$$$$$ /$$$$$$ /$$$$$$ * | $$ | $$ | $$| $$__ $$ /$$__ $$ /$$__ $$ * | $$ | $$ | $$| $$ \ $$| $$ \ $$| $$ \ $$ * | $$ | $$ | $$| $$ | $$| $$ | $$| $$ | $$ * | $$$$$$$$| $$$$$$/| $$ | $$| $$$$$$$| $$$$$$/ * |________/ \______/ |__/ |__/ \____ $$ \______/ * /$$ \ $$ * | $$$$$$/ * \______/ * * @copyright 2011-2012 TapQuo Inc (c) * @license http://www.github.com/tapquo/lungo/blob/master/LICENSE.txt * @version 1.2 * @link https://github.com/TapQuo/Lungo.js * * @author Javier Jimenez Villar || @soyjavi * @author Guillermo Pascual || @pasku1 */ var Quo=function(){function a(j,b){j=j||h;j.__proto__=a.prototype;j.selector=b||"";return j}function f(j){if(j){var b=f.getDomainSelector(j);return a(b,j)}else return a()}var h=[];f.extend=function(j){Array.prototype.slice.call(arguments,1).forEach(function(b){for(key in b)j[key]=b[key]});return j};a.prototype=f.fn={};return f}();window.Quo=Quo;"$$"in window||(window.$$=Quo); (function(a){function f(b){return b.filter(function(g){return g!==undefined&&g!==null})}var h=Object.prototype,j=[];a.toType=function(b){return h.toString.call(b).match(/\s([a-z|A-Z]+)/)[1].toLowerCase()};a.isOwnProperty=function(b,g){return h.hasOwnProperty.call(b,g)};a.getDomainSelector=function(b){var g=null,c=[1,9,11],e=a.toType(b);if(e==="array")g=f(b);else if(e==="string")g=a.query(document,b);else if(c.indexOf(b.nodeType)>=0||b===window)g=[b];return g};a.map=function(b,g){var c=[],e;if(a.toType(b)=== "array")for(e=0;e0?[].concat.apply([],c):c};a.each=function(b,g){var c;if(a.toType(b)==="array")for(c=0;c=0}))}})(Quo); (function(a){a.fn.attr=function(f,h){return a.toType(f)==="string"&&h===undefined?this[0].getAttribute(f):this.each(function(){this.setAttribute(f,h)})};a.fn.data=function(f,h){return this.attr("data-"+f,h)};a.fn.val=function(f){return a.toType(f)==="string"?this.each(function(){this.value=f}):this.length>0?this[0].value:null};a.fn.show=function(){return this.style("display","block")};a.fn.hide=function(){return this.style("display","none")};a.fn.height=function(){return this.offset().height};a.fn.width= function(){return this.offset().width};a.fn.offset=function(){var f=this[0].getBoundingClientRect();return{left:f.left+window.pageXOffset,top:f.top+window.pageYOffset,width:f.width,height:f.height}};a.fn.remove=function(){return this.each(function(){this.parentNode!=null&&this.parentNode.removeChild(this)})}})(Quo); (function(a){var f=/WebKit\/([\d.]+)/,h={android:/(Android)\s+([\d.]+)/,ipad:/(iPad).*OS\s([\d_]+)/,iphone:/(iPhone\sOS)\s([\d_]+)/,blackberry:/(BlackBerry).*Version\/([\d.]+)/,webos:/(webOS|hpwOS)[\s\/]([\d.]+)/},j=null;a.isMobile=function(){j=j||b();return j.isMobile};a.environment=function(){return j=j||b()};a.isOnline=function(){return navigator.onLine};var b=function(){var g=navigator.userAgent,c={},e=g.match(f);c.browser=e?e[0]:g;var i;for(os in h)if(e=g.match(h[os])){i={name:os==="iphone"|| os==="ipad"?"ios":os,version:e[2].replace("_",".")};break}c.os=i;c.isMobile=c.os?true:false;c.screen={width:window.innerWidth,height:window.innerHeight};return c}})(Quo); (function(a){a.fn.text=function(f){return!f?this[0].textContent:this.each(function(){this.textContent=f})};a.fn.html=function(f){return a.toType(f)==="string"?this.each(function(){this.innerHTML=f}):this[0].innerHTML};a.fn.append=function(f){return this.each(function(){if(a.toType(f)==="string"){if(f){var h=document.createElement();h.innerHTML=f;this.appendChild(h.firstChild)}}else this.insertBefore(f)})};a.fn.prepend=function(f){return this.each(function(){if(a.toType(f)==="string")this.innerHTML= f+this.innerHTML;else{var h=this.parentNode;h.insertBefore(f,h.firstChild)}})};a.fn.empty=function(){return this.each(function(){this.innerHTML=null})}})(Quo); (function(a){a.query=function(j,b){var g=document.querySelectorAll(b);return g=Array.prototype.slice.call(g)};a.fn.parent=function(j){var b=j?f(this):this.instance("parentNode");return h(b,j)};a.fn.siblings=function(j){var b=this.map(function(g,c){return Array.prototype.slice.call(c.parentNode.children).filter(function(e){return e!==c})});return h(b,j)};a.fn.children=function(j){var b=this.map(function(){return Array.prototype.slice.call(this.children)});return h(b,j)};a.fn.get=function(j){return j=== undefined?this:this[j]};a.fn.first=function(){return a(this[0])};a.fn.last=function(){return a(this[this.length-1])};a.fn.closest=function(j,b){var g=this[0],c=a(j);for(c.length||(g=null);g&&c.indexOf(g)<0;)g=g!==b&&g!==document&&g.parentNode;return a(g)};a.fn.each=function(j){this.forEach(function(b,g){j.call(b,g,b)});return this};var f=function(j){for(var b=[];j.length>0;)j=a.map(j,function(g){if((g=g.parentNode)&&g!==document&&b.indexOf(g)<0){b.push(g);return g}});return b},h=function(j,b){return b=== undefined?a(j):a(j).filter(b)}})(Quo); (function(a){function f(h,j){return j.split(/\s+/g).indexOf(h)>=0}a.fn.addClass=function(h){return this.each(function(){f(h,this.className)||(this.className+=" "+h)})};a.fn.removeClass=function(h){return this.each(function(){if(f(h,this.className))this.className=this.className.replace(h," ").replace(/\s+/gi," ")})};a.fn.toggleClass=function(h){return this.each(function(){if(f(h,this.className))this.className=this.className.replace(h," ");else this.className+=" "+h})};a.fn.hasClass=function(h){return f(h, this[0].className)};a.fn.style=function(h,j){return!j?this[0].style[h]||document.defaultView.getComputedStyle(this[0],"")[h]:this.each(function(){this.style[h]=j})}})(Quo); (function(a){function f(e,i){if(i.contentType)i.headers["Content-Type"]=i.contentType;if(i.dataType)i.headers.Accept=g[i.dataType];for(header in i.headers)e.setRequestHeader(header,i.headers[header])}function h(e,i){e.onreadystatechange={};e.abort();i.error.call(i.context,"QuoJS \u00bb $$.ajax : timeout exceeded",e,i)}function j(e,i){var d=e.responseText;if(d)if(i.dataType===b.MIME)try{d=JSON.parse(d)}catch(k){d=k;i.error.call(i.context,"Parse Error",e,i)}else if(i.dataType==="xml")d=e.responseXML; return d}var b={TYPE:"GET",MIME:"json"},g={script:"text/javascript, application/javascript",json:"application/json",xml:"application/xml, text/xml",html:"text/html",text:"text/plain"},c=0;a.ajaxSettings={type:b.TYPE,async:true,success:{},error:{},context:null,dataType:b.MIME,headers:{},xhr:function(){return new window.XMLHttpRequest},crossDomain:false,timeout:0};a.ajax=function(e){var i=a.mix(a.ajaxSettings,e);if(/=\?/.test(i.url))return a.jsonp(i);var d=i.xhr();d.onreadystatechange=function(){if(d.readyState=== 4){clearTimeout(k);if(d.status===200||d.status===0){if(i.async){var m=j(d,i);i.success.call(i.context,m,d)}}else i.error.call(i.context,"QuoJS \u00bb $$.ajax",d,i)}};d.open(i.type,i.url,i.async);f(d,i);if(i.timeout>0)var k=setTimeout(function(){h(d,i)},i.timeout);d.send(i.data);return i.async?d:j(d,i)};a.jsonp=function(e){var i="jsonp"+ ++c,d=document.createElement("script"),k={abort:function(){a(d).remove();if(i in window)window[i]={}}},m;window[i]=function(n){clearTimeout(m);a(d).remove();delete window[i]; e.success.call(e.context,n,k)};d.src=e.url.replace(/=\?/,"="+i);a("head").append(d);if(e.timeout>0)m=setTimeout(function(){h(k,e)},e.timeout);return k};a.get=function(e,i,d,k){e+=a.serializeParameters(i);return a.ajax({url:e,success:d,dataType:k})};a.post=function(e,i,d,k){return a.ajax({type:"POST",url:e,data:i,success:d,dataType:k,contentType:"application/x-www-form-urlencoded"})};a.json=function(e,i,d){e+=a.serializeParameters(i);return a.ajax({url:e,success:d,dataType:b.MIME})};a.serializeParameters= function(e){var i="?",d;for(d in e)if(e.hasOwnProperty(d)){if(i!=="?")i+="&";i+=d+"="+e[d]}return i==="?"?"":i}})(Quo); (function(a){var f={touch:"touchstart",tap:"tap"},h=/complete|loaded|interactive/;["touch","tap"].forEach(function(j){a.fn[j]=function(b){a(document.body).delegate(this.selector,f[j],b);return this}});a.fn.on=function(j,b,g){return b===undefined||a.toType(b)==="function"?this.bind(j,b):this.delegate(b,j,g)};a.fn.off=function(j,b,g){return b===undefined||a.toType(b)==="function"?this.unbind(j,b):this.undelegate(b,j,g)};a.fn.ready=function(j){h.test(document.readyState)?j(a):document.addEventListener("DOMContentLoaded", function(){j(a)},false);return this}})(Quo); (function(a){function f(k,m,n,r,s){m=(a.isMobile()?m:d[m])||m;var v=k._id||(k._id=c++);v=e[v]||(e[v]=[]);s=s&&s(n,m);m={event:m,callback:n,selector:r,proxy:j(s,n,k),delegate:s,index:v.length};v.push(m);k.addEventListener(m.event,m.proxy,false)}function h(k,m,n,r){m=(a.isMobile()?m:d[m])||m;var s=k._id||(k._id=c++);b(s,m,n,r).forEach(function(v){delete e[s][v.index];k.removeEventListener(v.event,v.proxy,false)})}function j(k,m,n){m=k||m;return function(r){var s=m.apply(n,[r].concat(r.data));s===false&& r.preventDefault();return s}}function b(k,m,n,r){return(e[k]||[]).filter(function(s){return s&&(!m||s.event==m)&&(!n||s.fn==n)&&(!r||s.selector==r)})}function g(k){var m=a.extend({originalEvent:k},k);a.each(i,function(n,r){m[n]=function(){this[r]=function(){return true};return k[n].apply(k,arguments)};m[r]=function(){return false}});return m}var c=1,e={},i={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"},d={touchstart:"mousedown", touchmove:"mousemove",touchend:"mouseup",tap:"click",doubletap:"dblclick",orientationchange:"resize"};a.Event=function(k){var m=document.createEvent("Events");m.initEvent(k,true,true,null,null,null,null,null,null,null,null,null,null,null,null);return m};a.fn.bind=function(k,m){return this.each(function(){f(this,k,m)})};a.fn.unbind=function(k,m){return this.each(function(){h(this,k,m)})};a.fn.delegate=function(k,m,n){return this.each(function(r,s){f(s,m,n,k,function(v){return function(z){var y=a(z.target).closest(k, s).get(0);if(y){var l=a.extend(g(z),{currentTarget:y,liveFired:s});return v.apply(y,[l].concat([].slice.call(arguments,1)))}}})})};a.fn.undelegate=function(k,m,n){return this.each(function(){h(this,m,n,k)})};a.fn.trigger=function(k){if(a.toType(k)==="string")k=a.Event(k);return this.each(function(){this.dispatchEvent(k)})}})(Quo); (function(a){function f(d){var k=Date.now(),m=k-(c.last||k);d=a.isMobile()?d.touches[0]:d;e&&clearTimeout(e);c={el:a("tagName"in d.target?d.target:d.target.parentNode),x1:d.pageX,y1:d.pageY,isDoubleTap:m>0&&m<=250?true:false,last:k};setTimeout(g,i)}function h(d){d=a.isMobile()?d.touches[0]:d;c.x2=d.pageX;c.y2=d.pageY}function j(){if(c.isDoubleTap){c.el.trigger("doubleTap");c={}}else if(c.x2>0||c.y2>0){(Math.abs(c.x1-c.x2)>30||Math.abs(c.y1-c.y2)>30)&&c.el.trigger("swipe")&&c.el.trigger("swipe"+(Math.abs(c.x1- c.x2)>=Math.abs(c.y1-c.y2)?c.x1-c.x2>0?"Left":"Right":c.y1-c.y2>0?"Up":"Down"));c.x1=c.x2=c.y1=c.y2=c.last=0;c={}}else{c.el!==undefined&&c.el.trigger("tap");e=setTimeout(function(){e=null;c={}},250)}}function b(){c={};clearTimeout(e)}function g(){if(c.last&&Date.now()-c.last>=i){c.el.trigger("longTap");c={}}}var c={},e,i=750;["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","longTap"].forEach(function(d){a.fn[d]=function(k){return this.on(d,k)}});a(document).ready(function(){var d= a(document.body);d.bind("touchstart",f);d.bind("touchmove",h);d.bind("touchend",j);d.bind("touchcancel",b)})})(Quo);(function(){var a=Math,f=/webkit/i.test(navigator.appVersion)?"webkit":/firefox/i.test(navigator.userAgent)?"Moz":"opera"in window?"O":"";/android/gi.test(navigator.appVersion);var h=/iphone|ipad/gi.test(navigator.appVersion),j=/playbook/gi.test(navigator.appVersion),b=/hp-tablet/gi.test(navigator.appVersion),g="WebKitCSSMatrix"in window&&"m11"in new WebKitCSSMatrix,c="ontouchstart"in window&&!b,e=f+"Transform"in document.documentElement.style,i=h||j,d=function(){return window.requestAnimationFrame|| window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(l){return setTimeout(l,17)}}(),k=window.cancelRequestAnimationFrame||window.webkitCancelAnimationFrame||window.webkitCancelRequestAnimationFrame||window.mozCancelRequestAnimationFrame||window.oCancelRequestAnimationFrame||window.msCancelRequestAnimationFrame||clearTimeout,m="onorientationchange"in window?"orientationchange":"resize",n=c?"touchstart":"mousedown", r=c?"touchmove":"mousemove",s=c?"touchend":"mouseup",v=c?"touchcancel":"mouseup",z="translate"+(g?"3d(":"("),y=g?",0)":")";h=function(l,p){var o=document,t;this.wrapper=typeof l=="object"?l:o.getElementById(l);this.wrapper.style.overflow="hidden";this.scroller=this.wrapper.children[0];this.options={hScroll:true,vScroll:true,x:0,y:0,bounce:true,bounceLock:false,momentum:true,lockDirection:true,useTransform:true,useTransition:false,onRefresh:null,onBeforeScrollStart:function(q){for(var u=q.target;u.nodeType!= 1;)u=u.parentNode;u.tagName!="SELECT"&&u.tagName!="INPUT"&&u.tagName!="TEXTAREA"&&q.preventDefault()},onScrollStart:null,onBeforeScrollMove:null,onScrollMove:null,onBeforeScrollEnd:null,onScrollEnd:null,onTouchEnd:null,onDestroy:null};for(t in p)this.options[t]=p[t];this.x=this.options.x;this.y=this.options.y;this.options.useTransform=e?this.options.useTransform:false;this.options.hScrollbar=this.options.hScroll&&this.options.hScrollbar;this.options.vScrollbar=this.options.vScroll&&this.options.vScrollbar; this.options.useTransition=i&&this.options.useTransition;this.scroller.style[f+"TransitionProperty"]=this.options.useTransform?"-"+f.toLowerCase()+"-transform":"top left";this.scroller.style[f+"TransitionDuration"]="0";this.scroller.style[f+"TransformOrigin"]="0 0";if(this.options.useTransition)this.scroller.style[f+"TransitionTimingFunction"]="cubic-bezier(0.33,0.66,0.66,1)";if(this.options.useTransform)this.scroller.style[f+"Transform"]=z+this.x+"px,"+this.y+"px"+y;else this.scroller.style.cssText+= ";position:absolute;top:"+this.y+"px;left:"+this.x+"px";this.refresh();this._bind(m,window);this._bind(n);c||this._bind("mouseout",this.wrapper)};h.prototype={enabled:true,x:0,y:0,steps:[],scale:1,handleEvent:function(l){switch(l.type){case n:if(!c&&l.button!==0)break;this._start(l);break;case r:this._move(l);break;case s:case v:this._end(l);break;case m:this._resize();break;case "mouseout":this._mouseout(l);break;case "webkitTransitionEnd":this._transitionEnd(l)}},_resize:function(){this.refresh()}, _pos:function(l,p){l=this.hScroll?l:0;p=this.vScroll?p:0;if(this.options.useTransform)this.scroller.style[f+"Transform"]=z+l+"px,"+p+"px"+y+" scale("+this.scale+")";else{l>>=0;p>>=0;this.scroller.style.left=l+"px";this.scroller.style.top=p+"px"}this.x=l;this.y=p},_start:function(l){var p=c?l.touches[0]:l,o,t;if(this.enabled){this.options.onBeforeScrollStart&&this.options.onBeforeScrollStart.call(this,l);this.options.useTransition&&this._transitionTime(0);this.zoomed=this.animating=this.moved=false; this.dirY=this.dirX=this.absDistY=this.absDistX=this.distY=this.distX=0;if(this.options.momentum){if(this.options.useTransform){o=getComputedStyle(this.scroller,null)[f+"Transform"].replace(/[^0-9-.,]/g,"").split(",");t=o[4]*1;o=o[5]*1}else{t=getComputedStyle(this.scroller,null).left.replace(/[^0-9-]/g,"")*1;o=getComputedStyle(this.scroller,null).top.replace(/[^0-9-]/g,"")*1}if(t!=this.x||o!=this.y){this.options.useTransition?this._unbind("webkitTransitionEnd"):k(this.aniTime);this.steps=[];this._pos(t, o)}}this.startX=this.x;this.startY=this.y;this.pointX=p.pageX;this.pointY=p.pageY;this.startTime=l.timeStamp||Date.now();this.options.onScrollStart&&this.options.onScrollStart.call(this,l);this._bind(r);this._bind(s);this._bind(v)}},_move:function(l){var p=c?l.touches[0]:l,o=p.pageX-this.pointX,t=p.pageY-this.pointY,q=this.x+o,u=this.y+t,w=l.timeStamp||Date.now();this.options.onBeforeScrollMove&&this.options.onBeforeScrollMove.call(this,l);this.pointX=p.pageX;this.pointY=p.pageY;if(q>0||q=0||this.maxScrollX>=0?0:this.maxScrollX;if(u>0||u=0||this.maxScrollY>=0?0:this.maxScrollY;if(this.absDistX<6&&this.absDistY<6){this.distX+=o;this.distY+=t;this.absDistX=a.abs(this.distX);this.absDistY=a.abs(this.distY)}else{if(this.options.lockDirection)if(this.absDistX>this.absDistY+5){u=this.y;t=0}else if(this.absDistY>this.absDistX+5){q=this.x;o=0}this.moved=true;this._pos(q,u);this.dirX=o>0?-1:o<0?1:0;this.dirY= t>0?-1:t<0?1:0;if(w-this.startTime>300){this.startTime=w;this.startX=this.x;this.startY=this.y}this.options.onScrollMove&&this.options.onScrollMove.call(this,l)}},_end:function(l){if(!(c&&l.touches.length!=0)){var p=c?l.changedTouches[0]:l,o,t,q={dist:0,time:0},u={dist:0,time:0},w=(l.timeStamp||Date.now())-this.startTime;o=this.x;t=this.y;this._unbind(r);this._unbind(s);this._unbind(v);this.options.onBeforeScrollEnd&&this.options.onBeforeScrollEnd.call(this,l);if(this.moved){if(w<300&&this.options.momentum){q= o?this._momentum(o-this.startX,w,-this.x,this.scrollerW-this.wrapperW+this.x,this.options.bounce?this.wrapperW:0):q;u=t?this._momentum(t-this.startY,w,-this.y,this.maxScrollY<0?this.scrollerH-this.wrapperH+this.y:0,this.options.bounce?this.wrapperH:0):u;o=this.x+q.dist;t=this.y+u.dist;if(this.x>0&&o>0||this.x0&&t>0||this.y> 0,t>>0,p)}else this._resetPos(200)}else{if(c){for(o=p.target;o.nodeType!=1;)o=o.parentNode;if(o.tagName!="SELECT"&&o.tagName!="INPUT"&&o.tagName!="TEXTAREA"){t=document.createEvent("MouseEvents");t.initMouseEvent("click",true,true,l.view,1,p.screenX,p.screenY,p.clientX,p.clientY,l.ctrlKey,l.altKey,l.shiftKey,l.metaKey,0,null);t._fake=true;o.dispatchEvent(t)}}this._resetPos(200)}this.options.onTouchEnd&&this.options.onTouchEnd.call(this,l)}},_resetPos:function(l){var p=this.x>=0?0:this.x=0||this.maxScrollY>0?0:this.y=t+q.time){l._pos(q.x,q.y);l.animating=false;l.options.onAnimationEnd&&l.options.onAnimationEnd.call(l);l._startAni()}else{x=(x-t)/q.time-1;u=a.sqrt(1-x*x);x=(q.x-p)*u+p;l._pos(x, (q.y-o)*u+o);if(l.animating)l.aniTime=d(w)}};w()}}else l._resetPos(400)},_transitionTime:function(l){this.scroller.style[f+"TransitionDuration"]=l+"ms"},_momentum:function(l,p,o,t,q){p=a.abs(l)/p;var u=p*p/0.0012,w=0;w=0;if(l>0&&u>o){w=q/(6/(u/p*6.0E-4));o+=w;p=p*o/u;u=o}else if(l<0&&u>t){w=q/(6/(u/p*6.0E-4));t+=w;p=p*t/u;u=t}u*=l<0?-1:1;w=p/6.0E-4;return{dist:u,time:w>>0}},_offset:function(l){for(var p=-l.offsetLeft,o=-l.offsetTop;l=l.offsetParent;){p-=l.offsetLeft;o-=l.offsetTop}return{left:p,top:o}}, _bind:function(l,p,o){(p||this.scroller).addEventListener(l,this,!!o)},_unbind:function(l,p,o){(p||this.scroller).removeEventListener(l,this,!!o)},destroy:function(){this.scroller.style[f+"Transform"]="";this._unbind(m,window);this._unbind(n);this._unbind(r);this._unbind(s);this._unbind(v);this._unbind("mouseout",this.wrapper);this.options.useTransition&&this._unbind("webkitTransitionEnd");this.options.onDestroy&&this.options.onDestroy.call(this)},refresh:function(){var l;this.wrapperW=this.wrapper.clientWidth; this.wrapperH=this.wrapper.clientHeight;this.scrollerW=this.scroller.offsetWidth;this.scrollerH=this.scroller.offsetHeight;this.maxScrollX=this.wrapperW-this.scrollerW;this.maxScrollY=this.wrapperH-this.scrollerH;this.dirY=this.dirX=0;this.hScroll=this.options.hScroll&&this.maxScrollX<0;this.vScroll=this.options.vScroll&&(!this.options.bounceLock&&!this.hScroll||this.scrollerH>this.wrapperH);l=this._offset(this.wrapper);this.wrapperOffsetLeft=-l.left;this.wrapperOffsetTop=-l.top;this.scroller.style[f+ "TransitionDuration"]="0";this._resetPos(200)},scrollTo:function(l,p,o,t){var q=l;this.stop();q.length||(q=[{x:l,y:p,time:o,relative:t}]);l=0;for(p=q.length;l0?0:o.left0?0:o.top",SPAN:" "},CLASS:{ACTIVE:"active",ASIDE:"aside",SHOW:"show",SHOW_REVOKE:"show-revoke",HIDE:"hide",HIDE_REVOKE:"hide-revoke",CURRENT:"current",RIGHT:"onright",LEFT:"onleft",HORIZONTAL:"horizontal",FLOW:"flow"},TRIGGER:{LOAD:"load",UNLOAD:"unload"},ATTRIBUTE:{ID:"id",HREF:"href",TITLE:"title",ARTICLE:"article",CLASS:"class",WIDTH:"width",HEIGHT:"height",PIXEL:"px",PERCENT:"%", TARGET:"target",FIRST:"first",LAST:"last",EMPTY:""},BINDING:{START:"{{",END:"}}",KEY:"value",PARSER:/\{{.*?\}}/gi},ERROR:{CREATE_SCROLL:"ERROR: Impossible to create a without ID.",BINDING_DATA_TYPE:"ERROR: Processing the type of binding data.",BINDING_TEMPLATE:"ERROR: Binding Template not exists >> ",BINDING_LIST:"ERROR: Processing parameters for list binding.",DATABASE:"ERROR: Connecting to Data.Sql.",ROUTER:"ERROR: The target does not exists >>",LOADING_RESOURCE:"ERROR: Loading resource."}};LUNGO.App=function(a){var f={id:1,name:"lungo_app",version:1,icon:""};return{init:function(h){f=a.Core.mix(f,h);a.Boot()},get:function(h){return f[h]}}}(LUNGO);LUNGO.Core=function(a,f){var h=Array.prototype,j=function(c,e){return f.isOwnProperty(c,e)},b=function(c){return f.toType(c)},g=function(c){return h.slice.call(c,0)};return{log:function(c,e){a.Core.isMobile()||console[c===1?"log":c===2?"warn":"error"](e)},execute:function(){var c=g(arguments),e=c.shift();b(e)==="function"&&e.apply(null,c)},bind:function(c,e){return function(){return e.apply(c,g(arguments))}},mix:function(){for(var c=c||{},e=0,i=arguments.length;em[e]?d:0})},parseUrl:function(c){var e=c.lastIndexOf("#");if(e>0)c=c.substring(e);else if(e===-1)c="#"+c;return c},findByProperty:function(c,e,i){for(var d=null,k=0,m=c.length;k=0)i/=60;else if(e.indexOf(h.DAY)>=0)i=i/60/24;c=i="4.2"&&b.style("position","fixed")}}}(LUNGO);LUNGO.Router=function(a){var f=a.Constants.CLASS,h=a.Constants.ELEMENT,j=a.Constants.ERROR,b=a.Constants.TRIGGER,g=function(c){var e=false;if(a.dom(c).length>0)e=true;else a.Core.log(3,j.ROUTER+c);return e};return{section:function(c){c=a.Core.parseUrl(c);var e=a.Router.History.current(),i=h.SECTION+c;if(g(i)){a.dom(e).removeClass(f.HIDE_REVOKE).removeClass(f.SHOW).addClass(f.HIDE);a.dom(i).removeClass(f.SHOW_REVOKE).addClass(f.SHOW).trigger(b.LOAD);a.Router.History.add(c)}},article:function(c,e){c= a.Core.parseUrl(c);e=a.Core.parseUrl(e);var i=h.SECTION+c+" "+h.ARTICLE+e;if(g(i)){a.dom(i).trigger(b.LOAD);a.View.Article.show(c,e)}},aside:function(c,e){c=a.Core.parseUrl(c);e=a.Core.parseUrl(e);var i=h.ASIDE+e;if(g(i))a.dom(i).hasClass(f.CURRENT)?a.View.Aside.hide(c,e):a.View.Aside.show(c,e)},back:function(){var c=h.SECTION+a.Router.History.current();a.dom(c).removeClass(f.SHOW).addClass(f.SHOW_REVOKE).trigger(b.UNLOAD);a.Router.History.removeLast();a.dom(a.Router.History.current()).removeClass(f.HIDE).addClass(f.HIDE_REVOKE).addClass(f.SHOW)}}}(LUNGO);LUNGO.Router.History=function(){var a=[],f=function(){return a[a.length-1]};return{add:function(h){h!==f()&&a.push(h)},current:f,removeLast:function(){a.length-=1}}}();LUNGO.View.Article=function(a){var f=a.Constants.ELEMENT,h=a.Constants.CLASS,j=a.Constants.ATTRIBUTE,b=a.Constants.TRIGGER,g={NAVIGATION_ITEM:'a[href][data-target="article"]',REFERENCE_LINK:" a[href][data-article]"},c=function(e,i){for(var d=a.dom(f.SECTION+e+g.REFERENCE_LINK),k=0,m=d.length;k0,e=a.View.Template.exists(b.template);if(c&&e){c=a.Core.toType(b.data);if(c==="array"||c==="object")g=true}else a.Core.log(3,f.BINDING_LIST);if(g){if(b.order&&b.order.field&&b.order.type)b.data=a.Core.orderByProperty(b.data, b.order.field,b.order.type);b.data=b.data;a.View.Template.render(b.container.selector,b.template,b.data);j(b.el)}},append:function(b){var g=a.View.Template.markup(b.template,b.data);a.dom(b.el).children().first().append(g);j(b.el,h.LAST)},prepend:function(b){var g=a.View.Template.markup(b.template,b.data);a.dom(b.el).children().first().prepend(g);j(b.el,h.FIRST)}}}(LUNGO);LUNGO.View.Scroll=function(a){var f=a.Constants.CLASS,h=a.Constants.ATTRIBUTE,j=a.Constants.ERROR,b={hScroll:false,vScroll:false,useTransition:true,momentum:true,lockDirection:true,fixedScrollbar:true,fadeScrollbar:true,hideScrollbar:true},g=function(d){if(a.Data.Cache.exists("scrolls")&&a.Data.Cache.get("scrolls",d)){a.Data.Cache.get("scrolls",d).destroy();a.Data.Cache.remove("scrolls",d)}},c=function(d){d=a.dom("#"+d);var k=d.children().first();if(k.length===0){d.html("
");k=d.children().first()}return k}, e=function(d,k){var m=a.dom("#"+d),n=m[0];if(i(a.dom(n))?n.clientWidth0){var e=c.children(j.BUBBLE);if(e.length>0)e.html(g);else{e=LUNGO.Attributes.Data.Count.html.replace(h.START+h.KEY+h.END,g);c.append(e)}}else c.children(j.BUBBLE).remove()},progress:function(b,g,c,e){if(a.dom(b)){g+=f.PERCENT; a.dom(b+j.PROGRESS_VALUE).style(f.WIDTH,g);g=g;a.dom(b+j.PROGRESS_PERCENTAGE).html(c?g:f.EMPTY);a.dom(b+j.PROGRESS_DESCRIPTION).html(c?e:f.EMPTY)}}}}(LUNGO);LUNGO.Attributes.Data={Search:{tag:"search",selector:".list",html:''},Count:{tag:"count",selector:"*",html:'{{value}}'},Search:{tag:"search",selector:"*",html:''},Progress:{tag:"progress",selector:"*",html:'
'}, Label:{tag:"label",selector:"a",html:"{{value}}"},Icon:{tag:"icon",selector:"*",html:''},Image:{tag:"image",selector:"*",html:''},Title:{tag:"title",selector:"header, footer, article",html:'{{value}}'},Back:{tag:"back",selector:"header, footer",html:''}};LUNGO.Data.Cache=function(a,f){var h={},j=function(g){return arguments.length===1?h[g]:h[arguments[0]]?h[arguments[0]][arguments[1]]:f},b=function(g){return h[g]?true:false};return{set:function(g,c){h[g]=b(g)?a.Core.mix(j(g),c):c},get:j,remove:function(g){if(arguments.length===1)delete h[g];else delete h[arguments[0]][arguments[1]]},exists:b}}(LUNGO);LUNGO.Data.Sql=function(a){var f=a.Constants.ERROR,h={name:"lungo_db",version:"1.0",size:65536,schema:[]},j=null,b=function(d,k){a.Core.log(1,"lng.Data.Sql >> "+d);j.transaction(function(m){m.executeSql(d,[],function(n,r){c(k,r)},function(n){n.executedQuery=d;i.apply(null,arguments)})})},g=function(d,k){var m="",n;for(n in d)if(a.Core.isOwnProperty(d,n)){var r=d[n];if(m)m+=" "+k+" ";m+=n+"=";m+=isNaN(r)?'"'+r+'"':r}return m},c=function(d,k){a.Core.toType(d)==="function"&&setTimeout(d,100,k)},e=function(d, k){var m="",n="",r;for(r in k)if(a.Core.isOwnProperty(k,r)){var s=k[r];m+=m?", "+r:r;if(n)n+=", ";n+=isNaN(s)?'"'+s+'"':s}b("INSERT INTO "+d+" ("+m+") VALUES ("+n+")")},i=function(d,k){a.Core.log(3,"lng.Data.Sql >> "+k.code+": "+k.message+" \n Executed query: "+d.executedQuery)};return{init:function(d){h=a.Core.mix(h,d);if(j=openDatabase(h.name,h.version,h.name,h.size)){d=h.schema;var k=d.length;if(k)for(var m=0;m