diff --git a/dist/laroux.js b/dist/laroux.js index 91d3a3e..0f86b05 100644 --- a/dist/laroux.js +++ b/dist/laroux.js @@ -2463,7 +2463,7 @@ setCookie: function(name, value, expires, path) { var expireValue = ''; - if (typeof expires != 'undefined' || expires !== null) { + if (typeof expires != 'undefined' && expires !== null) { expireValue = '; expires=' + expires.toGMTString(); } diff --git a/dist/laroux.min.js b/dist/laroux.min.js index 7aa90b8..10e21c5 100644 --- a/dist/laroux.min.js +++ b/dist/laroux.min.js @@ -1,2 +1,2 @@ /*! laroux 22-11-2014 */ -!function(a){"use strict";var b=function(a,b){return a instanceof Array?Array.prototype.slice.call((b||document).querySelectorAll(a)):(b||document).querySelector(a)};b.id=function(a,b){return(b||document).getElementById(a)},b.idcs={},b.idc=function(a){return b.idcs[a]||(b.idcs[a]=document.getElementById(a))},b.parent=a,b.popupFunc=alert,b.readyPassed=!1,b.contentEnd=function(){b.readyPassed||(b.events.invoke("contentEnd"),b.readyPassed=!0)},b.ready=function(a){return b.readyPassed?void a():void b.events.add("contentEnd",a)},b.extend=function(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])},b.each=function(a,b){for(var c in a)if(b(c,a[c])===!1)break;return a},b.map=function(a,b){var c=[];for(var d in a){var e=b(a[d],d);if(e===!1)break;"undefined"!=typeof e&&c.push(e)}return c},b.aeach=function(a,b){for(var c=a.length;c--&&b(c,a[c])!==!1;);return a},b.amap=function(a,b){for(var c=[],d=a.length;d--;){var e=b(a[d],d);if(e===!1)break;"undefined"!=typeof e&&c.unshift(e)}return c},a.$l=a.laroux=b,document.addEventListener("DOMContentLoaded",b.contentEnd)}(this),function(laroux){"use strict";laroux.ajax={corsDefault:!1,wrappers:{registry:{"laroux.js":function(data){if(!data.isSuccess)return void laroux.popupFunc("Error: "+data.errorMessage);var obj;return obj="json"==data.format?JSON.parse(data.object):"script"==data.format?eval(data.object):data.object}},set:function(a,b){laroux.ajax.wrappers.registry[a]=b}},xDomainObject:!1,_xmlHttpRequestObject:null,_xDomainRequestObject:null,_xhr:function(a){if(null===laroux.ajax._xmlHttpRequestObject&&(laroux.ajax._xmlHttpRequestObject=new XMLHttpRequest),a){if(!("withCredentials"in laroux.ajax._xmlHttpRequestObject)&&"undefined"!=typeof XDomainRequest)return laroux.ajax.xDomainObject=!0,null===laroux.ajax._xDomainRequestObject&&(laroux.ajax._xDomainRequestObject=new XDomainRequest),laroux.ajax._xDomainRequestObject}else laroux.ajax.xDomainObject=!1;return laroux.ajax._xmlHttpRequestObject},_xhrResp:function(xhr,options){var wrapperFunction=xhr.getResponseHeader("X-Response-Wrapper-Function"),response;return response="undefined"==typeof options.datatype?xhr.responseText:"json"==options.datatype?JSON.parse(xhr.responseText):"script"==options.datatype?eval(xhr.responseText):"xml"==options.datatype?xhr.responseXML:xhr.responseText,null!==wrapperFunction&&"undefined"!=typeof laroux.ajax.wrappers.registry[wrapperFunction]&&(response=laroux.ajax.wrappers.registry[wrapperFunction](response)),{response:response,wrapperFunc:wrapperFunction}},makeRequest:function(a){var b=laroux.ajax.corsDefault;"undefined"!=typeof a.cors&&(b=a.cors);var c=laroux.ajax._xhr(b),d=null,e=0;"undefined"!=typeof a.timeout&&(d=setTimeout(function(){c.abort(),"undefined"!=typeof a.timeoutFn&&a.timeoutFn(a.url)},a.timeout)),c.onreadystatechange=function(){if(4==c.readyState){if(null!==d&&clearTimeout(d),c.status<300){var b=null,f=!0;try{b=laroux.ajax._xhrResp(c,a)}catch(g){"undefined"!=typeof a.error&&a.error(c,c.status,c.statusText),laroux.events.invoke("ajaxError",[c,c.status,c.statusText,a]),f=!1}f&&("undefined"!=typeof a.success&&null!==b&&a.success(b.response,b.wrapperFunc),laroux.events.invoke("ajaxSuccess",[c,b.response,b.wrapperFunc,a]))}else"undefined"!=typeof a.error&&a.error(c,c.status,c.statusText),laroux.events.invoke("ajaxError",[c,c.status,c.statusText,a]);"undefined"!=typeof a.complete&&a.complete(c,c.statusText),laroux.events.invoke("ajaxComplete",[c,c.statusText,a])}else"undefined"!=typeof a.progress&&a.progress(++e)};var f=a.url;if("object"==typeof a.getdata){var g=laroux.helpers.buildQueryString(a.getdata);g.length>0&&(f+=(f.indexOf("?")<0?"?":"&")+g)}"undefined"!=typeof a.jsonp&&(f+=(f.indexOf("?")<0?"?":"&")+"jsonp="+a.jsonp),laroux.ajax.xDomainObject?c.open(a.type,f):c.open(a.type,f,!0);try{if("undefined"!=typeof a.xhrFields)for(var h in a.xhrFields)a.xhrFields.hasOwnProperty(h)&&(c[h]=a.xhrFields[h]);if("undefined"!=typeof a.headers)for(var i in a.headers)a.headers.hasOwnProperty(i)&&c.setRequestHeader(i,a.headers[i])}catch(j){console.log(j)}var k=null;"undefined"!=typeof a.postdata&&(k=a.postdata,"undefined"!=typeof a.postdatatype&&("json"==a.postdatatype?k=JSON.stringify(k):"form"==a.postdatatype&&(k=laroux.helpers.buildFormData(a.postdata)))),c.send(k)},get:function(a,b,c,d){laroux.ajax.makeRequest({type:"GET",url:a,datatype:"html",getdata:b,headers:{"X-Requested-With":"XMLHttpRequest","X-Wrapper-Function":"laroux.js"},success:c,error:d})},getJson:function(a,b,c,d){laroux.ajax.makeRequest({type:"GET",url:a,datatype:"json",getdata:b,headers:{"X-Requested-With":"XMLHttpRequest","X-Wrapper-Function":"laroux.js"},success:c,error:d})},getJsonP:function(a,b,c,d,e){laroux.ajax.makeRequest({type:"GET",url:a,datatype:"script",getdata:b,jsonp:c,headers:{"X-Requested-With":"XMLHttpRequest"},success:d,error:e})},getScript:function(a,b,c,d){laroux.ajax.makeRequest({type:"GET",url:a,datatype:"script",getdata:b,headers:{"X-Requested-With":"XMLHttpRequest"},success:c,error:d})},post:function(a,b,c,d){laroux.ajax.makeRequest({type:"POST",url:a,datatype:"json",postdata:b,postdatatype:"form",headers:{"X-Requested-With":"XMLHttpRequest","X-Wrapper-Function":"laroux.js"},success:c,error:d})},postJson:function(a,b,c,d){laroux.ajax.makeRequest({type:"POST",url:a,datatype:"json",postdata:b,postdatatype:"json",headers:{"Content-Type":"application/json; charset=UTF-8","X-Requested-With":"XMLHttpRequest","X-Wrapper-Function":"laroux.js"},success:c,error:d})}}}(this.laroux),function(a){"use strict";a.anim={data:[],fx:{interpolate:function(a,b,c){return a+(b-a)*c},easing:function(a){return-Math.cos(a*Math.PI)/2+.5}},set:function(b){b.startTime=null,("undefined"==typeof b.unit||null===b.unit)&&(b.unit=""),("undefined"==typeof b.from||null===b.from)&&(b.from=b.object===document.body&&"scrollTop"==b.property?document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop:b.object[b.property]),"string"==typeof b.from&&(b.from=Number(b.from)),("undefined"==typeof b.reset||null===b.reset)&&(b.reset=!1),a.anim.data.push(b),1===a.anim.data.length&&requestAnimationFrame(a.anim.onframe)},setCss:function(b){("undefined"==typeof b.from||null===b.from)&&(b.from=a.css.getProperty(b.object,b.property)),b.object=b.object.style,b.property=a.helpers.camelCase(b.property),a.anim.set(b)},remove:function(b){var c=null;for(var d in a.anim.data)if(a.anim.data.hasOwnProperty(d)){var e=a.anim.data[d];if("undefined"!=typeof e.id&&e.id==b){c=d;break}}return null!==c?(a.anim.data.splice(c,1),!0):!1},onframe:function(b){var c=[];for(var d in a.anim.data)if(a.anim.data.hasOwnProperty(d)){var e=a.anim.data[d];null===e.startTime&&(e.startTime=b);var f=a.anim.step(e,b);f===!1?c.unshift(d):b>e.startTime+e.time&&(e.reset?(e.startTime=b,newanim.object===document.body&&"scrollTop"==newanim.property?scrollTo(document.body,e.from):e.object[e.property]=e.from):c.unshift(d))}for(var g in c)c.hasOwnProperty(g)&&a.anim.data.splice(c[g],1);a.anim.data.length>0&&requestAnimationFrame(a.anim.onframe)},step:function(b,c){var d=b.startTime+b.time,e=c>d?1:(c-b.startTime)/b.time,f=a.anim.fx.interpolate(b.from,b.to,a.anim.fx.easing(e))+b.unit;b.object===document.body&&"scrollTop"==b.property?scrollTo(document.body,f):b.object[b.property]=f}}}(this.laroux),function(a){"use strict";a.css={hasClass:function(a,b){return a.classList.contains(b)},addClass:function(b,c){for(var d=a.helpers.getAsArray(b),e=d.length;e--;)d[e].classList.add(c)},removeClass:function(b,c){for(var d=a.helpers.getAsArray(b),e=d.length;e--;)d[e].classList.remove(c)},toggleClass:function(b,c){for(var d=a.helpers.getAsArray(b),e=d.length;e--;)d[e].classList.contains(c)?d[e].classList.remove(c):d[e].classList.add(c)},getProperty:function(b,c){var d=getComputedStyle(b);return c=a.helpers.antiCamelCase(c),d.getPropertyValue(c)},setProperty:function(b,c,d){var e=a.helpers.getAsArray(b);if("string"==typeof c){var f=c;c={},c[f]=d}for(var g in c)if(c.hasOwnProperty(g))for(var h=a.helpers.camelCase(g),i=e.length;i--;)e[i].style[h]=c[g]},defaultTransition:"2s ease",setTransitionSingle:function(b,c){var d,e=a.helpers.getAsArray(c),f=getComputedStyle(b),g=f.getPropertyValue("transition")||f.getPropertyValue("-webkit-transition")||f.getPropertyValue("-ms-transition")||"";d=g.length>0?g.split(","):[];for(var h in e)if(e.hasOwnProperty(h)){var i,j,k=e[h].indexOf(" ");-1!==k?(i=e[h].substring(0,k),j=e[h].substring(k+1)):(i=e[h],j=a.css.defaultTransition);for(var l=!1,m=0;mwindow.innerHeight},leftOfScreen:function(a){return a.getBoundingClientRect().right<=0},rightOfScreen:function(a){return a.getBoundingClientRect().left>window.innerWidth},inViewport:function(a){var b=a.getBoundingClientRect();return!(b.bottom<=0||b.top>window.innerHeight||b.right<=0||b.left>window.innerWidth)}}}(this.laroux),function(a){"use strict";a.date={parseEpoch:function(a,b){return 3e3>=a?"now":6e4>a?(a=Math.ceil(a/1e3),a+" seconds"):36e5>a?(a=Math.ceil(a/6e4),1==a?"a minute":a+" minutes"):864e5>a?(a=Math.ceil(a/36e5),1==a?"an hour":a+" hours"):6048e5>a?(a=Math.ceil(a/864e5),1==a?"a day":a+" days"):24192e5>a?(a=Math.ceil(a/6048e5),1==a?"a week":a+" weeks"):"undefined"!=typeof b&&b===!0?null:18144e6>a?(a=Math.ceil(a/2592e6),1==a?"a month":a+" months"):(a=Math.ceil(a/31536e6),1==a?"a year":a+" years")},monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],getDateString:function(b,c){var d,e=Date.now(),f=("0"+b.getDate()).substr(-2,2),g=("0"+(b.getMonth()+1)).substr(-2,2),h=a.date.monthsShort[b.getMonth()],i=b.getFullYear(),j=e-b.getTime();0>j?(d=!0,j=Math.abs(j)):d=!1;var k=a.date.parseEpoch(j,!0);return null!==k?d?k+" later":k:"undefined"!=typeof c&&c?f+" "+h+" "+i:f+"."+g+"."+i},getLongDateString:function(b,c,d){var e,f=("0"+b.getDate()).substr(-2,2),g=("0"+(b.getMonth()+1)).substr(-2,2),h=a.date.monthsShort[b.getMonth()],i=b.getFullYear();if(e="undefined"!=typeof c&&c?f+" "+h+" "+i:f+"."+g+"."+i,"undefined"!=typeof d&&d){var j=("0"+b.getHours()).substr(-2,2),k=("0"+b.getMinutes()).substr(-2,2);e+=" "+j+":"+k}return e}}}(this.laroux),function(a){"use strict";a.dom={docprop:function(a){return document.documentElement.classList.contains(a)},select:function(a,b){return Array.prototype.slice.call((b||document).querySelectorAll(a))},selectByClass:function(a,b){return Array.prototype.slice.call((b||document).getElementsByClassName(a))},selectById:function(a,b){return(b||document).getElementById(a)},selectSingle:function(a,b){return(b||document).querySelector(a)},attr:function(a,b,c){return"undefined"==typeof c?a.getAttribute(b):null===c?void a.removeAttribute(b):void a.setAttribute(b,c)},data:function(a,b,c){return"undefined"==typeof c?a.getAttribute("data-"+b):null===c?void a.removeAttribute("data-"+b):void a.setAttribute("data-"+b,c)},eventHistory:{},setEvent:function(b,c,d){for(var e=a.helpers.getAsArray(b),f=e.length;f--;)a.dom.setEventSingle(e[f],c,d)},setEventSingle:function(b,c,d){var e=function(a){d(a,b)===!1&&(a.preventDefault?a.preventDefault():window.event&&(window.event.returnValue=!1))};"undefined"==typeof a.dom.eventHistory[b]&&(a.dom.eventHistory[b]={}),"undefined"!=typeof a.dom.eventHistory[b][c]&&(b.removeEventListener?b.removeEventListener(c,a.dom.eventHistory[b][c],!1):b.detachEvent&&b.detachEvent("on"+c,a.dom.eventHistory[b][c])),a.dom.eventHistory[b][c]=e,b.addEventListener?b.addEventListener(c,e,!1):b.attachEvent&&b.attachEvent("on"+c,e)},unsetEvent:function(b,c){for(var d=a.helpers.getAsArray(b),e=d.length;e--;){if("undefined"==typeof a.dom.eventHistory[d[e]])return;"undefined"!=typeof a.dom.eventHistory[d[e]][c]&&(d[e].removeEventListener?d[e].removeEventListener(c,a.dom.eventHistory[d[e]][c],!1):d[e].detachEvent&&d[e].detachEvent("on"+c,a.dom.eventHistory[d[e]][c])),delete a.dom.eventHistory[d[e]][c]}},create:function(a){var b=document.createDocumentFragment(),c=document.createElement("DIV");for(c.insertAdjacentHTML("beforeend",a);c.firstChild;)b.appendChild(c.firstChild);return c=null,b},createElement:function(b,c,d){var e=document.createElement(b);if("object"==typeof c)for(var f in c)c.hasOwnProperty(f)&&e.setAttribute(f,c[f]);if("object"==typeof d)for(var g in d)d.hasOwnProperty(g)&&e.setAttribute(g,d[g]);else"string"==typeof d&&d.length>0&&a.dom.append(e,d);return e},createOption:function(b,c,d,e){var f=document.createElement("OPTION");f.setAttribute("value",c),"undefined"!=typeof e&&e===!0&&f.setAttribute("checked","checked"),a.dom.append(f,d),b.appendChild(f)},selectByValue:function(a,b){for(var c=a.options.length;c--;)if(a.options[c].getAttribute("value")==b){a.selectedIndex=c;break}},clear:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},insert:function(a,b,c){a.insertAdjacentHTML(b,c)},prepend:function(a,b){a.insertAdjacentHTML("afterbegin",b)},append:function(a,b){a.insertAdjacentHTML("beforeend",b)},replace:function(b,c){a.dom.clear(b),b.insertAdjacentHTML("afterbegin",c)},replaceText:function(a,b){a.textContent=b},remove:function(a){a.remove()},cloneReturn:0,cloneAppend:1,cloneInsertAfter:2,cloneInsertBefore:3,clone:function(b,c,d,e){var f=b.cloneNode(!0);return"undefined"==typeof d&&(d=b.parentNode),"undefined"==typeof e&&(e=b),"undefined"!=typeof c&&c!=a.dom.cloneReturn&&("undefined"==typeof c||c==a.dom.cloneAppend?d.appendChild(f):c==a.dom.cloneInsertAfter?d.insertBefore(f,e.nextSibling):d.insertBefore(f,e)),f}},"undefined"==typeof Element.prototype.remove&&(Element.prototype.remove=function(){null!==this.parentElement&&this.parentElement.removeChild(this)})}(this.laroux),function(a){"use strict";a.events={delegates:[],add:function(b,c){a.events.delegates.push({event:b,fnc:c})},invoke:function(b,c){for(var d in a.events.delegates)a.events.delegates.hasOwnProperty(d)&&a.events.delegates[d].event==b&&a.events.delegates[d].fnc(c)}}}(this.laroux),function(a){"use strict";a.forms={ajaxForm:function(b,c,d){a.dom.setEvent(b,"submit",function(){return"undefined"!=typeof d&&d(),a.ajax.post(b.getAttribute("action"),a.forms.serializeFormData(b),c),!1})},isFormField:function(a){if("SELECT"==a.tagName)return!0;if("INPUT"==a.tagName){var b=a.getAttribute("type").toUpperCase();return"FILE"==b||"CHECKBOX"==b||"RADIO"==b||"TEXT"==b||"PASSWORD"==b||"HIDDEN"==b?!0:!1}return"TEXTAREA"==a.tagName?!0:!1},getFormFieldValue:function(a){if(a.disabled===!0)return null;if("SELECT"==a.tagName)return a.options[a.selectedIndex].value;if("INPUT"==a.tagName){var b=a.getAttribute("type").toUpperCase();return"FILE"==b?a.files[0]:"CHECKBOX"==b||"RADIO"==b?a.checked?a.value:null:"TEXT"==b||"PASSWORD"==b||"HIDDEN"==b?a.value:null}return"TEXTAREA"==a.tagName?a.value:null},setFormFieldValue:function(a,b){if(a.disabled!==!0)if("SELECT"!=a.tagName){if("INPUT"!=a.tagName)return"TEXTAREA"==a.tagName?void(a.value=b):void 0;var c=a.getAttribute("type").toUpperCase();if("FILE"==c)return void(a.files[0]=b);if("CHECKBOX"==c||"RADIO"==c)return void((b===!0||b==a.value)&&(a.checked=!0));if("TEXT"==c||"PASSWORD"==c||"HIDDEN"==c)return void(a.value=b)}else for(var d in a.options)if(a.options.hasOwnProperty(d)&&a.options[d].value==b)return void(a.selectedIndex=d)},toggleFormEditing:function(b,c){var d=b.querySelectorAll("*[name]");"undefined"==typeof c&&(null===b.getAttribute("data-last-enabled")?(b.setAttribute("data-last-enabled","enabled"),c=!1):(b.removeAttribute("data-last-enabled"),c=!0));for(var e=0;e/g,">").replace(/"/g,""").replace(/\r\n/g," ").replace(/[\r\n]/g," ")},random:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},find:function(a,b,c){var d;return a.some(function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},column:function(a,b){return a.map(function(a){return a[b]})},shuffle:function(b){var c=0,d=[];return b.forEach(function(b){var e=a.helpers.random(0,c);d[c++]=d[e],d[e]=b}),d},merge:function(a,b){var c=a;if(c instanceof Array)return c.concat(b);for(var d in b)c.hasOwnProperty(d)||(c[d]=b[d]);return c},duplicate:function(a){return JSON.parse(JSON.stringify(a))},getAsArray:function(a){var b;return b=a instanceof Array?a:a instanceof NodeList?Array.prototype.slice.call(a):[a]},getLength:function(a){return"object"==typeof a?"undefined"!=typeof a.length?a.length:Object.keys(a).length:-1},getKeysRecursive:function(b,c,d,e){"undefined"==typeof c&&(c="."),"undefined"==typeof d&&(d="",e=[]);for(var f in b)e.push(d+f),b[f]instanceof Object&&a.helpers.getKeysRecursive(b[f],c,d+f+c,e);return e},getElement:function(b,c,d,e){"undefined"==typeof d&&(d=null),"undefined"==typeof e&&(e=".");var f,g,h=c.indexOf(e);return-1===h?(f=c,g=null):(f=c.substring(0,h),g=c.substring(h+1)),"undefined"==typeof b[f]?null:null===g||0===g.length?b[f]:a.helpers.getElement(b[f],g,d,e)}}}(this.laroux),function(a){"use strict";a.mvc={appObjects:[],init:function(){var b=a.dom.select("*[lr-app]");for(var c in b)a.mvc.appObjects.push({app:b[c].getAttribute("lr-app"),element:b[c],model:{},cachedNodes:null})},scanElement:function(b,c,d){for(var e=0,f=b.attributes,g=f.length;g>e;e++)for(var h in c){var i="{{"+c[h]+"}}";-1!==f[e].value.indexOf(i)&&d.push({node:f[e],key:c[h],value:f[e].value})}for(var j=0,k=b.childNodes,l=k.length;l>j;j++){for(var m in c){var n="{{"+c[m]+"}}";3!==k[j].nodeType||-1!==k[j].textContent.indexOf(n)&&d.push({node:k[j],key:c[m],value:k[j].textContent})}1===k[j].nodeType&&a.mvc.scanElement(k[j],c,d)}},update:function(){for(var b in a.mvc.appObjects){var c=a.mvc.appObjects[b];a.mvc.updateApp(c)}},updateApp:function(b,c){if("undefined"!=typeof b.controller&&b.controller(b.model),null===b.cachedNodes){b.cachedNodes=[];var d=a.helpers.getKeysRecursive(b.model);a.mvc.scanElement(b.element,d,b.cachedNodes)}for(var e in b.cachedNodes){var f=b.cachedNodes[e];("undefined"==typeof c||-1!==c.indexOf(f.key))&&(f.node instanceof Attr?f.node.value=f.value:f.node.textContent=f.value)}for(var g in b.cachedNodes){var h=b.cachedNodes[g];if("undefined"==typeof c||-1!==c.indexOf(h.key)){var i="{{"+h.key+"}}",j=a.helpers.getElement(b.model,h.key);h.node instanceof Attr?h.node.value=h.node.value.replace(i,j):h.node.textContent=h.node.textContent.replace(i,j)}}},observer:function(b){var c={};for(var d in b)if("update"==b[d].type)for(var e in a.mvc.appObjects){var f=a.mvc.appObjects[e];f.model==b[d].object&&("undefined"==typeof c[f.app]?c[f.app]={app:f,keys:[b[d].name]}:c[f.app].keys.push(b[d].name))}for(var g in c)a.mvc.updateApp(c[g].app,c[g].keys)},bind:function(b,c,d){"undefined"==typeof d&&(d=window[b]);for(var e in a.mvc.appObjects){var f=a.mvc.appObjects[e];f.app==b&&(f.model=c,f.controller=d,a.mvc.updateApp(f))}Object.observe(c,a.mvc.observer)}}}(this.laroux),function(a){"use strict";a.stack=function(){this.data={},this.add=function(a,b){this.data[a]=b},this.addRange=function(a){for(var b in a)a.hasOwnProperty(b)&&(this.data[b]=a[b])},this.get=function(a,b){return this.data[a]||b||null},this.getRange=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=this.data[a[c]]);return b},this.keys=function(){return Object.keys(this.data)},this.length=function(){return Object.keys(this.data).length},this.exists=function(a){return"undefined"!=typeof this.data[a]},this.remove=function(a){delete this.data[a]},this.clear=function(){this.data={}}}}(this.laroux),function(a){"use strict";a.templates={engine:null,load:function(b,c){var d=b.innerHTML;return a.templates.engine.compile(d,c)},apply:function(b,c,d){var e=a.templates.load(b,d);return e.render(c)},insert:function(b,c,d,e,f){var g=a.templates.apply(b,c,f);a.dom.insert(d,e||"beforeend",g)}}}(this.laroux),function(a){"use strict";a.timers={data:[],set:function(b){b.next=Date.now()+b.timeout,a.timers.data.push(b)},remove:function(b){var c=null;for(var d in a.timers.data)if(a.timers.data.hasOwnProperty(d)){var e=a.timers.data[d];if("undefined"!=typeof e.id&&e.id==b){c=d;break}}return null!==c?(a.timers.data.splice(c,1),!0):!1},ontick:function(){var b=Date.now(),c=[];for(var d in a.timers.data)if(a.timers.data.hasOwnProperty(d)){var e=a.timers.data[d];if(e.next<=b){var f=e.ontick(e.state);f!==!1&&"undefined"!=typeof e.reset&&e.reset?e.next=b+e.timeout:c.unshift(d)}}for(var g in c)c.hasOwnProperty(g)&&a.timers.data.splice(c[g],1)}},a.ready(function(){setInterval(a.timers.ontick,100)})}(this.laroux),function(a){"use strict";a.triggers={delegates:[],list:[],set:function(b,c,d){var e=a.helpers.getAsArray(b);for(var f in e)e.hasOwnProperty(f)&&-1==a.triggers.list.indexOf(e[f])&&a.triggers.list.push(e[f]);a.triggers.delegates.push({conditions:e,fnc:c,state:d})},ontrigger:function(b,c){var d=a.triggers.list.indexOf(b);-1!=d&&a.triggers.list.splice(d,1);var e=[];for(var f in a.triggers.delegates)if(a.triggers.delegates.hasOwnProperty(f)){var g=0,h=a.triggers.delegates[f];for(var i in h.conditions)if(h.conditions.hasOwnProperty(i)){var j=h.conditions[i];-1!=a.triggers.list.indexOf(j)&&g++}0===g&&(h.fnc({state:h.state,args:a.helpers.getAsArray(c)}),e.unshift(f))}for(var k in e)e.hasOwnProperty(k)&&a.triggers.delegates.splice(e[k],1)}}}(this.laroux),function(a){"use strict";a.ui={floatContainer:null,popup:{defaultTimeout:500,createBox:function(b,c,d){return a.dom.createElement("DIV",{id:b,"class":c},d)},msgbox:function(b,c){var d=a.helpers.getUniqueId(),e=a.ui.popup.createBox(d,"laroux_msgbox",c);a.ui.floatContainer.appendChild(e),a.css.setProperty(e,{opacity:1}),a.timers.set({timeout:b,reset:!1,ontick:function(b){a.dom.remove(b)},state:e})},init:function(){a.popupFunc=function(b){a.ui.popup.msgbox(a.ui.popup.defaultTimeout,b)}}},loading:{elementSelector:null,element:null,defaultDelay:1500,timer:null,killTimer:function(){clearTimeout(a.ui.loading.timer)},hide:function(){a.ui.loading.killTimer(),a.css.setProperty(a.ui.loading.element,{display:"none"}),localStorage.loadingIndicator="false"},show:function(b){a.ui.loading.killTimer(),"undefined"==typeof b&&(b=a.ui.loading.defaultDelay),b>0?setTimeout(function(){a.ui.loading.show(0)},b):(a.css.setProperty(a.ui.loading.element,{display:"block"}),localStorage.loadingIndicator="true")},init:function(){null===a.ui.loading.element&&null!==a.ui.loading.elementSelector&&(a.ui.loading.element=a.dom.selectSingle(a.ui.loading.elementSelector)),null!==a.ui.loading.element&&(a.dom.setEvent(window,"load",a.ui.loading.hide),a.dom.setEvent(window,"beforeunload",a.ui.loading.show),"undefined"!=typeof localStorage.loadingIndicator&&"true"==localStorage.loadingIndicator?a.ui.loading.show(0):a.ui.loading.show())}},dynamicDates:{updateDatesElements:null,updateDates:function(){null===a.ui.dynamicDates.updateDatesElements&&(a.ui.dynamicDates.updateDatesElements=a.dom.select("*[data-epoch]")),a.ui.dynamicDates.updateDatesElements.forEach(function(b){var c=new Date(1e3*(b.getAttribute("data-epoch")>>0));a.dom.replace(b,a.date.getDateString(c)),b.setAttribute("title",a.date.getLongDateString(c))})},init:function(){a.timers.set({timeout:500,reset:!0,ontick:a.ui.dynamicDates.updateDates})}},scrollView:{selectedElements:[],onhidden:function(b){a.css.setProperty(b,{opacity:0}),a.css.setTransition(b,["opacity"])},onreveal:function(b){a.css.setProperty(b,{opacity:1})},set:function(b){for(var c in b)b.hasOwnProperty(c)&&(a.css.inViewport(b[c])||a.ui.scrollView.selectedElements.push(b[c]));a.ui.scrollView.onhidden(a.ui.scrollView.selectedElements),a.dom.setEvent(window,"scroll",a.ui.scrollView.reveal)},reveal:function(){var b=[],c=[];a.each(a.ui.scrollView.selectedElements,function(d,e){a.css.inViewport(e)&&(b.unshift(d),c.push(e))});for(var d in b)b.hasOwnProperty(d)&&a.ui.scrollView.selectedElements.splice(b[d],1);0===a.ui.scrollView.selectedElements.length&&a.dom.unsetEvent(window,"scroll"),c.length>0&&a.ui.scrollView.onreveal(c)}},createFloatContainer:function(){a.ui.floatContainer||(a.ui.floatContainer=a.dom.createElement("DIV",{id:"laroux_floatdiv"}),document.body.insertBefore(a.ui.floatContainer,document.body.firstChild))},init:function(){a.ui.createFloatContainer(),a.ui.popup.init(),a.ui.loading.init(),a.ui.dynamicDates.init()}}}(this.laroux),function(a){"use strict";a.vars={cookiePath:"/",getCookie:function(a,b){var c=new RegExp(encodeURIComponent(a)+"=[^;]+","i"),d=document.cookie.match(c);return d?decodeURIComponent(d[0].split("=")[1]):b||null},setCookie:function(b,c,d,e){var f="";("undefined"!=typeof d||null!==d)&&(f="; expires="+d.toGMTString()),document.cookie=encodeURIComponent(b)+"="+encodeURIComponent(c)+f+"; path="+(e||a.vars.cookiePath)},removeCookie:function(b,c){document.cookie=encodeURIComponent(b)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path="+(c||a.vars.cookiePath)},getLocal:function(a,b){return"undefined"==typeof localStorage[a]?b||null:JSON.parse(localStorage[a])},setLocal:function(a,b){localStorage[a]=JSON.stringify(b)},removeLocal:function(a){delete localStorage[a]},getSession:function(a,b){return"undefined"==typeof sessionStorage[a]?b||null:JSON.parse(sessionStorage[a])},setSession:function(a,b){sessionStorage[a]=JSON.stringify(b)},removeSession:function(a){delete sessionStorage[a]}}}(this.laroux); \ No newline at end of file +!function(a){"use strict";var b=function(a,b){return a instanceof Array?Array.prototype.slice.call((b||document).querySelectorAll(a)):(b||document).querySelector(a)};b.id=function(a,b){return(b||document).getElementById(a)},b.idcs={},b.idc=function(a){return b.idcs[a]||(b.idcs[a]=document.getElementById(a))},b.parent=a,b.popupFunc=alert,b.readyPassed=!1,b.contentEnd=function(){b.readyPassed||(b.events.invoke("contentEnd"),b.readyPassed=!0)},b.ready=function(a){return b.readyPassed?void a():void b.events.add("contentEnd",a)},b.extend=function(a){for(var c in a)b.hasOwnProperty(c)||(b[c]=a[c])},b.each=function(a,b){for(var c in a)if(b(c,a[c])===!1)break;return a},b.map=function(a,b){var c=[];for(var d in a){var e=b(a[d],d);if(e===!1)break;"undefined"!=typeof e&&c.push(e)}return c},b.aeach=function(a,b){for(var c=a.length;c--&&b(c,a[c])!==!1;);return a},b.amap=function(a,b){for(var c=[],d=a.length;d--;){var e=b(a[d],d);if(e===!1)break;"undefined"!=typeof e&&c.unshift(e)}return c},a.$l=a.laroux=b,document.addEventListener("DOMContentLoaded",b.contentEnd)}(this),function(laroux){"use strict";laroux.ajax={corsDefault:!1,wrappers:{registry:{"laroux.js":function(data){if(!data.isSuccess)return void laroux.popupFunc("Error: "+data.errorMessage);var obj;return obj="json"==data.format?JSON.parse(data.object):"script"==data.format?eval(data.object):data.object}},set:function(a,b){laroux.ajax.wrappers.registry[a]=b}},xDomainObject:!1,_xmlHttpRequestObject:null,_xDomainRequestObject:null,_xhr:function(a){if(null===laroux.ajax._xmlHttpRequestObject&&(laroux.ajax._xmlHttpRequestObject=new XMLHttpRequest),a){if(!("withCredentials"in laroux.ajax._xmlHttpRequestObject)&&"undefined"!=typeof XDomainRequest)return laroux.ajax.xDomainObject=!0,null===laroux.ajax._xDomainRequestObject&&(laroux.ajax._xDomainRequestObject=new XDomainRequest),laroux.ajax._xDomainRequestObject}else laroux.ajax.xDomainObject=!1;return laroux.ajax._xmlHttpRequestObject},_xhrResp:function(xhr,options){var wrapperFunction=xhr.getResponseHeader("X-Response-Wrapper-Function"),response;return response="undefined"==typeof options.datatype?xhr.responseText:"json"==options.datatype?JSON.parse(xhr.responseText):"script"==options.datatype?eval(xhr.responseText):"xml"==options.datatype?xhr.responseXML:xhr.responseText,null!==wrapperFunction&&"undefined"!=typeof laroux.ajax.wrappers.registry[wrapperFunction]&&(response=laroux.ajax.wrappers.registry[wrapperFunction](response)),{response:response,wrapperFunc:wrapperFunction}},makeRequest:function(a){var b=laroux.ajax.corsDefault;"undefined"!=typeof a.cors&&(b=a.cors);var c=laroux.ajax._xhr(b),d=null,e=0;"undefined"!=typeof a.timeout&&(d=setTimeout(function(){c.abort(),"undefined"!=typeof a.timeoutFn&&a.timeoutFn(a.url)},a.timeout)),c.onreadystatechange=function(){if(4==c.readyState){if(null!==d&&clearTimeout(d),c.status<300){var b=null,f=!0;try{b=laroux.ajax._xhrResp(c,a)}catch(g){"undefined"!=typeof a.error&&a.error(c,c.status,c.statusText),laroux.events.invoke("ajaxError",[c,c.status,c.statusText,a]),f=!1}f&&("undefined"!=typeof a.success&&null!==b&&a.success(b.response,b.wrapperFunc),laroux.events.invoke("ajaxSuccess",[c,b.response,b.wrapperFunc,a]))}else"undefined"!=typeof a.error&&a.error(c,c.status,c.statusText),laroux.events.invoke("ajaxError",[c,c.status,c.statusText,a]);"undefined"!=typeof a.complete&&a.complete(c,c.statusText),laroux.events.invoke("ajaxComplete",[c,c.statusText,a])}else"undefined"!=typeof a.progress&&a.progress(++e)};var f=a.url;if("object"==typeof a.getdata){var g=laroux.helpers.buildQueryString(a.getdata);g.length>0&&(f+=(f.indexOf("?")<0?"?":"&")+g)}"undefined"!=typeof a.jsonp&&(f+=(f.indexOf("?")<0?"?":"&")+"jsonp="+a.jsonp),laroux.ajax.xDomainObject?c.open(a.type,f):c.open(a.type,f,!0);try{if("undefined"!=typeof a.xhrFields)for(var h in a.xhrFields)a.xhrFields.hasOwnProperty(h)&&(c[h]=a.xhrFields[h]);if("undefined"!=typeof a.headers)for(var i in a.headers)a.headers.hasOwnProperty(i)&&c.setRequestHeader(i,a.headers[i])}catch(j){console.log(j)}var k=null;"undefined"!=typeof a.postdata&&(k=a.postdata,"undefined"!=typeof a.postdatatype&&("json"==a.postdatatype?k=JSON.stringify(k):"form"==a.postdatatype&&(k=laroux.helpers.buildFormData(a.postdata)))),c.send(k)},get:function(a,b,c,d){laroux.ajax.makeRequest({type:"GET",url:a,datatype:"html",getdata:b,headers:{"X-Requested-With":"XMLHttpRequest","X-Wrapper-Function":"laroux.js"},success:c,error:d})},getJson:function(a,b,c,d){laroux.ajax.makeRequest({type:"GET",url:a,datatype:"json",getdata:b,headers:{"X-Requested-With":"XMLHttpRequest","X-Wrapper-Function":"laroux.js"},success:c,error:d})},getJsonP:function(a,b,c,d,e){laroux.ajax.makeRequest({type:"GET",url:a,datatype:"script",getdata:b,jsonp:c,headers:{"X-Requested-With":"XMLHttpRequest"},success:d,error:e})},getScript:function(a,b,c,d){laroux.ajax.makeRequest({type:"GET",url:a,datatype:"script",getdata:b,headers:{"X-Requested-With":"XMLHttpRequest"},success:c,error:d})},post:function(a,b,c,d){laroux.ajax.makeRequest({type:"POST",url:a,datatype:"json",postdata:b,postdatatype:"form",headers:{"X-Requested-With":"XMLHttpRequest","X-Wrapper-Function":"laroux.js"},success:c,error:d})},postJson:function(a,b,c,d){laroux.ajax.makeRequest({type:"POST",url:a,datatype:"json",postdata:b,postdatatype:"json",headers:{"Content-Type":"application/json; charset=UTF-8","X-Requested-With":"XMLHttpRequest","X-Wrapper-Function":"laroux.js"},success:c,error:d})}}}(this.laroux),function(a){"use strict";a.anim={data:[],fx:{interpolate:function(a,b,c){return a+(b-a)*c},easing:function(a){return-Math.cos(a*Math.PI)/2+.5}},set:function(b){b.startTime=null,("undefined"==typeof b.unit||null===b.unit)&&(b.unit=""),("undefined"==typeof b.from||null===b.from)&&(b.from=b.object===document.body&&"scrollTop"==b.property?document.documentElement&&document.documentElement.scrollTop||document.body.scrollTop:b.object[b.property]),"string"==typeof b.from&&(b.from=Number(b.from)),("undefined"==typeof b.reset||null===b.reset)&&(b.reset=!1),a.anim.data.push(b),1===a.anim.data.length&&requestAnimationFrame(a.anim.onframe)},setCss:function(b){("undefined"==typeof b.from||null===b.from)&&(b.from=a.css.getProperty(b.object,b.property)),b.object=b.object.style,b.property=a.helpers.camelCase(b.property),a.anim.set(b)},remove:function(b){var c=null;for(var d in a.anim.data)if(a.anim.data.hasOwnProperty(d)){var e=a.anim.data[d];if("undefined"!=typeof e.id&&e.id==b){c=d;break}}return null!==c?(a.anim.data.splice(c,1),!0):!1},onframe:function(b){var c=[];for(var d in a.anim.data)if(a.anim.data.hasOwnProperty(d)){var e=a.anim.data[d];null===e.startTime&&(e.startTime=b);var f=a.anim.step(e,b);f===!1?c.unshift(d):b>e.startTime+e.time&&(e.reset?(e.startTime=b,newanim.object===document.body&&"scrollTop"==newanim.property?scrollTo(document.body,e.from):e.object[e.property]=e.from):c.unshift(d))}for(var g in c)c.hasOwnProperty(g)&&a.anim.data.splice(c[g],1);a.anim.data.length>0&&requestAnimationFrame(a.anim.onframe)},step:function(b,c){var d=b.startTime+b.time,e=c>d?1:(c-b.startTime)/b.time,f=a.anim.fx.interpolate(b.from,b.to,a.anim.fx.easing(e))+b.unit;b.object===document.body&&"scrollTop"==b.property?scrollTo(document.body,f):b.object[b.property]=f}}}(this.laroux),function(a){"use strict";a.css={hasClass:function(a,b){return a.classList.contains(b)},addClass:function(b,c){for(var d=a.helpers.getAsArray(b),e=d.length;e--;)d[e].classList.add(c)},removeClass:function(b,c){for(var d=a.helpers.getAsArray(b),e=d.length;e--;)d[e].classList.remove(c)},toggleClass:function(b,c){for(var d=a.helpers.getAsArray(b),e=d.length;e--;)d[e].classList.contains(c)?d[e].classList.remove(c):d[e].classList.add(c)},getProperty:function(b,c){var d=getComputedStyle(b);return c=a.helpers.antiCamelCase(c),d.getPropertyValue(c)},setProperty:function(b,c,d){var e=a.helpers.getAsArray(b);if("string"==typeof c){var f=c;c={},c[f]=d}for(var g in c)if(c.hasOwnProperty(g))for(var h=a.helpers.camelCase(g),i=e.length;i--;)e[i].style[h]=c[g]},defaultTransition:"2s ease",setTransitionSingle:function(b,c){var d,e=a.helpers.getAsArray(c),f=getComputedStyle(b),g=f.getPropertyValue("transition")||f.getPropertyValue("-webkit-transition")||f.getPropertyValue("-ms-transition")||"";d=g.length>0?g.split(","):[];for(var h in e)if(e.hasOwnProperty(h)){var i,j,k=e[h].indexOf(" ");-1!==k?(i=e[h].substring(0,k),j=e[h].substring(k+1)):(i=e[h],j=a.css.defaultTransition);for(var l=!1,m=0;mwindow.innerHeight},leftOfScreen:function(a){return a.getBoundingClientRect().right<=0},rightOfScreen:function(a){return a.getBoundingClientRect().left>window.innerWidth},inViewport:function(a){var b=a.getBoundingClientRect();return!(b.bottom<=0||b.top>window.innerHeight||b.right<=0||b.left>window.innerWidth)}}}(this.laroux),function(a){"use strict";a.date={parseEpoch:function(a,b){return 3e3>=a?"now":6e4>a?(a=Math.ceil(a/1e3),a+" seconds"):36e5>a?(a=Math.ceil(a/6e4),1==a?"a minute":a+" minutes"):864e5>a?(a=Math.ceil(a/36e5),1==a?"an hour":a+" hours"):6048e5>a?(a=Math.ceil(a/864e5),1==a?"a day":a+" days"):24192e5>a?(a=Math.ceil(a/6048e5),1==a?"a week":a+" weeks"):"undefined"!=typeof b&&b===!0?null:18144e6>a?(a=Math.ceil(a/2592e6),1==a?"a month":a+" months"):(a=Math.ceil(a/31536e6),1==a?"a year":a+" years")},monthsShort:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],getDateString:function(b,c){var d,e=Date.now(),f=("0"+b.getDate()).substr(-2,2),g=("0"+(b.getMonth()+1)).substr(-2,2),h=a.date.monthsShort[b.getMonth()],i=b.getFullYear(),j=e-b.getTime();0>j?(d=!0,j=Math.abs(j)):d=!1;var k=a.date.parseEpoch(j,!0);return null!==k?d?k+" later":k:"undefined"!=typeof c&&c?f+" "+h+" "+i:f+"."+g+"."+i},getLongDateString:function(b,c,d){var e,f=("0"+b.getDate()).substr(-2,2),g=("0"+(b.getMonth()+1)).substr(-2,2),h=a.date.monthsShort[b.getMonth()],i=b.getFullYear();if(e="undefined"!=typeof c&&c?f+" "+h+" "+i:f+"."+g+"."+i,"undefined"!=typeof d&&d){var j=("0"+b.getHours()).substr(-2,2),k=("0"+b.getMinutes()).substr(-2,2);e+=" "+j+":"+k}return e}}}(this.laroux),function(a){"use strict";a.dom={docprop:function(a){return document.documentElement.classList.contains(a)},select:function(a,b){return Array.prototype.slice.call((b||document).querySelectorAll(a))},selectByClass:function(a,b){return Array.prototype.slice.call((b||document).getElementsByClassName(a))},selectById:function(a,b){return(b||document).getElementById(a)},selectSingle:function(a,b){return(b||document).querySelector(a)},attr:function(a,b,c){return"undefined"==typeof c?a.getAttribute(b):null===c?void a.removeAttribute(b):void a.setAttribute(b,c)},data:function(a,b,c){return"undefined"==typeof c?a.getAttribute("data-"+b):null===c?void a.removeAttribute("data-"+b):void a.setAttribute("data-"+b,c)},eventHistory:{},setEvent:function(b,c,d){for(var e=a.helpers.getAsArray(b),f=e.length;f--;)a.dom.setEventSingle(e[f],c,d)},setEventSingle:function(b,c,d){var e=function(a){d(a,b)===!1&&(a.preventDefault?a.preventDefault():window.event&&(window.event.returnValue=!1))};"undefined"==typeof a.dom.eventHistory[b]&&(a.dom.eventHistory[b]={}),"undefined"!=typeof a.dom.eventHistory[b][c]&&(b.removeEventListener?b.removeEventListener(c,a.dom.eventHistory[b][c],!1):b.detachEvent&&b.detachEvent("on"+c,a.dom.eventHistory[b][c])),a.dom.eventHistory[b][c]=e,b.addEventListener?b.addEventListener(c,e,!1):b.attachEvent&&b.attachEvent("on"+c,e)},unsetEvent:function(b,c){for(var d=a.helpers.getAsArray(b),e=d.length;e--;){if("undefined"==typeof a.dom.eventHistory[d[e]])return;"undefined"!=typeof a.dom.eventHistory[d[e]][c]&&(d[e].removeEventListener?d[e].removeEventListener(c,a.dom.eventHistory[d[e]][c],!1):d[e].detachEvent&&d[e].detachEvent("on"+c,a.dom.eventHistory[d[e]][c])),delete a.dom.eventHistory[d[e]][c]}},create:function(a){var b=document.createDocumentFragment(),c=document.createElement("DIV");for(c.insertAdjacentHTML("beforeend",a);c.firstChild;)b.appendChild(c.firstChild);return c=null,b},createElement:function(b,c,d){var e=document.createElement(b);if("object"==typeof c)for(var f in c)c.hasOwnProperty(f)&&e.setAttribute(f,c[f]);if("object"==typeof d)for(var g in d)d.hasOwnProperty(g)&&e.setAttribute(g,d[g]);else"string"==typeof d&&d.length>0&&a.dom.append(e,d);return e},createOption:function(b,c,d,e){var f=document.createElement("OPTION");f.setAttribute("value",c),"undefined"!=typeof e&&e===!0&&f.setAttribute("checked","checked"),a.dom.append(f,d),b.appendChild(f)},selectByValue:function(a,b){for(var c=a.options.length;c--;)if(a.options[c].getAttribute("value")==b){a.selectedIndex=c;break}},clear:function(a){for(;a.hasChildNodes();)a.removeChild(a.firstChild)},insert:function(a,b,c){a.insertAdjacentHTML(b,c)},prepend:function(a,b){a.insertAdjacentHTML("afterbegin",b)},append:function(a,b){a.insertAdjacentHTML("beforeend",b)},replace:function(b,c){a.dom.clear(b),b.insertAdjacentHTML("afterbegin",c)},replaceText:function(a,b){a.textContent=b},remove:function(a){a.remove()},cloneReturn:0,cloneAppend:1,cloneInsertAfter:2,cloneInsertBefore:3,clone:function(b,c,d,e){var f=b.cloneNode(!0);return"undefined"==typeof d&&(d=b.parentNode),"undefined"==typeof e&&(e=b),"undefined"!=typeof c&&c!=a.dom.cloneReturn&&("undefined"==typeof c||c==a.dom.cloneAppend?d.appendChild(f):c==a.dom.cloneInsertAfter?d.insertBefore(f,e.nextSibling):d.insertBefore(f,e)),f}},"undefined"==typeof Element.prototype.remove&&(Element.prototype.remove=function(){null!==this.parentElement&&this.parentElement.removeChild(this)})}(this.laroux),function(a){"use strict";a.events={delegates:[],add:function(b,c){a.events.delegates.push({event:b,fnc:c})},invoke:function(b,c){for(var d in a.events.delegates)a.events.delegates.hasOwnProperty(d)&&a.events.delegates[d].event==b&&a.events.delegates[d].fnc(c)}}}(this.laroux),function(a){"use strict";a.forms={ajaxForm:function(b,c,d){a.dom.setEvent(b,"submit",function(){return"undefined"!=typeof d&&d(),a.ajax.post(b.getAttribute("action"),a.forms.serializeFormData(b),c),!1})},isFormField:function(a){if("SELECT"==a.tagName)return!0;if("INPUT"==a.tagName){var b=a.getAttribute("type").toUpperCase();return"FILE"==b||"CHECKBOX"==b||"RADIO"==b||"TEXT"==b||"PASSWORD"==b||"HIDDEN"==b?!0:!1}return"TEXTAREA"==a.tagName?!0:!1},getFormFieldValue:function(a){if(a.disabled===!0)return null;if("SELECT"==a.tagName)return a.options[a.selectedIndex].value;if("INPUT"==a.tagName){var b=a.getAttribute("type").toUpperCase();return"FILE"==b?a.files[0]:"CHECKBOX"==b||"RADIO"==b?a.checked?a.value:null:"TEXT"==b||"PASSWORD"==b||"HIDDEN"==b?a.value:null}return"TEXTAREA"==a.tagName?a.value:null},setFormFieldValue:function(a,b){if(a.disabled!==!0)if("SELECT"!=a.tagName){if("INPUT"!=a.tagName)return"TEXTAREA"==a.tagName?void(a.value=b):void 0;var c=a.getAttribute("type").toUpperCase();if("FILE"==c)return void(a.files[0]=b);if("CHECKBOX"==c||"RADIO"==c)return void((b===!0||b==a.value)&&(a.checked=!0));if("TEXT"==c||"PASSWORD"==c||"HIDDEN"==c)return void(a.value=b)}else for(var d in a.options)if(a.options.hasOwnProperty(d)&&a.options[d].value==b)return void(a.selectedIndex=d)},toggleFormEditing:function(b,c){var d=b.querySelectorAll("*[name]");"undefined"==typeof c&&(null===b.getAttribute("data-last-enabled")?(b.setAttribute("data-last-enabled","enabled"),c=!1):(b.removeAttribute("data-last-enabled"),c=!0));for(var e=0;e/g,">").replace(/"/g,""").replace(/\r\n/g," ").replace(/[\r\n]/g," ")},random:function(a,b){return a+Math.floor(Math.random()*(b-a+1))},find:function(a,b,c){var d;return a.some(function(a,e,f){return b.call(c,a,e,f)?(d=a,!0):void 0}),d},column:function(a,b){return a.map(function(a){return a[b]})},shuffle:function(b){var c=0,d=[];return b.forEach(function(b){var e=a.helpers.random(0,c);d[c++]=d[e],d[e]=b}),d},merge:function(a,b){var c=a;if(c instanceof Array)return c.concat(b);for(var d in b)c.hasOwnProperty(d)||(c[d]=b[d]);return c},duplicate:function(a){return JSON.parse(JSON.stringify(a))},getAsArray:function(a){var b;return b=a instanceof Array?a:a instanceof NodeList?Array.prototype.slice.call(a):[a]},getLength:function(a){return"object"==typeof a?"undefined"!=typeof a.length?a.length:Object.keys(a).length:-1},getKeysRecursive:function(b,c,d,e){"undefined"==typeof c&&(c="."),"undefined"==typeof d&&(d="",e=[]);for(var f in b)e.push(d+f),b[f]instanceof Object&&a.helpers.getKeysRecursive(b[f],c,d+f+c,e);return e},getElement:function(b,c,d,e){"undefined"==typeof d&&(d=null),"undefined"==typeof e&&(e=".");var f,g,h=c.indexOf(e);return-1===h?(f=c,g=null):(f=c.substring(0,h),g=c.substring(h+1)),"undefined"==typeof b[f]?null:null===g||0===g.length?b[f]:a.helpers.getElement(b[f],g,d,e)}}}(this.laroux),function(a){"use strict";a.mvc={appObjects:[],init:function(){var b=a.dom.select("*[lr-app]");for(var c in b)a.mvc.appObjects.push({app:b[c].getAttribute("lr-app"),element:b[c],model:{},cachedNodes:null})},scanElement:function(b,c,d){for(var e=0,f=b.attributes,g=f.length;g>e;e++)for(var h in c){var i="{{"+c[h]+"}}";-1!==f[e].value.indexOf(i)&&d.push({node:f[e],key:c[h],value:f[e].value})}for(var j=0,k=b.childNodes,l=k.length;l>j;j++){for(var m in c){var n="{{"+c[m]+"}}";3!==k[j].nodeType||-1!==k[j].textContent.indexOf(n)&&d.push({node:k[j],key:c[m],value:k[j].textContent})}1===k[j].nodeType&&a.mvc.scanElement(k[j],c,d)}},update:function(){for(var b in a.mvc.appObjects){var c=a.mvc.appObjects[b];a.mvc.updateApp(c)}},updateApp:function(b,c){if("undefined"!=typeof b.controller&&b.controller(b.model),null===b.cachedNodes){b.cachedNodes=[];var d=a.helpers.getKeysRecursive(b.model);a.mvc.scanElement(b.element,d,b.cachedNodes)}for(var e in b.cachedNodes){var f=b.cachedNodes[e];("undefined"==typeof c||-1!==c.indexOf(f.key))&&(f.node instanceof Attr?f.node.value=f.value:f.node.textContent=f.value)}for(var g in b.cachedNodes){var h=b.cachedNodes[g];if("undefined"==typeof c||-1!==c.indexOf(h.key)){var i="{{"+h.key+"}}",j=a.helpers.getElement(b.model,h.key);h.node instanceof Attr?h.node.value=h.node.value.replace(i,j):h.node.textContent=h.node.textContent.replace(i,j)}}},observer:function(b){var c={};for(var d in b)if("update"==b[d].type)for(var e in a.mvc.appObjects){var f=a.mvc.appObjects[e];f.model==b[d].object&&("undefined"==typeof c[f.app]?c[f.app]={app:f,keys:[b[d].name]}:c[f.app].keys.push(b[d].name))}for(var g in c)a.mvc.updateApp(c[g].app,c[g].keys)},bind:function(b,c,d){"undefined"==typeof d&&(d=window[b]);for(var e in a.mvc.appObjects){var f=a.mvc.appObjects[e];f.app==b&&(f.model=c,f.controller=d,a.mvc.updateApp(f))}Object.observe(c,a.mvc.observer)}}}(this.laroux),function(a){"use strict";a.stack=function(){this.data={},this.add=function(a,b){this.data[a]=b},this.addRange=function(a){for(var b in a)a.hasOwnProperty(b)&&(this.data[b]=a[b])},this.get=function(a,b){return this.data[a]||b||null},this.getRange=function(a){var b={};for(var c in a)a.hasOwnProperty(c)&&(b[a[c]]=this.data[a[c]]);return b},this.keys=function(){return Object.keys(this.data)},this.length=function(){return Object.keys(this.data).length},this.exists=function(a){return"undefined"!=typeof this.data[a]},this.remove=function(a){delete this.data[a]},this.clear=function(){this.data={}}}}(this.laroux),function(a){"use strict";a.templates={engine:null,load:function(b,c){var d=b.innerHTML;return a.templates.engine.compile(d,c)},apply:function(b,c,d){var e=a.templates.load(b,d);return e.render(c)},insert:function(b,c,d,e,f){var g=a.templates.apply(b,c,f);a.dom.insert(d,e||"beforeend",g)}}}(this.laroux),function(a){"use strict";a.timers={data:[],set:function(b){b.next=Date.now()+b.timeout,a.timers.data.push(b)},remove:function(b){var c=null;for(var d in a.timers.data)if(a.timers.data.hasOwnProperty(d)){var e=a.timers.data[d];if("undefined"!=typeof e.id&&e.id==b){c=d;break}}return null!==c?(a.timers.data.splice(c,1),!0):!1},ontick:function(){var b=Date.now(),c=[];for(var d in a.timers.data)if(a.timers.data.hasOwnProperty(d)){var e=a.timers.data[d];if(e.next<=b){var f=e.ontick(e.state);f!==!1&&"undefined"!=typeof e.reset&&e.reset?e.next=b+e.timeout:c.unshift(d)}}for(var g in c)c.hasOwnProperty(g)&&a.timers.data.splice(c[g],1)}},a.ready(function(){setInterval(a.timers.ontick,100)})}(this.laroux),function(a){"use strict";a.triggers={delegates:[],list:[],set:function(b,c,d){var e=a.helpers.getAsArray(b);for(var f in e)e.hasOwnProperty(f)&&-1==a.triggers.list.indexOf(e[f])&&a.triggers.list.push(e[f]);a.triggers.delegates.push({conditions:e,fnc:c,state:d})},ontrigger:function(b,c){var d=a.triggers.list.indexOf(b);-1!=d&&a.triggers.list.splice(d,1);var e=[];for(var f in a.triggers.delegates)if(a.triggers.delegates.hasOwnProperty(f)){var g=0,h=a.triggers.delegates[f];for(var i in h.conditions)if(h.conditions.hasOwnProperty(i)){var j=h.conditions[i];-1!=a.triggers.list.indexOf(j)&&g++}0===g&&(h.fnc({state:h.state,args:a.helpers.getAsArray(c)}),e.unshift(f))}for(var k in e)e.hasOwnProperty(k)&&a.triggers.delegates.splice(e[k],1)}}}(this.laroux),function(a){"use strict";a.ui={floatContainer:null,popup:{defaultTimeout:500,createBox:function(b,c,d){return a.dom.createElement("DIV",{id:b,"class":c},d)},msgbox:function(b,c){var d=a.helpers.getUniqueId(),e=a.ui.popup.createBox(d,"laroux_msgbox",c);a.ui.floatContainer.appendChild(e),a.css.setProperty(e,{opacity:1}),a.timers.set({timeout:b,reset:!1,ontick:function(b){a.dom.remove(b)},state:e})},init:function(){a.popupFunc=function(b){a.ui.popup.msgbox(a.ui.popup.defaultTimeout,b)}}},loading:{elementSelector:null,element:null,defaultDelay:1500,timer:null,killTimer:function(){clearTimeout(a.ui.loading.timer)},hide:function(){a.ui.loading.killTimer(),a.css.setProperty(a.ui.loading.element,{display:"none"}),localStorage.loadingIndicator="false"},show:function(b){a.ui.loading.killTimer(),"undefined"==typeof b&&(b=a.ui.loading.defaultDelay),b>0?setTimeout(function(){a.ui.loading.show(0)},b):(a.css.setProperty(a.ui.loading.element,{display:"block"}),localStorage.loadingIndicator="true")},init:function(){null===a.ui.loading.element&&null!==a.ui.loading.elementSelector&&(a.ui.loading.element=a.dom.selectSingle(a.ui.loading.elementSelector)),null!==a.ui.loading.element&&(a.dom.setEvent(window,"load",a.ui.loading.hide),a.dom.setEvent(window,"beforeunload",a.ui.loading.show),"undefined"!=typeof localStorage.loadingIndicator&&"true"==localStorage.loadingIndicator?a.ui.loading.show(0):a.ui.loading.show())}},dynamicDates:{updateDatesElements:null,updateDates:function(){null===a.ui.dynamicDates.updateDatesElements&&(a.ui.dynamicDates.updateDatesElements=a.dom.select("*[data-epoch]")),a.ui.dynamicDates.updateDatesElements.forEach(function(b){var c=new Date(1e3*(b.getAttribute("data-epoch")>>0));a.dom.replace(b,a.date.getDateString(c)),b.setAttribute("title",a.date.getLongDateString(c))})},init:function(){a.timers.set({timeout:500,reset:!0,ontick:a.ui.dynamicDates.updateDates})}},scrollView:{selectedElements:[],onhidden:function(b){a.css.setProperty(b,{opacity:0}),a.css.setTransition(b,["opacity"])},onreveal:function(b){a.css.setProperty(b,{opacity:1})},set:function(b){for(var c in b)b.hasOwnProperty(c)&&(a.css.inViewport(b[c])||a.ui.scrollView.selectedElements.push(b[c]));a.ui.scrollView.onhidden(a.ui.scrollView.selectedElements),a.dom.setEvent(window,"scroll",a.ui.scrollView.reveal)},reveal:function(){var b=[],c=[];a.each(a.ui.scrollView.selectedElements,function(d,e){a.css.inViewport(e)&&(b.unshift(d),c.push(e))});for(var d in b)b.hasOwnProperty(d)&&a.ui.scrollView.selectedElements.splice(b[d],1);0===a.ui.scrollView.selectedElements.length&&a.dom.unsetEvent(window,"scroll"),c.length>0&&a.ui.scrollView.onreveal(c)}},createFloatContainer:function(){a.ui.floatContainer||(a.ui.floatContainer=a.dom.createElement("DIV",{id:"laroux_floatdiv"}),document.body.insertBefore(a.ui.floatContainer,document.body.firstChild))},init:function(){a.ui.createFloatContainer(),a.ui.popup.init(),a.ui.loading.init(),a.ui.dynamicDates.init()}}}(this.laroux),function(a){"use strict";a.vars={cookiePath:"/",getCookie:function(a,b){var c=new RegExp(encodeURIComponent(a)+"=[^;]+","i"),d=document.cookie.match(c);return d?decodeURIComponent(d[0].split("=")[1]):b||null},setCookie:function(b,c,d,e){var f="";"undefined"!=typeof d&&null!==d&&(f="; expires="+d.toGMTString()),document.cookie=encodeURIComponent(b)+"="+encodeURIComponent(c)+f+"; path="+(e||a.vars.cookiePath)},removeCookie:function(b,c){document.cookie=encodeURIComponent(b)+"=; expires=Thu, 01 Jan 1970 00:00:00 GMT; path="+(c||a.vars.cookiePath)},getLocal:function(a,b){return"undefined"==typeof localStorage[a]?b||null:JSON.parse(localStorage[a])},setLocal:function(a,b){localStorage[a]=JSON.stringify(b)},removeLocal:function(a){delete localStorage[a]},getSession:function(a,b){return"undefined"==typeof sessionStorage[a]?b||null:JSON.parse(sessionStorage[a])},setSession:function(a,b){sessionStorage[a]=JSON.stringify(b)},removeSession:function(a){delete sessionStorage[a]}}}(this.laroux); \ No newline at end of file diff --git a/src/laroux.vars.js b/src/laroux.vars.js index a0ac53c..6d34fb5 100644 --- a/src/laroux.vars.js +++ b/src/laroux.vars.js @@ -20,7 +20,7 @@ setCookie: function(name, value, expires, path) { var expireValue = ''; - if (typeof expires != 'undefined' || expires !== null) { + if (typeof expires != 'undefined' && expires !== null) { expireValue = '; expires=' + expires.toGMTString(); }