fastman2 2.9.0 → 3.0.0-alpha.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/actionsheetman.js +96 -1
- package/alertman.js +79 -1
- package/annotationman.js +2912 -17
- package/baseman.js +115 -1
- package/blankpageman.js +171 -1
- package/cascadepickerman.js +322 -1
- package/confirmman.js +87 -1
- package/coreman.js +2182 -3
- package/cryptoman.js +8931 -2
- package/datetimepickerman.js +181 -1
- package/domman.js +2759 -1
- package/eventemitterman.js +112 -1
- package/fileuploadman.js +2970 -1
- package/formvalidateman.js +335 -1
- package/jsbridgeman.js +992 -1
- package/lazyloadman.js +133 -1
- package/loadingman.js +81 -1
- package/modalman.js +264 -1
- package/mutationobserverman.js +356 -1
- package/package.json +1 -1
- package/passguardman.js +1722 -1
- package/persistman.js +60 -1
- package/pickerman.js +680 -1
- package/popupman.js +61 -1
- package/postman.js +1649 -1
- package/preloadman.js +8760 -2
- package/resultpageman.js +153 -1
- package/routerman.js +1201 -1
- package/scrollman-infiniteRefresh.js +117 -1
- package/scrollman-pullDownRefresh.js +302 -1
- package/scrollman.js +2567 -2
- package/storeman.js +585 -1
- package/swiperman.js +4702 -1
- package/swiperoldman.js +3005 -1
- package/tabman.js +145 -1
- package/tipman.js +110 -1
- package/toastman.js +78 -1
- package/toolman.js +22 -1
- package/whenman.js +774 -1
- package/wsman.js +7624 -1
package/domman.js
CHANGED
|
@@ -1 +1,2759 @@
|
|
|
1
|
-
!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.fastman=e():t.fastman=e()}(this,function(){return function(t){function e(n){if(i[n])return i[n].exports;var r=i[n]={i:n,l:!1,exports:{}};return t[n].call(r.exports,r,r.exports,e),r.l=!0,r.exports}var n=window.webpackJsonpfastman;window.webpackJsonpfastman=function(i,o,a){for(var s,u,c,l=0,f=[];l<i.length;l++)u=i[l],r[u]&&f.push(r[u][0]),r[u]=0;for(s in o)Object.prototype.hasOwnProperty.call(o,s)&&(t[s]=o[s]);for(n&&n(i,o,a);f.length;)f.shift()();if(a)for(l=0;l<a.length;l++)c=e(e.s=a[l]);return c};var i={},r={32:0};return e.e=function(t){function n(){s.onerror=s.onload=null,clearTimeout(u);var e=r[t];0!==e&&(e&&e[1](new Error("Loading chunk "+t+" failed.")),r[t]=void 0)}var i=r[t];if(0===i)return new Promise(function(t){t()});if(i)return i[2];var o=new Promise(function(e,n){i=r[t]=[e,n]});i[2]=o;var a=document.getElementsByTagName("head")[0],s=document.createElement("script");s.type="text/javascript",s.charset="utf-8",s.async=!0,s.timeout=12e4,e.nc&&s.setAttribute("nonce",e.nc),s.src=e.p+""+t+".js";var u=setTimeout(n,12e4);return s.onerror=s.onload=n,a.appendChild(s),o},e.m=t,e.c=i,e.i=function(t){return t},e.d=function(t,n,i){e.o(t,n)||Object.defineProperty(t,n,{configurable:!1,enumerable:!0,get:i})},e.n=function(t){var n=t&&t.__esModule?function(){return t.default}:function(){return t};return e.d(n,"a",n),n},e.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},e.p="",e.oe=function(t){throw t},e(e.s=243)}({105:function(t,e,n){"use strict";var i={},r=navigator.userAgent,o=r.match(/(Android);?[\s\/]+([\d.]+)?/),a=r.match(/(iPad).*OS\s([\d_]+)/),s=r.match(/(iPod)(.*OS\s([\d_]+))?/),u=!a&&r.match(/(iPhone\sOS)\s([\d_]+)/),c=r.match(/MSIE\s([\d.]+)/)||r.match(/Trident\/[\d](?=[^?]+).*rv:([0-9.].)/),l=r.match(/(OpenHarmony)\s([\d.]+)/i);if(i.ios=i.android=i.iphone=i.ipad=i.androidChrome=i.ie=i.pc=i.harmony=!1,l&&(i.os="harmony",i.osVersion=l[2],i.harmony=!0),o&&(i.os="android",i.osVersion=o[2],i.android=!0,i.androidChrome=r.toLowerCase().indexOf("chrome")>=0),(a||u||s)&&(i.os="ios",i.ios=!0),u&&!s&&(i.osVersion=u[2].replace(/_/g,"."),i.iphone=!0),a&&(i.osVersion=a[2].replace(/_/g,"."),i.ipad=!0),s&&(i.osVersion=s[3]?s[3].replace(/_/g,"."):null,i.iphone=!0),i.ios&&i.osVersion&&r.indexOf("Version/")>=0&&"10"===i.osVersion.split(".")[0]&&(i.osVersion=r.toLowerCase().split("version/")[1].split(" ")[0]),c&&(i.ie=!0,i.ieVersion=c[1]),i.os||(i.os="pc",i.pc=!0),i.hasNativeHistory=history&&history.pushState,i.webView=(u||a||s)&&r.match(/.*AppleWebKit(?!.*Safari)/i),i.os&&"ios"===i.os){var f=i.osVersion.split(".");i.minimalUi=!i.webView&&(s||u)&&(1*f[0]==7?1*f[1]>=1:1*f[0]>7)&&$('meta[name="viewport"]').length>0&&$('meta[name="viewport"]').attr("content").indexOf("minimal-ui")>=0}var h=$(window).width(),p=$(window).height();i.statusBar=!1,i.webView&&h*p==screen.width*screen.height?i.statusBar=!0:i.statusBar=!1;var d=[];if(i.pixelRatio=window.devicePixelRatio||1,d.push("pixel-ratio-"+Math.floor(i.pixelRatio)),i.pixelRatio>=2&&d.push("retina"),i.os&&(d.push(i.os),i.osVersion&&d.push(i.os+"-"+i.osVersion.split(".")[0],i.os+"-"+i.osVersion.replace(/\./g,"-")),"ios"===i.os))for(var m=parseInt(i.osVersion.split(".")[0],10),v=m-1;v>=6;v--)d.push("ios-gt-"+v);i.statusBar?d.push("with-statusbar-overlay"):$("html").removeClass("with-statusbar-overlay"),d.length>0&&$("html").addClass(d.join(" ")),i.isWeixin=/MicroMessenger/i.test(r),$.device=i},107:function(t,e){!function(t){function e(e,n,i){var r=t.Event(n);return t(e).trigger(r,i),!r.isDefaultPrevented()}function n(t,n,i,r){if(t.global)return e(n||w,i,r)}function i(e){e.global&&0==t.active++&&n(e,null,"ajaxStart")}function r(e){e.global&&!--t.active&&n(e,null,"ajaxStop")}function o(t,e){var i=e.context;if(!1===e.beforeSend.call(i,t,e)||!1===n(e,i,"ajaxBeforeSend",[t,e]))return!1;n(e,i,"ajaxSend",[t,e])}function a(t,e,i,r){var o=i.context;i.success.call(o,t,"success",e),r&&r.resolveWith(o,[t,"success",e]),n(i,o,"ajaxSuccess",[e,i,t]),u("success",e,i)}function s(t,e,i,r,o){var a=r.context;r.error.call(a,i,e,t),o&&o.rejectWith(a,[i,e,t]),n(r,a,"ajaxError",[i,r,t||e]),u(e,i,r)}function u(t,e,i){var o=i.context;i.complete.call(o,e,t),n(i,o,"ajaxComplete",[e,i]),r(i)}function c(t,e,n){if(n.dataFilter==l)return t;var i=n.context;return n.dataFilter.call(i,t,e)}function l(){}function f(t){return t&&(t=t.split(";",2)[0]),t&&(t==S?"html":t==T?"json":x.test(t)?"script":E.test(t)&&"xml")||"text"}function h(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()&&"jsonp"!=e.dataType||(e.url=h(e.url,e.data),e.data=void 0)}function d(e,n,i,r){return t.isFunction(n)&&(r=i,i=n,n=void 0),t.isFunction(i)||(r=i,i=void 0),{url:e,data:n,success:i,dataType:r}}function m(e,n,i,r){var o,a=t.isArray(n),s=t.isPlainObject(n);t.each(n,function(n,u){o=t.type(u),r&&(n=i?r:r+"["+(s||"object"==o||"array"==o?n:"")+"]"),!r&&a?e.add(u.name,u.value):"array"==o||!i&&"object"==o?m(e,u,i,n):e.add(n,u)})}var v,g,y=+new Date,w=window.document,b=/<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,x=/^(?:text|application)\/javascript/i,E=/^(?:text|application)\/xml/i,T="application/json",S="text/html",C=/^\s*$/,A=w.createElement("a");A.href=window.location.href,t.active=0,t.ajaxJSONP=function(e,n){if(!("type"in e))return t.ajax(e);var i,r,u=e.jsonpCallback,c=(t.isFunction(u)?u():u)||"Zepto"+y++,l=w.createElement("script"),f=window[c],h=function(e){t(l).triggerHandler("error",e||"abort")},p={abort:h};return n&&n.promise(p),t(l).on("load error",function(o,u){clearTimeout(r),t(l).off().remove(),"error"!=o.type&&i?a(i[0],p,e,n):s(null,u||"error",p,e,n),window[c]=f,i&&t.isFunction(f)&&f(i[0]),f=i=void 0}),!1===o(p,e)?(h("abort"),p):(window[c]=function(){i=arguments},l.src=e.url.replace(/\?(.+)=\?/,"?$1="+c),w.head.appendChild(l),e.timeout>0&&(r=setTimeout(function(){h("timeout")},e.timeout)),p)},t.ajaxSettings={type:"GET",beforeSend:l,success:l,error:l,complete:l,context:null,global:!0,xhr:function(){return new window.XMLHttpRequest},accepts:{script:"text/javascript, application/javascript, application/x-javascript",json:T,xml:"application/xml, text/xml",html:S,text:"text/plain"},crossDomain:!1,timeout:0,processData:!0,cache:!0,dataFilter:l},t.ajax=function(e){var n,r,u=t.extend({},e||{}),d=t.Deferred&&t.Deferred();for(v in t.ajaxSettings)void 0===u[v]&&(u[v]=t.ajaxSettings[v]);i(u),u.crossDomain||(n=w.createElement("a"),n.href=u.url,n.href=n.href,u.crossDomain=A.protocol+"//"+A.host!=n.protocol+"//"+n.host),u.url||(u.url=window.location.toString()),(r=u.url.indexOf("#"))>-1&&(u.url=u.url.slice(0,r)),p(u);var m=u.dataType,y=/\?.+=\?/.test(u.url);if(y&&(m="jsonp"),!1!==u.cache&&(e&&!0===e.cache||"script"!=m&&"jsonp"!=m)||(u.url=h(u.url,"_="+Date.now())),"jsonp"==m)return y||(u.url=h(u.url,u.jsonp?u.jsonp+"=?":!1===u.jsonp?"":"callback=?")),t.ajaxJSONP(u,d);var b,x=u.accepts[m],E={},T=function(t,e){E[t.toLowerCase()]=[t,e]},S=/^([\w-]+:)\/\//.test(u.url)?RegExp.$1:window.location.protocol,j=u.xhr(),$=j.setRequestHeader;if(d&&d.promise(j),u.crossDomain||T("X-Requested-With","XMLHttpRequest"),T("Accept",x||"*/*"),(x=u.mimeType||x)&&(x.indexOf(",")>-1&&(x=x.split(",",2)[0]),j.overrideMimeType&&j.overrideMimeType(x)),(u.contentType||!1!==u.contentType&&u.data&&"GET"!=u.type.toUpperCase())&&T("Content-Type",u.contentType||"application/x-www-form-urlencoded"),u.headers)for(g in u.headers)T(g,u.headers[g]);if(j.setRequestHeader=T,j.onreadystatechange=function(){if(4==j.readyState){j.onreadystatechange=l,clearTimeout(b);var e,n=!1;if(j.status>=200&&j.status<300||304==j.status||0==j.status&&"file:"==S){if(m=m||f(u.mimeType||j.getResponseHeader("content-type")),"arraybuffer"==j.responseType||"blob"==j.responseType)e=j.response;else{e=j.responseText;try{e=c(e,m,u),"script"==m?(0,eval)(e):"xml"==m?e=j.responseXML:"json"==m&&(e=C.test(e)?null:t.parseJSON(e))}catch(t){n=t}if(n)return s(n,"parsererror",j,u,d)}a(e,j,u,d)}else s(j.statusText||null,j.status?"error":"abort",j,u,d)}},!1===o(j,u))return j.abort(),s(null,"abort",j,u,d),j;var M=!("async"in u)||u.async;if(j.open(u.type,u.url,M,u.username,u.password),u.xhrFields)for(g in u.xhrFields)j[g]=u.xhrFields[g];for(g in E)$.apply(j,E[g]);return u.timeout>0&&(b=setTimeout(function(){j.onreadystatechange=l,j.abort(),s(null,"timeout",j,u,d)},u.timeout)),j.send(u.data?u.data:null),j},t.get=function(){return t.ajax(d.apply(null,arguments))},t.post=function(){var e=d.apply(null,arguments);return e.type="POST",t.ajax(e)},t.getJSON=function(){var e=d.apply(null,arguments);return e.dataType="json",t.ajax(e)},t.fn.load=function(e,n,i){if(!this.length)return this;var r,o=this,a=e.split(/\s/),s=d(e,n,i),u=s.success;return a.length>1&&(s.url=a[0],r=a[1]),s.success=function(e){o.html(r?t("<div>").html(e.replace(b,"")).find(r):e),u&&u.apply(o,arguments)},t.ajax(s),this};var j=encodeURIComponent;t.param=function(e,n){var i=[];return i.add=function(e,n){t.isFunction(n)&&(n=n()),null==n&&(n=""),this.push(j(e)+"="+j(n))},m(i,e,n),i.join("&").replace(/%20/g,"+")}}(Zepto)},108:function(t,e){!function(t){function e(e,i){var u=e[s],c=u&&r[u];if(void 0===i)return c||n(e);if(c){if(i in c)return c[i];var l=a(i);if(l in c)return c[l]}return o.call(t(e),i)}function n(e,n,o){var u=e[s]||(e[s]=++t.uuid),c=r[u]||(r[u]=i(e));return void 0!==n&&(c[a(n)]=o),c}function i(e){var n={};return t.each(e.attributes||u,function(e,i){0==i.name.indexOf("data-")&&(n[a(i.name.replace("data-",""))]=t.zepto.deserializeValue(i.value))}),n}var r={},o=t.fn.data,a=t.camelCase,s=t.expando="Zepto"+ +new Date,u=[];t.fn.data=function(i,r){return void 0===r?t.isPlainObject(i)?this.each(function(e,r){t.each(i,function(t,e){n(r,t,e)})}):0 in this?e(this[0],i):void 0:this.each(function(){n(this,i,r)})},t.data=function(e,n,i){return t(e).data(n,i)},t.hasData=function(e){var n=e[s],i=n&&r[n];return!!i&&!t.isEmptyObject(i)},t.fn.removeData=function(e){return"string"==typeof e&&(e=e.split(/\s+/)),this.each(function(){var n=this[s],i=n&&r[n];i&&t.each(e||i,function(t){delete i[e?a(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)},109:function(t,e){!function(t){function e(t){return t._zid||(t._zid=h++)}function n(t,n,o,a){if(n=i(n),n.ns)var s=r(n.ns);return(v[e(t)]||[]).filter(function(t){return t&&(!n.e||t.e==n.e)&&(!n.ns||s.test(t.ns))&&(!o||e(t.fn)===e(o))&&(!a||t.sel==a)})}function i(t){var e=(""+t).split(".");return{e:e[0],ns:e.slice(1).sort().join(" ")}}function r(t){return new RegExp("(?:^| )"+t.replace(" "," .* ?")+"(?: |$)")}function o(t,e){return t.del&&!y&&t.e in w||!!e}function a(t){return b[t]||y&&w[t]||t}function s(n,r,s,u,l,h,p){var d=e(n),m=v[d]||(v[d]=[]);r.split(/\s/).forEach(function(e){if("ready"==e)return t(document).ready(s);var r=i(e);r.fn=s,r.sel=l,r.e in b&&(s=function(e){var n=e.relatedTarget;if(!n||n!==this&&!t.contains(this,n))return r.fn.apply(this,arguments)}),r.del=h;var d=h||s;r.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!1===e&&(t.preventDefault(),t.stopPropagation()),e}},r.i=m.length,m.push(r),"addEventListener"in n&&n.addEventListener(a(r.e),r.proxy,o(r,p))})}function u(t,i,r,s,u){var c=e(t);(i||"").split(/\s/).forEach(function(e){n(t,e,r,s).forEach(function(e){delete v[c][e.i],"removeEventListener"in t&&t.removeEventListener(a(e.e),e.proxy,o(e,u))})})}function c(e,n){return!n&&e.isDefaultPrevented||(n||(n=e),t.each(S,function(t,i){var r=n[t];e[t]=function(){return this[i]=x,r&&r.apply(n,arguments)},e[i]=E}),e.timeStamp||(e.timeStamp=Date.now()),(n.defaultPrevented!==f?n.defaultPrevented:"returnValue"in n?!1===n.returnValue: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,m=function(t){return"string"==typeof t},v={},g={},y="onfocusin"in window,w={focus:"focusin",blur:"focusout"},b={mouseenter:"mouseover",mouseleave:"mouseout"};g.click=g.mousedown=g.mouseup=g.mousemove="MouseEvents",t.event={add:s,remove:u},t.proxy=function(n,i){var r=2 in arguments&&p.call(arguments,2);if(d(n)){var o=function(){return n.apply(i,r?r.concat(p.call(arguments)):arguments)};return o._zid=e(n),o}if(m(i))return r?(r.unshift(n[i],n),t.proxy.apply(null,r)):t.proxy(n[i],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,i){return this.on(t,e,n,i,1)};var x=function(){return!0},E=function(){return!1},T=/^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,S={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,i,r,o){var a,c,h=this;return e&&!m(e)?(t.each(e,function(t,e){h.on(t,n,i,e,o)}),h):(m(n)||d(r)||!1===r||(r=i,i=n,n=f),r!==f&&!1!==i||(r=i,i=f),!1===r&&(r=E),h.each(function(f,h){o&&(a=function(t){return u(h,t.type,r),r.apply(this,arguments)}),n&&(c=function(e){var i,o=t(e.target).closest(n,h).get(0);if(o&&o!==h)return i=t.extend(l(e),{currentTarget:o,liveFired:h}),(a||r).apply(o,[i].concat(p.call(arguments,1)))}),s(h,e,r,i,n,c||a)}))},t.fn.off=function(e,n,i){var r=this;return e&&!m(e)?(t.each(e,function(t,e){r.off(t,n,e)}),r):(m(n)||d(i)||!1===i||(i=n,n=f),!1===i&&(i=E),r.each(function(){u(this,e,i,n)}))},t.fn.trigger=function(e,n){return e=m(e)||t.isPlainObject(e)?t.Event(e):c(e),e._args=n,this.each(function(){e.type in w&&"function"==typeof this[e.type]?this[e.type]():"dispatchEvent"in this?this.dispatchEvent(e):t(this).triggerHandler(e,n)})},t.fn.triggerHandler=function(e,i){var r,o;return this.each(function(a,s){r=l(m(e)?t.Event(e):e),r._args=i,r.target=s,t.each(n(s,e.type||e),function(t,e){if(o=e.proxy(r),r.isImmediatePropagationStopped())return!1})}),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){m(t)||(e=t,t=e.type);var n=document.createEvent(g[t]||"Events"),i=!0;if(e)for(var r in e)"bubbles"==r?i=!!e[r]:n[r]=e[r];return n.initEvent(t,i,!0),c(n)}}(Zepto)},110:function(t,e){var n=function(){function t(t){return null==t?String(t):X[J.call(t)]||"object"}function e(e){return"function"==t(e)}function n(t){return null!=t&&t==t.window}function i(t){return null!=t&&t.nodeType==t.DOCUMENT_NODE}function r(e){return"object"==t(e)}function o(t){return r(t)&&!n(t)&&Object.getPrototypeOf(t)==Object.prototype}function a(t){var e=!!t&&"length"in t&&t.length,i=S.type(t);return"function"!=i&&!n(t)&&("array"==i||0===e||"number"==typeof e&&e>0&&e-1 in t)}function s(t){return P.call(t,function(t){return null!=t})}function u(t){return t.length>0?S.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 V?V[t]:V[t]=new RegExp("(^|\\s)"+t+"(\\s|$)")}function f(t,e){return"number"!=typeof e||F[c(t)]?e:e+"px"}function h(t){var e,n;return D[t]||(e=N.createElement(t),N.body.appendChild(e),n=getComputedStyle(e,"").getPropertyValue("display"),e.parentNode.removeChild(e),"none"==n&&(n="block"),D[t]=n),D[t]}function p(t){return"children"in t?O.call(t.children):S.map(t.childNodes,function(t){if(1==t.nodeType)return t})}function d(t,e){var n,i=t?t.length:0;for(n=0;n<i;n++)this[n]=t[n];this.length=i,this.selector=e||""}function m(t,e,n){for(T in e)n&&(o(e[T])||Q(e[T]))?(o(e[T])&&!o(t[T])&&(t[T]={}),Q(e[T])&&!Q(t[T])&&(t[T]=[]),m(t[T],e[T],n)):e[T]!==E&&(t[T]=e[T])}function v(t,e){return null==e?S(t):S(t).filter(e)}function g(t,n,i,r){return e(n)?n.call(t,i,r):n}function y(t,e,n){null==n?t.removeAttribute(e):t.setAttribute(e,n)}function w(t,e){var n=t.className||"",i=n&&n.baseVal!==E;if(e===E)return i?n.baseVal:n;i?n.baseVal=e:t.className=e}function b(t){try{return t?"true"==t||"false"!=t&&("null"==t?null:+t+""==t?+t:/^[\[\{]/.test(t)?S.parseJSON(t):t):t}catch(e){return t}}function x(t,e){e(t);for(var n=0,i=t.childNodes.length;n<i;n++)x(t.childNodes[n],e)}var E,T,S,C,A,j,$=[],M=$.concat,P=$.filter,O=$.slice,N=window.document,D={},V={},F={"column-count":1,columns:1,"font-weight":1,"line-height":1,opacity:1,"z-index":1,zoom:1},k=/^\s*<(\w+|!)[^>]*>/,L=/^<(\w+)\s*\/?>(?:<\/\1>|)$/,z=/<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,_=/^(?:body|html)$/i,R=/([A-Z])/g,I=["val","css","html","text","data","width","height","offset"],q=["after","prepend","before","append"],Z=N.createElement("table"),B=N.createElement("tr"),U={tr:N.createElement("tbody"),tbody:Z,thead:Z,tfoot:Z,td:B,th:B,"*":N.createElement("div")},H=/complete|loaded|interactive/,W=/^[\w-]*$/,X={},J=X.toString,Y={},G=N.createElement("div"),K={tabindex:"tabIndex",readonly:"readOnly",for:"htmlFor",class:"className",maxlength:"maxLength",cellspacing:"cellSpacing",cellpadding:"cellPadding",rowspan:"rowSpan",colspan:"colSpan",usemap:"useMap",frameborder:"frameBorder",contenteditable:"contentEditable"},Q=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.matches||t.webkitMatchesSelector||t.mozMatchesSelector||t.oMatchesSelector||t.matchesSelector;if(n)return n.call(t,e);var i,r=t.parentNode,o=!r;return o&&(r=G).appendChild(t),i=~Y.qsa(r,e).indexOf(t),o&&G.removeChild(t),i},A=function(t){return t.replace(/-+(.)?/g,function(t,e){return e?e.toUpperCase():""})},j=function(t){return P.call(t,function(e,n){return t.indexOf(e)==n})},Y.fragment=function(t,e,n){var i,r,a;return L.test(t)&&(i=S(N.createElement(RegExp.$1))),i||(t.replace&&(t=t.replace(z,"<$1></$2>")),e===E&&(e=k.test(t)&&RegExp.$1),e in U||(e="*"),a=U[e],a.innerHTML=""+t,i=S.each(O.call(a.childNodes),function(){a.removeChild(this)})),o(n)&&(r=S(i),S.each(n,function(t,e){I.indexOf(t)>-1?r[t](e):r.attr(t,e)})),i},Y.Z=function(t,e){return new d(t,e)},Y.isZ=function(t){return t instanceof Y.Z},Y.init=function(t,n){var i;if(!t)return Y.Z();if("string"==typeof t)if(t=t.trim(),"<"==t[0]&&k.test(t))i=Y.fragment(t,RegExp.$1,n),t=null;else{if(n!==E)return S(n).find(t);i=Y.qsa(N,t)}else{if(e(t))return S(N).ready(t);if(Y.isZ(t))return t;if(Q(t))i=s(t);else if(r(t))i=[t],t=null;else if(k.test(t))i=Y.fragment(t.trim(),RegExp.$1,n),t=null;else{if(n!==E)return S(n).find(t);i=Y.qsa(N,t)}}return Y.Z(i,t)},S=function(t,e){return Y.init(t,e)},S.extend=function(t){var e,n=O.call(arguments,1);return"boolean"==typeof t&&(e=t,t=n.shift()),n.forEach(function(n){m(t,n,e)}),t},Y.qsa=function(t,e){var n,i="#"==e[0],r=!i&&"."==e[0],o=i||r?e.slice(1):e,a=W.test(o);return t.getElementById&&a&&i?(n=t.getElementById(o))?[n]:[]:1!==t.nodeType&&9!==t.nodeType&&11!==t.nodeType?[]:O.call(a&&!i&&t.getElementsByClassName?r?t.getElementsByClassName(o):t.getElementsByTagName(e):t.querySelectorAll(e))},S.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},S.type=t,S.isFunction=e,S.isWindow=n,S.isArray=Q,S.isPlainObject=o,S.isEmptyObject=function(t){var e;for(e in t)return!1;return!0},S.isNumeric=function(t){var e=Number(t),n=typeof t;return null!=t&&"boolean"!=n&&("string"!=n||t.length)&&!isNaN(e)&&isFinite(e)||!1},S.inArray=function(t,e,n){return $.indexOf.call(e,t,n)},S.camelCase=A,S.trim=function(t){return null==t?"":String.prototype.trim.call(t)},S.uuid=0,S.support={},S.expr={},S.noop=function(){},S.map=function(t,e){var n,i,r,o=[];if(a(t))for(i=0;i<t.length;i++)null!=(n=e(t[i],i))&&o.push(n);else for(r in t)null!=(n=e(t[r],r))&&o.push(n);return u(o)},S.each=function(t,e){var n,i;if(a(t)){for(n=0;n<t.length;n++)if(!1===e.call(t[n],n,t[n]))return t}else for(i in t)if(!1===e.call(t[i],i,t[i]))return t;return t},S.grep=function(t,e){return P.call(t,e)},window.JSON&&(S.parseJSON=JSON.parse),S.each("Boolean Number String Function Array Date RegExp Object Error".split(" "),function(t,e){X["[object "+e+"]"]=e.toLowerCase()}),S.fn={constructor:Y.Z,length:0,forEach:$.forEach,reduce:$.reduce,push:$.push,sort:$.sort,splice:$.splice,indexOf:$.indexOf,concat:function(){var t,e,n=[];for(t=0;t<arguments.length;t++)e=arguments[t],n[t]=Y.isZ(e)?e.toArray():e;return M.apply(Y.isZ(this)?this.toArray():this,n)},map:function(t){return S(S.map(this,function(e,n){return t.call(e,n,e)}))},slice:function(){return S(O.apply(this,arguments))},ready:function(t){return H.test(N.readyState)&&N.body?t(S):N.addEventListener("DOMContentLoaded",function(){t(S)},!1),this},get:function(t){return t===E?O.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!1!==t.call(e,n,e)}),this},filter:function(t){return e(t)?this.not(this.not(t)):S(P.call(this,function(e){return Y.matches(e,t)}))},add:function(t,e){return S(j(this.concat(S(t,e))))},is:function(t){return this.length>0&&Y.matches(this[0],t)},not:function(t){var n=[];if(e(t)&&t.call!==E)this.each(function(e){t.call(this,e)||n.push(this)});else{var i="string"==typeof t?this.filter(t):a(t)&&e(t.item)?O.call(t):S(t);this.forEach(function(t){i.indexOf(t)<0&&n.push(t)})}return S(n)},has:function(t){return this.filter(function(){return r(t)?S.contains(this,t):S(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&&!r(t)?t:S(t)},last:function(){var t=this[this.length-1];return t&&!r(t)?t:S(t)},find:function(t){var e=this;return t?"object"==typeof t?S(t).filter(function(){var t=this;return $.some.call(e,function(e){return S.contains(e,t)})}):1==this.length?S(Y.qsa(this[0],t)):this.map(function(){return Y.qsa(this,t)}):S()},closest:function(t,e){var n=[],r="object"==typeof t&&S(t);return this.each(function(o,a){for(;a&&!(r?r.indexOf(a)>=0:Y.matches(a,t));)a=a!==e&&!i(a)&&a.parentNode;a&&n.indexOf(a)<0&&n.push(a)}),S(n)},parents:function(t){for(var e=[],n=this;n.length>0;)n=S.map(n,function(t){if((t=t.parentNode)&&!i(t)&&e.indexOf(t)<0)return e.push(t),t});return v(e,t)},parent:function(t){return v(j(this.pluck("parentNode")),t)},children:function(t){return v(this.map(function(){return p(this)}),t)},contents:function(){return this.map(function(){return this.contentDocument||O.call(this.childNodes)})},siblings:function(t){return v(this.map(function(t,e){return P.call(p(e.parentNode),function(t){return t!==e})}),t)},empty:function(){return this.each(function(){this.innerHTML=""})},pluck:function(t){return S.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 i=S(t).get(0),r=i.parentNode||this.length>1;return this.each(function(e){S(this).wrapAll(n?t.call(this,e):r?i.cloneNode(!0):i)})},wrapAll:function(t){if(this[0]){S(this[0]).before(t=S(t));for(var e;(e=t.children()).length;)t=e.first();S(t).append(this)}return this},wrapInner:function(t){var n=e(t);return this.each(function(e){var i=S(this),r=i.contents(),o=n?t.call(this,e):t;r.length?r.wrapAll(o):i.append(o)})},unwrap:function(){return this.parent().each(function(){S(this).replaceWith(S(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=S(this);(t===E?"none"==e.css("display"):t)?e.show():e.hide()})},prev:function(t){return S(this.pluck("previousElementSibling")).filter(t||"*")},next:function(t){return S(this.pluck("nextElementSibling")).filter(t||"*")},html:function(t){return 0 in arguments?this.each(function(e){var n=this.innerHTML;S(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.pluck("textContent").join(""):null},attr:function(t,e){var n;return"string"!=typeof t||1 in arguments?this.each(function(n){if(1===this.nodeType)if(r(t))for(T in t)y(this,T,t[T]);else y(this,t,g(this,e,n,this.getAttribute(t)))}):0 in this&&1==this[0].nodeType&&null!=(n=this[0].getAttribute(t))?n:E},removeAttr:function(t){return this.each(function(){1===this.nodeType&&t.split(" ").forEach(function(t){y(this,t)},this)})},prop:function(t,e){return t=K[t]||t,1 in arguments?this.each(function(n){this[t]=g(this,e,n,this[t])}):this[0]&&this[0][t]},removeProp:function(t){return t=K[t]||t,this.each(function(){delete this[t]})},data:function(t,e){var n="data-"+t.replace(R,"-$1").toLowerCase(),i=1 in arguments?this.attr(n,e):this.attr(n);return null!==i?b(i):E},val:function(t){return 0 in arguments?(null==t&&(t=""),this.each(function(e){this.value=g(this,t,e,this.value)})):this[0]&&(this[0].multiple?S(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=S(this),i=g(this,t,e,n.offset()),r=n.offsetParent().offset(),o={top:i.top-r.top,left:i.left-r.left};"static"==n.css("position")&&(o.position="relative"),n.css(o)});if(!this.length)return null;if(N.documentElement!==this[0]&&!S.contains(N.documentElement,this[0]))return{top:0,left:0};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 i=this[0];if("string"==typeof e){if(!i)return;return i.style[A(e)]||getComputedStyle(i,"").getPropertyValue(e)}if(Q(e)){if(!i)return;var r={},o=getComputedStyle(i,"");return S.each(e,function(t,e){r[e]=i.style[A(e)]||o.getPropertyValue(e)}),r}}var a="";if("string"==t(e))n||0===n?a=c(e)+":"+f(e,n):this.each(function(){this.style.removeProperty(c(e))});else for(T in e)e[T]||0===e[T]?a+=c(T)+":"+f(T,e[T])+";":this.each(function(){this.style.removeProperty(c(T))});return this.each(function(){this.style.cssText+=";"+a})},index:function(t){return t?this.indexOf(S(t)[0]):this.parent().children().indexOf(this[0])},hasClass:function(t){return!!t&&$.some.call(this,function(t){return this.test(w(t))},l(t))},addClass:function(t){return t?this.each(function(e){if("className"in this){C=[];var n=w(this);g(this,t,e,n).split(/\s+/g).forEach(function(t){S(this).hasClass(t)||C.push(t)},this),C.length&&w(this,n+(n?" ":"")+C.join(" "))}}):this},removeClass:function(t){return this.each(function(e){if("className"in this){if(t===E)return w(this,"");C=w(this),g(this,t,e,C).split(/\s+/g).forEach(function(t){C=C.replace(l(t)," ")}),w(this,C.trim())}})},toggleClass:function(t,e){return t?this.each(function(n){var i=S(this);g(this,t,n,w(this)).split(/\s+/g).forEach(function(t){(e===E?!i.hasClass(t):e)?i.addClass(t):i.removeClass(t)})}):this},scrollTop:function(t){if(this.length){var e="scrollTop"in this[0];return t===E?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===E?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(),i=_.test(e[0].nodeName)?{top:0,left:0}:e.offset();return n.top-=parseFloat(S(t).css("margin-top"))||0,n.left-=parseFloat(S(t).css("margin-left"))||0,i.top+=parseFloat(S(e[0]).css("border-top-width"))||0,i.left+=parseFloat(S(e[0]).css("border-left-width"))||0,{top:n.top-i.top,left:n.left-i.left}}},offsetParent:function(){return this.map(function(){for(var t=this.offsetParent||N.body;t&&!_.test(t.nodeName)&&"static"==S(t).css("position");)t=t.offsetParent;return t})}},S.fn.detach=S.fn.remove,["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});S.fn[t]=function(r){var o,a=this[0];return r===E?n(a)?a["inner"+e]:i(a)?a.documentElement["scroll"+e]:(o=this.offset())&&o[t]:this.each(function(e){a=S(this),a.css(t,g(this,r,e,a[t]()))})}}),q.forEach(function(e,n){var i=n%2;S.fn[e]=function(){var e,r,o=S.map(arguments,function(n){var i=[];return e=t(n),"array"==e?(n.forEach(function(t){return t.nodeType!==E?i.push(t):S.zepto.isZ(t)?i=i.concat(t.get()):void(i=i.concat(Y.fragment(t)))}),i):"object"==e||null==n?n:Y.fragment(n)}),a=this.length>1;return o.length<1?this:this.each(function(t,e){r=i?e:e.parentNode,e=0==n?e.nextSibling:1==n?e.firstChild:2==n?e:null;var s=S.contains(N.documentElement,r);o.forEach(function(t){if(a)t=t.cloneNode(!0);else if(!r)return S(t).remove();r.insertBefore(t,e),s&&x(t,function(t){if(!(null==t.nodeName||"SCRIPT"!==t.nodeName.toUpperCase()||t.type&&"text/javascript"!==t.type||t.src)){var e=t.ownerDocument?t.ownerDocument.defaultView:window;e.eval.call(e,t.innerHTML)}})})})},S.fn[i?e+"To":"insert"+(n?"Before":"After")]=function(t){return S(t)[e](this),this}}),Y.Z.prototype=d.prototype=S.fn,Y.uniq=j,Y.deserializeValue=b,S.zepto=Y,S}();window.Zepto=n,void 0===window.$&&(window.$=n)},243:function(t,e,n){n(110),n(109),n(96),n(108),n(107),n(105),n(79),t.exports=n(78)},31:function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});e.compareVersion=function(t,e){var n=t.split("."),i=e.split(".");if(t===e)return 0;for(var r=0;r<n.length;r++){var o=parseInt(n[r]);if(!i[r])return 1;var a=parseInt(i[r]);if(o<a)return-1;if(o>a)return 1}return-1}},78:function(t,e,n){"use strict";function i(){var t=0,e=0,n=screen.height,i=screen.width,r=document.documentElement.clientHeight,u=document.documentElement.clientWidth,f=window.devicePixelRatio;switch(window.orientation){case 0:case 180:s?(t=Math.max(n,i),e=Math.max(r,u),o||a||t/f>=e&&u!=i&&(t/=f)):(t=Math.min(n,i),e=Math.min(r,u),o||a||Math.ceil(t/f)>=e&&r!=n&&(t/=f));break;case-90:case 90:s?(t=Math.min(n,i),e=Math.min(r,u),o||a||t/f>=e&&r!=n&&(t/=f)):c||l?(t=Math.max(n,i),e=Math.max(r,u),o||a||t/f>=e&&u!=i&&(t=t/f-100)):(t=Math.max(n,i),e=Math.max(r,u),o||a||Math.ceil(t/f)>=e&&u!=i&&(t/=f));break;default:t=i}window.remFontSize=t/16,document.documentElement.style.fontSize=t/16+"px";try{for(var h=document.getElementById(kb.settings.id+"_kb").querySelectorAll(".keyboardEle"),p=0;p<h.length;p++)$(h[p]).removeClass("active").removeClass("active2")}catch(t){}}var r=n(31),o=window.navigator.appVersion.match(/iPad/gi),a=window.navigator.appVersion.match(/iphone/gi),s=window.navigator.appVersion.match(/SM-T800/gi),u=window.navigator.appVersion.match(/UCBrowser/gi),c=window.navigator.appVersion.match(/Lenovo A890e/gi)&&window.navigator.appVersion.match(/360 Aphone Browser/gi),l=window.navigator.appVersion.match(/HUAWEI D2-6070/gi)&&window.navigator.appVersion.match(/LieBaoFast/gi),f=window.navigator.userAgent.match(/Android[\S\s]+AppleWebkit\/(\d{3})/i),h=window.navigator.userAgent.match(/U3\/((\d+|\.){5,})/i),p=h&&parseInt(h[1].split(".").join(""),10)>=80,d=window.navigator.appVersion.match(/(iphone|ipad|ipod)/gi),m=!0,v=window.navigator.appVersion.match(/android/gi);if(function(){o&&(document.querySelector("html").className="ua-ipad")}(),v&&u){var g=null;window.addEventListener("orientationchange",function(){m=!1,clearTimeout(g),g=setTimeout(i,300)},!1);navigator.userAgent.match(/Firefox/gi)&&window.addEventListener("resize",function(){clearTimeout(g),g=setTimeout(i,300)},!1),i()}else!function(t){function e(){var t=o.getAttribute("data-dpr");if(t)try{a=parseInt(t)}catch(t){}var e=o.getAttribute("data-android-dpr");if(e&&v)try{a=parseInt(e)}catch(t){}var n=o.getAttribute("data-ios-dpr");if(n&&d)try{a=parseInt(n)}catch(t){}if("no"!=o.getAttribute("data-rem")){var i=o.getBoundingClientRect().width/a,r=i/16,s=r*a;$.device.pc&&(s=30),o.style.fontSize=s+"px";var u=o.getAttribute("data-sysfont");if(v&&u){var c=document.createElement("div");c.style.cssText="width:1rem;height:0;overflow: hidden;position:absolute;z-index:-1;visibility: hidden;",document.body.appendChild(c);var l=c.offsetWidth;document.body.removeChild(c);var f=document.querySelector("html"),h=parseFloat(f.style.fontSize)||0,p=h;l!=h&&(p=Math.pow(h,2)/l),f.style.fontSize=p+"px"}}}var n,i=t.document,o=i.documentElement,a=t.devicePixelRatio||1;d||f&&f[1]>534||p||(a=1),a=parseInt(a);var s=o.getAttribute("data-dpr");if(s)try{a=parseInt(s)}catch(t){}var u=o.getAttribute("data-android-dpr");if(u&&v)try{a=parseInt(u)}catch(t){}var c=o.getAttribute("data-ios-dpr");if(c&&d)try{a=parseInt(c)}catch(t){}o.setAttribute("data-dpr",a);var l=1/a,h=i.querySelector('meta[name="viewport"]');h||(h=i.createElement("meta"),h.setAttribute("name","viewport"),i.head.appendChild(h)),$.device.ios&&r.compareVersion($.device.osVersion,"10.0.0")<0&&(l=1),o.setAttribute("data-scale",l),"no"!=o.getAttribute("data-rem")&&h.setAttribute("content","width=device-width,user-scalable=no,initial-scale="+l+",maximum-scale="+l+",minimum-scale="+l+",viewport-fit=cover"),$.device.pc||t.addEventListener("resize",function(){clearTimeout(n),n=setTimeout(e,300)},!1),t.addEventListener("pageshow",function(t){t.persisted&&(clearTimeout(n),n=setTimeout(e,300))},!1),e()}(window)},79:function(t,e,n){"use strict";function i(t,e){function n(t){if(t.target===this)for(e.call(this,t),i=0;i<r.length;i++)o.off(r[i],n)}var i,r=t,o=this;if(e)for(i=0;i<r.length;i++)o.on(r[i],n)}["width","height"].forEach(function(t){var e=t.replace(/./,function(t){return t[0].toUpperCase()});$.fn["outer"+e]=function(e){var n=this;if(n){var i=n[t]();return{width:["left","right"],height:["top","bottom"]}[t].forEach(function(t){e&&(i+=parseInt(n.css("margin-"+t),10))}),i}return null}}),$.support=function(){return{touch:!!("ontouchstart"in window||window.DocumentTouch&&document instanceof window.DocumentTouch)}}(),$.touchEvents={start:$.support.touch?"touchstart":"mousedown",move:$.support.touch?"touchmove":"mousemove",end:$.support.touch?"touchend":"mouseup"},$.getTranslate=function(t,e){var n,i,r,o;return void 0===e&&(e="x"),r=window.getComputedStyle(t,null),window.WebKitCSSMatrix?o=new WebKitCSSMatrix("none"===r.webkitTransform?"":r.webkitTransform):(o=r.MozTransform||r.transform||r.getPropertyValue("transform").replace("translate(","matrix(1, 0, 0, 1,"),n=o.toString().split(",")),"x"===e&&(i=window.WebKitCSSMatrix?o.m41:16===n.length?parseFloat(n[12]):parseFloat(n[4])),"y"===e&&(i=window.WebKitCSSMatrix?o.m42:16===n.length?parseFloat(n[13]):parseFloat(n[5])),i||0},$.requestAnimationFrame=function(t){return window.requestAnimationFrame?window.requestAnimationFrame(t):window.webkitRequestAnimationFrame?window.webkitRequestAnimationFrame(t):window.mozRequestAnimationFrame?window.mozRequestAnimationFrame(t):window.setTimeout(t,1e3/60)},$.cancelAnimationFrame=function(t){return window.cancelAnimationFrame?window.cancelAnimationFrame(t):window.webkitCancelAnimationFrame?window.webkitCancelAnimationFrame(t):window.mozCancelAnimationFrame?window.mozCancelAnimationFrame(t):window.clearTimeout(t)},$.fn.dataset=function(){var t={},e=this[0].dataset;for(var n in e){var i=t[n]=e[n];"false"===i?t[n]=!1:"true"===i?t[n]=!0:parseFloat(i)===1*i&&(t[n]=1*i)}return $.extend({},t,this[0].__eleData)},$.fn.zeptoData=$.fn.data,$.fn.data=function(t,e){var n=$(this).dataset();if(!t)return n;if(void 0===e){var i=n[t],r=this[0].__eleData;return r&&t in r?r[t]:i}for(var o=0;o<this.length;o++){var a=this[o];t in n&&delete a.dataset[t],a.__eleData||(a.__eleData={}),a.__eleData[t]=e}return this},$.fn.animationEnd=function(t){return i.call(this,["webkitAnimationEnd","animationend"],t),this},$.fn.transitionEnd=function(t){return i.call(this,["webkitTransitionEnd","transitionend"],t),this},$.fn.transition=function(t){"string"!=typeof t&&(t+="ms");for(var e=0;e<this.length;e++){var n=this[e].style;n.webkitTransitionDuration=n.MozTransitionDuration=n.transitionDuration=t}return this},$.fn.transform=function(t){for(var e=0;e<this.length;e++){var n=this[e].style;n.webkitTransform=n.MozTransform=n.transform=t}return this},$.fn.prevAll=function(t){var e=[],n=this[0];if(!n)return $([]);for(;n.previousElementSibling;){var i=n.previousElementSibling;t?$(i).is(t)&&e.push(i):e.push(i),n=i}return $(e)},$.fn.nextAll=function(t){var e=[],n=this[0];if(!n)return $([]);for(;n.nextElementSibling;){var i=n.nextElementSibling;t?$(i).is(t)&&e.push(i):e.push(i),n=i}return $(e)},$.fn.show=function(){function t(t){var n,i;return e[t]||(n=document.createElement(t),document.body.appendChild(n),i=getComputedStyle(n,"").getPropertyValue("display"),n.parentNode.removeChild(n),"none"===i&&(i="block"),e[t]=i),e[t]}var e={};return this.each(function(){"none"===this.style.display&&(this.style.display=""),getComputedStyle(this,"").getPropertyValue("display"),this.style.display=t(this.nodeName)})},$.fn.serializeArray=function(){var t,e,n=[],i=function e(i){if(i.forEach)return i.forEach(e);n.push({name:t,value:i})};return this[0]&&$.each(this[0].elements,function(n,r){e=r.type,t=r.name,t&&"fieldset"!=r.nodeName.toLowerCase()&&!r.disabled&&"submit"!=e&&"reset"!=e&&"button"!=e&&"file"!=e&&("radio"!=e&&"checkbox"!=e||r.checked)&&i($(r).val())}),n},$.fn.serialize=function(){var t=[];return this.serializeArray().forEach(function(e){t.push(encodeURIComponent(e.name)+"="+encodeURIComponent(e.value))}),t.join("&")}},96:function(t,e,n){"use strict";!function(t){function e(t,e,n,i){return Math.abs(t-e)>=Math.abs(n-i)?t-e>0?"Left":"Right":n-i>0?"Up":"Down"}function n(){l=null,h.last&&(h.el.trigger("longTap"),h={})}function i(){l&&clearTimeout(l),l=null}function r(){s&&clearTimeout(s),u&&clearTimeout(u),c&&clearTimeout(c),l&&clearTimeout(l),s=u=c=l=null,h={}}function o(t){return("touch"==t.pointerType||t.pointerType==t.MSPOINTER_TYPE_TOUCH)&&t.isPrimary}function a(t,e){return t.type=="pointer"+e||t.type.toLowerCase()=="mspointer"+e}var s,u,c,l,f,h={};t(document).ready(function(){var p,d,m,v,g=0,y=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",function(e){(v=a(e,"down"))&&!o(e)||(m=v?e:e.touches[0],e.touches&&1===e.touches.length&&h.x2&&(h.x2=void 0,h.y2=void 0),p=Date.now(),d=p-(h.last||p),h.el=t("tagName"in m.target?m.target:m.target.parentNode),s&&clearTimeout(s),h.x1=m.pageX,h.y1=m.pageY,d>0&&d<=250&&(h.isDoubleTap=!0),h.last=p,l=setTimeout(n,750),f&&v&&f.addPointer(e.pointerId))}).on("touchmove MSPointerMove",function(t){(v=a(t,"move"))&&!o(t)||(m=v?t:t.touches[0],i(),h.x2=m.pageX,h.y2=m.pageY,g+=Math.abs(h.x1-h.x2),y+=Math.abs(h.y1-h.y2))}).on("touchend MSPointerUp",function(n){(v=a(n,"up"))&&!o(n)||(i(),h.x2&&Math.abs(h.x1-h.x2)>30||h.y2&&Math.abs(h.y1-h.y2)>30?c=setTimeout(function(){h.el&&(h.el.trigger("swipe"),h.el.trigger("swipe"+e(h.x1,h.x2,h.y1,h.y2))),h={}},0):"last"in h&&(g<30&&y<30?u=setTimeout(function(){var e=t.Event("tap");e.cancelTouch=r,h.el&&h.el.trigger(e),h.isDoubleTap?(h.el&&h.el.trigger("doubleTap"),h={}):s=setTimeout(function(){s=null,h.el&&h.el.trigger("singleTap"),h={}},250)},0):h={}),g=y=0)}).on("touchcancel MSPointerCancel",r),t(window).on("scroll",r)}),["swipe","swipeLeft","swipeRight","swipeUp","swipeDown","doubleTap","tap","singleTap","longTap"].forEach(function(e){t.fn[e]=function(t){return this.on(e,t)}})}(Zepto)}})});
|
|
1
|
+
(function webpackUniversalModuleDefinition(root, factory) {
|
|
2
|
+
if(typeof exports === 'object' && typeof module === 'object')
|
|
3
|
+
module.exports = factory();
|
|
4
|
+
else if(typeof define === 'function' && define.amd)
|
|
5
|
+
define([], factory);
|
|
6
|
+
else if(typeof exports === 'object')
|
|
7
|
+
exports["fastman"] = factory();
|
|
8
|
+
else
|
|
9
|
+
root["fastman"] = factory();
|
|
10
|
+
})(this, function() {
|
|
11
|
+
return /******/ (function(modules) { // webpackBootstrap
|
|
12
|
+
/******/ // install a JSONP callback for chunk loading
|
|
13
|
+
/******/ var parentJsonpFunction = window["webpackJsonpfastman"];
|
|
14
|
+
/******/ window["webpackJsonpfastman"] = function webpackJsonpCallback(chunkIds, moreModules, executeModules) {
|
|
15
|
+
/******/ // add "moreModules" to the modules object,
|
|
16
|
+
/******/ // then flag all "chunkIds" as loaded and fire callback
|
|
17
|
+
/******/ var moduleId, chunkId, i = 0, resolves = [], result;
|
|
18
|
+
/******/ for(;i < chunkIds.length; i++) {
|
|
19
|
+
/******/ chunkId = chunkIds[i];
|
|
20
|
+
/******/ if(installedChunks[chunkId]) {
|
|
21
|
+
/******/ resolves.push(installedChunks[chunkId][0]);
|
|
22
|
+
/******/ }
|
|
23
|
+
/******/ installedChunks[chunkId] = 0;
|
|
24
|
+
/******/ }
|
|
25
|
+
/******/ for(moduleId in moreModules) {
|
|
26
|
+
/******/ if(Object.prototype.hasOwnProperty.call(moreModules, moduleId)) {
|
|
27
|
+
/******/ modules[moduleId] = moreModules[moduleId];
|
|
28
|
+
/******/ }
|
|
29
|
+
/******/ }
|
|
30
|
+
/******/ if(parentJsonpFunction) parentJsonpFunction(chunkIds, moreModules, executeModules);
|
|
31
|
+
/******/ while(resolves.length) {
|
|
32
|
+
/******/ resolves.shift()();
|
|
33
|
+
/******/ }
|
|
34
|
+
/******/ if(executeModules) {
|
|
35
|
+
/******/ for(i=0; i < executeModules.length; i++) {
|
|
36
|
+
/******/ result = __webpack_require__(__webpack_require__.s = executeModules[i]);
|
|
37
|
+
/******/ }
|
|
38
|
+
/******/ }
|
|
39
|
+
/******/ return result;
|
|
40
|
+
/******/ };
|
|
41
|
+
/******/
|
|
42
|
+
/******/ // The module cache
|
|
43
|
+
/******/ var installedModules = {};
|
|
44
|
+
/******/
|
|
45
|
+
/******/ // objects to store loaded and loading chunks
|
|
46
|
+
/******/ var installedChunks = {
|
|
47
|
+
/******/ 32: 0
|
|
48
|
+
/******/ };
|
|
49
|
+
/******/
|
|
50
|
+
/******/ // The require function
|
|
51
|
+
/******/ function __webpack_require__(moduleId) {
|
|
52
|
+
/******/
|
|
53
|
+
/******/ // Check if module is in cache
|
|
54
|
+
/******/ if(installedModules[moduleId]) {
|
|
55
|
+
/******/ return installedModules[moduleId].exports;
|
|
56
|
+
/******/ }
|
|
57
|
+
/******/ // Create a new module (and put it into the cache)
|
|
58
|
+
/******/ var module = installedModules[moduleId] = {
|
|
59
|
+
/******/ i: moduleId,
|
|
60
|
+
/******/ l: false,
|
|
61
|
+
/******/ exports: {}
|
|
62
|
+
/******/ };
|
|
63
|
+
/******/
|
|
64
|
+
/******/ // Execute the module function
|
|
65
|
+
/******/ modules[moduleId].call(module.exports, module, module.exports, __webpack_require__);
|
|
66
|
+
/******/
|
|
67
|
+
/******/ // Flag the module as loaded
|
|
68
|
+
/******/ module.l = true;
|
|
69
|
+
/******/
|
|
70
|
+
/******/ // Return the exports of the module
|
|
71
|
+
/******/ return module.exports;
|
|
72
|
+
/******/ }
|
|
73
|
+
/******/
|
|
74
|
+
/******/ // This file contains only the entry chunk.
|
|
75
|
+
/******/ // The chunk loading function for additional chunks
|
|
76
|
+
/******/ __webpack_require__.e = function requireEnsure(chunkId) {
|
|
77
|
+
/******/ var installedChunkData = installedChunks[chunkId];
|
|
78
|
+
/******/ if(installedChunkData === 0) {
|
|
79
|
+
/******/ return new Promise(function(resolve) { resolve(); });
|
|
80
|
+
/******/ }
|
|
81
|
+
/******/
|
|
82
|
+
/******/ // a Promise means "currently loading".
|
|
83
|
+
/******/ if(installedChunkData) {
|
|
84
|
+
/******/ return installedChunkData[2];
|
|
85
|
+
/******/ }
|
|
86
|
+
/******/
|
|
87
|
+
/******/ // setup Promise in chunk cache
|
|
88
|
+
/******/ var promise = new Promise(function(resolve, reject) {
|
|
89
|
+
/******/ installedChunkData = installedChunks[chunkId] = [resolve, reject];
|
|
90
|
+
/******/ });
|
|
91
|
+
/******/ installedChunkData[2] = promise;
|
|
92
|
+
/******/
|
|
93
|
+
/******/ // start chunk loading
|
|
94
|
+
/******/ var head = document.getElementsByTagName('head')[0];
|
|
95
|
+
/******/ var script = document.createElement('script');
|
|
96
|
+
/******/ script.type = 'text/javascript';
|
|
97
|
+
/******/ script.charset = 'utf-8';
|
|
98
|
+
/******/ script.async = true;
|
|
99
|
+
/******/ script.timeout = 120000;
|
|
100
|
+
/******/
|
|
101
|
+
/******/ if (__webpack_require__.nc) {
|
|
102
|
+
/******/ script.setAttribute("nonce", __webpack_require__.nc);
|
|
103
|
+
/******/ }
|
|
104
|
+
/******/ script.src = __webpack_require__.p + "" + chunkId + ".js";
|
|
105
|
+
/******/ var timeout = setTimeout(onScriptComplete, 120000);
|
|
106
|
+
/******/ script.onerror = script.onload = onScriptComplete;
|
|
107
|
+
/******/ function onScriptComplete() {
|
|
108
|
+
/******/ // avoid mem leaks in IE.
|
|
109
|
+
/******/ script.onerror = script.onload = null;
|
|
110
|
+
/******/ clearTimeout(timeout);
|
|
111
|
+
/******/ var chunk = installedChunks[chunkId];
|
|
112
|
+
/******/ if(chunk !== 0) {
|
|
113
|
+
/******/ if(chunk) {
|
|
114
|
+
/******/ chunk[1](new Error('Loading chunk ' + chunkId + ' failed.'));
|
|
115
|
+
/******/ }
|
|
116
|
+
/******/ installedChunks[chunkId] = undefined;
|
|
117
|
+
/******/ }
|
|
118
|
+
/******/ };
|
|
119
|
+
/******/ head.appendChild(script);
|
|
120
|
+
/******/
|
|
121
|
+
/******/ return promise;
|
|
122
|
+
/******/ };
|
|
123
|
+
/******/
|
|
124
|
+
/******/ // expose the modules object (__webpack_modules__)
|
|
125
|
+
/******/ __webpack_require__.m = modules;
|
|
126
|
+
/******/
|
|
127
|
+
/******/ // expose the module cache
|
|
128
|
+
/******/ __webpack_require__.c = installedModules;
|
|
129
|
+
/******/
|
|
130
|
+
/******/ // identity function for calling harmony imports with the correct context
|
|
131
|
+
/******/ __webpack_require__.i = function(value) { return value; };
|
|
132
|
+
/******/
|
|
133
|
+
/******/ // define getter function for harmony exports
|
|
134
|
+
/******/ __webpack_require__.d = function(exports, name, getter) {
|
|
135
|
+
/******/ if(!__webpack_require__.o(exports, name)) {
|
|
136
|
+
/******/ Object.defineProperty(exports, name, {
|
|
137
|
+
/******/ configurable: false,
|
|
138
|
+
/******/ enumerable: true,
|
|
139
|
+
/******/ get: getter
|
|
140
|
+
/******/ });
|
|
141
|
+
/******/ }
|
|
142
|
+
/******/ };
|
|
143
|
+
/******/
|
|
144
|
+
/******/ // getDefaultExport function for compatibility with non-harmony modules
|
|
145
|
+
/******/ __webpack_require__.n = function(module) {
|
|
146
|
+
/******/ var getter = module && module.__esModule ?
|
|
147
|
+
/******/ function getDefault() { return module['default']; } :
|
|
148
|
+
/******/ function getModuleExports() { return module; };
|
|
149
|
+
/******/ __webpack_require__.d(getter, 'a', getter);
|
|
150
|
+
/******/ return getter;
|
|
151
|
+
/******/ };
|
|
152
|
+
/******/
|
|
153
|
+
/******/ // Object.prototype.hasOwnProperty.call
|
|
154
|
+
/******/ __webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };
|
|
155
|
+
/******/
|
|
156
|
+
/******/ // __webpack_public_path__
|
|
157
|
+
/******/ __webpack_require__.p = "";
|
|
158
|
+
/******/
|
|
159
|
+
/******/ // on error function for async loading
|
|
160
|
+
/******/ __webpack_require__.oe = function(err) { console.error(err); throw err; };
|
|
161
|
+
/******/
|
|
162
|
+
/******/ // Load entry module and return exports
|
|
163
|
+
/******/ return __webpack_require__(__webpack_require__.s = 243);
|
|
164
|
+
/******/ })
|
|
165
|
+
/************************************************************************/
|
|
166
|
+
/******/ ({
|
|
167
|
+
|
|
168
|
+
/***/ 105:
|
|
169
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
170
|
+
|
|
171
|
+
"use strict";
|
|
172
|
+
|
|
173
|
+
|
|
174
|
+
/**
|
|
175
|
+
* Created by dfzq on 2017/2/12.
|
|
176
|
+
*/
|
|
177
|
+
var device = {};
|
|
178
|
+
var ua = navigator.userAgent;
|
|
179
|
+
|
|
180
|
+
var android = ua.match(/(Android);?[\s\/]+([\d.]+)?/);
|
|
181
|
+
var ipad = ua.match(/(iPad).*OS\s([\d_]+)/);
|
|
182
|
+
var ipod = ua.match(/(iPod)(.*OS\s([\d_]+))?/);
|
|
183
|
+
var iphone = !ipad && ua.match(/(iPhone\sOS)\s([\d_]+)/);
|
|
184
|
+
var ie = ua.match(/MSIE\s([\d.]+)/) || ua.match(/Trident\/[\d](?=[^?]+).*rv:([0-9.].)/);
|
|
185
|
+
var harmony = ua.match(/(OpenHarmony)\s([\d.]+)/i);
|
|
186
|
+
|
|
187
|
+
device.ios = device.android = device.iphone = device.ipad = device.androidChrome = device.ie = device.pc = device.harmony = false;
|
|
188
|
+
|
|
189
|
+
// Harmony
|
|
190
|
+
if (harmony) {
|
|
191
|
+
device.os = 'harmony';
|
|
192
|
+
device.osVersion = harmony[2];
|
|
193
|
+
device.harmony = true;
|
|
194
|
+
}
|
|
195
|
+
// Android
|
|
196
|
+
if (android) {
|
|
197
|
+
device.os = 'android';
|
|
198
|
+
device.osVersion = android[2];
|
|
199
|
+
device.android = true;
|
|
200
|
+
device.androidChrome = ua.toLowerCase().indexOf('chrome') >= 0;
|
|
201
|
+
}
|
|
202
|
+
if (ipad || iphone || ipod) {
|
|
203
|
+
device.os = 'ios';
|
|
204
|
+
device.ios = true;
|
|
205
|
+
}
|
|
206
|
+
// iOS
|
|
207
|
+
if (iphone && !ipod) {
|
|
208
|
+
device.osVersion = iphone[2].replace(/_/g, '.');
|
|
209
|
+
device.iphone = true;
|
|
210
|
+
}
|
|
211
|
+
if (ipad) {
|
|
212
|
+
device.osVersion = ipad[2].replace(/_/g, '.');
|
|
213
|
+
device.ipad = true;
|
|
214
|
+
}
|
|
215
|
+
if (ipod) {
|
|
216
|
+
device.osVersion = ipod[3] ? ipod[3].replace(/_/g, '.') : null;
|
|
217
|
+
device.iphone = true;
|
|
218
|
+
}
|
|
219
|
+
// iOS 8+ changed UA
|
|
220
|
+
if (device.ios && device.osVersion && ua.indexOf('Version/') >= 0) {
|
|
221
|
+
if (device.osVersion.split('.')[0] === '10') {
|
|
222
|
+
device.osVersion = ua.toLowerCase().split('version/')[1].split(' ')[0];
|
|
223
|
+
}
|
|
224
|
+
}
|
|
225
|
+
|
|
226
|
+
// 获取是否是ie 以及版本
|
|
227
|
+
if (ie) {
|
|
228
|
+
device.ie = true;
|
|
229
|
+
device.ieVersion = ie[1];
|
|
230
|
+
}
|
|
231
|
+
|
|
232
|
+
// 如果不是安卓或ios 则认为是pc浏览器
|
|
233
|
+
if (!device.os) {
|
|
234
|
+
device.os = "pc";
|
|
235
|
+
device.pc = true;
|
|
236
|
+
}
|
|
237
|
+
|
|
238
|
+
// 判断是否 支持history
|
|
239
|
+
device.hasNativeHistory = history && history.pushState;
|
|
240
|
+
|
|
241
|
+
// Webview
|
|
242
|
+
device.webView = (iphone || ipad || ipod) && ua.match(/.*AppleWebKit(?!.*Safari)/i);
|
|
243
|
+
|
|
244
|
+
// Minimal UI
|
|
245
|
+
if (device.os && device.os === 'ios') {
|
|
246
|
+
var osVersionArr = device.osVersion.split('.');
|
|
247
|
+
device.minimalUi = !device.webView && (ipod || iphone) && (osVersionArr[0] * 1 === 7 ? osVersionArr[1] * 1 >= 1 : osVersionArr[0] * 1 > 7) && $('meta[name="viewport"]').length > 0 && $('meta[name="viewport"]').attr('content').indexOf('minimal-ui') >= 0;
|
|
248
|
+
}
|
|
249
|
+
|
|
250
|
+
// Check for status bar and fullscreen app mode
|
|
251
|
+
var windowWidth = $(window).width();
|
|
252
|
+
var windowHeight = $(window).height();
|
|
253
|
+
device.statusBar = false;
|
|
254
|
+
if (device.webView && windowWidth * windowHeight === screen.width * screen.height) {
|
|
255
|
+
device.statusBar = true;
|
|
256
|
+
} else {
|
|
257
|
+
device.statusBar = false;
|
|
258
|
+
}
|
|
259
|
+
|
|
260
|
+
// Classes
|
|
261
|
+
var classNames = [];
|
|
262
|
+
|
|
263
|
+
// Pixel Ratio
|
|
264
|
+
device.pixelRatio = window.devicePixelRatio || 1;
|
|
265
|
+
classNames.push('pixel-ratio-' + Math.floor(device.pixelRatio));
|
|
266
|
+
if (device.pixelRatio >= 2) {
|
|
267
|
+
classNames.push('retina');
|
|
268
|
+
}
|
|
269
|
+
|
|
270
|
+
// OS classes
|
|
271
|
+
if (device.os) {
|
|
272
|
+
classNames.push(device.os);
|
|
273
|
+
|
|
274
|
+
if (device.osVersion) {
|
|
275
|
+
classNames.push(device.os + '-' + device.osVersion.split('.')[0], device.os + '-' + device.osVersion.replace(/\./g, '-'));
|
|
276
|
+
}
|
|
277
|
+
if (device.os === 'ios') {
|
|
278
|
+
var major = parseInt(device.osVersion.split('.')[0], 10);
|
|
279
|
+
for (var i = major - 1; i >= 6; i--) {
|
|
280
|
+
classNames.push('ios-gt-' + i);
|
|
281
|
+
}
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
// Status bar classes
|
|
285
|
+
if (device.statusBar) {
|
|
286
|
+
classNames.push('with-statusbar-overlay');
|
|
287
|
+
} else {
|
|
288
|
+
$('html').removeClass('with-statusbar-overlay');
|
|
289
|
+
}
|
|
290
|
+
|
|
291
|
+
// Add html classes
|
|
292
|
+
if (classNames.length > 0) $('html').addClass(classNames.join(' '));
|
|
293
|
+
|
|
294
|
+
// 微信判断
|
|
295
|
+
device.isWeixin = /MicroMessenger/i.test(ua);
|
|
296
|
+
|
|
297
|
+
$.device = device;
|
|
298
|
+
|
|
299
|
+
/***/ }),
|
|
300
|
+
|
|
301
|
+
/***/ 107:
|
|
302
|
+
/***/ (function(module, exports) {
|
|
303
|
+
|
|
304
|
+
// Zepto.js
|
|
305
|
+
// (c) 2010-2016 Thomas Fuchs
|
|
306
|
+
// Zepto.js may be freely distributed under the MIT license.
|
|
307
|
+
|
|
308
|
+
;(function($){
|
|
309
|
+
var jsonpID = +new Date(),
|
|
310
|
+
document = window.document,
|
|
311
|
+
key,
|
|
312
|
+
name,
|
|
313
|
+
rscript = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
|
|
314
|
+
scriptTypeRE = /^(?:text|application)\/javascript/i,
|
|
315
|
+
xmlTypeRE = /^(?:text|application)\/xml/i,
|
|
316
|
+
jsonType = 'application/json',
|
|
317
|
+
htmlType = 'text/html',
|
|
318
|
+
blankRE = /^\s*$/,
|
|
319
|
+
originAnchor = document.createElement('a')
|
|
320
|
+
|
|
321
|
+
originAnchor.href = window.location.href
|
|
322
|
+
|
|
323
|
+
// trigger a custom event and return false if it was cancelled
|
|
324
|
+
function triggerAndReturn(context, eventName, data) {
|
|
325
|
+
var event = $.Event(eventName)
|
|
326
|
+
$(context).trigger(event, data)
|
|
327
|
+
return !event.isDefaultPrevented()
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
// trigger an Ajax "global" event
|
|
331
|
+
function triggerGlobal(settings, context, eventName, data) {
|
|
332
|
+
if (settings.global) return triggerAndReturn(context || document, eventName, data)
|
|
333
|
+
}
|
|
334
|
+
|
|
335
|
+
// Number of active Ajax requests
|
|
336
|
+
$.active = 0
|
|
337
|
+
|
|
338
|
+
function ajaxStart(settings) {
|
|
339
|
+
if (settings.global && $.active++ === 0) triggerGlobal(settings, null, 'ajaxStart')
|
|
340
|
+
}
|
|
341
|
+
function ajaxStop(settings) {
|
|
342
|
+
if (settings.global && !(--$.active)) triggerGlobal(settings, null, 'ajaxStop')
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
// triggers an extra global event "ajaxBeforeSend" that's like "ajaxSend" but cancelable
|
|
346
|
+
function ajaxBeforeSend(xhr, settings) {
|
|
347
|
+
var context = settings.context
|
|
348
|
+
if (settings.beforeSend.call(context, xhr, settings) === false ||
|
|
349
|
+
triggerGlobal(settings, context, 'ajaxBeforeSend', [xhr, settings]) === false)
|
|
350
|
+
return false
|
|
351
|
+
|
|
352
|
+
triggerGlobal(settings, context, 'ajaxSend', [xhr, settings])
|
|
353
|
+
}
|
|
354
|
+
function ajaxSuccess(data, xhr, settings, deferred) {
|
|
355
|
+
var context = settings.context, status = 'success'
|
|
356
|
+
settings.success.call(context, data, status, xhr)
|
|
357
|
+
if (deferred) deferred.resolveWith(context, [data, status, xhr])
|
|
358
|
+
triggerGlobal(settings, context, 'ajaxSuccess', [xhr, settings, data])
|
|
359
|
+
ajaxComplete(status, xhr, settings)
|
|
360
|
+
}
|
|
361
|
+
// type: "timeout", "error", "abort", "parsererror"
|
|
362
|
+
function ajaxError(error, type, xhr, settings, deferred) {
|
|
363
|
+
var context = settings.context
|
|
364
|
+
settings.error.call(context, xhr, type, error)
|
|
365
|
+
if (deferred) deferred.rejectWith(context, [xhr, type, error])
|
|
366
|
+
triggerGlobal(settings, context, 'ajaxError', [xhr, settings, error || type])
|
|
367
|
+
ajaxComplete(type, xhr, settings)
|
|
368
|
+
}
|
|
369
|
+
// status: "success", "notmodified", "error", "timeout", "abort", "parsererror"
|
|
370
|
+
function ajaxComplete(status, xhr, settings) {
|
|
371
|
+
var context = settings.context
|
|
372
|
+
settings.complete.call(context, xhr, status)
|
|
373
|
+
triggerGlobal(settings, context, 'ajaxComplete', [xhr, settings])
|
|
374
|
+
ajaxStop(settings)
|
|
375
|
+
}
|
|
376
|
+
|
|
377
|
+
function ajaxDataFilter(data, type, settings) {
|
|
378
|
+
if (settings.dataFilter == empty) return data
|
|
379
|
+
var context = settings.context
|
|
380
|
+
return settings.dataFilter.call(context, data, type)
|
|
381
|
+
}
|
|
382
|
+
|
|
383
|
+
// Empty function, used as default callback
|
|
384
|
+
function empty() {}
|
|
385
|
+
|
|
386
|
+
$.ajaxJSONP = function(options, deferred){
|
|
387
|
+
if (!('type' in options)) return $.ajax(options)
|
|
388
|
+
|
|
389
|
+
var _callbackName = options.jsonpCallback,
|
|
390
|
+
callbackName = ($.isFunction(_callbackName) ?
|
|
391
|
+
_callbackName() : _callbackName) || ('Zepto' + (jsonpID++)),
|
|
392
|
+
script = document.createElement('script'),
|
|
393
|
+
originalCallback = window[callbackName],
|
|
394
|
+
responseData,
|
|
395
|
+
abort = function(errorType) {
|
|
396
|
+
$(script).triggerHandler('error', errorType || 'abort')
|
|
397
|
+
},
|
|
398
|
+
xhr = { abort: abort }, abortTimeout
|
|
399
|
+
|
|
400
|
+
if (deferred) deferred.promise(xhr)
|
|
401
|
+
|
|
402
|
+
$(script).on('load error', function(e, errorType){
|
|
403
|
+
clearTimeout(abortTimeout)
|
|
404
|
+
$(script).off().remove()
|
|
405
|
+
|
|
406
|
+
if (e.type == 'error' || !responseData) {
|
|
407
|
+
ajaxError(null, errorType || 'error', xhr, options, deferred)
|
|
408
|
+
} else {
|
|
409
|
+
ajaxSuccess(responseData[0], xhr, options, deferred)
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
window[callbackName] = originalCallback
|
|
413
|
+
if (responseData && $.isFunction(originalCallback))
|
|
414
|
+
originalCallback(responseData[0])
|
|
415
|
+
|
|
416
|
+
originalCallback = responseData = undefined
|
|
417
|
+
})
|
|
418
|
+
|
|
419
|
+
if (ajaxBeforeSend(xhr, options) === false) {
|
|
420
|
+
abort('abort')
|
|
421
|
+
return xhr
|
|
422
|
+
}
|
|
423
|
+
|
|
424
|
+
window[callbackName] = function(){
|
|
425
|
+
responseData = arguments
|
|
426
|
+
}
|
|
427
|
+
|
|
428
|
+
script.src = options.url.replace(/\?(.+)=\?/, '?$1=' + callbackName)
|
|
429
|
+
document.head.appendChild(script)
|
|
430
|
+
|
|
431
|
+
if (options.timeout > 0) abortTimeout = setTimeout(function(){
|
|
432
|
+
abort('timeout')
|
|
433
|
+
}, options.timeout)
|
|
434
|
+
|
|
435
|
+
return xhr
|
|
436
|
+
}
|
|
437
|
+
|
|
438
|
+
$.ajaxSettings = {
|
|
439
|
+
// Default type of request
|
|
440
|
+
type: 'GET',
|
|
441
|
+
// Callback that is executed before request
|
|
442
|
+
beforeSend: empty,
|
|
443
|
+
// Callback that is executed if the request succeeds
|
|
444
|
+
success: empty,
|
|
445
|
+
// Callback that is executed the the server drops error
|
|
446
|
+
error: empty,
|
|
447
|
+
// Callback that is executed on request complete (both: error and success)
|
|
448
|
+
complete: empty,
|
|
449
|
+
// The context for the callbacks
|
|
450
|
+
context: null,
|
|
451
|
+
// Whether to trigger "global" Ajax events
|
|
452
|
+
global: true,
|
|
453
|
+
// Transport
|
|
454
|
+
xhr: function () {
|
|
455
|
+
return new window.XMLHttpRequest()
|
|
456
|
+
},
|
|
457
|
+
// MIME types mapping
|
|
458
|
+
// IIS returns Javascript as "application/x-javascript"
|
|
459
|
+
accepts: {
|
|
460
|
+
script: 'text/javascript, application/javascript, application/x-javascript',
|
|
461
|
+
json: jsonType,
|
|
462
|
+
xml: 'application/xml, text/xml',
|
|
463
|
+
html: htmlType,
|
|
464
|
+
text: 'text/plain'
|
|
465
|
+
},
|
|
466
|
+
// Whether the request is to another domain
|
|
467
|
+
crossDomain: false,
|
|
468
|
+
// Default timeout
|
|
469
|
+
timeout: 0,
|
|
470
|
+
// Whether data should be serialized to string
|
|
471
|
+
processData: true,
|
|
472
|
+
// Whether the browser should be allowed to cache GET responses
|
|
473
|
+
cache: true,
|
|
474
|
+
//Used to handle the raw response data of XMLHttpRequest.
|
|
475
|
+
//This is a pre-filtering function to sanitize the response.
|
|
476
|
+
//The sanitized response should be returned
|
|
477
|
+
dataFilter: empty
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
function mimeToDataType(mime) {
|
|
481
|
+
if (mime) mime = mime.split(';', 2)[0]
|
|
482
|
+
return mime && ( mime == htmlType ? 'html' :
|
|
483
|
+
mime == jsonType ? 'json' :
|
|
484
|
+
scriptTypeRE.test(mime) ? 'script' :
|
|
485
|
+
xmlTypeRE.test(mime) && 'xml' ) || 'text'
|
|
486
|
+
}
|
|
487
|
+
|
|
488
|
+
function appendQuery(url, query) {
|
|
489
|
+
if (query == '') return url
|
|
490
|
+
return (url + '&' + query).replace(/[&?]{1,2}/, '?')
|
|
491
|
+
}
|
|
492
|
+
|
|
493
|
+
// serialize payload and append it to the URL for GET requests
|
|
494
|
+
function serializeData(options) {
|
|
495
|
+
if (options.processData && options.data && $.type(options.data) != "string")
|
|
496
|
+
options.data = $.param(options.data, options.traditional)
|
|
497
|
+
if (options.data && (!options.type || options.type.toUpperCase() == 'GET' || 'jsonp' == options.dataType))
|
|
498
|
+
options.url = appendQuery(options.url, options.data), options.data = undefined
|
|
499
|
+
}
|
|
500
|
+
|
|
501
|
+
$.ajax = function(options){
|
|
502
|
+
var settings = $.extend({}, options || {}),
|
|
503
|
+
deferred = $.Deferred && $.Deferred(),
|
|
504
|
+
urlAnchor, hashIndex
|
|
505
|
+
for (key in $.ajaxSettings) if (settings[key] === undefined) settings[key] = $.ajaxSettings[key]
|
|
506
|
+
|
|
507
|
+
ajaxStart(settings)
|
|
508
|
+
|
|
509
|
+
if (!settings.crossDomain) {
|
|
510
|
+
urlAnchor = document.createElement('a')
|
|
511
|
+
urlAnchor.href = settings.url
|
|
512
|
+
// cleans up URL for .href (IE only), see https://github.com/madrobby/zepto/pull/1049
|
|
513
|
+
urlAnchor.href = urlAnchor.href
|
|
514
|
+
settings.crossDomain = (originAnchor.protocol + '//' + originAnchor.host) !== (urlAnchor.protocol + '//' + urlAnchor.host)
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
if (!settings.url) settings.url = window.location.toString()
|
|
518
|
+
if ((hashIndex = settings.url.indexOf('#')) > -1) settings.url = settings.url.slice(0, hashIndex)
|
|
519
|
+
serializeData(settings)
|
|
520
|
+
|
|
521
|
+
var dataType = settings.dataType, hasPlaceholder = /\?.+=\?/.test(settings.url)
|
|
522
|
+
if (hasPlaceholder) dataType = 'jsonp'
|
|
523
|
+
|
|
524
|
+
if (settings.cache === false || (
|
|
525
|
+
(!options || options.cache !== true) &&
|
|
526
|
+
('script' == dataType || 'jsonp' == dataType)
|
|
527
|
+
))
|
|
528
|
+
settings.url = appendQuery(settings.url, '_=' + Date.now())
|
|
529
|
+
|
|
530
|
+
if ('jsonp' == dataType) {
|
|
531
|
+
if (!hasPlaceholder)
|
|
532
|
+
settings.url = appendQuery(settings.url,
|
|
533
|
+
settings.jsonp ? (settings.jsonp + '=?') : settings.jsonp === false ? '' : 'callback=?')
|
|
534
|
+
return $.ajaxJSONP(settings, deferred)
|
|
535
|
+
}
|
|
536
|
+
|
|
537
|
+
var mime = settings.accepts[dataType],
|
|
538
|
+
headers = { },
|
|
539
|
+
setHeader = function(name, value) { headers[name.toLowerCase()] = [name, value] },
|
|
540
|
+
protocol = /^([\w-]+:)\/\//.test(settings.url) ? RegExp.$1 : window.location.protocol,
|
|
541
|
+
xhr = settings.xhr(),
|
|
542
|
+
nativeSetHeader = xhr.setRequestHeader,
|
|
543
|
+
abortTimeout
|
|
544
|
+
|
|
545
|
+
if (deferred) deferred.promise(xhr)
|
|
546
|
+
|
|
547
|
+
if (!settings.crossDomain) setHeader('X-Requested-With', 'XMLHttpRequest')
|
|
548
|
+
setHeader('Accept', mime || '*/*')
|
|
549
|
+
if (mime = settings.mimeType || mime) {
|
|
550
|
+
if (mime.indexOf(',') > -1) mime = mime.split(',', 2)[0]
|
|
551
|
+
xhr.overrideMimeType && xhr.overrideMimeType(mime)
|
|
552
|
+
}
|
|
553
|
+
if (settings.contentType || (settings.contentType !== false && settings.data && settings.type.toUpperCase() != 'GET'))
|
|
554
|
+
setHeader('Content-Type', settings.contentType || 'application/x-www-form-urlencoded')
|
|
555
|
+
|
|
556
|
+
if (settings.headers) for (name in settings.headers) setHeader(name, settings.headers[name])
|
|
557
|
+
xhr.setRequestHeader = setHeader
|
|
558
|
+
|
|
559
|
+
xhr.onreadystatechange = function(){
|
|
560
|
+
if (xhr.readyState == 4) {
|
|
561
|
+
xhr.onreadystatechange = empty
|
|
562
|
+
clearTimeout(abortTimeout)
|
|
563
|
+
var result, error = false
|
|
564
|
+
if ((xhr.status >= 200 && xhr.status < 300) || xhr.status == 304 || (xhr.status == 0 && protocol == 'file:')) {
|
|
565
|
+
dataType = dataType || mimeToDataType(settings.mimeType || xhr.getResponseHeader('content-type'))
|
|
566
|
+
|
|
567
|
+
if (xhr.responseType == 'arraybuffer' || xhr.responseType == 'blob')
|
|
568
|
+
result = xhr.response
|
|
569
|
+
else {
|
|
570
|
+
result = xhr.responseText
|
|
571
|
+
|
|
572
|
+
try {
|
|
573
|
+
// http://perfectionkills.com/global-eval-what-are-the-options/
|
|
574
|
+
// sanitize response accordingly if data filter callback provided
|
|
575
|
+
result = ajaxDataFilter(result, dataType, settings)
|
|
576
|
+
if (dataType == 'script') (1,eval)(result)
|
|
577
|
+
else if (dataType == 'xml') result = xhr.responseXML
|
|
578
|
+
else if (dataType == 'json') result = blankRE.test(result) ? null : $.parseJSON(result)
|
|
579
|
+
} catch (e) { error = e }
|
|
580
|
+
|
|
581
|
+
if (error) return ajaxError(error, 'parsererror', xhr, settings, deferred)
|
|
582
|
+
}
|
|
583
|
+
|
|
584
|
+
ajaxSuccess(result, xhr, settings, deferred)
|
|
585
|
+
} else {
|
|
586
|
+
ajaxError(xhr.statusText || null, xhr.status ? 'error' : 'abort', xhr, settings, deferred)
|
|
587
|
+
}
|
|
588
|
+
}
|
|
589
|
+
}
|
|
590
|
+
|
|
591
|
+
if (ajaxBeforeSend(xhr, settings) === false) {
|
|
592
|
+
xhr.abort()
|
|
593
|
+
ajaxError(null, 'abort', xhr, settings, deferred)
|
|
594
|
+
return xhr
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
var async = 'async' in settings ? settings.async : true
|
|
598
|
+
xhr.open(settings.type, settings.url, async, settings.username, settings.password)
|
|
599
|
+
|
|
600
|
+
if (settings.xhrFields) for (name in settings.xhrFields) xhr[name] = settings.xhrFields[name]
|
|
601
|
+
|
|
602
|
+
for (name in headers) nativeSetHeader.apply(xhr, headers[name])
|
|
603
|
+
|
|
604
|
+
if (settings.timeout > 0) abortTimeout = setTimeout(function(){
|
|
605
|
+
xhr.onreadystatechange = empty
|
|
606
|
+
xhr.abort()
|
|
607
|
+
ajaxError(null, 'timeout', xhr, settings, deferred)
|
|
608
|
+
}, settings.timeout)
|
|
609
|
+
|
|
610
|
+
// avoid sending empty string (#319)
|
|
611
|
+
xhr.send(settings.data ? settings.data : null)
|
|
612
|
+
return xhr
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
// handle optional data/success arguments
|
|
616
|
+
function parseArguments(url, data, success, dataType) {
|
|
617
|
+
if ($.isFunction(data)) dataType = success, success = data, data = undefined
|
|
618
|
+
if (!$.isFunction(success)) dataType = success, success = undefined
|
|
619
|
+
return {
|
|
620
|
+
url: url
|
|
621
|
+
, data: data
|
|
622
|
+
, success: success
|
|
623
|
+
, dataType: dataType
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
$.get = function(/* url, data, success, dataType */){
|
|
628
|
+
return $.ajax(parseArguments.apply(null, arguments))
|
|
629
|
+
}
|
|
630
|
+
|
|
631
|
+
$.post = function(/* url, data, success, dataType */){
|
|
632
|
+
var options = parseArguments.apply(null, arguments)
|
|
633
|
+
options.type = 'POST'
|
|
634
|
+
return $.ajax(options)
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
$.getJSON = function(/* url, data, success */){
|
|
638
|
+
var options = parseArguments.apply(null, arguments)
|
|
639
|
+
options.dataType = 'json'
|
|
640
|
+
return $.ajax(options)
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
$.fn.load = function(url, data, success){
|
|
644
|
+
if (!this.length) return this
|
|
645
|
+
var self = this, parts = url.split(/\s/), selector,
|
|
646
|
+
options = parseArguments(url, data, success),
|
|
647
|
+
callback = options.success
|
|
648
|
+
if (parts.length > 1) options.url = parts[0], selector = parts[1]
|
|
649
|
+
options.success = function(response){
|
|
650
|
+
self.html(selector ?
|
|
651
|
+
$('<div>').html(response.replace(rscript, "")).find(selector)
|
|
652
|
+
: response)
|
|
653
|
+
callback && callback.apply(self, arguments)
|
|
654
|
+
}
|
|
655
|
+
$.ajax(options)
|
|
656
|
+
return this
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
var escape = encodeURIComponent
|
|
660
|
+
|
|
661
|
+
function serialize(params, obj, traditional, scope){
|
|
662
|
+
var type, array = $.isArray(obj), hash = $.isPlainObject(obj)
|
|
663
|
+
$.each(obj, function(key, value) {
|
|
664
|
+
type = $.type(value)
|
|
665
|
+
if (scope) key = traditional ? scope :
|
|
666
|
+
scope + '[' + (hash || type == 'object' || type == 'array' ? key : '') + ']'
|
|
667
|
+
// handle data in serializeArray() format
|
|
668
|
+
if (!scope && array) params.add(value.name, value.value)
|
|
669
|
+
// recurse into nested objects
|
|
670
|
+
else if (type == "array" || (!traditional && type == "object"))
|
|
671
|
+
serialize(params, value, traditional, key)
|
|
672
|
+
else params.add(key, value)
|
|
673
|
+
})
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
$.param = function(obj, traditional){
|
|
677
|
+
var params = []
|
|
678
|
+
params.add = function(key, value) {
|
|
679
|
+
if ($.isFunction(value)) value = value()
|
|
680
|
+
if (value == null) value = ""
|
|
681
|
+
this.push(escape(key) + '=' + escape(value))
|
|
682
|
+
}
|
|
683
|
+
serialize(params, obj, traditional)
|
|
684
|
+
return params.join('&').replace(/%20/g, '+')
|
|
685
|
+
}
|
|
686
|
+
})(Zepto)
|
|
687
|
+
|
|
688
|
+
|
|
689
|
+
/***/ }),
|
|
690
|
+
|
|
691
|
+
/***/ 108:
|
|
692
|
+
/***/ (function(module, exports) {
|
|
693
|
+
|
|
694
|
+
// Zepto.js
|
|
695
|
+
// (c) 2010-2016 Thomas Fuchs
|
|
696
|
+
// Zepto.js may be freely distributed under the MIT license.
|
|
697
|
+
|
|
698
|
+
// The following code is heavily inspired by jQuery's $.fn.data()
|
|
699
|
+
|
|
700
|
+
;(function($){
|
|
701
|
+
var data = {}, dataAttr = $.fn.data, camelize = $.camelCase,
|
|
702
|
+
exp = $.expando = 'Zepto' + (+new Date()), emptyArray = []
|
|
703
|
+
|
|
704
|
+
// Get value from node:
|
|
705
|
+
// 1. first try key as given,
|
|
706
|
+
// 2. then try camelized key,
|
|
707
|
+
// 3. fall back to reading "data-*" attribute.
|
|
708
|
+
function getData(node, name) {
|
|
709
|
+
var id = node[exp], store = id && data[id]
|
|
710
|
+
if (name === undefined) return store || setData(node)
|
|
711
|
+
else {
|
|
712
|
+
if (store) {
|
|
713
|
+
if (name in store) return store[name]
|
|
714
|
+
var camelName = camelize(name)
|
|
715
|
+
if (camelName in store) return store[camelName]
|
|
716
|
+
}
|
|
717
|
+
return dataAttr.call($(node), name)
|
|
718
|
+
}
|
|
719
|
+
}
|
|
720
|
+
|
|
721
|
+
// Store value under camelized key on node
|
|
722
|
+
function setData(node, name, value) {
|
|
723
|
+
var id = node[exp] || (node[exp] = ++$.uuid),
|
|
724
|
+
store = data[id] || (data[id] = attributeData(node))
|
|
725
|
+
if (name !== undefined) store[camelize(name)] = value
|
|
726
|
+
return store
|
|
727
|
+
}
|
|
728
|
+
|
|
729
|
+
// Read all "data-*" attributes from a node
|
|
730
|
+
function attributeData(node) {
|
|
731
|
+
var store = {}
|
|
732
|
+
$.each(node.attributes || emptyArray, function(i, attr){
|
|
733
|
+
if (attr.name.indexOf('data-') == 0)
|
|
734
|
+
store[camelize(attr.name.replace('data-', ''))] =
|
|
735
|
+
$.zepto.deserializeValue(attr.value)
|
|
736
|
+
})
|
|
737
|
+
return store
|
|
738
|
+
}
|
|
739
|
+
|
|
740
|
+
$.fn.data = function(name, value) {
|
|
741
|
+
return value === undefined ?
|
|
742
|
+
// set multiple values via object
|
|
743
|
+
$.isPlainObject(name) ?
|
|
744
|
+
this.each(function(i, node){
|
|
745
|
+
$.each(name, function(key, value){ setData(node, key, value) })
|
|
746
|
+
}) :
|
|
747
|
+
// get value from first element
|
|
748
|
+
(0 in this ? getData(this[0], name) : undefined) :
|
|
749
|
+
// set value on all elements
|
|
750
|
+
this.each(function(){ setData(this, name, value) })
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
$.data = function(elem, name, value) {
|
|
754
|
+
return $(elem).data(name, value)
|
|
755
|
+
}
|
|
756
|
+
|
|
757
|
+
$.hasData = function(elem) {
|
|
758
|
+
var id = elem[exp], store = id && data[id]
|
|
759
|
+
return store ? !$.isEmptyObject(store) : false
|
|
760
|
+
}
|
|
761
|
+
|
|
762
|
+
$.fn.removeData = function(names) {
|
|
763
|
+
if (typeof names == 'string') names = names.split(/\s+/)
|
|
764
|
+
return this.each(function(){
|
|
765
|
+
var id = this[exp], store = id && data[id]
|
|
766
|
+
if (store) $.each(names || store, function(key){
|
|
767
|
+
delete store[names ? camelize(this) : key]
|
|
768
|
+
})
|
|
769
|
+
})
|
|
770
|
+
}
|
|
771
|
+
|
|
772
|
+
// Generate extended `remove` and `empty` functions
|
|
773
|
+
;['remove', 'empty'].forEach(function(methodName){
|
|
774
|
+
var origFn = $.fn[methodName]
|
|
775
|
+
$.fn[methodName] = function() {
|
|
776
|
+
var elements = this.find('*')
|
|
777
|
+
if (methodName === 'remove') elements = elements.add(this)
|
|
778
|
+
elements.removeData()
|
|
779
|
+
return origFn.call(this)
|
|
780
|
+
}
|
|
781
|
+
})
|
|
782
|
+
})(Zepto)
|
|
783
|
+
|
|
784
|
+
|
|
785
|
+
/***/ }),
|
|
786
|
+
|
|
787
|
+
/***/ 109:
|
|
788
|
+
/***/ (function(module, exports) {
|
|
789
|
+
|
|
790
|
+
// Zepto.js
|
|
791
|
+
// (c) 2010-2016 Thomas Fuchs
|
|
792
|
+
// Zepto.js may be freely distributed under the MIT license.
|
|
793
|
+
|
|
794
|
+
;(function($){
|
|
795
|
+
var _zid = 1, undefined,
|
|
796
|
+
slice = Array.prototype.slice,
|
|
797
|
+
isFunction = $.isFunction,
|
|
798
|
+
isString = function(obj){ return typeof obj == 'string' },
|
|
799
|
+
handlers = {},
|
|
800
|
+
specialEvents={},
|
|
801
|
+
focusinSupported = 'onfocusin' in window,
|
|
802
|
+
focus = { focus: 'focusin', blur: 'focusout' },
|
|
803
|
+
hover = { mouseenter: 'mouseover', mouseleave: 'mouseout' }
|
|
804
|
+
|
|
805
|
+
specialEvents.click = specialEvents.mousedown = specialEvents.mouseup = specialEvents.mousemove = 'MouseEvents'
|
|
806
|
+
|
|
807
|
+
function zid(element) {
|
|
808
|
+
return element._zid || (element._zid = _zid++)
|
|
809
|
+
}
|
|
810
|
+
function findHandlers(element, event, fn, selector) {
|
|
811
|
+
event = parse(event)
|
|
812
|
+
if (event.ns) var matcher = matcherFor(event.ns)
|
|
813
|
+
return (handlers[zid(element)] || []).filter(function(handler) {
|
|
814
|
+
return handler
|
|
815
|
+
&& (!event.e || handler.e == event.e)
|
|
816
|
+
&& (!event.ns || matcher.test(handler.ns))
|
|
817
|
+
&& (!fn || zid(handler.fn) === zid(fn))
|
|
818
|
+
&& (!selector || handler.sel == selector)
|
|
819
|
+
})
|
|
820
|
+
}
|
|
821
|
+
function parse(event) {
|
|
822
|
+
var parts = ('' + event).split('.')
|
|
823
|
+
return {e: parts[0], ns: parts.slice(1).sort().join(' ')}
|
|
824
|
+
}
|
|
825
|
+
function matcherFor(ns) {
|
|
826
|
+
return new RegExp('(?:^| )' + ns.replace(' ', ' .* ?') + '(?: |$)')
|
|
827
|
+
}
|
|
828
|
+
|
|
829
|
+
function eventCapture(handler, captureSetting) {
|
|
830
|
+
return handler.del &&
|
|
831
|
+
(!focusinSupported && (handler.e in focus)) ||
|
|
832
|
+
!!captureSetting
|
|
833
|
+
}
|
|
834
|
+
|
|
835
|
+
function realEvent(type) {
|
|
836
|
+
return hover[type] || (focusinSupported && focus[type]) || type
|
|
837
|
+
}
|
|
838
|
+
|
|
839
|
+
function add(element, events, fn, data, selector, delegator, capture){
|
|
840
|
+
var id = zid(element), set = (handlers[id] || (handlers[id] = []))
|
|
841
|
+
events.split(/\s/).forEach(function(event){
|
|
842
|
+
if (event == 'ready') return $(document).ready(fn)
|
|
843
|
+
var handler = parse(event)
|
|
844
|
+
handler.fn = fn
|
|
845
|
+
handler.sel = selector
|
|
846
|
+
// emulate mouseenter, mouseleave
|
|
847
|
+
if (handler.e in hover) fn = function(e){
|
|
848
|
+
var related = e.relatedTarget
|
|
849
|
+
if (!related || (related !== this && !$.contains(this, related)))
|
|
850
|
+
return handler.fn.apply(this, arguments)
|
|
851
|
+
}
|
|
852
|
+
handler.del = delegator
|
|
853
|
+
var callback = delegator || fn
|
|
854
|
+
handler.proxy = function(e){
|
|
855
|
+
e = compatible(e)
|
|
856
|
+
if (e.isImmediatePropagationStopped()) return
|
|
857
|
+
e.data = data
|
|
858
|
+
var result = callback.apply(element, e._args == undefined ? [e] : [e].concat(e._args))
|
|
859
|
+
if (result === false) e.preventDefault(), e.stopPropagation()
|
|
860
|
+
return result
|
|
861
|
+
}
|
|
862
|
+
handler.i = set.length
|
|
863
|
+
set.push(handler)
|
|
864
|
+
if ('addEventListener' in element)
|
|
865
|
+
element.addEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))
|
|
866
|
+
})
|
|
867
|
+
}
|
|
868
|
+
function remove(element, events, fn, selector, capture){
|
|
869
|
+
var id = zid(element)
|
|
870
|
+
;(events || '').split(/\s/).forEach(function(event){
|
|
871
|
+
findHandlers(element, event, fn, selector).forEach(function(handler){
|
|
872
|
+
delete handlers[id][handler.i]
|
|
873
|
+
if ('removeEventListener' in element)
|
|
874
|
+
element.removeEventListener(realEvent(handler.e), handler.proxy, eventCapture(handler, capture))
|
|
875
|
+
})
|
|
876
|
+
})
|
|
877
|
+
}
|
|
878
|
+
|
|
879
|
+
$.event = { add: add, remove: remove }
|
|
880
|
+
|
|
881
|
+
$.proxy = function(fn, context) {
|
|
882
|
+
var args = (2 in arguments) && slice.call(arguments, 2)
|
|
883
|
+
if (isFunction(fn)) {
|
|
884
|
+
var proxyFn = function(){ return fn.apply(context, args ? args.concat(slice.call(arguments)) : arguments) }
|
|
885
|
+
proxyFn._zid = zid(fn)
|
|
886
|
+
return proxyFn
|
|
887
|
+
} else if (isString(context)) {
|
|
888
|
+
if (args) {
|
|
889
|
+
args.unshift(fn[context], fn)
|
|
890
|
+
return $.proxy.apply(null, args)
|
|
891
|
+
} else {
|
|
892
|
+
return $.proxy(fn[context], fn)
|
|
893
|
+
}
|
|
894
|
+
} else {
|
|
895
|
+
throw new TypeError("expected function")
|
|
896
|
+
}
|
|
897
|
+
}
|
|
898
|
+
|
|
899
|
+
$.fn.bind = function(event, data, callback){
|
|
900
|
+
return this.on(event, data, callback)
|
|
901
|
+
}
|
|
902
|
+
$.fn.unbind = function(event, callback){
|
|
903
|
+
return this.off(event, callback)
|
|
904
|
+
}
|
|
905
|
+
$.fn.one = function(event, selector, data, callback){
|
|
906
|
+
return this.on(event, selector, data, callback, 1)
|
|
907
|
+
}
|
|
908
|
+
|
|
909
|
+
var returnTrue = function(){return true},
|
|
910
|
+
returnFalse = function(){return false},
|
|
911
|
+
ignoreProperties = /^([A-Z]|returnValue$|layer[XY]$|webkitMovement[XY]$)/,
|
|
912
|
+
eventMethods = {
|
|
913
|
+
preventDefault: 'isDefaultPrevented',
|
|
914
|
+
stopImmediatePropagation: 'isImmediatePropagationStopped',
|
|
915
|
+
stopPropagation: 'isPropagationStopped'
|
|
916
|
+
}
|
|
917
|
+
|
|
918
|
+
function compatible(event, source) {
|
|
919
|
+
if (source || !event.isDefaultPrevented) {
|
|
920
|
+
source || (source = event)
|
|
921
|
+
|
|
922
|
+
$.each(eventMethods, function(name, predicate) {
|
|
923
|
+
var sourceMethod = source[name]
|
|
924
|
+
event[name] = function(){
|
|
925
|
+
this[predicate] = returnTrue
|
|
926
|
+
return sourceMethod && sourceMethod.apply(source, arguments)
|
|
927
|
+
}
|
|
928
|
+
event[predicate] = returnFalse
|
|
929
|
+
})
|
|
930
|
+
|
|
931
|
+
event.timeStamp || (event.timeStamp = Date.now())
|
|
932
|
+
|
|
933
|
+
if (source.defaultPrevented !== undefined ? source.defaultPrevented :
|
|
934
|
+
'returnValue' in source ? source.returnValue === false :
|
|
935
|
+
source.getPreventDefault && source.getPreventDefault())
|
|
936
|
+
event.isDefaultPrevented = returnTrue
|
|
937
|
+
}
|
|
938
|
+
return event
|
|
939
|
+
}
|
|
940
|
+
|
|
941
|
+
function createProxy(event) {
|
|
942
|
+
var key, proxy = { originalEvent: event }
|
|
943
|
+
for (key in event)
|
|
944
|
+
if (!ignoreProperties.test(key) && event[key] !== undefined) proxy[key] = event[key]
|
|
945
|
+
|
|
946
|
+
return compatible(proxy, event)
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
$.fn.delegate = function(selector, event, callback){
|
|
950
|
+
return this.on(event, selector, callback)
|
|
951
|
+
}
|
|
952
|
+
$.fn.undelegate = function(selector, event, callback){
|
|
953
|
+
return this.off(event, selector, callback)
|
|
954
|
+
}
|
|
955
|
+
|
|
956
|
+
$.fn.live = function(event, callback){
|
|
957
|
+
$(document.body).delegate(this.selector, event, callback)
|
|
958
|
+
return this
|
|
959
|
+
}
|
|
960
|
+
$.fn.die = function(event, callback){
|
|
961
|
+
$(document.body).undelegate(this.selector, event, callback)
|
|
962
|
+
return this
|
|
963
|
+
}
|
|
964
|
+
|
|
965
|
+
$.fn.on = function(event, selector, data, callback, one){
|
|
966
|
+
var autoRemove, delegator, $this = this
|
|
967
|
+
if (event && !isString(event)) {
|
|
968
|
+
$.each(event, function(type, fn){
|
|
969
|
+
$this.on(type, selector, data, fn, one)
|
|
970
|
+
})
|
|
971
|
+
return $this
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
if (!isString(selector) && !isFunction(callback) && callback !== false)
|
|
975
|
+
callback = data, data = selector, selector = undefined
|
|
976
|
+
if (callback === undefined || data === false)
|
|
977
|
+
callback = data, data = undefined
|
|
978
|
+
|
|
979
|
+
if (callback === false) callback = returnFalse
|
|
980
|
+
|
|
981
|
+
return $this.each(function(_, element){
|
|
982
|
+
if (one) autoRemove = function(e){
|
|
983
|
+
remove(element, e.type, callback)
|
|
984
|
+
return callback.apply(this, arguments)
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
if (selector) delegator = function(e){
|
|
988
|
+
var evt, match = $(e.target).closest(selector, element).get(0)
|
|
989
|
+
if (match && match !== element) {
|
|
990
|
+
evt = $.extend(createProxy(e), {currentTarget: match, liveFired: element})
|
|
991
|
+
return (autoRemove || callback).apply(match, [evt].concat(slice.call(arguments, 1)))
|
|
992
|
+
}
|
|
993
|
+
}
|
|
994
|
+
|
|
995
|
+
add(element, event, callback, data, selector, delegator || autoRemove)
|
|
996
|
+
})
|
|
997
|
+
}
|
|
998
|
+
$.fn.off = function(event, selector, callback){
|
|
999
|
+
var $this = this
|
|
1000
|
+
if (event && !isString(event)) {
|
|
1001
|
+
$.each(event, function(type, fn){
|
|
1002
|
+
$this.off(type, selector, fn)
|
|
1003
|
+
})
|
|
1004
|
+
return $this
|
|
1005
|
+
}
|
|
1006
|
+
|
|
1007
|
+
if (!isString(selector) && !isFunction(callback) && callback !== false)
|
|
1008
|
+
callback = selector, selector = undefined
|
|
1009
|
+
|
|
1010
|
+
if (callback === false) callback = returnFalse
|
|
1011
|
+
|
|
1012
|
+
return $this.each(function(){
|
|
1013
|
+
remove(this, event, callback, selector)
|
|
1014
|
+
})
|
|
1015
|
+
}
|
|
1016
|
+
|
|
1017
|
+
$.fn.trigger = function(event, args){
|
|
1018
|
+
event = (isString(event) || $.isPlainObject(event)) ? $.Event(event) : compatible(event)
|
|
1019
|
+
event._args = args
|
|
1020
|
+
return this.each(function(){
|
|
1021
|
+
// handle focus(), blur() by calling them directly
|
|
1022
|
+
if (event.type in focus && typeof this[event.type] == "function") this[event.type]()
|
|
1023
|
+
// items in the collection might not be DOM elements
|
|
1024
|
+
else if ('dispatchEvent' in this) this.dispatchEvent(event)
|
|
1025
|
+
else $(this).triggerHandler(event, args)
|
|
1026
|
+
})
|
|
1027
|
+
}
|
|
1028
|
+
|
|
1029
|
+
// triggers event handlers on current element just as if an event occurred,
|
|
1030
|
+
// doesn't trigger an actual event, doesn't bubble
|
|
1031
|
+
$.fn.triggerHandler = function(event, args){
|
|
1032
|
+
var e, result
|
|
1033
|
+
this.each(function(i, element){
|
|
1034
|
+
e = createProxy(isString(event) ? $.Event(event) : event)
|
|
1035
|
+
e._args = args
|
|
1036
|
+
e.target = element
|
|
1037
|
+
$.each(findHandlers(element, event.type || event), function(i, handler){
|
|
1038
|
+
result = handler.proxy(e)
|
|
1039
|
+
if (e.isImmediatePropagationStopped()) return false
|
|
1040
|
+
})
|
|
1041
|
+
})
|
|
1042
|
+
return result
|
|
1043
|
+
}
|
|
1044
|
+
|
|
1045
|
+
// shortcut methods for `.bind(event, fn)` for each event type
|
|
1046
|
+
;('focusin focusout focus blur load resize scroll unload click dblclick '+
|
|
1047
|
+
'mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave '+
|
|
1048
|
+
'change select keydown keypress keyup error').split(' ').forEach(function(event) {
|
|
1049
|
+
$.fn[event] = function(callback) {
|
|
1050
|
+
return (0 in arguments) ?
|
|
1051
|
+
this.bind(event, callback) :
|
|
1052
|
+
this.trigger(event)
|
|
1053
|
+
}
|
|
1054
|
+
})
|
|
1055
|
+
|
|
1056
|
+
$.Event = function(type, props) {
|
|
1057
|
+
if (!isString(type)) props = type, type = props.type
|
|
1058
|
+
var event = document.createEvent(specialEvents[type] || 'Events'), bubbles = true
|
|
1059
|
+
if (props) for (var name in props) (name == 'bubbles') ? (bubbles = !!props[name]) : (event[name] = props[name])
|
|
1060
|
+
event.initEvent(type, bubbles, true)
|
|
1061
|
+
return compatible(event)
|
|
1062
|
+
}
|
|
1063
|
+
|
|
1064
|
+
})(Zepto)
|
|
1065
|
+
|
|
1066
|
+
|
|
1067
|
+
/***/ }),
|
|
1068
|
+
|
|
1069
|
+
/***/ 110:
|
|
1070
|
+
/***/ (function(module, exports) {
|
|
1071
|
+
|
|
1072
|
+
// Zepto.js
|
|
1073
|
+
// (c) 2010-2016 Thomas Fuchs
|
|
1074
|
+
// Zepto.js may be freely distributed under the MIT license.
|
|
1075
|
+
|
|
1076
|
+
var Zepto = (function() {
|
|
1077
|
+
var undefined, key, $, classList, emptyArray = [], concat = emptyArray.concat, filter = emptyArray.filter, slice = emptyArray.slice,
|
|
1078
|
+
document = window.document,
|
|
1079
|
+
elementDisplay = {}, classCache = {},
|
|
1080
|
+
cssNumber = { 'column-count': 1, 'columns': 1, 'font-weight': 1, 'line-height': 1,'opacity': 1, 'z-index': 1, 'zoom': 1 },
|
|
1081
|
+
fragmentRE = /^\s*<(\w+|!)[^>]*>/,
|
|
1082
|
+
singleTagRE = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
|
|
1083
|
+
tagExpanderRE = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/ig,
|
|
1084
|
+
rootNodeRE = /^(?:body|html)$/i,
|
|
1085
|
+
capitalRE = /([A-Z])/g,
|
|
1086
|
+
|
|
1087
|
+
// special attributes that should be get/set via method calls
|
|
1088
|
+
methodAttributes = ['val', 'css', 'html', 'text', 'data', 'width', 'height', 'offset'],
|
|
1089
|
+
|
|
1090
|
+
adjacencyOperators = [ 'after', 'prepend', 'before', 'append' ],
|
|
1091
|
+
table = document.createElement('table'),
|
|
1092
|
+
tableRow = document.createElement('tr'),
|
|
1093
|
+
containers = {
|
|
1094
|
+
'tr': document.createElement('tbody'),
|
|
1095
|
+
'tbody': table, 'thead': table, 'tfoot': table,
|
|
1096
|
+
'td': tableRow, 'th': tableRow,
|
|
1097
|
+
'*': document.createElement('div')
|
|
1098
|
+
},
|
|
1099
|
+
readyRE = /complete|loaded|interactive/,
|
|
1100
|
+
simpleSelectorRE = /^[\w-]*$/,
|
|
1101
|
+
class2type = {},
|
|
1102
|
+
toString = class2type.toString,
|
|
1103
|
+
zepto = {},
|
|
1104
|
+
camelize, uniq,
|
|
1105
|
+
tempParent = document.createElement('div'),
|
|
1106
|
+
propMap = {
|
|
1107
|
+
'tabindex': 'tabIndex',
|
|
1108
|
+
'readonly': 'readOnly',
|
|
1109
|
+
'for': 'htmlFor',
|
|
1110
|
+
'class': 'className',
|
|
1111
|
+
'maxlength': 'maxLength',
|
|
1112
|
+
'cellspacing': 'cellSpacing',
|
|
1113
|
+
'cellpadding': 'cellPadding',
|
|
1114
|
+
'rowspan': 'rowSpan',
|
|
1115
|
+
'colspan': 'colSpan',
|
|
1116
|
+
'usemap': 'useMap',
|
|
1117
|
+
'frameborder': 'frameBorder',
|
|
1118
|
+
'contenteditable': 'contentEditable'
|
|
1119
|
+
},
|
|
1120
|
+
isArray = Array.isArray ||
|
|
1121
|
+
function(object){ return object instanceof Array }
|
|
1122
|
+
|
|
1123
|
+
zepto.matches = function(element, selector) {
|
|
1124
|
+
if (!selector || !element || element.nodeType !== 1) return false
|
|
1125
|
+
var matchesSelector = element.matches || element.webkitMatchesSelector ||
|
|
1126
|
+
element.mozMatchesSelector || element.oMatchesSelector ||
|
|
1127
|
+
element.matchesSelector
|
|
1128
|
+
if (matchesSelector) return matchesSelector.call(element, selector)
|
|
1129
|
+
// fall back to performing a selector:
|
|
1130
|
+
var match, parent = element.parentNode, temp = !parent
|
|
1131
|
+
if (temp) (parent = tempParent).appendChild(element)
|
|
1132
|
+
match = ~zepto.qsa(parent, selector).indexOf(element)
|
|
1133
|
+
temp && tempParent.removeChild(element)
|
|
1134
|
+
return match
|
|
1135
|
+
}
|
|
1136
|
+
|
|
1137
|
+
function type(obj) {
|
|
1138
|
+
return obj == null ? String(obj) :
|
|
1139
|
+
class2type[toString.call(obj)] || "object"
|
|
1140
|
+
}
|
|
1141
|
+
|
|
1142
|
+
function isFunction(value) { return type(value) == "function" }
|
|
1143
|
+
function isWindow(obj) { return obj != null && obj == obj.window }
|
|
1144
|
+
function isDocument(obj) { return obj != null && obj.nodeType == obj.DOCUMENT_NODE }
|
|
1145
|
+
function isObject(obj) { return type(obj) == "object" }
|
|
1146
|
+
function isPlainObject(obj) {
|
|
1147
|
+
return isObject(obj) && !isWindow(obj) && Object.getPrototypeOf(obj) == Object.prototype
|
|
1148
|
+
}
|
|
1149
|
+
|
|
1150
|
+
function likeArray(obj) {
|
|
1151
|
+
var length = !!obj && 'length' in obj && obj.length,
|
|
1152
|
+
type = $.type(obj)
|
|
1153
|
+
|
|
1154
|
+
return 'function' != type && !isWindow(obj) && (
|
|
1155
|
+
'array' == type || length === 0 ||
|
|
1156
|
+
(typeof length == 'number' && length > 0 && (length - 1) in obj)
|
|
1157
|
+
)
|
|
1158
|
+
}
|
|
1159
|
+
|
|
1160
|
+
function compact(array) { return filter.call(array, function(item){ return item != null }) }
|
|
1161
|
+
function flatten(array) { return array.length > 0 ? $.fn.concat.apply([], array) : array }
|
|
1162
|
+
camelize = function(str){ return str.replace(/-+(.)?/g, function(match, chr){ return chr ? chr.toUpperCase() : '' }) }
|
|
1163
|
+
function dasherize(str) {
|
|
1164
|
+
return str.replace(/::/g, '/')
|
|
1165
|
+
.replace(/([A-Z]+)([A-Z][a-z])/g, '$1_$2')
|
|
1166
|
+
.replace(/([a-z\d])([A-Z])/g, '$1_$2')
|
|
1167
|
+
.replace(/_/g, '-')
|
|
1168
|
+
.toLowerCase()
|
|
1169
|
+
}
|
|
1170
|
+
uniq = function(array){ return filter.call(array, function(item, idx){ return array.indexOf(item) == idx }) }
|
|
1171
|
+
|
|
1172
|
+
function classRE(name) {
|
|
1173
|
+
return name in classCache ?
|
|
1174
|
+
classCache[name] : (classCache[name] = new RegExp('(^|\\s)' + name + '(\\s|$)'))
|
|
1175
|
+
}
|
|
1176
|
+
|
|
1177
|
+
function maybeAddPx(name, value) {
|
|
1178
|
+
return (typeof value == "number" && !cssNumber[dasherize(name)]) ? value + "px" : value
|
|
1179
|
+
}
|
|
1180
|
+
|
|
1181
|
+
function defaultDisplay(nodeName) {
|
|
1182
|
+
var element, display
|
|
1183
|
+
if (!elementDisplay[nodeName]) {
|
|
1184
|
+
element = document.createElement(nodeName)
|
|
1185
|
+
document.body.appendChild(element)
|
|
1186
|
+
display = getComputedStyle(element, '').getPropertyValue("display")
|
|
1187
|
+
element.parentNode.removeChild(element)
|
|
1188
|
+
display == "none" && (display = "block")
|
|
1189
|
+
elementDisplay[nodeName] = display
|
|
1190
|
+
}
|
|
1191
|
+
return elementDisplay[nodeName]
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
function children(element) {
|
|
1195
|
+
return 'children' in element ?
|
|
1196
|
+
slice.call(element.children) :
|
|
1197
|
+
$.map(element.childNodes, function(node){ if (node.nodeType == 1) return node })
|
|
1198
|
+
}
|
|
1199
|
+
|
|
1200
|
+
function Z(dom, selector) {
|
|
1201
|
+
var i, len = dom ? dom.length : 0
|
|
1202
|
+
for (i = 0; i < len; i++) this[i] = dom[i]
|
|
1203
|
+
this.length = len
|
|
1204
|
+
this.selector = selector || ''
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
// `$.zepto.fragment` takes a html string and an optional tag name
|
|
1208
|
+
// to generate DOM nodes from the given html string.
|
|
1209
|
+
// The generated DOM nodes are returned as an array.
|
|
1210
|
+
// This function can be overridden in plugins for example to make
|
|
1211
|
+
// it compatible with browsers that don't support the DOM fully.
|
|
1212
|
+
zepto.fragment = function(html, name, properties) {
|
|
1213
|
+
var dom, nodes, container
|
|
1214
|
+
|
|
1215
|
+
// A special case optimization for a single tag
|
|
1216
|
+
if (singleTagRE.test(html)) dom = $(document.createElement(RegExp.$1))
|
|
1217
|
+
|
|
1218
|
+
if (!dom) {
|
|
1219
|
+
if (html.replace) html = html.replace(tagExpanderRE, "<$1></$2>")
|
|
1220
|
+
if (name === undefined) name = fragmentRE.test(html) && RegExp.$1
|
|
1221
|
+
if (!(name in containers)) name = '*'
|
|
1222
|
+
|
|
1223
|
+
container = containers[name]
|
|
1224
|
+
container.innerHTML = '' + html
|
|
1225
|
+
dom = $.each(slice.call(container.childNodes), function(){
|
|
1226
|
+
container.removeChild(this)
|
|
1227
|
+
})
|
|
1228
|
+
}
|
|
1229
|
+
|
|
1230
|
+
if (isPlainObject(properties)) {
|
|
1231
|
+
nodes = $(dom)
|
|
1232
|
+
$.each(properties, function(key, value) {
|
|
1233
|
+
if (methodAttributes.indexOf(key) > -1) nodes[key](value)
|
|
1234
|
+
else nodes.attr(key, value)
|
|
1235
|
+
})
|
|
1236
|
+
}
|
|
1237
|
+
|
|
1238
|
+
return dom
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
// `$.zepto.Z` swaps out the prototype of the given `dom` array
|
|
1242
|
+
// of nodes with `$.fn` and thus supplying all the Zepto functions
|
|
1243
|
+
// to the array. This method can be overridden in plugins.
|
|
1244
|
+
zepto.Z = function(dom, selector) {
|
|
1245
|
+
return new Z(dom, selector)
|
|
1246
|
+
}
|
|
1247
|
+
|
|
1248
|
+
// `$.zepto.isZ` should return `true` if the given object is a Zepto
|
|
1249
|
+
// collection. This method can be overridden in plugins.
|
|
1250
|
+
zepto.isZ = function(object) {
|
|
1251
|
+
return object instanceof zepto.Z
|
|
1252
|
+
}
|
|
1253
|
+
|
|
1254
|
+
// `$.zepto.init` is Zepto's counterpart to jQuery's `$.fn.init` and
|
|
1255
|
+
// takes a CSS selector and an optional context (and handles various
|
|
1256
|
+
// special cases).
|
|
1257
|
+
// This method can be overridden in plugins.
|
|
1258
|
+
zepto.init = function(selector, context) {
|
|
1259
|
+
var dom
|
|
1260
|
+
// If nothing given, return an empty Zepto collection
|
|
1261
|
+
if (!selector) return zepto.Z()
|
|
1262
|
+
// Optimize for string selectors
|
|
1263
|
+
else if (typeof selector == 'string') {
|
|
1264
|
+
selector = selector.trim()
|
|
1265
|
+
// If it's a html fragment, create nodes from it
|
|
1266
|
+
// Note: In both Chrome 21 and Firefox 15, DOM error 12
|
|
1267
|
+
// is thrown if the fragment doesn't begin with <
|
|
1268
|
+
if (selector[0] == '<' && fragmentRE.test(selector))
|
|
1269
|
+
dom = zepto.fragment(selector, RegExp.$1, context), selector = null
|
|
1270
|
+
// If there's a context, create a collection on that context first, and select
|
|
1271
|
+
// nodes from there
|
|
1272
|
+
else if (context !== undefined) return $(context).find(selector)
|
|
1273
|
+
// If it's a CSS selector, use it to select nodes.
|
|
1274
|
+
else dom = zepto.qsa(document, selector)
|
|
1275
|
+
}
|
|
1276
|
+
// If a function is given, call it when the DOM is ready
|
|
1277
|
+
else if (isFunction(selector)) return $(document).ready(selector)
|
|
1278
|
+
// If a Zepto collection is given, just return it
|
|
1279
|
+
else if (zepto.isZ(selector)) return selector
|
|
1280
|
+
else {
|
|
1281
|
+
// normalize array if an array of nodes is given
|
|
1282
|
+
if (isArray(selector)) dom = compact(selector)
|
|
1283
|
+
// Wrap DOM nodes.
|
|
1284
|
+
else if (isObject(selector))
|
|
1285
|
+
dom = [selector], selector = null
|
|
1286
|
+
// If it's a html fragment, create nodes from it
|
|
1287
|
+
else if (fragmentRE.test(selector))
|
|
1288
|
+
dom = zepto.fragment(selector.trim(), RegExp.$1, context), selector = null
|
|
1289
|
+
// If there's a context, create a collection on that context first, and select
|
|
1290
|
+
// nodes from there
|
|
1291
|
+
else if (context !== undefined) return $(context).find(selector)
|
|
1292
|
+
// And last but no least, if it's a CSS selector, use it to select nodes.
|
|
1293
|
+
else dom = zepto.qsa(document, selector)
|
|
1294
|
+
}
|
|
1295
|
+
// create a new Zepto collection from the nodes found
|
|
1296
|
+
return zepto.Z(dom, selector)
|
|
1297
|
+
}
|
|
1298
|
+
|
|
1299
|
+
// `$` will be the base `Zepto` object. When calling this
|
|
1300
|
+
// function just call `$.zepto.init, which makes the implementation
|
|
1301
|
+
// details of selecting nodes and creating Zepto collections
|
|
1302
|
+
// patchable in plugins.
|
|
1303
|
+
$ = function(selector, context){
|
|
1304
|
+
return zepto.init(selector, context)
|
|
1305
|
+
}
|
|
1306
|
+
|
|
1307
|
+
function extend(target, source, deep) {
|
|
1308
|
+
for (key in source)
|
|
1309
|
+
if (deep && (isPlainObject(source[key]) || isArray(source[key]))) {
|
|
1310
|
+
if (isPlainObject(source[key]) && !isPlainObject(target[key]))
|
|
1311
|
+
target[key] = {}
|
|
1312
|
+
if (isArray(source[key]) && !isArray(target[key]))
|
|
1313
|
+
target[key] = []
|
|
1314
|
+
extend(target[key], source[key], deep)
|
|
1315
|
+
}
|
|
1316
|
+
else if (source[key] !== undefined) target[key] = source[key]
|
|
1317
|
+
}
|
|
1318
|
+
|
|
1319
|
+
// Copy all but undefined properties from one or more
|
|
1320
|
+
// objects to the `target` object.
|
|
1321
|
+
$.extend = function(target){
|
|
1322
|
+
var deep, args = slice.call(arguments, 1)
|
|
1323
|
+
if (typeof target == 'boolean') {
|
|
1324
|
+
deep = target
|
|
1325
|
+
target = args.shift()
|
|
1326
|
+
}
|
|
1327
|
+
args.forEach(function(arg){ extend(target, arg, deep) })
|
|
1328
|
+
return target
|
|
1329
|
+
}
|
|
1330
|
+
|
|
1331
|
+
// `$.zepto.qsa` is Zepto's CSS selector implementation which
|
|
1332
|
+
// uses `document.querySelectorAll` and optimizes for some special cases, like `#id`.
|
|
1333
|
+
// This method can be overridden in plugins.
|
|
1334
|
+
zepto.qsa = function(element, selector){
|
|
1335
|
+
var found,
|
|
1336
|
+
maybeID = selector[0] == '#',
|
|
1337
|
+
maybeClass = !maybeID && selector[0] == '.',
|
|
1338
|
+
nameOnly = maybeID || maybeClass ? selector.slice(1) : selector, // Ensure that a 1 char tag name still gets checked
|
|
1339
|
+
isSimple = simpleSelectorRE.test(nameOnly)
|
|
1340
|
+
return (element.getElementById && isSimple && maybeID) ? // Safari DocumentFragment doesn't have getElementById
|
|
1341
|
+
( (found = element.getElementById(nameOnly)) ? [found] : [] ) :
|
|
1342
|
+
(element.nodeType !== 1 && element.nodeType !== 9 && element.nodeType !== 11) ? [] :
|
|
1343
|
+
slice.call(
|
|
1344
|
+
isSimple && !maybeID && element.getElementsByClassName ? // DocumentFragment doesn't have getElementsByClassName/TagName
|
|
1345
|
+
maybeClass ? element.getElementsByClassName(nameOnly) : // If it's simple, it could be a class
|
|
1346
|
+
element.getElementsByTagName(selector) : // Or a tag
|
|
1347
|
+
element.querySelectorAll(selector) // Or it's not simple, and we need to query all
|
|
1348
|
+
)
|
|
1349
|
+
}
|
|
1350
|
+
|
|
1351
|
+
function filtered(nodes, selector) {
|
|
1352
|
+
return selector == null ? $(nodes) : $(nodes).filter(selector)
|
|
1353
|
+
}
|
|
1354
|
+
|
|
1355
|
+
$.contains = document.documentElement.contains ?
|
|
1356
|
+
function(parent, node) {
|
|
1357
|
+
return parent !== node && parent.contains(node)
|
|
1358
|
+
} :
|
|
1359
|
+
function(parent, node) {
|
|
1360
|
+
while (node && (node = node.parentNode))
|
|
1361
|
+
if (node === parent) return true
|
|
1362
|
+
return false
|
|
1363
|
+
}
|
|
1364
|
+
|
|
1365
|
+
function funcArg(context, arg, idx, payload) {
|
|
1366
|
+
return isFunction(arg) ? arg.call(context, idx, payload) : arg
|
|
1367
|
+
}
|
|
1368
|
+
|
|
1369
|
+
function setAttribute(node, name, value) {
|
|
1370
|
+
value == null ? node.removeAttribute(name) : node.setAttribute(name, value)
|
|
1371
|
+
}
|
|
1372
|
+
|
|
1373
|
+
// access className property while respecting SVGAnimatedString
|
|
1374
|
+
function className(node, value){
|
|
1375
|
+
var klass = node.className || '',
|
|
1376
|
+
svg = klass && klass.baseVal !== undefined
|
|
1377
|
+
|
|
1378
|
+
if (value === undefined) return svg ? klass.baseVal : klass
|
|
1379
|
+
svg ? (klass.baseVal = value) : (node.className = value)
|
|
1380
|
+
}
|
|
1381
|
+
|
|
1382
|
+
// "true" => true
|
|
1383
|
+
// "false" => false
|
|
1384
|
+
// "null" => null
|
|
1385
|
+
// "42" => 42
|
|
1386
|
+
// "42.5" => 42.5
|
|
1387
|
+
// "08" => "08"
|
|
1388
|
+
// JSON => parse if valid
|
|
1389
|
+
// String => self
|
|
1390
|
+
function deserializeValue(value) {
|
|
1391
|
+
try {
|
|
1392
|
+
return value ?
|
|
1393
|
+
value == "true" ||
|
|
1394
|
+
( value == "false" ? false :
|
|
1395
|
+
value == "null" ? null :
|
|
1396
|
+
+value + "" == value ? +value :
|
|
1397
|
+
/^[\[\{]/.test(value) ? $.parseJSON(value) :
|
|
1398
|
+
value )
|
|
1399
|
+
: value
|
|
1400
|
+
} catch(e) {
|
|
1401
|
+
return value
|
|
1402
|
+
}
|
|
1403
|
+
}
|
|
1404
|
+
|
|
1405
|
+
$.type = type
|
|
1406
|
+
$.isFunction = isFunction
|
|
1407
|
+
$.isWindow = isWindow
|
|
1408
|
+
$.isArray = isArray
|
|
1409
|
+
$.isPlainObject = isPlainObject
|
|
1410
|
+
|
|
1411
|
+
$.isEmptyObject = function(obj) {
|
|
1412
|
+
var name
|
|
1413
|
+
for (name in obj) return false
|
|
1414
|
+
return true
|
|
1415
|
+
}
|
|
1416
|
+
|
|
1417
|
+
$.isNumeric = function(val) {
|
|
1418
|
+
var num = Number(val), type = typeof val
|
|
1419
|
+
return val != null && type != 'boolean' &&
|
|
1420
|
+
(type != 'string' || val.length) &&
|
|
1421
|
+
!isNaN(num) && isFinite(num) || false
|
|
1422
|
+
}
|
|
1423
|
+
|
|
1424
|
+
$.inArray = function(elem, array, i){
|
|
1425
|
+
return emptyArray.indexOf.call(array, elem, i)
|
|
1426
|
+
}
|
|
1427
|
+
|
|
1428
|
+
$.camelCase = camelize
|
|
1429
|
+
$.trim = function(str) {
|
|
1430
|
+
return str == null ? "" : String.prototype.trim.call(str)
|
|
1431
|
+
}
|
|
1432
|
+
|
|
1433
|
+
// plugin compatibility
|
|
1434
|
+
$.uuid = 0
|
|
1435
|
+
$.support = { }
|
|
1436
|
+
$.expr = { }
|
|
1437
|
+
$.noop = function() {}
|
|
1438
|
+
|
|
1439
|
+
$.map = function(elements, callback){
|
|
1440
|
+
var value, values = [], i, key
|
|
1441
|
+
if (likeArray(elements))
|
|
1442
|
+
for (i = 0; i < elements.length; i++) {
|
|
1443
|
+
value = callback(elements[i], i)
|
|
1444
|
+
if (value != null) values.push(value)
|
|
1445
|
+
}
|
|
1446
|
+
else
|
|
1447
|
+
for (key in elements) {
|
|
1448
|
+
value = callback(elements[key], key)
|
|
1449
|
+
if (value != null) values.push(value)
|
|
1450
|
+
}
|
|
1451
|
+
return flatten(values)
|
|
1452
|
+
}
|
|
1453
|
+
|
|
1454
|
+
$.each = function(elements, callback){
|
|
1455
|
+
var i, key
|
|
1456
|
+
if (likeArray(elements)) {
|
|
1457
|
+
for (i = 0; i < elements.length; i++)
|
|
1458
|
+
if (callback.call(elements[i], i, elements[i]) === false) return elements
|
|
1459
|
+
} else {
|
|
1460
|
+
for (key in elements)
|
|
1461
|
+
if (callback.call(elements[key], key, elements[key]) === false) return elements
|
|
1462
|
+
}
|
|
1463
|
+
|
|
1464
|
+
return elements
|
|
1465
|
+
}
|
|
1466
|
+
|
|
1467
|
+
$.grep = function(elements, callback){
|
|
1468
|
+
return filter.call(elements, callback)
|
|
1469
|
+
}
|
|
1470
|
+
|
|
1471
|
+
if (window.JSON) $.parseJSON = JSON.parse
|
|
1472
|
+
|
|
1473
|
+
// Populate the class2type map
|
|
1474
|
+
$.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(i, name) {
|
|
1475
|
+
class2type[ "[object " + name + "]" ] = name.toLowerCase()
|
|
1476
|
+
})
|
|
1477
|
+
|
|
1478
|
+
// Define methods that will be available on all
|
|
1479
|
+
// Zepto collections
|
|
1480
|
+
$.fn = {
|
|
1481
|
+
constructor: zepto.Z,
|
|
1482
|
+
length: 0,
|
|
1483
|
+
|
|
1484
|
+
// Because a collection acts like an array
|
|
1485
|
+
// copy over these useful array functions.
|
|
1486
|
+
forEach: emptyArray.forEach,
|
|
1487
|
+
reduce: emptyArray.reduce,
|
|
1488
|
+
push: emptyArray.push,
|
|
1489
|
+
sort: emptyArray.sort,
|
|
1490
|
+
splice: emptyArray.splice,
|
|
1491
|
+
indexOf: emptyArray.indexOf,
|
|
1492
|
+
concat: function(){
|
|
1493
|
+
var i, value, args = []
|
|
1494
|
+
for (i = 0; i < arguments.length; i++) {
|
|
1495
|
+
value = arguments[i]
|
|
1496
|
+
args[i] = zepto.isZ(value) ? value.toArray() : value
|
|
1497
|
+
}
|
|
1498
|
+
return concat.apply(zepto.isZ(this) ? this.toArray() : this, args)
|
|
1499
|
+
},
|
|
1500
|
+
|
|
1501
|
+
// `map` and `slice` in the jQuery API work differently
|
|
1502
|
+
// from their array counterparts
|
|
1503
|
+
map: function(fn){
|
|
1504
|
+
return $($.map(this, function(el, i){ return fn.call(el, i, el) }))
|
|
1505
|
+
},
|
|
1506
|
+
slice: function(){
|
|
1507
|
+
return $(slice.apply(this, arguments))
|
|
1508
|
+
},
|
|
1509
|
+
|
|
1510
|
+
ready: function(callback){
|
|
1511
|
+
// need to check if document.body exists for IE as that browser reports
|
|
1512
|
+
// document ready when it hasn't yet created the body element
|
|
1513
|
+
if (readyRE.test(document.readyState) && document.body) callback($)
|
|
1514
|
+
else document.addEventListener('DOMContentLoaded', function(){ callback($) }, false)
|
|
1515
|
+
return this
|
|
1516
|
+
},
|
|
1517
|
+
get: function(idx){
|
|
1518
|
+
return idx === undefined ? slice.call(this) : this[idx >= 0 ? idx : idx + this.length]
|
|
1519
|
+
},
|
|
1520
|
+
toArray: function(){ return this.get() },
|
|
1521
|
+
size: function(){
|
|
1522
|
+
return this.length
|
|
1523
|
+
},
|
|
1524
|
+
remove: function(){
|
|
1525
|
+
return this.each(function(){
|
|
1526
|
+
if (this.parentNode != null)
|
|
1527
|
+
this.parentNode.removeChild(this)
|
|
1528
|
+
})
|
|
1529
|
+
},
|
|
1530
|
+
each: function(callback){
|
|
1531
|
+
emptyArray.every.call(this, function(el, idx){
|
|
1532
|
+
return callback.call(el, idx, el) !== false
|
|
1533
|
+
})
|
|
1534
|
+
return this
|
|
1535
|
+
},
|
|
1536
|
+
filter: function(selector){
|
|
1537
|
+
if (isFunction(selector)) return this.not(this.not(selector))
|
|
1538
|
+
return $(filter.call(this, function(element){
|
|
1539
|
+
return zepto.matches(element, selector)
|
|
1540
|
+
}))
|
|
1541
|
+
},
|
|
1542
|
+
add: function(selector,context){
|
|
1543
|
+
return $(uniq(this.concat($(selector,context))))
|
|
1544
|
+
},
|
|
1545
|
+
is: function(selector){
|
|
1546
|
+
return this.length > 0 && zepto.matches(this[0], selector)
|
|
1547
|
+
},
|
|
1548
|
+
not: function(selector){
|
|
1549
|
+
var nodes=[]
|
|
1550
|
+
if (isFunction(selector) && selector.call !== undefined)
|
|
1551
|
+
this.each(function(idx){
|
|
1552
|
+
if (!selector.call(this,idx)) nodes.push(this)
|
|
1553
|
+
})
|
|
1554
|
+
else {
|
|
1555
|
+
var excludes = typeof selector == 'string' ? this.filter(selector) :
|
|
1556
|
+
(likeArray(selector) && isFunction(selector.item)) ? slice.call(selector) : $(selector)
|
|
1557
|
+
this.forEach(function(el){
|
|
1558
|
+
if (excludes.indexOf(el) < 0) nodes.push(el)
|
|
1559
|
+
})
|
|
1560
|
+
}
|
|
1561
|
+
return $(nodes)
|
|
1562
|
+
},
|
|
1563
|
+
has: function(selector){
|
|
1564
|
+
return this.filter(function(){
|
|
1565
|
+
return isObject(selector) ?
|
|
1566
|
+
$.contains(this, selector) :
|
|
1567
|
+
$(this).find(selector).size()
|
|
1568
|
+
})
|
|
1569
|
+
},
|
|
1570
|
+
eq: function(idx){
|
|
1571
|
+
return idx === -1 ? this.slice(idx) : this.slice(idx, + idx + 1)
|
|
1572
|
+
},
|
|
1573
|
+
first: function(){
|
|
1574
|
+
var el = this[0]
|
|
1575
|
+
return el && !isObject(el) ? el : $(el)
|
|
1576
|
+
},
|
|
1577
|
+
last: function(){
|
|
1578
|
+
var el = this[this.length - 1]
|
|
1579
|
+
return el && !isObject(el) ? el : $(el)
|
|
1580
|
+
},
|
|
1581
|
+
find: function(selector){
|
|
1582
|
+
var result, $this = this
|
|
1583
|
+
if (!selector) result = $()
|
|
1584
|
+
else if (typeof selector == 'object')
|
|
1585
|
+
result = $(selector).filter(function(){
|
|
1586
|
+
var node = this
|
|
1587
|
+
return emptyArray.some.call($this, function(parent){
|
|
1588
|
+
return $.contains(parent, node)
|
|
1589
|
+
})
|
|
1590
|
+
})
|
|
1591
|
+
else if (this.length == 1) result = $(zepto.qsa(this[0], selector))
|
|
1592
|
+
else result = this.map(function(){ return zepto.qsa(this, selector) })
|
|
1593
|
+
return result
|
|
1594
|
+
},
|
|
1595
|
+
closest: function(selector, context){
|
|
1596
|
+
var nodes = [], collection = typeof selector == 'object' && $(selector)
|
|
1597
|
+
this.each(function(_, node){
|
|
1598
|
+
while (node && !(collection ? collection.indexOf(node) >= 0 : zepto.matches(node, selector)))
|
|
1599
|
+
node = node !== context && !isDocument(node) && node.parentNode
|
|
1600
|
+
if (node && nodes.indexOf(node) < 0) nodes.push(node)
|
|
1601
|
+
})
|
|
1602
|
+
return $(nodes)
|
|
1603
|
+
},
|
|
1604
|
+
parents: function(selector){
|
|
1605
|
+
var ancestors = [], nodes = this
|
|
1606
|
+
while (nodes.length > 0)
|
|
1607
|
+
nodes = $.map(nodes, function(node){
|
|
1608
|
+
if ((node = node.parentNode) && !isDocument(node) && ancestors.indexOf(node) < 0) {
|
|
1609
|
+
ancestors.push(node)
|
|
1610
|
+
return node
|
|
1611
|
+
}
|
|
1612
|
+
})
|
|
1613
|
+
return filtered(ancestors, selector)
|
|
1614
|
+
},
|
|
1615
|
+
parent: function(selector){
|
|
1616
|
+
return filtered(uniq(this.pluck('parentNode')), selector)
|
|
1617
|
+
},
|
|
1618
|
+
children: function(selector){
|
|
1619
|
+
return filtered(this.map(function(){ return children(this) }), selector)
|
|
1620
|
+
},
|
|
1621
|
+
contents: function() {
|
|
1622
|
+
return this.map(function() { return this.contentDocument || slice.call(this.childNodes) })
|
|
1623
|
+
},
|
|
1624
|
+
siblings: function(selector){
|
|
1625
|
+
return filtered(this.map(function(i, el){
|
|
1626
|
+
return filter.call(children(el.parentNode), function(child){ return child!==el })
|
|
1627
|
+
}), selector)
|
|
1628
|
+
},
|
|
1629
|
+
empty: function(){
|
|
1630
|
+
return this.each(function(){ this.innerHTML = '' })
|
|
1631
|
+
},
|
|
1632
|
+
// `pluck` is borrowed from Prototype.js
|
|
1633
|
+
pluck: function(property){
|
|
1634
|
+
return $.map(this, function(el){ return el[property] })
|
|
1635
|
+
},
|
|
1636
|
+
show: function(){
|
|
1637
|
+
return this.each(function(){
|
|
1638
|
+
this.style.display == "none" && (this.style.display = '')
|
|
1639
|
+
if (getComputedStyle(this, '').getPropertyValue("display") == "none")
|
|
1640
|
+
this.style.display = defaultDisplay(this.nodeName)
|
|
1641
|
+
})
|
|
1642
|
+
},
|
|
1643
|
+
replaceWith: function(newContent){
|
|
1644
|
+
return this.before(newContent).remove()
|
|
1645
|
+
},
|
|
1646
|
+
wrap: function(structure){
|
|
1647
|
+
var func = isFunction(structure)
|
|
1648
|
+
if (this[0] && !func)
|
|
1649
|
+
var dom = $(structure).get(0),
|
|
1650
|
+
clone = dom.parentNode || this.length > 1
|
|
1651
|
+
|
|
1652
|
+
return this.each(function(index){
|
|
1653
|
+
$(this).wrapAll(
|
|
1654
|
+
func ? structure.call(this, index) :
|
|
1655
|
+
clone ? dom.cloneNode(true) : dom
|
|
1656
|
+
)
|
|
1657
|
+
})
|
|
1658
|
+
},
|
|
1659
|
+
wrapAll: function(structure){
|
|
1660
|
+
if (this[0]) {
|
|
1661
|
+
$(this[0]).before(structure = $(structure))
|
|
1662
|
+
var children
|
|
1663
|
+
// drill down to the inmost element
|
|
1664
|
+
while ((children = structure.children()).length) structure = children.first()
|
|
1665
|
+
$(structure).append(this)
|
|
1666
|
+
}
|
|
1667
|
+
return this
|
|
1668
|
+
},
|
|
1669
|
+
wrapInner: function(structure){
|
|
1670
|
+
var func = isFunction(structure)
|
|
1671
|
+
return this.each(function(index){
|
|
1672
|
+
var self = $(this), contents = self.contents(),
|
|
1673
|
+
dom = func ? structure.call(this, index) : structure
|
|
1674
|
+
contents.length ? contents.wrapAll(dom) : self.append(dom)
|
|
1675
|
+
})
|
|
1676
|
+
},
|
|
1677
|
+
unwrap: function(){
|
|
1678
|
+
this.parent().each(function(){
|
|
1679
|
+
$(this).replaceWith($(this).children())
|
|
1680
|
+
})
|
|
1681
|
+
return this
|
|
1682
|
+
},
|
|
1683
|
+
clone: function(){
|
|
1684
|
+
return this.map(function(){ return this.cloneNode(true) })
|
|
1685
|
+
},
|
|
1686
|
+
hide: function(){
|
|
1687
|
+
return this.css("display", "none")
|
|
1688
|
+
},
|
|
1689
|
+
toggle: function(setting){
|
|
1690
|
+
return this.each(function(){
|
|
1691
|
+
var el = $(this)
|
|
1692
|
+
;(setting === undefined ? el.css("display") == "none" : setting) ? el.show() : el.hide()
|
|
1693
|
+
})
|
|
1694
|
+
},
|
|
1695
|
+
prev: function(selector){ return $(this.pluck('previousElementSibling')).filter(selector || '*') },
|
|
1696
|
+
next: function(selector){ return $(this.pluck('nextElementSibling')).filter(selector || '*') },
|
|
1697
|
+
html: function(html){
|
|
1698
|
+
return 0 in arguments ?
|
|
1699
|
+
this.each(function(idx){
|
|
1700
|
+
var originHtml = this.innerHTML
|
|
1701
|
+
$(this).empty().append( funcArg(this, html, idx, originHtml) )
|
|
1702
|
+
}) :
|
|
1703
|
+
(0 in this ? this[0].innerHTML : null)
|
|
1704
|
+
},
|
|
1705
|
+
text: function(text){
|
|
1706
|
+
return 0 in arguments ?
|
|
1707
|
+
this.each(function(idx){
|
|
1708
|
+
var newText = funcArg(this, text, idx, this.textContent)
|
|
1709
|
+
this.textContent = newText == null ? '' : ''+newText
|
|
1710
|
+
}) :
|
|
1711
|
+
(0 in this ? this.pluck('textContent').join("") : null)
|
|
1712
|
+
},
|
|
1713
|
+
attr: function(name, value){
|
|
1714
|
+
var result
|
|
1715
|
+
return (typeof name == 'string' && !(1 in arguments)) ?
|
|
1716
|
+
(0 in this && this[0].nodeType == 1 && (result = this[0].getAttribute(name)) != null ? result : undefined) :
|
|
1717
|
+
this.each(function(idx){
|
|
1718
|
+
if (this.nodeType !== 1) return
|
|
1719
|
+
if (isObject(name)) for (key in name) setAttribute(this, key, name[key])
|
|
1720
|
+
else setAttribute(this, name, funcArg(this, value, idx, this.getAttribute(name)))
|
|
1721
|
+
})
|
|
1722
|
+
},
|
|
1723
|
+
removeAttr: function(name){
|
|
1724
|
+
return this.each(function(){ this.nodeType === 1 && name.split(' ').forEach(function(attribute){
|
|
1725
|
+
setAttribute(this, attribute)
|
|
1726
|
+
}, this)})
|
|
1727
|
+
},
|
|
1728
|
+
prop: function(name, value){
|
|
1729
|
+
name = propMap[name] || name
|
|
1730
|
+
return (1 in arguments) ?
|
|
1731
|
+
this.each(function(idx){
|
|
1732
|
+
this[name] = funcArg(this, value, idx, this[name])
|
|
1733
|
+
}) :
|
|
1734
|
+
(this[0] && this[0][name])
|
|
1735
|
+
},
|
|
1736
|
+
removeProp: function(name){
|
|
1737
|
+
name = propMap[name] || name
|
|
1738
|
+
return this.each(function(){ delete this[name] })
|
|
1739
|
+
},
|
|
1740
|
+
data: function(name, value){
|
|
1741
|
+
var attrName = 'data-' + name.replace(capitalRE, '-$1').toLowerCase()
|
|
1742
|
+
|
|
1743
|
+
var data = (1 in arguments) ?
|
|
1744
|
+
this.attr(attrName, value) :
|
|
1745
|
+
this.attr(attrName)
|
|
1746
|
+
|
|
1747
|
+
return data !== null ? deserializeValue(data) : undefined
|
|
1748
|
+
},
|
|
1749
|
+
val: function(value){
|
|
1750
|
+
if (0 in arguments) {
|
|
1751
|
+
if (value == null) value = ""
|
|
1752
|
+
return this.each(function(idx){
|
|
1753
|
+
this.value = funcArg(this, value, idx, this.value)
|
|
1754
|
+
})
|
|
1755
|
+
} else {
|
|
1756
|
+
return this[0] && (this[0].multiple ?
|
|
1757
|
+
$(this[0]).find('option').filter(function(){ return this.selected }).pluck('value') :
|
|
1758
|
+
this[0].value)
|
|
1759
|
+
}
|
|
1760
|
+
},
|
|
1761
|
+
offset: function(coordinates){
|
|
1762
|
+
if (coordinates) return this.each(function(index){
|
|
1763
|
+
var $this = $(this),
|
|
1764
|
+
coords = funcArg(this, coordinates, index, $this.offset()),
|
|
1765
|
+
parentOffset = $this.offsetParent().offset(),
|
|
1766
|
+
props = {
|
|
1767
|
+
top: coords.top - parentOffset.top,
|
|
1768
|
+
left: coords.left - parentOffset.left
|
|
1769
|
+
}
|
|
1770
|
+
|
|
1771
|
+
if ($this.css('position') == 'static') props['position'] = 'relative'
|
|
1772
|
+
$this.css(props)
|
|
1773
|
+
})
|
|
1774
|
+
if (!this.length) return null
|
|
1775
|
+
if (document.documentElement !== this[0] && !$.contains(document.documentElement, this[0]))
|
|
1776
|
+
return {top: 0, left: 0}
|
|
1777
|
+
var obj = this[0].getBoundingClientRect()
|
|
1778
|
+
return {
|
|
1779
|
+
left: obj.left + window.pageXOffset,
|
|
1780
|
+
top: obj.top + window.pageYOffset,
|
|
1781
|
+
width: Math.round(obj.width),
|
|
1782
|
+
height: Math.round(obj.height)
|
|
1783
|
+
}
|
|
1784
|
+
},
|
|
1785
|
+
css: function(property, value){
|
|
1786
|
+
if (arguments.length < 2) {
|
|
1787
|
+
var element = this[0]
|
|
1788
|
+
if (typeof property == 'string') {
|
|
1789
|
+
if (!element) return
|
|
1790
|
+
return element.style[camelize(property)] || getComputedStyle(element, '').getPropertyValue(property)
|
|
1791
|
+
} else if (isArray(property)) {
|
|
1792
|
+
if (!element) return
|
|
1793
|
+
var props = {}
|
|
1794
|
+
var computedStyle = getComputedStyle(element, '')
|
|
1795
|
+
$.each(property, function(_, prop){
|
|
1796
|
+
props[prop] = (element.style[camelize(prop)] || computedStyle.getPropertyValue(prop))
|
|
1797
|
+
})
|
|
1798
|
+
return props
|
|
1799
|
+
}
|
|
1800
|
+
}
|
|
1801
|
+
|
|
1802
|
+
var css = ''
|
|
1803
|
+
if (type(property) == 'string') {
|
|
1804
|
+
if (!value && value !== 0)
|
|
1805
|
+
this.each(function(){ this.style.removeProperty(dasherize(property)) })
|
|
1806
|
+
else
|
|
1807
|
+
css = dasherize(property) + ":" + maybeAddPx(property, value)
|
|
1808
|
+
} else {
|
|
1809
|
+
for (key in property)
|
|
1810
|
+
if (!property[key] && property[key] !== 0)
|
|
1811
|
+
this.each(function(){ this.style.removeProperty(dasherize(key)) })
|
|
1812
|
+
else
|
|
1813
|
+
css += dasherize(key) + ':' + maybeAddPx(key, property[key]) + ';'
|
|
1814
|
+
}
|
|
1815
|
+
|
|
1816
|
+
return this.each(function(){ this.style.cssText += ';' + css })
|
|
1817
|
+
},
|
|
1818
|
+
index: function(element){
|
|
1819
|
+
return element ? this.indexOf($(element)[0]) : this.parent().children().indexOf(this[0])
|
|
1820
|
+
},
|
|
1821
|
+
hasClass: function(name){
|
|
1822
|
+
if (!name) return false
|
|
1823
|
+
return emptyArray.some.call(this, function(el){
|
|
1824
|
+
return this.test(className(el))
|
|
1825
|
+
}, classRE(name))
|
|
1826
|
+
},
|
|
1827
|
+
addClass: function(name){
|
|
1828
|
+
if (!name) return this
|
|
1829
|
+
return this.each(function(idx){
|
|
1830
|
+
if (!('className' in this)) return
|
|
1831
|
+
classList = []
|
|
1832
|
+
var cls = className(this), newName = funcArg(this, name, idx, cls)
|
|
1833
|
+
newName.split(/\s+/g).forEach(function(klass){
|
|
1834
|
+
if (!$(this).hasClass(klass)) classList.push(klass)
|
|
1835
|
+
}, this)
|
|
1836
|
+
classList.length && className(this, cls + (cls ? " " : "") + classList.join(" "))
|
|
1837
|
+
})
|
|
1838
|
+
},
|
|
1839
|
+
removeClass: function(name){
|
|
1840
|
+
return this.each(function(idx){
|
|
1841
|
+
if (!('className' in this)) return
|
|
1842
|
+
if (name === undefined) return className(this, '')
|
|
1843
|
+
classList = className(this)
|
|
1844
|
+
funcArg(this, name, idx, classList).split(/\s+/g).forEach(function(klass){
|
|
1845
|
+
classList = classList.replace(classRE(klass), " ")
|
|
1846
|
+
})
|
|
1847
|
+
className(this, classList.trim())
|
|
1848
|
+
})
|
|
1849
|
+
},
|
|
1850
|
+
toggleClass: function(name, when){
|
|
1851
|
+
if (!name) return this
|
|
1852
|
+
return this.each(function(idx){
|
|
1853
|
+
var $this = $(this), names = funcArg(this, name, idx, className(this))
|
|
1854
|
+
names.split(/\s+/g).forEach(function(klass){
|
|
1855
|
+
(when === undefined ? !$this.hasClass(klass) : when) ?
|
|
1856
|
+
$this.addClass(klass) : $this.removeClass(klass)
|
|
1857
|
+
})
|
|
1858
|
+
})
|
|
1859
|
+
},
|
|
1860
|
+
scrollTop: function(value){
|
|
1861
|
+
if (!this.length) return
|
|
1862
|
+
var hasScrollTop = 'scrollTop' in this[0]
|
|
1863
|
+
if (value === undefined) return hasScrollTop ? this[0].scrollTop : this[0].pageYOffset
|
|
1864
|
+
return this.each(hasScrollTop ?
|
|
1865
|
+
function(){ this.scrollTop = value } :
|
|
1866
|
+
function(){ this.scrollTo(this.scrollX, value) })
|
|
1867
|
+
},
|
|
1868
|
+
scrollLeft: function(value){
|
|
1869
|
+
if (!this.length) return
|
|
1870
|
+
var hasScrollLeft = 'scrollLeft' in this[0]
|
|
1871
|
+
if (value === undefined) return hasScrollLeft ? this[0].scrollLeft : this[0].pageXOffset
|
|
1872
|
+
return this.each(hasScrollLeft ?
|
|
1873
|
+
function(){ this.scrollLeft = value } :
|
|
1874
|
+
function(){ this.scrollTo(value, this.scrollY) })
|
|
1875
|
+
},
|
|
1876
|
+
position: function() {
|
|
1877
|
+
if (!this.length) return
|
|
1878
|
+
|
|
1879
|
+
var elem = this[0],
|
|
1880
|
+
// Get *real* offsetParent
|
|
1881
|
+
offsetParent = this.offsetParent(),
|
|
1882
|
+
// Get correct offsets
|
|
1883
|
+
offset = this.offset(),
|
|
1884
|
+
parentOffset = rootNodeRE.test(offsetParent[0].nodeName) ? { top: 0, left: 0 } : offsetParent.offset()
|
|
1885
|
+
|
|
1886
|
+
// Subtract element margins
|
|
1887
|
+
// note: when an element has margin: auto the offsetLeft and marginLeft
|
|
1888
|
+
// are the same in Safari causing offset.left to incorrectly be 0
|
|
1889
|
+
offset.top -= parseFloat( $(elem).css('margin-top') ) || 0
|
|
1890
|
+
offset.left -= parseFloat( $(elem).css('margin-left') ) || 0
|
|
1891
|
+
|
|
1892
|
+
// Add offsetParent borders
|
|
1893
|
+
parentOffset.top += parseFloat( $(offsetParent[0]).css('border-top-width') ) || 0
|
|
1894
|
+
parentOffset.left += parseFloat( $(offsetParent[0]).css('border-left-width') ) || 0
|
|
1895
|
+
|
|
1896
|
+
// Subtract the two offsets
|
|
1897
|
+
return {
|
|
1898
|
+
top: offset.top - parentOffset.top,
|
|
1899
|
+
left: offset.left - parentOffset.left
|
|
1900
|
+
}
|
|
1901
|
+
},
|
|
1902
|
+
offsetParent: function() {
|
|
1903
|
+
return this.map(function(){
|
|
1904
|
+
var parent = this.offsetParent || document.body
|
|
1905
|
+
while (parent && !rootNodeRE.test(parent.nodeName) && $(parent).css("position") == "static")
|
|
1906
|
+
parent = parent.offsetParent
|
|
1907
|
+
return parent
|
|
1908
|
+
})
|
|
1909
|
+
}
|
|
1910
|
+
}
|
|
1911
|
+
|
|
1912
|
+
// for now
|
|
1913
|
+
$.fn.detach = $.fn.remove
|
|
1914
|
+
|
|
1915
|
+
// Generate the `width` and `height` functions
|
|
1916
|
+
;['width', 'height'].forEach(function(dimension){
|
|
1917
|
+
var dimensionProperty =
|
|
1918
|
+
dimension.replace(/./, function(m){ return m[0].toUpperCase() })
|
|
1919
|
+
|
|
1920
|
+
$.fn[dimension] = function(value){
|
|
1921
|
+
var offset, el = this[0]
|
|
1922
|
+
if (value === undefined) return isWindow(el) ? el['inner' + dimensionProperty] :
|
|
1923
|
+
isDocument(el) ? el.documentElement['scroll' + dimensionProperty] :
|
|
1924
|
+
(offset = this.offset()) && offset[dimension]
|
|
1925
|
+
else return this.each(function(idx){
|
|
1926
|
+
el = $(this)
|
|
1927
|
+
el.css(dimension, funcArg(this, value, idx, el[dimension]()))
|
|
1928
|
+
})
|
|
1929
|
+
}
|
|
1930
|
+
})
|
|
1931
|
+
|
|
1932
|
+
function traverseNode(node, fun) {
|
|
1933
|
+
fun(node)
|
|
1934
|
+
for (var i = 0, len = node.childNodes.length; i < len; i++)
|
|
1935
|
+
traverseNode(node.childNodes[i], fun)
|
|
1936
|
+
}
|
|
1937
|
+
|
|
1938
|
+
// Generate the `after`, `prepend`, `before`, `append`,
|
|
1939
|
+
// `insertAfter`, `insertBefore`, `appendTo`, and `prependTo` methods.
|
|
1940
|
+
adjacencyOperators.forEach(function(operator, operatorIndex) {
|
|
1941
|
+
var inside = operatorIndex % 2 //=> prepend, append
|
|
1942
|
+
|
|
1943
|
+
$.fn[operator] = function(){
|
|
1944
|
+
// arguments can be nodes, arrays of nodes, Zepto objects and HTML strings
|
|
1945
|
+
var argType, nodes = $.map(arguments, function(arg) {
|
|
1946
|
+
var arr = []
|
|
1947
|
+
argType = type(arg)
|
|
1948
|
+
if (argType == "array") {
|
|
1949
|
+
arg.forEach(function(el) {
|
|
1950
|
+
if (el.nodeType !== undefined) return arr.push(el)
|
|
1951
|
+
else if ($.zepto.isZ(el)) return arr = arr.concat(el.get())
|
|
1952
|
+
arr = arr.concat(zepto.fragment(el))
|
|
1953
|
+
})
|
|
1954
|
+
return arr
|
|
1955
|
+
}
|
|
1956
|
+
return argType == "object" || arg == null ?
|
|
1957
|
+
arg : zepto.fragment(arg)
|
|
1958
|
+
}),
|
|
1959
|
+
parent, copyByClone = this.length > 1
|
|
1960
|
+
if (nodes.length < 1) return this
|
|
1961
|
+
|
|
1962
|
+
return this.each(function(_, target){
|
|
1963
|
+
parent = inside ? target : target.parentNode
|
|
1964
|
+
|
|
1965
|
+
// convert all methods to a "before" operation
|
|
1966
|
+
target = operatorIndex == 0 ? target.nextSibling :
|
|
1967
|
+
operatorIndex == 1 ? target.firstChild :
|
|
1968
|
+
operatorIndex == 2 ? target :
|
|
1969
|
+
null
|
|
1970
|
+
|
|
1971
|
+
var parentInDocument = $.contains(document.documentElement, parent)
|
|
1972
|
+
|
|
1973
|
+
nodes.forEach(function(node){
|
|
1974
|
+
if (copyByClone) node = node.cloneNode(true)
|
|
1975
|
+
else if (!parent) return $(node).remove()
|
|
1976
|
+
|
|
1977
|
+
parent.insertBefore(node, target)
|
|
1978
|
+
if (parentInDocument) traverseNode(node, function(el){
|
|
1979
|
+
if (el.nodeName != null && el.nodeName.toUpperCase() === 'SCRIPT' &&
|
|
1980
|
+
(!el.type || el.type === 'text/javascript') && !el.src){
|
|
1981
|
+
var target = el.ownerDocument ? el.ownerDocument.defaultView : window
|
|
1982
|
+
target['eval'].call(target, el.innerHTML)
|
|
1983
|
+
}
|
|
1984
|
+
})
|
|
1985
|
+
})
|
|
1986
|
+
})
|
|
1987
|
+
}
|
|
1988
|
+
|
|
1989
|
+
// after => insertAfter
|
|
1990
|
+
// prepend => prependTo
|
|
1991
|
+
// before => insertBefore
|
|
1992
|
+
// append => appendTo
|
|
1993
|
+
$.fn[inside ? operator+'To' : 'insert'+(operatorIndex ? 'Before' : 'After')] = function(html){
|
|
1994
|
+
$(html)[operator](this)
|
|
1995
|
+
return this
|
|
1996
|
+
}
|
|
1997
|
+
})
|
|
1998
|
+
|
|
1999
|
+
zepto.Z.prototype = Z.prototype = $.fn
|
|
2000
|
+
|
|
2001
|
+
// Export internal API functions in the `$.zepto` namespace
|
|
2002
|
+
zepto.uniq = uniq
|
|
2003
|
+
zepto.deserializeValue = deserializeValue
|
|
2004
|
+
$.zepto = zepto
|
|
2005
|
+
|
|
2006
|
+
return $
|
|
2007
|
+
})()
|
|
2008
|
+
|
|
2009
|
+
// If `$` is not yet defined, point it to `Zepto`
|
|
2010
|
+
window.Zepto = Zepto
|
|
2011
|
+
window.$ === undefined && (window.$ = Zepto)
|
|
2012
|
+
|
|
2013
|
+
|
|
2014
|
+
/***/ }),
|
|
2015
|
+
|
|
2016
|
+
/***/ 243:
|
|
2017
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2018
|
+
|
|
2019
|
+
__webpack_require__(110);
|
|
2020
|
+
__webpack_require__(109);
|
|
2021
|
+
__webpack_require__(96);
|
|
2022
|
+
__webpack_require__(108);
|
|
2023
|
+
__webpack_require__(107);
|
|
2024
|
+
__webpack_require__(105);
|
|
2025
|
+
__webpack_require__(79);
|
|
2026
|
+
module.exports = __webpack_require__(78);
|
|
2027
|
+
|
|
2028
|
+
|
|
2029
|
+
/***/ }),
|
|
2030
|
+
|
|
2031
|
+
/***/ 31:
|
|
2032
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2033
|
+
|
|
2034
|
+
"use strict";
|
|
2035
|
+
|
|
2036
|
+
|
|
2037
|
+
Object.defineProperty(exports, "__esModule", {
|
|
2038
|
+
value: true
|
|
2039
|
+
});
|
|
2040
|
+
/**
|
|
2041
|
+
* Created by dfzq on 2017/2/12.
|
|
2042
|
+
*/
|
|
2043
|
+
//比较一个字符串版本号
|
|
2044
|
+
//a > b === 1
|
|
2045
|
+
//a = b === 0
|
|
2046
|
+
//a < b === -1
|
|
2047
|
+
var compareVersion = exports.compareVersion = function compareVersion(a, b) {
|
|
2048
|
+
var as = a.split('.');
|
|
2049
|
+
var bs = b.split('.');
|
|
2050
|
+
if (a === b) return 0;
|
|
2051
|
+
|
|
2052
|
+
for (var i = 0; i < as.length; i++) {
|
|
2053
|
+
var x = parseInt(as[i]);
|
|
2054
|
+
if (!bs[i]) return 1;
|
|
2055
|
+
var y = parseInt(bs[i]);
|
|
2056
|
+
if (x < y) return -1;
|
|
2057
|
+
if (x > y) return 1;
|
|
2058
|
+
}
|
|
2059
|
+
return -1;
|
|
2060
|
+
};
|
|
2061
|
+
|
|
2062
|
+
// export const getCurrentPage = () => {
|
|
2063
|
+
// return $(".page-current")[0] || $(".page")[0] || document.body;
|
|
2064
|
+
// }
|
|
2065
|
+
|
|
2066
|
+
/***/ }),
|
|
2067
|
+
|
|
2068
|
+
/***/ 78:
|
|
2069
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2070
|
+
|
|
2071
|
+
"use strict";
|
|
2072
|
+
|
|
2073
|
+
|
|
2074
|
+
/**
|
|
2075
|
+
* Created by dfzq on 2017/4/21.
|
|
2076
|
+
*/
|
|
2077
|
+
var Util = __webpack_require__(31);
|
|
2078
|
+
|
|
2079
|
+
// 设备检测
|
|
2080
|
+
var isIpad = window.navigator.appVersion.match(/iPad/gi);
|
|
2081
|
+
var isIPhone = window.navigator.appVersion.match(/iphone/gi);
|
|
2082
|
+
var isSMT800UCPAD = window.navigator.appVersion.match(/SM-T800/gi);
|
|
2083
|
+
var isAndroidUC = window.navigator.appVersion.match(/UCBrowser/gi);
|
|
2084
|
+
var isLenovoA890e360 = window.navigator.appVersion.match(/Lenovo A890e/gi) && window.navigator.appVersion.match(/360 Aphone Browser/gi);
|
|
2085
|
+
var isHuaWeiD26070 = window.navigator.appVersion.match(/HUAWEI D2-6070/gi) && window.navigator.appVersion.match(/LieBaoFast/gi);
|
|
2086
|
+
var matches = window.navigator.userAgent.match(/Android[\S\s]+AppleWebkit\/(\d{3})/i);
|
|
2087
|
+
var UCversion = window.navigator.userAgent.match(/U3\/((\d+|\.){5,})/i);
|
|
2088
|
+
var isUCHd = UCversion && parseInt(UCversion[1].split('.').join(''), 10) >= 80;
|
|
2089
|
+
var isIos = window.navigator.appVersion.match(/(iphone|ipad|ipod)/gi);
|
|
2090
|
+
var isFirst = true;
|
|
2091
|
+
var isAndroid = window.navigator.appVersion.match(/android/gi);
|
|
2092
|
+
|
|
2093
|
+
// 安卓系统中需要resize操作
|
|
2094
|
+
function resize() {
|
|
2095
|
+
var value = 0;
|
|
2096
|
+
var clientValue = 0;
|
|
2097
|
+
var height = screen.height;
|
|
2098
|
+
var width = screen.width;
|
|
2099
|
+
var clientHeight = document.documentElement.clientHeight;
|
|
2100
|
+
var clientWidth = document.documentElement.clientWidth;
|
|
2101
|
+
var dpr = window.devicePixelRatio;
|
|
2102
|
+
switch (window.orientation) {
|
|
2103
|
+
case 0:
|
|
2104
|
+
case 180:
|
|
2105
|
+
if (isSMT800UCPAD) {
|
|
2106
|
+
value = Math.max(height, width);
|
|
2107
|
+
clientValue = Math.max(clientHeight, clientWidth);
|
|
2108
|
+
if (!isIpad && !isIPhone) {
|
|
2109
|
+
if (value / dpr >= clientValue && clientWidth != width) {
|
|
2110
|
+
value = value / dpr;
|
|
2111
|
+
}
|
|
2112
|
+
}
|
|
2113
|
+
} else {
|
|
2114
|
+
value = Math.min(height, width);
|
|
2115
|
+
clientValue = Math.min(clientHeight, clientWidth);
|
|
2116
|
+
if (!isIpad && !isIPhone) {
|
|
2117
|
+
if (Math.ceil(value / dpr) >= clientValue && clientHeight != height) {
|
|
2118
|
+
value = value / dpr;
|
|
2119
|
+
}
|
|
2120
|
+
}
|
|
2121
|
+
}
|
|
2122
|
+
break;
|
|
2123
|
+
case -90:
|
|
2124
|
+
case 90:
|
|
2125
|
+
if (isSMT800UCPAD) {
|
|
2126
|
+
value = Math.min(height, width);
|
|
2127
|
+
clientValue = Math.min(clientHeight, clientWidth);
|
|
2128
|
+
if (!isIpad && !isIPhone) {
|
|
2129
|
+
if (value / dpr >= clientValue && clientHeight != height) {
|
|
2130
|
+
value = value / dpr;
|
|
2131
|
+
}
|
|
2132
|
+
}
|
|
2133
|
+
} else if (isLenovoA890e360 || isHuaWeiD26070) {
|
|
2134
|
+
value = Math.max(height, width);
|
|
2135
|
+
clientValue = Math.max(clientHeight, clientWidth);
|
|
2136
|
+
if (!isIpad && !isIPhone) {
|
|
2137
|
+
if (value / dpr >= clientValue && clientWidth != width) {
|
|
2138
|
+
value = value / dpr - 100;
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
} else {
|
|
2142
|
+
value = Math.max(height, width);
|
|
2143
|
+
clientValue = Math.max(clientHeight, clientWidth);
|
|
2144
|
+
if (!isIpad && !isIPhone) {
|
|
2145
|
+
if (Math.ceil(value / dpr) >= clientValue && clientWidth != width) {
|
|
2146
|
+
value = value / dpr;
|
|
2147
|
+
}
|
|
2148
|
+
}
|
|
2149
|
+
}
|
|
2150
|
+
break;
|
|
2151
|
+
default:
|
|
2152
|
+
value = width;
|
|
2153
|
+
break;
|
|
2154
|
+
}
|
|
2155
|
+
window.remFontSize = value / 16;
|
|
2156
|
+
document.documentElement.style.fontSize = value / 16 + "px";
|
|
2157
|
+
try {
|
|
2158
|
+
var T = document.getElementById(kb.settings.id + "_kb").querySelectorAll(".keyboardEle");
|
|
2159
|
+
for (var i = 0; i < T.length; i++) {
|
|
2160
|
+
$(T[i]).removeClass("active").removeClass("active2");
|
|
2161
|
+
}
|
|
2162
|
+
} catch (e) {}
|
|
2163
|
+
};
|
|
2164
|
+
addClassByUa();
|
|
2165
|
+
function addClassByUa() {
|
|
2166
|
+
if (isIpad) {
|
|
2167
|
+
document.querySelector('html').className = 'ua-ipad';
|
|
2168
|
+
}
|
|
2169
|
+
};
|
|
2170
|
+
|
|
2171
|
+
// 安卓中的处理
|
|
2172
|
+
if (isAndroid && isAndroidUC) {
|
|
2173
|
+
var b = null;
|
|
2174
|
+
window.addEventListener("orientationchange", function () {
|
|
2175
|
+
isFirst = false;
|
|
2176
|
+
clearTimeout(b), b = setTimeout(resize, 300);
|
|
2177
|
+
}, !1);
|
|
2178
|
+
var isFirefox = navigator.userAgent.match(/Firefox/gi);
|
|
2179
|
+
if (isFirefox) {
|
|
2180
|
+
window.addEventListener("resize", function () {
|
|
2181
|
+
clearTimeout(b), b = setTimeout(resize, 300);
|
|
2182
|
+
}, !1);
|
|
2183
|
+
}
|
|
2184
|
+
resize();
|
|
2185
|
+
}
|
|
2186
|
+
// 非安卓系统的处理
|
|
2187
|
+
else {
|
|
2188
|
+
;
|
|
2189
|
+
(function (win) {
|
|
2190
|
+
var tid;
|
|
2191
|
+
var doc = win.document;
|
|
2192
|
+
var docEl = doc.documentElement;
|
|
2193
|
+
// 计算dpr和收缩比例
|
|
2194
|
+
var dpr = win.devicePixelRatio || 1;
|
|
2195
|
+
// 计算dpr,如果非IOS,Android4.3以下,非UC内核,就不执行高清,否则dpr设置为1
|
|
2196
|
+
if (!isIos && !(matches && matches[1] > 534) && !isUCHd) {
|
|
2197
|
+
dpr = 1;
|
|
2198
|
+
}
|
|
2199
|
+
|
|
2200
|
+
// 部分安卓机的dpr是小数点,但是计算上又根据整数来换算单位
|
|
2201
|
+
dpr = parseInt(dpr);
|
|
2202
|
+
|
|
2203
|
+
// data-dpr用于强制定义dpr值(安卓端_iOS)
|
|
2204
|
+
var forceDpr = docEl.getAttribute('data-dpr');
|
|
2205
|
+
if (forceDpr) {
|
|
2206
|
+
try {
|
|
2207
|
+
dpr = parseInt(forceDpr);
|
|
2208
|
+
} catch (ex) {}
|
|
2209
|
+
}
|
|
2210
|
+
|
|
2211
|
+
// data-android-dpr用于强制定义dpr值(安卓端)
|
|
2212
|
+
var forceAndroidDpr = docEl.getAttribute('data-android-dpr');
|
|
2213
|
+
if (forceAndroidDpr && isAndroid) {
|
|
2214
|
+
try {
|
|
2215
|
+
dpr = parseInt(forceAndroidDpr);
|
|
2216
|
+
} catch (ex) {}
|
|
2217
|
+
}
|
|
2218
|
+
|
|
2219
|
+
// data-ios-dpr用于强制定义dpr值(iOS端)
|
|
2220
|
+
var forceIosDpr = docEl.getAttribute('data-ios-dpr');
|
|
2221
|
+
if (forceIosDpr && isIos) {
|
|
2222
|
+
try {
|
|
2223
|
+
dpr = parseInt(forceIosDpr);
|
|
2224
|
+
} catch (ex) {}
|
|
2225
|
+
}
|
|
2226
|
+
|
|
2227
|
+
docEl.setAttribute('data-dpr', dpr);
|
|
2228
|
+
var scale = 1 / dpr;
|
|
2229
|
+
|
|
2230
|
+
// 获取当前viewport
|
|
2231
|
+
var metaEl = doc.querySelector('meta[name="viewport"]');
|
|
2232
|
+
if (!metaEl) {
|
|
2233
|
+
metaEl = doc.createElement('meta');
|
|
2234
|
+
metaEl.setAttribute('name', 'viewport');
|
|
2235
|
+
doc.head.appendChild(metaEl);
|
|
2236
|
+
}
|
|
2237
|
+
|
|
2238
|
+
// 解决IOS9以下在微信平台内可以左右滑动的BUG
|
|
2239
|
+
// if($.device.ios && (Util.compareVersion($.device.osVersion, '9.0.0') >= 0 && Util.compareVersion($.device.osVersion, '10.0.0') < 0)){
|
|
2240
|
+
if ($.device.ios && Util.compareVersion($.device.osVersion, '10.0.0') < 0) {
|
|
2241
|
+
scale = 1;
|
|
2242
|
+
}
|
|
2243
|
+
|
|
2244
|
+
docEl.setAttribute('data-scale', scale);
|
|
2245
|
+
if (docEl.getAttribute('data-rem') != 'no') {
|
|
2246
|
+
metaEl.setAttribute('content', 'width=device-width,user-scalable=no,initial-scale=' + scale + ',maximum-scale=' + scale + ',minimum-scale=' + scale + ',viewport-fit=cover');
|
|
2247
|
+
}
|
|
2248
|
+
|
|
2249
|
+
function refreshRem() {
|
|
2250
|
+
// data-dpr用于强制定义dpr值(安卓端_iOS)
|
|
2251
|
+
var forceDpr = docEl.getAttribute('data-dpr');
|
|
2252
|
+
if (forceDpr) {
|
|
2253
|
+
try {
|
|
2254
|
+
dpr = parseInt(forceDpr);
|
|
2255
|
+
} catch (ex) {}
|
|
2256
|
+
}
|
|
2257
|
+
|
|
2258
|
+
// data-android-dpr用于强制定义dpr值(安卓端)
|
|
2259
|
+
var forceAndroidDpr = docEl.getAttribute('data-android-dpr');
|
|
2260
|
+
if (forceAndroidDpr && isAndroid) {
|
|
2261
|
+
try {
|
|
2262
|
+
dpr = parseInt(forceAndroidDpr);
|
|
2263
|
+
} catch (ex) {}
|
|
2264
|
+
}
|
|
2265
|
+
|
|
2266
|
+
// data-ios-dpr用于强制定义dpr值(iOS端)
|
|
2267
|
+
var forceIosDpr = docEl.getAttribute('data-ios-dpr');
|
|
2268
|
+
if (forceIosDpr && isIos) {
|
|
2269
|
+
try {
|
|
2270
|
+
dpr = parseInt(forceIosDpr);
|
|
2271
|
+
} catch (ex) {}
|
|
2272
|
+
}
|
|
2273
|
+
|
|
2274
|
+
console.log('screen-width:' + docEl.getBoundingClientRect().width);
|
|
2275
|
+
console.log('dpr:' + dpr);
|
|
2276
|
+
|
|
2277
|
+
if (docEl.getAttribute('data-rem') == 'no') {
|
|
2278
|
+
console.log('rem已关闭');
|
|
2279
|
+
return;
|
|
2280
|
+
}
|
|
2281
|
+
|
|
2282
|
+
var width = docEl.getBoundingClientRect().width / dpr;
|
|
2283
|
+
// rem基准值
|
|
2284
|
+
var rem = width / 16;
|
|
2285
|
+
// 实现高清效果
|
|
2286
|
+
var fontSize = rem * dpr;
|
|
2287
|
+
|
|
2288
|
+
// 如果是 pc 则写死 font-size
|
|
2289
|
+
if ($.device.pc) {
|
|
2290
|
+
fontSize = 30;
|
|
2291
|
+
}
|
|
2292
|
+
console.log('font-size:' + fontSize);
|
|
2293
|
+
docEl.style.fontSize = fontSize + 'px';
|
|
2294
|
+
|
|
2295
|
+
// data-sysfont用于强制定义使用缩放的标准字体
|
|
2296
|
+
var forceSysFont = docEl.getAttribute('data-sysfont');
|
|
2297
|
+
// 安卓并且强制标准字体特殊处理,需要重新更新font-size
|
|
2298
|
+
if (isAndroid && forceSysFont) {
|
|
2299
|
+
var d = document.createElement('div');
|
|
2300
|
+
d.style.cssText = "width:1rem;height:0;overflow: hidden;position:absolute;z-index:-1;visibility: hidden;";
|
|
2301
|
+
document.body.appendChild(d);
|
|
2302
|
+
var dw = d.offsetWidth; // 1rem的实际展示px值
|
|
2303
|
+
document.body.removeChild(d);
|
|
2304
|
+
var html = document.querySelector('html');
|
|
2305
|
+
var fz = parseFloat(html.style.fontSize) || 0; //正常计算出来的rem基准值 , 可自行修改为rem计算好的值
|
|
2306
|
+
var realRem = fz;
|
|
2307
|
+
if (dw != fz) {
|
|
2308
|
+
//不相等,则被缩放了
|
|
2309
|
+
realRem = Math.pow(fz, 2) / dw;
|
|
2310
|
+
}
|
|
2311
|
+
html.style.fontSize = realRem + 'px';
|
|
2312
|
+
console.log('realRem:' + realRem);
|
|
2313
|
+
}
|
|
2314
|
+
};
|
|
2315
|
+
|
|
2316
|
+
// 非pc端 屏幕大小调整时重新 设置 rem
|
|
2317
|
+
if (!$.device.pc) {
|
|
2318
|
+
win.addEventListener('resize', function () {
|
|
2319
|
+
clearTimeout(tid);
|
|
2320
|
+
tid = setTimeout(refreshRem, 300);
|
|
2321
|
+
}, false);
|
|
2322
|
+
}
|
|
2323
|
+
win.addEventListener('pageshow', function (e) {
|
|
2324
|
+
if (e.persisted) {
|
|
2325
|
+
clearTimeout(tid);
|
|
2326
|
+
tid = setTimeout(refreshRem, 300);
|
|
2327
|
+
}
|
|
2328
|
+
}, false);
|
|
2329
|
+
refreshRem();
|
|
2330
|
+
})(window);
|
|
2331
|
+
}
|
|
2332
|
+
|
|
2333
|
+
/***/ }),
|
|
2334
|
+
|
|
2335
|
+
/***/ 79:
|
|
2336
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2337
|
+
|
|
2338
|
+
"use strict";
|
|
2339
|
+
|
|
2340
|
+
|
|
2341
|
+
/**
|
|
2342
|
+
* Created by dfzq on 2017/2/9.
|
|
2343
|
+
*/
|
|
2344
|
+
['width', 'height'].forEach(function (dimension) {
|
|
2345
|
+
var Dimension = dimension.replace(/./, function (m) {
|
|
2346
|
+
return m[0].toUpperCase();
|
|
2347
|
+
});
|
|
2348
|
+
$.fn['outer' + Dimension] = function (margin) {
|
|
2349
|
+
var elem = this;
|
|
2350
|
+
if (elem) {
|
|
2351
|
+
var size = elem[dimension]();
|
|
2352
|
+
var sides = {
|
|
2353
|
+
'width': ['left', 'right'],
|
|
2354
|
+
'height': ['top', 'bottom']
|
|
2355
|
+
};
|
|
2356
|
+
sides[dimension].forEach(function (side) {
|
|
2357
|
+
if (margin) size += parseInt(elem.css('margin-' + side), 10);
|
|
2358
|
+
});
|
|
2359
|
+
return size;
|
|
2360
|
+
} else {
|
|
2361
|
+
return null;
|
|
2362
|
+
}
|
|
2363
|
+
};
|
|
2364
|
+
});
|
|
2365
|
+
|
|
2366
|
+
//support
|
|
2367
|
+
$.support = function () {
|
|
2368
|
+
var support = {
|
|
2369
|
+
touch: !!('ontouchstart' in window || window.DocumentTouch && document instanceof window.DocumentTouch)
|
|
2370
|
+
};
|
|
2371
|
+
return support;
|
|
2372
|
+
}();
|
|
2373
|
+
|
|
2374
|
+
$.touchEvents = {
|
|
2375
|
+
start: $.support.touch ? 'touchstart' : 'mousedown',
|
|
2376
|
+
move: $.support.touch ? 'touchmove' : 'mousemove',
|
|
2377
|
+
end: $.support.touch ? 'touchend' : 'mouseup'
|
|
2378
|
+
};
|
|
2379
|
+
|
|
2380
|
+
$.getTranslate = function (el, axis) {
|
|
2381
|
+
var matrix, curTransform, curStyle, transformMatrix;
|
|
2382
|
+
|
|
2383
|
+
// automatic axis detection
|
|
2384
|
+
if (typeof axis === 'undefined') {
|
|
2385
|
+
axis = 'x';
|
|
2386
|
+
}
|
|
2387
|
+
|
|
2388
|
+
curStyle = window.getComputedStyle(el, null);
|
|
2389
|
+
if (window.WebKitCSSMatrix) {
|
|
2390
|
+
// Some old versions of Webkit choke when 'none' is passed; pass
|
|
2391
|
+
// empty string instead in this case
|
|
2392
|
+
transformMatrix = new WebKitCSSMatrix(curStyle.webkitTransform === 'none' ? '' : curStyle.webkitTransform);
|
|
2393
|
+
} else {
|
|
2394
|
+
transformMatrix = curStyle.MozTransform || curStyle.transform || curStyle.getPropertyValue('transform').replace('translate(', 'matrix(1, 0, 0, 1,');
|
|
2395
|
+
matrix = transformMatrix.toString().split(',');
|
|
2396
|
+
}
|
|
2397
|
+
|
|
2398
|
+
if (axis === 'x') {
|
|
2399
|
+
//Latest Chrome and webkits Fix
|
|
2400
|
+
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m41;
|
|
2401
|
+
//Crazy IE10 Matrix
|
|
2402
|
+
else if (matrix.length === 16) curTransform = parseFloat(matrix[12]);
|
|
2403
|
+
//Normal Browsers
|
|
2404
|
+
else curTransform = parseFloat(matrix[4]);
|
|
2405
|
+
}
|
|
2406
|
+
if (axis === 'y') {
|
|
2407
|
+
//Latest Chrome and webkits Fix
|
|
2408
|
+
if (window.WebKitCSSMatrix) curTransform = transformMatrix.m42;
|
|
2409
|
+
//Crazy IE10 Matrix
|
|
2410
|
+
else if (matrix.length === 16) curTransform = parseFloat(matrix[13]);
|
|
2411
|
+
//Normal Browsers
|
|
2412
|
+
else curTransform = parseFloat(matrix[5]);
|
|
2413
|
+
}
|
|
2414
|
+
|
|
2415
|
+
return curTransform || 0;
|
|
2416
|
+
};
|
|
2417
|
+
/* jshint ignore:start */
|
|
2418
|
+
$.requestAnimationFrame = function (callback) {
|
|
2419
|
+
if (window.requestAnimationFrame) return window.requestAnimationFrame(callback);else if (window.webkitRequestAnimationFrame) return window.webkitRequestAnimationFrame(callback);else if (window.mozRequestAnimationFrame) return window.mozRequestAnimationFrame(callback);else {
|
|
2420
|
+
return window.setTimeout(callback, 1000 / 60);
|
|
2421
|
+
}
|
|
2422
|
+
};
|
|
2423
|
+
$.cancelAnimationFrame = function (id) {
|
|
2424
|
+
if (window.cancelAnimationFrame) return window.cancelAnimationFrame(id);else if (window.webkitCancelAnimationFrame) return window.webkitCancelAnimationFrame(id);else if (window.mozCancelAnimationFrame) return window.mozCancelAnimationFrame(id);else {
|
|
2425
|
+
return window.clearTimeout(id);
|
|
2426
|
+
}
|
|
2427
|
+
};
|
|
2428
|
+
/* jshint ignore:end */
|
|
2429
|
+
|
|
2430
|
+
$.fn.dataset = function () {
|
|
2431
|
+
var dataset = {},
|
|
2432
|
+
ds = this[0].dataset;
|
|
2433
|
+
for (var key in ds) {
|
|
2434
|
+
// jshint ignore:line
|
|
2435
|
+
var item = dataset[key] = ds[key];
|
|
2436
|
+
if (item === 'false') dataset[key] = false;else if (item === 'true') dataset[key] = true;else if (parseFloat(item) === item * 1) dataset[key] = item * 1;
|
|
2437
|
+
}
|
|
2438
|
+
// mixin dataset and __eleData
|
|
2439
|
+
return $.extend({}, dataset, this[0].__eleData);
|
|
2440
|
+
};
|
|
2441
|
+
$.fn.zeptoData = $.fn.data;
|
|
2442
|
+
$.fn.data = function (key, value) {
|
|
2443
|
+
var tmpData = $(this).dataset();
|
|
2444
|
+
if (!key) {
|
|
2445
|
+
return tmpData;
|
|
2446
|
+
}
|
|
2447
|
+
// value may be 0, false, null
|
|
2448
|
+
if (typeof value === 'undefined') {
|
|
2449
|
+
// Get value
|
|
2450
|
+
var dataVal = tmpData[key],
|
|
2451
|
+
__eD = this[0].__eleData;
|
|
2452
|
+
|
|
2453
|
+
//if (dataVal !== undefined) {
|
|
2454
|
+
if (__eD && key in __eD) {
|
|
2455
|
+
return __eD[key];
|
|
2456
|
+
} else {
|
|
2457
|
+
return dataVal;
|
|
2458
|
+
}
|
|
2459
|
+
} else {
|
|
2460
|
+
// Set value,uniformly set in extra ```__eleData```
|
|
2461
|
+
for (var i = 0; i < this.length; i++) {
|
|
2462
|
+
var el = this[i];
|
|
2463
|
+
// delete multiple data in dataset
|
|
2464
|
+
if (key in tmpData) delete el.dataset[key];
|
|
2465
|
+
|
|
2466
|
+
if (!el.__eleData) el.__eleData = {};
|
|
2467
|
+
el.__eleData[key] = value;
|
|
2468
|
+
}
|
|
2469
|
+
return this;
|
|
2470
|
+
}
|
|
2471
|
+
};
|
|
2472
|
+
function __dealCssEvent(eventNameArr, callback) {
|
|
2473
|
+
var events = eventNameArr,
|
|
2474
|
+
i,
|
|
2475
|
+
dom = this; // jshint ignore:line
|
|
2476
|
+
|
|
2477
|
+
function fireCallBack(e) {
|
|
2478
|
+
/*jshint validthis:true */
|
|
2479
|
+
if (e.target !== this) return;
|
|
2480
|
+
callback.call(this, e);
|
|
2481
|
+
for (i = 0; i < events.length; i++) {
|
|
2482
|
+
dom.off(events[i], fireCallBack);
|
|
2483
|
+
}
|
|
2484
|
+
}
|
|
2485
|
+
if (callback) {
|
|
2486
|
+
for (i = 0; i < events.length; i++) {
|
|
2487
|
+
dom.on(events[i], fireCallBack);
|
|
2488
|
+
}
|
|
2489
|
+
}
|
|
2490
|
+
}
|
|
2491
|
+
$.fn.animationEnd = function (callback) {
|
|
2492
|
+
__dealCssEvent.call(this, ['webkitAnimationEnd', 'animationend'], callback);
|
|
2493
|
+
return this;
|
|
2494
|
+
};
|
|
2495
|
+
$.fn.transitionEnd = function (callback) {
|
|
2496
|
+
__dealCssEvent.call(this, ['webkitTransitionEnd', 'transitionend'], callback);
|
|
2497
|
+
return this;
|
|
2498
|
+
};
|
|
2499
|
+
$.fn.transition = function (duration) {
|
|
2500
|
+
if (typeof duration !== 'string') {
|
|
2501
|
+
duration = duration + 'ms';
|
|
2502
|
+
}
|
|
2503
|
+
for (var i = 0; i < this.length; i++) {
|
|
2504
|
+
var elStyle = this[i].style;
|
|
2505
|
+
elStyle.webkitTransitionDuration = elStyle.MozTransitionDuration = elStyle.transitionDuration = duration;
|
|
2506
|
+
}
|
|
2507
|
+
return this;
|
|
2508
|
+
};
|
|
2509
|
+
$.fn.transform = function (transform) {
|
|
2510
|
+
for (var i = 0; i < this.length; i++) {
|
|
2511
|
+
var elStyle = this[i].style;
|
|
2512
|
+
elStyle.webkitTransform = elStyle.MozTransform = elStyle.transform = transform;
|
|
2513
|
+
}
|
|
2514
|
+
return this;
|
|
2515
|
+
};
|
|
2516
|
+
$.fn.prevAll = function (selector) {
|
|
2517
|
+
var prevEls = [];
|
|
2518
|
+
var el = this[0];
|
|
2519
|
+
if (!el) return $([]);
|
|
2520
|
+
while (el.previousElementSibling) {
|
|
2521
|
+
var prev = el.previousElementSibling;
|
|
2522
|
+
if (selector) {
|
|
2523
|
+
if ($(prev).is(selector)) prevEls.push(prev);
|
|
2524
|
+
} else prevEls.push(prev);
|
|
2525
|
+
el = prev;
|
|
2526
|
+
}
|
|
2527
|
+
return $(prevEls);
|
|
2528
|
+
};
|
|
2529
|
+
$.fn.nextAll = function (selector) {
|
|
2530
|
+
var nextEls = [];
|
|
2531
|
+
var el = this[0];
|
|
2532
|
+
if (!el) return $([]);
|
|
2533
|
+
while (el.nextElementSibling) {
|
|
2534
|
+
var next = el.nextElementSibling;
|
|
2535
|
+
if (selector) {
|
|
2536
|
+
if ($(next).is(selector)) nextEls.push(next);
|
|
2537
|
+
} else nextEls.push(next);
|
|
2538
|
+
el = next;
|
|
2539
|
+
}
|
|
2540
|
+
return $(nextEls);
|
|
2541
|
+
};
|
|
2542
|
+
|
|
2543
|
+
//重置zepto的show方法,防止有些人引用的版本中 show 方法操作 opacity 属性影响动画执行
|
|
2544
|
+
$.fn.show = function () {
|
|
2545
|
+
var elementDisplay = {};
|
|
2546
|
+
function defaultDisplay(nodeName) {
|
|
2547
|
+
var element, display;
|
|
2548
|
+
if (!elementDisplay[nodeName]) {
|
|
2549
|
+
element = document.createElement(nodeName);
|
|
2550
|
+
document.body.appendChild(element);
|
|
2551
|
+
display = getComputedStyle(element, '').getPropertyValue("display");
|
|
2552
|
+
element.parentNode.removeChild(element);
|
|
2553
|
+
display === "none" && (display = "block");
|
|
2554
|
+
elementDisplay[nodeName] = display;
|
|
2555
|
+
}
|
|
2556
|
+
return elementDisplay[nodeName];
|
|
2557
|
+
}
|
|
2558
|
+
|
|
2559
|
+
return this.each(function () {
|
|
2560
|
+
this.style.display === "none" && (this.style.display = '');
|
|
2561
|
+
if (getComputedStyle(this, '').getPropertyValue("display") === "none") ;
|
|
2562
|
+
this.style.display = defaultDisplay(this.nodeName);
|
|
2563
|
+
});
|
|
2564
|
+
};
|
|
2565
|
+
|
|
2566
|
+
$.fn.serializeArray = function () {
|
|
2567
|
+
var name,
|
|
2568
|
+
type,
|
|
2569
|
+
result = [],
|
|
2570
|
+
add = function add(value) {
|
|
2571
|
+
if (value.forEach) return value.forEach(add);
|
|
2572
|
+
result.push({ name: name, value: value });
|
|
2573
|
+
};
|
|
2574
|
+
if (this[0]) $.each(this[0].elements, function (_, field) {
|
|
2575
|
+
type = field.type, name = field.name;
|
|
2576
|
+
if (name && field.nodeName.toLowerCase() != 'fieldset' && !field.disabled && type != 'submit' && type != 'reset' && type != 'button' && type != 'file' && (type != 'radio' && type != 'checkbox' || field.checked)) add($(field).val());
|
|
2577
|
+
});
|
|
2578
|
+
return result;
|
|
2579
|
+
};
|
|
2580
|
+
|
|
2581
|
+
$.fn.serialize = function () {
|
|
2582
|
+
var result = [];
|
|
2583
|
+
this.serializeArray().forEach(function (elm) {
|
|
2584
|
+
result.push(encodeURIComponent(elm.name) + '=' + encodeURIComponent(elm.value));
|
|
2585
|
+
});
|
|
2586
|
+
return result.join('&');
|
|
2587
|
+
};
|
|
2588
|
+
|
|
2589
|
+
/***/ }),
|
|
2590
|
+
|
|
2591
|
+
/***/ 96:
|
|
2592
|
+
/***/ (function(module, exports, __webpack_require__) {
|
|
2593
|
+
|
|
2594
|
+
"use strict";
|
|
2595
|
+
|
|
2596
|
+
|
|
2597
|
+
// Zepto.js
|
|
2598
|
+
// (c) 2010-2016 Thomas Fuchs
|
|
2599
|
+
// Zepto.js may be freely distributed under the MIT license.
|
|
2600
|
+
|
|
2601
|
+
;(function ($) {
|
|
2602
|
+
var touch = {},
|
|
2603
|
+
touchTimeout,
|
|
2604
|
+
tapTimeout,
|
|
2605
|
+
swipeTimeout,
|
|
2606
|
+
longTapTimeout,
|
|
2607
|
+
longTapDelay = 750,
|
|
2608
|
+
gesture;
|
|
2609
|
+
|
|
2610
|
+
function swipeDirection(x1, x2, y1, y2) {
|
|
2611
|
+
return Math.abs(x1 - x2) >= Math.abs(y1 - y2) ? x1 - x2 > 0 ? 'Left' : 'Right' : y1 - y2 > 0 ? 'Up' : 'Down';
|
|
2612
|
+
}
|
|
2613
|
+
|
|
2614
|
+
function longTap() {
|
|
2615
|
+
longTapTimeout = null;
|
|
2616
|
+
if (touch.last) {
|
|
2617
|
+
touch.el.trigger('longTap');
|
|
2618
|
+
touch = {};
|
|
2619
|
+
}
|
|
2620
|
+
}
|
|
2621
|
+
|
|
2622
|
+
function cancelLongTap() {
|
|
2623
|
+
if (longTapTimeout) clearTimeout(longTapTimeout);
|
|
2624
|
+
longTapTimeout = null;
|
|
2625
|
+
}
|
|
2626
|
+
|
|
2627
|
+
function cancelAll() {
|
|
2628
|
+
if (touchTimeout) clearTimeout(touchTimeout);
|
|
2629
|
+
if (tapTimeout) clearTimeout(tapTimeout);
|
|
2630
|
+
if (swipeTimeout) clearTimeout(swipeTimeout);
|
|
2631
|
+
if (longTapTimeout) clearTimeout(longTapTimeout);
|
|
2632
|
+
touchTimeout = tapTimeout = swipeTimeout = longTapTimeout = null;
|
|
2633
|
+
touch = {};
|
|
2634
|
+
}
|
|
2635
|
+
|
|
2636
|
+
function isPrimaryTouch(event) {
|
|
2637
|
+
return (event.pointerType == 'touch' || event.pointerType == event.MSPOINTER_TYPE_TOUCH) && event.isPrimary;
|
|
2638
|
+
}
|
|
2639
|
+
|
|
2640
|
+
function isPointerEventType(e, type) {
|
|
2641
|
+
return e.type == 'pointer' + type || e.type.toLowerCase() == 'mspointer' + type;
|
|
2642
|
+
}
|
|
2643
|
+
|
|
2644
|
+
$(document).ready(function () {
|
|
2645
|
+
var now,
|
|
2646
|
+
delta,
|
|
2647
|
+
deltaX = 0,
|
|
2648
|
+
deltaY = 0,
|
|
2649
|
+
firstTouch,
|
|
2650
|
+
_isPointerType;
|
|
2651
|
+
|
|
2652
|
+
if ('MSGesture' in window) {
|
|
2653
|
+
gesture = new MSGesture();
|
|
2654
|
+
gesture.target = document.body;
|
|
2655
|
+
}
|
|
2656
|
+
|
|
2657
|
+
$(document).bind('MSGestureEnd', function (e) {
|
|
2658
|
+
var swipeDirectionFromVelocity = e.velocityX > 1 ? 'Right' : e.velocityX < -1 ? 'Left' : e.velocityY > 1 ? 'Down' : e.velocityY < -1 ? 'Up' : null;
|
|
2659
|
+
if (swipeDirectionFromVelocity) {
|
|
2660
|
+
touch.el.trigger('swipe');
|
|
2661
|
+
touch.el.trigger('swipe' + swipeDirectionFromVelocity);
|
|
2662
|
+
}
|
|
2663
|
+
}).on('touchstart MSPointerDown', function (e) {
|
|
2664
|
+
if ((_isPointerType = isPointerEventType(e, 'down')) && !isPrimaryTouch(e)) return;
|
|
2665
|
+
firstTouch = _isPointerType ? e : e.touches[0];
|
|
2666
|
+
if (e.touches && e.touches.length === 1 && touch.x2) {
|
|
2667
|
+
// Clear out touch movement data if we have it sticking around
|
|
2668
|
+
// This can occur if touchcancel doesn't fire due to preventDefault, etc.
|
|
2669
|
+
touch.x2 = undefined;
|
|
2670
|
+
touch.y2 = undefined;
|
|
2671
|
+
}
|
|
2672
|
+
now = Date.now();
|
|
2673
|
+
delta = now - (touch.last || now);
|
|
2674
|
+
touch.el = $('tagName' in firstTouch.target ? firstTouch.target : firstTouch.target.parentNode);
|
|
2675
|
+
touchTimeout && clearTimeout(touchTimeout);
|
|
2676
|
+
touch.x1 = firstTouch.pageX;
|
|
2677
|
+
touch.y1 = firstTouch.pageY;
|
|
2678
|
+
if (delta > 0 && delta <= 250) touch.isDoubleTap = true;
|
|
2679
|
+
touch.last = now;
|
|
2680
|
+
longTapTimeout = setTimeout(longTap, longTapDelay);
|
|
2681
|
+
// adds the current touch contact for IE gesture recognition
|
|
2682
|
+
if (gesture && _isPointerType) gesture.addPointer(e.pointerId);
|
|
2683
|
+
}).on('touchmove MSPointerMove', function (e) {
|
|
2684
|
+
if ((_isPointerType = isPointerEventType(e, 'move')) && !isPrimaryTouch(e)) return;
|
|
2685
|
+
firstTouch = _isPointerType ? e : e.touches[0];
|
|
2686
|
+
cancelLongTap();
|
|
2687
|
+
touch.x2 = firstTouch.pageX;
|
|
2688
|
+
touch.y2 = firstTouch.pageY;
|
|
2689
|
+
|
|
2690
|
+
deltaX += Math.abs(touch.x1 - touch.x2);
|
|
2691
|
+
deltaY += Math.abs(touch.y1 - touch.y2);
|
|
2692
|
+
}).on('touchend MSPointerUp', function (e) {
|
|
2693
|
+
if ((_isPointerType = isPointerEventType(e, 'up')) && !isPrimaryTouch(e)) return;
|
|
2694
|
+
cancelLongTap();
|
|
2695
|
+
|
|
2696
|
+
// swipe
|
|
2697
|
+
if (touch.x2 && Math.abs(touch.x1 - touch.x2) > 30 || touch.y2 && Math.abs(touch.y1 - touch.y2) > 30) swipeTimeout = setTimeout(function () {
|
|
2698
|
+
if (touch.el) {
|
|
2699
|
+
touch.el.trigger('swipe');
|
|
2700
|
+
touch.el.trigger('swipe' + swipeDirection(touch.x1, touch.x2, touch.y1, touch.y2));
|
|
2701
|
+
}
|
|
2702
|
+
touch = {};
|
|
2703
|
+
}, 0);
|
|
2704
|
+
|
|
2705
|
+
// normal tap
|
|
2706
|
+
else if ('last' in touch)
|
|
2707
|
+
// don't fire tap when delta position changed by more than 30 pixels,
|
|
2708
|
+
// for instance when moving to a point and back to origin
|
|
2709
|
+
if (deltaX < 30 && deltaY < 30) {
|
|
2710
|
+
// delay by one tick so we can cancel the 'tap' event if 'scroll' fires
|
|
2711
|
+
// ('tap' fires before 'scroll')
|
|
2712
|
+
tapTimeout = setTimeout(function () {
|
|
2713
|
+
|
|
2714
|
+
// trigger universal 'tap' with the option to cancelTouch()
|
|
2715
|
+
// (cancelTouch cancels processing of single vs double taps for faster 'tap' response)
|
|
2716
|
+
var event = $.Event('tap');
|
|
2717
|
+
event.cancelTouch = cancelAll;
|
|
2718
|
+
// [by paper] fix -> "TypeError: 'undefined' is not an object (evaluating 'touch.el.trigger'), when double tap
|
|
2719
|
+
if (touch.el) touch.el.trigger(event);
|
|
2720
|
+
|
|
2721
|
+
// trigger double tap immediately
|
|
2722
|
+
if (touch.isDoubleTap) {
|
|
2723
|
+
if (touch.el) touch.el.trigger('doubleTap');
|
|
2724
|
+
touch = {};
|
|
2725
|
+
}
|
|
2726
|
+
|
|
2727
|
+
// trigger single tap after 250ms of inactivity
|
|
2728
|
+
else {
|
|
2729
|
+
touchTimeout = setTimeout(function () {
|
|
2730
|
+
touchTimeout = null;
|
|
2731
|
+
if (touch.el) touch.el.trigger('singleTap');
|
|
2732
|
+
touch = {};
|
|
2733
|
+
}, 250);
|
|
2734
|
+
}
|
|
2735
|
+
}, 0);
|
|
2736
|
+
} else {
|
|
2737
|
+
touch = {};
|
|
2738
|
+
}
|
|
2739
|
+
deltaX = deltaY = 0;
|
|
2740
|
+
})
|
|
2741
|
+
// when the browser window loses focus,
|
|
2742
|
+
// for example when a modal dialog is shown,
|
|
2743
|
+
// cancel all ongoing events
|
|
2744
|
+
.on('touchcancel MSPointerCancel', cancelAll);
|
|
2745
|
+
|
|
2746
|
+
// scrolling the window indicates intention of the user
|
|
2747
|
+
// to scroll, not tap or swipe, so cancel all ongoing events
|
|
2748
|
+
$(window).on('scroll', cancelAll);
|
|
2749
|
+
});['swipe', 'swipeLeft', 'swipeRight', 'swipeUp', 'swipeDown', 'doubleTap', 'tap', 'singleTap', 'longTap'].forEach(function (eventName) {
|
|
2750
|
+
$.fn[eventName] = function (callback) {
|
|
2751
|
+
return this.on(eventName, callback);
|
|
2752
|
+
};
|
|
2753
|
+
});
|
|
2754
|
+
})(Zepto);
|
|
2755
|
+
|
|
2756
|
+
/***/ })
|
|
2757
|
+
|
|
2758
|
+
/******/ });
|
|
2759
|
+
});
|