43 lines
215 KiB
JavaScript
43 lines
215 KiB
JavaScript
|
|
|||
|
(function(){"use strict";if(!("Ink"in window)){var e={Ink:"INK_PATH"in window?window.INK_PATH:window.location.protocol+"//js.ink.sapo.pt/Ink/"},n={},t=[],r={},i=[],o=function(e){if("object"!=typeof e)return!1;for(var n in e)if(e.hasOwnProperty(n))return!1;return!0};window.Ink={_checkPendingRequireModules:function(){var e,t,r,o,a,u,s=[];for(e=0,t=i.length;t>e;++e)if(r=i[e]){for(o in r.left)r.left.hasOwnProperty(o)&&(a=n[o],a&&(r.args[r.left[o]]=a,delete r.left[o],--r.remaining));if(r.remaining>0)s.push(r);else{if(u=r.cb,!u)continue;delete r.cb,u.apply(!1,r.args)}}i=s,i.length>0&&setTimeout(function(){Ink._checkPendingRequireModules()},0)},_modNameToUri:function(n){if(-1!==n.indexOf("/"))return n;var t=n.replace(/_/g,".").split("."),r=t.shift(),i=e[r];return i||(i="./"+r+"/"),[i,t.join("/"),"/lib.js"].join("")},getPath:function(n){return e[n||"Ink"]},setPath:function(n,t){e[n]=t},loadScript:function(e){var n=document.createElement("script");n.setAttribute("type","text/javascript"),n.setAttribute("src",this._modNameToUri(e));var t=document.getElementsByTagName("head");t.length>0&&t[0].appendChild(n)},namespace:function(e,n){if(!e||!e.length)return null;for(var t,r=e.split("."),i=window,o=0,a=r.length;a>o;++o)i[r[o]]=i[r[o]]||{},t=i,i=i[r[o]];return n?[t,r[o-1]]:i},getModule:function(e,t){var r=t?[e,"_",t].join(""):e;return n[r]},createModule:function(e,i,a,u){var s=function(){if("string"!=typeof e)throw Error("module name must be a string!");if(!("number"==typeof i||"string"==typeof i&&i.length>0))throw Error("version number missing!");var a=[e,"_",i].join("");if(!n[a]){delete r[a],delete r[e];var s=Array.prototype.slice.call(arguments),c=u.apply(window,s);t.push(a),"object"==typeof c?c._version=i:"function"==typeof c&&(c.prototype._version=i,c._version=i);var l,f=0===e.indexOf("Ink.");f&&(l=Ink.namespace(e,!0)),n[a]=c,f&&(l[0][l[1]+"_"+i]=c),n[e]=c,f&&o(l[0][l[1]])&&(l[0][l[1]]=c),this&&Ink._checkPendingRequireModules()}};this.requireModules(a,s)},requireModules:function(e,t){var o,a,u,s,c;if(a=e.length,u={args:Array(a),left:{},remaining:a,cb:t},"object"!=typeof e||void 0===e.length)throw Error("Dependency list should be an array!");if("function"!=typeof t)throw Error("Callback should be a function!");for(o=0;a>o;++o)s=e[o],c=n[s],c?(u.args[o]=c,--u.remaining):(r[s]||(r[s]=!0,Ink.loadScript(s)),u.left[s]=o);u.remaining>0?i.push(u):t.apply(!0,u.args)},getModulesLoadOrder:function(){return t.slice()},getModuleScripts:function(){var e=this.getModulesLoadOrder();return e.unshift("Ink_1"),e=e.map(function(e){var n=e.indexOf(".");-1===n&&(n=e.indexOf("_"));var t=e.substring(0,n);e=e.substring(n+1);var r=Ink.getPath(t);return['<script type="text/javascript" src="',r,e.replace(/\./g,"/"),'/"></script>'].join("")}),e.join("\n")},bind:function(e,n){var t=Array.prototype.slice.call(arguments,2);return function(){var r=Array.prototype.slice.call(arguments),i=t.concat(r);return e.apply(n,i)}},bindMethod:function(e,n){return this.bind.apply(this,[e[n],e].concat([].slice.call(arguments,2)))},bindEvent:function(e,n){var t=Array.prototype.slice.call(arguments,2);return function(r){var i=t.slice();return i.unshift(r||window.event),e.apply(n,i)}},i:function(e){if(!e)throw Error("Ink.i => id or element must be passed");return"string"==typeof e?document.getElementById(e):e},s:function(e,n){if(Ink.Dom===void 0||Ink.Dom.Selector===void 0)throw Error("This method requires Ink.Dom.Selector");return Ink.Dom.Selector.select(e,n||document)[0]||null},ss:function(e,n){if(Ink.Dom===void 0||Ink.Dom.Selector===void 0)throw Error("This method requires Ink.Dom.Selector");return Ink.Dom.Selector.select(e,n||document)},extendObj:function(e,n){if(arguments.length>2&&(n=Ink.extendObj.apply(this,[].slice.call(arguments,1))),n)for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(e[t]=n[t]);return e}}}})();
|
|||
|
Ink.createModule("Ink.Net.Ajax","1",[],function(){"use strict";var Ajax=function(t,e){this.init(t,e)};Ajax.globalOptions={parameters:{},requestHeaders:{}};var xMLHttpRequestWithCredentials="XMLHttpRequest"in window&&"withCredentials"in new XMLHttpRequest;return Ajax.prototype={init:function(t,e){if(!t)throw Error("WRONG_ARGUMENTS_ERR");var n=Ink.extendObj({asynchronous:!0,method:"POST",parameters:null,timeout:0,delay:0,postBody:"",contentType:"application/x-www-form-urlencoded",requestHeaders:null,onComplete:null,onSuccess:null,onFailure:null,onException:null,onHeaders:null,onCreate:null,onInit:null,onTimeout:null,sanitizeJSON:!1,evalJS:!0,xhrProxy:"",cors:!1,debug:!1,useCredentials:!1,signRequest:!1},Ajax.globalOptions);if(e&&"object"==typeof e){if(n=Ink.extendObj(n,e),"object"==typeof e.parameters)n.parameters=Ink.extendObj(Ink.extendObj({},Ajax.globalOptions.parameters),e.parameters);else if(null!==e.parameters){var s=this.paramsObjToStr(Ajax.globalOptions.parameters);s&&(n.parameters=e.parameters+"&"+s)}n.requestHeaders=Ink.extendObj({},Ajax.globalOptions.requestHeaders),n.requestHeaders=Ink.extendObj(n.requestHeaders,e.requestHeaders)}this.options=n,this.safeCall("onInit");var r=document.createElementNS?document.createElementNS("http://www.w3.org/1999/xhtml","a"):document.createElement("a");r.href=t,this.url=t,this.isHTTP=r.protocol.match(/^https?:$/i)&&!0,this.requestHasBody=0>n.method.search(/^get|head$/i),this.isCrossDomain=this.isHTTP&&"widget:"!==location.protocol&&"object"!=typeof window.widget?location.protocol!==r.protocol||location.host!==r.host:!1,this.options.cors&&(this.isCrossDomain=!1),this.transport=this.getTransport(),this.request()},getTransport:function(){if(!xMLHttpRequestWithCredentials&&this.options.cors&&"XDomainRequest"in window)return this.usingXDomainReq=!0,new XDomainRequest;if("undefined"!=typeof XMLHttpRequest)return new XMLHttpRequest;if("undefined"==typeof ActiveXObject)return null;try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){return new ActiveXObject("Microsoft.XMLHTTP")}},setHeaders:function(){if(this.transport)try{var t={Accept:"text/javascript,text/xml,application/xml,application/xhtml+xml,text/html,application/json;q=0.9,text/plain;q=0.8,video/x-mng,image/png,image/jpeg,image/gif;q=0.2,*/*;q=0.1","Accept-Language":navigator.language,"X-Requested-With":"XMLHttpRequest","X-Ink-Version":"1"};if(this.options.cors&&(this.options.signRequest||delete t["X-Requested-With"],delete t["X-Ink-Version"]),this.options.requestHeaders&&"object"==typeof this.options.requestHeaders)for(var e in this.options.requestHeaders)this.options.requestHeaders.hasOwnProperty(e)&&(t[e]=this.options.requestHeaders[e]);this.transport.overrideMimeType&&2005>(navigator.userAgent.match(/Gecko\/(\d{4})/)||[0,2005])[1]&&(t.Connection="close");for(var n in t)t.hasOwnProperty(n)&&this.transport.setRequestHeader(n,t[n])}catch(s){}},paramsObjToStr:function(t){var e,n,s,r,i=[];if("object"!=typeof t)return t;for(s in t)if(t.hasOwnProperty(s))if(r=t[s],"[object Array]"!==Object.prototype.toString.call(r)||isNaN(r.length))i=i.concat([encodeURIComponent(s),"=",encodeURIComponent(r),"&"]);else for(e=0,n=r.length;n>e;e++)i=i.concat([encodeURIComponent(s),"[]","=",encodeURIComponent(r[e]),"&"]);return i.length>0&&i.pop(),i.join("")},setParams:function(){var t=null,e=this.options.parameters;t="object"==typeof e?this.paramsObjToStr(e):""+e,t&&(this.url=this.url.indexOf("?")>-1?this.url.split("#")[0]+"&"+t:this.url.split("#")[0]+"?"+t)},getHeader:function(t){if(this.usingXDomainReq&&"Content-Type"===t)return this.transport.contentType;try{return this.transport.getResponseHeader(t)}catch(e){return null}},getAllHeaders:function(){try{return this.transport.getAllResponseHeaders()}catch(t){return null}},getResponse:function(){var t=this.transport,e={headerJSON:null,responseJSON:null,getHeader:this.getHeader,getAllHeaders:this.getAllHeaders,request:this,transport:t,timeTaken:new Date-this.startTime,requestedUrl:this.url};e.readyState=t.readyState;try{e.responseText=t.responseText}catch(n){}try{e.responseXML=t.responseXML}catch
|
|||
|
Ink.createModule("Ink.Net.JsonP","1",[],function(){"use strict";var t=function(t,e){this.init(t,e)};return t.prototype={init:function(t,e){if(this.options=Ink.extendObj({onSuccess:void 0,onFailure:void 0,failureObj:{},timeout:10,params:{},callbackParam:"jsoncallback",internalCallback:"_cb",randVar:!1},e||{}),this.randVar=this.options.randVar!==!1?this.options.randVar:parseInt(1e5*Math.random(),10),this.options.internalCallback+=this.randVar,this.uri=t,"function"==typeof this.options.onComplete&&(this.options.onSuccess=this.options.onComplete),"string"!=typeof this.uri)throw"Please define an URI";if("function"!=typeof this.options.onSuccess)throw"please define a callback function on option onSuccess!";Ink.Net.JsonP[this.options.internalCallback]=Ink.bind(function(){window.clearTimeout(this.timeout),delete window.Ink.Net.JsonP[this.options.internalCallback],this._removeScriptTag(),this.options.onSuccess(arguments[0])},this),this._addScriptTag()},_addParamsToGet:function(t,e){var n,s,i,o=-1!==t.indexOf("?"),r=[t];for(s in e)e.hasOwnProperty(s)&&(o?n="&":(n="?",o=!0),i=e[s],"number"==typeof i||i||(i=""),r=r.concat([n,s,"=",encodeURIComponent(i)]));return r.join("")},_getScriptContainer:function(){var t=document.getElementsByTagName("head");if(0===t.length){var e=document.getElementsByTagName("script");return e[0]}return t[0]},_addScriptTag:function(){this.options.params[this.options.callbackParam]="Ink.Net.JsonP."+this.options.internalCallback,this.options.params.rnd_seed=this.randVar,this.uri=this._addParamsToGet(this.uri,this.options.params);var t=document.createElement("script");t.type="text/javascript",t.src=this.uri;var e=this._getScriptContainer();e.appendChild(t),this.timeout=setTimeout(Ink.bind(this._requestFailed,this),1e3*this.options.timeout)},_requestFailed:function(){delete Ink.Net.JsonP[this.options.internalCallback],this._removeScriptTag(),"function"==typeof this.options.onFailure&&this.options.onFailure(this.options.failureObj)},_removeScriptTag:function(){for(var t,e,n=document.getElementsByTagName("script"),s=0,i=n.length;i>s;++s)if(t=n[s],e=t.getAttribute("src")||t.src,null!==e&&e===this.uri)return t.parentNode.removeChild(t),void 0}},t});
|
|||
|
Ink.createModule("Ink.Dom.Css",1,[],function(){"use strict";var t={addRemoveClassName:function(t,e,n){return n?this.addClassName(t,e):(this.removeClassName(t,e),void 0)},addClassName:function(t,e){t=Ink.i(t),t&&e&&(t.classList!==void 0?t.classList.add(e):this.hasClassName(t,e)||(t.className+=(t.className?" ":"")+e))},removeClassName:function(t,e){if(t=Ink.i(t),t&&e)if(t.classList!==void 0)t.classList.remove(e);else{if(t.className===void 0)return!1;var n=t.className,s=RegExp("(^|\\s+)"+e+"(\\s+|$)");n=n.replace(s," "),n=n.replace(/^\s+/,"").replace(/\s+$/,""),t.className=n}},setClassName:function(t,e,n){this.addRemoveClassName(t,e,n||!1)},hasClassName:function(t,e){if(t=Ink.i(t),t&&e){if(t.classList!==void 0)return t.classList.contains(e);if(t.className===void 0)return!1;var n=t.className;if(n.length===void 0)return!1;if(n.length>0){if(n===e)return!0;var s=RegExp("(^|\\s)"+e+"(\\s|$)");if(s.test(n))return!0}}return!1},blinkClass:function(t,e,n,s){t=Ink.i(t),this.addRemoveClassName(t,e,!s),setTimeout(Ink.bind(function(){this.addRemoveClassName(t,e,s)},this),Number(n)||100)},toggleClassName:function(t,e,n){return t&&e&&t.classList!==void 0?(t=Ink.i(t),null!==t&&t.classList.toggle(e),!0):(n!==void 0?n===!0?this.addClassName(t,e):n===!1&&this.removeClassName(t,e):this.hasClassName(t,e)?this.removeClassName(t,e):this.addClassName(t,e),void 0)},setOpacity:function(t,e){if(t=Ink.i(t),null!==t){var n=1;isNaN(Number(e))||(n=0>=e?0:1>=e?e:100>=e?e/100:1),t.style.opacity!==void 0?t.style.opacity=n:t.style.filter="alpha(opacity:"+(0|100*n)+")"}},_camelCase:function(t){return t?t.replace(/-(\w)/g,function(t,e){return e.toUpperCase()}):t},getStyle:function(t,e){if(t=Ink.i(t),null!==t){e="float"===e?"cssFloat":this._camelCase(e);var n=t.style[e];if(!window.getComputedStyle||n&&"auto"!==n)!n&&t.currentStyle&&(n=t.currentStyle[e],"auto"!==n||"width"!==e&&"height"!==e||(n=t["offset"+e.charAt(0).toUpperCase()+e.slice(1)]+"px"));else{var s=window.getComputedStyle(t,null);n=s?s[e]:null}if("opacity"===e)return n?parseFloat(n,10):1;if("borderTopWidth"===e||"borderBottomWidth"===e||"borderRightWidth"===e||"borderLeftWidth"===e){if("thin"===n)return"1px";if("medium"===n)return"3px";if("thick"===n)return"5px"}return"auto"===n?null:n}},setStyle:function(t,e){if(t=Ink.i(t),null!==t)if("string"==typeof e)t.style.cssText+="; "+e,-1!==e.indexOf("opacity")&&this.setOpacity(t,e.match(/opacity:\s*(\d?\.?\d*)/)[1]);else for(var n in e)e.hasOwnProperty(n)&&("opacity"===n?this.setOpacity(t,e[n]):"float"===n||"cssFloat"===n?t.style.styleFloat===void 0?t.style.cssFloat=e[n]:t.style.styleFloat=e[n]:t.style[n]=e[n])},show:function(t,e){t=Ink.i(t),null!==t&&(t.style.display=e?e:"")},hide:function(t){t=Ink.i(t),null!==t&&(t.style.display="none")},showHide:function(t,e){t=Ink.i(t),t&&(t.style.display=e?"":"none")},toggle:function(t,e){t=Ink.i(t),null!==t&&(e!==void 0?e===!0?this.show(t):this.hide(t):"none"===t.style.display?this.show(t):this.hide(t))},_getRefTag:function(t){if(t.firstElementChild)return t.firstElementChild;for(var e=t.firstChild;e;e=e.nextSibling)if(1===e.nodeType)return e;return null},appendStyleTag:function(t,e,n){n=Ink.extendObj({type:"text/css",force:!1},n||{});var s,i,r=document.getElementsByTagName("style"),o=!1,a=!0;for(s=0,i=r.length;i>s;s++)o=r[s].innerHTML,o.indexOf(t)>=0&&(a=!1);if(a){var l=document.createElement("style"),u=document.getElementsByTagName("head")[0],c=!1,h="";l.type=n.type,h+=t+" {",h+=e,h+="} ",l.styleSheet!==void 0?l.styleSheet.cssText=h:l.appendChild(document.createTextNode(h)),n.force?u.appendChild(l):(c=this._getRefTag(u),c&&u.insertBefore(l,c))}},appendStylesheet:function(t,e){e=Ink.extendObj({media:"screen",type:"text/css",force:!1},e||{});var n,s=document.createElement("link"),i=document.getElementsByTagName("head")[0];s.media=e.media,s.type=e.type,s.href=t,s.rel="Stylesheet",e.force?i.appendChild(s):(n=this._getRefTag(i),n&&i.insertBefore(s,n))},_loadingCSSFiles:{},_loadedCSSFiles:{},appendStylesheetCb:function(t,e){if(!t)return e(t);if(this._loadedCSSFiles[t])return e(t);var n=this._loadingCSSFiles[t];if(n)retur
|
|||
|
Ink.createModule("Ink.Dom.Element",1,[],function(){"use strict";var e={get:function(e){return e!==void 0?"string"==typeof e?document.getElementById(e):e:null},create:function(e,t){var n=document.createElement(e);for(var i in t)t.hasOwnProperty(i)&&("className"===i&&(i="class"),n.setAttribute(i,t[i]));return n},remove:function(e){var t;e&&(t=e.parentNode)&&t.removeChild(e)},scrollTo:function(e){if(e=this.get(e)){if(e.scrollIntoView)return e.scrollIntoView();var t={},n=0,i=0;do n+=e.offsetTop||0,i+=e.offsetLeft||0,e=e.offsetParent;while(e);t={x:i,y:n},window.scrollTo(t.x,t.y)}},offsetTop:function(e){return this.offset(e)[1]},offsetLeft:function(e){return this.offset(e)[0]},positionedOffset:function(e){var t=0,n=0;e=this.get(e);do if(t+=e.offsetTop||0,n+=e.offsetLeft||0,e=e.offsetParent){if("body"===e.tagName.toLowerCase())break;var i=e.style.position;if(!i&&e.currentStyle&&(i=e.currentStyle.position),(!i||"auto"===i)&&"undefined"!=typeof getComputedStyle){var r=getComputedStyle(e,null);i=r?r.position:null}if("relative"===i||"absolute"===i)break}while(e);return[n,t]},offset:function(e){e=Ink.i(e);var t,n,i,r,o=["border-left-width","border-top-width"],s=[0,0],a=this._getPropPx,l=Ink.getModule("Ink.Dom.Browser",1);do r=window.getComputedStyle?window.getComputedStyle(e,null):e.currentStyle,t=[0|e.offsetLeft,0|e.offsetTop],n=[a(r,o[0]),a(r,o[1])],l.OPERA?(s[0]+=t[0],s[1]+=t[1]):(s[0]+=t[0]+n[0],s[1]+=t[1]+n[1]),i=e.offsetParent;while(e=i);return n=[a(r,o[0]),a(r,o[1])],l.GECKO?(s[0]+=n[0],s[1]+=n[1]):l.OPERA||(s[0]-=n[0],s[1]-=n[1]),s},scroll:function(e){return e=e?Ink.i(e):document.body,[window.pageXOffset?window.pageXOffset:e.scrollLeft,window.pageYOffset?window.pageYOffset:e.scrollTop]},_getPropPx:function(e,t){var n,i,r=e.getPropertyValue?e.getPropertyValue(t):e[t];return r?(i=r.indexOf("px"),n=-1===i?0:parseInt(r,10)):n=0,n},offset2:function(e){return this.offset(e)},hasAttribute:function(e,t){return e.hasAttribute?e.hasAttribute(t):!!e.getAttribute(t)},insertAfter:function(e,t){(t=this.get(t))&&t.parentNode.insertBefore(e,t.nextSibling)},insertTop:function(e,t){(t=this.get(t))&&t.insertBefore(e,t.firstChild)},textContent:function(e){e=Ink.i(e);var t,n,i,r;switch(e&&e.nodeType){case 9:return this.textContent(e.documentElement||e.body&&e.body.parentNode||e.body);case 1:if(t=e.innerText,t!==void 0)return t;case 11:if(t=e.textContent,t!==void 0)return t;if(e.firstChild===e.lastChild)return this.textContent(e.firstChild);for(t=[],i=e.childNodes,n=0,r=i.length;r>n;++n)t.push(this.textContent(i[n]));return t.join("");case 3:case 4:return e.nodeValue}return""},setTextContent:function(e,t){switch(e=Ink.i(e),e&&e.nodeType){case 1:if("innerText"in e){e.innerText=t;break}case 11:if("textContent"in e){e.textContent=t;break}case 9:for(;e.firstChild;)e.removeChild(e.firstChild);if(""!==t){var n=e.ownerDocument||e;e.appendChild(n.createTextNode(t))}break;case 3:case 4:e.nodeValue=t}},isLink:function(e){var t=e&&1===e.nodeType&&(/^a|area$/i.test(e.tagName)||e.hasAttributeNS&&e.hasAttributeNS("http://www.w3.org/1999/xlink","href"));return!!t},isAncestorOf:function(e,t){if(!t||!e)return!1;if(t.compareDocumentPosition)return 0!==(16&e.compareDocumentPosition(t));for(;t=t.parentNode;)if(t===e)return!0;return!1},descendantOf:function(e,t){return e!==t&&this.isAncestorOf(e,t)},firstElementChild:function(e){if(!e)return null;if("firstElementChild"in e)return e.firstElementChild;for(var t=e.firstChild;t&&1!==t.nodeType;)t=t.nextSibling;return t},lastElementChild:function(e){if(!e)return null;if("lastElementChild"in e)return e.lastElementChild;for(var t=e.lastChild;t&&1!==t.nodeType;)t=t.previousSibling;return t},nextElementSibling:function(e){var t=null;if(!e)return t;if("nextElementSibling"in e)return e.nextElementSibling;for(t=e.nextSibling;t&&1!==t.nodeType;)t=t.nextSibling;return t},previousElementSibling:function(e){var t=null;if(!e)return t;if("previousElementSibling"in e)return e.previousElementSibling;for(t=e.previousSibling;t&&1!==t.nodeType;)t=t.previousSibling;return t},elementWidth:function(e){return"string"==typeof e&&(e=document.ge
|
|||
|
Ink.createModule("Ink.Dom.Event",1,[],function(){"use strict";var e={KEY_BACKSPACE:8,KEY_TAB:9,KEY_RETURN:13,KEY_ESC:27,KEY_LEFT:37,KEY_UP:38,KEY_RIGHT:39,KEY_DOWN:40,KEY_DELETE:46,KEY_HOME:36,KEY_END:35,KEY_PAGEUP:33,KEY_PAGEDOWN:34,KEY_INSERT:45,throttle:function(e,t){t=t||0;var n,o=0,r=function(){var i=+new Date,s=i-o;if(s>=t)return o=i,e.apply(this,[].slice.call(arguments));var a=this,l=[].slice.call(arguments);clearTimeout(n),n=setTimeout(function(){return r.apply(a,l)})};return r},element:function(e){var t=e.target||"mouseout"===e.type&&e.fromElement||"mouseleave"===e.type&&e.fromElement||"mouseover"===e.type&&e.toElement||"mouseenter"===e.type&&e.toElement||e.srcElement||null;return!t||3!==t.nodeType&&4!==t.nodeType?t:t.parentNode},relatedTarget:function(e){var t=e.relatedTarget||"mouseout"===e.type&&e.toElement||"mouseleave"===e.type&&e.toElement||"mouseover"===e.type&&e.fromElement||"mouseenter"===e.type&&e.fromElement||null;return!t||3!==t.nodeType&&4!==t.nodeType?t:t.parentNode},findElement:function(e,t,n){for(var o=this.element(e);;){if(o.nodeName.toLowerCase()===t.toLowerCase())return o;if(o=o.parentNode,!o)return n?!1:document;if(!o.parentNode)return n?!1:document}},fire:function(e,t,n){e=Ink.i(e);var o,r;if(r=document.createEvent?{DOMActivate:!0,DOMFocusIn:!0,DOMFocusOut:!0,focus:!0,focusin:!0,focusout:!0,blur:!0,load:!0,unload:!0,abort:!0,error:!0,select:!0,change:!0,submit:!0,reset:!0,resize:!0,scroll:!0,click:!0,dblclick:!0,mousedown:!0,mouseenter:!0,mouseleave:!0,mousemove:!0,mouseover:!0,mouseout:!0,mouseup:!0,mousewheel:!0,wheel:!0,textInput:!0,keydown:!0,keypress:!0,keyup:!0,compositionstart:!0,compositionupdate:!0,compositionend:!0,DOMSubtreeModified:!0,DOMNodeInserted:!0,DOMNodeRemoved:!0,DOMNodeInsertedIntoDocument:!0,DOMNodeRemovedFromDocument:!0,DOMAttrModified:!0,DOMCharacterDataModified:!0,DOMAttributeNameChanged:!0,DOMElementNameChanged:!0,hashchange:!0}:{onabort:!0,onactivate:!0,onafterprint:!0,onafterupdate:!0,onbeforeactivate:!0,onbeforecopy:!0,onbeforecut:!0,onbeforedeactivate:!0,onbeforeeditfocus:!0,onbeforepaste:!0,onbeforeprint:!0,onbeforeunload:!0,onbeforeupdate:!0,onblur:!0,onbounce:!0,oncellchange:!0,onchange:!0,onclick:!0,oncontextmenu:!0,oncontrolselect:!0,oncopy:!0,oncut:!0,ondataavailable:!0,ondatasetchanged:!0,ondatasetcomplete:!0,ondblclick:!0,ondeactivate:!0,ondrag:!0,ondragend:!0,ondragenter:!0,ondragleave:!0,ondragover:!0,ondragstart:!0,ondrop:!0,onerror:!0,onerrorupdate:!0,onfilterchange:!0,onfinish:!0,onfocus:!0,onfocusin:!0,onfocusout:!0,onhashchange:!0,onhelp:!0,onkeydown:!0,onkeypress:!0,onkeyup:!0,onlayoutcomplete:!0,onload:!0,onlosecapture:!0,onmessage:!0,onmousedown:!0,onmouseenter:!0,onmouseleave:!0,onmousemove:!0,onmouseout:!0,onmouseover:!0,onmouseup:!0,onmousewheel:!0,onmove:!0,onmoveend:!0,onmovestart:!0,onoffline:!0,ononline:!0,onpage:!0,onpaste:!0,onprogress:!0,onpropertychange:!0,onreadystatechange:!0,onreset:!0,onresize:!0,onresizeend:!0,onresizestart:!0,onrowenter:!0,onrowexit:!0,onrowsdelete:!0,onrowsinserted:!0,onscroll:!0,onselect:!0,onselectionchange:!0,onselectstart:!0,onstart:!0,onstop:!0,onstorage:!0,onstoragecommit:!0,onsubmit:!0,ontimeout:!0,onunload:!0},null!==e&&void 0!==e){e===document&&document.createEvent&&!e.dispatchEvent&&(e=document.documentElement),document.createEvent?(o=document.createEvent("HTMLEvents"),r[t]===void 0?o.initEvent("dataavailable",!0,!0):o.initEvent(t,!0,!0)):(o=document.createEventObject(),o.eventType=r["on"+t]===void 0?"ondataavailable":"on"+t),o.eventName=t,o.memo=n||{};try{if(document.createEvent)e.dispatchEvent(o);else{if(!e.fireEvent)return;e.fireEvent(o.eventType,o)}}catch(i){}return o}},_callbackForCustomEvents:function(e,t,n){var o="hashchange"===t&&e.attachEvent&&!window.onhashchange,r=-1!==t.indexOf(":");if(o||r){var i=n;return Ink.bindEvent(function(e,t,n){e.eventName===t&&(window.addEventListener&&(window.event=e),n())},this,t,i)}return null},observe:function(e,t,n,o){if(e=Ink.i(e),null!==e&&void 0!==e){var r=this._callbackForCustomEvents(e,t,n);return r&&(n=r,t="dataavailable"),e.addEventListener?e.addEven
|
|||
|
Ink.createModule("Ink.Dom.FormSerialize",1,[],function(){"use strict";var e={serialize:function(e){e=Ink.i(e);var t=this._getFieldNameInputsMap(e),n={};for(var o in t)if(t.hasOwnProperty(o))if(null!==o){var r=o.replace(/\[\]$/,"");n[r]=this._getValuesOfField(t[o])}else n[o]=this._getValuesOfField(t[o]);return delete n["null"],n},fillIn:function(e,t){e=Ink.i(e);var n=this._getFieldNameInputsMap(e);delete n["null"];for(var o in t)t.hasOwnProperty(o)&&this._setValuesOfField(n[o],t[o])},_getFieldNameInputsMap:function(e){for(var t,n,o,r={},i=0,s=e.elements.length;s>i;++i)o=e.elements[i],t=o.getAttribute("name"),n=o.nodeName.toLowerCase(),"fieldset"!==n&&(void 0===r[t]?r[t]=[o]:r[t].push(o));return r},_getValuesOfField:function(e){var t,n,o,r,i,s,a=e[0].nodeName.toLowerCase(),l=e[0].getAttribute("type"),u=e[0].value,c=[];switch(a){case"select":for(t=0,n=e.length;n>t;++t)for(c[t]=[],s=e[t].getAttribute("multiple"),o=0,r=e[t].options.length;r>o;++o)if(i=e[t].options[o],i.selected){if(!s){c[t]=i.value;break}c[t].push(i.value)}return e.length>0&&/\[[^\]]*\]$/.test(e[0].getAttribute("name"))?c:c[0];case"textarea":case"input":if("checkbox"===l||"radio"===l){for(t=0,n=e.length;n>t;++t)i=e[t],i.checked&&c.push(i.value);return"checkbox"===l?e.length>1?c:!!c.length:e.length>1?c[0]:!!c.length}if(e.length>0&&/\[[^\]]*\]$/.test(e[0].getAttribute("name"))){var d=[];for(t=0,n=e.length;n>t;++t)d.push(e[t].value);return d}return u;default:return void 0}},_valInArray:function(e,t){for(var n=0,o=t.length;o>n;++n)if(t[n]===e)return!0;return!1},_setValuesOfField:function(e,t){if(e){var n,o,r,i=e[0].nodeName.toLowerCase(),s=e[0].getAttribute("type");switch(i){case"select":if(e.length>1)throw"Got multiple select elements with same name!";for(n=0,o=e[0].options.length;o>n;++n)r=e[0].options[n],r.selected=t instanceof Array?this._valInArray(r.value,t):r.value===t;break;case"textarea":case"input":if("checkbox"===s||"radio"===s)for(n=0,o=e.length;o>n;++n)r=e[n],r.checked=t instanceof Array?this._valInArray(r.value,t):e.length>1?r.value===t:!!t;else{if(e.length>1)throw"Got multiple input elements with same name!";"file"!==s&&(e[0].value=t)}break;default:throw'Unsupported element: "'+i+'"!'}}}};return e});
|
|||
|
Ink.createModule("Ink.Dom.Loaded",1,[],function(){"use strict";var e={_contexts:[],run:function(e,t){t||(t=e,e=window);for(var n,o=0,r=this._contexts.length;r>o;o++)if(this._contexts[o][0]===e){n=this._contexts[o][1];break}n||(n={cbQueue:[],win:e,doc:e.document,root:e.document.documentElement,done:!1,top:!0},n.handlers={checkState:Ink.bindEvent(this._checkState,this,n),poll:Ink.bind(this._poll,this,n)},this._contexts.push([e,n]));var i=n.doc.addEventListener;n.add=i?"addEventListener":"attachEvent",n.rem=i?"removeEventListener":"detachEvent",n.pre=i?"":"on",n.det=i?"DOMContentLoaded":"onreadystatechange",n.wet=n.pre+"load";var s=n.handlers.checkState,a="complete"===n.doc.readyState&&"about:blank"!=""+n.win.location;if(a)setTimeout(Ink.bind(function(){t.call(n.win,"lazy")},this),0);else{n.cbQueue.push(t),n.doc[n.add](n.det,s),n.win[n.add](n.wet,s);var l=1;try{l=n.win.frameElement}catch(u){}if(!i&&n.root&&n.root.doScroll){try{n.top=!l}catch(u){}n.top&&this._poll(n)}}},_checkState:function(e,t){if(e&&("readystatechange"!==e.type||"complete"===t.doc.readyState)){var n="load"===e.type?t.win:t.doc;n[t.rem](t.pre+e.type,t.handlers.checkState,!1),this._ready(t)}},_poll:function(e){try{e.root.doScroll("left")}catch(t){return setTimeout(e.handlers.poll,50)}this._ready(e)},_ready:function(e){if(!e.done){e.done=!0;for(var t=0;e.cbQueue.length>t;++t)e.cbQueue[t].call(e.win);e.cbQueue=[]}}};return e});
|
|||
|
Ink.createModule("Ink.Dom.Selector",1,[],function(){"use strict";function e(e){return ht.test(e+"")}function t(){var e,t=[];return e=function(n,r){return t.push(n+=" ")>E.cacheLength&&delete e[t.shift()],e[n]=r}}function n(e){return e[P]=!0,e}function r(e){var t=A.createElement("div");try{return!!e(t)}catch(n){return!1}finally{t=null}}function o(e,t,n,r){var o,i,s,a,l,d,f,p,h,m;if((t?t.ownerDocument||t:B)!==A&&O(t),t=t||A,n=n||[],!e||"string"!=typeof e)return n;if(1!==(a=t.nodeType)&&9!==a)return[];if(R&&!r){if(o=mt.exec(e))if(s=o[1]){if(9===a){if(i=t.getElementById(s),!i||!i.parentNode)return n;if(i.id===s)return n.push(i),n}else if(t.ownerDocument&&(i=t.ownerDocument.getElementById(s))&&M(t,i)&&i.id===s)return n.push(i),n}else{if(o[2])return Q.apply(n,t.getElementsByTagName(e)),n;if((s=o[3])&&j.getElementsByClassName&&t.getElementsByClassName)return Q.apply(n,t.getElementsByClassName(s)),n}if(j.qsa&&!L.test(e)){if(f=!0,p=P,h=t,m=9===a&&e,1===a&&"object"!==t.nodeName.toLowerCase()){for(d=u(e),(f=t.getAttribute("id"))?p=f.replace(yt,"\\$&"):t.setAttribute("id",p),p="[id='"+p+"'] ",l=d.length;l--;)d[l]=p+c(d[l]);h=pt.test(e)&&t.parentNode||t,m=d.join(",")}if(m)try{return Q.apply(n,h.querySelectorAll(m)),n}catch(g){}finally{f||t.removeAttribute("id")}}}return y(e.replace(at,"$1"),t,n,r)}function i(e,t){var n=t&&e,r=n&&(~t.sourceIndex||Y)-(~e.sourceIndex||Y);if(r)return r;if(n)for(;n=n.nextSibling;)if(n===t)return-1;return e?1:-1}function s(e){return function(t){var n=t.nodeName.toLowerCase();return"input"===n&&t.type===e}}function a(e){return function(t){var n=t.nodeName.toLowerCase();return("input"===n||"button"===n)&&t.type===e}}function l(e){return n(function(t){return t=+t,n(function(n,r){for(var o,i=e([],n.length,t),s=i.length;s--;)n[o=i[s]]&&(n[o]=!(r[o]=n[o]))})})}function u(e,t){var n,r,i,s,a,l,u,c=W[e+" "];if(c)return t?0:c.slice(0);for(a=e,l=[],u=E.preFilter;a;){(!n||(r=lt.exec(a)))&&(r&&(a=a.slice(r[0].length)||a),l.push(i=[])),n=!1,(r=ut.exec(a))&&(n=r.shift(),i.push({value:n,type:r[0].replace(at," ")}),a=a.slice(n.length));for(s in E.filter)!(r=ft[s].exec(a))||u[s]&&!(r=u[s](r))||(n=r.shift(),i.push({value:n,type:s,matches:r}),a=a.slice(n.length));if(!n)break}return t?a.length:a?o.error(e):W(e,l).slice(0)}function c(e){for(var t=0,n=e.length,r="";n>t;t++)r+=e[t].value;return r}function d(e,t,n){var r=t.dir,o=n&&"parentNode"===r,i=F++;return t.first?function(t,n,i){for(;t=t[r];)if(1===t.nodeType||o)return e(t,n,i)}:function(t,n,s){var a,l,u,c=q+" "+i;if(s){for(;t=t[r];)if((1===t.nodeType||o)&&e(t,n,s))return!0}else for(;t=t[r];)if(1===t.nodeType||o)if(u=t[P]||(t[P]={}),(l=u[r])&&l[0]===c){if((a=l[1])===!0||a===C)return a===!0}else if(l=u[r]=[c],l[1]=e(t,n,s)||C,l[1]===!0)return!0}}function f(e){return e.length>1?function(t,n,r){for(var o=e.length;o--;)if(!e[o](t,n,r))return!1;return!0}:e[0]}function p(e,t,n,r,o){for(var i,s=[],a=0,l=e.length,u=null!=t;l>a;a++)(i=e[a])&&(!n||n(i,r,o))&&(s.push(i),u&&t.push(a));return s}function h(e,t,r,o,i,s){return o&&!o[P]&&(o=h(o)),i&&!i[P]&&(i=h(i,s)),n(function(n,s,a,l){var u,c,d,f=[],h=[],m=s.length,g=n||v(t||"*",a.nodeType?[a]:a,[]),y=!e||!n&&t?g:p(g,f,e,a,l),b=r?i||(n?e:m||o)?[]:s:y;if(r&&r(y,b,a,l),o)for(u=p(b,h),o(u,[],a,l),c=u.length;c--;)(d=u[c])&&(b[h[c]]=!(y[h[c]]=d));if(n){if(i||e){if(i){for(u=[],c=b.length;c--;)(d=b[c])&&u.push(y[c]=d);i(null,b=[],u,l)}for(c=b.length;c--;)(d=b[c])&&(u=i?et.call(n,d):f[c])>-1&&(n[u]=!(s[u]=d))}}else b=p(b===s?b.splice(m,b.length):b),i?i(null,s,b,l):Q.apply(s,b)})}function m(e){for(var t,n,r,o=e.length,i=E.relative[e[0].type],s=i||E.relative[" "],a=i?1:0,l=d(function(e){return e===t},s,!0),u=d(function(e){return et.call(t,e)>-1},s,!0),p=[function(e,n,r){return!i&&(r||n!==N)||((t=n).nodeType?l(e,n,r):u(e,n,r))}];o>a;a++)if(n=E.relative[e[a].type])p=[d(f(p),n)];else{if(n=E.filter[e[a].type].apply(null,e[a].matches),n[P]){for(r=++a;o>r&&!E.relative[e[r].type];r++);return h(a>1&&f(p),a>1&&c(e.slice(0,a-1)).replace(at,"$1"),n,r>a&&m(e.slice(a,r)),o>r&&m(e=e.slice(r)),o>r&&c(e))}p.push(n)}return f(p)}function g(e,t){var r=0,i=t.length>0
|
|||
|
Ink.createModule("Ink.Dom.Browser","1",[],function(){"use strict";var e={IE:!1,GECKO:!1,OPERA:!1,SAFARI:!1,KONQUEROR:!1,CHROME:!1,model:!1,version:!1,userAgent:!1,init:function(){this.detectBrowser(),this.setDimensions(),this.setReferrer()},setDimensions:function(){var e=0,t=0;"number"==typeof window.innerWidth?(e=window.innerWidth,t=window.innerHeight):document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?(e=document.documentElement.clientWidth,t=document.documentElement.clientHeight):document.body&&(document.body.clientWidth||document.body.clientHeight)&&(e=document.body.clientWidth,t=document.body.clientHeight),this.windowWidth=e,this.windowHeight=t},setReferrer:function(){this.referrer=void 0!==document.referrer?document.referrer.length>0?window.escape(document.referrer):!1:!1},detectBrowser:function(){var e=navigator.userAgent;if(this.userAgent=e,e=e.toLowerCase(),RegExp("applewebkit/").test(e))RegExp("chrome/").test(e)?(this.CHROME=!0,this.model="chrome",this.version=e.replace(RegExp("(.*)chrome/([^\\s]+)(.*)"),"$2"),this.cssPrefix="-webkit-",this.domPrefix="Webkit"):(this.SAFARI=!0,this.model="safari",this.version=e.replace(RegExp("(.*)applewebkit/([^\\s]+)(.*)"),"$2"),this.cssPrefix="-webkit-",this.domPrefix="Webkit");else if(RegExp("opera").test(e))this.OPERA=!0,this.model="opera",this.version=e.replace(RegExp("(.*)opera.([^\\s$]+)(.*)"),"$2"),this.cssPrefix="-o-",this.domPrefix="O";else if(RegExp("konqueror").test(e))this.KONQUEROR=!0,this.model="konqueror",this.version=e.replace(RegExp("(.*)konqueror/([^;]+);(.*)"),"$2"),this.cssPrefix="-khtml-",this.domPrefix="Khtml";else if(RegExp("msie\\ ").test(e))this.IE=!0,this.model="ie",this.version=e.replace(RegExp("(.*)\\smsie\\s([^;]+);(.*)"),"$2"),this.cssPrefix="-ms-",this.domPrefix="ms";else if(RegExp("gecko").test(e)){this.GECKO=!0;var t=RegExp("(camino|chimera|epiphany|minefield|firefox|firebird|phoenix|galeon|iceweasel|k\\-meleon|seamonkey|netscape|songbird|sylera)");if(t.test(e))this.model=e.match(t)[1],this.version=e.replace(RegExp("(.*)"+this.model+"/([^;\\s$]+)(.*)"),"$2"),this.cssPrefix="-moz-",this.domPrefix="Moz";else{this.model="mozilla";var n=RegExp("(.*)rv:([^)]+)(.*)");n.test(e)&&(this.version=e.replace(n,"$2")),this.cssPrefix="-moz-",this.domPrefix="Moz"}}},debug:function(){var e="known browsers: (ie, gecko, opera, safari, konqueror) \n";e+=[this.IE,this.GECKO,this.OPERA,this.SAFARI,this.KONQUEROR]+"\n",e+="model -> "+this.model+"\n",e+="version -> "+this.version+"\n",e+="\n",e+="original UA -> "+this.userAgent,alert(e)}};return e.init(),e});
|
|||
|
Ink.createModule("Ink.Util.Url","1",[],function(){"use strict";var e={_keyStr:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",getUrl:function(){return window.location.href},genQueryString:function(e,t){var n,r,o,i=-1!==e.indexOf("?"),s=[e];for(r in t)t.hasOwnProperty(r)&&(i?n="&":(n="?",i=!0),o=t[r],"number"==typeof o||o||(o=""),s=s.concat([n,encodeURIComponent(r),"=",encodeURIComponent(o)]));return s.join("")},getQueryString:function(e){var t;t=e&&e!==void 0?e:this.getUrl();var n={};if(t.match(/\?(.+)/i)){var r=t.replace(/^(.*)\?([^\#]+)(\#(.*))?/g,"$2");if(r.length>0)for(var o=r.split(/[;&]/),i=0;o.length>i;i++){var s=o[i].split("=");n[decodeURIComponent(s[0])]=s[1]!==void 0&&s[1]?decodeURIComponent(s[1]):!1}}return n},getAnchor:function(e){var t;t=e&&e!==void 0?e:this.getUrl();var n=!1;return t.match(/#(.+)/)&&(n=t.replace(/([^#]+)#(.*)/,"$2")),n},getAnchorString:function(e){var t;t=e&&e!==void 0?e:this.getUrl();var n={};if(t.match(/#(.+)/i)){var r=t.replace(/^([^#]+)#(.*)?/g,"$2");if(r.length>0)for(var o=r.split(/[;&]/),i=0;o.length>i;i++){var s=o[i].split("=");n[decodeURIComponent(s[0])]=s[1]!==void 0&&s[1]?decodeURIComponent(s[1]):!1}}return n},parseUrl:function(e){var t={};if(e&&e!==void 0&&"string"==typeof e){if(e.match(/^([^:]+):\/\//i)){var n=/^([^:]+):\/\/([^\/]*)\/?([^\?#]*)\??([^#]*)#?(.*)/i;e.match(n)&&(t.scheme=e.replace(n,"$1"),t.host=e.replace(n,"$2"),t.path="/"+e.replace(n,"$3"),t.query=e.replace(n,"$4")||!1,t.fragment=e.replace(n,"$5")||!1)}else{var r=RegExp("^([^\\?]+)\\?([^#]+)#(.*)","i"),o=RegExp("^([^\\?]+)\\?([^#]+)#?","i"),i=RegExp("^([^\\?]+)\\??","i");e.match(r)?(t.scheme=!1,t.host=!1,t.path=e.replace(r,"$1"),t.query=e.replace(r,"$2"),t.fragment=e.replace(r,"$3")):e.match(o)?(t.scheme=!1,t.host=!1,t.path=e.replace(o,"$1"),t.query=e.replace(o,"$2"),t.fragment=!1):e.match(i)&&(t.scheme=!1,t.host=!1,t.path=e.replace(i,"$1"),t.query=!1,t.fragment=!1)}if(t.host){var s=RegExp("^(.*)\\:(\\d+)$","i");if(t.host.match(s)){var a=t.host;t.host=a.replace(s,"$1"),t.port=a.replace(s,"$2")}else t.port=!1;if(t.host.match(/@/i)){var l=t.host;t.host=l.split("@")[1];var u=l.split("@")[0];u.match(/\:/)?(t.user=u.split(":")[0],t.pass=u.split(":")[1]):(t.user=u,t.pass=!1)}}}return t},currentScriptElement:function(e){var t=document.getElementsByTagName("script");if(e===void 0)return t.length>0?t[t.length-1]:!1;for(var n=!1,r=RegExp(""+e,"i"),o=0,i=t.length;i>o;o++)if(n=t[o],r.test(n.src))return n;return!1},_debug:function(){}};return e});
|
|||
|
Ink.createModule("Ink.Util.Swipe","1",["Ink.Dom.Event_1"],function(e){"use strict";var t=function(e,t){this._options=Ink.extendObj({callback:void 0,forceAxis:void 0,maxDist:void 0,maxDuration:void 0,minDist:void 0,minDuration:void 0,stopEvents:!0,storeGesture:!1},t||{}),this._handlers={down:Ink.bindEvent(this._onDown,this),move:Ink.bindEvent(this._onMove,this),up:Ink.bindEvent(this._onUp,this)},this._element=Ink.i(e),this._init()};return t._supported="ontouchstart"in document.documentElement,t.prototype={_init:function(){var t=document.body;e.observe(t,"touchstart",this._handlers.down),this._options.storeGesture&&e.observe(t,"touchmove",this._handlers.move),e.observe(t,"touchend",this._handlers.up),this._isOn=!1},_isMeOrParent:function(e,t){if(e){do{if(e===t)return!0;e=e.parentNode}while(e);return!1}},_onDown:function(t){1===event.changedTouches.length&&this._isMeOrParent(t.target,this._element)&&(this._options.stopEvents===!0&&e.stop(t),t=t.changedTouches[0],this._isOn=!0,this._target=t.target,this._t0=(new Date).valueOf(),this._p0=[t.pageX,t.pageY],this._options.storeGesture&&(this._gesture=[this._p0],this._time=[0]))},_onMove:function(t){if(this._isOn&&1===event.changedTouches.length){this._options.stopEvents===!0&&e.stop(t),t=t.changedTouches[0];var n=(new Date).valueOf(),r=.001*(n-this._t0);this._gesture.push([t.pageX,t.pageY]),this._time.push(r)}},_onUp:function(t){if(this._isOn&&1===event.changedTouches.length){this._options.stopEvents&&e.stop(t),t=t.changedTouches[0],this._isOn=!1;var n=(new Date).valueOf(),r=[t.pageX,t.pageY],o=.001*(n-this._t0),i=[r[0]-this._p0[0],r[1]-this._p0[1]],s=Math.sqrt(i[0]*i[0]+i[1]*i[1]),a=Math.abs(i[0])>Math.abs(i[1])?"x":"y",l=this._options;if(!(l.minDist&&l.minDist>s||l.maxDist&&s>l.maxDist||l.minDuration&&l.minDuration>o||l.maxDuration&&o>l.maxDuration||l.forceAxis&&a!==l.forceAxis)){var u={upEvent:t,elementId:this._element.id,duration:o,dr:i,dist:s,axis:a,target:this._target};this._options.storeGesture&&(u.gesture=this._gesture,u.time=this._time),this._options.callback(this,u)}}}},t});
|
|||
|
Ink.createModule("Ink.Util.String","1",[],function(){"use strict";var InkUtilString={_chars:["&","à","á","â","ã","ä","å","æ","ç","è","é","ê","ë","ì","í","î","ï","ð","ñ","ò","ó","ô","õ","ö","ø","ù","ú","û","ü","ý","þ","ÿ","À","Á","Â","Ã","Ä","Å","Æ","Ç","È","É","Ê","Ë","Ì","Í","Î","Ï","Ð","Ñ","Ò","Ó","Ô","Õ","Ö","Ø","Ù","Ú","Û","Ü","Ý","Þ","€",'"',"ß","<",">","¢","£","¤","¥","¦","§","¨","©","ª","«","¬","","®","¯","°","±","²","³","´","µ","¶","·","¸","¹","º","»","¼","½","¾"],_entities:["amp","agrave","aacute","acirc","atilde","auml","aring","aelig","ccedil","egrave","eacute","ecirc","euml","igrave","iacute","icirc","iuml","eth","ntilde","ograve","oacute","ocirc","otilde","ouml","oslash","ugrave","uacute","ucirc","uuml","yacute","thorn","yuml","Agrave","Aacute","Acirc","Atilde","Auml","Aring","AElig","Ccedil","Egrave","Eacute","Ecirc","Euml","Igrave","Iacute","Icirc","Iuml","ETH","Ntilde","Ograve","Oacute","Ocirc","Otilde","Ouml","Oslash","Ugrave","Uacute","Ucirc","Uuml","Yacute","THORN","euro","quot","szlig","lt","gt","cent","pound","curren","yen","brvbar","sect","uml","copy","ordf","laquo","not","shy","reg","macr","deg","plusmn","sup2","sup3","acute","micro","para","middot","cedil","sup1","ordm","raquo","frac14","frac12","frac34"],_accentedChars:["à","á","â","ã","ä","å","è","é","ê","ë","ì","í","î","ï","ò","ó","ô","õ","ö","ù","ú","û","ü","ç","ñ","À","Á","Â","Ã","Ä","Å","È","É","Ê","Ë","Ì","Í","Î","Ï","Ò","Ó","Ô","Õ","Ö","Ù","Ú","Û","Ü","Ç","Ñ"],_accentedRemovedChars:["a","a","a","a","a","a","e","e","e","e","i","i","i","i","o","o","o","o","o","u","u","u","u","c","n","A","A","A","A","A","A","E","E","E","E","I","I","I","I","O","O","O","O","O","U","U","U","U","C","N"],_htmlUnsafeChars:{"<":"<",">":">","&":"&",'"':""","'":"'"},ucFirst:function(e,t){var n=t?/(^|\s)(\w)(\S{2,})/:/(^|\s)(\w)(\S{2,})/g;return e?(e+"").replace(n,function(e,t,n,r){return t+n.toUpperCase()+r.toLowerCase()}):e},trim:function(e){return"string"==typeof e?e.replace(/^\s+|\s+$|\n+$/g,""):e},stripTags:function(e,t){if(t&&"string"==typeof t){for(var n=InkUtilString.trim(t).split(","),r=[],o=!1,i=0;n.length>i;i++)""!==InkUtilString.trim(n[i])&&(o=InkUtilString.trim(n[i].replace(/(\<|\>)/g,"").replace(/\s/,"")),r.push("(<"+o+"\\s[^>]+>|<(\\s|\\/)?(\\s|\\/)?"+o+">)"));for(var s=r.join("|"),a=RegExp(s,"i"),l=e.match(RegExp("<[^>]*>","g")),u=0;l.length>u;u++)l[u].match(a)||(e=e.replace(RegExp(l[u],"gm"),""));return e}return e.replace(/\<[^\>]+\>/g,"")},htmlEntitiesEncode:function(e){if(e&&e.replace)for(var t=!1,n=0;InkUtilString._chars.length>n;n++)t=RegExp(InkUtilString._chars[n],"gm"),e=e.replace(t,"&"+InkUtilString._entities[n]+";");return e},htmlEntitiesDecode:function(e){if(e&&e.replace){for(var t=!1,n=0;InkUtilString._entities.length>n;n++)t=RegExp("&"+InkUtilString._entities[n]+";","gm"),e=e.replace(t,InkUtilString._chars[n]);e=e.replace(/&#[^;]+;?/g,function(e){return"x"===e.charAt(2)?String.fromCharCode(parseInt(e.substring(3),16)):String.fromCharCode(parseInt(e.substring(2),10))})}return e},utf8Encode:function(e){e=e.replace(/\r\n/g,"\n");for(var t="",n=0;e.length>n;n++){var r=e.charCodeAt(n);128>r?t+=String.fromCharCode(r):r>127&&2048>r?(t+=String.fromCharCode(192|r>>6),t+=String.fromCharCode(128|63&r)):(t+=String.fromCharCode(224|r>>12),t+=String.fromCharCode(128|63&r>>6),t+=String.fromCharCode(128|63&r))}return t},shortString:function(e,t){for(var n=e.split(" "),r="",o=0;n.length>o;o++){if((r+n[o]+" ").length>=t){r+="…";break}r+=n[o]+" "}return r},truncateString:function(e,t){return e.length-1>t?e.substr(0,t-1)+"…":e},utf8Decode:function(e){for(var t="",n=0,r=0,o=0,i=0;e.length>n;)r=e.charCodeAt(n),128>r?(t+=String.fromCharCode(r),n++):r>191&&224>r?(o=e.charCodeAt(n+1),t+=String.fromCharCode((31&r)<<6|63&o),n+=2):(o=e.charCodeAt(n+1),i=e.charCodeAt(n+2),t+=String.fromCharCode((15&r)<<12|(63&o)<<6|63&i),n+=3);return t},removeAccentedChars:function(e){for(var t=e,n=!1,r=0;InkUtilStr
|
|||
|
Ink.createModule("Ink.Util.Json","1",[],function(){"use strict";function twoDigits(e){var t=""+e;return 1===t.length?"0"+t:t}var function_call=Function.prototype.call,cx=/[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,date_toISOString=Date.prototype.toISOString?Ink.bind(function_call,Date.prototype.toISOString):function(e){return e.getUTCFullYear()+"-"+twoDigits(e.getUTCMonth()+1)+"-"+twoDigits(e.getUTCDate())+"T"+twoDigits(e.getUTCHours())+":"+twoDigits(e.getUTCMinutes())+":"+twoDigits(e.getUTCSeconds())+"."+((e.getUTCMilliseconds()/1e3).toFixed(3)+"").slice(2,5)+"Z"},InkJson={_nativeJSON:window.JSON||null,_convertToUnicode:!1,_escape:function(e){var t={"\b":"\\b"," ":"\\t","\n":"\\n","\f":"\\f","\r":"\\r",'"':'\\"',"\\":"\\\\"};return/["\\\x00-\x1f]/.test(e)&&(e=e.replace(/([\x00-\x1f\\"])/g,function(e,n){var r=t[n];return r?r:(r=n.charCodeAt(),"\\u00"+Math.floor(r/16).toString(16)+(r%16).toString(16))})),e},_toUnicode:function(e){if(this._convertToUnicode){for(var t="",n=!1,r=!1,o=0,i=e.length;i>o;){if(n=e.charCodeAt(o),n>=32&&126>=n||8===n||9===n||10===n||12===n||13===n||32===n||34===n||47===n||58===n||92===n)r=34===n||92===n||47===n?"\\"+e.charAt(o):8===n?"\\b":9===n?"\\t":10===n?"\\n":12===n?"\\f":13===n?"\\r":e.charAt(o);else if(this._convertToUnicode){for(r=e.charCodeAt(o).toString(16)+"".toUpperCase();4>r.length;)r="0"+r;r="\\u"+r}else r=e.charAt(o);t+=r,o++}return t}return this._escape(e)},_stringifyValue:function(e){if("string"==typeof e)return'"'+this._toUnicode(e)+'"';if("number"!=typeof e||!isNaN(e)&&isFinite(e)){if(e===void 0||null===e)return"null";if("function"==typeof e.toJSON){var t=e.toJSON();return"string"==typeof t?'"'+this._escape(t)+'"':this._escape(""+t)}if("number"==typeof e||"boolean"==typeof e)return""+e;if("function"==typeof e)return"null";if(e.constructor===Date)throw"";if(e.constructor===Array){for(var n="",r=0,o=e.length;o>r;r++)r>0&&(n+=","),n+=this._stringifyValue(e[r]);return"["+n+"]"}var i="";for(var s in e)({}).hasOwnProperty.call(e,s)&&(""!==i&&(i+=","),i+='"'+this._escape(s)+'": '+this._stringifyValue(e[s]));return"{"+i+"}"}return"null"},stringify:function(e,t){return this._convertToUnicode=!!t,!this._convertToUnicode&&this._nativeJSON?this._nativeJSON.stringify(e):this._stringifyValue(e)},parse:function(text,reviver){function walk(e,t){var n,r,o=e[t];if(o&&"object"==typeof o)for(n in o)Object.prototype.hasOwnProperty.call(o,n)&&(r=walk(o,n),void 0!==r?o[n]=r:delete o[n]);return reviver.call(e,t,o)}var j;if(text+="",cx.lastIndex=0,cx.test(text)&&(text=text.replace(cx,function(e){return"\\u"+("0000"+e.charCodeAt(0).toString(16)).slice(-4)})),/^[\],:{}\s]*$/.test(text.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g,"@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g,"]").replace(/(?:^|:|,)(?:\s*\[)+/g,"")))return j=eval("("+text+")"),"function"==typeof reviver?walk({"":j},""):j;throw new SyntaxError("JSON.parse")}};return InkJson});
|
|||
|
Ink.createModule("Ink.Util.I18n","1",[],function(){"use strict";var e=/\{(?:(\{.*?})|(?:%s:)?(\d+)|(?:%s)?|([\w-]+))}/g,t=function(e,t){return"function"==typeof e?e.apply(this,t):void 0!==typeof e?e:""},n=function(e,t,r){return this instanceof n?(this.reset().lang(t).testMode(r).append(e||{},t),void 0):new n(e,t,r)};return n.prototype={reset:function(){return this._dicts=[],this._dict={},this._testMode=!1,this._lang=this._gLang,this},append:function(e){return this._dicts.push(e),this._dict=Ink.extendObj(this._dict,e[this._lang]),this},lang:function(e){if(!arguments.length)return this._lang;if(e&&this._lang!==e){this._lang=e,this._dict={};for(var t=0,n=this._dicts.length;n>t;t++)this._dict=Ink.extendObj(this._dict,this._dicts[t][e]||{})}return this},testMode:function(e){return arguments.length?(void 0!==e&&(this._testMode=!!e),this):!!this._testMode},getKey:function(e){var t,r=this._gLang,o=this._lang;return e in this._dict?t=this._dict[e]:(n.lang(o),t=this._gDict[e],n.lang(r)),t},text:function(n){if("string"==typeof n){var r=Array.prototype.slice.call(arguments,1),o=0,i="object"==typeof r[0],s=this.getKey(n);return void 0===s&&(s=this._testMode?"["+n+"]":n),"number"==typeof s&&(s+=""),"string"==typeof s?s=s.replace(e,function(e,n,s,a){var u=n?n:s?r[s-(i?0:1)]:a?r[0][a]||"":r[o++ +(i?1:0)];return t(u,[o].concat(r))}):"function"==typeof s?s.apply(this,r):s instanceof Array?t(s[r[0]],r):"object"==typeof s?t(s[r[0]],r):""}},ntext:function(e,t,n){var r,o=Array.prototype.slice.apply(arguments);if(2===o.length&&"number"==typeof t){if(r=this.getKey(e),!(r instanceof Array))return"";o.splice(0,1),r=r[1===t?0:1]}else o.splice(0,2),r=1===n?e:t;return this.text.apply(this,[r].concat(o))},ordinal:function(e){if(void 0===e)return"";var n=+(""+e).slice(-1),r=this.getKey("_ordinals");if(void 0===r)return"";if("string"==typeof r)return r;var o;return"function"==typeof r&&(o=r(e,n),"string"==typeof o)?o:"exceptions"in r&&(o="function"==typeof r.exceptions?r.exceptions(e,n):e in r.exceptions?t(r.exceptions[e],[e,n]):void 0,"string"==typeof o)?o:"byLastDigit"in r&&(o="function"==typeof r.byLastDigit?r.byLastDigit(n,e):n in r.byLastDigit?t(r.byLastDigit[n],[n,e]):void 0,"string"==typeof o)?o:"default"in r&&(o=t(r["default"],[e,n]),"string"==typeof o)?o:""},alias:function(){var e=Ink.bind(n.prototype.text,this);return e.ntext=Ink.bind(n.prototype.ntext,this),e.append=Ink.bind(n.prototype.append,this),e.ordinal=Ink.bind(n.prototype.ordinal,this),e.testMode=Ink.bind(n.prototype.testMode,this),e}},n.reset=function(){n.prototype._gDicts=[],n.prototype._gDict={},n.prototype._gLang="pt_PT"},n.reset(),n.append=function(e,t){if(t){if(!(t in e)){var r={};r[t]=e,e=r}t!==n.prototype._gLang&&n.lang(t)}n.prototype._gDicts.push(e),Ink.extendObj(n.prototype._gDict,e[n.prototype._gLang])},n.lang=function(e){if(!arguments.length)return n.prototype._gLang;if(e&&n.prototype._gLang!==e){n.prototype._gLang=e,n.prototype._gDict={};for(var t=0,r=n.prototype._gDicts.length;r>t;t++)Ink.extendObj(n.prototype._gDict,n.prototype._gDicts[t][e]||{})}},n});
|
|||
|
Ink.createModule("Ink.Util.Dumper","1",[],function(){"use strict";var e={_tab:" ",_formatParam:function(e){var t="";switch(typeof e){case"string":t="(string) "+e;break;case"number":t="(number) "+e;break;case"boolean":t="(boolean) "+e;break;case"object":t=null!==e?e.constructor===Array?"Array \n{\n"+this._outputFormat(e,0)+"\n}":"Object \n{\n"+this._outputFormat(e,0)+"\n}":"null";break;default:t=!1}return t},_getTabs:function(e){for(var t="",n=0;e>n;n++)t+=this._tab;return t},_outputFormat:function(e,t){var n="",r=!1;for(var o in e)if(null!==e[o])if("object"!=typeof e[o]||e[o].constructor!==Array&&e[o].constructor!==Object){if(e[o].constructor===Function)continue;n=n+this._tab+this._getTabs(t)+"["+o+"] => "+e[o]+"\n"}else e[o].constructor===Array?r="Array":e[o].constructor===Object&&(r="Object"),n+=this._tab+this._getTabs(t)+"["+o+"] => <b>"+r+"</b>\n",n+=this._tab+this._getTabs(t)+"{\n",n+=this._outputFormat(e[o],t+1)+this._tab+this._getTabs(t)+"}\n";else n=n+this._tab+this._getTabs(t)+"["+o+"] => null \n";return n},printDump:function(e,t){if(t&&t!==void 0)if("string"==typeof t)document.getElementById(t).innerHTML="<pre>"+this._formatParam(e)+"</pre>";else{if("object"!=typeof t)throw"TARGET must be an element or an element ID";t.innerHTML="<pre>"+this._formatParam(e)+"</pre>"}else document.write("<pre>"+this._formatParam(e)+"</pre>")},returnDump:function(e){return this._formatParam(e)},alertDump:function(e){window.alert(this._formatParam(e).replace(/(<b>)(Array|Object)(<\/b>)/g,"$2"))},windowDump:function(e){var t="dumperwindow_"+1e4*Math.random(),n=window.open("",t,"width=400,height=300,left=50,top=50,status,menubar,scrollbars,resizable");n.document.open(),n.document.write("<pre>"+this._formatParam(e)+"</pre>"),n.document.close(),n.focus()}};return e});
|
|||
|
Ink.createModule("Ink.Util.Date","1",[],function(){"use strict";var e={_months:function(e){var t=["Janeiro","Fevereiro","Março","Abril","Maio","Junho","Julho","Agosto","Setembro","Outubro","Novembro","Dezembro"];return t[e]},_iMonth:function(e){return Number(e)?+e-1:{janeiro:0,jan:0,fevereiro:1,fev:1,"março":2,mar:2,abril:3,abr:3,maio:4,mai:4,junho:5,jun:5,julho:6,jul:6,agosto:7,ago:7,setembro:8,set:8,outubro:9,out:9,novembro:10,nov:10,dezembro:11,dez:11}[e.toLowerCase()]},_wDays:function(e){var t=["Domingo","Segunda","Terça","Quarta","Quinta","Sexta","Sábado"];return t[e]},_iWeek:function(e){return Number(e)?+e||7:{segunda:1,seg:1,"terça":2,ter:2,quarta:3,qua:3,quinta:4,qui:4,sexta:5,sex:5,"sábado":6,"sáb":6,domingo:7,dom:7}[e.toLowerCase()]},_daysInMonth:function(e,t){var n;return n=1===e||3===e||5===e||7===e||8===e||10===e||12===e?31:4===e||6===e||9===e||11===e?30:0===t%400||0===t%4&&0!==t%100?29:28},get:function(e,t){(e===void 0||""===e)&&(e="Y-m-d");var n,r=e.split(""),o=Array(r.length),i="\\";n=t===void 0?new Date:"number"==typeof t?new Date(1e3*t):new Date(t);for(var a,s,u,l=0;r.length>l;l++)switch(r[l]){case i:o[l]=r[l+1],l++;break;case"d":var c=n.getDate();o[l]=(c+"").length>1?c:"0"+c;break;case"D":o[l]=this._wDays(n.getDay()).substring(0,3);break;case"j":o[l]=n.getDate();break;case"l":o[l]=this._wDays(n.getDay());break;case"N":o[l]=n.getDay()||7;break;case"S":var d=n.getDate(),f=["st","nd","rd"],h="";o[l]=d>=11&&13>=d?"th":(h=f[(d+"").substr(-1)-1])?h:"th";break;case"w":o[l]=n.getDay();break;case"z":a=Date.UTC(n.getFullYear(),0,0),s=Date.UTC(n.getFullYear(),n.getMonth(),n.getDate()),o[l]=Math.floor((s-a)/864e5);break;case"W":var p=new Date(n.getFullYear(),0,1);a=p.getDay()||7;var m=Math.floor((n-p)/864e5+1);o[l]=Math.ceil((m-(8-a))/7)+1;break;case"F":o[l]=this._months(n.getMonth());break;case"m":var g=n.getMonth()+1+"";o[l]=g.length>1?g:"0"+g;break;case"M":o[l]=this._months(n.getMonth()).substring(0,3);break;case"n":o[l]=n.getMonth()+1;break;case"t":o[l]=this._daysInMonth(n.getMonth()+1,n.getYear());break;case"L":var v=n.getFullYear();o[l]=v%4?!1:v%100?!0:v%400?!1:!0;break;case"o":throw'"o" not implemented!';case"Y":o[l]=n.getFullYear();break;case"y":o[l]=(n.getFullYear()+"").substring(2);break;case"a":o[l]=12>n.getHours()?"am":"pm";break;case"A":o[l]=12>n.getHours?"AM":"PM";break;case"B":throw'"B" not implemented!';case"g":u=n.getHours(),o[l]=12>=u?u:u-12;break;case"G":o[l]=n.getHours()+"";break;case"h":u=n.getHours()+"",u=12>=u?u:u-12,o[l]=u.length>1?u:"0"+u;break;case"H":u=n.getHours()+"",o[l]=u.length>1?u:"0"+u;break;case"i":var y=n.getMinutes()+"";o[l]=y.length>1?y:"0"+y;break;case"s":var b=n.getSeconds()+"";o[l]=b.length>1?b:"0"+b;break;case"u":throw'"u" not implemented!';case"e":throw'"e" not implemented!';case"I":a=new Date(n.getFullYear(),0,1),o[l]=n.getTimezoneOffset()!==a.getTimezoneOffset()?1:0;break;case"O":var w=n.getTimezoneOffset(),k=w%60;u=-1*((w-k)/60)+"","-"!==u.charAt(0)&&(u="+"+u),u=3===u.length?u:u.replace(/([+\-])(\d)/,"$10$2"),o[l]=u+k+"0";break;case"P":throw'"P" not implemented!';case"T":throw'"T" not implemented!';case"Z":o[l]=60*n.getTimezoneOffset();break;case"c":throw'"c" not implemented!';case"r":var E=this._wDays(n.getDay()).substr(0,3),C=this._months(n.getMonth()).substr(0,3);o[l]=E+", "+n.getDate()+" "+C+this.get(" Y H:i:s O",n);break;case"U":o[l]=Math.floor(n.getTime()/1e3);break;default:o[l]=r[l]}return o.join("")},set:function(e,t){if(void 0!==t){(e===void 0||""===e)&&(e="Y-m-d");for(var n,r=e.split(""),o=Array(r.length),i="\\",a={year:void 0,month:void 0,day:void 0,dayY:void 0,dayW:void 0,week:void 0,hour:void 0,hourD:void 0,min:void 0,sec:void 0,msec:void 0,ampm:void 0,diffM:void 0,diffH:void 0,date:void 0},s=0,u=0;r.length>u;u++)switch(r[u]){case i:o[u]=r[u+1],u++;break;case"d":o[u]="(\\d{2})",a.day={original:u,match:s++};break;case"j":o[u]="(\\d{1,2})",a.day={original:u,match:s++};break;case"D":o[u]="([\\wá]{3})",a.dayW={original:u,match:s++};break;case"l":o[u]="([\\wá]{5,7})",a.dayW={original:u,match:s++};break;case"N":o[u]="(\\d)",a.dayW={original:u,match:s++}
|
|||
|
Ink.createModule("Ink.Util.Cookie","1",[],function(){"use strict";var e={get:function(e){var t=document.cookie||!1,n={};if(t){t=t.replace(RegExp("; ","g"),";");var r=t.split(";"),o=[];if(r.length>0)for(var i=0;r.length>i;i++)o=r[i].split("="),2===o.length&&(n[o[0]]=decodeURIComponent(o[1])),o=[]}return e?n[e]!==void 0?n[e]:null:n},set:function(e,t,n,r,o,i){var a;if(!e||t===!1||void 0===e||void 0===t)return!1;a=e+"="+encodeURIComponent(t);var s=!1,u=!1,l=!1,c=!1;if(n&&n!==void 0&&!isNaN(n)){var d=new Date,f=parseInt(Number(d.valueOf()),10)+1e3*Number(parseInt(n,10)),h=new Date(f),p=h.toGMTString(),m=RegExp("([^\\s]+)(\\s\\d\\d)\\s(\\w\\w\\w)\\s(.*)");p=p.replace(m,"$1$2-$3-$4"),s="expires="+p}else s=void 0===n||isNaN(n)||0!==Number(parseInt(n,10))?"expires=Thu, 01-Jan-2037 00:00:01 GMT":"";if(u=r&&r!==void 0?"path="+r:"path=/",o&&o!==void 0)l="domain="+o;else{var g=RegExp(":(.*)");l="domain="+window.location.host,l=l.replace(g,"")}c=i&&i!==void 0?i:!1,document.cookie=a+"; "+s+"; "+u+"; "+l+"; "+c},remove:function(e,t,n){var r=!1,o=!1,i=-999999999;r=t&&t!==void 0?t:"/",o=n&&n!==void 0?n:window.location.host,this.set(e,"deleted",i,r,o)}};return e});
|
|||
|
Ink.createModule("Ink.Util.BinPack","1",[],function(){"use strict";var e=function(e,t){this.init(e,t)};e.prototype={init:function(e,t){this.root={x:0,y:0,w:e,h:t}},fit:function(e){var t,n,r;for(t=0;e.length>t;++t)r=e[t],(n=this.findNode(this.root,r.w,r.h))&&(r.fit=this.splitNode(n,r.w,r.h))},findNode:function(e,t,n){return e.used?this.findNode(e.right,t,n)||this.findNode(e.down,t,n):e.w>=t&&e.h>=n?e:null},splitNode:function(e,t,n){return e.used=!0,e.down={x:e.x,y:e.y+n,w:e.w,h:e.h-n},e.right={x:e.x+t,y:e.y,w:e.w-t,h:n},e}};var t=function(){};t.prototype={fit:function(e){var t,n,r,o=e.length,i=o>0?e[0].w:0,a=o>0?e[0].h:0;for(this.root={x:0,y:0,w:i,h:a},t=0;o>t;t++)r=e[t],r.fit=(n=this.findNode(this.root,r.w,r.h))?this.splitNode(n,r.w,r.h):this.growNode(r.w,r.h)},findNode:function(e,t,n){return e.used?this.findNode(e.right,t,n)||this.findNode(e.down,t,n):e.w>=t&&e.h>=n?e:null},splitNode:function(e,t,n){return e.used=!0,e.down={x:e.x,y:e.y+n,w:e.w,h:e.h-n},e.right={x:e.x+t,y:e.y,w:e.w-t,h:n},e},growNode:function(e,t){var n=this.root.w>=e,r=this.root.h>=t,o=r&&this.root.h>=this.root.w+e,i=n&&this.root.w>=this.root.h+t;return o?this.growRight(e,t):i?this.growDown(e,t):r?this.growRight(e,t):n?this.growDown(e,t):null},growRight:function(e,t){this.root={used:!0,x:0,y:0,w:this.root.w+e,h:this.root.h,down:this.root,right:{x:this.root.w,y:0,w:e,h:this.root.h}};var n;return(n=this.findNode(this.root,e,t))?this.splitNode(n,e,t):null},growDown:function(e,t){this.root={used:!0,x:0,y:0,w:this.root.w,h:this.root.h+t,down:{x:0,y:this.root.h,w:this.root.w,h:t},right:this.root};var n;return(n=this.findNode(this.root,e,t))?this.splitNode(n,e,t):null}};var n={random:function(){return Math.random()-.5},w:function(e,t){return t.w-e.w},h:function(e,t){return t.h-e.h},a:function(e,t){return t.area-e.area},max:function(e,t){return Math.max(t.w,t.h)-Math.max(e.w,e.h)},min:function(e,t){return Math.min(t.w,t.h)-Math.min(e.w,e.h)},height:function(e,t){return n.msort(e,t,["h","w"])},width:function(e,t){return n.msort(e,t,["w","h"])},area:function(e,t){return n.msort(e,t,["a","h","w"])},maxside:function(e,t){return n.msort(e,t,["max","min","h","w"])},msort:function(e,t,r){var o,i;for(i=0;r.length>i;++i)if(o=n[r[i]](e,t),0!==o)return o;return 0}},r=function(){return[this.w," x ",this.h].join("")},o={binPack:function(o){var i,a,s;for(i=0,a=o.blocks.length;a>i;++i)s=o.blocks[i],"area"in s||(s.area=s.w*s.h);var u=o.dimensions?new e(o.dimensions[0],o.dimensions[1]):new t;o.sorter||(o.sorter="maxside"),o.blocks.sort(n[o.sorter]),u.fit(o.blocks);var l=[u.root.w,u.root.h],c=[],d=[];for(i=0,a=o.blocks.length;a>i;++i)s=o.blocks[i],s.fit?c.push(s):(s.toString=r,d.push(s));var h=l[0]*l[1],f=0;for(i=0,a=c.length;a>i;++i)s=c[i],f+=s.area;return{dimensions:l,filled:f/h,blocks:o.blocks,fitted:c,unfitted:d}}};return o});
|
|||
|
Ink.createModule("Ink.Util.Array","1",[],function(){"use strict";var e=Array.prototype,t={inArray:function(e,t){if("object"==typeof t)for(var n=0,r=t.length;r>n;++n)if(t[n]===e)return!0;return!1},sortMulti:function(e,t){if(e===void 0||e.constructor!==Array)return!1;if("string"!=typeof t)return e.sort();if(e.length>0){if(e[0][t]===void 0)return!1;e.sort(function(e,n){var r=e[t],o=n[t];return o>r?-1:r>o?1:0})}return e},keyValue:function(e,t,n){if(e!==void 0&&"object"==typeof t&&this.inArray(e,t)){for(var r=[],o=0,i=t.length;i>o;++o)if(t[o]===e){if(n!==void 0&&n===!0)return o;r.push(o)}return r}return!1},shuffle:function(e){if(e!==void 0&&e.constructor!==Array)return!1;for(var t=e.length,n=!1,r=!1;t--;)r=Math.floor(Math.random()*(t+1)),n=e[t],e[t]=e[r],e[r]=n;return e},forEach:function(t,n,r){if(e.forEach)return e.forEach.call(t,n,r);for(var o=0,i=t.length>>>0;i>o;o++)n.call(r,t[o],o,t)},each:function(){t.forEach.apply(t,[].slice.call(arguments))},map:function(t,n,r){if(e.map)return e.map.call(t,n,r);for(var o=Array(a),i=0,a=t.length>>>0;a>i;i++)o[i]=n.call(r,t[i],i,t);return o},filter:function(t,n,r){if(e.filter)return e.filter.call(t,n,r);for(var o=[],i=null,a=0,s=t.length;s>a;a++)i=t[a],n.call(r,i,a,t)&&o.push(i);return o},some:function(e,t,n){if(null===e)throw new TypeError("First argument is invalid.");var r=Object(e),o=r.length>>>0;if("function"!=typeof t)throw new TypeError("Second argument must be a function.");for(var i=0;o>i;i++)if(i in r&&t.call(n,r[i],i,r))return!0;return!1},intersect:function(e,t){if(!e||!t||e instanceof Array==!1||t instanceof Array==!1)return[];for(var n=[],r=0,o=e.length;o>r;++r)for(var i=0,a=t.length;a>i;++i)e[r]===t[i]&&n.push(e[r]);return n},convert:function(t){return e.slice.call(t||[],0)},insert:function(e,t,n){e.splice(t,0,n)},remove:function(e,t,n){for(var r=[],o=0,i=e.length;i>o;o++)o>=t&&t+n>o||r.push(e[o]);return r}};return t});
|
|||
|
Ink.createModule("Ink.Util.Validator","1",[],function(){"use strict";var e={_countryCodes:["AO","CV","MZ","PT"],_internacionalPT:351,_indicativosPT:{21:"lisboa",22:"porto",231:"mealhada",232:"viseu",233:"figueira da foz",234:"aveiro",235:"arganil",236:"pombal",238:"seia",239:"coimbra",241:"abrantes",242:"ponte de sôr",243:"santarém",244:"leiria",245:"portalegre",249:"torres novas",251:"valença",252:"vila nova de famalicão",253:"braga",254:"peso da régua",255:"penafiel",256:"são joão da madeira",258:"viana do castelo",259:"vila real",261:"torres vedras",262:"caldas da raínha",263:"vila franca de xira",265:"setúbal",266:"évora",268:"estremoz",269:"santiago do cacém",271:"guarda",272:"castelo branco",273:"bragança",274:"proença-a-nova",275:"covilhã",276:"chaves",277:"idanha-a-nova",278:"mirandela",279:"moncorvo",281:"tavira",282:"portimão",283:"odemira",284:"beja",285:"moura",286:"castro verde",289:"faro",291:"funchal, porto santo",292:"corvo, faial, flores, horta, pico",295:"angra do heroísmo, graciosa, são jorge, terceira",296:"ponta delgada, são miguel, santa maria",91:"rede móvel 91 (Vodafone / Yorn)",93:"rede móvel 93 (Optimus)",96:"rede móvel 96 (TMN)",92:"rede móvel 92 (TODOS)",707:"número único",760:"número único",800:"número grátis",808:"chamada local",30:"voip"},_internacionalCV:238,_indicativosCV:{2:"fixo",91:"móvel 91",95:"móvel 95",97:"móvel 97",98:"móvel 98",99:"móvel 99"},_internacionalAO:244,_indicativosAO:{2:"fixo",91:"móvel 91",92:"móvel 92"},_internacionalMZ:258,_indicativosMZ:{2:"fixo",82:"móvel 82",84:"móvel 84"},_internacionalTL:670,_indicativosTL:{3:"fixo",7:"móvel 7"},_characterGroups:{numbers:["0-9"],asciiAlpha:["a-zA-Z"],latin1Alpha:["a-zA-Z","À-ÿ"],unicodeAlpha:["a-zA-Z","À-ÿ","Ā-","Ⰰ-"],space:[" "],dash:["-"],underscore:["_"],nicknamePunctuation:["_.-"],singleLineWhitespace:[" "],newline:["\n"],whitespace:[" \n\f\r "],asciiPunctuation:["!-/",":-@","[-`","{-~"],latin1Punctuation:["!-/",":-@","[-`","{-~","¡-¿","×","÷"],unicodePunctuation:["!-/",":-@","[-`","{-~","¡-¿","×","÷"," -","⸀-"," -〿"]},createRegExp:function(t){var n="^[";for(var r in t)if(t.hasOwnProperty(r)){if(!(r in e._characterGroups))throw Error("group "+r+" is not a valid character group");t[r]&&(n+=e._characterGroups[r].join(""))}return RegExp(n+"]*?$")},checkCharacterGroups:function(t,n){return e.createRegExp(n).test(t)},unicode:function(t,n){return e.checkCharacterGroups(t,Ink.extendObj({unicodeAlpha:!0},n))},latin1:function(t,n){return e.checkCharacterGroups(t,Ink.extendObj({latin1Alpha:!0},n))},ascii:function(t,n){return e.checkCharacterGroups(t,Ink.extendObj({asciiAlpha:!0},n))},number:function(t,n){t+="";var r=Ink.extendObj({decimalSep:".",thousandSep:"",negative:!0,decimalPlaces:null,maxDigits:null,max:null,min:null,returnNumber:!1},n||{});if(r.thousandSep)return t=t.replace(RegExp("\\"+r.thousandSep,"g"),""),r.thousandSep="",e.number(t,r);if(r.negative===!1)return r.min=0,r.negative=!0,e.number(t,r);if("."!==r.decimalSep&&(t=t.replace(RegExp("\\"+r.decimalSep,"g"),".")),!/^(-)?(\d+)?(\.\d+)?$/.test(t)||""===t)return!1;var i;if(r.decimalSep&&-1!==t.indexOf(r.decimalSep)){if(i=t.split(r.decimalSep),null!==r.decimalPlaces&&i[1].length>r.decimalPlaces)return!1}else i=[""+t,""];if(null!==r.maxDigits&&i[0].replace(/-/g,"").length>r.maxDigits)return i;var o=parseFloat(t);return null!==r.maxExcl&&o>=r.maxExcl||null!==r.minExcl&&r.minExcl>=o?!1:null!==r.max&&o>r.max||null!==r.min&&r.min>o?!1:r.returnNumber?o:!0},_isLeapYear:function(e){var t=/^\d{4}$/;return t.test(e)?e%4?!1:e%100?!0:e%400?!1:!0:!1},_dateParsers:{"yyyy-mm-dd":{day:5,month:3,year:1,sep:"-",parser:/^(\d{4})(\-)(\d{1,2})(\-)(\d{1,2})$/},"yyyy/mm/dd":{day:5,month:3,year:1,sep:"/",parser:/^(\d{4})(\/)(\d{1,2})(\/)(\d{1,2})$/},"yy-mm-dd":{day:5,month:3,year:1,sep:"-",parser:/^(\d{2})(\-)(\d{1,2})(\-)(\d{1,2})$/},"yy/mm/dd":{day:5,month:3,year:1,sep:"/",parser:/^(\d{2})(\/)(\d{1,2})(\/)(\d{1,2})$/},"dd-mm-yyyy":{day:1,month:3,year:5,sep:"-",parser:/^(\d{1,2})(\-)(\d{1,2})(\-)(\d{4})$/},"dd/mm/yyyy"
|
|||
|
Ink.createModule("Ink.UI.Aux","1",["Ink.Net.Ajax_1","Ink.Dom.Css_1","Ink.Dom.Selector_1","Ink.Util.Url_1"],function(e,t,n,r){"use strict";var i={},o=0,a={Layouts:{SMALL:"small",MEDIUM:"medium",LARGE:"large"},isDOMElement:function(e){return"object"==typeof e&&"nodeType"in e&&1===e.nodeType},isInteger:function(e){return"number"==typeof e&&0===e%1},elOrSelector:function(e,t){if(!this.isDOMElement(e)){var r=n.select(e);if(0===r.length)throw new TypeError(t+" must either be a DOM Element or a selector expression!\nThe script element must also be after the DOM Element itself.");return r[0]}return e},clone:function(e){try{if("object"!=typeof e)throw Error("Given argument is not an object!");return JSON.parse(JSON.stringify(e))}catch(t){throw Error("Given object cannot have loops!")}},childIndex:function(e){if(a.isDOMElement(e))for(var t=n.select("> *",e.parentNode),r=0,i=t.length;i>r;++r)if(t[r]===e)return r;throw"not found!"},ajaxJSON:function(t,n,r){new e(t,{evalJS:"force",method:"POST",parameters:n,onSuccess:function(e){try{if(e=e.responseJSON,"ok"!==e.status)throw"server error: "+e.message;r(null,e)}catch(t){r(t)}},onFailure:function(){r("communication failure")}})},currentLayout:function(){var e,r,i,o,a,s=n.select("#ink-layout-detector")[0];if(!s){s=document.createElement("div"),s.id="ink-layout-detector";for(i in this.Layouts)this.Layouts.hasOwnProperty(i)&&(o=this.Layouts[i],a=document.createElement("div"),a.className="show-"+o+" hide-all",a.setAttribute("data-ink-layout",o),s.appendChild(a));document.body.appendChild(s)}for(e=0,r=s.childNodes.length;r>e;++e)if(a=s.childNodes[e],"hidden"!==t.getStyle(a,"visibility"))return a.getAttribute("data-ink-layout")},hashSet:function(e){if("object"!=typeof e)throw new TypeError("o should be an object!");var t=r.getAnchorString();t=Ink.extendObj(t,e),window.location.hash=r.genQueryString("",t).substring(1)},cleanChildren:function(e){if(!a.isDOMElement(e))throw"Please provide a valid DOMElement";for(var t,n=e.lastChild;n;)t=n.previousSibling,e.removeChild(n),n=t},storeIdAndClasses:function(e,t){if(!a.isDOMElement(e))throw"Please provide a valid DOMElement as first parameter";var n=e.id;n&&(t._id=n);var r=e.className;r&&(t._classes=r)},restoreIdAndClasses:function(e,t){if(!a.isDOMElement(e))throw"Please provide a valid DOMElement as first parameter";t._id&&e.id!==t._id&&(e.id=t._id),t._classes&&-1===e.className.indexOf(t._classes)&&(e.className?e.className+=" "+t._classes:e.className=t._classes),t._instanceId&&!e.getAttribute("data-instance")&&e.setAttribute("data-instance",t._instanceId)},registerInstance:function(e,t,n){if(!e._instanceId){if("object"!=typeof e)throw new TypeError("1st argument must be a JavaScript object!");if(!e._options||!e._options.skipRegister){if(!this.isDOMElement(t))throw new TypeError("2nd argument must be a DOM element!");if(void 0!==n&&"string"!=typeof n)throw new TypeError("3rd argument must be a string!");var r=(n||"instance")+ ++o;i[r]=e,e._instanceId=r;var a=t.getAttribute("data-instance");a=null!==a?[a,r].join(" "):r,t.setAttribute("data-instance",a)}}},unregisterInstance:function(e){delete i[e]},getInstance:function(e){var t;if(this.isDOMElement(e)){if(t=e.getAttribute("data-instance"),null===t)throw Error("argument is not a DOM instance element!")}else t=e;t=t.split(" ");var n,r,o,a=t.length,s=[];for(o=0;a>o;++o){if(r=t[o],!r)throw Error("Element is not a JS instance!");if(n=i[r],!n)throw Error('Instance "'+r+'" not found!');s.push(n)}return 1===a?s[0]:s},getInstanceFromSelector:function(e){var t=n.select(e)[0];if(!t)throw Error("Element not found!");return this.getInstance(t)},getInstanceIds:function(){var e=[];for(var t in i)i.hasOwnProperty(t)&&e.push(t);return e},getInstances:function(){var e=[];for(var t in i)i.hasOwnProperty(t)&&e.push(i[t]);return e},destroyComponent:function(){Ink.Util.Aux.unregisterInstance(this._instanceId),this._element.parentNode.removeChild(this._element)}};return a});
|
|||
|
Ink.createModule("Ink.UI.Pagination","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(e,t,n,r,i){"use strict";var o=function(e,t){var n=document.createElement("a");return n.setAttribute("href","#"),void 0!==t&&n.setAttribute("data-index",t),n.innerHTML=e,n},a=function(t,i){if(this._element=e.elOrSelector(t,"1st argument"),this._options=Ink.extendObj({size:void 0,start:1,firstLabel:"First",lastLabel:"Last",previousLabel:"Previous",nextLabel:"Next",onChange:void 0,setHash:!1,hashParameter:"page",numberFormatter:function(e){return e+1}},i||{},r.data(this._element)),this._options.previousPageLabel||(this._options.previousPageLabel="Previous "+this._options.maxSize),this._options.nextPageLabel||(this._options.nextPageLabel="Next "+this._options.maxSize),this._handlers={click:Ink.bindEvent(this._onClick,this)},!e.isInteger(this._options.size))throw new TypeError("size option is a required integer!");if(!e.isInteger(this._options.start)&&this._options.start>0&&this._options.start<=this._options.size)throw new TypeError("start option is a required integer between 1 and size!");if(this._options.maxSize&&!e.isInteger(this._options.maxSize)&&this._options.maxSize>0)throw new TypeError("maxSize option is a positive integer!");if(0>this._options.size)throw new RangeError("size option must be equal or more than 0!");if(void 0!==this._options.onChange&&"function"!=typeof this._options.onChange)throw new TypeError("onChange option must be a function!");n.hasClassName(Ink.s("ul",this._element),"dotted")&&(this._options.numberFormatter=function(){return'<i class="icon-circle"></i>'}),this._current=this._options.start-1,this._itemLiEls=[],this._init()};return a.prototype={_init:function(){this._generateMarkup(this._element),this._updateItems(),this._observe(),e.registerInstance(this,this._element,"pagination")},_observe:function(){t.observe(this._element,"click",this._handlers.click)},_updateItems:function(){var e,t,r,i=this._itemLiEls,a=this._options.size===i.length;if(a)for(e=0,t=this._options.size;t>e;++e)n.setClassName(i[e],"active",e===this._current);else{for(e=i.length-1;e>=0;--e)this._ulEl.removeChild(i[e]);for(i=[],e=0,t=this._options.size;t>e;++e)r=document.createElement("li"),r.appendChild(o(this._options.numberFormatter(e),e)),n.setClassName(r,"active",e===this._current),this._ulEl.insertBefore(r,this._nextEl),i.push(r);this._itemLiEls=i}if(this._options.maxSize){var s=Math.floor(this._current/this._options.maxSize),u=this._options.maxSize*s,l=u+this._options.maxSize-1;for(e=0,t=this._options.size;t>e;++e)r=i[e],n.setClassName(r,"hide-all",u>e||e>l);this._pageStart=u,this._pageEnd=l,this._page=s,n.setClassName(this._prevPageEl,"disabled",!this.hasPreviousPage()),n.setClassName(this._nextPageEl,"disabled",!this.hasNextPage()),n.setClassName(this._firstEl,"disabled",this.isFirst()),n.setClassName(this._lastEl,"disabled",this.isLast())}n.setClassName(this._prevEl,"disabled",!this.hasPrevious()),n.setClassName(this._nextEl,"disabled",!this.hasNext())},_generateMarkup:function(e){n.addClassName(e,"ink-navigation");var t,r,a=!1;1>(t=i.select("ul.pagination",e)).length?(t=document.createElement("ul"),n.addClassName(t,"pagination")):(a=!0,t=t[0]),this._options.maxSize&&(r=document.createElement("li"),r.appendChild(o(this._options.firstLabel)),this._firstEl=r,n.addClassName(r,"first"),t.appendChild(r),r=document.createElement("li"),r.appendChild(o(this._options.previousPageLabel)),this._prevPageEl=r,n.addClassName(r,"previousPage"),t.appendChild(r)),r=document.createElement("li"),r.appendChild(o(this._options.previousLabel)),this._prevEl=r,n.addClassName(r,"previous"),t.appendChild(r),r=document.createElement("li"),r.appendChild(o(this._options.nextLabel)),this._nextEl=r,n.addClassName(r,"next"),t.appendChild(r),this._options.maxSize&&(r=document.createElement("li"),r.appendChild(o(this._options.nextPageLabel)),this._nextPageEl=r,n.addClassName(r,"nextPage"),t.appendChild(r),r=document.createElement("li"),r.appendChild(o(this._options.lastLabel)),this._lastEl=r,n.addClassName(r,"la
|
|||
|
Ink.createModule("Ink.UI.SortableList","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(e,t,n,r,i,o){"use strict";var s=function(t,n){if(this._element=e.elOrSelector(t,"1st argument"),!e.isDOMElement(t)&&"string"!=typeof t)throw"[Ink.UI.SortableList] :: Invalid selector";if("string"==typeof t){if(this._element=Ink.Dom.Selector.select(t),1>this._element.length)throw"[Ink.UI.SortableList] :: Selector has returned no elements";this._element=this._element[0]}else this._element=t;if(this._options=Ink.extendObj({dragObject:"li"},Ink.Dom.Element.data(this._element)),this._options=Ink.extendObj(this._options,n||{}),this._handlers={down:Ink.bindEvent(this._onDown,this),move:Ink.bindEvent(this._onMove,this),up:Ink.bindEvent(this._onUp,this)},this._model=[],this._index=void 0,this._isMoving=!1,this._options.model instanceof Array)this._model=this._options.model,this._createdFrom="JSON";else{if("ul"!==this._element.nodeName.toLowerCase())throw new TypeError("You must pass a selector expression/DOM element as 1st option or provide a model on 2nd argument!");this._createdFrom="DOM"}if(this._dragTriggers=i.select(this._options.dragObject,this._element),!this._dragTriggers)throw"[Ink.UI.SortableList] :: Drag object not found";this._init()};return s.prototype={_init:function(){"DOM"===this._createdFrom&&(this._extractModelFromDOM(),this._createdFrom="JSON");var n="ontouchstart"in document.documentElement;this._down=n?"touchstart":"mousedown",this._move=n?"touchmove":"mousemove",this._up=n?"touchend":"mouseup";var r=document.body;t.observe(r,this._move,this._handlers.move),t.observe(r,this._up,this._handlers.up),this._observe(),e.registerInstance(this,this._element,"sortableList")},_observe:function(){t.observe(this._element,this._down,this._handlers.down)},_extractModelFromDOM:function(){this._model=[];var e=this,t=i.select("> li",this._element);o.each(t,function(t){var n=t.innerHTML;e._model.push(n)})},_generateMarkup:function(){var e=document.createElement("ul");e.className="unstyled ink-sortable-list";var t=this;return o.each(this._model,function(n,r){var i=document.createElement("li");r===t._index&&(i.className="drag"),i.innerHTML=[n].join(""),e.appendChild(i)}),e},_getY:function(e){return 0===e.type.indexOf("touch")?e.changedTouches[0].pageY:"number"==typeof e.pageY?e.pageY:e.clientY},_refresh:function(t){var n=this._generateMarkup();this._element.parentNode.replaceChild(n,this._element),this._element=n,e.restoreIdAndClasses(this._element,this),this._dragTriggers=i.select(this._options.dragObject,this._element),t||this._observe()},_onDown:function(n){if(!this._isMoving){var r=t.element(n);if(!o.inArray(r,this._dragTriggers)){for(;!o.inArray(r,this._dragTriggers)&&"body"!==r.nodeName.toLowerCase();)r=r.parentNode;if("body"===r.nodeName.toLowerCase())return}t.stop(n);var i;if("li"!==r.nodeName.toLowerCase())for(;"li"!==r.nodeName.toLowerCase()&&"body"!==r.nodeName.toLowerCase();)r=r.parentNode;return i=r,this._index=e.childIndex(i),this._height=i.offsetHeight,this._startY=this._getY(n),this._isMoving=!0,document.body.style.cursor="move",this._refresh(!1),!1}},_onMove:function(e){if(this._isMoving){t.stop(e);var n=this._getY(e),r=n-this._startY,i=r>0?1:-1,o=i*Math.floor(Math.abs(r)/this._height);if(0!==o&&(o/=Math.abs(o),!(-1===o&&0===this._index||1===o&&this._index===this._model.length-1))){var s=o>0?this._index:this._index+o,a=0>o?this._index:this._index+o;this._model.splice(s,2,this._model[a],this._model[s]),this._index+=o,this._startY=n,this._refresh(!1)}}},_onUp:function(e){this._isMoving&&(t.stop(e),this._index=void 0,this._isMoving=!1,document.body.style.cursor="",this._refresh())},getModel:function(){return this._model.slice()},destroy:e.destroyComponent},s});
|
|||
|
Ink.createModule("Ink.UI.Spy","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(e,t,n,r,i,o){"use strict";var s=function(t,n){this._rootElement=e.elOrSelector(t,"1st argument"),this._options=Ink.extendObj({target:void 0},r.data(this._rootElement)),this._options=Ink.extendObj(this._options,n||{}),this._options.target=e.elOrSelector(this._options.target,"Target"),this._scrollTimeout=null,this._init()};return s.prototype={_elements:[],_init:function(){t.observe(document,"scroll",Ink.bindEvent(this._onScroll,this)),this._elements.push(this._rootElement)},_onScroll:function(){var e=r.scrollHeight();if(!(this._rootElement.offsetTop>e)){for(var t=0,s=this._elements.length;s>t;t++)if(e>=this._elements[t].offsetTop&&this._elements[t]!==this._rootElement&&this._elements[t].offsetTop>this._rootElement.offsetTop)return;o.each(i.select("a",this._options.target),Ink.bind(function(e){var t="name"in this._rootElement&&this._rootElement.name?"#"+this._rootElement.name:"#"+this._rootElement.id;e.href.substr(e.href.indexOf("#"))===t?n.addClassName(r.findUpwardsByTag(e,"li"),"active"):n.removeClassName(r.findUpwardsByTag(e,"li"),"active")},this))}}},s});
|
|||
|
Ink.createModule("Ink.UI.Sticky","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1"],function(e,t,n,r,i){"use strict";var o=function(t,n){if("object"!=typeof t&&"string"!=typeof t)throw"[Sticky] :: Invalid selector defined";if("object"==typeof t)this._rootElement=t;else{if(this._rootElement=i.select(t),0>=this._rootElement.length)throw"[Sticky] :: Can't find any element with the specified selector";this._rootElement=this._rootElement[0]}this._options=Ink.extendObj({offsetBottom:0,offsetTop:0,topElement:void 0,bottomElement:void 0},r.data(this._rootElement)),this._options=Ink.extendObj(this._options,n||{}),this._options.topElement=this._options.topElement!==void 0?e.elOrSelector(this._options.topElement,"Top Element"):e.elOrSelector("body","Top Element"),this._options.bottomElement=this._options.bottomElement!==void 0?e.elOrSelector(this._options.bottomElement,"Bottom Element"):e.elOrSelector("body","Top Element"),this._computedStyle=window.getComputedStyle?window.getComputedStyle(this._rootElement,null):this._rootElement.currentStyle,this._dims={height:this._computedStyle.height,width:this._computedStyle.width},this._init()};return o.prototype={_init:function(){t.observe(document,"scroll",Ink.bindEvent(this._onScroll,this)),t.observe(window,"resize",Ink.bindEvent(this._onResize,this)),this._calculateOriginalSizes(),this._calculateOffsets()},_onScroll:function(){var e="CSS1Compat"===document.compatMode?document.documentElement:document.body;return 100*r.elementWidth(this._rootElement)/e.clientWidth>90||649>=e.clientWidth?(r.hasAttribute(this._rootElement,"style")&&this._rootElement.removeAttribute("style"),void 0):(this._scrollTimeout&&clearTimeout(this._scrollTimeout),this._scrollTimeout=setTimeout(Ink.bind(function(){var e=r.scrollHeight();if(r.hasAttribute(this._rootElement,"style"))this._options.originalTop-this._options.originalOffsetTop>=e?this._rootElement.removeAttribute("style"):document.body.scrollHeight-(e+parseInt(this._dims.height,10))<this._options.offsetBottom?(this._rootElement.style.position="fixed",this._rootElement.style.top="auto",this._rootElement.style.left=this._options.originalLeft+"px",this._rootElement.style.bottom=this._options.offsetBottom<parseInt(document.body.scrollHeight-(document.documentElement.clientHeight+e),10)?this._options.originalOffsetBottom+"px":this._options.offsetBottom-parseInt(document.body.scrollHeight-(document.documentElement.clientHeight+e),10)+"px",this._rootElement.style.width=this._options.originalWidth+"px"):document.body.scrollHeight-(e+parseInt(this._dims.height,10))>=this._options.offsetBottom&&(this._rootElement.style.left=this._options.originalLeft+"px",this._rootElement.style.position="fixed",this._rootElement.style.bottom="auto",this._rootElement.style.left=this._options.originalLeft+"px",this._rootElement.style.top=this._options.originalOffsetTop+"px",this._rootElement.style.width=this._options.originalWidth+"px");else{if(this._options.originalTop-this._options.originalOffsetTop>=e)return;this._rootElement.style.left=this._options.originalLeft+"px",this._rootElement.style.position="fixed",this._rootElement.style.bottom="auto",this._rootElement.style.left=this._options.originalLeft+"px",this._rootElement.style.top=this._options.originalOffsetTop+"px",this._rootElement.style.width=this._options.originalWidth+"px"}this._scrollTimeout=void 0},this),0),void 0)},_onResize:function(){this._resizeTimeout&&clearTimeout(this._resizeTimeout),this._resizeTimeout=setTimeout(Ink.bind(function(){this._rootElement.removeAttribute("style"),this._calculateOriginalSizes(),this._calculateOffsets()},this),0)},_calculateOffsets:function(){if(this._options.topElement!==void 0)if("body"!==this._options.topElement.nodeName.toLowerCase()){var e=r.elementHeight(this._options.topElement),t=r.elementTop(this._options.topElement);this._options.offsetTop=parseInt(e,10)+parseInt(t,10)+parseInt(this._options.originalOffsetTop,10)}else this._options.offsetTop=parseInt(this._options.originalOffsetTop,10);if(this._options.bottomElement!==void 0)if("bod
|
|||
|
Ink.createModule("Ink.UI.Table","1",["Ink.Net.Ajax_1","Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Util.String_1"],function(e,t,n,i,r,o,s,a){"use strict";var l=function(e,n){if(this._rootElement=t.elOrSelector(e,"1st argument"),"table"!==this._rootElement.nodeName.toLowerCase())throw"[Ink.UI.Table] :: The element is not a table";this._options=Ink.extendObj({pageSize:void 0,endpoint:void 0,loadMode:"full",allowResetSorting:!1,visibleFields:void 0},r.data(this._rootElement)),this._options=Ink.extendObj(this._options,n||{}),this._markupMode=this._options.endpoint===void 0,this._options.visibleFields&&(this._options.visibleFields=this._options.visibleFields.split(",")),this._handlers={click:Ink.bindEvent(this._onClick,this)},this._originalFields=[],this._sortableFields={},this._originalData=this._data=[],this._headers=[],this._pagination=null,this._totalRows=0,this._init()};return l.prototype={_init:function(){if(this._markupMode){if(this._setHeadersHandlers(),s.each(o.select("tbody tr",this._rootElement),Ink.bind(function(e){this._data.push(e)},this)),this._originalData=this._data.slice(0),this._totalRows=this._data.length,"pageSize"in this._options&&this._options.pageSize!==void 0){for(this._pagination=this._rootElement.nextSibling;1!==this._pagination.nodeType;)this._pagination=this._pagination.nextSibling;if("nav"!==this._pagination.nodeName.toLowerCase())throw"[Ink.UI.Table] :: Missing the pagination markup or is mis-positioned";var e=Ink.getModule("Ink.UI.Pagination",1);this._pagination=new e(this._pagination,{size:Math.ceil(this._totalRows/this._options.pageSize),onChange:Ink.bind(function(e){this._paginate(e._current+1)},this)}),this._paginate(1)}}else this._getData(this._options.endpoint,!0)},_onClick:function(e){var i,l,u=n.element(e),c=r.data(u),h="pageSize"in this._options&&this._options.pageSize!==void 0;if("th"===u.nodeName.toLowerCase()&&"sortable"in c&&"true"==""+c.sortable){if(n.stop(e),i=-1,s.inArray(u,this._headers))for(l=0;this._headers.length>l;l++)if(this._headers[l]===u){i=l;break}if(!this._markupMode&&h){for(var d in this._sortableFields)d!=="col_"+i&&(this._sortableFields[d]="none",this._headers[d.replace("col_","")].innerHTML=a.stripTags(this._headers[d.replace("col_","")].innerHTML));"asc"===this._sortableFields["col_"+i]?(this._sortableFields["col_"+i]="desc",this._headers[i].innerHTML=a.stripTags(this._headers[i].innerHTML)+'<i class="icon-caret-down"></i>'):(this._sortableFields["col_"+i]="asc",this._headers[i].innerHTML=a.stripTags(this._headers[i].innerHTML)+'<i class="icon-caret-up"></i>'),this._pagination.setCurrent(this._pagination._current)}else{if(-1===i)return;if("desc"===this._sortableFields["col_"+i]&&this._options.allowResetSorting&&"true"==""+this._options.allowResetSorting)this._headers[i].innerHTML=a.stripTags(this._headers[i].innerHTML),this._sortableFields["col_"+i]="none",this._data=this._originalData.slice(0);else{for(var d in this._sortableFields)d!=="col_"+i&&(this._sortableFields[d]="none",this._headers[d.replace("col_","")].innerHTML=a.stripTags(this._headers[d.replace("col_","")].innerHTML));this._sort(i),"asc"===this._sortableFields["col_"+i]?(this._data.reverse(),this._sortableFields["col_"+i]="desc",this._headers[i].innerHTML=a.stripTags(this._headers[i].innerHTML)+'<i class="icon-caret-down"></i>'):(this._sortableFields["col_"+i]="asc",this._headers[i].innerHTML=a.stripTags(this._headers[i].innerHTML)+'<i class="icon-caret-up"></i>')}var p=o.select("tbody",this._rootElement)[0];t.cleanChildren(p),s.each(this._data,function(e){p.appendChild(e)}),this._pagination.setCurrent(0),this._paginate(1)}}},_paginate:function(e){s.each(this._data,Ink.bind(function(t,n){n>=(e-1)*parseInt(this._options.pageSize,10)&&(e-1)*parseInt(this._options.pageSize,10)+parseInt(this._options.pageSize,10)>n?i.removeClassName(t,"hide-all"):i.addClassName(t,"hide-all")},this))},_sort:function(e){this._data.sort(Ink.bind(function(t,n){var i=r.textContent(o.select("td",t)[e]),s=r.textContent(o.select("td",n)[e]),a=RegExp(/\d/g);re
|
|||
|
Ink.createModule("Ink.UI.Tabs","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(e,t,n,i,r,o){"use strict";var s=function(t,n){if(e.isDOMElement(t))this._element=t;else{if(t=r.select(t),0===t.length)throw new TypeError("1st argument must either be a DOM Element or a selector expression!");this._element=t[0]}this._options=Ink.extendObj({preventUrlChange:!1,active:void 0,disabled:[],onBeforeChange:void 0,onChange:void 0},i.data(t)),this._options=Ink.extendObj(this._options,n||{}),this._handlers={tabClicked:Ink.bindEvent(this._onTabClicked,this),disabledTabClicked:Ink.bindEvent(this._onDisabledTabClicked,this),resize:Ink.bindEvent(this._onResize,this)},this._init()};return s.prototype={_init:function(){this._menu=r.select(".tabs-nav",this._element)[0],this._menuTabs=this._getChildElements(this._menu),this._contentTabs=r.select(".tabs-content",this._element),this._initializeDom(),this._observe(),this._setFirstActive(),this._changeTab(this._activeMenuLink),this._handlers.resize(),e.registerInstance(this,this._element,"tabs")},_initializeDom:function(){for(var e=0;this._contentTabs.length>e;e++)n.hide(this._contentTabs[e])},_observe:function(){o.each(this._menuTabs,Ink.bind(function(e){var t=r.select("a",e)[0];o.inArray(t.getAttribute("href"),this._options.disabled)?this.disable(t):this.enable(t)},this)),t.observe(window,"resize",this._handlers.resize)},_setFirstActive:function(){var e=window.location.hash;this._activeContentTab=r.select(e,this._element)[0]||r.select(this._hashify(this._options.active),this._element)[0]||r.select(".tabs-content",this._element)[0],this._activeMenuLink=this._findLinkByHref(this._activeContentTab.getAttribute("id")),this._activeMenuTab=this._activeMenuLink.parentNode},_changeTab:function(e,t){t&&this._options.onBeforeChange!==void 0&&this._options.onBeforeChange(this);var i=e.getAttribute("href");n.removeClassName(this._activeMenuTab,"active"),n.removeClassName(this._activeContentTab,"active"),n.addClassName(this._activeContentTab,"hide-all"),this._activeMenuLink=e,this._activeMenuTab=this._activeMenuLink.parentNode,this._activeContentTab=r.select(i.substr(i.indexOf("#")),this._element)[0],n.addClassName(this._activeMenuTab,"active"),n.addClassName(this._activeContentTab,"active"),n.removeClassName(this._activeContentTab,"hide-all"),n.show(this._activeContentTab),t&&this._options.onChange!==void 0&&this._options.onChange(this)},_onTabClicked:function(e){t.stop(e);var n=t.findElement(e,"A");"a"===n.nodeName.toLowerCase()&&("true"!=""+this._options.preventUrlChange&&(window.location.hash=n.getAttribute("href").substr(n.getAttribute("href").indexOf("#"))),n!==this._activeMenuLink&&this.changeTab(n))},_onDisabledTabClicked:function(e){t.stop(e)},_onResize:function(){var t=e.currentLayout();t!==this._lastLayout&&(t===e.Layouts.SMALL||t===e.Layouts.MEDIUM?(n.removeClassName(this._menu,"menu"),n.removeClassName(this._menu,"horizontal")):(n.addClassName(this._menu,"menu"),n.addClassName(this._menu,"horizontal")),this._lastLayout=t)},_hashify:function(e){return e?0===e.indexOf("#")?e:"#"+e:""},_findLinkByHref:function(e){e=this._hashify(e);var t;return o.each(this._menuTabs,Ink.bind(function(n){var i=r.select("a",n)[0];-1!==i.getAttribute("href").indexOf("#")&&i.getAttribute("href").substr(i.getAttribute("href").indexOf("#"))===e&&(t=i)},this)),t},_getChildElements:function(e){for(var t=[],n=e.children,i=0;n.length>i;i++)1===n[i].nodeType&&t.push(n[i]);return t},changeTab:function(e){var t=1===e.nodeType?e:this._findLinkByHref(this._hashify(e));t&&!n.hasClassName(t,"ink-disabled")&&this._changeTab(t,!0)},disable:function(e){var i=1===e.nodeType?e:this._findLinkByHref(this._hashify(e));i&&(t.stopObserving(i,"click",this._handlers.tabClicked),t.observe(i,"click",this._handlers.disabledTabClicked),n.addClassName(i,"ink-disabled"))},enable:function(e){var i=1===e.nodeType?e:this._findLinkByHref(this._hashify(e));i&&(t.stopObserving(i,"click",this._handlers.disabledTabClicked),t.observe(i,"click",this._handlers.tabClicked),n.removeClass
|
|||
|
Ink.createModule("Ink.UI.Toggle","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(e,t,n,i,r,o){"use strict";var s=function(e,t){if("string"!=typeof e&&"object"!=typeof e)throw"[Ink.UI.Toggle] Invalid CSS selector to determine the root element";if("string"==typeof e){if(this._rootElement=r.select(e),0>=this._rootElement.length)throw"[Ink.UI.Toggle] Root element not found";this._rootElement=this._rootElement[0]}else this._rootElement=e;if(this._options=Ink.extendObj({target:void 0,triggerEvent:"click",closeOnClick:!0},i.data(this._rootElement)),this._options=Ink.extendObj(this._options,t||{}),this._targets=function(e){return"string"==typeof e?r.select(e):"object"==typeof e?e.constructor===Array?e:[e]:void 0}(this._options.target),!this._targets.length)throw"[Ink.UI.Toggle] Toggle target was not found! Supply a valid selector, array, or element through the `target` option.";this._init()};return s.prototype={_init:function(){this._accordion=n.hasClassName(this._rootElement.parentNode,"accordion")||n.hasClassName(this._targets[0].parentNode,"accordion"),t.observe(this._rootElement,this._options.triggerEvent,Ink.bindEvent(this._onTriggerEvent,this)),"true"==""+this._options.closeOnClick&&t.observe(document,"click",Ink.bindEvent(this._onClick,this))},_onTriggerEvent:function(){if(this._accordion){var e,t,o;for(o=n.hasClassName(this._targets[0].parentNode,"accordion")?this._targets[0].parentNode:this._targets[0].parentNode.parentNode,e=r.select(".toggle",o),t=0;e.length>t;t+=1){var s=i.data(e[t]),a=r.select(s.target,o);a.length>0&&a[0]!==this._targets[0]&&(a[0].style.display="none")}}for(var l,u,c=0,h=this._targets.length;h>c;c++)l="none"===n.getStyle(this._targets[c],"display")?"show-all":"hide-all",u="none"===n.getStyle(this._targets[c],"display")?"block":"none",n.removeClassName(this._targets[c],"show-all"),n.removeClassName(this._targets[c],"hide-all"),n.addClassName(this._targets[c],l),this._targets[c].style.display=u;"show-all"===l?n.addClassName(this._rootElement,"active"):n.removeClassName(this._rootElement,"active")},_onClick:function(e){var n,r=t.element(e),s=o.some(this._targets,function(e){return i.isAncestorOf(e,r)});if(this._rootElement!==r&&!i.isAncestorOf(this._rootElement,r)&&!s){if((n=Ink.ss(".ink-shade")).length)for(var a=n.length,l=0;a>l;l++)if(i.isAncestorOf(n[l],r)&&i.isAncestorOf(n[l],this._rootElement))return;i.findUpwardsByClass(r,"toggle")&&this._dismiss(this._rootElement)}},_dismiss:function(){if("none"!==n.getStyle(this._targets[0],"display")){for(var e=0,t=this._targets.length;t>e;e++)n.removeClassName(this._targets[e],"show-all"),n.addClassName(this._targets[e],"hide-all"),this._targets[e].style.display="none";n.removeClassName(this._rootElement,"active")}}},s});
|
|||
|
Ink.createModule("Ink.UI.Tooltip","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Dom.Css_1","Ink.Dom.Browser_1"],function(e,t,n,i,o,r){"use strict";function s(e,t){this._init(e,t||{})}function a(e,t){this._init(e,t)}var l,u,c;(function(){for(var e=document.createElement("DIV"),t=["transition","oTransition","msTransition","mozTransition","webkitTransition"],n=0;t.length>n;n++)if(e.style[t[n]+"Duration"]!==void 0){l=t[n]+"Duration",u=t[n]+"Property",c=t[n]+"TimingFunction";break}})();var h=document.getElementsByTagName("body"),d=h&&h.length?h[0]:document.documentElement;return s.prototype={_init:function(e,t){var n;if(this.options=Ink.extendObj({where:"up",zIndex:1e4,left:10,top:10,spacing:8,forever:0,color:"",timeout:0,delay:0,template:null,templatefield:null,fade:.3,text:""},t||{}),"string"==typeof e)n=i.select(e);else{if("object"!=typeof e)throw"Element expected";n=[e]}this.tooltips=[];for(var o=0,r=n.length;r>o;o++)this.tooltips[o]=new a(this,n[o])},destroy:function(){o.each(this.tooltips,function(e){e._destroy()}),this.tooltips=null,this.options=null}},a.prototype={_oppositeDirections:{left:"right",right:"left",up:"down",down:"up"},_init:function(e,n){t.observe(n,"mouseover",Ink.bindEvent(this._onMouseOver,this)),t.observe(n,"mouseout",Ink.bindEvent(this._onMouseOut,this)),t.observe(n,"mousemove",Ink.bindEvent(this._onMouseMove,this)),this.root=e,this.element=n,this._delayTimeout=null,this.tooltip=null},_makeTooltip:function(e){if(!this._getOpt("text"))return!1;var n=this._createTooltipElement();this.tooltip&&this._removeTooltip(),this.tooltip=n,this._fadeInTooltipElement(n),this._placeTooltipElement(n,e),t.observe(n,"mouseover",Ink.bindEvent(this._onTooltipMouseOver,this));var i=this._getFloatOpt("timeout");i&&setTimeout(Ink.bind(function(){this.tooltip===n&&this._removeTooltip()},this),1e3*i)},_createTooltipElement:function(){var t,o,s=this._getOpt("template"),a=this._getOpt("templatefield");if(s){var l=document.createElement("DIV");if(l.innerHTML=e.elOrSelector(s,"options.template").outerHTML,t=l.firstChild,a){if(o=i.select(a,t),!o)throw"options.templatefield must be a valid selector within options.template";o=o[0]}else o=t}else t=document.createElement("DIV"),r.addClassName(t,"ink-tooltip"),r.addClassName(t,this._getOpt("color")),o=document.createElement("DIV"),r.addClassName(o,"content"),t.appendChild(o);return n.setTextContent(o,this._getOpt("text")),t.style.display="block",t.style.position="absolute",t.style.zIndex=this._getIntOpt("zIndex"),t},_fadeInTooltipElement:function(e){var t=this._getFloatOpt("fade");l&&t&&(e.style.opacity="0",e.style[l]=t+"s",e.style[u]="opacity",e.style[c]="ease-in-out",setTimeout(function(){e.style.opacity="1"},0))},_placeTooltipElement:function(e,t){var i=this._getOpt("where");if("mousemove"===i||"mousefix"===i){var o=t;this._setPos(o[0],o[1]),d.appendChild(e)}else if(i.match(/(up|down|left|right)/)){d.appendChild(e);var s=n.offset(this.element),a=s[0],l=s[1];a instanceof Array&&(l=a[1],a=a[0]);var u=n.elementWidth(this.element)/2-n.elementWidth(e)/2,c=n.elementHeight(this.element)/2-n.elementHeight(e)/2,h=this._getIntOpt("spacing"),p=n.elementDimensions(e),f=n.elementDimensions(this.element),m=n.scrollWidth()+n.viewportWidth(),g=n.scrollHeight()+n.viewportHeight();"left"===i&&0>a-p[0]?i="right":"right"===i&&a+p[0]>m?i="left":"up"===i&&0>l-p[1]?i="down":"down"===i&&l+p[1]>g&&(i="up"),"up"===i?(l-=p[1],l-=h,a+=u):"down"===i?(l+=f[1],l+=h,a+=u):"left"===i?(a-=p[0],a-=h,l+=c):"right"===i&&(a+=f[0],a+=h,l+=c);var v=null;i.match(/(up|down|left|right)/)&&(v=document.createElement("SPAN"),r.addClassName(v,"arrow"),r.addClassName(v,this._oppositeDirections[i]),e.appendChild(v));var _=this._getLocalScroll(),y=a-_[0],b=l-_[1],w=b+p[1]-g,E=y+p[0]-m,k=0-y,C=0-b;w>0?(v&&(v.style.top=p[1]/2+w+"px"),b-=w):C>0?(v&&(v.style.top=p[1]/2-C+"px"),b+=C):E>0?(v&&(v.style.left=p[0]/2+E+"px"),y-=E):k>0&&(v&&(v.style.left=p[0]/2-k+"px"),y+=k),e.style.left=y+"px",e.style.top=b+"px"}},_removeTooltip:function(){var e=this.tooltip;if(e){var t=Ink.bind(n.re
|
|||
|
Ink.createModule("Ink.UI.TreeView","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(e,t,n,i,o,r){"use strict";var s=function(t,n){if(!e.isDOMElement(t)&&"string"!=typeof t)throw"[Ink.UI.TreeView] :: Invalid selector";if("string"==typeof t){if(this._element=o.select(t),1>this._element.length)throw"[Ink.UI.TreeView] :: Selector has returned no elements";this._element=this._element[0]}else this._element=t;this._options=Ink.extendObj({node:"li",child:"ul"},i.data(this._element)),this._options=Ink.extendObj(this._options,n||{}),this._init()};return s.prototype={_init:function(){this._handlers={click:Ink.bindEvent(this._onClick,this)},t.observe(this._element,"click",this._handlers.click);var e,i=o.select(this._options.node,this._element);r.each(i,Ink.bind(function(t){n.hasClassName(t,"open")||(n.hasClassName(t,"closed")||n.addClassName(t,"closed"),e=o.select(this._options.child,t),r.each(e,Ink.bind(function(e){n.hasClassName(e,"hide-all")||n.addClassName(e,"hide-all")},this)))},this))},_onClick:function(e){var i=t.element(e);if("."===this._options.node[0]){if(!n.hasClassName(i,this._options.node.substr(1)))for(;!n.hasClassName(i,this._options.node.substr(1))&&"body"!==i.nodeName.toLowerCase();)i=i.parentNode}else if("#"===this._options.node[0]){if(i.id!==this._options.node.substr(1))for(;i.id!==this._options.node.substr(1)&&"body"!==i.nodeName.toLowerCase();)i=i.parentNode}else if(i.nodeName.toLowerCase()!==this._options.node)for(;i.nodeName.toLowerCase()!==this._options.node&&"body"!==i.nodeName.toLowerCase();)i=i.parentNode;if("body"!==i.nodeName.toLowerCase()){var r=o.select(this._options.child,i);r.length>0&&(t.stop(e),r=r[0],n.hasClassName(r,"hide-all")?(n.removeClassName(r,"hide-all"),n.addClassName(i,"open"),n.removeClassName(i,"closed")):(n.addClassName(r,"hide-all"),n.removeClassName(i,"open"),n.addClassName(i,"closed")))}}},s});
|
|||
|
Ink.createModule("Ink.UI.SmoothScroller","1",["Ink.Dom.Event_1","Ink.Dom.Selector_1","Ink.Dom.Loaded_1"],function(e,t,n){"use strict";var i={speed:10,gy:function(e){var t;if(t=e.offsetTop,e.offsetParent)for(;e=e.offsetParent;)t+=e.offsetTop;return t},scrollTop:function(){var e=document.body,t=document.documentElement;return e&&e.scrollTop?e.scrollTop:t&&t.scrollTop?t.scrollTop:window.pageYOffset?window.pageYOffset:0},add:function(t,n,i){e.observe(t,n,i)},end:function(t){return window.event?(window.event.cancelBubble=!0,window.event.returnValue=!1,void 0):(e.stop(t),void 0)},scroll:function(e){var t=Ink.UI.SmoothScroller.scrollTop();t+=e>t?Math.ceil((e-t)/Ink.UI.SmoothScroller.speed):(e-t)/Ink.UI.SmoothScroller.speed,window.scrollTo(0,t),(t===e||Ink.UI.SmoothScroller.offsetTop===t)&&clearInterval(Ink.UI.SmoothScroller.interval),Ink.UI.SmoothScroller.offsetTop=t},init:function(){n.run(Ink.UI.SmoothScroller.render)},render:function(){var n=t.select("a.scrollableLink");Ink.UI.SmoothScroller.end(this);for(var i=0;n.length>i;i++){var o=n[i];!o.href||-1===o.href.indexOf("#")||o.pathname!==location.pathname&&"/"+o.pathname!==location.pathname||(Ink.UI.SmoothScroller.add(o,"click",Ink.UI.SmoothScroller.end),e.observe(o,"click",Ink.bindEvent(Ink.UI.SmoothScroller.clickScroll,this,o)))}},clickScroll:function(e,n){if(Ink.UI.SmoothScroller.end(n),null!==n&&null!==n.getAttribute("href")){var i=n.href.indexOf("#");if(-1===i)return;var o=n.href.substr(i+1),r=t.select('a[name="'+o+'"],#'+o);if(r[0]!==void 0){if(-1===n.parentNode.className.indexOf("active")){var s=n.parentNode.parentNode,a=s.firstChild;do if(a.tagName!==void 0&&"LI"===a.tagName.toUpperCase()&&-1!==a.className.indexOf("active")){a.className=a.className.replace("active","");break}while(a=a.nextSibling);n.parentNode.className+=" active"}clearInterval(Ink.UI.SmoothScroller.interval),Ink.UI.SmoothScroller.interval=setInterval("Ink.UI.SmoothScroller.scroll("+Ink.UI.SmoothScroller.gy(r[0])+")",10)}}}};return i});
|
|||
|
Ink.createModule("Ink.UI.ImageQuery","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(e,t,n,i,o,r){"use strict";var s=function(t,n){if(!e.isDOMElement(t)&&"string"!=typeof t)throw"[ImageQuery] :: Invalid selector";if("string"==typeof t){if(this._element=o.select(t),1>this._element.length)throw"[ImageQuery] :: Selector has returned no elements";if(this._element.length>1){var r;for(r=1;this._element.length>r;r+=1)new Ink.UI.ImageQuery(this._element[r],n)}this._element=this._element[0]}else this._element=t;this._options=Ink.extendObj({queries:[],onLoad:null},i.data(this._element)),this._options=Ink.extendObj(this._options,n||{});var s;if(-1!==(s=this._element.src.lastIndexOf("?"))){var a=this._element.src.substr(s);this._filename=this._element.src.replace(a,"").split("/").pop()+a}else this._filename=this._element.src.split("/").pop();this._init()};return s.prototype={_init:function(){this._options.queries=r.sortMulti(this._options.queries,"width").reverse(),this._handlers={resize:Ink.bindEvent(this._onResize,this),load:Ink.bindEvent(this._onLoad,this)},"function"==typeof this._options.onLoad&&t.observe(this._element,"onload",this._handlers.load),t.observe(window,"resize",this._handlers.resize),this._handlers.resize.call(this)},_onResize:function(){clearTimeout(e);var e=setTimeout(Ink.bind(function(){if(!this._options.queries||this._options.queries==={})return clearTimeout(e),void 0;var t,n,i;for("number"==typeof window.innerWidth?i=window.innerWidth:document.documentElement&&(document.documentElement.clientWidth||document.documentElement.clientHeight)?i=document.documentElement.clientWidth:document.body&&(document.body.clientWidth||document.body.clientHeight)&&(i=document.body.clientWidth),t=0;this._options.queries.length>t;t+=1)if(i>=this._options.queries[t].width){n=t;break}n===void 0&&(n=this._options.queries.length-1);var o=this._options.queries[n].src||this._options.src;if("devicePixelRatio"in window&&window.devicePixelRatio>1&&"retina"in this._options&&(o=this._options.queries[n].retina||this._options.retina),this._options.queries[n].file=this._filename,"function"==typeof o&&(o=o.apply(this,[this._element,this._options.queries[n]]),"string"!=typeof o))throw'[ImageQuery] :: "src" callback does not return a string';var r;for(r in this._options.queries[n])if(this._options.queries[n].hasOwnProperty(r)){if("src"===r||"retina"===r)continue;o=o.replace("{:"+r+"}",this._options.queries[n][r])}this._element.src=o,delete this._options.queries[n].file,e=void 0},this),300)},_onLoad:function(){this._options.onLoad.call(this)}},s});
|
|||
|
Ink.createModule("Ink.UI.FormValidator","2",["Ink.UI.Aux_1","Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Selector_1","Ink.Dom.Css_1","Ink.Util.Array_1","Ink.Util.I18n_1","Ink.Util.Validator_1"],function(e,t,n,i,o,r,s,a){"use strict";var l={required:function(e){return e!==void 0&&!/^\s*$/.test(e)},min_length:function(e,t){return"string"==typeof e&&e.length>=parseInt(t,10)},max_length:function(e,t){return"string"==typeof e&&e.length<=parseInt(t,10)},exact_length:function(e,t){return"string"==typeof e&&e.length===parseInt(t,10)},email:function(e){return"string"==typeof e&&a.mail(e)},url:function(e,t){return t=t||!1,"string"==typeof e&&a.url(e,t)},ip:function(e,t){return"string"!=typeof e?!1:a.isIP(e,t)},phone:function(e,t){if("string"!=typeof e)return!1;var n=t?t.toUpperCase():"";return a["is"+n+"Phone"](e)},credit_card:function(e,t){return"string"!=typeof e?!1:a.isCreditCard(e,t||"default")},date:function(e,t){return"string"==typeof e&&a.isDate(t,e)},alpha:function(e,t){return a.ascii(e,{singleLineWhitespace:t})},text:function(e,t,n){return a.unicode(e,{singleLineWhitespace:t,unicodePunctuation:n})},latin:function(e,t,n){return"string"!=typeof e?!1:a.latin1(e,{latin1Punctuation:t,singleLineWhitespace:n})},alpha_numeric:function(e){return a.ascii(e,{numbers:!0})},alpha_dash:function(e){return a.ascii(e,{dash:!0,underscore:!0})},digit:function(e){return"string"==typeof e&&/^[0-9]{1}$/.test(e)},integer:function(e,t){return a.number(e,{negative:!t,decimalPlaces:0})},decimal:function(e,t,n,i){return a.number(e,{decimalSep:t||".",decimalPlaces:+n||null,maxDigits:+i})},numeric:function(e,t,n,i){return t=t||".",-1!==e.indexOf(t)?l.decimal(e,t,n,i):l.integer(e)},range:function(e,t,n,i){return e=+e,t=+t,n=+n,isNaN(e)||isNaN(t)||isNaN(n)?!1:t>e||e>n?!1:i?0===(e-t)%i:!0},color:function(e){return a.isColor(e)},matches:function(e,t){return e===this.getFormElements()[t][0].getValue()}},u=new s({en_US:{"formvalidator.required":"The {field} filling is mandatory","formvalidator.min_length":"The {field} must have a minimum size of {param1} characters","formvalidator.max_length":"The {field} must have a maximum size of {param1} characters","formvalidator.exact_length":"The {field} must have an exact size of {param1} characters","formvalidator.email":"The {field} must have a valid e-mail address","formvalidator.url":"The {field} must have a valid URL","formvalidator.ip":"The {field} does not contain a valid {param1} IP address","formvalidator.phone":"The {field} does not contain a valid {param1} phone number","formvalidator.credit_card":"The {field} does not contain a valid {param1} credit card","formvalidator.date":"The {field} should contain a date in the {param1} format","formvalidator.alpha":"The {field} should only contain letters","formvalidator.text":"The {field} should only contain alphabetic characters","formvalidator.latin":"The {field} should only contain alphabetic characters","formvalidator.alpha_numeric":"The {field} should only contain letters or numbers","formvalidator.alpha_dashes":"The {field} should only contain letters or dashes","formvalidator.digit":"The {field} should only contain a digit","formvalidator.integer":"The {field} should only contain an integer","formvalidator.decimal":"The {field} should contain a valid decimal number","formvalidator.numeric":"The {field} should contain a number","formvalidator.range":"The {field} should contain a number between {param1} and {param2}","formvalidator.color":"The {field} should contain a valid color","formvalidator.matches":"The {field} should match the field {param1}","formvalidator.validation_function_not_found":"The rule {rule} has not been defined"},pt_PT:{"formvalidator.required":"Preencher {field} é obrigatório","formvalidator.min_length":"{field} deve ter no mínimo {param1} caracteres","formvalidator.max_length":"{field} tem um tamanho máximo de {param1} caracteres","formvalidator.exact_length":"{field} devia ter exactamente {param1} caracteres","formvalidator.email":"{field} deve ser um e-mail válido","formvalidator.url":"O {field} deve ser um URL válido","for
|
|||
|
Ink.createModule("Ink.UI.FormValidator","1",["Ink.Dom.Css_1","Ink.Util.Validator_1"],function(e,t){"use strict";var n={version:"1",_flagMap:{"ink-fv-required":{msg:"Required field"},"ink-fv-email":{msg:"Invalid e-mail address"},"ink-fv-url":{msg:"Invalid URL"},"ink-fv-number":{msg:"Invalid number"},"ink-fv-phone_pt":{msg:"Invalid phone number"},"ink-fv-phone_cv":{msg:"Invalid phone number"},"ink-fv-phone_mz":{msg:"Invalid phone number"},"ink-fv-phone_ao":{msg:"Invalid phone number"},"ink-fv-date":{msg:"Invalid date"},"ink-fv-confirm":{msg:"Confirmation does not match"},"ink-fv-custom":{msg:""}},elements:{},confirmElms:{},hasConfirm:{},_errorClassName:"tip",_errorValidationClassName:"validaton",_errorTypeWarningClassName:"warning",_errorTypeErrorClassName:"error",validate:function(e,t){if(this._free(),t=Ink.extendObj({onSuccess:!1,onError:!1,customFlag:!1,confirmGroup:[]},t||{}),"string"==typeof e&&(e=document.getElementById(e)),null===e)return!1;this.element=e,(this.element.id===void 0||null===this.element.id||""===this.element.id)&&(this.element.id="ink-fv_randomid_"+Math.round(99999*Math.random())),this.custom=t.customFlag,this.confirmGroup=t.confirmGroup;var n=this._validateElements();return n.length>0?(t.onError?t.onError(n):this._showError(e,n),!1):(t.onError||this._clearError(e),this._clearCache(),t.onSuccess&&t.onSuccess(),!0)},reset:function(){this._clearError(),this._clearCache()},_free:function(){this.element=null,this.custom=!1,this.confirmGroup=!1},_clearCache:function(){this.element=null,this.elements=[],this.custom=!1,this.confirmGroup=!1},_getElements:function(){this.elements[this.element.id]=[],this.confirmElms[this.element.id]=[];for(var t=this.element.elements,n=!1,i=0,r=t.length;r>i;i++)if(n=t[i],null!==n.getAttribute("type")&&"radio"===n.getAttribute("type").toLowerCase()){if(0===this.elements[this.element.id].length||n.getAttribute("type")!==this.elements[this.element.id][this.elements[this.element.id].length-1].getAttribute("type")&&n.getAttribute("name")!==this.elements[this.element.id][this.elements[this.element.id].length-1].getAttribute("name"))for(var o in this._flagMap)if(e.hasClassName(n,o)){this.elements[this.element.id].push(n);break}}else{for(var s in this._flagMap)if(e.hasClassName(n,s)&&"ink-fv-confirm"!==s){this.elements[this.element.id].push(n);break}e.hasClassName(n,"ink-fv-confirm")&&(this.confirmElms[this.element.id].push(n),this.hasConfirm[this.element.id]=!0)}},_validateElements:function(){var t;this._getElements(),this.hasConfirm[this.element.id]!==void 0&&this.hasConfirm[this.element.id]===!0&&(t=this._makeConfirmGroups());for(var n,i=[],r=!1,o=!1,s=0,a=this.elements[this.element.id].length;a>s;s++)if(n=!1,r=this.elements[this.element.id][s],!r.disabled)for(var l in this._flagMap)e.hasClassName(r,l)&&("ink-fv-custom"!==l&&"ink-fv-confirm"!==l?this._isValid(r,l)||(n?i[i.length-1].errors.push(l):(i.push({elm:r,errors:[l]}),n=!0)):"ink-fv-confirm"!==l&&(o=this._isCustomValid(r),o.length>0&&i.push({elm:r,errors:[l],custom:o})));return i=this._validateConfirmGroups(t,i)},_validateConfirmGroups:function(e,t){var n=!1;for(var i in e)e.hasOwnProperty(i)&&(n=e[i],2===n.length&&n[0].value!==n[1].value&&t.push({elm:n[1],errors:["ink-fv-confirm"]}));return t},_makeConfirmGroups:function(){var t;if(this.confirmGroup&&this.confirmGroup.length>0){t={};for(var n=!1,i=!1,r=0,o=this.confirmElms[this.element.id].length;o>r;r++){n=this.confirmElms[this.element.id][r];for(var s=0,a=this.confirmGroup.length;a>s;s++)i=this.confirmGroup[s],e.hasClassName(n,i)&&(t[i]===void 0?t[i]=[n]:t[i].push(n))}return t}return 2===this.confirmElms[this.element.id].length&&(t={"ink-fv-confirm":[this.confirmElms[this.element.id][0],this.confirmElms[this.element.id][1]]}),t},_isCustomValid:function(t){for(var n=[],i=!1,r=0,o=this.custom.length;o>r;r++)i=this.custom[r],e.hasClassName(t,i.flag)&&(i.callback(t,i.msg)||n.push({flag:i.flag,msg:i.msg}));return n},_isValid:function(n,i){switch(i){case"ink-fv-required":if("select"===n.nodeName.toLowerCase())return n.selectedIndex>0?!0:!1;if("checkbox"!==n.getAttribute("type")
|
|||
|
Ink.createModule("Ink.UI.Droppable","1",["Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.UI.Aux_1","Ink.Util.Array_1","Ink.Dom.Selector_1"],function(e,t,n,i,r,o){var s=function(e){return function(t){return n.addClassName(e,t)}},a=function(e){return function(t){return n.removeClassName(e,t)}},l={debug:!1,_droppables:[],_draggables:[],add:function(t,n){function r(e){e.style.position="inherit"}t=i.elOrSelector(t,"Droppable.add target element");var o=Ink.extendObj({hoverClass:n.hoverclass||!1,accept:!1,onHover:!1,onDrop:!1,onDropOut:!1},n||{},e.data(t));"string"==typeof o.hoverClass&&(o.hoverClass=o.hoverClass.split(/\s+/));var s,a=this,l={move:function(e,t){r(e),t.appendChild(e)},copy:function(e,t){r(e),t.appendChild(e.cloneNode)},revert:function(e){a._findDraggable(e).originalParent.appendChild(e),r(e)}};if("string"==typeof o.onHover&&(s=o.onHover,o.onHover=l[s],void 0===o.onHover))throw Error("Unknown hover event handler: "+s);if("string"==typeof o.onDrop&&(s=o.onDrop,o.onDrop=l[s],void 0===o.onDrop))throw Error("Unknown drop event handler: "+s);if("string"==typeof o.onDropOut&&(s=o.onDropOut,o.onDropOut=l[s],void 0===o.onDropOut))throw Error("Unknown dropOut event handler: "+s);var u={element:t,data:{},options:o};this._droppables.push(u),this._update(u)},_findData:function(e){for(var t=this._droppables,n=0,i=t.length;i>n;n++)if(t[n].element===e)return t[n]},_findDraggable:function(e){for(var t=this._draggables,n=0,i=t.length;i>n;n++)if(t[n].element===e)return t[n]},updateAll:function(){r.each(this._droppables,l._update)},update:function(e){this._update(this._findData(e))},_update:function(t){var n=t.data,i=t.element;n.left=e.offsetLeft(i),n.top=e.offsetTop(i),n.right=n.left+e.elementWidth(i),n.bottom=n.top+e.elementHeight(i)},remove:function(e){e=i.elOrSelector(e);for(var t=this._droppables.length,n=0;t>n;n++)if(this._droppables[n].element===e){this._droppables.splice(n,1);break}return t!==this._droppables.length},action:function(e,t,n,i){r.each(this._droppables,Ink.bind(function(l){var u=l.data,h=l.options,c=l.element;(!h.accept||o.matches(h.accept,[i]).length)&&("drag"!==t||this._findDraggable(i)||this._draggables.push({element:i,originalParent:i.parentNode}),e.x>=u.left&&e.x<=u.right&&e.y>=u.top&&e.y<=u.bottom?"drag"===t?(h.hoverClass&&r.each(h.hoverClass,s(c)),h.onHover&&h.onHover(i,c)):"drop"===t&&(h.hoverClass&&r.each(h.hoverClass,a(c)),h.onDrop&&h.onDrop(i,c,n)):"drag"===t&&h.hoverClass?r.each(h.hoverClass,a(c)):"drop"===t&&h.onDropOut&&h.onDropOut(i,c,n))},this))}};return l});
|
|||
|
Ink.createModule("Ink.UI.Draggable","1",["Ink.Dom.Element_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Browser_1","Ink.Dom.Selector_1","Ink.UI.Aux_1"],function(e,t,n,i,o,r){function s(e,t,n){return e=Math.min(e,n),e=Math.max(e,t)}var a=0,l=1,h=function(e,t){this.init(e,t)};return h.prototype={init:function(n,o){var s=Ink.extendObj({constraint:!1,constraintElm:!1,top:!1,right:!1,bottom:!1,left:!1,handle:o.handler||!1,revert:!1,cursor:"move",zindex:o.zindex||9999,dragClass:"drag",onStart:!1,onEnd:!1,onDrag:!1,onChange:!1,droppableProxy:!1,mouseAnchor:void 0,skipChildren:!0,fps:100,debug:!1},o||{},e.data(n));this.options=s,this.element=r.elOrSelector(n),this.constraintElm=s.constraintElm&&r.elOrSelector(s.constraintElm),this.handle=!1,this.elmStartPosition=!1,this.active=!1,this.dragged=!1,this.prevCoords=!1,this.placeholder=!1,this.position=!1,this.zindex=!1,this.firstDrag=!0,s.fps&&(this.deltaMs=1e3/s.fps,this.lastRunAt=0),this.handlers={},this.handlers.start=Ink.bindEvent(this._onStart,this),this.handlers.dragFacade=Ink.bindEvent(this._onDragFacade,this),this.handlers.drag=Ink.bindEvent(this._onDrag,this),this.handlers.end=Ink.bindEvent(this._onEnd,this),this.handlers.selectStart=function(e){return t.stop(e),!1},this.handle=this.options.handle?r.elOrSelector(this.options.handle):this.element,this.handle.style.cursor=s.cursor,t.observe(this.handle,"touchstart",this.handlers.start),t.observe(this.handle,"mousedown",this.handlers.start),i.IE&&t.observe(this.element,"selectstart",this.handlers.selectStart)},destroy:function(){t.stopObserving(this.handle,"touchstart",this.handlers.start),t.stopObserving(this.handle,"mousedown",this.handlers.start),i.IE&&t.stopObserving(this.element,"selectstart",this.handlers.selectStart)},_getCoords:function(t){var n=[e.scrollWidth(),e.scrollHeight()];return{x:(t.touches?t.touches[0].clientX:t.clientX)+n[a],y:(t.touches?t.touches[0].clientY:t.clientY)+n[l]}},_cloneStyle:function(t,i){i.className=t.className,i.style.borderWidth="0",i.style.padding="0",i.style.position="absolute",i.style.width=e.elementWidth(t)+"px",i.style.height=e.elementHeight(t)+"px",i.style.left=e.elementLeft(t)+"px",i.style.top=e.elementTop(t)+"px",i.style.cssFloat=n.getStyle(t,"float"),i.style.display=n.getStyle(t,"display")},_onStart:function(i){if(!this.active&&t.isLeftClick(i)||i.button===void 0){var o=t.element(i);if(this.options.skipChildren&&o!==this.handle)return;t.stop(i),n.addClassName(this.element,this.options.dragClass),this.elmStartPosition=[e.elementLeft(this.element),e.elementTop(this.element)];var r=[parseInt(n.getStyle(this.element,"left"),10),parseInt(n.getStyle(this.element,"top"),10)],s=e.elementDimensions(this.element);this.originalPosition=[r[a]?r[a]:null,r[l]?r[l]:null],this.delta=this._getCoords(i),this.active=!0,this.position=n.getStyle(this.element,"position"),this.zindex=n.getStyle(this.element,"zIndex");var h=document.createElement("div");if(h.style.position=this.position,h.style.width=s[a]+"px",h.style.height=s[l]+"px",h.style.marginTop=n.getStyle(this.element,"margin-top"),h.style.marginBottom=n.getStyle(this.element,"margin-bottom"),h.style.marginLeft=n.getStyle(this.element,"margin-left"),h.style.marginRight=n.getStyle(this.element,"margin-right"),h.style.borderWidth="0",h.style.padding="0",h.style.cssFloat=n.getStyle(this.element,"float"),h.style.display=n.getStyle(this.element,"display"),h.style.visibility="hidden",this.delta2=[this.delta.x-this.elmStartPosition[a],this.delta.y-this.elmStartPosition[l]],this.options.mouseAnchor){var u=this.options.mouseAnchor.split(" "),c=[s[a],s[l]];"left"===u[0]?c[a]=0:"center"===u[0]&&(c[a]=parseInt(c[a]/2,10)),"top"===u[1]?c[l]=0:"center"===u[1]&&(c[l]=parseInt(c[l]/2,10)),this.applyDelta=[this.delta2[a]-c[a],this.delta2[l]-c[l]]}var d=this.options.fps?"dragFacade":"drag";if(this.placeholder=h,this.options.onStart&&this.options.onStart(this.element,i),this.options.droppableProxy){this.proxy=document.createElement("div"),s=[window.innerWidth||document.documentElement.clientWidth||document.body.clientWidth,window.innerHeight||document.documentElement
|
|||
|
Ink.createModule("Ink.UI.DatePicker","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1","Ink.Util.Date_1","Ink.Dom.Browser_1"],function(e,t,n,i,o,r,s){"use strict";var a=function(t,n){t&&(this._dataField=e.elOrSelector(t,"1st argument")),this._options=Ink.extendObj({instance:"scdp_"+Math.round(99999*Math.random()),format:"yyyy-mm-dd",cssClass:"sapo_component_datepicker",position:"right",onFocus:!0,onYearSelected:void 0,onMonthSelected:void 0,validDayFn:void 0,startDate:!1,onSetDate:!1,displayInSelect:!1,showClose:!0,showClean:!0,yearRange:!1,dateRange:!1,startWeekDay:1,closeText:"Close",cleanText:"Clear",prevLinkText:"«",nextLinkText:"»",ofText:" de ",month:{1:"January",2:"February",3:"March",4:"April",5:"May",6:"June",7:"July",8:"August",9:"September",10:"October",11:"November",12:"December"},wDay:{0:"Sunday",1:"Monday",2:"Tuesday",3:"Wednesday",4:"Thursday",5:"Friday",6:"Saturday"}},i.data(this._dataField)||{}),this._options=Ink.extendObj(this._options,n||{}),this._options.format=this._dateParsers[this._options.format]||this._options.format,this._hoverPicker=!1,this._picker=null,this._options.pickerField&&(this._picker=e.elOrSelector(this._options.pickerField,"pickerField")),this._today=new Date,this._day=this._today.getDate(),this._month=this._today.getMonth(),this._year=this._today.getFullYear(),this._setMinMax(this._options.dateRange||this._options.yearRange),this._data=new Date(Date.UTC.apply(this,this._checkDateRange(this._year,this._month,this._day))),this._options.startDate&&"string"==typeof this._options.startDate&&/\d\d\d\d\-\d\d\-\d\d/.test(this._options.startDate)&&this.setDate(this._options.startDate),this._init(),this._render(),this._options.startDate||this._dataField&&"string"==typeof this._dataField.value&&this._dataField.value&&this.setDate(this._dataField.value),e.registerInstance(this,this._containerObject,"datePicker")};return a.prototype={version:"0.1",_init:function(){Ink.extendObj(this._options,this._lang||{})},_render:function(){this._containerObject=document.createElement("div"),this._containerObject.id=this._options.instance,this._containerObject.className="sapo_component_datepicker";var n=document.getElementsByTagName("body")[0];if(this._options.showClose||this._options.showClean){if(this._superTopBar=document.createElement("div"),this._superTopBar.className="sapo_cal_top_options",this._options.showClean){var o=document.createElement("a");o.className="clean",o.innerHTML=this._options.cleanText,this._superTopBar.appendChild(o)}if(this._options.showClose){var r=document.createElement("a");r.className="close",r.innerHTML=this._options.closeText,this._superTopBar.appendChild(r)}this._containerObject.appendChild(this._superTopBar)}var s=document.createElement("div");s.className="sapo_cal_top",this._monthDescContainer=document.createElement("div"),this._monthDescContainer.className="sapo_cal_month_desc",this._monthPrev=document.createElement("div"),this._monthPrev.className="sapo_cal_prev",this._monthPrev.innerHTML='<a href="#prev" class="change_month_prev">'+this._options.prevLinkText+"</a>",this._monthNext=document.createElement("div"),this._monthNext.className="sapo_cal_next",this._monthNext.innerHTML='<a href="#next" class="change_month_next">'+this._options.nextLinkText+"</a>",s.appendChild(this._monthPrev),s.appendChild(this._monthDescContainer),s.appendChild(this._monthNext),this._monthContainer=document.createElement("div"),this._monthContainer.className="sapo_cal_month",this._containerObject.appendChild(s),this._containerObject.appendChild(this._monthContainer),this._monthSelector=document.createElement("ul"),this._monthSelector.className="sapo_cal_month_selector";for(var a,l,h=1;12>=h;h++)0===(h-1)%4&&(a=document.createElement("ul")),l=document.createElement("li"),l.innerHTML='<a href="#" class="sapo_calmonth_'+(2===(h+"").length?h:"0"+h)+'">'+this._options.month[h].substring(0,3)+"</a>",a.appendChild(l),0===h%4&&this._monthSelector.appendChild(a);if(this._containerObject.appendChild(this._monthSelector),this._year
|
|||
|
Ink.createModule("Ink.UI.Close","1",["Ink.Dom.Event_1","Ink.Dom.Element_1"],function(e,t){"use strict";var n=function(){e.observe(document.body,"click",function(n){var i=e.element(n);if(i=t.findUpwardsByClass(i,"ink-close")||t.findUpwardsByClass(i,"ink-dismiss")){var o=i;o=t.findUpwardsByClass(i,"ink-alert")||t.findUpwardsByClass(i,"ink-alert-block"),o&&(e.stop(n),t.remove(o))}})};return n});
|
|||
|
Ink.createModule("Ink.UI.Carousel","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.UI.Pagination_1","Ink.Dom.Browser_1","Ink.Dom.Selector_1"],function(e,t,n,i,o,s){"use strict";var r=function(n,s){this._handlers={paginationChange:Ink.bind(this._onPaginationChange,this),windowResize:Ink.bind(this.refit,this)},t.observe(window,"resize",this._handlers.windowResize),this._element=e.elOrSelector(n,"1st argument"),this._options=Ink.extendObj({axis:"x",hideLast:!1,center:!1,keyboardSupport:!1,pagination:null,onChange:null},s||{},i.data(this._element)),this._isY="y"===this._options.axis;var r=this._element,a=Ink.s("ul.stage",r);if(this._ulEl=a,i.removeTextNodeChildren(a),this._options.hideLast){var l=document.createElement("div");l.className="hider",this._element.appendChild(l),l.style.position="absolute",l.style[this._isY?"left":"top"]="0",l.style[this._isY?"right":"bottom"]="0",l.style[this._isY?"bottom":"right"]="0",this._hiderEl=l}this.refit(),this._isY&&(this._ulEl.style.whiteSpace="normal"),this._options.pagination&&(e.isDOMElement(this._options.pagination)||"string"==typeof this._options.pagination?this._pagination=new o(this._options.pagination,{size:this._numPages,onChange:this._handlers.paginationChange}):(this._pagination=this._options.pagination,this._pagination._options.onChange=this._handlers.paginationChange,this._pagination.setSize(this._numPages),this._pagination.setCurrent(0)))};return r.prototype={refit:function(){this._liEls=Ink.ss("li.slide",this._ulEl);var e=this._liEls.length;this._ctnLength=this._size(this._element),this._elLength=this._size(this._liEls[0]),this._itemsPerPage=Math.floor(this._ctnLength/this._elLength),this._numPages=Math.ceil(e/this._itemsPerPage),this._deltaLength=this._itemsPerPage*this._elLength,this._isY?(this._element.style.width=this._liEls[0].offsetWidth+"px",this._ulEl.style.width=this._liEls[0].offsetWidth+"px"):this._ulEl.style.height=this._liEls[0].offsetHeight+"px",this._center(),this._updateHider(),this._IE7(),this._pagination&&(this._pagination.setSize(this._numPages),this._pagination.setCurrent(0))},_size:function(e){var t=i.outerDimensions(e);return this._isY?t[1]:t[0]},_center:function(){if(this._options.center){var e,t=Math.floor((this._ctnLength-this._elLength*this._itemsPerPage)/2);e=this._isY?[t,"px 0"]:["0 ",t,"px"],this._ulEl.style.padding=e.join("")}},_updateHider:function(){if(this._hiderEl){var e=Math.floor(this._ctnLength-this._elLength*this._itemsPerPage);this._options.center&&(e/=2),this._hiderEl.style[this._isY?"height":"width"]=e+"px"}},_IE7:function(){if(s.IE&&"7"==""+s.version.split(".")[0]){this._numPages;for(var e=Ink.ss("li.slide",this._ulEl),t=function(t,i){e[n].style[t]=i},n=0,i=e.length;i>n;n++)t("position","absolute"),t(this._isY?"top":"left",n*this._elLength+"px")}},_onPaginationChange:function(e){var t=e.getCurrent();this._ulEl.style["y"===this._options.axis?"top":"left"]=["-",t*this._deltaLength,"px"].join(""),this._options.onChange&&this._options.onChange.call(this,t)}},r});
|
|||
|
Ink.createModule("Ink.UI.Modal","1",["Ink.UI.Aux_1","Ink.Dom.Event_1","Ink.Dom.Css_1","Ink.Dom.Element_1","Ink.Dom.Selector_1","Ink.Util.Array_1"],function(e,t,n,i,o,s){"use strict";var r=function(e,r){if("string"!=typeof e&&"object"!=typeof e&&r.markup===void 0)throw"Invalid Modal selector";if("string"==typeof e){if(""!==e){if(this._element=o.select(e),0===this._element.length)throw"The Modal selector has not returned any elements";this._element=this._element[0]}}else e&&(this._element=e);if(this._options={width:void 0,height:void 0,shadeClass:void 0,modalClass:void 0,trigger:void 0,triggerEvent:"click",autoDisplay:!0,markup:void 0,onShow:void 0,onDismiss:void 0,closeOnClick:!1,responsive:!0,disableScroll:!0},this._handlers={click:Ink.bindEvent(this._onClick,this),keyDown:Ink.bindEvent(this._onKeyDown,this),resize:Ink.bindEvent(this._onResize,this)},this._wasDismissed=!1,this._markupMode=this._element?n.hasClassName(this._element,"ink-modal"):!1,this._markupMode){if(this._modalDiv=this._element,this._modalDivStyle=this._modalDiv.style,this._modalShadow=this._modalDiv.parentNode,this._modalShadowStyle=this._modalShadow.style,this._contentContainer=o.select(".modal-body",this._modalDiv),!this._contentContainer.length)throw'Missing div with class "modal-body"';this._contentContainer=this._contentContainer[0],this._options.markup=this._contentContainer.innerHTML,this._options=Ink.extendObj(this._options,i.data(this._element))}else this._modalShadow=document.createElement("div"),this._modalShadowStyle=this._modalShadow.style,this._modalDiv=document.createElement("div"),this._modalDivStyle=this._modalDiv.style,this._element&&(this._options.markup=this._element.innerHTML),n.addClassName(this._modalShadow,"ink-shade"),n.addClassName(this._modalDiv,"ink-modal"),n.addClassName(this._modalDiv,"ink-space"),this._modalShadow.appendChild(this._modalDiv),document.body.appendChild(this._modalShadow);if(this._options=Ink.extendObj(this._options,r||{}),this._markupMode||this.setContentMarkup(this._options.markup),"string"==typeof this._options.shadeClass&&s.each(this._options.shadeClass.split(" "),Ink.bind(function(e){n.addClassName(this._modalShadow,e.trim())},this)),"string"==typeof this._options.modalClass&&s.each(this._options.modalClass.split(" "),Ink.bind(function(e){n.addClassName(this._modalDiv,e.trim())},this)),"trigger"in this._options&&this._options.trigger!==void 0){var a,l;if("string"==typeof this._options.trigger&&(a=o.select(this._options.trigger),a.length>0))for(l=0;a.length>l;l++)t.observe(a[l],this._options.triggerEvent,Ink.bindEvent(this.open,this))}else this._options.autoDisplay&&this.open()};return r.prototype={_reposition:function(){this._modalDivStyle.top=this._modalDivStyle.left="50%",this._modalDivStyle.marginTop="-"+~~(i.elementHeight(this._modalDiv)/2)+"px",this._modalDivStyle.marginLeft="-"+~~(i.elementWidth(this._modalDiv)/2)+"px"},_onResize:function(e){"boolean"==typeof e?this._timeoutResizeFunction.call(this):this._resizeTimeout||"object"!=typeof e||(this._resizeTimeout=setTimeout(Ink.bind(this._timeoutResizeFunction,this),250))},_timeoutResizeFunction:function(){var e="CSS1Compat"===document.compatMode?document.documentElement:document.body,t=parseInt(e.clientHeight,10),n=parseInt(e.clientWidth,10);this._modalDivStyle.width=n>this.originalStatus.width?this._modalDivStyle.maxWidth:~~(.9*n)+"px",this._modalDivStyle.height=t>this.originalStatus.height&&parseInt(this._modalDivStyle.maxHeight,10)>=i.elementHeight(this._modalDiv)?this._modalDivStyle.maxHeight:~~(.9*t)+"px",this._resizeContainer(),this._reposition(),this._resizeTimeout=void 0},_onClick:function(e){var s=t.element(e);if(n.hasClassName(s,"ink-close")||n.hasClassName(s,"ink-dismiss")||i.findUpwardsByClass(s,"ink-close")||i.findUpwardsByClass(s,"ink-dismiss")||this._options.closeOnClick&&(!i.descendantOf(this._shadeElement,s)||s===this._shadeElement)){for(var r=o.select(".ink-alert",this._shadeElement),a=r.length,l=0;a>l;l++)if(i.descendantOf(r[l],s))return;t.stop(e),this.dismiss()}},_onKeyDown:function(e){27!==e.keyCode||this._wasDismissed||this.di
|
|||
|
Ink.createModule("Ink.UI.ProgressBar","1",["Ink.Dom.Selector_1","Ink.Dom.Element_1"],function(e,t){"use strict";var n=function(n,i){if("object"!=typeof n){if("string"!=typeof n)throw"[Ink.UI.ProgressBar] :: Invalid selector";if(this._element=e.select(n),1>this._element.length)throw"[Ink.UI.ProgressBar] :: Selector didn't find any elements";this._element=this._element[0]}else this._element=n;this._options=Ink.extendObj({startValue:0,onStart:function(){},onEnd:function(){}},t.data(this._element)),this._options=Ink.extendObj(this._options,i||{}),this._value=this._options.startValue,this._init()};return n.prototype={_init:function(){if(this._elementBar=e.select(".bar",this._element),1>this._elementBar.length)throw"[Ink.UI.ProgressBar] :: Bar element not found";this._elementBar=this._elementBar[0],this._options.onStart=Ink.bind(this._options.onStart,this),this._options.onEnd=Ink.bind(this._options.onEnd,this),this.setValue(this._options.startValue)},setValue:function(e){this._options.onStart(this._value),e=parseInt(e,10),isNaN(e)||0>e?e=0:e>100&&(e=100),this._value=e,this._elementBar.style.width=this._value+"%",this._options.onEnd(this._value)}},n});
|