scripts

彻底清理百度搜索(www.baidu.com)结果首尾的推广广告、二次顽固广告与右侧广告,并防止反复

  1. // ==UserScript==
  2. // @name:en scii
  3. // @name:zh-TW 百度廣告(首尾推廣及右側廣告)清理
  4. // @version 0.89
  5. // @description 彻底清理百度搜索(www.baidu.com)结果首尾的推广广告、二次顽固广告与右侧广告,并防止反复
  6. // @description:en Just Kill Baidu AD
  7. // @description:zh-TW 徹底清理百度搜索(www.baidu.com)結果首尾的推廣廣告、二次頑固廣告與右側廣告,並防止反復
  8. // @author howoke@utooemail.com
  9. // @include http*://www.warzone.com/*
  10. // @grant none
  11. // @run-at document-start
  12. // @license MIT License
  13. // @compatible chrome 测试通过
  14. // @compatible firefox 测试通过
  15. // @compatible opera 未测试
  16. // @compatible safari 未测试
  17. // @name scripts
  18. // @namespace https://gf.qytechs.cn/users/240876
  19. // ==/UserScript==
  20.  
  21. var io = "undefined" === typeof module ? {} : module.exports;
  22. (function() {
  23. (function(d, a) {
  24. d.version = "0.9.17";
  25. d.protocol = 1;
  26. d.transports = [];
  27. d.j = [];
  28. d.sockets = {};
  29. d.connect = function(b, c) {
  30. var g = d.util.parseUri(b),
  31. f, e;
  32. a && a.location && (g.protocol = g.protocol || a.location.protocol.slice(0, -1), g.host = g.host || (a.document ? a.document.domain : a.location.hostname), g.port = g.port || a.location.port);
  33. f = d.util.uniqueUri(g);
  34. var l = {
  35. host: g.host,
  36. secure: "https" == g.protocol,
  37. port: g.port || ("https" == g.protocol ? 443 : 80),
  38. query: g.query || ""
  39. };
  40. d.util.merge(l, c);
  41. if (l["force new connection"] || !d.sockets[f]) e =
  42. new d.Socket(l);
  43. !l["force new connection"] && e && (d.sockets[f] = e);
  44. e = e || d.sockets[f];
  45. console.log("connect returns", e.of(1 < g.path.length ? g.path : ""));
  46. return e.of(1 < g.path.length ? g.path : "")
  47. }
  48. })("object" === typeof module ? module.exports : this.io = {}, this);
  49. (function(d, a) {
  50. var b = d.util = {},
  51. c = /^(?:(?![^:@]+:[^:@\/]*@)([^:\/?#.]+):)?(?:\/\/)?((?:(([^:@]*)(?::([^:@]*))?)?@)?([^:\/?#]*)(?::(\d*))?)(((\/(?:[^?#](?![^?#\/]*\.[^?#\/.]+(?:[?#]|$)))*\/?)?([^?#\/]*))(?:\?([^#]*))?(?:#(.*))?)/,
  52. g = "source protocol authority userInfo user password host port relative path directory file query anchor".split(" ");
  53. b.parseUri = function(e) {
  54. e = c.exec(e || "");
  55. for (var a = {}, b = 14; b--;) a[g[b]] = e[b] || "";
  56. console.log("parseUri returns", a);
  57. return a
  58. };
  59. b.uniqueUri = function(e) {
  60. var c = e.protocol,
  61. b = e.host;
  62. e = e.port;
  63. "document" in a ? (b = b || document.domain, e = e || ("https" == c && "https:" !== document.location.protocol ? 443 : document.location.port)) : (b = b || "localhost", e || "https" != c || (e = 443));
  64. console.log("unique Uri returns", (c || "http") + "://" + b + ":" + (e || 80));
  65. return (c || "http") + "://" + b + ":" + (e || 80)
  66. };
  67. b.query = function(e, a) {
  68. var c = b.chunkQuery(e || ""),
  69. f = [];
  70. b.merge(c, b.chunkQuery(a || ""));
  71. for (var g in c) c.hasOwnProperty(g) && f.push(g + "=" + c[g]);
  72. console.log("b.query returns", f.length ?
  73. "?" + f.join("&") : "");
  74. return f.length ?
  75. "?" + f.join("&") : ""
  76. };
  77. b.chunkQuery = function(e) {
  78. var a = {};
  79. e = e.split("&");
  80. for (var c = 0, b = e.length, f; c < b; ++c) f = e[c].split("="), f[0] && (a[f[0]] = f[1]);
  81. console.log("chunkQuery returns", a);
  82. return a
  83. };
  84. var f = !1;
  85. b.load = function(e) {
  86. if ("document" in a && "complete" === document.readyState || f) return e();
  87. b.on(a, "load", e, !1)
  88. };
  89. b.on = function(e, a, c, b) {
  90. console.log("b.on args", e,a,c,b);
  91. e.attachEvent ? e.attachEvent("on" + a, c) : e.addEventListener && e.addEventListener(a, c, b)
  92. };
  93. b.request = function(e) {
  94. console.log("b.request arg", e);
  95. if (e && "undefined" != typeof XDomainRequest && !b.ua.hasCORS) return new XDomainRequest;
  96. if ("undefined" != typeof XMLHttpRequest &&
  97. (!e || b.ua.hasCORS)) return new XMLHttpRequest;
  98. if (!e) try {
  99. return new(window[["Active"].concat("Object").join("X")])("Microsoft.XMLHTTP")
  100. } catch (a) {}
  101. return null
  102. };
  103. "undefined" != typeof window && b.load(function() {
  104. f = !0
  105. });
  106. b.defer = function(e) {
  107. if (!b.ua.webkit || "undefined" != typeof importScripts) return e();
  108. b.load(function() {
  109. setTimeout(e, 100)
  110. })
  111. };
  112. b.merge = function(e, a, c, f) {
  113. console.log("b.merge args", e,a ,c , f);
  114. f = f || [];
  115. c = "undefined" == typeof c ? 2 : c;
  116. for (var g in a) a.hasOwnProperty(g) && 0 > b.indexOf(f, g) && ("object" === typeof e[g] && c ? b.merge(e[g], a[g], c - 1, f) : (e[g] =
  117. a[g], f.push(a[g])));
  118. return e
  119. };
  120. b.mixin = function(a, c) {
  121. b.merge(a.prototype, c.prototype)
  122. };
  123. b.inherit = function(a, c) {
  124. function b() {}
  125. b.prototype = c.prototype;
  126. a.prototype = new b
  127. };
  128. b.isArray = Array.isArray || function(a) {
  129. return "[object Array]" === Object.prototype.toString.call(a)
  130. };
  131. b.intersect = function(a, c) {
  132. for (var f = [], g = a.length > c.length ? a : c, d = a.length > c.length ? c : a, n = 0, v = d.length; n < v; n++) ~b.indexOf(g, d[n]) && f.push(d[n]);
  133. return f
  134. };
  135. b.indexOf = function(a, c, b) {
  136. var f = a.length;
  137. for (b = 0 > b ? 0 > b + f ? 0 : b + f : b || 0; b < f && a[b] !== c; b++);
  138. return f <= b ? -1 : b
  139. };
  140. b.toArray = function(a) {
  141. for (var c = [], b = 0, f = a.length; b < f; b++) c.push(a[b]);
  142. return c
  143. };
  144. b.ua = {};
  145. b.ua.hasCORS = "undefined" != typeof XMLHttpRequest && function() {
  146. try {
  147. var a = new XMLHttpRequest
  148. } catch (c) {
  149. return !1
  150. }
  151. return void 0 != a.withCredentials
  152. }();
  153. b.ua.webkit = "undefined" != typeof navigator && /webkit/i.test(navigator.userAgent);
  154. b.ua.iDevice = "undefined" != typeof navigator && /iPad|iPhone|iPod/i.test(navigator.userAgent)
  155. })("undefined" != typeof io ? io : module.exports, this);
  156. (function(d, a) {
  157. function b() {}
  158. d.EventEmitter =
  159. b;
  160. b.prototype.on = function(c, b) {
  161. console.log("on args", c, b);
  162. console.log("this on", this.$events);
  163. this.$events || (this.$events = {});
  164. this.$events[c] ? a.util.isArray(this.$events[c]) ? this.$events[c].push(b) : this.$events[c] = [this.$events[c], b] : this.$events[c] = b;
  165. return this
  166. };
  167. b.prototype.addListener = b.prototype.on;
  168. b.prototype.once = function(a, b) {
  169. function f() {
  170. e.removeListener(a, f);
  171. b.apply(this, arguments)
  172. }
  173. var e = this;
  174. f.listener = b;
  175. this.on(a, f);
  176. return this
  177. };
  178. b.prototype.removeListener = function(c, b) {
  179. if (this.$events && this.$events[c]) {
  180. var f = this.$events[c];
  181. if (a.util.isArray(f)) {
  182. for (var e = -1, l = 0, m = f.length; l < m; l++)
  183. if (f[l] === b || f[l].listener && f[l].listener === b) {
  184. e = l;
  185. break
  186. } if (0 > e) return this;
  187. f.splice(e, 1);
  188. f.length || delete this.$events[c]
  189. } else(f === b || f.listener && f.listener === b) && delete this.$events[c]
  190. }
  191. return this
  192. };
  193. b.prototype.removeAllListeners = function(a) {
  194. if (void 0 === a) return this.$events = {}, this;
  195. this.$events && this.$events[a] && (this.$events[a] = null);
  196. return this
  197. };
  198. b.prototype.listeners = function(b) {
  199. this.$events || (this.$events = {});
  200. this.$events[b] || (this.$events[b] = []);
  201. a.util.isArray(this.$events[b]) ||
  202. (this.$events[b] = [this.$events[b]]);
  203. return this.$events[b]
  204. };
  205. b.prototype.emit = function(b) {
  206. console.log("emit arg", b);
  207. console.log("this events", this.$events);
  208. if (!this.$events) return !1;
  209. var g = this.$events[b];
  210. if (!g) return !1;
  211. var f = Array.prototype.slice.call(arguments, 1);
  212. if ("function" == typeof g) g.apply(this, f);
  213. else if (a.util.isArray(g))
  214. for (var g = g.slice(), e = 0, l = g.length; e < l; e++) g[e].apply(this, f);
  215. else return !1;
  216. return !0
  217. }
  218. })("undefined" != typeof io ? io : module.exports, "undefined" != typeof io ? io : module.parent.exports);
  219. (function(d, a) {
  220. function b(a) {
  221. return 10 > a ? "0" + a : a
  222. }
  223.  
  224. function c(a) {
  225. l.lastIndex =
  226. 0;
  227. return l.test(a) ? '"' + a.replace(l, function(a) {
  228. var b = p[a];
  229. return "string" === typeof b ? b : "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
  230. }) + '"' : '"' + a + '"'
  231. }
  232.  
  233. function g(a, e) {
  234. console.log("g args", a, e);
  235. var f, l, d, p, u = m,
  236. h, q = e[a];
  237. q instanceof Date && (q = isFinite(a.valueOf()) ? a.getUTCFullYear() + "-" + b(a.getUTCMonth() + 1) + "-" + b(a.getUTCDate()) + "T" + b(a.getUTCHours()) + ":" + b(a.getUTCMinutes()) + ":" + b(a.getUTCSeconds()) + "Z" : null);
  238. "function" === typeof n && (q = n.call(e, a, q));
  239. switch (typeof q) {
  240. case "string":
  241. return c(q);
  242. case "number":
  243. return isFinite(q) ?
  244. String(q) : "null";
  245. case "boolean":
  246. case "null":
  247. return String(q);
  248. case "object":
  249. if (!q) return "null";
  250. m += r;
  251. h = [];
  252. if ("[object Array]" === Object.prototype.toString.apply(q)) {
  253. p = q.length;
  254. for (f = 0; f < p; f += 1) h[f] = g(f, q) || "null";
  255. d = 0 === h.length ? "[]" : m ? "[\n" + m + h.join(",\n" + m) + "\n" + u + "]" : "[" + h.join(",") + "]";
  256. m = u;
  257. return d
  258. }
  259. if (n && "object" === typeof n)
  260. for (p = n.length, f = 0; f < p; f += 1) "string" === typeof n[f] && (l = n[f], (d = g(l, q)) && h.push(c(l) + (m ? ": " : ":") + d));
  261. else
  262. for (l in q) Object.prototype.hasOwnProperty.call(q, l) && (d = g(l, q)) && h.push(c(l) +
  263. (m ? ": " : ":") + d);
  264. d = 0 === h.length ? "{}" : m ? "{\n" + m + h.join(",\n" + m) + "\n" + u + "}" : "{" + h.join(",") + "}";
  265. m = u;
  266. return d
  267. }
  268. }
  269. if (a && a.parse) return d.JSON = {
  270. parse: a.parse,
  271. stringify: a.stringify
  272. };
  273. var f = d.JSON = {},
  274. e = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  275. l = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  276. m, r, p = {
  277. "\b": "\\b",
  278. "\t": "\\t",
  279. "\n": "\\n",
  280. "\f": "\\f",
  281. "\r": "\\r",
  282. '"': '\\"',
  283. "\\": "\\\\"
  284. },
  285. n;
  286. f.stringify = function(a, b, c) {
  287. var f;
  288. r = m = "";
  289. if ("number" === typeof c)
  290. for (f = 0; f < c; f += 1) r += " ";
  291. else "string" === typeof c && (r = c);
  292. if ((n = b) && "function" !== typeof b && ("object" !== typeof b || "number" !== typeof b.length)) throw Error("JSON.stringify");
  293. return g("", {
  294. "": a
  295. })
  296. };
  297. f.parse = function(a, b) {
  298. function c(a, f) {
  299. var e, l, g = a[f];
  300. if (g && "object" === typeof g)
  301. for (e in g) Object.prototype.hasOwnProperty.call(g, e) && (l = c(g, e), void 0 !== l ? g[e] = l : delete g[e]);
  302. return b.call(a, f, g)
  303. }
  304. var f;
  305. a = String(a);
  306. e.lastIndex = 0;
  307. e.test(a) && (a = a.replace(e,
  308. function(a) {
  309. return "\\u" + ("0000" + a.charCodeAt(0).toString(16)).slice(-4)
  310. }));
  311. if (/^[\],:{}\s]*$/.test(a.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g, ""))) return f = eval("(" + a + ")"), "function" === typeof b ? c({
  312. "": f
  313. }, "") : f;
  314. throw new SyntaxError("JSON.parse");
  315. }
  316. })("undefined" != typeof io ? io : module.exports, "undefined" !== typeof JSON ? JSON : void 0);
  317. (function(d, a) {
  318. var b = d.parser = {},
  319. c = b.packets = "disconnect connect heartbeat message json event ack error noop".split(" "),
  320. g = b.reasons = ["transport not supported", "client not handshaken", "unauthorized"],
  321. f = b.advice = ["reconnect"],
  322. e = a.JSON,
  323. l = a.util.indexOf;
  324. b.encodePacket = function(a) {
  325. var b = l(c, a.type),
  326. d = a.id || "",
  327. m = a.endpoint || "",
  328. w = a.ack,
  329. t = null;
  330. switch (a.type) {
  331. case "error":
  332. var x = a.reason ? l(g, a.reason) : "";
  333. a = a.advice ? l(f, a.advice) : "";
  334. if ("" !== x || "" !== a) t = x + ("" !== a ? "+" + a : "");
  335. break;
  336. case "message":
  337. "" !== a.data && (t = a.data);
  338. break;
  339. case "event":
  340. t = {
  341. name: a.name
  342. };
  343. a.args && a.args.length && (t.args = a.args);
  344. t = e.stringify(t);
  345. break;
  346. case "json":
  347. t =
  348. e.stringify(a.data);
  349. break;
  350. case "connect":
  351. a.qs && (t = a.qs);
  352. break;
  353. case "ack":
  354. t = a.ackId + (a.args && a.args.length ? "+" + e.stringify(a.args) : "")
  355. }
  356. b = [b, d + ("data" == w ? "+" : ""), m];
  357. null !== t && void 0 !== t && b.push(t);
  358. console.log(b.join(':'));
  359. return b.join(":")
  360. };
  361. b.encodePayload = function(a) {
  362. console.log("encodePayload args");
  363. var b = "";
  364. if (1 == a.length) return a[0];
  365. for (var c = 0, f = a.length; c < f; c++) b += "\ufffd" + a[c].length + "\ufffd" + a[c];
  366. return b
  367. };
  368. var m = /([^:]+):([0-9]+)?(\+)?:([^:]+)?:?([\s\S]*)?/;
  369. b.decodePacket = function(a) {
  370. var b = a.match(m);
  371. if (!b) return {};
  372. var l = b[2] || "";
  373. a = b[5] || "";
  374. var d = {
  375. type: c[b[1]],
  376. endpoint: b[4] || ""
  377. };
  378. l && (d.id = l, d.ack = b[3] ? "data" : !0);
  379. switch (d.type) {
  380. case "error":
  381. b = a.split("+");
  382. d.reason = g[b[0]] || "";
  383. d.advice = f[b[1]] || "";
  384. break;
  385. case "message":
  386. d.data = a || "";
  387. break;
  388. case "event":
  389. try {
  390. var w = e.parse(a);
  391. d.name = w.name;
  392. d.args = w.args
  393. } catch (t) {}
  394. d.args = d.args || [];
  395. break;
  396. case "json":
  397. try {
  398. d.data = e.parse(a)
  399. } catch (t) {}
  400. break;
  401. case "connect":
  402. d.qs = a || "";
  403. break;
  404. case "ack":
  405. if (b = a.match(/^([0-9]+)(\+)?(.*)/))
  406. if (d.ackId = b[1], d.args = [], b[3]) try {
  407. d.args = b[3] ? e.parse(b[3]) : []
  408. } catch (t) {}
  409. }
  410. return d
  411. };
  412. b.decodePayload =
  413. function(a) {
  414. if ("\ufffd" == a.charAt(0)) {
  415. for (var c = [], f = 1, e = ""; f < a.length; f++) "\ufffd" == a.charAt(f) ? (c.push(b.decodePacket(a.substr(f + 1).substr(0, e))), f += Number(e) + 1, e = "") : e += a.charAt(f);
  416. return c
  417. }
  418. return [b.decodePacket(a)]
  419. }
  420. })("undefined" != typeof io ? io : module.exports, "undefined" != typeof io ? io : module.parent.exports);
  421. (function(d, a) {
  422. function b(a, b) {
  423. this.socket = a;
  424. this.sessid = b
  425. }
  426. d.Transport = b;
  427. a.util.mixin(b, a.EventEmitter);
  428. b.prototype.heartbeats = function() {
  429. return !0
  430. };
  431. b.prototype.onData = function(b) {
  432. this.clearCloseTimeout();
  433. (this.socket.connected || this.socket.connecting || this.socket.reconnecting) && this.setCloseTimeout();
  434. if ("" !== b && (b = a.parser.decodePayload(b)) && b.length)
  435. for (var g = 0, f = b.length; g < f; g++) this.onPacket(b[g]);
  436. return this
  437. };
  438. b.prototype.onPacket = function(a) {
  439. this.socket.setHeartbeatTimeout();
  440. if ("heartbeat" == a.type) return this.onHeartbeat();
  441. if ("connect" == a.type && "" == a.endpoint) this.onConnect();
  442. "error" == a.type && "reconnect" == a.advice && (this.isOpen = !1);
  443. this.socket.onPacket(a);
  444. return this
  445. };
  446. b.prototype.setCloseTimeout =
  447. function() {
  448. if (!this.closeTimeout) {
  449. var a = this;
  450. this.closeTimeout = setTimeout(function() {
  451. a.onDisconnect()
  452. }, this.socket.closeTimeout)
  453. }
  454. };
  455. b.prototype.onDisconnect = function() {
  456. this.isOpen && this.close();
  457. this.clearTimeouts();
  458. this.socket.onDisconnect();
  459. return this
  460. };
  461. b.prototype.onConnect = function() {
  462. this.socket.onConnect();
  463. return this
  464. };
  465. b.prototype.clearCloseTimeout = function() {
  466. this.closeTimeout && (clearTimeout(this.closeTimeout), this.closeTimeout = null)
  467. };
  468. b.prototype.clearTimeouts = function() {
  469. this.clearCloseTimeout();
  470. this.reopenTimeout && clearTimeout(this.reopenTimeout)
  471. };
  472. b.prototype.packet = function(b) {
  473. this.send(a.parser.encodePacket(b))
  474. };
  475. b.prototype.onHeartbeat = function(a) {
  476. this.packet({
  477. type: "heartbeat"
  478. })
  479. };
  480. b.prototype.onOpen = function() {
  481. this.isOpen = !0;
  482. this.clearCloseTimeout();
  483. this.socket.onOpen()
  484. };
  485. b.prototype.onClose = function() {
  486. this.isOpen = !1;
  487. this.socket.onClose();
  488. this.onDisconnect()
  489. };
  490. b.prototype.prepareUrl = function() {
  491. var b = this.socket.options;
  492. return this.scheme() + "://" + b.host + ":" + b.port + "/" + b.resource + "/" + a.protocol +
  493. "/" + this.name + "/" + this.sessid
  494. };
  495. b.prototype.ready = function(a, b) {
  496. b.call(this)
  497. }
  498. })("undefined" != typeof io ? io : module.exports, "undefined" != typeof io ? io : module.parent.exports);
  499. (function(d, a, b) {
  500. function c(f) {
  501. this.options = {
  502. port: 80,
  503. secure: !1,
  504. document: "document" in b ? document : !1,
  505. resource: "socket.io",
  506. transports: a.transports,
  507. "connect timeout": 1E4,
  508. "try multiple transports": !0,
  509. reconnect: !0,
  510. "reconnection delay": 500,
  511. "reconnection limit": Infinity,
  512. "reopen delay": 3E3,
  513. "max reconnection attempts": 10,
  514. "sync disconnect on unload": !1,
  515. "auto connect": !0,
  516. "flash policy port": 10843,
  517. manualFlush: !1
  518. };
  519. a.util.merge(this.options, f);
  520. this.reconnecting = this.connecting = this.open = this.connected = !1;
  521. this.namespaces = {};
  522. this.buffer = [];
  523. this.doBuffer = !1;
  524. if (this.options["sync disconnect on unload"] && (!this.isXDomain() || a.util.ua.hasCORS)) {
  525. var e = this;
  526. a.util.on(b, "beforeunload", function() {
  527. e.disconnectSync()
  528. }, !1)
  529. }
  530. this.options["auto connect"] && this.connect()
  531. }
  532.  
  533. function g() {}
  534. d.Socket = c;
  535. a.util.mixin(c, a.EventEmitter);
  536. c.prototype.of = function(b) {
  537. this.namespaces[b] ||
  538. (this.namespaces[b] = new a.SocketNamespace(this, b), "" !== b && this.namespaces[b].packet({
  539. type: "connect"
  540. }));
  541. return this.namespaces[b]
  542. };
  543. c.prototype.publish = function() {
  544. this.emit.apply(this, arguments);
  545. var a, b;
  546. for (b in this.namespaces) this.namespaces.hasOwnProperty(b) && (a = this.of(b), a.$emit.apply(a, arguments))
  547. };
  548. c.prototype.handshake = function(b) {
  549. function e(a) {
  550. a instanceof Error ? (c.connecting = !1, c.onError(a.message)) : b.apply(null, a.split(":"))
  551. }
  552. var c = this,
  553. d = this.options,
  554. d = ["http" + (d.secure ? "s" : "") + ":/", d.host +
  555. ":" + d.port, d.resource, a.protocol, a.util.query(this.options.query, "t=" + +new Date)
  556. ].join("/");
  557. if (this.isXDomain() && !a.util.ua.hasCORS) {
  558. var r = document.getElementsByTagName("script")[0],
  559. p = document.createElement("script");
  560. p.src = d + "&jsonp=" + a.j.length;
  561. r.parentNode.insertBefore(p, r);
  562. a.j.push(function(a) {
  563. e(a);
  564. p.parentNode.removeChild(p)
  565. })
  566. } else {
  567. var n = a.util.request();
  568. n.open("GET", d, !0);
  569. this.isXDomain() && (n.withCredentials = !0);
  570. n.onreadystatechange = function() {
  571. if (4 == n.readyState)
  572. if (n.onreadystatechange = g, 200 ==
  573. n.status) e(n.responseText);
  574. else if (403 == n.status) c.onError(n.responseText);
  575. else c.connecting = !1, !c.reconnecting && c.onError(n.responseText)
  576. };
  577. n.send(null)
  578. }
  579. };
  580. c.prototype.getTransport = function(b) {
  581. b = b || this.transports;
  582. for (var e = 0, c; c = b[e]; e++)
  583. if (a.Transport[c] && a.Transport[c].check(this) && (!this.isXDomain() || a.Transport[c].xdomainCheck(this))) return new a.Transport[c](this, this.sessionid);
  584. return null
  585. };
  586. c.prototype.connect = function(b) {
  587. if (this.connecting) return this;
  588. var c = this;
  589. c.connecting = !0;
  590. this.handshake(function(l,
  591. g, d, p) {
  592. function n(a) {
  593. c.transport && c.transport.clearTimeouts();
  594. c.transport = c.getTransport(a);
  595. if (!c.transport) return c.publish("connect_failed");
  596. c.transport.ready(c, function() {
  597. c.connecting = !0;
  598. c.publish("connecting", c.transport.name);
  599. c.transport.open();
  600. c.options["connect timeout"] && (c.connectTimeoutTimer = setTimeout(function() {
  601. if (!c.connected && (c.connecting = !1, c.options["try multiple transports"])) {
  602. for (var a = c.transports; 0 < a.length && a.splice(0, 1)[0] != c.transport.name;);
  603. a.length ? n(a) : c.publish("connect_failed")
  604. }
  605. },
  606. c.options["connect timeout"]))
  607. })
  608. }
  609. c.sessionid = l;
  610. c.closeTimeout = 1E3 * d;
  611. c.heartbeatTimeout = 1E3 * g;
  612. c.transports || (c.transports = c.origTransports = p ? a.util.intersect(p.split(","), c.options.transports) : c.options.transports);
  613. c.setHeartbeatTimeout();
  614. n(c.transports);
  615. c.once("connect", function() {
  616. clearTimeout(c.connectTimeoutTimer);
  617. b && "function" == typeof b && b()
  618. })
  619. });
  620. return this
  621. };
  622. c.prototype.setHeartbeatTimeout = function() {
  623. clearTimeout(this.heartbeatTimeoutTimer);
  624. if (!this.transport || this.transport.heartbeats()) {
  625. var a =
  626. this;
  627. this.heartbeatTimeoutTimer = setTimeout(function() {
  628. a.transport.onClose()
  629. }, this.heartbeatTimeout)
  630. }
  631. };
  632. c.prototype.packet = function(a) {
  633. this.connected && !this.doBuffer ? this.transport.packet(a) : this.buffer.push(a);
  634. return this
  635. };
  636. c.prototype.setBuffer = function(a) {
  637. this.doBuffer = a;
  638. !a && this.connected && this.buffer.length && (this.options.manualFlush || this.flushBuffer())
  639. };
  640. c.prototype.flushBuffer = function() {
  641. this.transport.payload(this.buffer);
  642. this.buffer = []
  643. };
  644. c.prototype.disconnect = function() {
  645. if (this.connected || this.connecting) this.open &&
  646. this.of("").packet({
  647. type: "disconnect"
  648. }), this.onDisconnect("booted");
  649. return this
  650. };
  651. c.prototype.disconnectSync = function() {
  652. var b = a.util.request(),
  653. c = ["http" + (this.options.secure ? "s" : "") + ":/", this.options.host + ":" + this.options.port, this.options.resource, a.protocol, "", this.sessionid].join("/") + "/?disconnect=1";
  654. b.open("GET", c, !1);
  655. b.send(null);
  656. this.onDisconnect("booted")
  657. };
  658. c.prototype.isXDomain = function() {
  659. var a = b.location.port || ("https:" == b.location.protocol ? 443 : 80);
  660. return this.options.host !== b.location.hostname ||
  661. this.options.port != a
  662. };
  663. c.prototype.onConnect = function() {
  664. this.connected || (this.connected = !0, this.connecting = !1, this.doBuffer || this.setBuffer(!1), this.emit("connect"))
  665. };
  666. c.prototype.onOpen = function() {
  667. this.open = !0
  668. };
  669. c.prototype.onClose = function() {
  670. this.open = !1;
  671. clearTimeout(this.heartbeatTimeoutTimer)
  672. };
  673. c.prototype.onPacket = function(a) {
  674. this.of(a.endpoint).onPacket(a)
  675. };
  676. c.prototype.onError = function(a) {
  677. a && a.advice && "reconnect" === a.advice && (this.connected || this.connecting) && (this.disconnect(), this.options.reconnect &&
  678. this.reconnect());
  679. this.publish("error", a && a.reason ? a.reason : a)
  680. };
  681. c.prototype.onDisconnect = function(a) {
  682. var b = this.connected,
  683. c = this.connecting;
  684. this.open = this.connecting = this.connected = !1;
  685. if (b || c) this.transport.close(), this.transport.clearTimeouts(), b && (this.publish("disconnect", a), "booted" != a && this.options.reconnect && !this.reconnecting && this.reconnect())
  686. };
  687. c.prototype.reconnect = function() {
  688. function a() {
  689. if (c.connected) {
  690. for (var f in c.namespaces) c.namespaces.hasOwnProperty(f) && "" !== f && c.namespaces[f].packet({
  691. type: "connect"
  692. });
  693. c.publish("reconnect", c.transport.name, c.reconnectionAttempts)
  694. }
  695. clearTimeout(c.reconnectionTimer);
  696. c.removeListener("connect_failed", b);
  697. c.removeListener("connect", b);
  698. c.reconnecting = !1;
  699. delete c.reconnectionAttempts;
  700. delete c.reconnectionDelay;
  701. delete c.reconnectionTimer;
  702. delete c.redoTransports;
  703. c.options["try multiple transports"] = d
  704. }
  705.  
  706. function b() {
  707. if (c.reconnecting) {
  708. if (c.connected) return a();
  709. if (c.connecting && c.reconnecting) return c.reconnectionTimer = setTimeout(b, 1E3);
  710. c.reconnectionAttempts++ >= g ? c.redoTransports ?
  711. (c.publish("reconnect_failed"), a()) : (c.on("connect_failed", b), c.options["try multiple transports"] = !0, c.transports = c.origTransports, c.transport = c.getTransport(), c.redoTransports = !0, c.connect()) : (c.reconnectionDelay < p && (c.reconnectionDelay *= 2), c.connect(), c.publish("reconnecting", c.reconnectionDelay, c.reconnectionAttempts), c.reconnectionTimer = setTimeout(b, c.reconnectionDelay))
  712. }
  713. }
  714. this.reconnecting = !0;
  715. this.reconnectionAttempts = 0;
  716. this.reconnectionDelay = this.options["reconnection delay"];
  717. var c = this,
  718. g = this.options["max reconnection attempts"],
  719. d = this.options["try multiple transports"],
  720. p = this.options["reconnection limit"];
  721. this.options["try multiple transports"] = !1;
  722. this.reconnectionTimer = setTimeout(b, this.reconnectionDelay);
  723. this.on("connect", b)
  724. }
  725. })("undefined" != typeof io ? io : module.exports, "undefined" != typeof io ? io : module.parent.exports, this);
  726. (function(d, a) {
  727. function b(a, b) {
  728. this.socket = a;
  729. this.name = b || "";
  730. this.flags = {};
  731. this.json = new c(this, "json");
  732. this.ackPackets = 0;
  733. this.acks = {}
  734. }
  735.  
  736. function c(a, b) {
  737. this.namespace = a;
  738. this.name = b
  739. }
  740. d.SocketNamespace = b;
  741. a.util.mixin(b, a.EventEmitter);
  742. b.prototype.$emit = a.EventEmitter.prototype.emit;
  743. b.prototype.of = function() {
  744. return this.socket.of.apply(this.socket, arguments)
  745. };
  746. b.prototype.packet = function(a) {
  747. a.endpoint = this.name;
  748. this.socket.packet(a);
  749. this.flags = {};
  750. return this
  751. };
  752. b.prototype.send = function(a, b) {
  753. console.log("send args", a, b);
  754. var c = {
  755. type: this.flags.json ? "json" : "message",
  756. data: a
  757. };
  758. "function" == typeof b && (c.id = ++this.ackPackets, c.ack = !0, this.acks[c.id] = b);
  759. return this.packet(c)
  760. };
  761. b.prototype.emit = function(a) {
  762. var b = Array.prototype.slice.call(arguments,
  763. 1),
  764. c = b[b.length - 1],
  765. d = {
  766. type: "event",
  767. name: a
  768. };
  769. "function" == typeof c && (d.id = ++this.ackPackets, d.ack = "data", this.acks[d.id] = c, b = b.slice(0, b.length - 1));
  770. d.args = b;
  771. return this.packet(d)
  772. };
  773. b.prototype.disconnect = function() {
  774. "" === this.name ? this.socket.disconnect() : (this.packet({
  775. type: "disconnect"
  776. }), this.$emit("disconnect"));
  777. return this
  778. };
  779. b.prototype.onPacket = function(b) {
  780. function c() {
  781. e.packet({
  782. type: "ack",
  783. args: a.util.toArray(arguments),
  784. ackId: b.id
  785. })
  786. }
  787. var e = this;
  788. switch (b.type) {
  789. case "connect":
  790. this.$emit("connect");
  791. break;
  792. case "disconnect":
  793. if ("" === this.name) this.socket.onDisconnect(b.reason || "booted");
  794. else this.$emit("disconnect", b.reason);
  795. break;
  796. case "message":
  797. case "json":
  798. var d = ["message", b.data];
  799. "data" == b.ack ? d.push(c) : b.ack && this.packet({
  800. type: "ack",
  801. ackId: b.id
  802. });
  803. this.$emit.apply(this, d);
  804. break;
  805. case "event":
  806. d = [b.name].concat(b.args);
  807. "data" == b.ack && d.push(c);
  808. this.$emit.apply(this, d);
  809. break;
  810. case "ack":
  811. this.acks[b.ackId] && (this.acks[b.ackId].apply(this, b.args), delete this.acks[b.ackId]);
  812. break;
  813. case "error":
  814. if (b.advice) this.socket.onError(b);
  815. else "unauthorized" == b.reason ? this.$emit("connect_failed", b.reason) : this.$emit("error", b.reason)
  816. }
  817. };
  818. c.prototype.send = function() {
  819. this.namespace.flags[this.name] = !0;
  820. this.namespace.send.apply(this.namespace, arguments)
  821. };
  822. c.prototype.emit = function() {
  823. this.namespace.flags[this.name] = !0;
  824. this.namespace.emit.apply(this.namespace, arguments)
  825. }
  826. })("undefined" != typeof io ? io : module.exports, "undefined" != typeof io ? io : module.parent.exports);
  827. (function(d, a, b) {
  828. function c(b) {
  829. a.Transport.apply(this, arguments)
  830. }
  831. d.websocket = c;
  832. a.util.inherit(c, a.Transport);
  833. c.prototype.name = "websocket";
  834. c.prototype.open = function() {
  835. var c = a.util.query(this.socket.options.query),
  836. f = this,
  837. e;
  838. e || (e = b.MozWebSocket || b.WebSocket);
  839. this.websocket = new e(this.prepareUrl() + c);
  840. this.websocket.onopen = function() {
  841. f.onOpen();
  842. f.socket.setBuffer(!1)
  843. };
  844. this.websocket.onmessage = function(a) {
  845. f.onData(a.data)
  846. };
  847. this.websocket.onclose = function() {
  848. f.onClose();
  849. f.socket.setBuffer(!0)
  850. };
  851. this.websocket.onerror = function(a) {
  852. f.onError(a)
  853. };
  854. return this
  855. };
  856. c.prototype.send = a.util.ua.iDevice ?
  857. function(a) {
  858. var b = this;
  859. setTimeout(function() {
  860. b.websocket.send(a)
  861. }, 0);
  862. return this
  863. } : function(a) {
  864. this.websocket.send(a);
  865. return this
  866. };
  867. c.prototype.payload = function(a) {
  868. for (var b = 0, c = a.length; b < c; b++) this.packet(a[b]);
  869. return this
  870. };
  871. c.prototype.close = function() {
  872. this.websocket.close();
  873. return this
  874. };
  875. c.prototype.onError = function(a) {
  876. this.socket.onError(a)
  877. };
  878. c.prototype.scheme = function() {
  879. return this.socket.options.secure ? "wss" : "ws"
  880. };
  881. c.check = function() {
  882. return "WebSocket" in b && !("__addTask" in WebSocket) || "MozWebSocket" in
  883. b
  884. };
  885. c.xdomainCheck = function() {
  886. return !0
  887. };
  888. a.transports.push("websocket")
  889. })("undefined" != typeof io ? io.Transport : module.exports, "undefined" != typeof io ? io : module.parent.exports, this);
  890. (function(d, a) {
  891. function b() {
  892. a.Transport.websocket.apply(this, arguments)
  893. }
  894. d.flashsocket = b;
  895. a.util.inherit(b, a.Transport.websocket);
  896. b.prototype.name = "flashsocket";
  897. b.prototype.open = function() {
  898. var b = this,
  899. d = arguments;
  900. WebSocket.__addTask(function() {
  901. a.Transport.websocket.prototype.open.apply(b, d)
  902. });
  903. return this
  904. };
  905. b.prototype.send = function() {
  906. var b =
  907. this,
  908. d = arguments;
  909. WebSocket.__addTask(function() {
  910. a.Transport.websocket.prototype.send.apply(b, d)
  911. });
  912. return this
  913. };
  914. b.prototype.close = function() {
  915. WebSocket.__tasks.length = 0;
  916. a.Transport.websocket.prototype.close.call(this);
  917. return this
  918. };
  919. b.prototype.ready = function(c, d) {
  920. function f() {
  921. var a = c.options,
  922. f = a["flash policy port"],
  923. r = ["http" + (a.secure ? "s" : "") + ":/", a.host + ":" + a.port, a.resource, "static/flashsocket", "WebSocketMain" + (c.isXDomain() ? "Insecure" : "") + ".swf"];
  924. b.loaded || ("undefined" === typeof WEB_SOCKET_SWF_LOCATION &&
  925. (WEB_SOCKET_SWF_LOCATION = r.join("/")), 843 !== f && WebSocket.loadFlashPolicyFile("xmlsocket://" + a.host + ":" + f), WebSocket.__initialize(), b.loaded = !0);
  926. d.call(e)
  927. }
  928. var e = this;
  929. if (document.body) return f();
  930. a.util.load(f)
  931. };
  932. b.check = function() {
  933. return "undefined" != typeof WebSocket && "__initialize" in WebSocket && x ? 10 <= x.getFlashPlayerVersion().major : !1
  934. };
  935. b.xdomainCheck = function() {
  936. return !0
  937. };
  938. "undefined" != typeof window && (WEB_SOCKET_DISABLE_AUTO_INITIALIZATION = !0);
  939. a.transports.push("flashsocket")
  940. })("undefined" != typeof io ?
  941. io.Transport : module.exports, "undefined" != typeof io ? io : module.parent.exports);
  942. if ("undefined" != typeof window) var x = function() {
  943. function d() {
  944. if (!B) {
  945. try {
  946. var a = h.getElementsByTagName("body")[0].appendChild(h.createElement("span"));
  947. a.parentNode.removeChild(a)
  948. } catch (b) {
  949. return
  950. }
  951. B = !0;
  952. for (var a = E.length, c = 0; c < a; c++) E[c]()
  953. }
  954. }
  955.  
  956. function a(a) {
  957. B ? a() : E[E.length] = a
  958. }
  959.  
  960. function b(a) {
  961. if ("undefined" != typeof u.addEventListener) u.addEventListener("load", a, !1);
  962. else if ("undefined" != typeof h.addEventListener) h.addEventListener("load",
  963. a, !1);
  964. else if ("undefined" != typeof u.attachEvent) w(u, "onload", a);
  965. else if ("function" == typeof u.onload) {
  966. var b = u.onload;
  967. u.onload = function() {
  968. b();
  969. a()
  970. }
  971. } else u.onload = a
  972. }
  973.  
  974. function c() {
  975. var a = h.getElementsByTagName("body")[0],
  976. b = h.createElement("object");
  977. b.setAttribute("type", "application/x-shockwave-flash");
  978. var c = a.appendChild(b);
  979. if (c) {
  980. var f = 0;
  981. (function() {
  982. if ("undefined" != typeof c.GetVariable) {
  983. var e = c.GetVariable("$version");
  984. e && (e = e.split(" ")[1].split(","), k.pv = [parseInt(e[0], 10), parseInt(e[1], 10), parseInt(e[2],
  985. 10)])
  986. } else if (10 > f) {
  987. f++;
  988. setTimeout(arguments.callee, 10);
  989. return
  990. }
  991. a.removeChild(b);
  992. c = null;
  993. g()
  994. })()
  995. } else g()
  996. }
  997.  
  998. function g() {
  999. var a = z.length;
  1000. if (0 < a)
  1001. for (var b = 0; b < a; b++) {
  1002. var c = z[b].id,
  1003. d = z[b].callbackFn,
  1004. g = {
  1005. success: !1,
  1006. id: c
  1007. };
  1008. if (0 < k.pv[0]) {
  1009. var h = v(c);
  1010. if (h)
  1011. if (!t(z[b].swfVersion) || k.wk && 312 > k.wk)
  1012. if (z[b].expressInstall && e()) {
  1013. g = {};
  1014. g.data = z[b].expressInstall;
  1015. g.width = h.getAttribute("width") || "0";
  1016. g.height = h.getAttribute("height") || "0";
  1017. h.getAttribute("class") && (g.styleclass = h.getAttribute("class"));
  1018. h.getAttribute("align") &&
  1019. (g.align = h.getAttribute("align"));
  1020. for (var M = {}, h = h.getElementsByTagName("param"), n = h.length, p = 0; p < n; p++) "movie" != h[p].getAttribute("name").toLowerCase() && (M[h[p].getAttribute("name")] = h[p].getAttribute("value"));
  1021. l(g, M, c, d)
  1022. } else m(h), d && d(g);
  1023. else A(c, !0), d && (g.success = !0, g.ref = f(c), d(g))
  1024. } else A(c, !0), d && ((c = f(c)) && "undefined" != typeof c.SetVariable && (g.success = !0, g.ref = c), d(g))
  1025. }
  1026. }
  1027.  
  1028. function f(a) {
  1029. var b = null;
  1030. (a = v(a)) && "OBJECT" == a.nodeName && ("undefined" != typeof a.SetVariable ? b = a : (a = a.getElementsByTagName("object")[0]) &&
  1031. (b = a));
  1032. return b
  1033. }
  1034.  
  1035. function e() {
  1036. return !F && t("6.0.65") && (k.win || k.mac) && !(k.wk && 312 > k.wk)
  1037. }
  1038.  
  1039. function l(a, b, c, f) {
  1040. F = !0;
  1041. I = f || null;
  1042. N = {
  1043. success: !1,
  1044. id: c
  1045. };
  1046. var e = v(c);
  1047. if (e) {
  1048. "OBJECT" == e.nodeName ? (D = r(e), G = null) : (D = e, G = c);
  1049. a.id = "SWFObjectExprInst";
  1050. if ("undefined" == typeof a.width || !/%$/.test(a.width) && 310 > parseInt(a.width, 10)) a.width = "310";
  1051. if ("undefined" == typeof a.height || !/%$/.test(a.height) && 137 > parseInt(a.height, 10)) a.height = "137";
  1052. h.title = h.title.slice(0, 47) + " - Flash Player Installation";
  1053. f = k.ie && k.win ? ["Active"].concat("").join("X") :
  1054. "PlugIn";
  1055. f = "MMredirectURL=" + u.location.toString().replace(/&/g, "%26") + "&MMplayerType=" + f + "&MMdoctitle=" + h.title;
  1056. b.flashvars = "undefined" != typeof b.flashvars ? b.flashvars + ("&" + f) : f;
  1057. k.ie && k.win && 4 != e.readyState && (f = h.createElement("div"), c += "SWFObjectNew", f.setAttribute("id", c), e.parentNode.insertBefore(f, e), e.style.display = "none", function() {
  1058. 4 == e.readyState ? e.parentNode.removeChild(e) : setTimeout(arguments.callee, 10)
  1059. }());
  1060. p(a, b, c)
  1061. }
  1062. }
  1063.  
  1064. function m(a) {
  1065. if (k.ie && k.win && 4 != a.readyState) {
  1066. var b = h.createElement("div");
  1067. a.parentNode.insertBefore(b, a);
  1068. b.parentNode.replaceChild(r(a), b);
  1069. a.style.display = "none";
  1070. (function() {
  1071. 4 == a.readyState ? a.parentNode.removeChild(a) : setTimeout(arguments.callee, 10)
  1072. })()
  1073. } else a.parentNode.replaceChild(r(a), a)
  1074. }
  1075.  
  1076. function r(a) {
  1077. var b = h.createElement("div");
  1078. if (k.win && k.ie) b.innerHTML = a.innerHTML;
  1079. else if (a = a.getElementsByTagName("object")[0])
  1080. if (a = a.childNodes)
  1081. for (var c = a.length, e = 0; e < c; e++) 1 == a[e].nodeType && "PARAM" == a[e].nodeName || 8 == a[e].nodeType || b.appendChild(a[e].cloneNode(!0));
  1082. return b
  1083. }
  1084.  
  1085. function p(a,
  1086. b, c) {
  1087. var e, f = v(c);
  1088. if (k.wk && 312 > k.wk) return e;
  1089. if (f)
  1090. if ("undefined" == typeof a.id && (a.id = c), k.ie && k.win) {
  1091. var d = "",
  1092. g;
  1093. for (g in a) a[g] != Object.prototype[g] && ("data" == g.toLowerCase() ? b.movie = a[g] : "styleclass" == g.toLowerCase() ? d += ' class="' + a[g] + '"' : "classid" != g.toLowerCase() && (d += " " + g + '="' + a[g] + '"'));
  1094. g = "";
  1095. for (var l in b) b[l] != Object.prototype[l] && (g += '<param name="' + l + '" value="' + b[l] + '" />');
  1096. f.outerHTML = '<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"' + d + ">" + g + "</object>";
  1097. H[H.length] = a.id;
  1098. e = v(a.id)
  1099. } else {
  1100. l = h.createElement("object");
  1101. l.setAttribute("type", "application/x-shockwave-flash");
  1102. for (var m in a) a[m] != Object.prototype[m] && ("styleclass" == m.toLowerCase() ? l.setAttribute("class", a[m]) : "classid" != m.toLowerCase() && l.setAttribute(m, a[m]));
  1103. for (d in b) b[d] != Object.prototype[d] && "movie" != d.toLowerCase() && (a = l, g = d, m = b[d], c = h.createElement("param"), c.setAttribute("name", g), c.setAttribute("value", m), a.appendChild(c));
  1104. f.parentNode.replaceChild(l, f);
  1105. e = l
  1106. } return e
  1107. }
  1108.  
  1109. function n(a) {
  1110. var b = v(a);
  1111. b && "OBJECT" ==
  1112. b.nodeName && (k.ie && k.win ? (b.style.display = "none", function() {
  1113. if (4 == b.readyState) {
  1114. var c = v(a);
  1115. if (c) {
  1116. for (var e in c) "function" == typeof c[e] && (c[e] = null);
  1117. c.parentNode.removeChild(c)
  1118. }
  1119. } else setTimeout(arguments.callee, 10)
  1120. }()) : b.parentNode.removeChild(b))
  1121. }
  1122.  
  1123. function v(a) {
  1124. var b = null;
  1125. try {
  1126. b = h.getElementById(a)
  1127. } catch (c) {}
  1128. return b
  1129. }
  1130.  
  1131. function w(a, b, c) {
  1132. a.attachEvent(b, c);
  1133. C[C.length] = [a, b, c]
  1134. }
  1135.  
  1136. function t(a) {
  1137. var b = k.pv;
  1138. a = a.split(".");
  1139. a[0] = parseInt(a[0], 10);
  1140. a[1] = parseInt(a[1], 10) || 0;
  1141. a[2] = parseInt(a[2], 10) || 0;
  1142. return b[0] >
  1143. a[0] || b[0] == a[0] && b[1] > a[1] || b[0] == a[0] && b[1] == a[1] && b[2] >= a[2] ? !0 : !1
  1144. }
  1145.  
  1146. function K(a, b, c, e) {
  1147. if (!k.ie || !k.mac) {
  1148. var f = h.getElementsByTagName("head")[0];
  1149. f && (c = c && "string" == typeof c ? c : "screen", e && (J = y = null), y && J == c || (e = h.createElement("style"), e.setAttribute("type", "text/css"), e.setAttribute("media", c), y = f.appendChild(e), k.ie && k.win && "undefined" != typeof h.styleSheets && 0 < h.styleSheets.length && (y = h.styleSheets[h.styleSheets.length - 1]), J = c), k.ie && k.win ? y && "object" == typeof y.addRule && y.addRule(a, b) : y && "undefined" !=
  1150. typeof h.createTextNode && y.appendChild(h.createTextNode(a + " {" + b + "}")))
  1151. }
  1152. }
  1153.  
  1154. function A(a, b) {
  1155. if (O) {
  1156. var c = b ? "visible" : "hidden";
  1157. B && v(a) ? v(a).style.visibility = c : K("#" + a, "visibility:" + c)
  1158. }
  1159. }
  1160.  
  1161. function L(a) {
  1162. return null != /[\\\"<>\.;]/.exec(a) && "undefined" != typeof encodeURIComponent ? encodeURIComponent(a) : a
  1163. }
  1164. var u = window,
  1165. h = document,
  1166. q = navigator,
  1167. P = !1,
  1168. E = [function() {
  1169. P ? c() : g()
  1170. }],
  1171. z = [],
  1172. H = [],
  1173. C = [],
  1174. D, G, I, N, B = !1,
  1175. F = !1,
  1176. y, J, O = !0,
  1177. k = function() {
  1178. var a = "undefined" != typeof h.getElementById && "undefined" != typeof h.getElementsByTagName &&
  1179. "undefined" != typeof h.createElement,
  1180. b = q.userAgent.toLowerCase(),
  1181. c = q.platform.toLowerCase(),
  1182. e = c ? /win/.test(c) : /win/.test(b),
  1183. c = c ? /mac/.test(c) : /mac/.test(b),
  1184. b = /webkit/.test(b) ? parseFloat(b.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : !1,
  1185. f = !+"\v1",
  1186. d = [0, 0, 0],
  1187. g = null;
  1188. if ("undefined" != typeof q.plugins && "object" == typeof q.plugins["Shockwave Flash"]) !(g = q.plugins["Shockwave Flash"].description) || "undefined" != typeof q.mimeTypes && q.mimeTypes["application/x-shockwave-flash"] && !q.mimeTypes["application/x-shockwave-flash"].enabledPlugin ||
  1189. (P = !0, f = !1, g = g.replace(/^.*\s+(\S+\s+\S+$)/, "$1"), d[0] = parseInt(g.replace(/^(.*)\..*$/, "$1"), 10), d[1] = parseInt(g.replace(/^.*\.(.*)\s.*$/, "$1"), 10), d[2] = /[a-zA-Z]/.test(g) ? parseInt(g.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0);
  1190. else if ("undefined" != typeof u[["Active"].concat("Object").join("X")]) try {
  1191. if (g = (new(window[["Active"].concat("Object").join("X")])("ShockwaveFlash.ShockwaveFlash")).GetVariable("$version")) f = !0, g = g.split(" ")[1].split(","), d = [parseInt(g[0], 10), parseInt(g[1], 10), parseInt(g[2], 10)]
  1192. } catch (l) {}
  1193. return {
  1194. w3: a,
  1195. pv: d,
  1196. wk: b,
  1197. ie: f,
  1198. win: e,
  1199. mac: c
  1200. }
  1201. }();
  1202. (function() {
  1203. k.w3 && (("undefined" != typeof h.readyState && "complete" == h.readyState || "undefined" == typeof h.readyState && (h.getElementsByTagName("body")[0] || h.body)) && d(), B || ("undefined" != typeof h.addEventListener && h.addEventListener("DOMContentLoaded", d, !1), k.ie && k.win && (h.attachEvent("onreadystatechange", function() {
  1204. "complete" == h.readyState && (h.detachEvent("onreadystatechange", arguments.callee), d())
  1205. }), u == top && function() {
  1206. if (!B) {
  1207. try {
  1208. h.documentElement.doScroll("left")
  1209. } catch (a) {
  1210. setTimeout(arguments.callee,
  1211. 0);
  1212. return
  1213. }
  1214. d()
  1215. }
  1216. }()), k.wk && function() {
  1217. B || (/loaded|complete/.test(h.readyState) ? d() : setTimeout(arguments.callee, 0))
  1218. }(), b(d)))
  1219. })();
  1220. (function() {
  1221. k.ie && k.win && window.attachEvent("onunload", function() {
  1222. for (var a = C.length, b = 0; b < a; b++) C[b][0].detachEvent(C[b][1], C[b][2]);
  1223. a = H.length;
  1224. for (b = 0; b < a; b++) n(H[b]);
  1225. for (var c in k) k[c] = null;
  1226. k = null;
  1227. for (var e in x) x[e] = null;
  1228. x = null
  1229. })
  1230. })();
  1231. return {
  1232. registerObject: function(a, b, c, e) {
  1233. if (k.w3 && a && b) {
  1234. var f = {};
  1235. f.id = a;
  1236. f.swfVersion = b;
  1237. f.expressInstall = c;
  1238. f.callbackFn = e;
  1239. z[z.length] = f;
  1240. A(a,
  1241. !1)
  1242. } else e && e({
  1243. success: !1,
  1244. id: a
  1245. })
  1246. },
  1247. getObjectById: function(a) {
  1248. if (k.w3) return f(a)
  1249. },
  1250. embedSWF: function(b, c, f, d, g, m, h, n, q, r) {
  1251. var u = {
  1252. success: !1,
  1253. id: c
  1254. };
  1255. k.w3 && !(k.wk && 312 > k.wk) && b && c && f && d && g ? (A(c, !1), a(function() {
  1256. f += "";
  1257. d += "";
  1258. var a = {};
  1259. if (q && "object" === typeof q)
  1260. for (var k in q) a[k] = q[k];
  1261. a.data = b;
  1262. a.width = f;
  1263. a.height = d;
  1264. k = {};
  1265. if (n && "object" === typeof n)
  1266. for (var v in n) k[v] = n[v];
  1267. if (h && "object" === typeof h)
  1268. for (var w in h) k.flashvars = "undefined" != typeof k.flashvars ? k.flashvars + ("&" + w + "=" + h[w]) : w + "=" + h[w];
  1269. if (t(g)) v = p(a,
  1270. k, c), a.id == c && A(c, !0), u.success = !0, u.ref = v;
  1271. else {
  1272. if (m && e()) {
  1273. a.data = m;
  1274. l(a, k, c, r);
  1275. return
  1276. }
  1277. A(c, !0)
  1278. }
  1279. r && r(u)
  1280. })) : r && r(u)
  1281. },
  1282. switchOffAutoHideShow: function() {
  1283. O = !1
  1284. },
  1285. ua: k,
  1286. getFlashPlayerVersion: function() {
  1287. return {
  1288. major: k.pv[0],
  1289. minor: k.pv[1],
  1290. release: k.pv[2]
  1291. }
  1292. },
  1293. hasFlashPlayerVersion: t,
  1294. createSWF: function(a, b, c) {
  1295. if (k.w3) return p(a, b, c)
  1296. },
  1297. showExpressInstall: function(a, b, c, f) {
  1298. k.w3 && e() && l(a, b, c, f)
  1299. },
  1300. removeSWF: function(a) {
  1301. k.w3 && n(a)
  1302. },
  1303. createCSS: function(a, b, c, e) {
  1304. k.w3 && K(a, b, c, e)
  1305. },
  1306. addDomLoadEvent: a,
  1307. addLoadEvent: b,
  1308. getQueryParamValue: function(a) {
  1309. var b =
  1310. h.location.search || h.location.hash;
  1311. if (b) {
  1312. /\?/.test(b) && (b = b.split("?")[1]);
  1313. if (null == a) return L(b);
  1314. for (var b = b.split("&"), c = 0; c < b.length; c++)
  1315. if (b[c].substring(0, b[c].indexOf("=")) == a) return L(b[c].substring(b[c].indexOf("=") + 1))
  1316. }
  1317. return ""
  1318. },
  1319. expressInstallCallback: function() {
  1320. if (F) {
  1321. var a = v("SWFObjectExprInst");
  1322. a && D && (a.parentNode.replaceChild(D, a), G && (A(G, !0), k.ie && k.win && (D.style.display = "block")), I && I(N));
  1323. F = !1
  1324. }
  1325. }
  1326. }
  1327. }();
  1328. (function() {
  1329. if ("undefined" != typeof window && !window.WebSocket) {
  1330. var d = window.console;
  1331. d &&
  1332. d.log && d.error || (d = {
  1333. log: function() {},
  1334. error: function() {}
  1335. });
  1336. x.hasFlashPlayerVersion("10.0.0") ? ("file:" == location.protocol && d.error("WARNING: web-socket-js doesn't work in file:///... URL unless you set Flash Security Settings properly. Open the page via Web server i.e. http://..."), WebSocket = function(a, b, c, d, f) {
  1337. var e = this;
  1338. e.__id = WebSocket.__nextId++;
  1339. WebSocket.__instances[e.__id] = e;
  1340. e.readyState = WebSocket.CONNECTING;
  1341. e.bufferedAmount = 0;
  1342. e.__events = {};
  1343. b ? "string" == typeof b && (b = [b]) : b = [];
  1344. setTimeout(function() {
  1345. WebSocket.__addTask(function() {
  1346. WebSocket.__flash.create(e.__id,
  1347. a, b, c || null, d || 0, f || null)
  1348. })
  1349. }, 0)
  1350. }, WebSocket.prototype.send = function(a) {
  1351. if (this.readyState == WebSocket.CONNECTING) throw "INVALID_STATE_ERR: Web Socket connection has not been established";
  1352. a = WebSocket.__flash.send(this.__id, encodeURIComponent(a));
  1353. if (0 > a) return !0;
  1354. this.bufferedAmount += a;
  1355. return !1
  1356. }, WebSocket.prototype.close = function() {
  1357. this.readyState != WebSocket.CLOSED && this.readyState != WebSocket.CLOSING && (this.readyState = WebSocket.CLOSING, WebSocket.__flash.close(this.__id))
  1358. }, WebSocket.prototype.addEventListener =
  1359. function(a, b, c) {
  1360. a in this.__events || (this.__events[a] = []);
  1361. this.__events[a].push(b)
  1362. }, WebSocket.prototype.removeEventListener = function(a, b, c) {
  1363. if (a in this.__events)
  1364. for (a = this.__events[a], c = a.length - 1; 0 <= c; --c)
  1365. if (a[c] === b) {
  1366. a.splice(c, 1);
  1367. break
  1368. }
  1369. }, WebSocket.prototype.dispatchEvent = function(a) {
  1370. console.log("dispatch event arg", a);
  1371. for (var b = this.__events[a.type] || [], c = 0; c < b.length; ++c) b[c](a);
  1372. (b = this["on" + a.type]) && b(a)
  1373. }, WebSocket.prototype.__handleEvent = function(a) {
  1374. console.log("handle event arg", a);
  1375. "readyState" in a && (this.readyState = a.readyState);
  1376. "protocol" in a && (this.protocol =
  1377. a.protocol);
  1378. if ("open" == a.type || "error" == a.type) a = this.__createSimpleEvent(a.type);
  1379. else if ("close" == a.type) a = this.__createSimpleEvent("close");
  1380. else if ("message" == a.type) a = decodeURIComponent(a.message), a = this.__createMessageEvent("message", a);
  1381. else throw "unknown event type: " + a.type;
  1382. this.dispatchEvent(a)
  1383. }, WebSocket.prototype.__createSimpleEvent = function(a) {
  1384. if (document.createEvent && window.Event) {
  1385. var b = document.createEvent("Event");
  1386. b.initEvent(a, !1, !1);
  1387. return b
  1388. }
  1389. return {
  1390. type: a,
  1391. bubbles: !1,
  1392. cancelable: !1
  1393. }
  1394. },
  1395. WebSocket.prototype.__createMessageEvent = function(a, b) {
  1396. if (document.createEvent && window.MessageEvent && !window.opera) {
  1397. var c = document.createEvent("MessageEvent");
  1398. c.initMessageEvent("message", !1, !1, b, null, null, window, null);
  1399. return c
  1400. }
  1401. return {
  1402. type: a,
  1403. data: b,
  1404. bubbles: !1,
  1405. cancelable: !1
  1406. }
  1407. }, WebSocket.CONNECTING = 0, WebSocket.OPEN = 1, WebSocket.CLOSING = 2, WebSocket.CLOSED = 3, WebSocket.__flash = null, WebSocket.__instances = {}, WebSocket.__tasks = [], WebSocket.__nextId = 0, WebSocket.loadFlashPolicyFile = function(a) {
  1408. WebSocket.__addTask(function() {
  1409. WebSocket.__flash.loadManualPolicyFile(a)
  1410. })
  1411. },
  1412. WebSocket.__initialize = function() {
  1413. if (!WebSocket.__flash)
  1414. if (WebSocket.__swfLocation && (window.WEB_SOCKET_SWF_LOCATION = WebSocket.__swfLocation), window.WEB_SOCKET_SWF_LOCATION) {
  1415. var a = document.createElement("div");
  1416. a.id = "webSocketContainer";
  1417. a.style.position = "absolute";
  1418. WebSocket.__isFlashLite() ? (a.style.left = "0px", a.style.top = "0px") : (a.style.left = "-100px", a.style.top = "-100px");
  1419. var b = document.createElement("div");
  1420. b.id = "webSocketFlash";
  1421. a.appendChild(b);
  1422. document.body.appendChild(a);
  1423. x.embedSWF(WEB_SOCKET_SWF_LOCATION,
  1424. "webSocketFlash", "1", "1", "10.0.0", null, null, {
  1425. hasPriority: !0,
  1426. swliveconnect: !0,
  1427. allowScriptAccess: "always"
  1428. }, null,
  1429. function(a) {
  1430. a.success || d.error("[WebSocket] swfobject.embedSWF failed")
  1431. })
  1432. } else d.error("[WebSocket] set WEB_SOCKET_SWF_LOCATION to location of WebSocketMain.swf")
  1433. }, WebSocket.__onFlashInitialized = function() {
  1434. setTimeout(function() {
  1435. WebSocket.__flash = document.getElementById("webSocketFlash");
  1436. WebSocket.__flash.setCallerUrl(location.href);
  1437. WebSocket.__flash.setDebug(!!window.WEB_SOCKET_DEBUG);
  1438. for (var a =
  1439. 0; a < WebSocket.__tasks.length; ++a) WebSocket.__tasks[a]();
  1440. WebSocket.__tasks = []
  1441. }, 0)
  1442. }, WebSocket.__onFlashEvent = function() {
  1443. setTimeout(function() {
  1444. try {
  1445. for (var a = WebSocket.__flash.receiveEvents(), b = 0; b < a.length; ++b) WebSocket.__instances[a[b].webSocketId].__handleEvent(a[b])
  1446. } catch (c) {
  1447. d.error(c)
  1448. }
  1449. }, 0);
  1450. return !0
  1451. }, WebSocket.__log = function(a) {
  1452. d.log(decodeURIComponent(a))
  1453. }, WebSocket.__error = function(a) {
  1454. d.error(decodeURIComponent(a))
  1455. }, WebSocket.__addTask = function(a) {
  1456. WebSocket.__flash ? a() : WebSocket.__tasks.push(a)
  1457. },
  1458. WebSocket.__isFlashLite = function() {
  1459. if (!window.navigator || !window.navigator.mimeTypes) return !1;
  1460. var a = window.navigator.mimeTypes["application/x-shockwave-flash"];
  1461. return a && a.enabledPlugin && a.enabledPlugin.filename ? a.enabledPlugin.filename.match(/flashlite/i) ? !0 : !1 : !1
  1462. }, window.WEB_SOCKET_DISABLE_AUTO_INITIALIZATION || (window.addEventListener ? window.addEventListener("load", function() {
  1463. WebSocket.__initialize()
  1464. }, !1) : window.attachEvent("onload", function() {
  1465. WebSocket.__initialize()
  1466. }))) : d.error("Flash Player >= 10.0.0 is required.")
  1467. }
  1468. })();
  1469. (function(d, a, b) {
  1470. function c(b) {
  1471. b && (a.Transport.apply(this, arguments), this.sendBuffer = [])
  1472. }
  1473.  
  1474. function g() {}
  1475. d.XHR = c;
  1476. a.util.inherit(c, a.Transport);
  1477. c.prototype.open = function() {
  1478. this.socket.setBuffer(!1);
  1479. this.onOpen();
  1480. this.get();
  1481. this.setCloseTimeout();
  1482. return this
  1483. };
  1484. c.prototype.payload = function(b) {
  1485. for (var c = [], d = 0, g = b.length; d < g; d++) c.push(a.parser.encodePacket(b[d]));
  1486. this.send(a.parser.encodePayload(c))
  1487. };
  1488. c.prototype.send = function(a) {
  1489. this.post(a);
  1490. return this
  1491. };
  1492. c.prototype.post = function(a) {
  1493. function c() {
  1494. if (4 ==
  1495. this.readyState)
  1496. if (this.onreadystatechange = g, m.posting = !1, 200 == this.status) m.socket.setBuffer(!1);
  1497. else m.onClose()
  1498. }
  1499.  
  1500. function d() {
  1501. this.onload = g;
  1502. m.socket.setBuffer(!1)
  1503. }
  1504. var m = this;
  1505. this.socket.setBuffer(!0);
  1506. this.sendXHR = this.request("POST");
  1507. b.XDomainRequest && this.sendXHR instanceof XDomainRequest ? this.sendXHR.onload = this.sendXHR.onerror = d : this.sendXHR.onreadystatechange = c;
  1508. this.sendXHR.send(a)
  1509. };
  1510. c.prototype.close = function() {
  1511. this.onClose();
  1512. return this
  1513. };
  1514. c.prototype.request = function(b) {
  1515. var c = a.util.request(this.socket.isXDomain()),
  1516. d = a.util.query(this.socket.options.query, "t=" + +new Date);
  1517. c.open(b || "GET", this.prepareUrl() + d, !0);
  1518. if ("POST" == b) try {
  1519. c.setRequestHeader ? c.setRequestHeader("Content-type", "text/plain;charset=UTF-8") : c.contentType = "text/plain"
  1520. } catch (g) {}
  1521. return c
  1522. };
  1523. c.prototype.scheme = function() {
  1524. return this.socket.options.secure ? "https" : "http"
  1525. };
  1526. c.check = function(c, e) {
  1527. try {
  1528. var d = a.util.request(e),
  1529. g = b.XDomainRequest && d instanceof XDomainRequest,
  1530. r = c && c.options && c.options.secure ? "https:" : "http:",
  1531. p = b.location && r != b.location.protocol;
  1532. if (d && (!g || !p)) return !0
  1533. } catch (n) {}
  1534. return !1
  1535. };
  1536. c.xdomainCheck = function(a) {
  1537. return c.check(a, !0)
  1538. }
  1539. })("undefined" != typeof io ? io.Transport : module.exports, "undefined" != typeof io ? io : module.parent.exports, this);
  1540. (function(d, a) {
  1541. function b(b) {
  1542. a.Transport.XHR.apply(this, arguments)
  1543. }
  1544. d.htmlfile = b;
  1545. a.util.inherit(b, a.Transport.XHR);
  1546. b.prototype.name = "htmlfile";
  1547. b.prototype.get = function() {
  1548. this.doc = new(window[["Active"].concat("Object").join("X")])("htmlfile");
  1549. this.doc.open();
  1550. this.doc.write("<html></html>");
  1551. this.doc.close();
  1552. this.doc.parentWindow.s = this;
  1553. var b = this.doc.createElement("div");
  1554. b.className = "socketio";
  1555. this.doc.body.appendChild(b);
  1556. this.iframe = this.doc.createElement("iframe");
  1557. b.appendChild(this.iframe);
  1558. var d = this,
  1559. b = a.util.query(this.socket.options.query, "t=" + +new Date);
  1560. this.iframe.src = this.prepareUrl() + b;
  1561. a.util.on(window, "unload", function() {
  1562. d.destroy()
  1563. })
  1564. };
  1565. b.prototype._ = function(a, b) {
  1566. a = a.replace(/\\\//g, "/");
  1567. this.onData(a);
  1568. try {
  1569. var f = b.getElementsByTagName("script")[0];
  1570. f.parentNode.removeChild(f)
  1571. } catch (e) {}
  1572. };
  1573. b.prototype.destroy =
  1574. function() {
  1575. if (this.iframe) {
  1576. try {
  1577. this.iframe.src = "about:blank"
  1578. } catch (a) {}
  1579. this.doc = null;
  1580. this.iframe.parentNode.removeChild(this.iframe);
  1581. this.iframe = null;
  1582. CollectGarbage()
  1583. }
  1584. };
  1585. b.prototype.close = function() {
  1586. this.destroy();
  1587. return a.Transport.XHR.prototype.close.call(this)
  1588. };
  1589. b.check = function(b) {
  1590. if ("undefined" != typeof window && ["Active"].concat("Object").join("X") in window) try {
  1591. return new(window[["Active"].concat("Object").join("X")])("htmlfile"), a.Transport.XHR.check(b)
  1592. } catch (d) {}
  1593. return !1
  1594. };
  1595. b.xdomainCheck = function() {
  1596. return !1
  1597. };
  1598. a.transports.push("htmlfile")
  1599. })("undefined" != typeof io ? io.Transport : module.exports, "undefined" != typeof io ? io : module.parent.exports);
  1600. (function(d, a, b) {
  1601. function c() {
  1602. a.Transport.XHR.apply(this, arguments)
  1603. }
  1604.  
  1605. function g() {}
  1606. d["xhr-polling"] = c;
  1607. a.util.inherit(c, a.Transport.XHR);
  1608. a.util.merge(c, a.Transport.XHR);
  1609. c.prototype.name = "xhr-polling";
  1610. c.prototype.heartbeats = function() {
  1611. return !1
  1612. };
  1613. c.prototype.open = function() {
  1614. a.Transport.XHR.prototype.open.call(this);
  1615. return !1
  1616. };
  1617. c.prototype.get = function() {
  1618. function a() {
  1619. if (4 == this.readyState)
  1620. if (this.onreadystatechange =
  1621. g, 200 == this.status) m.onData(this.responseText), m.get();
  1622. else m.onClose()
  1623. }
  1624.  
  1625. function c() {
  1626. this.onerror = this.onload = g;
  1627. m.retryCounter = 1;
  1628. m.onData(this.responseText);
  1629. m.get()
  1630. }
  1631.  
  1632. function d() {
  1633. m.retryCounter++;
  1634. if (!m.retryCounter || 3 < m.retryCounter) m.onClose();
  1635. else m.get()
  1636. }
  1637. if (this.isOpen) {
  1638. var m = this;
  1639. this.xhr = this.request();
  1640. b.XDomainRequest && this.xhr instanceof XDomainRequest ? (this.xhr.onload = c, this.xhr.onerror = d) : this.xhr.onreadystatechange = a;
  1641. this.xhr.send(null)
  1642. }
  1643. };
  1644. c.prototype.onClose = function() {
  1645. a.Transport.XHR.prototype.onClose.call(this);
  1646. if (this.xhr) {
  1647. this.xhr.onreadystatechange = this.xhr.onload = this.xhr.onerror = g;
  1648. try {
  1649. this.xhr.abort()
  1650. } catch (b) {}
  1651. this.xhr = null
  1652. }
  1653. };
  1654. c.prototype.ready = function(b, c) {
  1655. var d = this;
  1656. a.util.defer(function() {
  1657. c.call(d)
  1658. })
  1659. };
  1660. a.transports.push("xhr-polling")
  1661. })("undefined" != typeof io ? io.Transport : module.exports, "undefined" != typeof io ? io : module.parent.exports, this);
  1662. (function(d, a, b) {
  1663. function c(b) {
  1664. a.Transport["xhr-polling"].apply(this, arguments);
  1665. this.index = a.j.length;
  1666. var c = this;
  1667. a.j.push(function(a) {
  1668. c._(a)
  1669. })
  1670. }
  1671. var g = b.document &&
  1672. "MozAppearance" in b.document.documentElement.style;
  1673. d["jsonp-polling"] = c;
  1674. a.util.inherit(c, a.Transport["xhr-polling"]);
  1675. c.prototype.name = "jsonp-polling";
  1676. c.prototype.post = function(b) {
  1677. function c() {
  1678. d();
  1679. g.socket.setBuffer(!1)
  1680. }
  1681.  
  1682. function d() {
  1683. g.iframe && g.form.removeChild(g.iframe);
  1684. try {
  1685. w = document.createElement('<iframe name="' + g.iframeId + '">')
  1686. } catch (a) {
  1687. w = document.createElement("iframe"), w.name = g.iframeId
  1688. }
  1689. w.id = g.iframeId;
  1690. g.form.appendChild(w);
  1691. g.iframe = w
  1692. }
  1693. var g = this,
  1694. r = a.util.query(this.socket.options.query, "t=" +
  1695. +new Date + "&i=" + this.index);
  1696. if (!this.form) {
  1697. var p = document.createElement("form"),
  1698. n = document.createElement("textarea"),
  1699. v = this.iframeId = "socketio_iframe_" + this.index,
  1700. w;
  1701. p.className = "socketio";
  1702. p.style.position = "absolute";
  1703. p.style.top = "0px";
  1704. p.style.left = "0px";
  1705. p.style.display = "none";
  1706. p.target = v;
  1707. p.method = "POST";
  1708. p.setAttribute("accept-charset", "utf-8");
  1709. n.name = "d";
  1710. p.appendChild(n);
  1711. document.body.appendChild(p);
  1712. this.form = p;
  1713. this.area = n
  1714. }
  1715. this.form.action = this.prepareUrl() + r;
  1716. d();
  1717. this.area.value = a.JSON.stringify(b);
  1718. try {
  1719. this.form.submit()
  1720. } catch (t) {}
  1721. this.iframe.attachEvent ? w.onreadystatechange = function() {
  1722. "complete" == g.iframe.readyState && c()
  1723. } : this.iframe.onload = c;
  1724. this.socket.setBuffer(!0)
  1725. };
  1726. c.prototype.get = function() {
  1727. var b = this,
  1728. c = document.createElement("script"),
  1729. d = a.util.query(this.socket.options.query, "t=" + +new Date + "&i=" + this.index);
  1730. this.script && (this.script.parentNode.removeChild(this.script), this.script = null);
  1731. c.async = !0;
  1732. c.src = this.prepareUrl() + d;
  1733. c.onerror = function() {
  1734. b.onClose()
  1735. };
  1736. d = document.getElementsByTagName("script")[0];
  1737. d.parentNode.insertBefore(c, d);
  1738. this.script = c;
  1739. g && setTimeout(function() {
  1740. var a = document.createElement("iframe");
  1741. document.body.appendChild(a);
  1742. document.body.removeChild(a)
  1743. }, 100)
  1744. };
  1745. c.prototype._ = function(a) {
  1746. this.onData(a);
  1747. this.isOpen && this.get();
  1748. return this
  1749. };
  1750. c.prototype.ready = function(b, c) {
  1751. var d = this;
  1752. if (!g) return c.call(this);
  1753. a.util.load(function() {
  1754. c.call(d)
  1755. })
  1756. };
  1757. c.check = function() {
  1758. return "document" in b
  1759. };
  1760. c.xdomainCheck = function() {
  1761. return !0
  1762. };
  1763. a.transports.push("jsonp-polling")
  1764. })("undefined" != typeof io ? io.Transport :
  1765. module.exports, "undefined" != typeof io ? io : module.parent.exports, this);
  1766. "function" === typeof define && define.amd && define([], function() {
  1767. return io
  1768. })
  1769. })();

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址