7 lines
47 KiB
JavaScript
7 lines
47 KiB
JavaScript
/*!
|
|
* mzui - v1.0.0 - 2016-07-13
|
|
* Copyright (c) 2016 cnezsoft.com; Licensed MIT
|
|
*/
|
|
/*! Zepto v1.1.6 - zeptojs.com/license */
|
|
var Zepto=function(){function t(t){return null==t?String(t):B[X.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 a(t){return i(t)&&!n(t)&&Object.getPrototypeOf(t)==Object.prototype}function o(t){return"number"==typeof t.length}function s(t){return D.call(t,function(t){return null!=t})}function l(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 u(t){return t in L?L[t]:L[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||M[c(t)]?e:e+"px"}function p(t){var e,n;return O[t]||(e=N.createElement(t),N.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),O[t]=n),O[t]}function h(t){return"children"in t?k.call(t.children):T.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function d(t,e,n){for(C in e)n&&(a(e[C])||G(e[C]))?(a(e[C])&&!a(t[C])&&(t[C]={}),G(e[C])&&!G(t[C])&&(t[C]=[]),d(t[C],e[C],n)):e[C]!==x&&(t[C]=e[C])}function g(t,e){return null==e?T(t):T(t).filter(e)}function m(t,n,r,i){return e(n)?n.call(t,r,i):n}function v(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,C,T,E,S,j,$=[],k=$.slice,D=$.filter,N=window.document,O={},L={},M={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},P=/^\s*<(\w+|!)[^>]*>/,A=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,F=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,I=/^(?:body|html)$/i,R=/([A-Z])/g,_=["val","css","html","text","data","width","height","offset"],H=["after","prepend","before","append"],z=N.createElement("table"),Z=N.createElement("tr"),V={tr:N.createElement("tbody"),tbody:z,thead:z,tfoot:z,td:Z,th:Z,"*":N.createElement("div")},U=/complete|loaded|interactive/,q=/^[\w-]*$/,B={},X=B.toString,J={},Y=N.createElement("div"),W={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},G=Array.isArray||function(t){return t instanceof Array};return J.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,a=!i;return a&&(i=Y).appendChild(t),r=~J.qsa(i,e).indexOf(t),a&&Y.removeChild(t),r},S=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},j=function(t){return D.call(t,function(e,n){return t.indexOf(e)==n})},J.fragment=function(t,e,n){var r,i,o;return A.test(t)&&(r=T(N.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(F,"<$1></$2>")),e===x&&(e=P.test(t)&&RegExp.$1),e in V||(e="*"),o=V[e],o.innerHTML=""+t,r=T.each(k.call(o.childNodes),function(){o.removeChild(this)})),a(n)&&(i=T(r),T.each(n,function(t,e){_.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},J.Z=function(t,e){return t=t||[],t.__proto__=T.fn,t.selector=e||"",t},J.isZ=function(t){return t instanceof J.Z},J.init=function(t,n){var r;if(!t)return J.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&P.test(t))r=J.fragment(t,RegExp.$1,n),t=null;else{if(n!==x)return T(n).find(t);r=J.qsa(N,t)}else{if(e(t))return T(N).ready(t);if(J.isZ(t))return t;if(G(t))r=s(t);else if(i(t))r=[t],t=null;else if(P.test(t))r=J.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==x)return T(n).find(t);r=J.qsa(N,t)}}return J.Z(r,t)},T=function(t,e){return J.init(t,e)},T.extend=function(t){var e,n=k.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){d(t,n,e)}),t},J.qsa=function(t,e){var n,i="#"==e[0],a=!i&&"."==e[0],o=i||a?e.slice(1):e,s=q.test(o);return r(t)&&s&&i?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType?[]:k.call(s&&!i?a?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},T.contains=N.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=G,T.isPlainObject=a,T.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},T.inArray=function(t,e,n){return $.indexOf.call(e,t,n)},T.camelCase=S,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,a=[];if(o(t))for(r=0;r<t.length;r++)n=e(t[r],r),null!=n&&a.push(n);else for(i in t)n=e(t[i],i),null!=n&&a.push(n);return l(a)},T.each=function(t,e){var n,r;if(o(t)){for(n=0;n<t.length;n++)if(e.call(t[n],n,t[n])===!1)return t}else for(r in t)if(e.call(t[r],r,t[r])===!1)return t;return t},T.grep=function(t,e){return D.call(t,e)},window.JSON&&(T.parseJSON=JSON.parse),T.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){B["[object "+e+"]"]=e.toLowerCase()}),T.fn={forEach:$.forEach,reduce:$.reduce,push:$.push,sort:$.sort,indexOf:$.indexOf,concat:$.concat,map:function(t){return T(T.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return T(k.apply(this,arguments))},ready:function(t){return U.test(N.readyState)&&N.body?t(T):N.addEventListener("DOMContentLoaded",function(){t(T)},!1),this},get:function(t){return t===x?k.call(this):this[t>=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 $.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(D.call(this,function(e){return J.matches(e,t)}))},add:function(t,e){return T(j(this.concat(T(t,e))))},is:function(t){return this.length>0&&J.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):o(t)&&e(t.item)?k.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 $.some.call(n,function(e){return T.contains(e,t)})}):1==this.length?T(J.qsa(this[0],t)):this.map(function(){return J.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:J.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 g(e,t)},parent:function(t){return g(j(this.pluck("parentNode")),t)},children:function(t){return g(this.map(function(){return h(this)}),t)},contents:function(){return this.map(function(){return k.call(this.childNodes)})},siblings:function(t){return g(this.map(function(t,e){return D.call(h(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=p(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(),a=n?t.call(this,e):t;i.length?i.wrapAll(a):r.append(a)})},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(m(this,t,e,n))}):0 in this?this[0].innerHTML:null},text:function(t){return 0 in arguments?this.each(function(e){var n=m(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(C in t)v(this,C,t[C]);else v(this,t,m(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){v(this,t)},this)})},prop:function(t,e){return t=W[t]||t,1 in arguments?this.each(function(n){this[t]=m(this,e,n,this[t])}):this[0]&&this[0][t]},data:function(t,e){var n="data-"+t.replace(R,"-$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=m(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=m(this,t,e,n.offset()),i=n.offsetParent().offset(),a={top:r.top-i.top,left:r.left-i.left};"static"==n.css("position")&&(a.position="relative"),n.css(a)});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[S(e)]||r.getPropertyValue(e);if(G(e)){var a={};return T.each(e,function(t,e){a[e]=i.style[S(e)]||r.getPropertyValue(e)}),a}}var o="";if("string"==t(e))n||0===n?o=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(C in e)e[C]||0===e[C]?o+=c(C)+":"+f(C,e[C])+";":this.each(function(){this.style.removeProperty(c(C))});return this.each(function(){this.style.cssText+=";"+o})},index:function(t){return t?this.indexOf(T(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return t?$.some.call(this,function(t){return this.test(y(t))},u(t)):!1},addClass:function(t){return t?this.each(function(e){if("className"in this){E=[];var n=y(this),r=m(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),m(this,t,e,E).split(/\s+/g).forEach(function(t){E=E.replace(u(t)," ")}),y(this,E.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var r=T(this),i=m(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=I.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||N.body;t&&!I.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 a,o=this[0];return i===x?n(o)?o["inner"+e]:r(o)?o.documentElement["scroll"+e]:(a=this.offset())&&a[t]:this.each(function(e){o=T(this),o.css(t,m(this,i,e,o[t]()))})}}),H.forEach(function(e,n){var r=n%2;T.fn[e]=function(){var e,i,a=T.map(arguments,function(n){return e=t(n),"object"==e||"array"==e||null==n?n:J.fragment(n)}),o=this.length>1;return a.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 s=T.contains(N.documentElement,i);a.forEach(function(t){if(o)t=t.cloneNode(!0);else if(!i)return T(t).remove();i.insertBefore(t,e),s&&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}}),J.Z.prototype=T.fn,J.uniq=j,J.deserializeValue=b,T.zepto=J,T}();window.Zepto=Zepto,void 0===window.$&&(window.$=Zepto),function(t){function e(t){return t._zid||(t._zid=p++)}function n(t,n,a,o){if(n=r(n),n.ns)var s=i(n.ns);return(m[e(t)]||[]).filter(function(t){return t&&(!n.e||t.e==n.e)&&(!n.ns||s.test(t.ns))&&(!a||e(t.fn)===e(a))&&(!o||t.sel==o)})}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 a(t,e){return t.del&&!y&&t.e in b||!!e}function o(t){return w[t]||y&&b[t]||t}function s(n,i,s,l,u,p,h){var d=e(n),g=m[d]||(m[d]=[]);i.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var i=r(e);i.fn=s,i.sel=u,i.e in w&&(s=function(e){var n=e.relatedTarget;return!n||n!==this&&!t.contains(this,n)?i.fn.apply(this,arguments):void 0}),i.del=p;var d=p||s;i.proxy=function(t){if(t=c(t),!t.isImmediatePropagationStopped()){t.data=l;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(o(i.e),i.proxy,a(i,h))})}function l(t,r,i,s,l){var c=e(t);(r||"").split(/\s/).forEach(function(e){n(t,e,i,s).forEach(function(e){delete m[c][e.i],"removeEventListener"in t&&t.removeEventListener(o(e.e),e.proxy,a(e,l))})})}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]=C}),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?n.returnValue===!1:n.getPreventDefault&&n.getPreventDefault())&&(e.isDefaultPrevented=x)),e}function u(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,p=1,h=Array.prototype.slice,d=t.isFunction,g=function(t){return"string"==typeof t},m={},v={},y="onfocusin"in window,b={focus:"focusin",blur:"focusout"},w={mouseenter:"mouseover",mouseleave:"mouseout"};v.click=v.mousedown=v.mouseup=v.mousemove="MouseEvents",t.event={add:s,remove:l},t.proxy=function(n,r){var i=2 in arguments&&h.call(arguments,2);if(d(n)){var a=function(){return n.apply(r,i?i.concat(h.call(arguments)):arguments)};return a._zid=e(n),a}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},C=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,a){var o,c,p=this;return e&&!g(e)?(t.each(e,function(t,e){p.on(t,n,r,e,a)}),p):(g(n)||d(i)||i===!1||(i=r,r=n,n=f),(d(r)||r===!1)&&(i=r,r=f),i===!1&&(i=C),p.each(function(f,p){a&&(o=function(t){return l(p,t.type,i),i.apply(this,arguments)}),n&&(c=function(e){var r,a=t(e.target).closest(n,p).get(0);return a&&a!==p?(r=t.extend(u(e),{currentTarget:a,liveFired:p}),(o||i).apply(a,[r].concat(h.call(arguments,1)))):void 0}),s(p,e,i,r,n,c||o)}))},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=C),i.each(function(){l(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,a;return this.each(function(o,s){i=u(g(e)?t.Event(e):e),i._args=r,i.target=s,t.each(n(s,e.type||e),function(t,e){return a=e.proxy(i),i.isImmediatePropagationStopped()?!1:void 0})}),a},"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(v[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)}}(Zepto),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(){u=null,p.last&&(p.el.trigger("longTap"),p={})}function r(){u&&clearTimeout(u),u=null}function i(){s&&clearTimeout(s),l&&clearTimeout(l),c&&clearTimeout(c),u&&clearTimeout(u),s=l=c=u=null,p={}}function a(t){return("touch"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function o(t,e){return t.type=="pointer"+e||t.type.toLowerCase()=="mspointer"+e}var s,l,c,u,f,p={},h=750;t(document).ready(function(){var d,g,m,v,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&&(p.el.trigger("swipe"),p.el.trigger("swipe"+e))}).on("touchstart MSPointerDown pointerdown",function(e){(v=o(e,"down"))&&!a(e)||(m=v?e:e.touches[0],e.touches&&1===e.touches.length&&p.x2&&(p.x2=void 0,p.y2=void 0),d=Date.now(),g=d-(p.last||d),p.el=t("tagName"in m.target?m.target:m.target.parentNode),s&&clearTimeout(s),p.x1=m.pageX,p.y1=m.pageY,g>0&&250>=g&&(p.isDoubleTap=!0),p.last=d,u=setTimeout(n,h),f&&v&&f.addPointer(e.pointerId))}).on("touchmove MSPointerMove pointermove",function(t){(v=o(t,"move"))&&!a(t)||(m=v?t:t.touches[0],r(),p.x2=m.pageX,p.y2=m.pageY,y+=Math.abs(p.x1-p.x2),b+=Math.abs(p.y1-p.y2))}).on("touchend MSPointerUp pointerup",function(n){(v=o(n,"up"))&&!a(n)||(r(),p.x2&&Math.abs(p.x1-p.x2)>30||p.y2&&Math.abs(p.y1-p.y2)>30?c=setTimeout(function(){p.el.trigger("swipe"),p.el.trigger("swipe"+e(p.x1,p.x2,p.y1,p.y2)),p={}},0):"last"in p&&(30>y&&30>b?l=setTimeout(function(){var e=t.Event("tap");e.cancelTouch=i,p.el.trigger(e),p.isDoubleTap?(p.el&&p.el.trigger("doubleTap"),p={}):s=setTimeout(function(){s=null,p.el&&p.el.trigger("singleTap"),p={}},250)},0):p={}),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)}})}(Zepto),function(t){function e(e,r){var l=e[s],c=l&&i[l];if(void 0===r)return c||n(e);if(c){if(r in c)return c[r];var u=o(r);if(u in c)return c[u]}return a.call(t(e),r)}function n(e,n,a){var l=e[s]||(e[s]=++t.uuid),c=i[l]||(i[l]=r(e));return void 0!==n&&(c[o(n)]=a),c}function r(e){var n={};return t.each(e.attributes||l,function(e,r){0==r.name.indexOf("data-")&&(n[o(r.name.replace("data-",""))]=t.zepto.deserializeValue(r.value))}),n}var i={},a=t.fn.data,o=t.camelCase,s=t.expando="Zepto"+ +new Date,l=[];t.fn.data=function(r,i){return void 0===i?t.isPlainObject(r)?this.each(function(e,i){t.each(r,function(t,e){n(i,t,e)})}):0 in this?e(this[0],r):void 0:this.each(function(){n(this,r,i)})},t.fn.removeData=function(e){return"string"==typeof e&&(e=e.split(/\s+/)),this.each(function(){var n=this[s],r=n&&i[n];r&&t.each(e||r,function(t){delete r[e?o(this):t]})})},["remove","empty"].forEach(function(e){var n=t.fn[e];t.fn[e]=function(){var t=this.find("*");return"remove"===e&&(t=t.add(this)),t.removeData(),n.call(this)}})}(Zepto),function(t){function e(e,n,r){var i=t.Event(n);return t(e).trigger(i,r),!i.isDefaultPrevented()}function n(t,n,r,i){return t.global?e(n||y,r,i):void 0}function r(e){e.global&&0===t.active++&&n(e,null,"ajaxStart")}function i(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function a(t,e){var r=e.context;return e.beforeSend.call(r,t,e)===!1||n(e,r,"ajaxBeforeSend",[t,e])===!1?!1:void n(e,r,"ajaxSend",[t,e])}function o(t,e,r,i){var a=r.context,o="success";r.success.call(a,t,o,e),i&&i.resolveWith(a,[t,o,e]),n(r,a,"ajaxSuccess",[e,r,t]),l(o,e,r)}function s(t,e,r,i,a){var o=i.context;i.error.call(o,r,e,t),a&&a.rejectWith(o,[r,e,t]),n(i,o,"ajaxError",[r,i,t||e]),l(e,r,i)}function l(t,e,r){var a=r.context;r.complete.call(a,e,t),n(r,a,"ajaxComplete",[e,r]),i(r)}function c(){}function u(t){return t&&(t=t.split(";",2)[0]),t&&(t==T?"html":t==C?"json":w.test(t)?"script":x.test(t)&&"xml")||"text"}function f(t,e){return""==e?t:(t+"&"+e).replace(/[&?]{1,2}/,"?")}function p(e){e.processData&&e.data&&"string"!=t.type(e.data)&&(e.data=t.param(e.data,e.traditional)),!e.data||e.type&&"GET"!=e.type.toUpperCase()||(e.url=f(e.url,e.data),e.data=void 0)}function h(e,n,r,i){return t.isFunction(n)&&(i=r,r=n,n=void 0),t.isFunction(r)||(i=r,r=void 0),{url:e,data:n,success:r,dataType:i}}function d(e,n,r,i){var a,o=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,l){a=t.type(l),i&&(n=r?i:i+"["+(s||"object"==a||"array"==a?n:"")+"]"),!i&&o?e.add(l.name,l.value):"array"==a||!r&&"object"==a?d(e,l,r,n):e.add(n,l)})}var g,m,v=0,y=window.document,b=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,w=/^(?:text|application)\/javascript/i,x=/^(?:text|application)\/xml/i,C="application/json",T="text/html",E=/^\s*$/,S=y.createElement("a");S.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var r,i,l=e.jsonpCallback,c=(t.isFunction(l)?l():l)||"jsonp"+ ++v,u=y.createElement("script"),f=window[c],p=function(e){t(u).triggerHandler("error",e||"abort")},h={abort:p};return n&&n.promise(h),t(u).on("load error",function(a,l){clearTimeout(i),t(u).off().remove(),"error"!=a.type&&r?o(r[0],h,e,n):s(null,l||"error",h,e,n),window[c]=f,r&&t.isFunction(f)&&f(r[0]),f=r=void 0}),a(h,e)===!1?(p("abort"),h):(window[c]=function(){r=arguments},u.src=e.url.replace(/\?(.+)=\?/,"?$1="+c),y.head.appendChild(u),e.timeout>0&&(i=setTimeout(function(){p("timeout")},e.timeout)),h)},t.ajaxSettings={type:"GET",beforeSend:c,success:c,error:c,complete:c,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:C,xml:"application/xml, text/xml",html:T,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0},t.ajax=function(e){var n,i=t.extend({},e||{}),l=t.Deferred&&t.Deferred();for(g in t.ajaxSettings)void 0===i[g]&&(i[g]=t.ajaxSettings[g]);r(i),i.crossDomain||(n=y.createElement("a"),n.href=i.url,n.href=n.href,i.crossDomain=S.protocol+"//"+S.host!=n.protocol+"//"+n.host),i.url||(i.url=window.location.toString()),p(i);var h=i.dataType,d=/\?.+=\?/.test(i.url);if(d&&(h="jsonp"),i.cache!==!1&&(e&&e.cache===!0||"script"!=h&&"jsonp"!=h)||(i.url=f(i.url,"_="+Date.now())),"jsonp"==h)return d||(i.url=f(i.url,i.jsonp?i.jsonp+"=?":i.jsonp===!1?"":"callback=?")),t.ajaxJSONP(i,l);var v,b=i.accepts[h],w={},x=function(t,e){w[t.toLowerCase()]=[t,e]},C=/^([\w-]+:)\/\//.test(i.url)?RegExp.$1:window.location.protocol,T=i.xhr(),j=T.setRequestHeader;if(l&&l.promise(T),i.crossDomain||x("X-Requested-With","XMLHttpRequest"),x("Accept",b||"*/*"),(b=i.mimeType||b)&&(b.indexOf(",")>-1&&(b=b.split(",",2)[0]),T.overrideMimeType&&T.overrideMimeType(b)),(i.contentType||i.contentType!==!1&&i.data&&"GET"!=i.type.toUpperCase())&&x("Content-Type",i.contentType||"application/x-www-form-urlencoded"),i.headers)for(m in i.headers)x(m,i.headers[m]);if(T.setRequestHeader=x,T.onreadystatechange=function(){if(4==T.readyState){T.onreadystatechange=c,clearTimeout(v);var e,n=!1;if(T.status>=200&&T.status<300||304==T.status||0==T.status&&"file:"==C){h=h||u(i.mimeType||T.getResponseHeader("content-type")),e=T.responseText;try{"script"==h?(0,eval)(e):"xml"==h?e=T.responseXML:"json"==h&&(e=E.test(e)?null:t.parseJSON(e))}catch(r){n=r}n?s(n,"parsererror",T,i,l):o(e,T,i,l)}else s(T.statusText||null,T.status?"error":"abort",T,i,l)}},a(T,i)===!1)return T.abort(),s(null,"abort",T,i,l),T;if(i.xhrFields)for(m in i.xhrFields)T[m]=i.xhrFields[m];var $="async"in i?i.async:!0;T.open(i.type,i.url,$,i.username,i.password);for(m in w)j.apply(T,w[m]);return i.timeout>0&&(v=setTimeout(function(){T.onreadystatechange=c,T.abort(),s(null,"timeout",T,i,l)},i.timeout)),T.send(i.data?i.data:null),T},t.get=function(){return t.ajax(h.apply(null,arguments))},t.post=function(){var e=h.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=h.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,r){if(!this.length)return this;var i,a=this,o=e.split(/\s/),s=h(e,n,r),l=s.success;return o.length>1&&(s.url=o[0],i=o[1]),s.success=function(e){a.html(i?t("<div>").html(e.replace(b,"")).find(i):e),l&&l.apply(a,arguments)},t.ajax(s),this};var j=encodeURIComponent;t.param=function(e,n){var r=[];return r.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(j(e)+"="+j(n))},d(r,e,n),r.join("&").replace(/%20/g,"+")}}(Zepto),window.CoreLib=window.jQuery||window.Zepto,!function(t){"use strict";t.callEvent=function(e,n,r,i,a){var o,s=t.Event(e);return i&&(t(i).trigger(s,a),o=s.result),t.isFunction(n)&&(o=n.apply(r,t.isArray(a)?a:[a])),o},t.fn.callEvent=function(e,n,r){return t.callEvent(n,e.options?e.options[n]:null,e,this,r)},t.bindFn=function(e,n,r){var i=t.fn[e],a=n.NAME||"mzui."+e;t.fn[e]=function(e,i){return this.each(function(){var o=t(this),s=o.data(a),l="object"==typeof e&&e;r&&(l=t.extend(l,r)),s||o.data(a,s=new n(o,l)),"string"==typeof e&&s[e].apply(s,t.isArray(i)?i:[i])})},t.fn[e].Constructor=n,t.fn[e].noConflict=function(){return t.fn[e]=i,this}},t.formatDate=function(t,e){t instanceof Date||(t=new Date(t));var n={"M+":t.getMonth()+1,"d+":t.getDate(),"h+":t.getHours(),"m+":t.getMinutes(),"s+":t.getSeconds(),"S+":t.getMilliseconds()};/(y+)/i.test(e)&&(e=e.replace(RegExp.$1,(t.getFullYear()+"").substr(4-RegExp.$1.length)));for(var r in n)new RegExp("("+r+")").test(e)&&(e=e.replace(RegExp.$1,1==RegExp.$1.length?n[r]:("00"+n[r]).substr((""+n[r]).length)));return e},t.format=function(e,n){if(e instanceof Date)return t.formatDate(e,n);if(arguments.length>1){var r;if(2==arguments.length&&"object"==typeof n)for(var i in n)void 0!==n[i]&&(r=new RegExp("({"+i+"})","g"),e=e.replace(r,n[i]));else for(var a=1;a<arguments.length;a++)void 0!==arguments[a]&&(r=new RegExp("({["+(a-1)+"]})","g"),e=e.replace(r,arguments[a]))}return e},t.calValue=function(e,n,r){return t.isFunction(e)?e.apply(n,t.isArray(r)?r:[r]):e},t.is$=function(e){return t.zepto.isZ(e)},t.isStr=function(t){return"string"==typeof t},t.isNum=function(t){return"number"==typeof t},t.TapName="ontouchstart"in document.documentElement?"tap":"click"}(CoreLib),!function(t,e,n,r){"use strict";var i=1200,a=t.TapName,o="display",s="orginalClass",l="hidden",c="loading",u="body",f="."+o+".oneTarget",p="mzui."+o,h={left:"right",bottom:"top",top:"bottom",right:"left"},d=function(n,r){var a=this;t.isPlainObject(n)&&(r=n,n=null),r=t.extend({element:n},d.DEFAULT,n?n.data():null,r);var s=r.display;s&&d.plugs["_"+s]&&(r=t.calValue(d.plugs["_"+s],a,r));var l=r.selector;n||(r.trigger=null),r.name||(r.name=o+i++);var c=function(e){r.stopPropagation&&e.stopPropagation();var n=t(this),i=n.data()||{};if(i.element=this,n.is("a")){var o=n.attr("href");o&&"#"!==o&&o.indexOf("##")<0&&(/^#[a-z]/i.test(o)?i.target=o:i.remote||(i.remote=o)),e&&e.preventDefault()}a[r.triggerMethod](i)};if(r.trigger&&(l?n.on(r.trigger,l,c):n.on(r.trigger,c)),a.$=n,a.options=r,r.displayAuto!==e&&r.displayAuto!==!1)l&&n?n.find(l).each(c):a.show();else if(l&&n){var u=r.activeClass;n.find(l).filter("[data-display-auto]"+(u?",."+u:"")).each(c)}};d.prototype._getTarget=function(e){var n=this,r=t.calValue(e.target,n,e);if("!new"===r||r==="#"+o+"Target"){var i=o+"Target-"+e.name,a=o+"Layer-"+e.name;t("#"+i).remove(),r=t('<div class="'+o+" "+l+'"/>',{id:i});var c=t("#"+a);c.length||(c=t('<div class="'+o+'-layer"/>',{id:a}).appendTo(u)),e.layer=e.container=c.append(r)}else"!self"===r&&(r=e.element||n.$);return r=t(r).addClass(o).attr("data-"+o+"-name",e.name),r.parent().length||r.appendTo(e.container),r.data(s)||r.data(s,r.attr("class")),r},d.prototype.update=function(e,n,i,a){var s=this,l=function(r){var i=n.template;t.isFunction(i)?r=i(r,n):t.isStr(i)&&(r=t.format(i,r)),r!==!1&&(t.is$(r)?e.empty().append(r):e["text"===n.contentType?"text":"html"](r))},f=t.calValue(n.remote,s,n);if(f){var p=t.uuid++,h=n.loadingClass;e.removeClass(n.showInClass).addClass(h),t(u).addClass("has-"+o+"-"+c),n.$backdrop&&n.$backdrop.addClass(h);var d=t.isStr(f)?{url:f}:f;s.xhr&&s.xhr.abort(),s.remoteCall=p,s.xhr=t.ajax(t.extend({dataType:n.remoteType||"html",error:n.remoteError},d,{success:function(t,e,n){l(t),d.success&&d.success(t,e,n)},complete:function(i,l){s.xhr=0,s.remoteCall===p&&(s.lastRemote!==f&&(t(n.container).scrollTop(0),s.lastRemote=f),e.removeClass(h).addClass(n.showInClass),t(u).removeClass("has-"+o+"-"+c),n.$backdrop&&n.$backdrop.removeClass(h),t.callEvent("loaded",n.loaded,s,s.$,n),t(r).triggerHandler(o+".loaded",[s,s.$,n]),d.complete&&d.complete(i,l),a&&a())}}))}else{var g=t.calValue(n.content,s,n),m=n.source;m&&(m=t(t.calValue(m,s,n)),m=m.parent().length?m.clone():m,g=g?m.html(g):m),l(g),a&&a()}i&&i(f)},d.prototype._getOptions=function(e){var n=this,r=t.extend({},n.options,e),i=r.display;return i&&d.plugs[i]&&(r=t.calValue(d.plugs[i],n,r)),r.$target||(r.$target=n._getTarget(r)),r},d.prototype.show=function(e,n){t.isFunction(e)&&(n=e,e=null);var c=this,p=c._getOptions(e);c.last=p;var g=p.$target,m=p.activeClass,v=p.animate,y=p.element,b=p.placement,w=p.layer,x="",C="",T=p.name,E=p.arrow,S=p.backdrop,j=t(y);if(g.attr("class","invisible "+g.data(s)+" "+(p.targetClass||"")).removeClass(l),t.callEvent("show",p.show,c,c.$,p)===!1)return g.attr("class",s),p.layer&&p.layer.remove(),n&&n();
|
|
if(p.showSingle&&(p.showSingle===!0?g.parent().children():t(p.showSingle)).not(g).removeClass(p.showInClass).addClass(l),w&&w.removeClass(l),S){var $="backdrop-"+T;t("#"+$).remove();var k=p.$backdrop=t('<div class="display-backdrop"/>',{id:$,type:p.display,"data-display-name":T}).appendTo(u).css("zIndex",i++);S===!0&&(S="fade"),t.isStr(S)&&k.addClass(S),t(u).addClass("display-show-"+p.name),setTimeout(function(){k.addClass("in")},10),p.backdropDismiss&&k.attr("data-dismiss",o)}"none"!==p.targetZIndex&&(w||g).css("zIndex",p.targetZIndex||i++),m&&y&&(p.activeSingle&&j.parent().children().removeClass(m),j.addClass(m)),c.update(g,p,function(e){if(p.scrollTop&&t(p.container).scrollTop(0),b=t.calValue(b,c,p)){t.isStr(b)&&"{"==b[0]&&(b=t.parseJSON(b));var i=t("body");if(t.isPlainObject(b))g.css(b);else if("overlay"===b){var s=j.offset();g.css({position:"absolute",left:s.left-(p.layer?i.scrollLeft():0),top:s.top-(p.layer?i.scrollTop():0),width:j.width(),height:j.height()})}else if(0===b.indexOf("beside")){g.css({position:"absolute"}),b=b.split("-");var l,u,d=b[1]||"auto",m=b[2]||"center",s=j.offset(),y=s.top-(p.layer?i.scrollTop():0),T=s.left-(p.layer?i.scrollLeft():0),S=j.width(),$=j.height(),k=g.width(),D=g.height(),N=t(r).width(),O=t(r).height(),L="start"===m,M="end"===m;"auto"===d&&(d=O>=y+$+D?"bottom":y>=D?"top":N>=T+S+k?"right":T>=k?"left":"bottom");var P=L?T:M?T+S:T+S/2-k/2,A=L?y:M?y+$:y+$/2-D/2;"bottom"===d?(u=y+$,l=P):"top"===d?(u=y-D,l=P):"right"===d?(u=A,l=T+S):(u=A,l=T-k),g.css({top:Math.max(0,Math.min(u,O-D)),left:Math.max(0,Math.min(l,N-k))}),C=h[d],x="fade scale-from-"+C}else{b=b.split("-");var F=b[0],I=b[1],R={};"top"!=F&&"bottom"!=F&&"left"!=F&&"right"!=F||(R.justifyContent="flex-"+("top"===F||"left"==F?"start":"end"),R.flexDirection="top"==F||"bottom"==F?"column":"row",R.alignItems=I?"center"==I?"center":"left"==I?"flex-start":"flex-end":"stretch"),w&&w.css(R),x=F,C=h[x],x="from-"+x}}if(E){var _="display-arrow arrow-"+C;t.isStr(E)&&(_+=" "+E),g.addClass(_)}var H=function(){g.removeClass("invisible"),e||g.addClass(p.showInClass),n&&n();var i=p.autoHide;i&&(c.animateCall=setTimeout(function(){c.hide()},t.isNum(i)?i:5e3)),c.animateCall=setTimeout(function(){t.callEvent("shown",p.shown,c,c.$,p),t(r).triggerHandler(o+".shown",[c,c.$,p])},p.duration+50),p.targetDismiss&&g.one((p.targetDismiss===!0?a:p.targetDismiss)+f,function(){c.hide()})};v?(v===!0?g.addClass(x?"enter-"+x:"fade"):t.isStr(v)?g.addClass(v.replace("suggest",x)):t.isNum(v)&&(p.duration=v),clearTimeout(c.animateCall),c.animateCall=setTimeout(H,10)):H()},function(){t.callEvent("displayed",p.displayed,c,c.$,p),t(r).triggerHandler(o+".displayed",[c,c.$,p]),p.plugSkin&&g.find("[data-skin]").skin(),p.plugDisplay&&g.find("[data-"+o+"]").display(),t.fn.listenScroll&&g.find(".listen-scroll").listenScroll()}),d.last=T,d.all[T]=c},d.prototype.hide=function(e,n){t.isFunction(e)&&(n=e,e=null);var i=this,a=i.last||i._getOptions(e);if(t.callEvent("hide",a.hide,i,i.$,a)===!1)return n&&n();i.last=!1;var s=a.$target.off(f),c=t("#backdrop-"+a.name),p=function(){a.layer&&a.layer.addClass(l),t.callEvent(l,a[l],i,i.$,a),t(r).triggerHandler(o+"."+l,[i,i.$,a]),s.addClass(l),c.remove(),t(u).removeClass(o+"-show-"+a.name),a.layer&&a.layer.remove()};a.activeClass&&a.element&&t(a.element).removeClass(a.activeClass),s.removeClass(a.showInClass),c.removeClass("in"),a.animate?(clearTimeout(i.animateCall),i.animateCall=setTimeout(p,a.duration+50)):p()},d.prototype.isShow=function(e){return e=this._getOptions(e),e.checkShow?t.calValue(e.checkShow,this,e):e.$target?e.$target.hasClass(e.showInClass):e.last},d.prototype.toggle=function(e,n){var r;e===!0||e===!1?(r=e,e=t.isPlainObject(n)?n:null,e&&(n=null)):r=this.isShow(e),this[r?"hide":"show"](e,n)},d.NAME=p,d.DEFAULT={trigger:a,triggerMethod:"show",container:u,plugSkin:!0,plugDisplay:!0,content:!1,loadingClass:c,showInClass:"in",animate:!0,duration:300,keyboard:!0,backdropDismiss:!0,activeSingle:!0},d.plugs=function(e,n,r){if(t.isPlainObject(e))t.each(e,d.plugs);else{if(!n)return d.plugs[e];d.plugs[e]=n,e=0===e.indexOf("_")?e.substr(1):e,t.fn[e]||r===!1||t.bindFn(r||e,d,{display:e})}},d.all={},d.dismiss=function(e,n){t.isFunction(e)&&(n=e,e=""),e=e||d.last;var r=d.all[e];r&&r.hide(n)},t.bindFn(o,d),t.Display=d,t(function(){t("[data-"+o+"]").display(),t(r).on(a,'[data-dismiss="'+o+'"]',function(){var e=t(this),n="data-"+o+"-name";name=e.attr(n),name&&"null"!=name||(name=e.closest("."+o).attr(n)),d.dismiss(name)})})}(CoreLib,void 0,window,document),!function(t,e){"use strict";if(!t.Display)return void console.error("display.plugs.js requires display.js");var n=function(e,n,r,i,a){var o=t(n).next("."+e);return o.length||(o=r),o||'<div class="'+(a||e)+" "+(i||"")+'"/>'},r=function(t,n){return t===e?n:t};t.Display.plugs({dropdown:function(e){var i=e.source;return t.extend(e,{backdrop:r(e.backdrop,"clean"),source:e.target?null:function(){return n("dropdown-menu",e.element,i)},target:r(e.target,"!new"),placement:r(e.placement,"beside"),activeClass:r(e.activeClass,"open"),targetDismiss:r(e.targetDismiss,!0)})},popover:function(e){var i=e.source;return t.extend(e,{arrow:r(e.arrow,!0),backdrop:r(e.backdrop,"clean"),source:e.target?null:function(){return n("popover",e.element,i,"canvas with-padding")},target:r(e.target,"!new"),placement:r(e.placement,"beside"),activeClass:r(e.activeClass,"open")})},messager:function(n){return t.extend(n,{autoHide:r(n.autoHide,!0),animate:n.animate===e||n.animate===!0?"scale-suggest fade":n.animate,closeButton:r(n.closeButton,!0),template:function(e,n){var r=t(n.source||'<div class="messager list-item"/>');return n.icon&&r.append('<div class="avatar"><i class="icon icon-'+n.icon+'"/></div>'),r.append('<div class="title">'+e+"</div>"),n.closeButton&&r.append('<button class="btn muted" type="button" data-dismiss="display"><i class="icon icon-remove"></i></button>'),r.addClass(n.type||"gray")},target:"!new",placement:r(n.placement,"bottom-center"),activeClass:r(n.activeClass,"open")})},modal:function(e){var i=e.source;return t.extend(e,{backdrop:r(e.backdrop,"modal-backdrop fade"),source:e.target?null:function(){return n("modal",e.element,i,"","content")},target:r(e.target,"!new"),targetClass:"modal "+(e.targetClass||""),placement:r(e.placement,"tap"===t.TapName?"bottom":"center"),activeClass:r(e.activeClass,"open")})},_collapse:function(e){return t.extend(e,{triggerMethod:"toggle",animate:!1,showInClass:"in",activeClass:"collapse-open",showSingle:r(e.group||e.showSingle,e.selector?"collapse-group-"+ ++t.uuid:!1)})}}),t.Display.plugs("_self",function(e){return t.extend(e,{trigger:!1,target:"!self",targetZIndex:"none",displayAuto:r(e.displayAuto,!0)})},"displaySelf");var i=new t.Display({display:"messager"});i._show=i.show,i.show=function(e,n){i._show(t.extend({content:e},n))},t.each({primary:0,success:"ok-sign",info:"info-sign",warning:"warning-sign",danger:"exclamation-sign",important:0,special:0},function(e,n){i[e]=function(r,a){i._show(t.extend({content:r,icon:n||null,type:e},a))}}),t.messager=i}(CoreLib,void 0),!function(t){"use strict";var e="mzui.scrollListener",n=function(r,i){var a=this;a.options=i=t.extend({},n.DEFAULT,r.data(),i),a.$=r,a.$container=i.container?"parent"==i.container?a.$.parent():t(i.container):a.$,a.lastScrollTop=0,a.lastCallTime=0;var o=0;if(r.on("scroll."+e,function(){clearTimeout(o);var t=(new Date).getTime();o=setTimeout(function(){a.onScroll(),a.lastCallTime=t},t-a.lastCallTime>i.handleInterval?0:i.handleInterval)}),i.canScrollClass){var s=(a.$[0]===window?t("body"):a.$)[0].scrollHeight;a.$container.toggleClass(i.canScrollClass,s>a.$.height())}};n.prototype.onScroll=function(){var t=this,e=t.options,n=t.$.scrollTop(),r=n>0,i=n>t.lastScrollTop?"down":"up";t.$container.toggleClass(e.inScrollClass,r).toggleClass(e.directionClass+"-down","down"===i).toggleClass(e.directionClass+"-up","up"===i).toggleClass(e.directionClass+"-over",n+t.$.height()>=t.$[0].scrollHeight),t.$container.callEvent(t,"listenScroll",[r,i,n]),t.isInScroll=r,t.scrollDirection=i,t.lastScrollTop=n},n.NAME=e,n.DEFAULT={minDelta:20,handleInterval:100,inScrollClass:"in-scroll",directionClass:"scroll",canScrollClass:"can-scroll"},t.bindFn("listenScroll",n),t(function(){t(window).listenScroll({container:"body"}),t(".listen-scroll").listenScroll()})}(CoreLib),!function(t,e,n){"use strict";function r(t){if(t=t.toLowerCase(),t&&c.test(t)){var e;if(4===t.length){var n="#";for(e=1;4>e;e+=1)n+=t.slice(e,e+1).concat(t.slice(e,e+1));t=n}var r=[];for(e=1;7>e;e+=2)r.push(v("0x"+t.slice(e,e+2)));return{r:r[0],g:r[1],b:r[2],a:1}}throw new Error("Wrong hex string! (hex: "+t+")")}function i(e){return typeof e===h&&("transparent"===e.toLowerCase()||c.test(t.trim(e.toLowerCase())))}function a(t){function e(t){return t=0>t?t+1:t>1?t-1:t,1>6*t?s+(o-s)*t*6:1>2*t?o:2>3*t?s+(o-s)*(2/3-t)*6:s}var n=t.h,r=t.s,i=t.l,a=t.a;n=l(n)%f/f,r=y(r),i=y(i),a=y(a);var o=.5>=i?i*(r+1):i+r-i*r,s=2*i-o,c={r:e(n+1/3)*u,g:e(n)*u,b:e(n-1/3)*u,a:a};return c}function o(t,n,r){return g(r)&&(r=0),g(n)&&(n=u),e.min(e.max(t,r),n)}function s(t,e){return o(t,e)}function l(t){return"number"==typeof t?t:parseFloat(t)}var c=/^#([0-9a-fA-f]{3}|[0-9a-fA-f]{6})$/,u=255,f=360,p=100,h="string",d="object",g=function(t){return t===n},m=function(t){return!g(t)},v=function(t){return parseInt(t)},y=function(t,e){return s(l(t),e)},b=function(t){return v(y(t,u))},w=function(t,e,n,i){var o=this;if(o.r=o.g=o.b=0,o.a=1,m(i)&&(o.a=y(i,1)),m(t)&&m(e)&&m(n))o.r=b(t),o.g=b(e),o.b=b(n);else if(m(t)){var s=typeof t;if(s==h)t=t.toLowerCase(),"transparent"===t?o.a=0:o.rgb(r(t));else if("number"==s&&g(e))o.r=o.g=o.b=b(t);else if(s==d&&m(t.r))o.r=b(t.r),m(t.g)&&(o.g=b(t.g)),m(t.b)&&(o.b=b(t.b)),m(t.a)&&(o.a=y(t.a,1));else if(s==d&&m(t.h)){var l={h:y(t.h,f),s:1,l:1,a:1};m(t.s)&&(l.s=y(t.s,1)),m(t.l)&&(l.l=y(t.l,1)),m(t.a)&&(l.a=y(t.a,1)),o.rgb(a(l))}}};w.prototype.rgb=function(t){var e=this;if(m(t)){if(typeof t==d)m(t.r)&&(e.r=b(t.r)),m(t.g)&&(e.g=b(t.g)),m(t.b)&&(e.b=b(t.b)),m(t.a)&&(e.a=y(t.a,1));else{var n=v(l(t));e.r=n,e.g=n,e.b=n}return e}return{r:e.r,g:e.g,b:e.b,a:e.a}},w.prototype.hue=function(t){var e=this,n=e.toHsl();return g(t)?n.h:(n.h=y(t,f),e.rgb(a(n)),e)},w.prototype.darken=function(t){var e=this,n=e.toHsl();return n.l-=t/p,n.l=s(n.l,1),e.rgb(a(n)),e},w.prototype.clone=function(){var t=this;return new w(t.r,t.g,t.b,t.a)},w.prototype.lighten=function(t){return this.darken(-t)},w.prototype.fade=function(t){return this.a=s(t/p,1),this},w.prototype.toHsl=function(){var t,n,r=this,i=r.r/u,a=r.g/u,o=r.b/u,s=r.a,l=e.max(i,a,o),c=e.min(i,a,o),p=(l+c)/2,h=l-c;if(l===c)t=n=0;else{switch(n=p>.5?h/(2-l-c):h/(l+c),l){case i:t=(a-o)/h+(o>a?6:0);break;case a:t=(o-i)/h+2;break;case o:t=(i-a)/h+4}t/=6}return{h:t*f,s:n,l:p,a:s}},w.prototype.luma=function(){var t=this.r/u,n=this.g/u,r=this.b/u;return t=.03928>=t?t/12.92:e.pow((t+.055)/1.055,2.4),n=.03928>=n?n/12.92:e.pow((n+.055)/1.055,2.4),r=.03928>=r?r/12.92:e.pow((r+.055)/1.055,2.4),.2126*t+.7152*n+.0722*r},w.prototype.saturate=function(t){var e=this.toHsl();return e.s+=t/p,e.s=s(e.s),this.rgb(a(e))},w.prototype.contrast=function(t,e,n){if(e=g(e)?new w(u,u,u,1):new w(e),t=g(t)?new w(0,0,0,1):new w(t),this.a<.5)return t;if(n=g(n)?.43:l(n),t.luma()>e.luma()){var r=e;e=t,t=r}return this.luma()<n?e:t},w.prototype.hexStr=function(){var t=function(t){return t=t.toString(16),1==t.length?"0"+t:t};return"#"+t(this.r)+t(this.g)+t(this.b)},w.prototype.toCssStr=function(){var t=this;return t.a>0?t.a<1?"rgba("+t.r+","+t.g+","+t.b+","+t.a+")":t.hexStr():"transparent"},w.isColor=i,t.Color=w}(CoreLib,Math,void 0),function(t,e){"use strict";var n="mzui.skin",r={},i=function(e,n){var r=this;r.options=n=t.extend({},i.DEFAULT,e.data(),n),r.$=e,r.paint()};i.prototype.paint=function(n){var i,a,o=this,s=o.options,l=o.$,c=o.$.hasClass("pale")||s.pale,u=s.outline||l.hasClass("outline"),f=s.tint||l.hasClass("text-tint");if(n=n===e?s.skin:n,c===e&&(o.$.hasClass("dark")||s.dark)&&(c=!1),t.isStr(n)&&n.indexOf(":")>0){n=n.split(":"),a=n[0],n=n[1];var p=parseInt(n);NaN!==p&&(n=p)}if(""===n||n===e||"random"===n)n=Math.round(360*Math.random());else if(r[n])n=r[n];else if(t.isStr(n)&&0===n.indexOf("random"))r[n]=n=Math.round(360*Math.random());else if(t.isStr(n)&&0===n.indexOf("@")){for(var h=0,d=n.length-1;d>0;--d)h+=Math.pow(3,d-1)*n.charCodeAt(d);n=h}a&&(r[a]=n),i="number"==typeof n?new t.Color({h:n*s.hueSpace%360,s:s.saturation,l:s.lightness}):new t.Color(n),o.color=i,i.luma()<s.threshold?c&&(o.darkColor=i,o.color=new t.Color(t.extend(i.toHsl(),{l:s.paleLight}))):c===!1?(o.paleColor=i,o.color=new t.Color(t.extend(i.toHsl(),{l:s.darkLight}))):(c=!0,f&&(o.darkColor=new t.Color(t.extend(i.toHsl(),{l:s.darkLight}))));var g=o.color.toCssStr(),m={backgroundColor:u?"transparent":g,borderColor:g,color:u?g:c?f?o.darkColor.toCssStr():"":"#fff"};o.$.callEvent(o,"paint",m)!==!1&&l.css(m)},i.NAME=n,i.DEFAULT={skin:"random",hueSpace:47,saturation:.7,lightness:.6,threshold:.5,darkLight:.4,paleLight:.92},i.all=r,i.set=function(e,n){t.isPlainObject(e)?t.extend(i.all,e,n):i.all[e]=n,t("[data-skin]").skin("paint")},t.bindFn("skin",i),t.Skin=i,t(function(){t("[data-skin]").skin()})}(CoreLib,void 0),function(t){t.fn.serializeArray=function(){var e,n,r=[],i=function(t){return t.forEach?t.forEach(i):void r.push({name:e,value:t})};return this[0]&&t.each(this[0].elements,function(r,a){n=a.type,e=a.name,e&&"fieldset"!=a.nodeName.toLowerCase()&&!a.disabled&&"submit"!=n&&"reset"!=n&&"button"!=n&&("radio"!=n&&"checkbox"!=n||a.checked)&&i("file"==n?a.files:t(a).val())}),r},t.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")},t.fn.submit=function(e){if(0 in arguments)this.bind("submit",e);else if(this.length){var n=t.Event("submit");this.eq(0).trigger(n),n.isDefaultPrevented()||this.get(0).submit()}return this}}(Zepto),!function(t,e,n){"use strict";var r="mzui.ajaxform",i=function(i,a){if(i.length&&!i.data(r)){i.data(r,1);var o=function(e,n){return a&&t.isFunction(a[e])?a[e](n):void i.trigger(e+"."+r,n)},s=function(e){var n=i.find(".form-message");if(n.length){var r=n.find(".content");(r.length?r:n).html(e),n.show()}else t.messager.warning(e,{time:1e4})};o("init"),i.on("submit",function(r){r.preventDefault();var a=i[0],l={};t.each(i.serializeArray(),function(e,r){var i=r.name,a=r.value,o=l[i];if(a instanceof FileList){for(var s=[],c=a.length-1;c>=0;--c)s.push(a[c]);a=s}t.isArray(a)?o===n?o=a:t.isArray(o)?o.push.apply(o,a):(a.push(o),o=a):i.lastIndexOf("]")===i.length-1?o===n?o=[a]:o.push(a):o=a,l[i]=o}),o("onSubmit",l);var c=new FormData;for(var u in l){var f=l[u];if(t.isArray(f))for(var p=f.length-1;p>=0;--p)c.append(u,f[p]);else c.append(u,f)}var h=i.find('[type="submit"]').attr("disabled","disabled").addClass("disabled loading");t.ajax({url:a.action,type:a.method,processData:!1,contentType:!1,dataType:i.data("type")||"json",data:c,success:function(e,n){try{if("string"==typeof e&&(e=t.parseJSON(e)),o("onSuccess",e),"success"===e.result)e.message?(t.messager.success(e.message),e.locate&&setTimeout(function(){location.href=e.locate},1200)):e.locate&&(location.href=e.locate);else{var r=e.message||e.reason||e.error;r&&(t.isPlainObject(r)?t.each(r,function(e,n){t.isArray(n)&&n.length&&(n=n.length>1?"<ul><li>"+n.join("</li><li>")+"</li></ul>":n[0]);var r=i.find("#"+e+', [name="'+e+'"]').closest(".control");if(r.length){var a=r.find(".help-text");a.length?a.html(n):r.append('<div class="help-text">'+n+"</div>"),r.addClass("has-error")}else s(n)}):s(r))}}catch(a){s(e||"No response.")}o("onResult",e)},error:function(n,r,i){s("error: "+i),o("onError",{xhr:n,errorType:r,error:i}),e.v&&e.v.lang.timeout&&t.messager.danger(e.v.lang.timeout)},complete:function(t,e){h.attr("disabled",null).removeClass("disabled loading"),o("onComplete",{xhr:t,status:e})}})}).on("change",function(e){i.find(".form-message").hide(),t(e.target).closest(".control").removeClass("has-error")})}};t.ajaxForm=i,t.fn.ajaxform=function(e){return t(this).each(function(){var n=t(this);i(n,t.extend(n.data(),e))})},t(function(){t(".ajaxform").ajaxform()})}(CoreLib,window,void 0); |