1/*! jQuery Mobile v1.2.0 jquerymobile.com | jquery.org/license */ 2(function (a, b, c) { 3 typeof define == "function" && define.amd ? define(["jquery"], function (d) { 4 return c(d, a, b), d.mobile 5 }) : c(a.jQuery, a, b) 6})(this, document, function (a, b, c, d) { 7 (function (a, b) { 8 var d = { 9 touch: "ontouchend" in c 10 }; 11 a.mobile = a.mobile || {}, a.mobile.support = a.mobile.support || {}, a.extend(a.support, d), a.extend(a.mobile.support, d) 12 })(a), 13 function (a, b, c, d) { 14 function x(a) { 15 while (a && typeof a.originalEvent != "undefined") a = a.originalEvent; 16 return a 17 } 18 19 function y(b, c) { 20 var e = b.type, 21 f, g, i, k, l, m, n, o, p; 22 b = a.Event(b), b.type = c, f = b.originalEvent, g = a.event.props, e.search(/^(mouse|click)/) > -1 && (g = j); 23 if (f) 24 for (n = g.length, k; n;) k = g[--n], b[k] = f[k]; 25 e.search(/mouse(down|up)|click/) > -1 && !b.which && (b.which = 1); 26 if (e.search(/^touch/) !== -1) { 27 i = x(f), e = i.touches, l = i.changedTouches, m = e && e.length ? e[0] : l && l.length ? l[0] : d; 28 if (m) 29 for (o = 0, p = h.length; o < p; o++) k = h[o], b[k] = m[k] 30 } 31 return b 32 } 33 34 function z(b) { 35 var c = {}, d, f; 36 while (b) { 37 d = a.data(b, e); 38 for (f in d) d[f] && (c[f] = c.hasVirtualBinding = !0); 39 b = b.parentNode 40 } 41 return c 42 } 43 44 function A(b, c) { 45 var d; 46 while (b) { 47 d = a.data(b, e); 48 if (d && (!c || d[c])) return b; 49 b = b.parentNode 50 } 51 return null 52 } 53 54 function B() { 55 r = !1 56 } 57 58 function C() { 59 r = !0 60 } 61 62 function D() { 63 v = 0, p.length = 0, q = !1, C() 64 } 65 66 function E() { 67 B() 68 } 69 70 function F() { 71 G(), l = setTimeout(function () { 72 l = 0, D() 73 }, a.vmouse.resetTimerDuration) 74 } 75 76 function G() { 77 l && (clearTimeout(l), l = 0) 78 } 79 80 function H(b, c, d) { 81 var e; 82 if (d && d[b] || !d && A(c.target, b)) e = y(c, b), a(c.target).trigger(e); 83 return e 84 } 85 86 function I(b) { 87 var c = a.data(b.target, f); 88 if (!q && (!v || v !== c)) { 89 var d = H("v" + b.type, b); 90 d && (d.isDefaultPrevented() && b.preventDefault(), d.isPropagationStopped() && b.stopPropagation(), d.isImmediatePropagationStopped() && b.stopImmediatePropagation()) 91 } 92 } 93 94 function J(b) { 95 var c = x(b).touches, 96 d, e; 97 if (c && c.length === 1) { 98 d = b.target, e = z(d); 99 if (e.hasVirtualBinding) { 100 v = u++, a.data(d, f, v), G(), E(), o = !1; 101 var g = x(b).touches[0]; 102 m = g.pageX, n = g.pageY, H("vmouseover", b, e), H("vmousedown", b, e) 103 } 104 } 105 } 106 107 function K(a) { 108 if (r) return; 109 o || H("vmousecancel", a, z(a.target)), o = !0, F() 110 } 111 112 function L(b) { 113 if (r) return; 114 var c = x(b).touches[0], 115 d = o, 116 e = a.vmouse.moveDistanceThreshold, 117 f = z(b.target); 118 o = o || Math.abs(c.pageX - m) > e || Math.abs(c.pageY - n) > e, o && !d && H("vmousecancel", b, f), H("vmousemove", b, f), F() 119 } 120 121 function M(a) { 122 if (r) return; 123 C(); 124 var b = z(a.target), 125 c; 126 H("vmouseup", a, b); 127 if (!o) { 128 var d = H("vclick", a, b); 129 d && d.isDefaultPrevented() && (c = x(a).changedTouches[0], p.push({ 130 touchID: v, 131 x: c.clientX, 132 y: c.clientY 133 }), q = !0) 134 } 135 H("vmouseout", a, b), o = !1, F() 136 } 137 138 function N(b) { 139 var c = a.data(b, e), 140 d; 141 if (c) 142 for (d in c) 143 if (c[d]) return !0; 144 return !1 145 } 146 147 function O() { 148 } 149 150 function P(b) { 151 var c = b.substr(1); 152 return { 153 setup: function (d, f) { 154 N(this) || a.data(this, e, {}); 155 var g = a.data(this, e); 156 g[b] = !0, k[b] = (k[b] || 0) + 1, k[b] === 1 && t.bind(c, I), a(this).bind(c, O), s && (k.touchstart = (k.touchstart || 0) + 1, k.touchstart === 1 && t.bind("touchstart", J).bind("touchend", M).bind("touchmove", L).bind("scroll", K)) 157 }, 158 teardown: function (d, f) { 159 --k[b], k[b] || t.unbind(c, I), s && (--k.touchstart, k.touchstart || t.unbind("touchstart", J).unbind("touchmove", L).unbind("touchend", M).unbind("scroll", K)); 160 var g = a(this), 161 h = a.data(this, e); 162 h && (h[b] = !1), g.unbind(c, O), N(this) || g.removeData(e) 163 } 164 } 165 } 166 167 var e = "virtualMouseBindings", 168 f = "virtualTouchID", 169 g = "vmouseover vmousedown vmousemove vmouseup vclick vmouseout vmousecancel".split(" "), 170 h = "clientX clientY pageX pageY screenX screenY".split(" "), 171 i = a.event.mouseHooks ? a.event.mouseHooks.props : [], 172 j = a.event.props.concat(i), 173 k = {}, l = 0, 174 m = 0, 175 n = 0, 176 o = !1, 177 p = [], 178 q = !1, 179 r = !1, 180 s = "addEventListener" in c, 181 t = a(c), 182 u = 1, 183 v = 0, 184 w; 185 a.vmouse = { 186 moveDistanceThreshold: 10, 187 clickDistanceThreshold: 10, 188 resetTimerDuration: 1500 189 }; 190 for (var Q = 0; Q < g.length; Q++) a.event.special[g[Q]] = P(g[Q]); 191 s && c.addEventListener("click", function (b) { 192 var c = p.length, 193 d = b.target, 194 e, g, h, i, j, k; 195 if (c) { 196 e = b.clientX, g = b.clientY, w = a.vmouse.clickDistanceThreshold, h = d; 197 while (h) { 198 for (i = 0; i < c; i++) { 199 j = p[i], k = 0; 200 if (h === d && Math.abs(j.x - e) < w && Math.abs(j.y - g) < w || a.data(h, f) === j.touchID) { 201 b.preventDefault(), b.stopPropagation(); 202 return 203 } 204 } 205 h = h.parentNode 206 } 207 } 208 }, !0) 209 }(a, b, c), 210 function (a, b, d) { 211 function j(b, c, d) { 212 var e = d.type; 213 d.type = c, a.event.handle.call(b, d), d.type = e 214 } 215 216 a.each("touchstart touchmove touchend tap taphold swipe swipeleft swiperight scrollstart scrollstop".split(" "), function (b, c) { 217 a.fn[c] = function (a) { 218 return a ? this.bind(c, a) : this.trigger(c) 219 }, a.attrFn && (a.attrFn[c] = !0) 220 }); 221 var e = a.mobile.support.touch, 222 f = "touchmove scroll", 223 g = e ? "touchstart" : "mousedown", 224 h = e ? "touchend" : "mouseup", 225 i = e ? "touchmove" : "mousemove"; 226 a.event.special.scrollstart = { 227 enabled: !0, 228 setup: function () { 229 function g(a, c) { 230 d = c, j(b, d ? "scrollstart" : "scrollstop", a) 231 } 232 233 var b = this, 234 c = a(b), 235 d, e; 236 c.bind(f, function (b) { 237 if (!a.event.special.scrollstart.enabled) return; 238 d || g(b, !0), clearTimeout(e), e = setTimeout(function () { 239 g(b, !1) 240 }, 50) 241 }) 242 } 243 }, a.event.special.tap = { 244 tapholdThreshold: 750, 245 setup: function () { 246 var b = this, 247 d = a(b); 248 d.bind("vmousedown", function (e) { 249 function i() { 250 clearTimeout(h) 251 } 252 253 function k() { 254 i(), d.unbind("vclick", l).unbind("vmouseup", i), a(c).unbind("vmousecancel", k) 255 } 256 257 function l(a) { 258 k(), f === a.target && j(b, "tap", a) 259 } 260 261 if (e.which && e.which !== 1) return !1; 262 var f = e.target, 263 g = e.originalEvent, 264 h; 265 d.bind("vmouseup", i).bind("vclick", l), a(c).bind("vmousecancel", k), h = setTimeout(function () { 266 j(b, "taphold", a.Event("taphold", { 267 target: f 268 })) 269 }, a.event.special.tap.tapholdThreshold) 270 }) 271 } 272 }, a.event.special.swipe = { 273 scrollSupressionThreshold: 30, 274 durationThreshold: 1e3, 275 horizontalDistanceThreshold: 30, 276 verticalDistanceThreshold: 75, 277 setup: function () { 278 var b = this, 279 c = a(b); 280 c.bind(g, function (b) { 281 function j(b) { 282 if (!f) return; 283 var c = b.originalEvent.touches ? b.originalEvent.touches[0] : b; 284 g = { 285 time: (new Date).getTime(), 286 coords: [c.pageX, c.pageY] 287 }, Math.abs(f.coords[0] - g.coords[0]) > a.event.special.swipe.scrollSupressionThreshold && b.preventDefault() 288 } 289 290 var e = b.originalEvent.touches ? b.originalEvent.touches[0] : b, 291 f = { 292 time: (new Date).getTime(), 293 coords: [e.pageX, e.pageY], 294 origin: a(b.target) 295 }, g; 296 c.bind(i, j).one(h, function (b) { 297 c.unbind(i, j), f && g && g.time - f.time < a.event.special.swipe.durationThreshold && Math.abs(f.coords[0] - g.coords[0]) > a.event.special.swipe.horizontalDistanceThreshold && Math.abs(f.coords[1] - g.coords[1]) < a.event.special.swipe.verticalDistanceThreshold && f.origin.trigger("swipe").trigger(f.coords[0] > g.coords[0] ? "swipeleft" : "swiperight"), f = g = d 298 }) 299 }) 300 } 301 }, a.each({ 302 scrollstop: "scrollstart", 303 taphold: "tap", 304 swipeleft: "swipe", 305 swiperight: "swipe" 306 }, function (b, c) { 307 a.event.special[b] = { 308 setup: function () { 309 a(this).bind(c, a.noop) 310 } 311 } 312 }) 313 }(a, this) 314})