diff --git a/dist/nuclear.js b/dist/nuclear.js index d31309898..e3aa764d7 100644 --- a/dist/nuclear.js +++ b/dist/nuclear.js @@ -12,9 +12,8 @@ define(function(require, exports, module){ module.exports=factory(); }); - } else { - root.$ = root.Nuclear = factory(); } + root.$ = root.Nuclear = factory(); }(this, function () { /* paste from Zepto v1.1.6 - @@ -1389,6 +1388,8 @@ Nuclear.create = function (obj) { Nuclear._mixObj = function (obj) { obj.ctor = function (option, selector) { + this._ncInstanceId=Nuclear.getInstanceId(); + Nuclear.instances[this._ncInstanceId] = this; this._nuclearParentEmpty = !selector; this.HTML = ""; this.option = option; @@ -1483,12 +1484,12 @@ Nuclear._mixObj = function (obj) { this.node = null; this.HTML = ""; } else { - var newNode = Nuclear.str2Dom(Nuclear.Tpl.render(Nuclear._fixTplIndex(item.tpl), item.data)); + var newNode = Nuclear.str2Dom(Nuclear.Tpl.render(Nuclear._fixEvent(Nuclear._fixTplIndex(item.tpl), this._ncInstanceId), item.data)); item.parent.replaceChild(newNode, this.node); this.node = newNode; } } else { - item.parent.insertAdjacentHTML("beforeEnd", Nuclear.Tpl.render(Nuclear._fixTplIndex(item.tpl), item.data)); + item.parent.insertAdjacentHTML("beforeEnd", Nuclear.Tpl.render(Nuclear._fixEvent(Nuclear._fixTplIndex(item.tpl), this._ncInstanceId), item.data)); this.node = item.parent.lastChild; } window["_nuclearIndex"] = null; @@ -1548,7 +1549,7 @@ Nuclear._mixObj = function (obj) { var item = this._nuclearRenderInfo, rpLen = item.refreshPart.length; item.tpl = this._nuclearTplGenerator(); if (rpLen > 0) { - var parts = Nuclear.str2Dom(Nuclear.Tpl.render(Nuclear._fixTplIndex(item.tpl), item.data)).querySelectorAll('*[nc-refresh]'); + var parts = Nuclear.str2Dom(Nuclear.Tpl.render(Nuclear._fixEvent(Nuclear._fixTplIndex(item.tpl), this._ncInstanceId), item.data)).querySelectorAll('*[nc-refresh]'); window["_nuclearIndex"] = null; for (var j = 0; j < rpLen; j++) { var part = item.refreshPart[j]; @@ -1562,23 +1563,21 @@ Nuclear._mixObj = function (obj) { this.HTML = this.node.outerHTML; this._nuclearFix(); - //var refLen = this._nuclearRef.length; - //if (refLen > 0) { - // var i = 0; - // for (; i < refLen; i++) { - // var ref = this._nuclearRef[i]; - // ref.node = this.node.querySelector('*[data-nuclearId="' + ref._nuclearId + '"]'); - - // if (ref.onRefresh) ref.onRefresh(); - // if (ref.installed) ref.installed(); - // } - //} } else { this._nuclearRender(item); } } } +Nuclear._fixEvent = function (tpl,instanceId) { + + return tpl.replace(/<[\s\S]*?>/g, function (item) { + return item.replace(/(onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onpause|onplay|onplaying|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onsubmit|onsuspend|ontimeupdate|ontoggle|onvolumechange|onwaiting|onautocomplete|onautocompleteerror|onbeforecopy|onbeforecut|onbeforepaste|oncopy|oncut|onpaste|onsearch|onselectstart|onwheel|onwebkitfullscreenchange|onwebkitfullscreenerror)=('|")/g, function (eventStr) { + return eventStr += "Nuclear.instances[" + instanceId + "]."; + }); + }); +} + Nuclear._fixTplIndex = function (tpl) { //"{{_nuclearIndex}}" return tpl.replace(/{{#[\s\S]*?{{@index}}/g, function (str) { @@ -2066,9 +2065,14 @@ Nuclear._minCanvasObj = function (obj) { Nuclear._nextID = 0; Nuclear.getId = function () { - return Nuclear._nextID++; - + return Nuclear._nextID++; } + +Nuclear._instanceId= 0; +Nuclear.getInstanceId = function () { + return Nuclear._instanceId++; +} +Nuclear.instances = {}; /*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js diff --git a/dist/nuclear.min.js b/dist/nuclear.min.js index 892032400..f4d7d9050 100644 --- a/dist/nuclear.min.js +++ b/dist/nuclear.min.js @@ -3,5 +3,5 @@ * Github: https://github.com/AlloyTeam/Nuclear * MIT Licensed. */ -!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():"function"==typeof define&&define.cmd?define(function(t,n,r){r.exports=e()}):t.$=t.Nuclear=e()}(this,function(){var t=function(){function t(t){return null==t?String(t):B[W.call(t)]||"object"}function e(e){return"function"==t(e)}function n(t){return null!=t&&t==t.window}function r(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function i(e){return"object"==t(e)}function o(t){return i(t)&&!n(t)&&Object.getPrototypeOf(t)==Object.prototype}function s(t){return"number"==typeof t.length}function a(t){return S.call(t,function(t){return null!=t})}function u(t){return t.length>0?T.fn.concat.apply([],t):t}function c(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in j?j[t]:j[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||$[c(t)]?e:e+"px"}function h(t){var e,n;return L[t]||(e=A.createElement(t),A.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),L[t]=n),L[t]}function p(t){return"children"in t?N.call(t.children):T.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function d(t,e,n){for(_ in e)n&&(o(e[_])||J(e[_]))?(o(e[_])&&!o(t[_])&&(t[_]={}),J(e[_])&&!J(t[_])&&(t[_]=[]),d(t[_],e[_],n)):e[_]!==x&&(t[_]=e[_])}function v(t,e){return null==e?T(t):T(t).filter(e)}function g(t,n,r,i){return e(n)?n.call(t,r,i):n}function m(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function y(t,e){var n=t.className||"",r=n&&n.baseVal!==x;return e===x?r?n.baseVal:n:void(r?n.baseVal=e:t.className=e)}function b(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?T.parseJSON(t):t):t}catch(e){return t}}function w(t,e){e(t);for(var n=0,r=t.childNodes.length;r>n;n++)w(t.childNodes[n],e)}var x,_,T,E,P,C,O=[],N=O.slice,S=O.filter,A=window.document,L={},j={},$={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},R=/^\s*<(\w+|!)[^>]*>/,M=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,I=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,k=/^(?:body|html)$/i,D=/([A-Z])/g,H=["val","css","html","text","data","width","height","offset"],F=["after","prepend","before","append"],U=A.createElement("table"),q=A.createElement("tr"),V={tr:A.createElement("tbody"),tbody:U,thead:U,tfoot:U,td:q,th:q,"*":A.createElement("div")},z=/complete|loaded|interactive/,Z=/^[\w-]*$/,B={},W=B.toString,Y={},X=A.createElement("div"),G={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},J=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=X).appendChild(t),r=~Y.qsa(i,e).indexOf(t),o&&X.removeChild(t),r},P=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},C=function(t){return S.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,i,s;return M.test(t)&&(r=T(A.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(I,"<$1>")),e===x&&(e=R.test(t)&&RegExp.$1),e in V||(e="*"),s=V[e],s.innerHTML=""+t,r=T.each(N.call(s.childNodes),function(){s.removeChild(this)})),o(n)&&(i=T(r),T.each(n,function(t,e){H.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},Y.Z=function(t,e){return t=t||[],t.__proto__=T.fn,t.selector=e||"",t},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&R.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==x)return T(n).find(t);r=Y.qsa(A,t)}else{if(e(t))return T(A).ready(t);if(Y.isZ(t))return t;if(J(t))r=a(t);else if(i(t))r=[t],t=null;else if(R.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==x)return T(n).find(t);r=Y.qsa(A,t)}}return Y.Z(r,t)},T=function(t,e){return Y.init(t,e)},T.extend=function(t){var e,n=N.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){d(t,n,e)}),t},Y.qsa=function(t,e){var n,i="#"==e[0],o=!i&&"."==e[0],s=i||o?e.slice(1):e,a=Z.test(s);return r(t)&&a&&i?(n=t.getElementById(s))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:N.call(a&&!i?o?t.getElementsByClassName(s):t.getElementsByTagName(e):t.querySelectorAll(e))},T.contains=A.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},T.type=t,T.isFunction=e,T.isWindow=n,T.isArray=J,T.isPlainObject=o,T.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},T.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},T.camelCase=P,T.trim=function(t){return null==t?"":String.prototype.trim.call(t)},T.uuid=0,T.support={},T.expr={},T.map=function(t,e){var n,r,i,o=[];if(s(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):T(S.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return T(C(this.concat(T(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==x)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):s(t)&&e(t.item)?N.call(t):T(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return T(n)},has:function(t){return this.filter(function(){return i(t)?T.contains(this,t):T(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!i(t)?t:T(t)},last:function(){var t=this[this.length-1];return t&&!i(t)?t:T(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?T(t).filter(function(){var t=this;return O.some.call(n,function(e){return T.contains(e,t)})}):1==this.length?T(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):T()},closest:function(t,e){var n=this[0],i=!1;for("object"==typeof t&&(i=T(t));n&&!(i?i.indexOf(n)>=0:Y.matches(n,t));)n=n!==e&&!r(n)&&n.parentNode;return T(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=T.map(n,function(t){return(t=t.parentNode)&&!r(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return v(e,t)},parent:function(t){return v(C(this.pluck("parentNode")),t)},children:function(t){return v(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return N.call(this.childNodes)})},siblings:function(t){return v(this.map(function(t,e){return S.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return T.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=T(t).get(0),i=r.parentNode||this.length>1;return this.each(function(e){T(this).wrapAll(n?t.call(this,e):i?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){T(this[0]).before(t=T(t));for(var e;(e=t.children()).length;)t=e.first();T(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=T(this),i=r.contents(),o=n?t.call(this,e):t;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(){return this.parent().each(function(){T(this).replaceWith(T(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=T(this);(t===x?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return T(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return T(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;T(this).empty().append(g(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=g(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this[0].textContent:null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(i(t))for(_ in t)m(this,_,t[_]);else m(this,t,g(this,e,n,this.getAttribute(t)))}):this.length&&1===this[0].nodeType?!(n=this[0].getAttribute(t))&&t in this[0]?this[0][t]:n:x},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){m(this,t)},this)})},prop:function(t,e){return t=G[t]||t,1 in arguments?this.each(function(n){this[t]=g(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(t,e){var n="data-"+t.replace(D,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?b(r):x},val:function(t){return 0 in arguments?this.each(function(e){this.value=g(this,t,e,this.value)}):this[0]&&(this[0].multiple?T(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=T(this),r=g(this,t,e,n.offset()),i=n.offsetParent().offset(),o={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r,i=this[0];if(!i)return;if(r=getComputedStyle(i,""),"string"==typeof e)return i.style[P(e)]||r.getPropertyValue(e);if(J(e)){var o={};return T.each(e,function(t,e){o[e]=i.style[P(e)]||r.getPropertyValue(e)}),o}}var s="";if("string"==t(e))n||0===n?s=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(_ in e)e[_]||0===e[_]?s+=c(_)+":"+f(_,e[_])+";":this.each(function(){this.style.removeProperty(c(_))});return this.each(function(){this.style.cssText+=";"+s})},index:function(t){return t?this.indexOf(T(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?O.some.call(this,function(t){return this.test(y(t))},l(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){E=[];var n=y(this),r=g(this,t,e,n);r.split(/\s+/g).forEach(function(t){T(this).hasClass(t)||E.push(t)},this),E.length&&y(this,n+(n?" ":"")+E.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===x)return y(this,"");E=y(this),g(this,t,e,E).split(/\s+/g).forEach(function(t){E=E.replace(l(t)," ")}),y(this,E.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=T(this),i=g(this,t,n,y(this));i.split(/\s+/g).forEach(function(t){(e===x?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===x?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===x?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=k.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(T(t).css("margin-top"))||0,n.left-=parseFloat(T(t).css("margin-left"))||0,r.top+=parseFloat(T(e[0]).css("border-top-width"))||0,r.left+=parseFloat(T(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||A.body;t&&!k.test(t.nodeName)&&"static"==T(t).css("position");)t=t.offsetParent;return t})}},T.fn.detach=T.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});T.fn[t]=function(i){var o,s=this[0];return i===x?n(s)?s["inner"+e]:r(s)?s.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){s=T(this),s.css(t,g(this,i,e,s[t]()))})}}),F.forEach(function(e,n){var r=n%2;T.fn[e]=function(){var e,i,o=T.map(arguments,function(n){return e=t(n),"object"==e||"array"==e||null==n?n:Y.fragment(n)}),s=this.length>1;return o.length<1?this:this.each(function(t,e){i=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var a=T.contains(A.documentElement,i);o.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!i)return T(t).remove();i.insertBefore(t,e),a&&w(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},T.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return T(t)[e](this),this}}),Y.Z.prototype=T.fn,Y.uniq=C,Y.deserializeValue=b,T.nuclear=Y,T}();return function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,s){if(n=r(n),n.ns)var a=i(n.ns);return(g[e(t)]||[]).filter(function(t){return!(!t||n.e&&t.e!=n.e||n.ns&&!a.test(t.ns)||o&&e(t.fn)!==e(o)||s&&t.sel!=s)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function i(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in b||!!e}function s(t){return w[t]||y&&b[t]||t}function a(n,i,a,u,l,h,p){var d=e(n),v=g[d]||(g[d]=[]);i.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(a);var i=r(e);i.fn=a,i.sel=l,i.e in w&&(a=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?i.fn.apply(this,arguments):void 0}),i.del=h;var d=h||a;i.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=u;var e=d.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},i.i=v.length,v.push(i),"addEventListener"in n&&n.addEventListener(s(i.e),i.proxy,o(i,p))})}function u(t,r,i,a,u){var c=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,i,a).forEach(function(e){delete g[c][e.i],"removeEventListener"in t&&t.removeEventListener(s(e.e),e.proxy,o(e,u))})})}function c(e,n){return(n||!e.isDefaultPrevented)&&(n||(n=e),t.each(E,function(t,r){var i=n[t];e[t]=function(){return this[r]=x,i&&i.apply(n,arguments)},e[r]=_}),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=x)),e}function l(t){var e,n={originalEvent:t};for(e in t)T.test(e)||t[e]===f||(n[e]=t[e]);return c(n,t)}var f,h=1,p=Array.prototype.slice,d=t.isFunction,v=function(t){return"string"==typeof t},g={},m={},y="onfocusin"in window,b={focus:"focusin",blur:"focusout"},w={mouseenter:"mouseover",mouseleave:"mouseout"};m.click=m.mousedown=m.mouseup=m.mousemove="MouseEvents",t.event={add:a,remove:u},t.proxy=function(n,r){var i=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(r,i?i.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(v(r))return i?(i.unshift(n[r],n),t.proxy.apply(null,i)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var x=function(){return!0},_=function(){return!1},T=/^([A-Z]|returnValue$|layer[XY]$)/,E={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,i,o){var s,c,h=this;return e&&!v(e)?(t.each(e,function(t,e){h.on(t,n,r,e,o)}),h):(v(n)||d(i)||i===!1||(i=r,r=n,n=f),(d(r)||r===!1)&&(i=r,r=f),i===!1&&(i=_),h.each(function(f,h){o&&(s=function(t){return u(h,t.type,i),i.apply(this,arguments)}),n&&(c=function(e){var r,o=t(e.target).closest(n,h).get(0);return o&&o!==h?(r=t.extend(l(e),{currentTarget:o,liveFired:h}),(s||i).apply(o,[r].concat(p.call(arguments,1)))):void 0}),a(h,e,i,r,n,c||s)}))},t.fn.off=function(e,n,r){var i=this;return e&&!v(e)?(t.each(e,function(t,e){i.off(t,n,e)}),i):(v(n)||d(r)||r===!1||(r=n,n=f),r===!1&&(r=_),i.each(function(){u(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=v(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in b&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var i,o;return this.each(function(s,a){i=l(v(e)?t.Event(e):e),i._args=r,i.target=a,t.each(n(a,e.type||e),function(t,e){return o=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){v(t)||(e=t,t=e.type);var n=document.createEvent(m[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),c(n)}}(t),function(t){"__proto__"in{}||t.extend(t.nuclear,{Z:function(e,n){return e=e||[],t.extend(e,t.fn),e.selector=n||"",e.__Z=!0,e},isZ:function(e){return"array"===t.type(e)&&"__Z"in e}});try{getComputedStyle(void 0)}catch(e){var n=getComputedStyle;window.getComputedStyle=function(t){try{return n(t)}catch(e){return null}}}}(t),function(t){function e(t,e,n,r){return Math.abs(t-e)>=Math.abs(n-r)?t-e>0?"Left":"Right":n-r>0?"Up":"Down"}function n(){l=null,h.last&&(h.el.trigger("longTap"),h={})}function r(){l&&clearTimeout(l),l=null}function i(){a&&clearTimeout(a),u&&clearTimeout(u),c&&clearTimeout(c),l&&clearTimeout(l),a=u=c=l=null,h={}}function o(t){return("touch"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function s(t,e){return t.type=="pointer"+e||t.type.toLowerCase()=="mspointer"+e}var a,u,c,l,f,h={},p=750;t(document).ready(function(){var d,v,g,m,y=0,b=0;"MSGesture"in window&&(f=new MSGesture,f.target=document.body),t(document).bind("MSGestureEnd",function(t){var e=t.velocityX>1?"Right":t.velocityX<-1?"Left":t.velocityY>1?"Down":t.velocityY<-1?"Up":null;e&&(h.el.trigger("swipe"),h.el.trigger("swipe"+e))}).on("touchstart MSPointerDown pointerdown",function(e){(!(m=s(e,"down"))||o(e))&&(g=m?e:e.touches[0],e.touches&&1===e.touches.length&&h.x2&&(h.x2=void 0,h.y2=void 0),d=Date.now(),v=d-(h.last||d),h.el=t("tagName"in g.target?g.target:g.target.parentNode),a&&clearTimeout(a),h.x1=g.pageX,h.y1=g.pageY,v>0&&250>=v&&(h.isDoubleTap=!0),h.last=d,l=setTimeout(n,p),f&&m&&f.addPointer(e.pointerId))}).on("touchmove MSPointerMove pointermove",function(t){(!(m=s(t,"move"))||o(t))&&(g=m?t:t.touches[0],r(),h.x2=g.pageX,h.y2=g.pageY,y+=Math.abs(h.x1-h.x2),b+=Math.abs(h.y1-h.y2))}).on("touchend MSPointerUp pointerup",function(n){(!(m=s(n,"up"))||o(n))&&(r(),h.x2&&Math.abs(h.x1-h.x2)>30||h.y2&&Math.abs(h.y1-h.y2)>30?c=setTimeout(function(){h.el.trigger("swipe"),h.el.trigger("swipe"+e(h.x1,h.x2,h.y1,h.y2)),h={}},0):"last"in h&&(30>y&&30>b?u=setTimeout(function(){var e=t.Event("tap");e.cancelTouch=i,h.el.trigger(e),h.isDoubleTap?(h.el&&h.el.trigger("doubleTap"),h={}):a=setTimeout(function(){a=null,h.el&&h.el.trigger("singleTap"),h={}},250)},0):h={}),y=b=0)}).on("touchcancel MSPointerCancel pointercancel",i),t(window).on("scroll",i)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(t),t.create=function(e){return t._mixObj(e),e.statics||(e.statics={}),e.statics.create=function(e){return t._mixObj(e),this.extend(e)},t.Class.extend(e)},t._mixObj=function(e){e.ctor=function(e,n){this._nuclearParentEmpty=!n,this.HTML="",this.option=e,this.parent=this._nuclearParentEmpty?document.createElement("div"):"string"==typeof n?document.querySelector(n):n,this.install&&this.install(),this._nuclearRef=[];for(var r in this)this.hasOwnProperty(r)&&this[r]&&this[r]._nuclearLocalRefresh&&(this[r]._nuclearParent=this,this._nuclearRef.push(this[r]));this._nuclearTimer=null,this._preNuclearTime=new Date,this.option&&t.observe(this.option,function(t,e,n,r){(!this.onOptionChange||this.onOptionChange&&this.onOptionChange(t,e,n,r))&&(clearTimeout(this._nuclearTimer),new Date-this._preNuclearTime>40?(this._nuclearLocalRefresh(),this._preNuclearTime=new Date):this._nuclearTimer=setTimeout(function(){this._nuclearLocalRefresh()}.bind(this),40))}.bind(this)),this._nuclearRenderInfo={tpl:this._nuclearTplGenerator(),data:this.option,parent:this.parent},this.option._nuclearIndex=function(){return++window._nuclearIndex||(window._nuclearIndex=0)},this.option._resetNuclearIndex=function(){window._nuclearIndex=-1},this._nuclearRender(this._nuclearRenderInfo),this.installed&&this.installed()},e.refresh=function(){this._nuclearLocalRefresh()},e.render&&(e._nuclearTplGenerator=e.render),e.render=function(){return this._nuclearParentEmpty?this.HTML:this._nuclearTplGenerator()},e._nuclearRender=function(e){if(this.node)if(t.isUndefined(e.tpl))e.parent.removeChild(this.node),this.node=null,this.HTML="";else{var n=t.str2Dom(t.Tpl.render(t._fixTplIndex(e.tpl),e.data));e.parent.replaceChild(n,this.node),this.node=n}else e.parent.insertAdjacentHTML("beforeEnd",t.Tpl.render(t._fixTplIndex(e.tpl),e.data)),this.node=e.parent.lastChild;window._nuclearIndex=null,this.node&&(this._nuclearId=t.getId(),this.node.setAttribute("data-nuclearId",this._nuclearId),this._mixNode(),this.onRefresh&&this.onRefresh(),e.refreshPart=this.node.querySelectorAll("*[nc-refresh]"),this.HTML=this.node.outerHTML,this._nuclearFix())},e._mixNode=function(){var t=this.node.querySelectorAll("*[nc-id]"),e=t.length;if(e>0)for(var n=0;e>n;n++){var r=t[n];this[r.getAttribute("nc-id")]=r}},e._nuclearFix=function(){this._nuclearParent||this._nuclearFixOne(this)},e._nuclearFixOne=function(t){var e=t._nuclearRef.length;if(e>0)for(var n=0;e>n;n++){var r=t._nuclearRef[n];r.node=t.node.querySelector('*[data-nuclearId="'+r._nuclearId+'"]'),r.node&&(r._mixNode(),r._nuclearRenderInfo.refreshPart=r.node.querySelectorAll("*[nc-refresh]"),r._nuclearRenderInfo.parent=r.node.parentNode,r.onRefresh&&r.onRefresh(),r.installed&&r.installed(),this._nuclearFixOne(r))}},e._nuclearLocalRefresh=function(){var e=this._nuclearRenderInfo,n=e.refreshPart.length;if(e.tpl=this._nuclearTplGenerator(),n>0){var r=t.str2Dom(t.Tpl.render(t._fixTplIndex(e.tpl),e.data)).querySelectorAll("*[nc-refresh]");window._nuclearIndex=null;for(var i=0;n>i;i++){var o=e.refreshPart[i];o.parentNode&&o.parentNode.replaceChild(r[i],o)}e.refreshPart=r,this._mixNode(),this.onRefresh&&this.onRefresh(),this.HTML=this.node.outerHTML,this._nuclearFix()}else this._nuclearRender(e)}},t._fixTplIndex=function(t){return t.replace(/{{#[\s\S]*?{{@index}}/g,function(t){return"{{_resetNuclearIndex}}"+t.replace("{{@index}}","{{_nuclearIndex}}")})},t._minActionObj=function(t){t.ctor=function(t){this.option=t,this.install&&this.install()}},t.createAction=function(e){return t._minActionObj(e),e.statics||(e.statics={}),e.statics.createAction=function(e){return t._minActionObj(e),this.extend(e)},t.Class.extend(e)},t.throttle=function(t,e,n){var r,i,o,s=null,a=0;n||(n={});var u=function(){a=n.leading===!1?0:Date.now(),s=null,o=t.apply(r,i),s||(r=i=null)};return function(){var c=Date.now();a||n.leading!==!1||(a=c);var l=e-(c-a);return r=this,i=arguments,0>=l||l>e?(clearTimeout(s),s=null,a=c,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(u,l)),o}},t.isElement=function(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName},t.str2Dom=function(t){var e={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],body:[0,"",""],_default:[1,"
","
"]};e.optgroup=e.option,e.tbody=e.tfoot=e.colgroup=e.caption=e.thead,e.th=e.td;var n=/<\s*\w.*?>/g.exec(t),r=document.createElement("div");if(null!=n){var i=n[0].replace(//g,"").split(" ")[0];if("body"===i.toLowerCase()){var o=(document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),document.createElement("body"));r.innerHTML=t.replace(//g,"");var s=r.firstChild.attributes;o.innerHTML=t;for(var a=0;a=0?t.removeClass(e,n):t.addClass(e,n)},t.trim=function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},t._iteration=function(e,n){var n=Array.prototype.slice.call(n);t.foreach(n[0],function(r){var i=n[0];n[0]=n[0][r],t[e].apply(t,n),n[0]=i})},t.css=function(e,n,r){return e?t.isNodeList(e)?void t._iteration("css",arguments):(3==arguments.length&&e.style&&(e.style[n]=r),window.getComputedStyle(e,null)[n]):void 0},t.foreach=function(t,e){for(var n=0,r=t.length;r>n;n++)e.call(t[n],n)},t.offset=function(t){var e=0,n=0;if(!document.documentElement.getBoundingClientRect||!t.getBoundingClientRect){for(;t.offsetParent;)e+=t.offsetTop,n+=t.offsetLeft,t=t.offsetParent;return{left:n,top:e}}var r=t.getBoundingClientRect();return n=r.left,e=r.top,{left:n+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),top:e+Math.max(document.documentElement.scrollTop,document.body.scrollTop)}},t.getViewport=function(){var t=document.documentElement,e=document.body,n=window,r=document.createElement("div");r.innerHTML=" ";var i=3!==r.firstChild.nodeType?{left:e.scrollLeft||t.scrollLeft,top:e.scrollTop||t.scrollTop}:{left:n.pageXOffset,top:n.pageYOffset},o=n.innerWidth?{width:n.innerWidth,height:n.innerHeight}:t&&t.clientWidth&&0!=t.clientWidth?{width:t.clientWidth,height:t.clientHeight}:{width:e.clientWidth,height:e.clientHeight};return{left:i.left,top:i.top,width:o.width,height:o.height}},t.getLastNode=function(t,e){var n=t.querySelectorAll(e),r=n.length;return n[r-1]},t.isUndefined=function(t){return"undefined"==typeof t},t.domready=function(){var t,e=[],n=document,r=n.documentElement.doScroll,i="DOMContentLoaded",o=(r?/^loaded|^c/:/^loaded|^i|^c/).test(n.readyState);return o||n.addEventListener(i,t=function(){for(n.removeEventListener(i,t),o=1;t=e.shift();)t()}),function(t){o?setTimeout(t,0):e.push(t)}}(),function(){var e={},n=Object.prototype.toString;"Boolean Number String Function Array Date RegExp Object Error NodeList".split(" ").forEach(function(t){e["[object "+t+"]"]=t.toLowerCase()});var r=function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?e[n.call(t)]||"object":typeof t},i=function(t){return"nodelist"===r(t)},o=function(t){return"function"===r(t)},s=function(t){return"array"===r(t)},a=function(t){return null!=t&&t===t.window},u=function(t){return"object"!==r(t)||t.nodeType||a(t)?!1:t.constructor&&!hasOwn.call(t.constructor.prototype,"isPrototypeOf")?!1:!0};t.type=r,t.isFunction=o,t.isArray=s,t.isWindow=a,t.isPlainObject=u,t.isNodeList=i}(),t.merge=function(){var e,n,r,i,o,s,a=arguments[0]||{},u=1,c=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[u]||{},u++),"object"==typeof a||t.isFunction(a)||(a={}),u===c&&(a=this,u--);c>u;u++)if(null!=(e=arguments[u]))for(n in e)r=a[n],i=e[n],a!==i&&(l&&i&&(t.isPlainObject(i)||(o=t.isArray(i)))?(o?(o=!1,s=r&&t.isArray(r)?r:[]):s=r&&t.isPlainObject(r)?r:{},a[n]=t.merge(l,s,i)):void 0!==i&&(a[n]=i));return a},t.uuid=function(){var t=(new Date).getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)});return e},t.createCanvas=function(e){return t._minCanvasObj(e),e.statics||(e.statics={}),e.statics.create=function(e){return t._minCanvasObj(e),this.extend(e)},t.Class.extend(e)},t._minCanvasObj=function(e){e.ctor=function(e,n,r,i){this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.canvas.width=e,this.canvas.height=n,this.parent="string"==typeof i?document.querySelector(i):i,this.option=r,this.install&&this.install(),this.option&&t.observe(this.option,t.throttle(this._nuclearRender.bind(this),15)),this._nuclearRender(),this.installed&&this.installed(),this.parent.appendChild(this.canvas)},e._nuclearRender=function(t){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.render()}},t._nextID=0,t.getId=function(){return t._nextID++},function(e,n){t.Tpl={},n(t.Tpl)}(this,function(t){function e(t){return"function"==typeof t}function n(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function r(t,e){return d.call(t,e)}function i(t){return!r(v,t)}function o(t){return String(t).replace(/[&<>"'\/]/g,function(t){return g[t]})}function s(e,r){function o(){if(_&&!T)for(;g.length;)delete v[g.pop()]; -else g=[];_=!1,T=!1}function s(t){if("string"==typeof t&&(t=t.split(y,2)),!p(t)||2!==t.length)throw new Error("Invalid tags: "+t);l=new RegExp(n(t[0])+"\\s*"),f=new RegExp("\\s*"+n(t[1])),h=new RegExp("\\s*"+n("}"+t[1]))}if(!e)return[];var l,f,h,d=[],v=[],g=[],_=!1,T=!1;s(r||t.tags);for(var E,P,C,O,N,S,A=new c(e);!A.eos();){if(E=A.pos,C=A.scanUntil(l))for(var L=0,j=C.length;j>L;++L)O=C.charAt(L),i(O)?g.push(v.length):T=!0,v.push(["text",O,E,E+1]),E+=1,"\n"===O&&o();if(!A.scan(l))break;if(_=!0,P=A.scan(x)||"name",A.scan(m),"="===P?(C=A.scanUntil(b),A.scan(b),A.scanUntil(f)):"{"===P?(C=A.scanUntil(h),A.scan(w),A.scanUntil(f),P="&"):C=A.scanUntil(f),!A.scan(f))throw new Error("Unclosed tag at "+A.pos);if(N=[P,C,E,A.pos],v.push(N),"#"===P||"^"===P)d.push(N);else if("/"===P){if(S=d.pop(),!S)throw new Error('Unopened section "'+C+'" at '+E);if(S[1]!==C)throw new Error('Unclosed section "'+S[1]+'" at '+E)}else"name"===P||"{"===P||"&"===P?T=!0:"="===P&&s(C)}if(S=d.pop())throw new Error('Unclosed section "'+S[1]+'" at '+A.pos);return u(a(v))}function a(t){for(var e,n,r=[],i=0,o=t.length;o>i;++i)e=t[i],e&&("text"===e[0]&&n&&"text"===n[0]?(n[1]+=e[1],n[3]=e[3]):(r.push(e),n=e));return r}function u(t){for(var e,n,r=[],i=r,o=[],s=0,a=t.length;a>s;++s)switch(e=t[s],e[0]){case"#":case"^":i.push(e),o.push(e),i=e[4]=[];break;case"/":n=o.pop(),n[5]=e[2],i=o.length>0?o[o.length-1][4]:r;break;default:i.push(e)}return r}function c(t){this.string=t,this.tail=t,this.pos=0}function l(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function f(){this.cache={}}var h=Object.prototype.toString,p=Array.isArray||function(t){return"[object Array]"===h.call(t)},d=RegExp.prototype.test,v=/\S/,g={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},m=/\s*/,y=/\s+/,b=/\s*=/,w=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!/;c.prototype.eos=function(){return""===this.tail},c.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},c.prototype.scanUntil=function(t){var e,n=this.tail.search(t);switch(n){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=e.length,e},l.prototype.push=function(t){return new l(t,this)},l.prototype.lookup=function(t){var n,r=this.cache;if(t in r)n=r[t];else{for(var i,o,s=this,a=!1;s;){if(t.indexOf(".")>0)for(n=s.view,i=t.split("."),o=0;null!=n&&ou;++u)s=void 0,i=t[u],o=i[0],"#"===o?s=this.renderSection(i,e,n,r):"^"===o?s=this.renderInverted(i,e,n,r):">"===o?s=this.renderPartial(i,e,n,r):"&"===o?s=this.unescapedValue(i,e):"name"===o?s=this.escapedValue(i,e):"text"===o&&(s=this.rawValue(i)),void 0!==s&&(a+=s);return a},f.prototype.renderSection=function(t,n,r,i){function o(t){return s.render(t,n,r)}var s=this,a="",u=n.lookup(t[1]);if(u){if(p(u))for(var c=0,l=u.length;l>c;++c)a+=this.renderTokens(t[4],n.push(u[c]),r,i);else if("object"==typeof u||"string"==typeof u||"number"==typeof u)a+=this.renderTokens(t[4],n.push(u),r,i);else if(e(u)){if("string"!=typeof i)throw new Error("Cannot use higher-order sections without the original template");u=u.call(n.view,i.slice(t[3],t[5]),o),null!=u&&(a+=u)}else a+=this.renderTokens(t[4],n,r,i);return a}},f.prototype.renderInverted=function(t,e,n,r){var i=e.lookup(t[1]);return!i||p(i)&&0===i.length?this.renderTokens(t[4],e,n,r):void 0},f.prototype.renderPartial=function(t,n,r){if(r){var i=e(r)?r(t[1]):r[t[1]];return null!=i?this.renderTokens(this.parse(i),n,r,i):void 0}},f.prototype.unescapedValue=function(t,e){var n=e.lookup(t[1]);return null!=n?n:void 0},f.prototype.escapedValue=function(e,n){var r=n.lookup(e[1]);return null!=r?t.escape(r):void 0},f.prototype.rawValue=function(t){return t[1]},t.name="mustache.js",t.version="2.0.0",t.tags=["{{","}}"];var _=new f;t.clearCache=function(){return _.clearCache()},t.parse=function(t,e){return _.parse(t,e)},t.render=function(t,e,n){return _.render(t,e,n)},t.to_html=function(n,r,i,o){var s=t.render(n,r,i);return e(o)?void o(s):s},t.escape=o,t.Scanner=c,t.Context=l,t.Writer=f}),function(){var e=function(t,n,r){var i=function(t,n,r){t.$observer||(t.$observer=this);var i=t.$observer,o=[];e.isArray(t)&&(0===t.length&&(t.$observeProps={},t.$observeProps.$observerPath="#"),i.mock(t));for(var s in t)t.hasOwnProperty(s)&&(r?e.isArray(n)&&e.isInArray(n,s)?(o.push(s),i.watch(t,s)):e.isString(n)&&s==n&&(o.push(s),i.watch(t,s)):(o.push(s),i.watch(t,s)));i.target=t,i.propertyChangedHandler||(i.propertyChangedHandler=[]);var a=r?r:n;i.propertyChangedHandler.push({all:!r,propChanged:a,eventPropArr:o})};return i.prototype={onPropertyChanged:function(t,n,r,i,o){if(n!==r&&this.propertyChangedHandler)for(var s=e._getRootName(t,o),a=0,u=this.propertyChangedHandler.length;u>a;a++){var c=this.propertyChangedHandler[a];(c.all||e.isInArray(c.eventPropArr,s)||0===s.indexOf("Array-"))&&c.propChanged.call(this.target,t,n,r,o)}0!==t.indexOf("Array-")&&"object"==typeof n&&this.watch(i,t,i.$observeProps.$observerPath)},mock:function(t){var n=this;e.methods.forEach(function(r){t[r]=function(){var t=Array.prototype.slice.call(this,0),i=Array.prototype[r].apply(this,Array.prototype.slice.call(arguments));if(new RegExp("\\b"+r+"\\b").test(e.triggerStr)){for(var o in this)this.hasOwnProperty(o)&&!e.isFunction(this[o])&&n.watch(this,o,this.$observeProps.$observerPath);n.onPropertyChanged("Array-"+r,this,t,this,this.$observeProps.$observerPath)}return i}})},watch:function(t,n,r){if("$observeProps"!==n&&"$observer"!==n&&!e.isFunction(t[n])){t.$observeProps||(t.$observeProps={}),t.$observeProps.$observerPath=void 0!==r?r:"#";var i=this,o=t.$observeProps[n]=t[n];if(Object.defineProperty(t,n,{get:function(){return this.$observeProps[n]},set:function(e){var r=this.$observeProps[n];this.$observeProps[n]=e,i.onPropertyChanged(n,e,r,this,t.$observeProps.$observerPath)}}),"object"==typeof o){e.isArray(o)&&(this.mock(o),0===o.length&&(o.$observeProps||(o.$observeProps={}),o.$observeProps.$observerPath=void 0!==r?r:"#"));for(var s in o)o.hasOwnProperty(s)&&this.watch(o,s,t.$observeProps.$observerPath+"-"+n)}}}},new i(t,n,r)};e.methods=["concat","every","filter","forEach","indexOf","join","lastIndexOf","map","pop","push","reduce","reduceRight","reverse","shift","slice","some","sort","splice","unshift","toLocaleString","toString","size"],e.triggerStr=["concat","pop","push","reverse","shift","sort","splice","unshift","size"].join(","),e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isString=function(t){return"string"==typeof t},e.isInArray=function(t,e){for(var n=t.length;--n>-1;)if(e===t[n])return!0;return!1},e.isFunction=function(t){return"[object Function]"==Object.prototype.toString.call(t)},e.twoWay=function(t,n,r,i){"object"==typeof t[n]&&"object"==typeof r[i]?(e(t,n,function(t,e){r[i]=this[n]}),e(r,i,function(e,r){t[n]=this[i]})):(e(t,n,function(t,e){r[i]=e}),e(r,i,function(e,r){t[n]=r}))},e._getRootName=function(t,e){return"#"===e?t:e.split("-")[1]},e.add=function(t,e,n){t[e]=n;var r=t.$observer;r.watch(t,e)},Array.prototype.size=function(t){this.length=t},t.observe=e}(),function(){var e=!1,n=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/,r=function(){};r.extend=function(t){function i(){!e&&this.ctor&&this.ctor.apply(this,arguments)}var o=this.prototype;e=!0;var s=new this;e=!1;for(var a in t)"statics"!=a&&(s[a]="function"==typeof t[a]&&"function"==typeof o[a]&&n.test(t[a])?function(t,e){return function(){var n=this._super;this._super=o[t];var r=e.apply(this,arguments);return this._super=n,r}}(a,t[a]):t[a]);for(var u in this)this.hasOwnProperty(u)&&"extend"!=u&&(i[u]=this[u]);if(i.prototype=s,t.statics)for(var a in t.statics)t.statics.hasOwnProperty(a)&&(i[a]=t.statics[a],"ctor"==a&&i[a]());return i.prototype.constructor=i,i.extend=r.extend,i.implement=function(t){for(var e in t)s[e]=t[e]},i},t.Class=r}(),t}); \ No newline at end of file +!function(t,e){"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?module.exports=e():"function"==typeof define&&define.cmd&&define(function(t,n,r){r.exports=e()}),t.$=t.Nuclear=e()}(this,function(){var t=function(){function t(t){return null==t?String(t):B[W.call(t)]||"object"}function e(e){return"function"==t(e)}function n(t){return null!=t&&t==t.window}function r(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function i(e){return"object"==t(e)}function o(t){return i(t)&&!n(t)&&Object.getPrototypeOf(t)==Object.prototype}function s(t){return"number"==typeof t.length}function a(t){return S.call(t,function(t){return null!=t})}function u(t){return t.length>0?E.fn.concat.apply([],t):t}function c(t){return t.replace(/::/g,"/").replace(/([A-Z]+)([A-Z][a-z])/g,"$1_$2").replace(/([a-z\d])([A-Z])/g,"$1_$2").replace(/_/g,"-").toLowerCase()}function l(t){return t in I?I[t]:I[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||j[c(t)]?e:e+"px"}function h(t){var e,n;return L[t]||(e=A.createElement(t),A.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),L[t]=n),L[t]}function p(t){return"children"in t?N.call(t.children):E.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function d(t,e,n){for(_ in e)n&&(o(e[_])||J(e[_]))?(o(e[_])&&!o(t[_])&&(t[_]={}),J(e[_])&&!J(t[_])&&(t[_]=[]),d(t[_],e[_],n)):e[_]!==x&&(t[_]=e[_])}function g(t,e){return null==e?E(t):E(t).filter(e)}function v(t,n,r,i){return e(n)?n.call(t,r,i):n}function m(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function y(t,e){var n=t.className||"",r=n&&n.baseVal!==x;return e===x?r?n.baseVal:n:void(r?n.baseVal=e:t.className=e)}function b(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?E.parseJSON(t):t):t}catch(e){return t}}function w(t,e){e(t);for(var n=0,r=t.childNodes.length;r>n;n++)w(t.childNodes[n],e)}var x,_,E,T,P,C,O=[],N=O.slice,S=O.filter,A=window.document,L={},I={},j={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},$=/^\s*<(\w+|!)[^>]*>/,R=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,M=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,k=/^(?:body|html)$/i,D=/([A-Z])/g,H=["val","css","html","text","data","width","height","offset"],F=["after","prepend","before","append"],U=A.createElement("table"),q=A.createElement("tr"),z={tr:A.createElement("tbody"),tbody:U,thead:U,tfoot:U,td:q,th:q,"*":A.createElement("div")},V=/complete|loaded|interactive/,Z=/^[\w-]*$/,B={},W=B.toString,Y={},X=A.createElement("div"),G={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},J=Array.isArray||function(t){return t instanceof Array};return Y.matches=function(t,e){if(!e||!t||1!==t.nodeType)return!1;var n=t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var r,i=t.parentNode,o=!i;return o&&(i=X).appendChild(t),r=~Y.qsa(i,e).indexOf(t),o&&X.removeChild(t),r},P=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},C=function(t){return S.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var r,i,s;return R.test(t)&&(r=E(A.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(M,"<$1>")),e===x&&(e=$.test(t)&&RegExp.$1),e in z||(e="*"),s=z[e],s.innerHTML=""+t,r=E.each(N.call(s.childNodes),function(){s.removeChild(this)})),o(n)&&(i=E(r),E.each(n,function(t,e){H.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},Y.Z=function(t,e){return t=t||[],t.__proto__=E.fn,t.selector=e||"",t},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var r;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&$.test(t))r=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==x)return E(n).find(t);r=Y.qsa(A,t)}else{if(e(t))return E(A).ready(t);if(Y.isZ(t))return t;if(J(t))r=a(t);else if(i(t))r=[t],t=null;else if($.test(t))r=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==x)return E(n).find(t);r=Y.qsa(A,t)}}return Y.Z(r,t)},E=function(t,e){return Y.init(t,e)},E.extend=function(t){var e,n=N.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){d(t,n,e)}),t},Y.qsa=function(t,e){var n,i="#"==e[0],o=!i&&"."==e[0],s=i||o?e.slice(1):e,a=Z.test(s);return r(t)&&a&&i?(n=t.getElementById(s))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:N.call(a&&!i?o?t.getElementsByClassName(s):t.getElementsByTagName(e):t.querySelectorAll(e))},E.contains=A.documentElement.contains?function(t,e){return t!==e&&t.contains(e)}:function(t,e){for(;e&&(e=e.parentNode);)if(e===t)return!0;return!1},E.type=t,E.isFunction=e,E.isWindow=n,E.isArray=J,E.isPlainObject=o,E.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},E.inArray=function(t,e,n){return O.indexOf.call(e,t,n)},E.camelCase=P,E.trim=function(t){return null==t?"":String.prototype.trim.call(t)},E.uuid=0,E.support={},E.expr={},E.map=function(t,e){var n,r,i,o=[];if(s(t))for(r=0;r=0?t:t+this.length]},toArray:function(){return this.get()},size:function(){return this.length},remove:function(){return this.each(function(){null!=this.parentNode&&this.parentNode.removeChild(this)})},each:function(t){return O.every.call(this,function(e,n){return t.call(e,n,e)!==!1}),this},filter:function(t){return e(t)?this.not(this.not(t)):E(S.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return E(C(this.concat(E(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==x)this.each(function(e){t.call(this,e)||n.push(this)});else{var r="string"==typeof t?this.filter(t):s(t)&&e(t.item)?N.call(t):E(t);this.forEach(function(t){r.indexOf(t)<0&&n.push(t)})}return E(n)},has:function(t){return this.filter(function(){return i(t)?E.contains(this,t):E(this).find(t).size()})},eq:function(t){return-1===t?this.slice(t):this.slice(t,+t+1)},first:function(){var t=this[0];return t&&!i(t)?t:E(t)},last:function(){var t=this[this.length-1];return t&&!i(t)?t:E(t)},find:function(t){var e,n=this;return e=t?"object"==typeof t?E(t).filter(function(){var t=this;return O.some.call(n,function(e){return E.contains(e,t)})}):1==this.length?E(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):E()},closest:function(t,e){var n=this[0],i=!1;for("object"==typeof t&&(i=E(t));n&&!(i?i.indexOf(n)>=0:Y.matches(n,t));)n=n!==e&&!r(n)&&n.parentNode;return E(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=E.map(n,function(t){return(t=t.parentNode)&&!r(t)&&e.indexOf(t)<0?(e.push(t),t):void 0});return g(e,t)},parent:function(t){return g(C(this.pluck("parentNode")),t)},children:function(t){return g(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return N.call(this.childNodes)})},siblings:function(t){return g(this.map(function(t,e){return S.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return E.map(this,function(e){return e[t]})},show:function(){return this.each(function(){"none"==this.style.display&&(this.style.display=""),"none"==getComputedStyle(this,"").getPropertyValue("display")&&(this.style.display=h(this.nodeName))})},replaceWith:function(t){return this.before(t).remove()},wrap:function(t){var n=e(t);if(this[0]&&!n)var r=E(t).get(0),i=r.parentNode||this.length>1;return this.each(function(e){E(this).wrapAll(n?t.call(this,e):i?r.cloneNode(!0):r)})},wrapAll:function(t){if(this[0]){E(this[0]).before(t=E(t));for(var e;(e=t.children()).length;)t=e.first();E(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var r=E(this),i=r.contents(),o=n?t.call(this,e):t;i.length?i.wrapAll(o):r.append(o)})},unwrap:function(){return this.parent().each(function(){E(this).replaceWith(E(this).children())}),this},clone:function(){return this.map(function(){return this.cloneNode(!0)})},hide:function(){return this.css("display","none")},toggle:function(t){return this.each(function(){var e=E(this);(t===x?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return E(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return E(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;E(this).empty().append(v(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=v(this,t,e,this.textContent);this.textContent=null==n?"":""+n}):0 in this?this[0].textContent:null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(i(t))for(_ in t)m(this,_,t[_]);else m(this,t,v(this,e,n,this.getAttribute(t)))}):this.length&&1===this[0].nodeType?!(n=this[0].getAttribute(t))&&t in this[0]?this[0][t]:n:x},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){m(this,t)},this)})},prop:function(t,e){return t=G[t]||t,1 in arguments?this.each(function(n){this[t]=v(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(t,e){var n="data-"+t.replace(D,"-$1").toLowerCase(),r=1 in arguments?this.attr(n,e):this.attr(n);return null!==r?b(r):x},val:function(t){return 0 in arguments?this.each(function(e){this.value=v(this,t,e,this.value)}):this[0]&&(this[0].multiple?E(this[0]).find("option").filter(function(){return this.selected}).pluck("value"):this[0].value)},offset:function(t){if(t)return this.each(function(e){var n=E(this),r=v(this,t,e,n.offset()),i=n.offsetParent().offset(),o={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;var e=this[0].getBoundingClientRect();return{left:e.left+window.pageXOffset,top:e.top+window.pageYOffset,width:Math.round(e.width),height:Math.round(e.height)}},css:function(e,n){if(arguments.length<2){var r,i=this[0];if(!i)return;if(r=getComputedStyle(i,""),"string"==typeof e)return i.style[P(e)]||r.getPropertyValue(e);if(J(e)){var o={};return E.each(e,function(t,e){o[e]=i.style[P(e)]||r.getPropertyValue(e)}),o}}var s="";if("string"==t(e))n||0===n?s=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(_ in e)e[_]||0===e[_]?s+=c(_)+":"+f(_,e[_])+";":this.each(function(){this.style.removeProperty(c(_))});return this.each(function(){this.style.cssText+=";"+s})},index:function(t){return t?this.indexOf(E(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?O.some.call(this,function(t){return this.test(y(t))},l(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){T=[];var n=y(this),r=v(this,t,e,n);r.split(/\s+/g).forEach(function(t){E(this).hasClass(t)||T.push(t)},this),T.length&&y(this,n+(n?" ":"")+T.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===x)return y(this,"");T=y(this),v(this,t,e,T).split(/\s+/g).forEach(function(t){T=T.replace(l(t)," ")}),y(this,T.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=E(this),i=v(this,t,n,y(this));i.split(/\s+/g).forEach(function(t){(e===x?!r.hasClass(t):e)?r.addClass(t):r.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===x?e?this[0].scrollTop:this[0].pageYOffset:this.each(e?function(){this.scrollTop=t}:function(){this.scrollTo(this.scrollX,t)})}},scrollLeft:function(t){if(this.length){var e="scrollLeft"in this[0];return t===x?e?this[0].scrollLeft:this[0].pageXOffset:this.each(e?function(){this.scrollLeft=t}:function(){this.scrollTo(t,this.scrollY)})}},position:function(){if(this.length){var t=this[0],e=this.offsetParent(),n=this.offset(),r=k.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(E(t).css("margin-top"))||0,n.left-=parseFloat(E(t).css("margin-left"))||0,r.top+=parseFloat(E(e[0]).css("border-top-width"))||0,r.left+=parseFloat(E(e[0]).css("border-left-width"))||0,{top:n.top-r.top,left:n.left-r.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||A.body;t&&!k.test(t.nodeName)&&"static"==E(t).css("position");)t=t.offsetParent;return t})}},E.fn.detach=E.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});E.fn[t]=function(i){var o,s=this[0];return i===x?n(s)?s["inner"+e]:r(s)?s.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){s=E(this),s.css(t,v(this,i,e,s[t]()))})}}),F.forEach(function(e,n){var r=n%2;E.fn[e]=function(){var e,i,o=E.map(arguments,function(n){return e=t(n),"object"==e||"array"==e||null==n?n:Y.fragment(n)}),s=this.length>1;return o.length<1?this:this.each(function(t,e){i=r?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var a=E.contains(A.documentElement,i);o.forEach(function(t){if(s)t=t.cloneNode(!0);else if(!i)return E(t).remove();i.insertBefore(t,e),a&&w(t,function(t){null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src||window.eval.call(window,t.innerHTML)})})})},E.fn[r?e+"To":"insert"+(n?"Before":"After")]=function(t){return E(t)[e](this),this}}),Y.Z.prototype=E.fn,Y.uniq=C,Y.deserializeValue=b,E.nuclear=Y,E}();return function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,s){if(n=r(n),n.ns)var a=i(n.ns);return(v[e(t)]||[]).filter(function(t){return!(!t||n.e&&t.e!=n.e||n.ns&&!a.test(t.ns)||o&&e(t.fn)!==e(o)||s&&t.sel!=s)})}function r(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function i(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in b||!!e}function s(t){return w[t]||y&&b[t]||t}function a(n,i,a,u,l,h,p){var d=e(n),g=v[d]||(v[d]=[]);i.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(a);var i=r(e);i.fn=a,i.sel=l,i.e in w&&(a=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?i.fn.apply(this,arguments):void 0}),i.del=h;var d=h||a;i.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=u;var e=d.apply(n,t._args==f?[t]:[t].concat(t._args));return e===!1&&(t.preventDefault(),t.stopPropagation()),e}},i.i=g.length,g.push(i),"addEventListener"in n&&n.addEventListener(s(i.e),i.proxy,o(i,p))})}function u(t,r,i,a,u){var c=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,i,a).forEach(function(e){delete v[c][e.i],"removeEventListener"in t&&t.removeEventListener(s(e.e),e.proxy,o(e,u))})})}function c(e,n){return(n||!e.isDefaultPrevented)&&(n||(n=e),t.each(T,function(t,r){var i=n[t];e[t]=function(){return this[r]=x,i&&i.apply(n,arguments)},e[r]=_}),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=x)),e}function l(t){var e,n={originalEvent:t};for(e in t)E.test(e)||t[e]===f||(n[e]=t[e]);return c(n,t)}var f,h=1,p=Array.prototype.slice,d=t.isFunction,g=function(t){return"string"==typeof t},v={},m={},y="onfocusin"in window,b={focus:"focusin",blur:"focusout"},w={mouseenter:"mouseover",mouseleave:"mouseout"};m.click=m.mousedown=m.mouseup=m.mousemove="MouseEvents",t.event={add:a,remove:u},t.proxy=function(n,r){var i=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(r,i?i.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(g(r))return i?(i.unshift(n[r],n),t.proxy.apply(null,i)):t.proxy(n[r],n);throw new TypeError("expected function")},t.fn.bind=function(t,e,n){return this.on(t,e,n)},t.fn.unbind=function(t,e){return this.off(t,e)},t.fn.one=function(t,e,n,r){return this.on(t,e,n,r,1)};var x=function(){return!0},_=function(){return!1},E=/^([A-Z]|returnValue$|layer[XY]$)/,T={preventDefault:"isDefaultPrevented",stopImmediatePropagation:"isImmediatePropagationStopped",stopPropagation:"isPropagationStopped"};t.fn.delegate=function(t,e,n){return this.on(e,t,n)},t.fn.undelegate=function(t,e,n){return this.off(e,t,n)},t.fn.live=function(e,n){return t(document.body).delegate(this.selector,e,n),this},t.fn.die=function(e,n){return t(document.body).undelegate(this.selector,e,n),this},t.fn.on=function(e,n,r,i,o){var s,c,h=this;return e&&!g(e)?(t.each(e,function(t,e){h.on(t,n,r,e,o)}),h):(g(n)||d(i)||i===!1||(i=r,r=n,n=f),(d(r)||r===!1)&&(i=r,r=f),i===!1&&(i=_),h.each(function(f,h){o&&(s=function(t){return u(h,t.type,i),i.apply(this,arguments)}),n&&(c=function(e){var r,o=t(e.target).closest(n,h).get(0);return o&&o!==h?(r=t.extend(l(e),{currentTarget:o,liveFired:h}),(s||i).apply(o,[r].concat(p.call(arguments,1)))):void 0}),a(h,e,i,r,n,c||s)}))},t.fn.off=function(e,n,r){var i=this;return e&&!g(e)?(t.each(e,function(t,e){i.off(t,n,e)}),i):(g(n)||d(r)||r===!1||(r=n,n=f),r===!1&&(r=_),i.each(function(){u(this,e,r,n)}))},t.fn.trigger=function(e,n){return e=g(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in b&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,r){var i,o;return this.each(function(s,a){i=l(g(e)?t.Event(e):e),i._args=r,i.target=a,t.each(n(a,e.type||e),function(t,e){return o=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),o},"focusin focusout focus blur load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e){t.fn[e]=function(t){return 0 in arguments?this.bind(e,t):this.trigger(e)}}),t.Event=function(t,e){g(t)||(e=t,t=e.type);var n=document.createEvent(m[t]||"Events"),r=!0;if(e)for(var i in e)"bubbles"==i?r=!!e[i]:n[i]=e[i];return n.initEvent(t,r,!0),c(n)}}(t),function(t){"__proto__"in{}||t.extend(t.nuclear,{Z:function(e,n){return e=e||[],t.extend(e,t.fn),e.selector=n||"",e.__Z=!0,e},isZ:function(e){return"array"===t.type(e)&&"__Z"in e}});try{getComputedStyle(void 0)}catch(e){var n=getComputedStyle;window.getComputedStyle=function(t){try{return n(t)}catch(e){return null}}}}(t),function(t){function e(t,e,n,r){return Math.abs(t-e)>=Math.abs(n-r)?t-e>0?"Left":"Right":n-r>0?"Up":"Down"}function n(){l=null,h.last&&(h.el.trigger("longTap"),h={})}function r(){l&&clearTimeout(l),l=null}function i(){a&&clearTimeout(a),u&&clearTimeout(u),c&&clearTimeout(c),l&&clearTimeout(l),a=u=c=l=null,h={}}function o(t){return("touch"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function s(t,e){return t.type=="pointer"+e||t.type.toLowerCase()=="mspointer"+e}var a,u,c,l,f,h={},p=750;t(document).ready(function(){var d,g,v,m,y=0,b=0;"MSGesture"in window&&(f=new MSGesture,f.target=document.body),t(document).bind("MSGestureEnd",function(t){var e=t.velocityX>1?"Right":t.velocityX<-1?"Left":t.velocityY>1?"Down":t.velocityY<-1?"Up":null;e&&(h.el.trigger("swipe"),h.el.trigger("swipe"+e))}).on("touchstart MSPointerDown pointerdown",function(e){(!(m=s(e,"down"))||o(e))&&(v=m?e:e.touches[0],e.touches&&1===e.touches.length&&h.x2&&(h.x2=void 0,h.y2=void 0),d=Date.now(),g=d-(h.last||d),h.el=t("tagName"in v.target?v.target:v.target.parentNode),a&&clearTimeout(a),h.x1=v.pageX,h.y1=v.pageY,g>0&&250>=g&&(h.isDoubleTap=!0),h.last=d,l=setTimeout(n,p),f&&m&&f.addPointer(e.pointerId))}).on("touchmove MSPointerMove pointermove",function(t){(!(m=s(t,"move"))||o(t))&&(v=m?t:t.touches[0],r(),h.x2=v.pageX,h.y2=v.pageY,y+=Math.abs(h.x1-h.x2),b+=Math.abs(h.y1-h.y2))}).on("touchend MSPointerUp pointerup",function(n){(!(m=s(n,"up"))||o(n))&&(r(),h.x2&&Math.abs(h.x1-h.x2)>30||h.y2&&Math.abs(h.y1-h.y2)>30?c=setTimeout(function(){h.el.trigger("swipe"),h.el.trigger("swipe"+e(h.x1,h.x2,h.y1,h.y2)),h={}},0):"last"in h&&(30>y&&30>b?u=setTimeout(function(){var e=t.Event("tap");e.cancelTouch=i,h.el.trigger(e),h.isDoubleTap?(h.el&&h.el.trigger("doubleTap"),h={}):a=setTimeout(function(){a=null,h.el&&h.el.trigger("singleTap"),h={}},250)},0):h={}),y=b=0)}).on("touchcancel MSPointerCancel pointercancel",i),t(window).on("scroll",i)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(t),t.create=function(e){return t._mixObj(e),e.statics||(e.statics={}),e.statics.create=function(e){return t._mixObj(e),this.extend(e)},t.Class.extend(e)},t._mixObj=function(e){e.ctor=function(e,n){this._ncInstanceId=t.getInstanceId(),t.instances[this._ncInstanceId]=this,this._nuclearParentEmpty=!n,this.HTML="",this.option=e,this.parent=this._nuclearParentEmpty?document.createElement("div"):"string"==typeof n?document.querySelector(n):n,this.install&&this.install(),this._nuclearRef=[];for(var r in this)this.hasOwnProperty(r)&&this[r]&&this[r]._nuclearLocalRefresh&&(this[r]._nuclearParent=this,this._nuclearRef.push(this[r]));this._nuclearTimer=null,this._preNuclearTime=new Date,this.option&&t.observe(this.option,function(t,e,n,r){(!this.onOptionChange||this.onOptionChange&&this.onOptionChange(t,e,n,r))&&(clearTimeout(this._nuclearTimer),new Date-this._preNuclearTime>40?(this._nuclearLocalRefresh(),this._preNuclearTime=new Date):this._nuclearTimer=setTimeout(function(){this._nuclearLocalRefresh()}.bind(this),40))}.bind(this)),this._nuclearRenderInfo={tpl:this._nuclearTplGenerator(),data:this.option,parent:this.parent},this.option._nuclearIndex=function(){return++window._nuclearIndex||(window._nuclearIndex=0)},this.option._resetNuclearIndex=function(){window._nuclearIndex=-1},this._nuclearRender(this._nuclearRenderInfo),this.installed&&this.installed()},e.refresh=function(){this._nuclearLocalRefresh()},e.render&&(e._nuclearTplGenerator=e.render),e.render=function(){return this._nuclearParentEmpty?this.HTML:this._nuclearTplGenerator()},e._nuclearRender=function(e){if(this.node)if(t.isUndefined(e.tpl))e.parent.removeChild(this.node),this.node=null,this.HTML="";else{var n=t.str2Dom(t.Tpl.render(t._fixEvent(t._fixTplIndex(e.tpl),this._ncInstanceId),e.data));e.parent.replaceChild(n,this.node),this.node=n}else e.parent.insertAdjacentHTML("beforeEnd",t.Tpl.render(t._fixEvent(t._fixTplIndex(e.tpl),this._ncInstanceId),e.data)),this.node=e.parent.lastChild;window._nuclearIndex=null,this.node&&(this._nuclearId=t.getId(),this.node.setAttribute("data-nuclearId",this._nuclearId),this._mixNode(),this.onRefresh&&this.onRefresh(),e.refreshPart=this.node.querySelectorAll("*[nc-refresh]"),this.HTML=this.node.outerHTML,this._nuclearFix())},e._mixNode=function(){var t=this.node.querySelectorAll("*[nc-id]"),e=t.length;if(e>0)for(var n=0;e>n;n++){var r=t[n];this[r.getAttribute("nc-id")]=r}},e._nuclearFix=function(){this._nuclearParent||this._nuclearFixOne(this)},e._nuclearFixOne=function(t){var e=t._nuclearRef.length;if(e>0)for(var n=0;e>n;n++){var r=t._nuclearRef[n];r.node=t.node.querySelector('*[data-nuclearId="'+r._nuclearId+'"]'),r.node&&(r._mixNode(),r._nuclearRenderInfo.refreshPart=r.node.querySelectorAll("*[nc-refresh]"),r._nuclearRenderInfo.parent=r.node.parentNode,r.onRefresh&&r.onRefresh(),r.installed&&r.installed(),this._nuclearFixOne(r))}},e._nuclearLocalRefresh=function(){var e=this._nuclearRenderInfo,n=e.refreshPart.length;if(e.tpl=this._nuclearTplGenerator(),n>0){var r=t.str2Dom(t.Tpl.render(t._fixEvent(t._fixTplIndex(e.tpl),this._ncInstanceId),e.data)).querySelectorAll("*[nc-refresh]");window._nuclearIndex=null;for(var i=0;n>i;i++){var o=e.refreshPart[i];o.parentNode&&o.parentNode.replaceChild(r[i],o)}e.refreshPart=r,this._mixNode(),this.onRefresh&&this.onRefresh(),this.HTML=this.node.outerHTML,this._nuclearFix()}else this._nuclearRender(e)}},t._fixEvent=function(t,e){return t.replace(/<[\s\S]*?>/g,function(t){return t.replace(/(onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onpause|onplay|onplaying|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onsubmit|onsuspend|ontimeupdate|ontoggle|onvolumechange|onwaiting|onautocomplete|onautocompleteerror|onbeforecopy|onbeforecut|onbeforepaste|oncopy|oncut|onpaste|onsearch|onselectstart|onwheel|onwebkitfullscreenchange|onwebkitfullscreenerror)=('|")/g,function(t){return t+="Nuclear.instances["+e+"]."})})},t._fixTplIndex=function(t){return t.replace(/{{#[\s\S]*?{{@index}}/g,function(t){return"{{_resetNuclearIndex}}"+t.replace("{{@index}}","{{_nuclearIndex}}")})},t._minActionObj=function(t){t.ctor=function(t){this.option=t,this.install&&this.install()}},t.createAction=function(e){return t._minActionObj(e),e.statics||(e.statics={}),e.statics.createAction=function(e){return t._minActionObj(e),this.extend(e)},t.Class.extend(e)},t.throttle=function(t,e,n){var r,i,o,s=null,a=0;n||(n={});var u=function(){a=n.leading===!1?0:Date.now(),s=null,o=t.apply(r,i),s||(r=i=null)};return function(){var c=Date.now();a||n.leading!==!1||(a=c);var l=e-(c-a);return r=this,i=arguments,0>=l||l>e?(clearTimeout(s),s=null,a=c,o=t.apply(r,i),s||(r=i=null)):s||n.trailing===!1||(s=setTimeout(u,l)),o}},t.isElement=function(t){return"object"==typeof HTMLElement?t instanceof HTMLElement:t&&"object"==typeof t&&null!==t&&1===t.nodeType&&"string"==typeof t.nodeName},t.str2Dom=function(t){var e={option:[1,""],legend:[1,"
","
"],area:[1,"",""],param:[1,"",""],thead:[1,"","
"],tr:[2,"","
"],col:[2,"","
"],td:[3,"","
"],body:[0,"",""],_default:[1,"
","
"]};e.optgroup=e.option,e.tbody=e.tfoot=e.colgroup=e.caption=e.thead,e.th=e.td;var n=/<\s*\w.*?>/g.exec(t),r=document.createElement("div");if(null!=n){var i=n[0].replace(//g,"").split(" ")[0];if("body"===i.toLowerCase()){var o=(document.implementation.createDocument("http://www.w3.org/1999/xhtml","html",null),document.createElement("body"));r.innerHTML=t.replace(//g,"");var s=r.firstChild.attributes;o.innerHTML=t;for(var a=0;a=0?t.removeClass(e,n):t.addClass(e,n)},t.trim=function(t){return t.replace(/^\s\s*/,"").replace(/\s\s*$/,"")},t._iteration=function(e,n){var n=Array.prototype.slice.call(n);t.foreach(n[0],function(r){var i=n[0];n[0]=n[0][r],t[e].apply(t,n),n[0]=i})},t.css=function(e,n,r){return e?t.isNodeList(e)?void t._iteration("css",arguments):(3==arguments.length&&e.style&&(e.style[n]=r),window.getComputedStyle(e,null)[n]):void 0},t.foreach=function(t,e){for(var n=0,r=t.length;r>n;n++)e.call(t[n],n)},t.offset=function(t){var e=0,n=0;if(!document.documentElement.getBoundingClientRect||!t.getBoundingClientRect){for(;t.offsetParent;)e+=t.offsetTop,n+=t.offsetLeft,t=t.offsetParent;return{left:n,top:e}}var r=t.getBoundingClientRect();return n=r.left,e=r.top,{left:n+Math.max(document.documentElement.scrollLeft,document.body.scrollLeft),top:e+Math.max(document.documentElement.scrollTop,document.body.scrollTop)}},t.getViewport=function(){var t=document.documentElement,e=document.body,n=window,r=document.createElement("div");r.innerHTML=" ";var i=3!==r.firstChild.nodeType?{left:e.scrollLeft||t.scrollLeft,top:e.scrollTop||t.scrollTop}:{left:n.pageXOffset,top:n.pageYOffset},o=n.innerWidth?{width:n.innerWidth,height:n.innerHeight}:t&&t.clientWidth&&0!=t.clientWidth?{width:t.clientWidth,height:t.clientHeight}:{width:e.clientWidth,height:e.clientHeight};return{left:i.left,top:i.top,width:o.width,height:o.height}},t.getLastNode=function(t,e){var n=t.querySelectorAll(e),r=n.length;return n[r-1]},t.isUndefined=function(t){return"undefined"==typeof t},t.domready=function(){var t,e=[],n=document,r=n.documentElement.doScroll,i="DOMContentLoaded",o=(r?/^loaded|^c/:/^loaded|^i|^c/).test(n.readyState);return o||n.addEventListener(i,t=function(){for(n.removeEventListener(i,t),o=1;t=e.shift();)t()}),function(t){o?setTimeout(t,0):e.push(t)}}(),function(){var e={},n=Object.prototype.toString;"Boolean Number String Function Array Date RegExp Object Error NodeList".split(" ").forEach(function(t){e["[object "+t+"]"]=t.toLowerCase()});var r=function(t){return null==t?t+"":"object"==typeof t||"function"==typeof t?e[n.call(t)]||"object":typeof t},i=function(t){return"nodelist"===r(t)},o=function(t){return"function"===r(t)},s=function(t){return"array"===r(t)},a=function(t){return null!=t&&t===t.window},u=function(t){return"object"!==r(t)||t.nodeType||a(t)?!1:t.constructor&&!hasOwn.call(t.constructor.prototype,"isPrototypeOf")?!1:!0};t.type=r,t.isFunction=o,t.isArray=s,t.isWindow=a,t.isPlainObject=u,t.isNodeList=i}(),t.merge=function(){var e,n,r,i,o,s,a=arguments[0]||{},u=1,c=arguments.length,l=!1;for("boolean"==typeof a&&(l=a,a=arguments[u]||{},u++),"object"==typeof a||t.isFunction(a)||(a={}),u===c&&(a=this,u--);c>u;u++)if(null!=(e=arguments[u]))for(n in e)r=a[n],i=e[n],a!==i&&(l&&i&&(t.isPlainObject(i)||(o=t.isArray(i)))?(o?(o=!1,s=r&&t.isArray(r)?r:[]):s=r&&t.isPlainObject(r)?r:{},a[n]=t.merge(l,s,i)):void 0!==i&&(a[n]=i));return a},t.uuid=function(){var t=(new Date).getTime(),e="xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,function(e){var n=(t+16*Math.random())%16|0;return t=Math.floor(t/16),("x"==e?n:3&n|8).toString(16)});return e},t.createCanvas=function(e){ +return t._minCanvasObj(e),e.statics||(e.statics={}),e.statics.create=function(e){return t._minCanvasObj(e),this.extend(e)},t.Class.extend(e)},t._minCanvasObj=function(e){e.ctor=function(e,n,r,i){this.canvas=document.createElement("canvas"),this.ctx=this.canvas.getContext("2d"),this.canvas.width=e,this.canvas.height=n,this.parent="string"==typeof i?document.querySelector(i):i,this.option=r,this.install&&this.install(),this.option&&t.observe(this.option,t.throttle(this._nuclearRender.bind(this),15)),this._nuclearRender(),this.installed&&this.installed(),this.parent.appendChild(this.canvas)},e._nuclearRender=function(t){this.ctx.clearRect(0,0,this.canvas.width,this.canvas.height),this.render()}},t._nextID=0,t.getId=function(){return t._nextID++},t._instanceId=0,t.getInstanceId=function(){return t._instanceId++},t.instances={},function(e,n){t.Tpl={},n(t.Tpl)}(this,function(t){function e(t){return"function"==typeof t}function n(t){return t.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}function r(t,e){return d.call(t,e)}function i(t){return!r(g,t)}function o(t){return String(t).replace(/[&<>"'\/]/g,function(t){return v[t]})}function s(e,r){function o(){if(_&&!E)for(;v.length;)delete g[v.pop()];else v=[];_=!1,E=!1}function s(t){if("string"==typeof t&&(t=t.split(y,2)),!p(t)||2!==t.length)throw new Error("Invalid tags: "+t);l=new RegExp(n(t[0])+"\\s*"),f=new RegExp("\\s*"+n(t[1])),h=new RegExp("\\s*"+n("}"+t[1]))}if(!e)return[];var l,f,h,d=[],g=[],v=[],_=!1,E=!1;s(r||t.tags);for(var T,P,C,O,N,S,A=new c(e);!A.eos();){if(T=A.pos,C=A.scanUntil(l))for(var L=0,I=C.length;I>L;++L)O=C.charAt(L),i(O)?v.push(g.length):E=!0,g.push(["text",O,T,T+1]),T+=1,"\n"===O&&o();if(!A.scan(l))break;if(_=!0,P=A.scan(x)||"name",A.scan(m),"="===P?(C=A.scanUntil(b),A.scan(b),A.scanUntil(f)):"{"===P?(C=A.scanUntil(h),A.scan(w),A.scanUntil(f),P="&"):C=A.scanUntil(f),!A.scan(f))throw new Error("Unclosed tag at "+A.pos);if(N=[P,C,T,A.pos],g.push(N),"#"===P||"^"===P)d.push(N);else if("/"===P){if(S=d.pop(),!S)throw new Error('Unopened section "'+C+'" at '+T);if(S[1]!==C)throw new Error('Unclosed section "'+S[1]+'" at '+T)}else"name"===P||"{"===P||"&"===P?E=!0:"="===P&&s(C)}if(S=d.pop())throw new Error('Unclosed section "'+S[1]+'" at '+A.pos);return u(a(g))}function a(t){for(var e,n,r=[],i=0,o=t.length;o>i;++i)e=t[i],e&&("text"===e[0]&&n&&"text"===n[0]?(n[1]+=e[1],n[3]=e[3]):(r.push(e),n=e));return r}function u(t){for(var e,n,r=[],i=r,o=[],s=0,a=t.length;a>s;++s)switch(e=t[s],e[0]){case"#":case"^":i.push(e),o.push(e),i=e[4]=[];break;case"/":n=o.pop(),n[5]=e[2],i=o.length>0?o[o.length-1][4]:r;break;default:i.push(e)}return r}function c(t){this.string=t,this.tail=t,this.pos=0}function l(t,e){this.view=t,this.cache={".":this.view},this.parent=e}function f(){this.cache={}}var h=Object.prototype.toString,p=Array.isArray||function(t){return"[object Array]"===h.call(t)},d=RegExp.prototype.test,g=/\S/,v={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"},m=/\s*/,y=/\s+/,b=/\s*=/,w=/\s*\}/,x=/#|\^|\/|>|\{|&|=|!/;c.prototype.eos=function(){return""===this.tail},c.prototype.scan=function(t){var e=this.tail.match(t);if(!e||0!==e.index)return"";var n=e[0];return this.tail=this.tail.substring(n.length),this.pos+=n.length,n},c.prototype.scanUntil=function(t){var e,n=this.tail.search(t);switch(n){case-1:e=this.tail,this.tail="";break;case 0:e="";break;default:e=this.tail.substring(0,n),this.tail=this.tail.substring(n)}return this.pos+=e.length,e},l.prototype.push=function(t){return new l(t,this)},l.prototype.lookup=function(t){var n,r=this.cache;if(t in r)n=r[t];else{for(var i,o,s=this,a=!1;s;){if(t.indexOf(".")>0)for(n=s.view,i=t.split("."),o=0;null!=n&&ou;++u)s=void 0,i=t[u],o=i[0],"#"===o?s=this.renderSection(i,e,n,r):"^"===o?s=this.renderInverted(i,e,n,r):">"===o?s=this.renderPartial(i,e,n,r):"&"===o?s=this.unescapedValue(i,e):"name"===o?s=this.escapedValue(i,e):"text"===o&&(s=this.rawValue(i)),void 0!==s&&(a+=s);return a},f.prototype.renderSection=function(t,n,r,i){function o(t){return s.render(t,n,r)}var s=this,a="",u=n.lookup(t[1]);if(u){if(p(u))for(var c=0,l=u.length;l>c;++c)a+=this.renderTokens(t[4],n.push(u[c]),r,i);else if("object"==typeof u||"string"==typeof u||"number"==typeof u)a+=this.renderTokens(t[4],n.push(u),r,i);else if(e(u)){if("string"!=typeof i)throw new Error("Cannot use higher-order sections without the original template");u=u.call(n.view,i.slice(t[3],t[5]),o),null!=u&&(a+=u)}else a+=this.renderTokens(t[4],n,r,i);return a}},f.prototype.renderInverted=function(t,e,n,r){var i=e.lookup(t[1]);return!i||p(i)&&0===i.length?this.renderTokens(t[4],e,n,r):void 0},f.prototype.renderPartial=function(t,n,r){if(r){var i=e(r)?r(t[1]):r[t[1]];return null!=i?this.renderTokens(this.parse(i),n,r,i):void 0}},f.prototype.unescapedValue=function(t,e){var n=e.lookup(t[1]);return null!=n?n:void 0},f.prototype.escapedValue=function(e,n){var r=n.lookup(e[1]);return null!=r?t.escape(r):void 0},f.prototype.rawValue=function(t){return t[1]},t.name="mustache.js",t.version="2.0.0",t.tags=["{{","}}"];var _=new f;t.clearCache=function(){return _.clearCache()},t.parse=function(t,e){return _.parse(t,e)},t.render=function(t,e,n){return _.render(t,e,n)},t.to_html=function(n,r,i,o){var s=t.render(n,r,i);return e(o)?void o(s):s},t.escape=o,t.Scanner=c,t.Context=l,t.Writer=f}),function(){var e=function(t,n,r){var i=function(t,n,r){t.$observer||(t.$observer=this);var i=t.$observer,o=[];e.isArray(t)&&(0===t.length&&(t.$observeProps={},t.$observeProps.$observerPath="#"),i.mock(t));for(var s in t)t.hasOwnProperty(s)&&(r?e.isArray(n)&&e.isInArray(n,s)?(o.push(s),i.watch(t,s)):e.isString(n)&&s==n&&(o.push(s),i.watch(t,s)):(o.push(s),i.watch(t,s)));i.target=t,i.propertyChangedHandler||(i.propertyChangedHandler=[]);var a=r?r:n;i.propertyChangedHandler.push({all:!r,propChanged:a,eventPropArr:o})};return i.prototype={onPropertyChanged:function(t,n,r,i,o){if(n!==r&&this.propertyChangedHandler)for(var s=e._getRootName(t,o),a=0,u=this.propertyChangedHandler.length;u>a;a++){var c=this.propertyChangedHandler[a];(c.all||e.isInArray(c.eventPropArr,s)||0===s.indexOf("Array-"))&&c.propChanged.call(this.target,t,n,r,o)}0!==t.indexOf("Array-")&&"object"==typeof n&&this.watch(i,t,i.$observeProps.$observerPath)},mock:function(t){var n=this;e.methods.forEach(function(r){t[r]=function(){var t=Array.prototype.slice.call(this,0),i=Array.prototype[r].apply(this,Array.prototype.slice.call(arguments));if(new RegExp("\\b"+r+"\\b").test(e.triggerStr)){for(var o in this)this.hasOwnProperty(o)&&!e.isFunction(this[o])&&n.watch(this,o,this.$observeProps.$observerPath);n.onPropertyChanged("Array-"+r,this,t,this,this.$observeProps.$observerPath)}return i}})},watch:function(t,n,r){if("$observeProps"!==n&&"$observer"!==n&&!e.isFunction(t[n])){t.$observeProps||(t.$observeProps={}),t.$observeProps.$observerPath=void 0!==r?r:"#";var i=this,o=t.$observeProps[n]=t[n];if(Object.defineProperty(t,n,{get:function(){return this.$observeProps[n]},set:function(e){var r=this.$observeProps[n];this.$observeProps[n]=e,i.onPropertyChanged(n,e,r,this,t.$observeProps.$observerPath)}}),"object"==typeof o){e.isArray(o)&&(this.mock(o),0===o.length&&(o.$observeProps||(o.$observeProps={}),o.$observeProps.$observerPath=void 0!==r?r:"#"));for(var s in o)o.hasOwnProperty(s)&&this.watch(o,s,t.$observeProps.$observerPath+"-"+n)}}}},new i(t,n,r)};e.methods=["concat","every","filter","forEach","indexOf","join","lastIndexOf","map","pop","push","reduce","reduceRight","reverse","shift","slice","some","sort","splice","unshift","toLocaleString","toString","size"],e.triggerStr=["concat","pop","push","reverse","shift","sort","splice","unshift","size"].join(","),e.isArray=function(t){return"[object Array]"===Object.prototype.toString.call(t)},e.isString=function(t){return"string"==typeof t},e.isInArray=function(t,e){for(var n=t.length;--n>-1;)if(e===t[n])return!0;return!1},e.isFunction=function(t){return"[object Function]"==Object.prototype.toString.call(t)},e.twoWay=function(t,n,r,i){"object"==typeof t[n]&&"object"==typeof r[i]?(e(t,n,function(t,e){r[i]=this[n]}),e(r,i,function(e,r){t[n]=this[i]})):(e(t,n,function(t,e){r[i]=e}),e(r,i,function(e,r){t[n]=r}))},e._getRootName=function(t,e){return"#"===e?t:e.split("-")[1]},e.add=function(t,e,n){t[e]=n;var r=t.$observer;r.watch(t,e)},Array.prototype.size=function(t){this.length=t},t.observe=e}(),function(){var e=!1,n=/xyz/.test(function(){xyz})?/\b_super\b/:/.*/,r=function(){};r.extend=function(t){function i(){!e&&this.ctor&&this.ctor.apply(this,arguments)}var o=this.prototype;e=!0;var s=new this;e=!1;for(var a in t)"statics"!=a&&(s[a]="function"==typeof t[a]&&"function"==typeof o[a]&&n.test(t[a])?function(t,e){return function(){var n=this._super;this._super=o[t];var r=e.apply(this,arguments);return this._super=n,r}}(a,t[a]):t[a]);for(var u in this)this.hasOwnProperty(u)&&"extend"!=u&&(i[u]=this[u]);if(i.prototype=s,t.statics)for(var a in t.statics)t.statics.hasOwnProperty(a)&&(i[a]=t.statics[a],"ctor"==a&&i[a]());return i.prototype.constructor=i,i.extend=r.extend,i.implement=function(t){for(var e in t)s[e]=t[e]},i},t.Class=r}(),t}); \ No newline at end of file diff --git a/example/todo.html b/example/todo.html new file mode 100644 index 000000000..4a292435b --- /dev/null +++ b/example/todo.html @@ -0,0 +1,32 @@ + + + + Todo + + +
+ + + + + + + diff --git a/src/core.js b/src/core.js index aa6867151..e8154a5ad 100644 --- a/src/core.js +++ b/src/core.js @@ -10,6 +10,8 @@ Nuclear._mixObj = function (obj) { obj.ctor = function (option, selector) { + this._ncInstanceId=Nuclear.getInstanceId(); + Nuclear.instances[this._ncInstanceId] = this; this._nuclearParentEmpty = !selector; this.HTML = ""; this.option = option; @@ -104,12 +106,12 @@ Nuclear._mixObj = function (obj) { this.node = null; this.HTML = ""; } else { - var newNode = Nuclear.str2Dom(Nuclear.Tpl.render(Nuclear._fixTplIndex(item.tpl), item.data)); + var newNode = Nuclear.str2Dom(Nuclear.Tpl.render(Nuclear._fixEvent(Nuclear._fixTplIndex(item.tpl), this._ncInstanceId), item.data)); item.parent.replaceChild(newNode, this.node); this.node = newNode; } } else { - item.parent.insertAdjacentHTML("beforeEnd", Nuclear.Tpl.render(Nuclear._fixTplIndex(item.tpl), item.data)); + item.parent.insertAdjacentHTML("beforeEnd", Nuclear.Tpl.render(Nuclear._fixEvent(Nuclear._fixTplIndex(item.tpl), this._ncInstanceId), item.data)); this.node = item.parent.lastChild; } window["_nuclearIndex"] = null; @@ -169,7 +171,7 @@ Nuclear._mixObj = function (obj) { var item = this._nuclearRenderInfo, rpLen = item.refreshPart.length; item.tpl = this._nuclearTplGenerator(); if (rpLen > 0) { - var parts = Nuclear.str2Dom(Nuclear.Tpl.render(Nuclear._fixTplIndex(item.tpl), item.data)).querySelectorAll('*[nc-refresh]'); + var parts = Nuclear.str2Dom(Nuclear.Tpl.render(Nuclear._fixEvent(Nuclear._fixTplIndex(item.tpl), this._ncInstanceId), item.data)).querySelectorAll('*[nc-refresh]'); window["_nuclearIndex"] = null; for (var j = 0; j < rpLen; j++) { var part = item.refreshPart[j]; @@ -183,23 +185,21 @@ Nuclear._mixObj = function (obj) { this.HTML = this.node.outerHTML; this._nuclearFix(); - //var refLen = this._nuclearRef.length; - //if (refLen > 0) { - // var i = 0; - // for (; i < refLen; i++) { - // var ref = this._nuclearRef[i]; - // ref.node = this.node.querySelector('*[data-nuclearId="' + ref._nuclearId + '"]'); - - // if (ref.onRefresh) ref.onRefresh(); - // if (ref.installed) ref.installed(); - // } - //} } else { this._nuclearRender(item); } } } +Nuclear._fixEvent = function (tpl,instanceId) { + + return tpl.replace(/<[\s\S]*?>/g, function (item) { + return item.replace(/(onabort|onblur|oncancel|oncanplay|oncanplaythrough|onchange|onclick|onclose|oncontextmenu|oncuechange|ondblclick|ondrag|ondragend|ondragenter|ondragleave|ondragover|ondragstart|ondrop|ondurationchange|onemptied|onended|onerror|onfocus|oninput|oninvalid|onkeydown|onkeypress|onkeyup|onload|onloadeddata|onloadedmetadata|onloadstart|onmousedown|onmouseenter|onmouseleave|onmousemove|onmouseout|onmouseover|onmouseup|onmousewheel|onpause|onplay|onplaying|onprogress|onratechange|onreset|onresize|onscroll|onseeked|onseeking|onselect|onshow|onstalled|onsubmit|onsuspend|ontimeupdate|ontoggle|onvolumechange|onwaiting|onautocomplete|onautocompleteerror|onbeforecopy|onbeforecut|onbeforepaste|oncopy|oncut|onpaste|onsearch|onselectstart|onwheel|onwebkitfullscreenchange|onwebkitfullscreenerror)=('|")/g, function (eventStr) { + return eventStr += "Nuclear.instances[" + instanceId + "]."; + }); + }); +} + Nuclear._fixTplIndex = function (tpl) { //"{{_nuclearIndex}}" return tpl.replace(/{{#[\s\S]*?{{@index}}/g, function (str) { @@ -687,6 +687,11 @@ Nuclear._minCanvasObj = function (obj) { Nuclear._nextID = 0; Nuclear.getId = function () { - return Nuclear._nextID++; - -} \ No newline at end of file + return Nuclear._nextID++; +} + +Nuclear._instanceId= 0; +Nuclear.getInstanceId = function () { + return Nuclear._instanceId++; +} +Nuclear.instances = {}; \ No newline at end of file diff --git a/src/intro.js b/src/intro.js index 0cac68030..bd8de3a0a 100644 --- a/src/intro.js +++ b/src/intro.js @@ -12,7 +12,6 @@ define(function(require, exports, module){ module.exports=factory(); }); - } else { - root.$ = root.Nuclear = factory(); } + root.$ = root.Nuclear = factory(); }(this, function () {