4 lines
70 KiB
JavaScript
4 lines
70 KiB
JavaScript
|
var Zepto=function(){function t(t){return null==t?String(t):q[R.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 k.call(t,function(t){return null!=t})}function u(t){return t.length>0?D.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||P[c(t)]?e:e+"px"}function h(t){var e,n;return C[t]||(e=O.createElement(t),O.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),C[t]=n),C[t]}function d(t){return"children"in t?Y.call(t.children):D.map(t.childNodes,function(t){return 1==t.nodeType?t:void 0})}function p(t,e,n){for(b in e)n&&(o(e[b])||X(e[b]))?(o(e[b])&&!o(t[b])&&(t[b]={}),X(e[b])&&!X(t[b])&&(t[b]=[]),p(t[b],e[b],n)):e[b]!==S&&(t[b]=e[b])}function m(t,e){return null==e?D(t):D(t).filter(e)}function _(t,n,r,i){return e(n)?n.call(t,r,i):n}function g(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function y(t,e){var n=t.className||"",r=n&&n.baseVal!==S;return e===S?r?n.baseVal:n:void(r?n.baseVal=e:t.className=e)}function v(t){try{return t?"true"==t||("false"==t?!1:"null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?D.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 S,b,D,M,x,E,T=[],Y=T.slice,k=T.filter,O=window.document,C={},J={},P={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},H=/^\s*<(\w+|!)[^>]*>/,j=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,L=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,F=/^(?:body|html)$/i,N=/([A-Z])/g,A=["val","css","html","text","data","width","height","offset"],U=["after","prepend","before","append"],W=O.createElement("table"),G=O.createElement("tr"),I={tr:O.createElement("tbody"),tbody:W,thead:W,tfoot:W,td:G,th:G,"*":O.createElement("div")},z=/complete|loaded|interactive/,Z=/^[\w-]*$/,q={},R=q.toString,V={},$=O.createElement("div"),B={tabindex:"tabIndex",readonly:"readOnly","for":"htmlFor","class":"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},X=Array.isArray||function(t){return t instanceof Array};return V.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=$).appendChild(t),r=~V.qsa(i,e).indexOf(t),o&&$.removeChild(t),r},x=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},E=function(t){return k.call(t,function(e,n){return t.indexOf(e)==n})},V.fragment=function(t,e,n){var r,i,s;return j.test(t)&&(r=D(O.createElement(RegExp.$1))),r||(t.replace&&(t=t.replace(L,"<$1></$2>")),e===S&&(e=H.test(t)&&RegExp.$1),e in I||(e="*"),s=I[e],s.innerHTML=""+t,r=D.each(Y.call(s.childNodes),function(){s.removeChild(this)})),o(n)&&(i=D(r),D.each(n,function(t,e){A.indexOf(t)>-1?i[t](e):i.attr(t,e)})),r},V.Z=function(t,e){return t=t||[],t.__proto__=D.fn,t.selector=e||"",t},V.isZ=function(t){return t instanceof V.Z},V.init=function(t,n){var r;if(!t)return V.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&H.test(t))r=V.fragment(t,RegExp.$1,n),t=null;else{if(n!==S)return D(n).find(t);r=V.qsa(O,t)}else{if(e(t))return D(O).ready(t);if(V.isZ(t))return t;if(X(t))r=a(t);else if(i(t))r=[t],t=null;else if(H.test(t))r=V.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==S)return D(n).find(t);r=V.qsa(O,t)}}return V.Z(r,t)},D=function(t,e){return V.init(t,e)},D.extend=function(
|
||
|
return s(function(){return n&&(K(t+"\n"+(new Error).stack),n=!1),e.apply(this,arguments)},e)}function ee(t,e){mi[t]||(K(e),mi[t]=!0)}function ne(t){var e,n,r=t._i,i=_i.exec(r);if(i){for(c(t).iso=!0,e=0,n=gi.length;n>e;e++)if(gi[e][1].exec(r)){t._f=gi[e][0];break}for(e=0,n=yi.length;n>e;e++)if(yi[e][1].exec(r)){t._f+=(i[6]||" ")+yi[e][0];break}r.match(ei)&&(t._f+="Z"),Se(t)}else t._isValid=!1}function re(e){var n=vi.exec(e._i);return null!==n?void(e._d=new Date(+n[1])):(ne(e),void(e._isValid===!1&&(delete e._isValid,t.createFromInputFallback(e))))}function ie(t,e,n,r,i,o,s){var a=new Date(t,e,n,r,i,o,s);return 1970>t&&a.setFullYear(t),a}function oe(t){var e=new Date(Date.UTC.apply(null,arguments));return 1970>t&&e.setUTCFullYear(t),e}function se(t){return ae(t)?366:365}function ae(t){return t%4===0&&t%100!==0||t%400===0}function ue(){return ae(this.year())}function ce(t,e,n){var r,i=n-e,o=n-t.day();return o>i&&(o-=7),i-7>o&&(o+=7),r=ke(t).add(o,"d"),{week:Math.ceil(r.dayOfYear()/7),year:r.year()}}function le(t){return ce(t,this._week.dow,this._week.doy).week}function fe(){return this._week.dow}function he(){return this._week.doy}function de(t){var e=this.localeData().week(this);return null==t?e:this.add(7*(t-e),"d")}function pe(t){var e=ce(this,1,4).week;return null==t?e:this.add(7*(t-e),"d")}function me(t,e,n,r,i){var o,s=6+i-r,a=oe(t,0,1+s),u=a.getUTCDay();return i>u&&(u+=7),n=null!=n?1*n:i,o=1+s+7*(e-1)-u+n,{year:o>0?t:t-1,dayOfYear:o>0?o:se(t-1)+o}}function _e(t){var e=Math.round((this.clone().startOf("day")-this.clone().startOf("year"))/864e5)+1;return null==t?e:this.add(t-e,"d")}function ge(t,e,n){return null!=t?t:null!=e?e:n}function ye(t){var e=new Date;return t._useUTC?[e.getUTCFullYear(),e.getUTCMonth(),e.getUTCDate()]:[e.getFullYear(),e.getMonth(),e.getDate()]}function ve(t){var e,n,r,i,o=[];if(!t._d){for(r=ye(t),t._w&&null==t._a[ui]&&null==t._a[ai]&&we(t),t._dayOfYear&&(i=ge(t._a[si],r[si]),t._dayOfYear>se(i)&&(c(t)._overflowDayOfYear=!0),n=oe(i,0,t._dayOfYear),t._a[ai]=n.getUTCMonth(),t._a[ui]=n.getUTCDate()),e=0;3>e&&null==t._a[e];++e)t._a[e]=o[e]=r[e];for(;7>e;e++)t._a[e]=o[e]=null==t._a[e]?2===e?1:0:t._a[e];24===t._a[ci]&&0===t._a[li]&&0===t._a[fi]&&0===t._a[hi]&&(t._nextDay=!0,t._a[ci]=0),t._d=(t._useUTC?oe:ie).apply(null,o),null!=t._tzm&&t._d.setUTCMinutes(t._d.getUTCMinutes()-t._tzm),t._nextDay&&(t._a[ci]=24)}}function we(t){var e,n,r,i,o,s,a;e=t._w,null!=e.GG||null!=e.W||null!=e.E?(o=1,s=4,n=ge(e.GG,t._a[si],ce(ke(),1,4).year),r=ge(e.W,1),i=ge(e.E,1)):(o=t._locale._week.dow,s=t._locale._week.doy,n=ge(e.gg,t._a[si],ce(ke(),o,s).year),r=ge(e.w,1),null!=e.d?(i=e.d,o>i&&++r):i=null!=e.e?e.e+o:o),a=me(n,r,i,s,o),t._a[si]=a.year,t._dayOfYear=a.dayOfYear}function Se(e){if(e._f===t.ISO_8601)return void ne(e);e._a=[],c(e).empty=!0;var n,r,i,o,s,a=""+e._i,u=a.length,l=0;for(i=F(e._f,e._locale).match(Ur)||[],n=0;n<i.length;n++)o=i[n],r=(a.match(U(o,e))||[])[0],r&&(s=a.substr(0,a.indexOf(r)),s.length>0&&c(e).unusedInput.push(s),a=a.slice(a.indexOf(r)+r.length),l+=r.length),Ir[o]?(r?c(e).empty=!1:c(e).unusedTokens.push(o),z(o,r,e)):e._strict&&!r&&c(e).unusedTokens.push(o);c(e).charsLeftOver=u-l,a.length>0&&c(e).unusedInput.push(a),c(e).bigHour===!0&&e._a[ci]<=12&&e._a[ci]>0&&(c(e).bigHour=void 0),e._a[ci]=be(e._locale,e._a[ci],e._meridiem),ve(e),Q(e)}function be(t,e,n){var r;return null==n?e:null!=t.meridiemHour?t.meridiemHour(e,n):null!=t.isPM?(r=t.isPM(n),r&&12>e&&(e+=12),r||12!==e||(e=0),e):e}function De(t){var e,n,r,i,o;if(0===t._f.length)return c(t).invalidFormat=!0,void(t._d=new Date(0/0));for(i=0;i<t._f.length;i++)o=0,e=h({},t),null!=t._useUTC&&(e._useUTC=t._useUTC),e._f=t._f[i],Se(e),l(e)&&(o+=c(e).charsLeftOver,o+=10*c(e).unusedTokens.length,c(e).score=o,(null==r||r>o)&&(r=o,n=e));s(t,n||e)}function Me(t){if(!t._d){var e=T(t._i);t._a=[e.year,e.month,e.day||e.date,e.hour,e.minute,e.second,e.millisecond],ve(t)}}function xe(t){var e=new d(Q(Ee(t)));return e._nextDay&&(e.add(1,"d"),e._nextDay=void 0),e}function Ee(t){var e=t._i,i=t._f;return t._locale=t._locale||M(t._l),null===e||void 0===i&&""===e?f({nullInp
|
||
|
var n=">";switch(e){case"[":n="]";break;case"<":break;default:throw e+" is not a supported deliminator"}this.scanner=new EJS.Scanner(this.source,e,n),this.out=""},EJS.Compiler.prototype={compile:function(options,name){options=options||{},this.out="";var put_cmd="___ViewO.push(",insert_cmd=put_cmd,buff=new EJS.Buffer(this.pre_cmd,this.post_cmd),content="",clean=function(t){return t=t.replace(/\\/g,"\\\\"),t=t.replace(/\n/g,"\\n"),t=t.replace(/"/g,'\\"')};this.scanner.scan(function(t,e){if(null==e.stag)switch(t){case"\n":content+="\n",buff.push(put_cmd+'"'+clean(content)+'");'),buff.cr(),content="";break;case e.left_delimiter:case e.left_equal:case e.left_comment:e.stag=t,content.length>0&&buff.push(put_cmd+'"'+clean(content)+'")'),content="";break;case e.double_left:content+=e.left_delimiter;break;default:content+=t}else switch(t){case e.right_delimiter:switch(e.stag){case e.left_delimiter:"\n"==content[content.length-1]?(content=chop(content),buff.push(content),buff.cr()):buff.push(content);break;case e.left_equal:buff.push(insert_cmd+"(EJS.Scanner.to_text("+content+")))")}e.stag=null,content="";break;case e.double_right:content+=e.right_delimiter;break;default:content+=t}}),content.length>0&&buff.push(put_cmd+'"'+clean(content)+'")'),buff.close(),this.out=buff.script+";";var to_be_evaled="/*"+name+"*/this.process = function(_CONTEXT,_VIEW) { try { with(_VIEW) { with (_CONTEXT) {"+this.out+" return ___ViewO.join('');}}}catch(e){e.lineNumber=null;throw e;}};";try{eval(to_be_evaled)}catch(e){if("undefined"==typeof JSLINT)throw e;JSLINT(this.out);for(var i=0;i<JSLINT.errors.length;i++){var error=JSLINT.errors[i];if("Unnecessary semicolon."!=error.reason){error.line++;var e=new Error;throw e.lineNumber=error.line,e.message=error.reason,options.view&&(e.fileName=options.view),e}}}}},EJS.config=function(t){EJS.cache=null!=t.cache?t.cache:EJS.cache,EJS.type=null!=t.type?t.type:EJS.type,EJS.ext=null!=t.ext?t.ext:EJS.ext;var e=EJS.templates_directory||{};EJS.templates_directory=e,EJS.get=function(t,n){return 0==n?null:e[t]?e[t]:null},EJS.update=function(t,n){null!=t&&(e[t]=n)},EJS.INVALID_PATH=-1},EJS.config({cache:!0,type:"<",ext:".ejs"}),EJS.Helpers=function(t,e){this._data=t,this._extras=e,extend(this,e)},EJS.Helpers.prototype={view:function(t,e,n){return n||(n=this._extras),e||(e=this._data),new EJS(t).render(e,n)},to_text:function(t,e){return null==t||void 0===t?e||"":t instanceof Date?t.toDateString():t.toString?t.toString().replace(/\n/g,"<br />").replace(/''/g,"'"):""}},EJS.newRequest=function(){for(var t=[function(){return new ActiveXObject("Msxml2.XMLHTTP")},function(){return new XMLHttpRequest},function(){return new ActiveXObject("Microsoft.XMLHTTP")}],e=0;e<t.length;e++)try{var n=t[e]();if(null!=n)return n}catch(r){continue}},EJS.request=function(t){var e=new EJS.newRequest;e.open("GET",t,!1);try{e.send(null)}catch(n){return null}return 404==e.status||2==e.status||0==e.status&&""==e.responseText?null:e.responseText},EJS.ajax_request=function(t){t.method=t.method?t.method:"GET";var e=new EJS.newRequest;e.onreadystatechange=function(){4==e.readyState&&t.onComplete(200==e.status?e:e)},e.open(t.method,t.url),e.send(null)}}(),EJS.Helpers.prototype.date_tag=function(t,e){e instanceof Date||(e=new Date);for(var n=["January","February","March","April","May","June","July","August","September","October","November","December"],r=[],i=[],o=[],s=e.getFullYear(),a=e.getMonth(),u=e.getDate(),c=s-15;s+15>c;c++)r.push({value:c,text:c});for(var l=0;12>l;l++)i.push({value:l,text:n[l]});for(var f=0;31>f;f++)o.push({value:f+1,text:f+1});var h=this.select_tag(t+"[year]",s,r,{id:t+"[year]"}),d=this.select_tag(t+"[month]",a,i,{id:t+"[month]"}),p=this.select_tag(t+"[day]",u,o,{id:t+"[day]"});return h+d+p},EJS.Helpers.prototype.form_tag=function(t,e){return e=e||{},e.action=t,1==e.multipart&&(e.method="post",e.enctype="multipart/form-data"),this.start_tag_for("form",e)},EJS.Helpers.prototype.form_tag_end=function(){return this.tag_end("form")},EJS.Helpers.prototype.hidden_field_tag=function(t,e,n){return this.input_field_tag(t,e,"hidden",n)},
|