/*! * mustache.js - Logic-less {{mustache}} templates with JavaScript * http://github.com/janl/mustache.js */ (function(a,b){if(typeof exports==="object"&&exports){b(exports)}else{var c={};b(c);if(typeof define==="function"&&define.amd){define(c)}else{a.Mustache=c}}}(this,function(a){var f=/\s*/;var m=/\s+/;var k=/\S/;var i=/\s*=/;var o=/\s*\}/;var t=/#|\^|\/|>|\{|&|=|!/;var g=RegExp.prototype.test;function s(z,y){return g.call(z,y)}function h(y){return !s(k,y)}var v=Object.prototype.toString;var l=Array.isArray||function(y){return v.call(y)==="[object Array]"};function b(y){return typeof y==="function"}function e(y){return y.replace(/[\-\[\]{}()*+?.,\\\^$|#\s]/g,"\\$&")}var d={"&":"&","<":"<",">":">",'"':""","'":"'","/":"/"};function n(y){return String(y).replace(/[&<>"'\/]/g,function(z){return d[z]})}function r(y){if(!l(y)||y.length!==2){throw new Error("Invalid tags: "+y)}return[new RegExp(e(y[0])+"\\s*"),new RegExp("\\s*"+e(y[1]))]}function x(O,E){E=E||a.tags;O=O||"";if(typeof E==="string"){E=E.split(m)}var I=r(E);var A=new u(O);var G=[];var F=[];var D=[];var P=false;var N=false;function M(){if(P&&!N){while(D.length){delete F[D.pop()]}}else{D=[]}P=false;N=false}var B,z,H,J,C,y;while(!A.eos()){B=A.pos;H=A.scanUntil(I[0]);if(H){for(var K=0,L=H.length;K0?E[E.length-1][4]:F;break;default:C.push(A)}}return F}function u(y){this.string=y;this.tail=y;this.pos=0}u.prototype.eos=function(){return this.tail===""};u.prototype.scan=function(A){var z=this.tail.match(A);if(z&&z.index===0){var y=z[0];this.tail=this.tail.substring(y.length);this.pos+=y.length;return y}return""};u.prototype.scanUntil=function(A){var z=this.tail.search(A),y;switch(z){case -1:y=this.tail;this.tail="";break;case 0:y="";break;default:y=this.tail.substring(0,z);this.tail=this.tail.substring(z)}this.pos+=y.length;return y};function q(z,y){this.view=z==null?{}:z;this.cache={".":this.view};this.parent=y}q.prototype.push=function(y){return new q(y,this)};q.prototype.lookup=function(y){var B;if(y in this.cache){B=this.cache[y]}else{var A=this;while(A){if(y.indexOf(".")>0){B=A.view;var C=y.split("."),z=0;while(B!=null&&z":if(!E){continue}H=b(E)?E(A[1]):E[A[1]];if(H!=null){C+=this.renderTokens(this.parse(H),y,E,H)}break;case"&":H=y.lookup(A[1]);if(H!=null){C+=H}break;case"name":H=y.lookup(A[1]);if(H!=null){C+=a.escape(H)}break;case"text":C+=A[1];break}}return C};a.name="mustache.js";a.version="0.8.1";a.tags=["{{","}}"];var j=new p();a.clearCache=function(){return j.clearCache()};a.parse=function(z,y){return j.parse(z,y)};a.render=function(A,y,z){return j.render(A,y,z)};a.to_html=function(B,z,A,C){var y=a.render(B,z,A);if(b(C)){C(y)}else{return y}};a.escape=n;a.Scanner=u;a.Context=q;a.Writer=p})); /*! * zeroModal.js * http://git.oschina.net/cylansad/zeroModal * * Copyright 2016, Sad */ (function(a){if(typeof module!=="undefined"&&typeof exports==="object"&&define.cmd){module.exports=a}else{if(typeof define==="function"&&define.amd){define(function(){return a})}else{window.zeroModal=a}}}((function(f,h){var z={};var g='
';var v='
';v+=' {{#drag}}
{{/drag}}';v+='
';v+=' {{#close}}
{{/close}}';v+=' {{#max}}
{{/max}}';v+=' {{#min}}
{{/min}}';v+=' {{#escape}}{{&title}}{{/escape}}{{^escape}}{{title}}{{/escape}}';v+="
";v+='
';v+=' {{#url}}
{{#iframe}}{{/iframe}}{{/url}}';v+="
";v+=' {{#resize}}
{{/resize}}';v+="
";var u='{{#iconDisplay}}{{&iconDisplay}}{{/iconDisplay}}{{^iconDisplay}}
{{&iconText}}
{{/iconDisplay}}';u+='
{{&_content}}
';u+='
{{&contentDetail}}
';var w={unique:"",title:"",content:"",escape:true,url:false,ajaxType:"get",ajaxData:{},iframe:false,width:"500px",height:"300px",top:h,left:h,transition:false,opacity:0.2,overlay:true,overlayClose:false,forbidBodyScroll:false,forbidBodyScrollClass:h,drag:true,dragHandle:"top",close:true,max:false,min:false,minPosition:h,resize:false,resizeAfterFn:h,ok:false,okTitle:"确定",okFn:false,cancel:false,cancelTitle:"关闭",cancelFn:true,buttonTopLine:true,buttons:[],esc:false,onOpen:false,onLoad:false,onComplete:false,onCleanup:false,onClosed:false};var e=false;var t=10000;var m={};var r=false;var l=false;f(function(){if(document.body.style.overflow!="hidden"&&document.body.scroll!="no"&&document.body.scrollHeight>document.body.offsetHeight){r=true}});z.show=function(B){var C=o(B);j(C);e=true;f(window).resize(function(){if(e){i(C)}});return C.unique};z.close=function(B){b({unique:B});e=false;delete m[B]};z.closeAll=function(){f('[role="zeromodal-loading"]').remove();f(".zeromodal-overlay").remove();f(".zeromodal-container").each(function(){var D=f(this);var C=D.attr("zero-unique-container");if(C!==h&&m[C]!==h){var B=m[C];if(typeof B.onCleanup==="function"){B.onCleanup(B)}D.remove();if(typeof B.onClosed==="function"){B.onClosed(B)}delete m[C]}});e=false};z.loading=function(E){var H=o();y(H);t++;var G=f(window).scrollTop()+Math.ceil(f(window).height()/3);if(E===h){E=1}if(E===1||E===2){var F="zeromodal-loading"+E;f("body").append('
')}else{if(k([3,4,5,6],E)){var B={};switch(E){case 3:B.className="pacman";B.containerCount=5;break;case 4:B.className="line-scale-pulse-out";B.containerCount=5;break;case 5:B.className="line-spin-fade-loader";B.containerCount=8;break;case 6:B.className="square-spin";B.containerCount=1;break}var C='
';for(var D=0;D
"}C+=" ";f("body").append(C)}}return H.unique};z.progress=function(H,B){var E=o();y(E);t++;if(H===h){H=3}var J=f(window).scrollTop()+Math.ceil(f(window).height()/3);var I={};switch(H){case 3:I.className="pacman";I.containerCount=5;break;case 4:I.className="line-scale-pulse-out";I.containerCount=5;break;case 5:I.className="line-spin-fade-loader";I.containerCount=8;break;case 6:I.className="square-spin";I.containerCount=1;break}var C='
';for(var G=0;G
"}C+=" ";C+='
';C+="";f("body").append(C);var F=0;var D=setInterval(function(){f.ajax({url:B.getProgressUrl+"?_="+new Date().getTime(),dataType:"json",type:"get",success:function(K){f("#progess_content_"+E.unique).html(K.progress);if(K.progress==="finish"){clearInterval(D);f.get(B.clearProgressUrl);z.close(E.unique)}}});F++;if(F>=500){clearInterval(D)}},500);return E.unique};z.progress_old=function(D){var G=o();y(G);t++;var J=f(window).scrollTop()+Math.ceil(f(window).height()/3);var K=f(window).width()/2-200;var H=1;if(D!==h&&D>H&&D<10){H=D}var C='
';C+='
';C+='
 0%
';C+="
";C+="
";f("body").append(C);var B=0;var I=f('[zeromodal-progress-bar="'+G.unique+'"]');var F=f('[zeromodal-progress-val="'+G.unique+'"]');var E=setInterval(function(){B+=1;I.css("width",B+"%");F.html((B>9?B:" "+B)+"%");if(B>=100){F.html('');clearInterval(E)}},H*100);return G.unique};z.alert=function(C){var B={iconClass:"show-zero2 zeromodal-icon-info",iconText:"!"};var D={};f.extend(D,B);if(typeof C==="object"){f.extend(D,C)}else{D.content=C}q(D)};z.error=function(B){var C={iconDisplay:'
'};if(typeof B==="object"){f.extend(C,B)}else{C.content=B}q(C)};z.success=function(B){var C={iconDisplay:'
'};if(typeof B==="object"){f.extend(C,B)}else{C.content=B}q(C)};z.confirm=function(D,C){var B={iconClass:"show-zero2 zeromodal-icon-question",iconText:"?",};var E={};f.extend(E,B);if(typeof C==="function"){E.okFn=C}E.cancel=true;if(typeof D==="object"){f.extend(E,D)}else{E.content=D}q(E)};function o(B){var C={};f.extend(C,w);f.extend(C,B);if(typeof C.unique==="undefined"||C.unique===""){C.unique=c()}m[C.unique]=C;return C}function j(B){if(typeof B.onOpen==="function"){B.onOpen(B)}y(B);n(B)}function b(B){if(typeof B==="object"){if(typeof B.onCleanup==="function"){B.onCleanup()}f('[zero-unique-overlay="'+B.unique+'"]').remove();f('[zero-unique-container="'+B.unique+'"]').remove();f('[zero-unique-loading="'+B.unique+'"]').remove();f("body").removeClass("zeromodal-overflow-hidden");if(B.forbidBodyScrollClass!==h){f("body").removeClass(B.forbidBodyScrollClass)}if(typeof B.onClosed==="function"){B.onClosed()}}}function y(C){t++;C._tmp_last_zindex=t;C._width=f(document).width();C._height=f(document).height();if(C.overlay){var B=f(Mustache.render(g,C));f("body").append(B);if(C.overlayClose){B.css("cursor","pointer");B.click(function(){b(C)})}else{B.click(function(){x(f('[zero-unique-container="'+C.unique+'"]'))})}}}function n(D){t++;var F=D.width.replace("px","");var H=D.height.replace("px","");var C=f(window).width();var G=f(window).height();if(F.indexOf("%")!==-1){F=(C*parseInt(F.replace("%",""))/100)}if(H.indexOf("%")!==-1){H=(G*parseInt(H.replace("%",""))/100)}if(typeof F==="string"){F=parseInt(F)}if(typeof H==="string"){H=parseInt(H)}var L=((C-F)/2)+"px";var K=(f(window).scrollTop()+Math.ceil((f(window).height()-H)/3))+"px";if(D.top!==h){K=D.top}if(D.left!==h){L=D.left}D._tmp_last_zindex=t;D._width=F;D._height=H;D._left=L;D._top=K;f("body").append(Mustache.render(v,D));if(D.drag){var B;if(D.dragHandle==="container"){B=f('[zero-unique-container="'+D.unique+'"]')[0]}else{B=f('[zero-unique-top="'+D.unique+'"]')[0]}new a(f('[zero-unique-container="'+D.unique+'"]')[0],{handle:B,limit:false})}f('[zero-close-unique="'+D.unique+'"]').click(function(){b(m[f(this).attr("zero-close-unique")])});f('[zero-max-unique="'+D.unique+'"]').click(function(){var M=f('[zeromodal-unqiue-header="'+D.unique+'"]');f('[zero-title-unique="'+D.unique+'"]').removeClass("modal-title-min");f('[zero-unique-body="'+D.unique+'"]').show();f('[zero-unique-container="'+D.unique+'"]').removeClass("zeromodal-fixed");if(M.attr("zero-status")!=="2"){i(m[f(this).attr("zero-max-unique")],"90%","85%");M.attr("zero-status","2")}else{i(m[f(this).attr("zero-max-unique")]);M.attr("zero-status","1")}p(D)});f('[zero-min-unique="'+D.unique+'"]').click(function(){var O=f('[zeromodal-unqiue-header="'+D.unique+'"]');var N=f('[zero-unique-container="'+D.unique+'"]');var P=f('[zero-unique-body="'+D.unique+'"]');if(O.attr("zero-status")!=="0"){P.hide();N.css("height","22px").css("width","220px").addClass("zeromodal-fixed");f('[zero-title-unique="'+D.unique+'"]').addClass("modal-title-min");if(D.minPosition!==h&&D.minPosition!==""){var M=D.minPosition.split(",");if(M.length===2){N.css("left",M[0]+"px").css("top",(parseInt(M[1])+f(window).scrollTop())+"px")}}O.attr("zero-status","0")}else{f('[zero-title-unique="'+D.unique+'"]').removeClass("modal-title-min");P.show();N.removeClass("zeromodal-fixed");i(m[f(this).attr("zero-min-unique")]);O.attr("zero-status","1")}});if(D.transition){f(".zeromodal-container").animate({top:K},300)}p(D);if(D.resize){A(D.unique,D)}if(typeof D.onLoad==="function"){D.onLoad(D)}var E=f('[zero-unique-body="'+D.unique+'"]');if(!D.url){E.addClass("zeromodal-overflow-y");if(D.escape){E.html(D.content)}else{E.text(D.content)}if(typeof D.onComplete==="function"){D.onComplete(D)}}else{E.append('
');if(D.iframe){var J=f('[zero-unique-frame="'+D.unique+'"]');J.load(function(){f(".zeromodal-loading1").remove();if(typeof D.onComplete==="function"){D.onComplete(D)}})}else{E.addClass("zeromodal-overflow-y");f.ajax({url:D.url,dataType:"html",type:D.ajaxType,data:D.ajaxData,success:function(M){E.append(M);f(".zeromodal-loading1").remove();if(typeof D.onComplete==="function"){D.onComplete(D)}}})}}if(D.forbidBodyScroll){var I=f("body");if(D.forbidBodyScrollOffset!==h&&r&&D.forbidBodyScrollClass!==h){I.addClass(D.forbidBodyScrollClass)}I.addClass("zeromodal-overflow-hidden")}d(D,f('[zero-unique-container="'+D.unique+'"]'));if(D.esc){f("body").one("keyup",function(M){if(M.keyCode===27){b(D)}})}}function d(G,D){if(G.ok||G.cancel||(G.buttons!==h&&G.buttons.length>0)){var C='";D.append(C);if(G.buttons!==h&&G.buttons.length>0){for(var F=0;F"+B.name+"");if(typeof B.fn==="function"){(function(J){E.click(function(){var K=J.fn(G);if(typeof K==="undefined"||K){b(G)}})}(B))}f('[zeromodal-btn-container="'+G.unique+'"]').append(E)}}else{if(G.ok){var H=f('");f('[zeromodal-btn-container="'+G.unique+'"]').append(H);H.click(function(){if(typeof G.okFn==="function"){var J=G.okFn();if(typeof J==="undefined"||J){b(G)}}else{b(G)}})}if(G.cancel){var I=f('");f('[zeromodal-btn-container="'+G.unique+'"]').append(I);I.click(function(){if(typeof G.cancelFn==="function"){var J=G.cancelFn();if(typeof J==="undefined"||J){b(G)}}else{b(G)}})}}}}function q(C){if(typeof C==="undefined"||typeof C.cancelTitle==="undefined"){C.cancelTitle="取消"}if(typeof C.width==="undefined"){C.width="350px"}if(typeof C.height==="undefined"){C.height="300px"}var D=o(C);D.esc=true;if(typeof C.ok==="undefined"){D.ok=true}D.buttonTopLine=false;if(typeof _okFn!=="undefined"){D.okFn=_okFn}if(typeof cancelFn!=="undefined"){D.cancelFn=cancelFn}D._content=D.content||"";D.content="";j(D);var B=f('[zero-unique-body="'+D.unique+'"]');B.append(Mustache.render(u,D));B.removeClass("zeromodal-overflow-y");f('[zero-unique-body="'+D.unique+'"]').removeClass("zeromodal-overflow-y");f('[zeromodal-btn-ok="'+D.unique+'"]').focus();e=true;f(window).resize(function(){if(e){i(D)}})}function i(D,C,I){var E=f('[zero-unique-container="'+D.unique+'"]');f('[zero-unique-overlay="'+D.unique+'"]').css("width",f(document).width()+"px").css("height",f(document).height()+"px");var B=f(window).width();var G=f(window).height();var F=C!==h?C.replace("px",""):D.width.replace("px","");var H=I!==h?I.replace("px",""):D.height.replace("px","");if(F.indexOf("%")!==-1){F=(B*parseInt(F.replace("%",""))/100)}if(H.indexOf("%")!==-1){H=(G*parseInt(H.replace("%",""))/100)}if(typeof F==="string"){F=parseInt(F)}if(typeof H==="string"){H=parseInt(H)}var K=((B-F)/2)+"px";var J=(f(window).scrollTop()+Math.ceil((f(window).height()-H)/3))+"px";if(D.left!==h){K=D.left}if(D.top!==h){J=D.top}E.css("width",F+"px").css("height",H+"px").css("left",K).css("top",J)}function s(G){var C=f(window).width();var E=f(window).height();var D=f('[zero-unique-container="'+G.unique+'"]');var B=parseInt(D.css("width").replace("px",""));var F=parseInt(D.css("height").replace("px",""));var H=(C-B)/2;var I=f(window).scrollTop()+Math.ceil((f(window).height()-F)/3);D.css("left",H+"px").css("top",I+"px")}function p(D){var C=f('[zeromodal-unqiue-header="'+D.unique+'"]').height();var E=(D.ok||D.cancel||(D.buttons!==h&&D.buttons.length>0))?60:0;var B=f('[zero-unique-container="'+D.unique+'"]').height()-C-10-E;f('[zero-unique-body="'+D.unique+'"]').css("height",B)}function x(D){if(D.length===0){return}var C=D.position().left;for(var B=0;B<2;B++){D.animate({left:C-2},50);D.animate({left:C},50);D.animate({left:C+2},50)}D.animate({left:C},50)}function k(B,D){for(var C=0;C