zepto.js 38 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030
  1. /*! Zepto v1.1.3 - zepto event ajax form ie - zeptojs.com/license */
  2. var Zepto = function() {
  3. function L(t) {
  4. return null == t ? String(t) : j[T.call(t)] || "object"
  5. }
  6. function Z(t) {
  7. return "function" == L(t)
  8. }
  9. function $(t) {
  10. return null != t && t == t.window
  11. }
  12. function _(t) {
  13. return null != t && t.nodeType == t.DOCUMENT_NODE
  14. }
  15. function D(t) {
  16. return "object" == L(t)
  17. }
  18. function R(t) {
  19. return D(t) && !$(t) && Object.getPrototypeOf(t) == Object.prototype
  20. }
  21. function M(t) {
  22. return "number" == typeof t.length
  23. }
  24. function k(t) {
  25. return s.call(t, function(t) {
  26. return null != t
  27. })
  28. }
  29. function z(t) {
  30. return t.length > 0 ? n.fn.concat.apply([], t) : t
  31. }
  32. function F(t) {
  33. 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()
  34. }
  35. function q(t) {
  36. return t in f ? f[t] : f[t] = new RegExp("(^|\\s)" + t + "(\\s|$)")
  37. }
  38. function H(t, e) {
  39. return "number" != typeof e || c[F(t)] ? e : e + "px"
  40. }
  41. function I(t) {
  42. var e, n;
  43. return u[t] || (e = a.createElement(t), a.body.appendChild(e), n = getComputedStyle(e, "").getPropertyValue("display"), e.parentNode.removeChild(e), "none" == n && (n = "block"), u[t] = n), u[t]
  44. }
  45. function V(t) {
  46. return "children" in t ? o.call(t.children) : n.map(t.childNodes, function(t) {
  47. return 1 == t.nodeType ? t : void 0
  48. })
  49. }
  50. function U(n, i, r) {
  51. for (e in i) r && (R(i[e]) || A(i[e])) ? (R(i[e]) && !R(n[e]) && (n[e] = {}), A(i[e]) && !A(n[e]) && (n[e] = []), U(n[e], i[e], r)) : i[e] !== t && (n[e] = i[e])
  52. }
  53. function B(t, e) {
  54. return null == e ? n(t) : n(t).filter(e)
  55. }
  56. function J(t, e, n, i) {
  57. return Z(e) ? e.call(t, n, i) : e
  58. }
  59. function X(t, e, n) {
  60. null == n ? t.removeAttribute(e) : t.setAttribute(e, n)
  61. }
  62. function W(e, n) {
  63. var i = e.className,
  64. r = i && i.baseVal !== t;
  65. return n === t ? r ? i.baseVal : i : void(r ? i.baseVal = n : e.className = n)
  66. }
  67. function Y(t) {
  68. var e;
  69. try {
  70. return t ? "true" == t || ("false" == t ? !1 : "null" == t ? null : /^0/.test(t) || isNaN(e = Number(t)) ? /^[\[\{]/.test(t) ? n.parseJSON(t) : t : e) : t
  71. } catch (i) {
  72. return t
  73. }
  74. }
  75. function G(t, e) {
  76. e(t);
  77. for (var n in t.childNodes) G(t.childNodes[n], e)
  78. }
  79. var t, e, n, i, C, N, r = [],
  80. o = r.slice,
  81. s = r.filter,
  82. a = window.document,
  83. u = {}, f = {}, c = {
  84. "column-count": 1,
  85. columns: 1,
  86. "font-weight": 1,
  87. "line-height": 1,
  88. opacity: 1,
  89. "z-index": 1,
  90. zoom: 1
  91. }, l = /^\s*<(\w+|!)[^>]*>/,
  92. h = /^<(\w+)\s*\/?>(?:<\/\1>|)$/,
  93. p = /<(?!area|br|col|embed|hr|img|input|link|meta|param)(([\w:]+)[^>]*)\/>/gi,
  94. d = /^(?:body|html)$/i,
  95. m = /([A-Z])/g,
  96. g = ["val", "css", "html", "text", "data", "width", "height", "offset"],
  97. v = ["after", "prepend", "before", "append"],
  98. y = a.createElement("table"),
  99. x = a.createElement("tr"),
  100. b = {
  101. tr: a.createElement("tbody"),
  102. tbody: y,
  103. thead: y,
  104. tfoot: y,
  105. td: x,
  106. th: x,
  107. "*": a.createElement("div")
  108. }, w = /complete|loaded|interactive/,
  109. E = /^[\w-]*$/,
  110. j = {}, T = j.toString,
  111. S = {}, O = a.createElement("div"),
  112. P = {
  113. tabindex: "tabIndex",
  114. readonly: "readOnly",
  115. "for": "htmlFor",
  116. "class": "className",
  117. maxlength: "maxLength",
  118. cellspacing: "cellSpacing",
  119. cellpadding: "cellPadding",
  120. rowspan: "rowSpan",
  121. colspan: "colSpan",
  122. usemap: "useMap",
  123. frameborder: "frameBorder",
  124. contenteditable: "contentEditable"
  125. }, A = Array.isArray || function(t) {
  126. return t instanceof Array
  127. };
  128. return S.matches = function(t, e) {
  129. if (!e || !t || 1 !== t.nodeType) return !1;
  130. var n = t.webkitMatchesSelector || t.mozMatchesSelector || t.oMatchesSelector || t.matchesSelector;
  131. if (n) return n.call(t, e);
  132. var i, r = t.parentNode,
  133. o = !r;
  134. return o && (r = O).appendChild(t), i = ~S.qsa(r, e).indexOf(t), o && O.removeChild(t), i
  135. }, C = function(t) {
  136. return t.replace(/-+(.)?/g, function(t, e) {
  137. return e ? e.toUpperCase() : ""
  138. })
  139. }, N = function(t) {
  140. return s.call(t, function(e, n) {
  141. return t.indexOf(e) == n
  142. })
  143. }, S.fragment = function(e, i, r) {
  144. var s, u, f;
  145. return h.test(e) && (s = n(a.createElement(RegExp.$1))), s || (e.replace && (e = e.replace(p, "<$1></$2>")), i === t && (i = l.test(e) && RegExp.$1), i in b || (i = "*"), f = b[i], f.innerHTML = "" + e, s = n.each(o.call(f.childNodes), function() {
  146. f.removeChild(this)
  147. })), R(r) && (u = n(s), n.each(r, function(t, e) {
  148. g.indexOf(t) > -1 ? u[t](e) : u.attr(t, e)
  149. })), s
  150. }, S.Z = function(t, e) {
  151. return t = t || [], t.__proto__ = n.fn, t.selector = e || "", t
  152. }, S.isZ = function(t) {
  153. return t instanceof S.Z
  154. }, S.init = function(e, i) {
  155. var r;
  156. if (!e) return S.Z();
  157. if ("string" == typeof e)
  158. if (e = e.trim(), "<" == e[0] && l.test(e)) r = S.fragment(e, RegExp.$1, i), e = null;
  159. else {
  160. if (i !== t) return n(i).find(e);
  161. r = S.qsa(a, e)
  162. } else {
  163. if (Z(e)) return n(a).ready(e);
  164. if (S.isZ(e)) return e;
  165. if (A(e)) r = k(e);
  166. else if (D(e)) r = [e], e = null;
  167. else if (l.test(e)) r = S.fragment(e.trim(), RegExp.$1, i), e = null;
  168. else {
  169. if (i !== t) return n(i).find(e);
  170. r = S.qsa(a, e)
  171. }
  172. }
  173. return S.Z(r, e)
  174. }, n = function(t, e) {
  175. return S.init(t, e)
  176. }, n.extend = function(t) {
  177. var e, n = o.call(arguments, 1);
  178. return "boolean" == typeof t && (e = t, t = n.shift()), n.forEach(function(n) {
  179. U(t, n, e)
  180. }), t
  181. }, S.qsa = function(t, e) {
  182. var n, i = "#" == e[0],
  183. r = !i && "." == e[0],
  184. s = i || r ? e.slice(1) : e,
  185. a = E.test(s);
  186. return _(t) && a && i ? (n = t.getElementById(s)) ? [n] : [] : 1 !== t.nodeType && 9 !== t.nodeType ? [] : o.call(a && !i ? r ? t.getElementsByClassName(s) : t.getElementsByTagName(e) : t.querySelectorAll(e))
  187. }, n.contains = function(t, e) {
  188. return t !== e && t.contains(e)
  189. }, n.type = L, n.isFunction = Z, n.isWindow = $, n.isArray = A, n.isPlainObject = R, n.isEmptyObject = function(t) {
  190. var e;
  191. for (e in t) return !1;
  192. return !0
  193. }, n.inArray = function(t, e, n) {
  194. return r.indexOf.call(e, t, n)
  195. }, n.camelCase = C, n.trim = function(t) {
  196. return null == t ? "" : String.prototype.trim.call(t)
  197. }, n.uuid = 0, n.support = {}, n.expr = {}, n.map = function(t, e) {
  198. var n, r, o, i = [];
  199. if (M(t))
  200. for (r = 0; r < t.length; r++) n = e(t[r], r), null != n && i.push(n);
  201. else
  202. for (o in t) n = e(t[o], o), null != n && i.push(n);
  203. return z(i)
  204. }, n.each = function(t, e) {
  205. var n, i;
  206. if (M(t)) {
  207. for (n = 0; n < t.length; n++)
  208. if (e.call(t[n], n, t[n]) === !1) return t
  209. } else
  210. for (i in t)
  211. if (e.call(t[i], i, t[i]) === !1) return t; return t
  212. }, n.grep = function(t, e) {
  213. return s.call(t, e)
  214. }, window.JSON && (n.parseJSON = JSON.parse), n.each("Boolean Number String Function Array Date RegExp Object Error".split(" "), function(t, e) {
  215. j["[object " + e + "]"] = e.toLowerCase()
  216. }), n.fn = {
  217. forEach: r.forEach,
  218. reduce: r.reduce,
  219. push: r.push,
  220. sort: r.sort,
  221. indexOf: r.indexOf,
  222. concat: r.concat,
  223. map: function(t) {
  224. return n(n.map(this, function(e, n) {
  225. return t.call(e, n, e)
  226. }))
  227. },
  228. slice: function() {
  229. return n(o.apply(this, arguments))
  230. },
  231. ready: function(t) {
  232. return w.test(a.readyState) && a.body ? t(n) : a.addEventListener("DOMContentLoaded", function() {
  233. t(n)
  234. }, !1), this
  235. },
  236. get: function(e) {
  237. return e === t ? o.call(this) : this[e >= 0 ? e : e + this.length]
  238. },
  239. toArray: function() {
  240. return this.get()
  241. },
  242. size: function() {
  243. return this.length
  244. },
  245. remove: function() {
  246. return this.each(function() {
  247. null != this.parentNode && this.parentNode.removeChild(this)
  248. })
  249. },
  250. each: function(t) {
  251. return r.every.call(this, function(e, n) {
  252. return t.call(e, n, e) !== !1
  253. }), this
  254. },
  255. filter: function(t) {
  256. return Z(t) ? this.not(this.not(t)) : n(s.call(this, function(e) {
  257. return S.matches(e, t)
  258. }))
  259. },
  260. add: function(t, e) {
  261. return n(N(this.concat(n(t, e))))
  262. },
  263. is: function(t) {
  264. return this.length > 0 && S.matches(this[0], t)
  265. },
  266. not: function(e) {
  267. var i = [];
  268. if (Z(e) && e.call !== t) this.each(function(t) {
  269. e.call(this, t) || i.push(this)
  270. });
  271. else {
  272. var r = "string" == typeof e ? this.filter(e) : M(e) && Z(e.item) ? o.call(e) : n(e);
  273. this.forEach(function(t) {
  274. r.indexOf(t) < 0 && i.push(t)
  275. })
  276. }
  277. return n(i)
  278. },
  279. has: function(t) {
  280. return this.filter(function() {
  281. return D(t) ? n.contains(this, t) : n(this).find(t).size()
  282. })
  283. },
  284. eq: function(t) {
  285. return -1 === t ? this.slice(t) : this.slice(t, +t + 1)
  286. },
  287. first: function() {
  288. var t = this[0];
  289. return t && !D(t) ? t : n(t)
  290. },
  291. last: function() {
  292. var t = this[this.length - 1];
  293. return t && !D(t) ? t : n(t)
  294. },
  295. find: function(t) {
  296. var e, i = this;
  297. return e = "object" == typeof t ? n(t).filter(function() {
  298. var t = this;
  299. return r.some.call(i, function(e) {
  300. return n.contains(e, t)
  301. })
  302. }) : 1 == this.length ? n(S.qsa(this[0], t)) : this.map(function() {
  303. return S.qsa(this, t)
  304. })
  305. },
  306. closest: function(t, e) {
  307. var i = this[0],
  308. r = !1;
  309. for ("object" == typeof t && (r = n(t)); i && !(r ? r.indexOf(i) >= 0 : S.matches(i, t));) i = i !== e && !_(i) && i.parentNode;
  310. return n(i)
  311. },
  312. parents: function(t) {
  313. for (var e = [], i = this; i.length > 0;) i = n.map(i, function(t) {
  314. return (t = t.parentNode) && !_(t) && e.indexOf(t) < 0 ? (e.push(t), t) : void 0
  315. });
  316. return B(e, t)
  317. },
  318. parent: function(t) {
  319. return B(N(this.pluck("parentNode")), t)
  320. },
  321. children: function(t) {
  322. return B(this.map(function() {
  323. return V(this)
  324. }), t)
  325. },
  326. contents: function() {
  327. return this.map(function() {
  328. return o.call(this.childNodes)
  329. })
  330. },
  331. siblings: function(t) {
  332. return B(this.map(function(t, e) {
  333. return s.call(V(e.parentNode), function(t) {
  334. return t !== e
  335. })
  336. }), t)
  337. },
  338. empty: function() {
  339. return this.each(function() {
  340. this.innerHTML = ""
  341. })
  342. },
  343. pluck: function(t) {
  344. return n.map(this, function(e) {
  345. return e[t]
  346. })
  347. },
  348. show: function() {
  349. return this.each(function() {
  350. "none" == this.style.display && (this.style.display = ""), "none" == getComputedStyle(this, "").getPropertyValue("display") && (this.style.display = I(this.nodeName))
  351. })
  352. },
  353. replaceWith: function(t) {
  354. return this.before(t).remove()
  355. },
  356. wrap: function(t) {
  357. var e = Z(t);
  358. if (this[0] && !e) var i = n(t).get(0),
  359. r = i.parentNode || this.length > 1;
  360. return this.each(function(o) {
  361. n(this).wrapAll(e ? t.call(this, o) : r ? i.cloneNode(!0) : i)
  362. })
  363. },
  364. wrapAll: function(t) {
  365. if (this[0]) {
  366. n(this[0]).before(t = n(t));
  367. for (var e;
  368. (e = t.children()).length;) t = e.first();
  369. n(t).append(this)
  370. }
  371. return this
  372. },
  373. wrapInner: function(t) {
  374. var e = Z(t);
  375. return this.each(function(i) {
  376. var r = n(this),
  377. o = r.contents(),
  378. s = e ? t.call(this, i) : t;
  379. o.length ? o.wrapAll(s) : r.append(s)
  380. })
  381. },
  382. unwrap: function() {
  383. return this.parent().each(function() {
  384. n(this).replaceWith(n(this).children())
  385. }), this
  386. },
  387. clone: function() {
  388. return this.map(function() {
  389. return this.cloneNode(!0)
  390. })
  391. },
  392. hide: function() {
  393. return this.css("display", "none")
  394. },
  395. toggle: function(e) {
  396. return this.each(function() {
  397. var i = n(this);
  398. (e === t ? "none" == i.css("display") : e) ? i.show() : i.hide()
  399. })
  400. },
  401. prev: function(t) {
  402. return n(this.pluck("previousElementSibling")).filter(t || "*")
  403. },
  404. next: function(t) {
  405. return n(this.pluck("nextElementSibling")).filter(t || "*")
  406. },
  407. html: function(t) {
  408. return 0 === arguments.length ? this.length > 0 ? this[0].innerHTML : null : this.each(function(e) {
  409. var i = this.innerHTML;
  410. n(this).empty().append(J(this, t, e, i))
  411. })
  412. },
  413. text: function(e) {
  414. return 0 === arguments.length ? this.length > 0 ? this[0].textContent : null : this.each(function() {
  415. this.textContent = e === t ? "" : "" + e
  416. })
  417. },
  418. attr: function(n, i) {
  419. var r;
  420. return "string" == typeof n && i === t ? 0 == this.length || 1 !== this[0].nodeType ? t : "value" == n && "INPUT" == this[0].nodeName ? this.val() : !(r = this[0].getAttribute(n)) && n in this[0] ? this[0][n] : r : this.each(function(t) {
  421. if (1 === this.nodeType)
  422. if (D(n))
  423. for (e in n) X(this, e, n[e]);
  424. else X(this, n, J(this, i, t, this.getAttribute(n)))
  425. })
  426. },
  427. removeAttr: function(t) {
  428. return this.each(function() {
  429. 1 === this.nodeType && X(this, t)
  430. })
  431. },
  432. prop: function(e, n) {
  433. return e = P[e] || e, n === t ? this[0] && this[0][e] : this.each(function(t) {
  434. this[e] = J(this, n, t, this[e])
  435. })
  436. },
  437. data: function(e, n) {
  438. var i = this.attr("data-" + e.replace(m, "-$1").toLowerCase(), n);
  439. return null !== i ? Y(i) : t
  440. },
  441. val: function(t) {
  442. return 0 === arguments.length ? this[0] && (this[0].multiple ? n(this[0]).find("option").filter(function() {
  443. return this.selected
  444. }).pluck("value") : this[0].value) : this.each(function(e) {
  445. this.value = J(this, t, e, this.value)
  446. })
  447. },
  448. offset: function(t) {
  449. if (t) return this.each(function(e) {
  450. var i = n(this),
  451. r = J(this, t, e, i.offset()),
  452. o = i.offsetParent().offset(),
  453. s = {
  454. top: r.top - o.top,
  455. left: r.left - o.left
  456. };
  457. "static" == i.css("position") && (s.position = "relative"), i.css(s)
  458. });
  459. if (0 == this.length) return null;
  460. var e = this[0].getBoundingClientRect();
  461. return {
  462. left: e.left + window.pageXOffset,
  463. top: e.top + window.pageYOffset,
  464. width: Math.round(e.width),
  465. height: Math.round(e.height)
  466. }
  467. },
  468. css: function(t, i) {
  469. if (arguments.length < 2) {
  470. var r = this[0],
  471. o = getComputedStyle(r, "");
  472. if (!r) return;
  473. if ("string" == typeof t) return r.style[C(t)] || o.getPropertyValue(t);
  474. if (A(t)) {
  475. var s = {};
  476. return n.each(A(t) ? t : [t], function(t, e) {
  477. s[e] = r.style[C(e)] || o.getPropertyValue(e)
  478. }), s
  479. }
  480. }
  481. var a = "";
  482. if ("string" == L(t)) i || 0 === i ? a = F(t) + ":" + H(t, i) : this.each(function() {
  483. this.style.removeProperty(F(t))
  484. });
  485. else
  486. for (e in t) t[e] || 0 === t[e] ? a += F(e) + ":" + H(e, t[e]) + ";" : this.each(function() {
  487. this.style.removeProperty(F(e))
  488. });
  489. return this.each(function() {
  490. this.style.cssText += ";" + a
  491. })
  492. },
  493. index: function(t) {
  494. return t ? this.indexOf(n(t)[0]) : this.parent().children().indexOf(this[0])
  495. },
  496. hasClass: function(t) {
  497. return t ? r.some.call(this, function(t) {
  498. return this.test(W(t))
  499. }, q(t)) : !1
  500. },
  501. addClass: function(t) {
  502. return t ? this.each(function(e) {
  503. i = [];
  504. var r = W(this),
  505. o = J(this, t, e, r);
  506. o.split(/\s+/g).forEach(function(t) {
  507. n(this).hasClass(t) || i.push(t)
  508. }, this), i.length && W(this, r + (r ? " " : "") + i.join(" "))
  509. }) : this
  510. },
  511. removeClass: function(e) {
  512. return this.each(function(n) {
  513. return e === t ? W(this, "") : (i = W(this), J(this, e, n, i).split(/\s+/g).forEach(function(t) {
  514. i = i.replace(q(t), " ")
  515. }), void W(this, i.trim()))
  516. })
  517. },
  518. toggleClass: function(e, i) {
  519. return e ? this.each(function(r) {
  520. var o = n(this),
  521. s = J(this, e, r, W(this));
  522. s.split(/\s+/g).forEach(function(e) {
  523. (i === t ? !o.hasClass(e) : i) ? o.addClass(e) : o.removeClass(e)
  524. })
  525. }) : this
  526. },
  527. scrollTop: function(e) {
  528. if (this.length) {
  529. var n = "scrollTop" in this[0];
  530. return e === t ? n ? this[0].scrollTop : this[0].pageYOffset : this.each(n ? function() {
  531. this.scrollTop = e
  532. } : function() {
  533. this.scrollTo(this.scrollX, e)
  534. })
  535. }
  536. },
  537. scrollLeft: function(e) {
  538. if (this.length) {
  539. var n = "scrollLeft" in this[0];
  540. return e === t ? n ? this[0].scrollLeft : this[0].pageXOffset : this.each(n ? function() {
  541. this.scrollLeft = e
  542. } : function() {
  543. this.scrollTo(e, this.scrollY)
  544. })
  545. }
  546. },
  547. position: function() {
  548. if (this.length) {
  549. var t = this[0],
  550. e = this.offsetParent(),
  551. i = this.offset(),
  552. r = d.test(e[0].nodeName) ? {
  553. top: 0,
  554. left: 0
  555. } : e.offset();
  556. return i.top -= parseFloat(n(t).css("margin-top")) || 0, i.left -= parseFloat(n(t).css("margin-left")) || 0, r.top += parseFloat(n(e[0]).css("border-top-width")) || 0, r.left += parseFloat(n(e[0]).css("border-left-width")) || 0, {
  557. top: i.top - r.top,
  558. left: i.left - r.left
  559. }
  560. }
  561. },
  562. offsetParent: function() {
  563. return this.map(function() {
  564. for (var t = this.offsetParent || a.body; t && !d.test(t.nodeName) && "static" == n(t).css("position");) t = t.offsetParent;
  565. return t
  566. })
  567. }
  568. }, n.fn.detach = n.fn.remove, ["width", "height"].forEach(function(e) {
  569. var i = e.replace(/./, function(t) {
  570. return t[0].toUpperCase()
  571. });
  572. n.fn[e] = function(r) {
  573. var o, s = this[0];
  574. return r === t ? $(s) ? s["inner" + i] : _(s) ? s.documentElement["scroll" + i] : (o = this.offset()) && o[e] : this.each(function(t) {
  575. s = n(this), s.css(e, J(this, r, t, s[e]()))
  576. })
  577. }
  578. }), v.forEach(function(t, e) {
  579. var i = e % 2;
  580. n.fn[t] = function() {
  581. var t, o, r = n.map(arguments, function(e) {
  582. return t = L(e), "object" == t || "array" == t || null == e ? e : S.fragment(e)
  583. }),
  584. s = this.length > 1;
  585. return r.length < 1 ? this : this.each(function(t, a) {
  586. o = i ? a : a.parentNode, a = 0 == e ? a.nextSibling : 1 == e ? a.firstChild : 2 == e ? a : null, r.forEach(function(t) {
  587. if (s) t = t.cloneNode(!0);
  588. else if (!o) return n(t).remove();
  589. G(o.insertBefore(t, a), function(t) {
  590. null == t.nodeName || "SCRIPT" !== t.nodeName.toUpperCase() || t.type && "text/javascript" !== t.type || t.src || window.eval.call(window, t.innerHTML)
  591. })
  592. })
  593. })
  594. }, n.fn[i ? t + "To" : "insert" + (e ? "Before" : "After")] = function(e) {
  595. return n(e)[t](this), this
  596. }
  597. }), S.Z.prototype = n.fn, S.uniq = N, S.deserializeValue = Y, n.zepto = S, n
  598. }();
  599. window.Zepto = Zepto, void 0 === window.$ && (window.$ = Zepto),
  600. function(t) {
  601. function l(t) {
  602. return t._zid || (t._zid = e++)
  603. }
  604. function h(t, e, n, i) {
  605. if (e = p(e), e.ns) var r = d(e.ns);
  606. return (s[l(t)] || []).filter(function(t) {
  607. return !(!t || e.e && t.e != e.e || e.ns && !r.test(t.ns) || n && l(t.fn) !== l(n) || i && t.sel != i)
  608. })
  609. }
  610. function p(t) {
  611. var e = ("" + t).split(".");
  612. return {
  613. e: e[0],
  614. ns: e.slice(1).sort().join(" ")
  615. }
  616. }
  617. function d(t) {
  618. return new RegExp("(?:^| )" + t.replace(" ", " .* ?") + "(?: |$)")
  619. }
  620. function m(t, e) {
  621. return t.del && !u && t.e in f || !! e
  622. }
  623. function g(t) {
  624. return c[t] || u && f[t] || t
  625. }
  626. function v(e, i, r, o, a, u, f) {
  627. var h = l(e),
  628. d = s[h] || (s[h] = []);
  629. i.split(/\s/).forEach(function(i) {
  630. if ("ready" == i) return t(document).ready(r);
  631. var s = p(i);
  632. s.fn = r, s.sel = a, s.e in c && (r = function(e) {
  633. var n = e.relatedTarget;
  634. return !n || n !== this && !t.contains(this, n) ? s.fn.apply(this, arguments) : void 0
  635. }), s.del = u;
  636. var l = u || r;
  637. s.proxy = function(t) {
  638. if (t = j(t), !t.isImmediatePropagationStopped()) {
  639. t.data = o;
  640. var i = l.apply(e, t._args == n ? [t] : [t].concat(t._args));
  641. return i === !1 && (t.preventDefault(), t.stopPropagation()), i
  642. }
  643. }, s.i = d.length, d.push(s), "addEventListener" in e && e.addEventListener(g(s.e), s.proxy, m(s, f))
  644. })
  645. }
  646. function y(t, e, n, i, r) {
  647. var o = l(t);
  648. (e || "").split(/\s/).forEach(function(e) {
  649. h(t, e, n, i).forEach(function(e) {
  650. delete s[o][e.i], "removeEventListener" in t && t.removeEventListener(g(e.e), e.proxy, m(e, r))
  651. })
  652. })
  653. }
  654. function j(e, i) {
  655. return (i || !e.isDefaultPrevented) && (i || (i = e), t.each(E, function(t, n) {
  656. var r = i[t];
  657. e[t] = function() {
  658. return this[n] = x, r && r.apply(i, arguments)
  659. }, e[n] = b
  660. }), (i.defaultPrevented !== n ? i.defaultPrevented : "returnValue" in i ? i.returnValue === !1 : i.getPreventDefault && i.getPreventDefault()) && (e.isDefaultPrevented = x)), e
  661. }
  662. function T(t) {
  663. var e, i = {
  664. originalEvent: t
  665. };
  666. for (e in t) w.test(e) || t[e] === n || (i[e] = t[e]);
  667. return j(i, t)
  668. }
  669. var n, e = 1,
  670. i = Array.prototype.slice,
  671. r = t.isFunction,
  672. o = function(t) {
  673. return "string" == typeof t
  674. }, s = {}, a = {}, u = "onfocusin" in window,
  675. f = {
  676. focus: "focusin",
  677. blur: "focusout"
  678. }, c = {
  679. mouseenter: "mouseover",
  680. mouseleave: "mouseout"
  681. };
  682. a.click = a.mousedown = a.mouseup = a.mousemove = "MouseEvents", t.event = {
  683. add: v,
  684. remove: y
  685. }, t.proxy = function(e, n) {
  686. if (r(e)) {
  687. var i = function() {
  688. return e.apply(n, arguments)
  689. };
  690. return i._zid = l(e), i
  691. }
  692. if (o(n)) return t.proxy(e[n], e);
  693. throw new TypeError("expected function")
  694. }, t.fn.bind = function(t, e, n) {
  695. return this.on(t, e, n)
  696. }, t.fn.unbind = function(t, e) {
  697. return this.off(t, e)
  698. }, t.fn.one = function(t, e, n, i) {
  699. return this.on(t, e, n, i, 1)
  700. };
  701. var x = function() {
  702. return !0
  703. }, b = function() {
  704. return !1
  705. }, w = /^([A-Z]|returnValue$|layer[XY]$)/,
  706. E = {
  707. preventDefault: "isDefaultPrevented",
  708. stopImmediatePropagation: "isImmediatePropagationStopped",
  709. stopPropagation: "isPropagationStopped"
  710. };
  711. t.fn.delegate = function(t, e, n) {
  712. return this.on(e, t, n)
  713. }, t.fn.undelegate = function(t, e, n) {
  714. return this.off(e, t, n)
  715. }, t.fn.live = function(e, n) {
  716. return t(document.body).delegate(this.selector, e, n), this
  717. }, t.fn.die = function(e, n) {
  718. return t(document.body).undelegate(this.selector, e, n), this
  719. }, t.fn.on = function(e, s, a, u, f) {
  720. var c, l, h = this;
  721. return e && !o(e) ? (t.each(e, function(t, e) {
  722. h.on(t, s, a, e, f)
  723. }), h) : (o(s) || r(u) || u === !1 || (u = a, a = s, s = n), (r(a) || a === !1) && (u = a, a = n), u === !1 && (u = b), h.each(function(n, r) {
  724. f && (c = function(t) {
  725. return y(r, t.type, u), u.apply(this, arguments)
  726. }), s && (l = function(e) {
  727. var n, o = t(e.target).closest(s, r).get(0);
  728. return o && o !== r ? (n = t.extend(T(e), {
  729. currentTarget: o,
  730. liveFired: r
  731. }), (c || u).apply(o, [n].concat(i.call(arguments, 1)))) : void 0
  732. }), v(r, e, u, a, s, l || c)
  733. }))
  734. }, t.fn.off = function(e, i, s) {
  735. var a = this;
  736. return e && !o(e) ? (t.each(e, function(t, e) {
  737. a.off(t, i, e)
  738. }), a) : (o(i) || r(s) || s === !1 || (s = i, i = n), s === !1 && (s = b), a.each(function() {
  739. y(this, e, s, i)
  740. }))
  741. }, t.fn.trigger = function(e, n) {
  742. return e = o(e) || t.isPlainObject(e) ? t.Event(e) : j(e), e._args = n, this.each(function() {
  743. "dispatchEvent" in this ? this.dispatchEvent(e) : t(this).triggerHandler(e, n)
  744. })
  745. }, t.fn.triggerHandler = function(e, n) {
  746. var i, r;
  747. return this.each(function(s, a) {
  748. i = T(o(e) ? t.Event(e) : e), i._args = n, i.target = a, t.each(h(a, e.type || e), function(t, e) {
  749. return r = e.proxy(i), i.isImmediatePropagationStopped() ? !1 : void 0
  750. })
  751. }), r
  752. }, "focusin focusout load resize scroll unload click dblclick mousedown mouseup mousemove mouseover mouseout mouseenter mouseleave change select keydown keypress keyup error".split(" ").forEach(function(e) {
  753. t.fn[e] = function(t) {
  754. return t ? this.bind(e, t) : this.trigger(e)
  755. }
  756. }), ["focus", "blur"].forEach(function(e) {
  757. t.fn[e] = function(t) {
  758. return t ? this.bind(e, t) : this.each(function() {
  759. try {
  760. this[e]()
  761. } catch (t) {}
  762. }), this
  763. }
  764. }), t.Event = function(t, e) {
  765. o(t) || (e = t, t = e.type);
  766. var n = document.createEvent(a[t] || "Events"),
  767. i = !0;
  768. if (e)
  769. for (var r in e) "bubbles" == r ? i = !! e[r] : n[r] = e[r];
  770. return n.initEvent(t, i, !0), j(n)
  771. }
  772. }(Zepto),
  773. function(t) {
  774. function l(e, n, i) {
  775. var r = t.Event(n);
  776. return t(e).trigger(r, i), !r.isDefaultPrevented()
  777. }
  778. function h(t, e, i, r) {
  779. return t.global ? l(e || n, i, r) : void 0
  780. }
  781. function p(e) {
  782. e.global && 0 === t.active++ && h(e, null, "ajaxStart")
  783. }
  784. function d(e) {
  785. e.global && !--t.active && h(e, null, "ajaxStop")
  786. }
  787. function m(t, e) {
  788. var n = e.context;
  789. return e.beforeSend.call(n, t, e) === !1 || h(e, n, "ajaxBeforeSend", [t, e]) === !1 ? !1 : void h(e, n, "ajaxSend", [t, e])
  790. }
  791. function g(t, e, n, i) {
  792. var r = n.context,
  793. o = "success";
  794. n.success.call(r, t, o, e), i && i.resolveWith(r, [t, o, e]), h(n, r, "ajaxSuccess", [e, n, t]), y(o, e, n)
  795. }
  796. function v(t, e, n, i, r) {
  797. var o = i.context;
  798. i.error.call(o, n, e, t), r && r.rejectWith(o, [n, e, t]), h(i, o, "ajaxError", [n, i, t || e]), y(e, n, i)
  799. }
  800. function y(t, e, n) {
  801. var i = n.context;
  802. n.complete.call(i, e, t), h(n, i, "ajaxComplete", [e, n]), d(n)
  803. }
  804. function x() {}
  805. function b(t) {
  806. return t && (t = t.split(";", 2)[0]), t && (t == f ? "html" : t == u ? "json" : s.test(t) ? "script" : a.test(t) && "xml") || "text"
  807. }
  808. function w(t, e) {
  809. return "" == e ? t : (t + "&" + e).replace(/[&?]{1,2}/, "?")
  810. }
  811. function E(e) {
  812. e.processData && e.data && "string" != t.type(e.data) && (e.data = t.param(e.data, e.traditional)), !e.data || e.type && "GET" != e.type.toUpperCase() || (e.url = w(e.url, e.data), e.data = void 0)
  813. }
  814. function j(e, n, i, r) {
  815. return t.isFunction(n) && (r = i, i = n, n = void 0), t.isFunction(i) || (r = i, i = void 0), {
  816. url: e,
  817. data: n,
  818. success: i,
  819. dataType: r
  820. }
  821. }
  822. function S(e, n, i, r) {
  823. var o, s = t.isArray(n),
  824. a = t.isPlainObject(n);
  825. t.each(n, function(n, u) {
  826. o = t.type(u), r && (n = i ? r : r + "[" + (a || "object" == o || "array" == o ? n : "") + "]"), !r && s ? e.add(u.name, u.value) : "array" == o || !i && "object" == o ? S(e, u, i, n) : e.add(n, u)
  827. })
  828. }
  829. var i, r, e = 0,
  830. n = window.document,
  831. o = /<script\b[^<]*(?:(?!<\/script>)<[^<]*)*<\/script>/gi,
  832. s = /^(?:text|application)\/javascript/i,
  833. a = /^(?:text|application)\/xml/i,
  834. u = "application/json",
  835. f = "text/html",
  836. c = /^\s*$/;
  837. t.active = 0, t.ajaxJSONP = function(i, r) {
  838. if (!("type" in i)) return t.ajax(i);
  839. var f, h, o = i.jsonpCallback,
  840. s = (t.isFunction(o) ? o() : o) || "jsonp" + ++e,
  841. a = n.createElement("script"),
  842. u = window[s],
  843. c = function(e) {
  844. t(a).triggerHandler("error", e || "abort")
  845. }, l = {
  846. abort: c
  847. };
  848. return r && r.promise(l), t(a).on("load error", function(e, n) {
  849. clearTimeout(h), t(a).off().remove(), "error" != e.type && f ? g(f[0], l, i, r) : v(null, n || "error", l, i, r), window[s] = u, f && t.isFunction(u) && u(f[0]), u = f = void 0
  850. }), m(l, i) === !1 ? (c("abort"), l) : (window[s] = function() {
  851. f = arguments
  852. }, a.src = i.url.replace(/\?(.+)=\?/, "?$1=" + s), n.head.appendChild(a), i.timeout > 0 && (h = setTimeout(function() {
  853. c("timeout")
  854. }, i.timeout)), l)
  855. }, t.ajaxSettings = {
  856. type: "GET",
  857. beforeSend: x,
  858. success: x,
  859. error: x,
  860. complete: x,
  861. context: null,
  862. global: !0,
  863. xhr: function() {
  864. return new window.XMLHttpRequest
  865. },
  866. accepts: {
  867. script: "text/javascript, application/javascript, application/x-javascript",
  868. json: u,
  869. xml: "application/xml, text/xml",
  870. html: f,
  871. text: "text/plain"
  872. },
  873. crossDomain: !1,
  874. timeout: 0,
  875. processData: !0,
  876. cache: !0
  877. }, t.ajax = function(e) {
  878. var n = t.extend({}, e || {}),
  879. o = t.Deferred && t.Deferred();
  880. for (i in t.ajaxSettings) void 0 === n[i] && (n[i] = t.ajaxSettings[i]);
  881. p(n), n.crossDomain || (n.crossDomain = /^([\w-]+:)?\/\/([^\/]+)/.test(n.url) && RegExp.$2 != window.location.host), n.url || (n.url = window.location.toString()), E(n), n.cache === !1 && (n.url = w(n.url, "_=" + Date.now()));
  882. var s = n.dataType,
  883. a = /\?.+=\?/.test(n.url);
  884. if ("jsonp" == s || a) return a || (n.url = w(n.url, n.jsonp ? n.jsonp + "=?" : n.jsonp === !1 ? "" : "callback=?")), t.ajaxJSONP(n, o);
  885. var j, u = n.accepts[s],
  886. f = {}, l = function(t, e) {
  887. f[t.toLowerCase()] = [t, e]
  888. }, h = /^([\w-]+:)\/\//.test(n.url) ? RegExp.$1 : window.location.protocol,
  889. d = n.xhr(),
  890. y = d.setRequestHeader;
  891. if (o && o.promise(d), n.crossDomain || l("X-Requested-With", "XMLHttpRequest"), l("Accept", u || "*/*"), (u = n.mimeType || u) && (u.indexOf(",") > -1 && (u = u.split(",", 2)[0]), d.overrideMimeType && d.overrideMimeType(u)), (n.contentType || n.contentType !== !1 && n.data && "GET" != n.type.toUpperCase()) && l("Content-Type", n.contentType || "application/x-www-form-urlencoded"), n.headers)
  892. for (r in n.headers) l(r, n.headers[r]);
  893. if (d.setRequestHeader = l, d.onreadystatechange = function() {
  894. if (4 == d.readyState) {
  895. d.onreadystatechange = x, clearTimeout(j);
  896. var e, i = !1;
  897. if (d.status >= 200 && d.status < 300 || 304 == d.status || 0 == d.status && "file:" == h) {
  898. s = s || b(n.mimeType || d.getResponseHeader("content-type")), e = d.responseText;
  899. try {
  900. "script" == s ? (1, eval)(e) : "xml" == s ? e = d.responseXML : "json" == s && (e = c.test(e) ? null : t.parseJSON(e))
  901. } catch (r) {
  902. i = r
  903. }
  904. i ? v(i, "parsererror", d, n, o) : g(e, d, n, o)
  905. } else v(d.statusText || null, d.status ? "error" : "abort", d, n, o)
  906. }
  907. }, m(d, n) === !1) return d.abort(), v(null, "abort", d, n, o), d;
  908. if (n.xhrFields)
  909. for (r in n.xhrFields) d[r] = n.xhrFields[r];
  910. var T = "async" in n ? n.async : !0;
  911. d.open(n.type, n.url, T, n.username, n.password);
  912. for (r in f) y.apply(d, f[r]);
  913. return n.timeout > 0 && (j = setTimeout(function() {
  914. d.onreadystatechange = x, d.abort(), v(null, "timeout", d, n, o)
  915. }, n.timeout)), d.send(n.data ? n.data : null), d
  916. }, t.get = function() {
  917. return t.ajax(j.apply(null, arguments))
  918. }, t.post = function() {
  919. var e = j.apply(null, arguments);
  920. return e.type = "POST", t.ajax(e)
  921. }, t.getJSON = function() {
  922. var e = j.apply(null, arguments);
  923. return e.dataType = "json", t.ajax(e)
  924. }, t.fn.load = function(e, n, i) {
  925. if (!this.length) return this;
  926. var a, r = this,
  927. s = e.split(/\s/),
  928. u = j(e, n, i),
  929. f = u.success;
  930. return s.length > 1 && (u.url = s[0], a = s[1]), u.success = function(e) {
  931. r.html(a ? t("<div>").html(e.replace(o, "")).find(a) : e), f && f.apply(r, arguments)
  932. }, t.ajax(u), this
  933. };
  934. var T = encodeURIComponent;
  935. t.param = function(t, e) {
  936. var n = [];
  937. return n.add = function(t, e) {
  938. this.push(T(t) + "=" + T(e))
  939. }, S(n, t, e), n.join("&").replace(/%20/g, "+")
  940. }
  941. }(Zepto),
  942. function(t) {
  943. t.fn.serializeArray = function() {
  944. var n, e = [];
  945. return t([].slice.call(this.get(0).elements)).each(function() {
  946. n = t(this);
  947. var i = n.attr("type");
  948. "fieldset" != this.nodeName.toLowerCase() && !this.disabled && "submit" != i && "reset" != i && "button" != i && ("radio" != i && "checkbox" != i || this.checked) && e.push({
  949. name: n.attr("name"),
  950. value: n.val()
  951. })
  952. }), e
  953. }, t.fn.serialize = function() {
  954. var t = [];
  955. return this.serializeArray().forEach(function(e) {
  956. t.push(encodeURIComponent(e.name) + "=" + encodeURIComponent(e.value))
  957. }), t.join("&")
  958. }, t.fn.submit = function(e) {
  959. if (e) this.bind("submit", e);
  960. else if (this.length) {
  961. var n = t.Event("submit");
  962. this.eq(0).trigger(n), n.isDefaultPrevented() || this.get(0).submit()
  963. }
  964. return this
  965. }
  966. }(Zepto),
  967. function(t) {
  968. "__proto__" in {} || t.extend(t.zepto, {
  969. Z: function(e, n) {
  970. return e = e || [], t.extend(e, t.fn), e.selector = n || "", e.__Z = !0, e
  971. },
  972. isZ: function(e) {
  973. return "array" === t.type(e) && "__Z" in e
  974. }
  975. });
  976. try {
  977. getComputedStyle(void 0)
  978. } catch (e) {
  979. var n = getComputedStyle;
  980. window.getComputedStyle = function(t) {
  981. try {
  982. return n(t)
  983. } catch (e) {
  984. return null
  985. }
  986. }
  987. }
  988. }(Zepto);