Advertisement
Guest User

Untitled

a guest
Apr 4th, 2016
238
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 345.17 KB | None | 0 0
  1. /* All source code is (c) Mibbit.com. Unauthorized use/reverse engineering/copying is prohibited. */
  2. function q() {
  3. return function() {}
  4. }
  5. VERSION = 4136;
  6. var t, ba;
  7. (function() {
  8. function b(j) {
  9. return j < 10 ? "0" + j : j
  10. }
  11.  
  12. function c(j) {
  13. f.lastIndex = 0;
  14. return f.test(j) ? '"' + j.replace(f, function(n) {
  15. var o = k[n];
  16. return typeof o === "string" ? o : "\\u" + ("0000" + n.charCodeAt(0).toString(16)).slice(-4)
  17. }) + '"' : '"' + j + '"'
  18. }
  19.  
  20. function d(j, n) {
  21. var o, s, w = g,
  22. p, r = n[j];
  23. if (r && typeof r === "object" && typeof r.toJSON === "function") r = r.toJSON(j);
  24. if (typeof l === "function") r = l.call(n, j, r);
  25. switch (typeof r) {
  26. case "string":
  27. return c(r);
  28. case "number":
  29. return isFinite(r) ? String(r) : "null";
  30. case "boolean":
  31. case "null":
  32. return String(r);
  33. case "object":
  34. if (!r) return "null";
  35. g += h;
  36. p = [];
  37. if (Object.prototype.toString.apply(r) === "[object Array]") {
  38. s = r.length;
  39. for (j = 0; j < s; j += 1) p[j] = d(j, r) || "null";
  40. n = p.length === 0 ? "[]" : g ? "[\n" + g + p.join(",\n" + g) + "\n" + w + "]" : "[" + p.join(",") + "]";
  41. g = w;
  42. return n
  43. }
  44. if (l && typeof l === "object") {
  45. s = l.length;
  46. for (j = 0; j < s; j += 1) {
  47. o = l[j];
  48. if (typeof o === "string")
  49. if (n = d(o, r)) p.push(c(o) + (g ? ": " : ":") + n)
  50. }
  51. } else
  52. for (o in r)
  53. if (Object.hasOwnProperty.call(r, o))
  54. if (n = d(o, r)) p.push(c(o) + (g ? ": " : ":") + n);
  55. n = p.length === 0 ? "{}" : g ? "{\n" + g + p.join(",\n" + g) +
  56. "\n" + w + "}" : "{" + p.join(",") + "}";
  57. g = w;
  58. return n
  59. }
  60. }
  61. if (typeof Date.prototype.toJSON !== "function") {
  62. Date.prototype.toJSON = function() {
  63. return isFinite(this.valueOf()) ? this.getUTCFullYear() + "-" + b(this.getUTCMonth() + 1) + "-" + b(this.getUTCDate()) + "T" + b(this.getUTCHours()) + ":" + b(this.getUTCMinutes()) + ":" + b(this.getUTCSeconds()) + "Z" : null
  64. };
  65. String.prototype.toJSON = Number.prototype.toJSON = Boolean.prototype.toJSON = function() {
  66. return this.valueOf()
  67. }
  68. }
  69. var e = /[\u0000\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  70. f = /[\\\"\x00-\x1f\x7f-\x9f\u00ad\u0600-\u0604\u070f\u17b4\u17b5\u200c-\u200f\u2028-\u202f\u2060-\u206f\ufeff\ufff0-\uffff]/g,
  71. g, h, k = {
  72. "\u0008": "\\b",
  73. "\t": "\\t",
  74. "\n": "\\n",
  75. "\u000c": "\\f",
  76. "\r": "\\r",
  77. '"': '\\"',
  78. "\\": "\\\\"
  79. },
  80. l;
  81. if (typeof t !== "function") t = function(j, n, o) {
  82. var s;
  83. h = g = "";
  84. if (typeof o === "number")
  85. for (s = 0; s < o; s += 1) h += " ";
  86. else if (typeof o === "string") h = o;
  87. if ((l = n) && typeof n !== "function" && (typeof n !== "object" || typeof n.length !== "number")) throw new Error("JSON.stringify");
  88. return d("", {
  89. "": j
  90. })
  91. };
  92. if (typeof ba !==
  93. "function") ba = function(j, n) {
  94. function o(s, w) {
  95. var p, r, y = s[w];
  96. if (y && typeof y === "object")
  97. for (p in y)
  98. if (Object.hasOwnProperty.call(y, p)) {
  99. r = o(y, p);
  100. if (r !== undefined) y[p] = r;
  101. else delete y[p]
  102. }
  103. return n.call(s, w, y)
  104. }
  105. e.lastIndex = 0;
  106. if (e.test(j)) j = j.replace(e, function(s) {
  107. return "\\u" + ("0000" + s.charCodeAt(0).toString(16)).slice(-4)
  108. });
  109. if (/^[\],:{}\s]*$/.test(j.replace(/\\(?:["\\\/bfnrt]|u[0-9a-fA-F]{4})/g, "@").replace(/"[^"\\\n\r]*"|true|false|null|-?\d+(?:\.\d*)?(?:[eE][+\-]?\d+)?/g, "]").replace(/(?:^|:|,)(?:\s*\[)+/g,
  110. ""))) {
  111. j = eval("(" + j + ")");
  112. return typeof n === "function" ? o({
  113. "": j
  114. }, "") : j
  115. }
  116. throw new SyntaxError("JSON.parse");
  117. }
  118. })();
  119.  
  120. function ca(b) {
  121. this.p = b;
  122. this.document = b.ownerDocument;
  123. this.bc = null;
  124. this.ze = [];
  125. this.hc = document.createElement("div");
  126. u({
  127. display: "none",
  128. position: "absolute",
  129. top: "0%",
  130. left: "0%",
  131. width: "100%",
  132. height: "100%",
  133. backgroundColor: "black",
  134. zIndex: "1001"
  135. }, this.hc.style);
  136. u({
  137. MozOpacity: "0.6",
  138. opacity: ".66",
  139. filter: "alpha(opacity=66)"
  140. }, this.hc.style);
  141. this.p.appendChild(this.hc);
  142. this.Ja = document.createElement("div");
  143. u({
  144. display: "none",
  145. position: "absolute",
  146. top: "25%",
  147. left: "25%",
  148. width: "50%",
  149. height: "50%",
  150. padding: "8px",
  151. border: "14px solid #000",
  152. backgroundColor: "white"
  153. }, this.Ja.style);
  154. u({
  155. borderRadius: "12px",
  156. MozBorderRadius: "12px",
  157. WebKitBorderRadius: "12px"
  158. }, this.Ja.style);
  159. u({
  160. zIndex: "1002",
  161. overflow: "auto"
  162. }, this.Ja.style);
  163. this.p.appendChild(this.Ja)
  164. }
  165. ca.prototype.alert = function(b, c, d, e) {
  166. var f = document.createElement("div");
  167. u({
  168. border: "1px solid #ccc",
  169. background: "#eee",
  170. margin: "2px",
  171. padding: "4px",
  172. fontSize: "15px",
  173. textAlign: "center",
  174. color: "#000",
  175. fontWeight: "bold"
  176. }, f.style);
  177. f.appendChild(this.document.createTextNode(b));
  178. var g;
  179. if (c) {
  180. if (d) {
  181. f.appendChild(this.document.createElement("br"));
  182. var h = this.document.createElement("form");
  183. h.style.display = "inline";
  184. h.onsubmit = function(k) {
  185. return function() {
  186. try {
  187. c(g.value)
  188. } catch (l) {
  189. x && A("ErrorLog", "Issue " + l, C)
  190. }
  191. da(k);
  192. return false
  193. }
  194. }(this);
  195. f.appendChild(h);
  196. g = this.document.createElement("input");
  197. if (e) g.value = e;
  198. g.style.marginRight = "4px";
  199. g.style.marginLeft = "4px";
  200. u({
  201. type: "text",
  202. size: 32
  203. }, g);
  204. u({
  205. background: "#fff",
  206. padding: "2px",
  207. fontFamily: "Sans-Serif",
  208. fontSize: "13px",
  209. color: "#222",
  210. border: "1px solid #444",
  211. Vf: "4px",
  212. MozBorderRadius: "4px",
  213. WebkitBorderRadius: "4px"
  214. }, g.style);
  215. h.appendChild(g);
  216. e = this.document.createElement("div");
  217. u({
  218. cursor: "pointer",
  219. textDecoration: "underline"
  220. }, e.style);
  221. e.onclick = function(k) {
  222. return function() {
  223. try {
  224. c(g.value)
  225. } catch (l) {
  226. x &&
  227. A("ErrorLog", "Issue " + l, C)
  228. }
  229. da(k)
  230. }
  231. }(this);
  232. e.appendChild(this.document.createTextNode("OK"))
  233. } else {
  234. f.appendChild(this.document.createElement("br"));
  235. e = this.document.createElement("span");
  236. u({
  237. cursor: "pointer",
  238. textDecoration: "underline",
  239. fontSize: "19px",
  240. fontWeight: "bold",
  241. color: "#c00"
  242. }, e.style);
  243. e.onclick = function(k) {
  244. return function() {
  245. c(false);
  246. da(k)
  247. }
  248. }(this);
  249. e.appendChild(this.document.createTextNode("Cancel"));
  250. f.appendChild(e);
  251. f.appendChild(this.document.createTextNode(" | "));
  252. e = this.document.createElement("span");
  253. u({
  254. cursor: "pointer",
  255. textDecoration: "underline",
  256. fontSize: "19px",
  257. fontWeight: "bold",
  258. color: "#0c0"
  259. }, e.style);
  260. e.onclick = function(k) {
  261. return function() {
  262. c(true);
  263. da(k)
  264. }
  265. }(this);
  266. e.appendChild(this.document.createTextNode("Yes"))
  267. }
  268. f.appendChild(e)
  269. }
  270. b = {
  271. msg: b,
  272. cb: c
  273. };
  274. if (d) b.isprompt = true;
  275. b = {
  276. element: f,
  277. closecb: function() {
  278. c && c(false)
  279. },
  280. initcb: function() {
  281. if (g) try {
  282. g.focus()
  283. } catch (k) {}
  284. }
  285. };
  286. ea(this, b)
  287. };
  288.  
  289. function ea(b, c) {
  290. b.bc == null ? b.Kd(c) : b.ze.push(c)
  291. }
  292. ca.prototype.Kd = function(b) {
  293. this.hc.style.display = "block";
  294. this.Ja.style.display = "block";
  295. var c = this.document.createElement("div");
  296. c.style.textAlign = "right";
  297. c.style.height = "16px";
  298. this.Ja.appendChild(c);
  299. var d = this.document.createElement("img");
  300. D(d, "https://s3.amazonaws.com/mibbit/gfx/close-win-red.png", 12, 12);
  301. d.onclick = function(e) {
  302. return function() {
  303. b.closecb && b.closecb();
  304. da(e)
  305. }
  306. }(this);
  307. d.style.margin = "2px";
  308. d.title = "Close window";
  309. c.appendChild(d);
  310. this.hc.onclick = d.onclick;
  311. this.bc = b.element;
  312. this.Ja.appendChild(this.bc);
  313. b.initcb && b.initcb()
  314. };
  315.  
  316. function da(b) {
  317. if (b.bc != null) {
  318. b.hc.style.display = "none";
  319. for (b.Ja.style.display = "none"; b.Ja.firstChild;) b.Ja.removeChild(b.Ja.firstChild);
  320. b.bc = null;
  321. b.ze.length > 0 && b.Kd(b.ze.shift())
  322. }
  323. }
  324.  
  325. function fa(b) {
  326. for (; b.bc != null;) da(b)
  327. }
  328. ca.prototype.Lc = function() {
  329. return this.bc != null
  330. };
  331. PermalinkInfo = {
  332. create: function(b, c, d) {
  333. function e(k, l) {
  334. var j = h.insertRow(-1),
  335. n = j.insertCell(-1);
  336. u({
  337. textAlign: "right",
  338. fontSize: "15px"
  339. }, n.style);
  340. j = j.insertCell(-1);
  341. n.appendChild(b.createTextNode(k));
  342. k = b.createElement("input");
  343. k.type = "text";
  344. k.zh = true;
  345. k.size = 32;
  346. k.value = l;
  347. u({
  348. border: "1px solid #888",
  349. padding: "2px",
  350. fontSize: "15px"
  351. }, k.style);
  352. j.appendChild(k)
  353. }
  354. var f = b.createElement("div");
  355. f.style.textAlign = "center";
  356. var g = b.createElement("h3");
  357. g.appendChild(b.createTextNode("Share a link to this channel with friends."));
  358. f.appendChild(g);
  359. g = b.createElement("h3");
  360. g.appendChild(b.createTextNode("Email, facebook, anywhere."));
  361. f.appendChild(g);
  362. g = b.createElement("form");
  363. g.style.textAlign = "center";
  364. f.appendChild(g);
  365. g.onsubmit = function() {
  366. return false
  367. };
  368. var h = b.createElement("table");
  369. h.style.margin = "auto";
  370. h.style.marginTop = "24px";
  371. h.style.fontSize = "15px";
  372. g.appendChild(h);
  373. g = "http://chat.mibbit.com/?channel=" + encodeURIComponent(d) + "&server=" + encodeURIComponent(c);
  374. e("Mibbit link:", g);
  375. if (d.substring(0, 1) == "#") d = d.substring(1, d.length);
  376. e("IRC:// link:", "irc://" + c + "/" + encodeURIComponent(d));
  377. return f
  378. }
  379. };
  380. var E = {};
  381. E.g = function(b) {
  382. if (!E[F.language] || !E[F.language][b]) return E.en[b];
  383. return E[F.language][b]
  384. };
  385. window.DisplayStrings = E;
  386. Adverts = {};
  387. Adverts.oe = 0;
  388. Adverts.nf = 0;
  389. Adverts.Ug = function(b, c) {
  390. if (Adverts.R) {
  391. Adverts.R.style.left = b + "px";
  392. Adverts.R.style.right = b + "px";
  393. Adverts.R.style.top = c + "px"
  394. }
  395. Adverts.oe = b;
  396. Adverts.nf = c
  397. };
  398. Adverts.Ee = function(b) {
  399. if (!G.ye) {
  400. !Adverts.R && b && Adverts.create();
  401. if (Adverts.R) u({
  402. position: "absolute",
  403. zIndex: "200",
  404. display: b ? "block" : "none"
  405. }, Adverts.R.style)
  406. }
  407. };
  408. Adverts.fe = function() {
  409. if (Adverts.R) {
  410. if (Adverts.Od) {
  411. window.clearInterval(Adverts.Od);
  412. Adverts.Od = null
  413. }
  414. document.body.removeChild(Adverts.R);
  415. Adverts.R = null
  416. }
  417. };
  418. Adverts.create = function() {
  419. if (!Adverts.sh) {
  420. if (document.body.clientWidth - F.cgmMargins * 2 < 728) {
  421. Adverts.height = 60;
  422. Adverts.width = 468
  423. } else {
  424. Adverts.height = 90;
  425. Adverts.width = 728
  426. }
  427. Adverts.R = document.createElement("div");
  428. Adverts.R.style.left = Adverts.oe + "px";
  429. Adverts.R.style.right = Adverts.oe + "px";
  430. Adverts.R.style.top = Adverts.nf + "px";
  431. Adverts.R.style.textAlign = "center";
  432. Adverts.R.style.overflow = "hidden";
  433. Adverts.R.style.width = Adverts.width;
  434. Adverts.R.style.height = Adverts.height;
  435. document.body.appendChild(Adverts.R);
  436. var b =
  437. document.createElement("iframe");
  438. Adverts.R.appendChild(b);
  439. u({
  440. border: "0",
  441. overflow: "hidden",
  442. margin: "0",
  443. width: Adverts.width + "px",
  444. height: Adverts.height + "px"
  445. }, b.style);
  446. b.setAttribute("framespacing", "0");
  447. b.setAttribute("frameborder", "no");
  448. b.setAttribute("scrolling", "no");
  449. if (Adverts.width == 728) {
  450. b.id = "a09d0787";
  451. b.name = "a09d0787";
  452. b.src = "http://a.mibbit.com/www/delivery/afr.php?refresh=180&zoneid=2&target=_blank&cb=" + Math.random();
  453. var c = document.createElement("a");
  454. c.href = "http://a.mibbit.com/www/delivery/ck.php?n=a9e8eb92&cb=" +
  455. Math.random();
  456. c.target = "_blank";
  457. var d = document.createElement("img");
  458. d.border = "0";
  459. d.src = "http://a.mibbit.com/www/delivery/avw.php?zoneid=2&n=a9e8eb92&cb=" + Math.random();
  460. b.appendChild(c);
  461. c.appendChild(d)
  462. } else if (Adverts.width == 468) {
  463. b.id = "ac1aff38";
  464. b.name = "ac1aff38";
  465. b.src = "http://a.mibbit.com/www/delivery/afr.php?refresh=180&zoneid=3&target=_blank&cb=" + Math.random();
  466. c = document.createElement("a");
  467. c.href = "http://a.mibbit.com/www/delivery/ck.php?n=a13e2b62&cb=" + Math.random();
  468. c.target = "_blank";
  469. d = document.createElement("img");
  470. d.border = "0";
  471. d.src = "http://a.mibbit.com/www/delivery/avw.php?zoneid=3&n=a13e2b62&cb=" + Math.random();
  472. b.appendChild(c);
  473. c.appendChild(d)
  474. }
  475. x && A("Adverts.create", "using an iframe", K)
  476. }
  477. };
  478.  
  479. function ga(b, c, d, e) {
  480. this.B = b;
  481. this.d = b.ownerDocument;
  482. this.fd = c;
  483. this.a = d;
  484. u({
  485. background: this.a.ulistPaneBackground,
  486. border: "1px solid " + this.a.ulistPaneBorder,
  487. borderRadius: this.a.ulistPaneRounding + "px",
  488. MozBorderRadius: this.a.ulistPaneRounding + "px",
  489. WebkitBorderRadius: this.a.ulistPaneRounding + "px",
  490. padding: this.a.ulistPaneRounding + "px",
  491. userSelect: "none",
  492. MozUserSelect: "none",
  493. WebkitUserSelect: "none"
  494. }, this.B.style);
  495. this.xe = [];
  496. this.Ab = "icon";
  497. ia(this);
  498. this.clear();
  499. if (!e) this.Od = window.setInterval(function(f) {
  500. return function() {
  501. for (var g in f.c) f.c.hasOwnProperty(g) &&
  502. ja(f.c[g]) && la(f, g)
  503. }
  504. }(this), 1E4)
  505. }
  506. ga.prototype.fe = function() {
  507. window.clearInterval(this.Od)
  508. };
  509.  
  510. function ia(b) {
  511. b.yc = [];
  512. for (var c = 0; c < b.a.userListGroups.length; c++) b.yc.push(new ma(b.B, b.a.userListGroups[c], b.a.userListSort, b.a))
  513. }
  514. ga.prototype.clear = function() {
  515. na(this);
  516. for (var b in this.c) this.c.hasOwnProperty(b) && oa(this, this.c[b]);
  517. this.c = {};
  518. delete this.V
  519. };
  520.  
  521. function pa(b, c) {
  522. for (var d = 0; d < b.yc.length; d++)
  523. if (qa(c, b.yc[d].dg)) return b.yc[d];
  524. return false
  525. }
  526. ga.prototype.z = function() {
  527. na(this);
  528. for (var b in this.c)
  529. if (this.c.hasOwnProperty(b)) {
  530. this.c[b].z();
  531. oa(this, this.c[b])
  532. }
  533. for (; this.B.firstChild;) this.B.removeChild(this.B.firstChild);
  534. ia(this);
  535. for (b in this.c) this.c.hasOwnProperty(b) && ra(this, this.c[b]);
  536. u({
  537. background: this.a.ulistPaneBackground,
  538. border: "1px solid " + this.a.ulistPaneBorder,
  539. borderRadius: this.a.ulistPaneRounding + "px",
  540. MozBorderRadius: this.a.ulistPaneRounding + "px",
  541. WebkitBorderRadius: this.a.ulistPaneRounding + "px",
  542. padding: this.a.ulistPaneRounding +
  543. "px"
  544. }, this.B.style)
  545. };
  546.  
  547. function sa(b, c, d) {
  548. b.xe.push({
  549. type: c,
  550. Ke: d
  551. })
  552. }
  553. ga.prototype.size = function() {
  554. for (var b = 0, c = 0; c < this.yc.length; c++) b += this.yc[c].Rc;
  555. return b
  556. };
  557.  
  558. function oa(b, c) {
  559. b.V ? sa(b, "remove", c) : c.lf.nc(c)
  560. }
  561.  
  562. function la(b, c) {
  563. if (b.V) sa(b, "refresh", c);
  564. else {
  565. oa(b, b.c[c]);
  566. ra(b, b.c[c])
  567. }
  568. }
  569.  
  570. function ra(b, c) {
  571. if (b.V) sa(b, "add", c);
  572. else {
  573. c.lf = pa(b, c);
  574. c.lf.kd(c)
  575. }
  576. }
  577. ga.prototype.kd = function(b) {
  578. var c = {};
  579. c.click = function(d) {
  580. return function(e) {
  581. ta(d, e);
  582. return false
  583. }
  584. }(this);
  585. c.Bg = function(d) {
  586. return function(e) {
  587. if (!d.V || d.V != e) ua(e, true)
  588. }
  589. }(this);
  590. c.Ag = function(d) {
  591. return function(e) {
  592. if (!d.V || d.V != e) ua(e, false)
  593. }
  594. }(this);
  595. c.de = function(d) {
  596. return function() {
  597. if (d.Ab == "icon") d.Ab = "flag";
  598. else if (d.Ab == "flag") d.Ab = "time";
  599. else if (d.Ab == "time") d.Ab = "icon";
  600. var e = {};
  601. e[d.Ab] = true;
  602. for (var f in d.c) d.c.hasOwnProperty(f) && va(d.c[f], e)
  603. }
  604. }(this);
  605. b = new wa(b.id, b, this.d, this.a, c);
  606. c = {};
  607. c[this.Ab] =
  608. true;
  609. va(b, c);
  610. typeof this.c[b.yb] != "undefined" && this.nc(b.yb);
  611. ra(this, b);
  612. this.c[b.yb] = b
  613. };
  614. ga.prototype.nc = function(b) {
  615. if (typeof this.c[b] == "undefined") return false;
  616. this.V && this.V == this.c[b] && delete this.V;
  617. oa(this, this.c[b]);
  618. delete this.c[b];
  619. return true
  620. };
  621.  
  622. function za(b, c, d) {
  623. if (typeof b.c[c] == "undefined") return false;
  624. b.c[c].setActive(d);
  625. la(b, c);
  626. return true
  627. }
  628.  
  629. function Aa(b, c) {
  630. if (typeof b.c[c] == "undefined") return false;
  631. var d = b.c[c];
  632. d.Sa = true;
  633. d.Ha = Math.floor((new Date).getTime() / 1E3);
  634. if (d.a.userListBoldOnChat) d.Sb.style.fontWeight = "bold";
  635. Ba(d, d.description);
  636. la(b, c);
  637. return true
  638. }
  639.  
  640. function Ca(b, c, d, e) {
  641. if (typeof b.c[c] == "undefined") return false;
  642. Da(b.c[c], d, e);
  643. la(b, c);
  644. return true
  645. }
  646.  
  647. function Ea(b, c, d) {
  648. if (typeof b.c[c] == "undefined") return false;
  649. var e = b.c[c];
  650. e.h = d;
  651. e.Sb.firstChild.nodeValue = d;
  652. b.nc(c);
  653. e.yb = d;
  654. ra(b, e);
  655. b.c[e.yb] = e;
  656. return true
  657. }
  658.  
  659. function Fa(b, c, d) {
  660. if (typeof b.c[c] == "undefined") return false;
  661. b.c[c].ac(d);
  662. return true
  663. }
  664.  
  665. function ta(b, c) {
  666. if (b.V && b.V == c) {
  667. (new Date).getTime() - b.Ng < b.a.doubleClickTime && b.a.doubleClickToPM && b.fd(c.yb, "usermenu0");
  668. na(b);
  669. b.fd(c.yb, "closed")
  670. } else {
  671. b.Ng = (new Date).getTime();
  672. na(b);
  673. b.V = c;
  674. var d = b.d.createElement("div");
  675. c.B.onmouseout = function(h) {
  676. return function(k) {
  677. k || (k = event);
  678. for (k = k.relatedTarget || k.toElement; k != null && k != document.body;) {
  679. if (k == c.B) return;
  680. k = k.parentNode
  681. }
  682. h.Db && window.clearTimeout(h.Db);
  683. h.Db = window.setTimeout(function() {
  684. na(h)
  685. }, h.a.userListMenuAutoCloseTime)
  686. }
  687. }(b);
  688. c.B.onmouseover =
  689. function(h) {
  690. return function() {
  691. if (h.Db) {
  692. window.clearTimeout(h.Db);
  693. delete h.Db
  694. }
  695. }
  696. }(b);
  697. u({
  698. background: b.a.userListMenuBackground,
  699. borderBottom: "1px solid #444",
  700. padding: "2px"
  701. }, d.style);
  702. for (var e = b.fd(c.yb, "getoptions"), f = 0; f < e.length; f++) {
  703. var g = b.d.createElement("div");
  704. g.onclick = function(h, k) {
  705. return function() {
  706. h.fd && h.fd(c.yb, k);
  707. na(h)
  708. }
  709. }(b, e[f].id);
  710. g.appendChild(b.d.createTextNode(e[f].desc));
  711. u({
  712. cursor: "pointer",
  713. color: b.a.userListMenuColor,
  714. overflow: "hidden",
  715. whiteSpace: "nowrap",
  716. fontSize: b.a.userListMenuFontSize +
  717. "px",
  718. fontFamily: b.a.userListMenuFontFamily,
  719. textDecoration: "none",
  720. paddingLeft: "2px",
  721. paddingRight: "2px"
  722. }, g.style);
  723. if (f != e.length - 1) g.style.borderBottom = "1px solid #aaa";
  724. if (b.a.userListMenuBackgroundHover) {
  725. g.onmouseover = function(h, k) {
  726. return function() {
  727. h.style.background = k
  728. }
  729. }(g, b.a.userListMenuBackgroundHover);
  730. g.onmouseout = function(h, k) {
  731. return function() {
  732. h.style.background = k
  733. }
  734. }(g, b.a.userListMenuBackground)
  735. }
  736. d.appendChild(g)
  737. }
  738. c.B.appendChild(d);
  739. window.setTimeout(function(h, k) {
  740. return function() {
  741. var l = k.B.offsetTop +
  742. k.B.offsetHeight,
  743. j = h.clientHeight;
  744. if (k.B.offsetTop < h.scrollTop) h.scrollTop = k.B.offsetTop;
  745. if (l > h.scrollTop + j) h.scrollTop = l - j
  746. }
  747. }(b.B, c), 50);
  748. c.K.style.background = b.a.userListSelected
  749. }
  750. }
  751.  
  752. function na(b) {
  753. if (b.V) {
  754. ua(b.V, false);
  755. b.V.B.removeChild(b.V.B.lastChild);
  756. b.V.B.onmouseover = null;
  757. b.V.B.onmouseout = null;
  758. if (b.Db) {
  759. window.clearTimeout(b.Db);
  760. delete b.Db
  761. }
  762. delete b.V
  763. }
  764. for (; b.xe.length > 0;) {
  765. var c = b.xe.shift();
  766. if (c.type == "add") ra(b, c.Ke);
  767. else if (c.type == "remove") oa(b, c.Ke);
  768. else c.type == "refresh" && la(b, c.Ke)
  769. }
  770. }
  771.  
  772. function ma(b, c, d, e) {
  773. this.dg = c.def;
  774. this.title = c.title;
  775. this.og = c.hideOnEmpty;
  776. this.Yg = c.startHidden;
  777. this.a = e;
  778. this.Xg = d;
  779. this.Rc = 0;
  780. this.xb = [];
  781. this.vb = true;
  782. this.Y = b.ownerDocument.createElement("div");
  783. this.pd = b.ownerDocument.createElement("div");
  784. if (this.title != "") {
  785. this.Pd = b.ownerDocument.createElement("div");
  786. u({
  787. fontFamily: this.a.userGroupFontFamily,
  788. fontSize: this.a.userGroupFontSize + "px",
  789. color: this.a.userGroupColor,
  790. background: this.a.userGroupBackground,
  791. textAlign: "center",
  792. cursor: "pointer",
  793. userSelect: "none",
  794. MozUserSelect: "none",
  795. WebkitUserSelect: "none"
  796. }, this.Pd.style);
  797. this.Pd.onclick = function(f) {
  798. return function() {
  799. f.vb = !f.vb;
  800. f.Y.style.display = f.vb ? "block" : "none";
  801. Ga(f);
  802. return false
  803. }
  804. }(this);
  805. this.He = b.ownerDocument.createTextNode(this.title);
  806. this.Pd.appendChild(this.He);
  807. this.pd.appendChild(this.Pd)
  808. }
  809. this.pd.appendChild(this.Y);
  810. this.update();
  811. if (this.Yg) {
  812. this.vb = false;
  813. this.Y.style.display = "none"
  814. }
  815. b.appendChild(this.pd)
  816. }
  817.  
  818. function Ga(b) {
  819. if (b.He) b.He.nodeValue = b.vb ? b.title : b.title + " (" + b.Rc + ")"
  820. }
  821. ma.prototype.update = function() {
  822. Ga(this);
  823. this.pd.style.display = this.Rc == 0 && this.og ? "none" : "block"
  824. };
  825. ma.prototype.nc = function(b) {
  826. this.Y.removeChild(b.B);
  827. for (var c = 0; c < this.xb.length; c++)
  828. if (this.xb[c] == b) {
  829. this.Rc--;
  830. this.xb.splice(c, 1);
  831. break
  832. }
  833. this.update()
  834. };
  835. ma.prototype.kd = function(b) {
  836. var c = Ha(this.xb, this.Xg, b, 0, this.xb.length);
  837. this.Rc++;
  838. if (c == this.xb.length) {
  839. this.Y.appendChild(b.B);
  840. this.xb.push(b)
  841. } else {
  842. this.Y.insertBefore(b.B, this.xb[c].B);
  843. this.xb.splice(c, 0, b)
  844. }
  845. this.update()
  846. };
  847.  
  848. function wa(b, c, d, e, f) {
  849. this.a = e;
  850. this.ca = f;
  851. this.d = d;
  852. this.yb = b;
  853. this.h = c.nick;
  854. this.P = c.icon;
  855. this.description = c.desc;
  856. this.sd = c.ci;
  857. this.Ic = c.countrycode;
  858. if (typeof c.localtime != "undefined") this.te = parseInt(c.localtime) - (new Date).getTime();
  859. this.Ge = c.timezone;
  860. this.dc = {
  861. icon: true,
  862. country: false,
  863. time: false
  864. };
  865. this.wc = false;
  866. this.pa = c.modes.active;
  867. this.Ha = -1;
  868. if (c.idleTime != -1) this.Ha = Math.floor((new Date).getTime() / 1E3) - c.idleTime;
  869. Ia(this);
  870. this.sa = {
  871. owner: c.modes.owner,
  872. admin: c.modes.admin,
  873. op: c.modes.op,
  874. halfop: c.modes.halfop,
  875. voice: c.modes.voice
  876. };
  877. this.ma = {};
  878. this.B = this.d.createElement("div");
  879. this.K = this.d.createElement("div");
  880. this.B.appendChild(this.K);
  881. this.z()
  882. }
  883.  
  884. function Ia(b) {
  885. b.Sa = b.Ha == -1 ? false : (new Date).getTime() / 1E3 - b.Ha < b.a.userListChattingTime
  886. }
  887.  
  888. function va(b, c) {
  889. b.dc = c;
  890. if (b.ga) b.ga.style.display = b.dc.time ? "inline" : "none";
  891. if (b.Wa) b.Wa.style.display = b.dc.flag ? "inline" : "none";
  892. if (b.ja) b.ja.style.display = b.dc.icon ? "inline" : "none"
  893. }
  894.  
  895. function ua(b, c) {
  896. b.K.style.background = c ? b.a.userListHover : "transparent"
  897. }
  898. wa.prototype.z = function() {
  899. for (; this.K.firstChild;) this.K.removeChild(this.K.firstChild);
  900. this.K.onmouseover = function(c) {
  901. return function() {
  902. c.ca.Bg(c)
  903. }
  904. }(this);
  905. this.K.onmouseout = function(c) {
  906. return function() {
  907. c.ca.Ag(c)
  908. }
  909. }(this);
  910. delete this.ga;
  911. delete this.Wa;
  912. delete this.ja;
  913. delete this.Xb;
  914. delete this.Ka;
  915. this.ga = this.d.createElement("img");
  916. u({
  917. marginRight: "2px",
  918. verticalAlign: this.a.userListIconAlign,
  919. display: this.dc.time ? "inline" : "none"
  920. }, this.ga.style);
  921. this.ga.onclick = function(c) {
  922. return function() {
  923. c.ca.de();
  924. return false
  925. }
  926. }(this);
  927. Ja(this);
  928. this.Wa = this.d.createElement("img");
  929. u({
  930. marginRight: "2px",
  931. verticalAlign: this.a.userListIconAlign,
  932. display: this.dc.flag ? "inline" : "none"
  933. }, this.Wa.style);
  934. this.Wa.onclick = function(c) {
  935. return function() {
  936. c.ca.de();
  937. return false
  938. }
  939. }(this);
  940. if (this.Ic) this.Wa.title = this.Ic;
  941. D(this.Wa, this.Ic ? "https://s3.amazonaws.com/mibbit/flags/" + this.Ic.toLowerCase() + ".png" : "https://s3.amazonaws.com/mibbit/gfx/mode_none.png", this.a.userListIconWidth, this.a.userListIconHeight);
  942. if (this.P && this.a.userListShowIcons) {
  943. this.ja =
  944. this.d.createElement("img");
  945. this.ja.style.marginRight = "2px";
  946. this.ja.style.display = this.dc.icon ? "inline" : "none";
  947. this.ja.onclick = function(c) {
  948. return function() {
  949. c.ca.de();
  950. return false
  951. }
  952. }(this);
  953. Ka(this, this.P)
  954. } else delete this.ja;
  955. this.K.onclick = function(c) {
  956. return function(d) {
  957. if (!d) d = window.event;
  958. d = d.target ? d.target : d.srcElement;
  959. if (!(d == c.ga || d == c.Wa || d == c.ja)) {
  960. c.ca.click(c);
  961. return false
  962. }
  963. }
  964. }(this);
  965. this.Sb = this.d.createElement("span");
  966. u({
  967. fontFamily: this.a.userListFontFamily,
  968. fontSize: this.a.userListFontSize +
  969. "px",
  970. cursor: "pointer",
  971. whiteSpace: "nowrap"
  972. }, this.Sb.style);
  973. this.Sb.appendChild(this.d.createTextNode(this.h));
  974. if (this.a.userListShowPrefixChars) {
  975. this.Xb = this.d.createElement("span");
  976. u({
  977. fontFamily: this.a.userListFontFamily,
  978. fontSize: this.a.userListFontSize + "px",
  979. color: this.a.userListColorNormal,
  980. fontWeight: "bold",
  981. cursor: "pointer"
  982. }, this.Xb.style)
  983. } else if (this.a.userListShowSingleMode) {
  984. this.Ka = this.d.createElement("img");
  985. this.Ka.style.verticalAlign = this.a.userListModeIconAlign;
  986. D(this.Ka, "https://s3.amazonaws.com/mibbit/gfx/mode_none.png",
  987. this.a.userListModeIconWidth, this.a.userListModeIconHeight)
  988. }
  989. this.ja && this.K.appendChild(this.ja);
  990. this.Wa && this.K.appendChild(this.Wa);
  991. this.ga && this.K.appendChild(this.ga);
  992. this.Xb && this.K.appendChild(this.Xb);
  993. if (this.Ka && this.a.userListShowModesLeft) {
  994. this.K.appendChild(this.Ka);
  995. this.Ka.style.paddingRight = this.a.userListModeSpacing + "px"
  996. }
  997. this.K.appendChild(this.Sb);
  998. if (this.Ka && !this.a.userListShowModesLeft) {
  999. this.K.appendChild(this.Ka);
  1000. this.Ka.style.paddingLeft = this.a.userListModeSpacing + "px"
  1001. }
  1002. this.K.style.whiteSpace =
  1003. "nowrap";
  1004. this.K.style.padding = this.a.userListPadding + "px";
  1005. Ba(this, this.description);
  1006. this.ma = {};
  1007. for (var b = 0; b < L.length; b++) Da(this, L[b], this.sa[L[b]]);
  1008. this.B.style.overflow = "hidden";
  1009. this.tb()
  1010. };
  1011.  
  1012. function La(b, c, d) {
  1013. d = d.split(",");
  1014. for (var e = 0; e < d.length; e++) {
  1015. var f = d[e];
  1016. if (f == "chatting") {
  1017. if (b.Sa != c.Sa) return b.Sa && !c.Sa ? -1 : 1
  1018. } else if (f == "active") {
  1019. if (b.pa != c.pa) return b.pa && !c.pa ? -1 : 1
  1020. } else if (f == "owner" || f == "admin" || f == "op" || f == "halfop" || f == "voice")
  1021. if (b.sa[f] != c.sa[f]) return b.sa[f] && !c.sa[f] ? -1 : 1
  1022. }
  1023. if (b.h.toLowerCase() > c.h.toLowerCase()) return 1;
  1024. if (b.h.toLowerCase() < c.h.toLowerCase()) return -1;
  1025. return 0
  1026. }
  1027.  
  1028. function Ha(b, c, d, e, f) {
  1029. var g = f - e;
  1030. if (g == 0) return f;
  1031. if (g == 1) {
  1032. if (La(d, b[e], c) > 0) return f;
  1033. return e
  1034. }
  1035. if (g == 2) return La(d, b[e], c) > 0 ? La(d, b[f - 1], c) > 0 ? f : f - 1 : e;
  1036. g = Math.floor((e + f) / 2);
  1037. var h = La(d, b[g], c);
  1038. if (h < 0) return Ha(b, c, d, e, g);
  1039. else if (h == 0) return g;
  1040. else if (h > 0) return Ha(b, c, d, g, f)
  1041. }
  1042.  
  1043. function qa(b, c) {
  1044. c = c.split(",");
  1045. for (var d = 0; d < c.length; d++) {
  1046. var e = c[d],
  1047. f = true;
  1048. if (e.substring(0, 1) == "!") {
  1049. e = e.substring(1, e.length);
  1050. f = false
  1051. }
  1052. if (e == "chatting") {
  1053. if (b.Sa != f) return false
  1054. } else if (e == "active") {
  1055. if (b.pa != f) return false
  1056. } else if (e == "owner" || e == "admin" || e == "op" || e == "halfop" || e == "voice")
  1057. if (b.sa[e] != f) return false
  1058. }
  1059. return true
  1060. }
  1061.  
  1062. function ja(b) {
  1063. Ja(b);
  1064. var c = b.Sb.style,
  1065. d = b.Sa;
  1066. Ia(b);
  1067. if (b.a.userListBoldOnChat) c.fontWeight = b.Sa ? "bold" : "normal";
  1068. Ba(b, b.description);
  1069. return d != b.Sa
  1070. }
  1071.  
  1072. function Ja(b) {
  1073. function c(k) {
  1074. return ("00" + k).substr(-2)
  1075. }
  1076. if (b.ga)
  1077. if (typeof b.te == "undefined" || typeof b.Ge == "undefined") {
  1078. b.ga.title = "";
  1079. D(b.ga, "https://s3.amazonaws.com/mibbit/gfx/mode_none.png", 16, 16)
  1080. } else {
  1081. var d = new Date(b.te + (new Date).getTime()),
  1082. e = d.getUTCHours() + ":" + c(d.getUTCMinutes()) + ":" + c(d.getUTCSeconds()),
  1083. f = "+",
  1084. g = b.Ge;
  1085. if (g < 0) {
  1086. f = "-";
  1087. g = -g
  1088. }
  1089. var h = Math.floor(g / 60);
  1090. g = g - 60 * h;
  1091. b.ga.title = e + " UTC" + f + c(h) + c(g);
  1092. d = d.getUTCHours();
  1093. if (d > 22 || d < 8) D(b.ga, "https://s3.amazonaws.com/mibbit/gfx/night.png", b.a.userListIconWidth,
  1094. b.a.userListIconHeight);
  1095. else if (d >= 8 && d < 12) D(b.ga, "https://s3.amazonaws.com/mibbit/gfx/morning.png", b.a.userListIconWidth, b.a.userListIconHeight);
  1096. else if (d >= 12 && d < 18) D(b.ga, "https://s3.amazonaws.com/mibbit/gfx/day.png", b.a.userListIconWidth, b.a.userListIconHeight);
  1097. else d >= 18 && d <= 22 && D(b.ga, "https://s3.amazonaws.com/mibbit/gfx/evening.png", b.a.userListIconWidth, b.a.userListIconHeight)
  1098. }
  1099. }
  1100. wa.prototype.tb = function() {
  1101. var b = this.Sb.style;
  1102. if (this.a.userListBoldOnChat) b.fontWeight = this.Sa ? "bold" : "normal";
  1103. b.color = this.pa ? this.wc && this.a.userListColorTyping != "" ? this.a.userListColorTyping : this.a.ciUserListColorNormal && this.sd && this.sd.userListColorNormal ? this.sd.userListColorNormal : this.a.userListColorNormal : this.a.userListColorInactive
  1104. };
  1105.  
  1106. function Ka(b, c) {
  1107. b.P = c;
  1108. if (b.ja) {
  1109. b.ja.style.verticalAlign = b.a.userListIconAlign;
  1110. if (b.P.name) {
  1111. c = b.a["ulicon_" + b.P.name];
  1112. if (Ma && typeof DATA_URLS != "undefined" && DATA_URLS[c]) c = DATA_URLS[c];
  1113. D(b.ja, c, b.a.userListIconWidth, b.a.userListIconHeight)
  1114. } else D(b.ja, b.P.src, b.a.userListIconWidth, b.a.userListIconHeight);
  1115. if (b.P.title) b.ja.title = b.P.title
  1116. }
  1117. }
  1118.  
  1119. function Ba(b, c) {
  1120. var d = b.description = c;
  1121. if (b.Ha != -1) {
  1122. d = Math.floor((new Date).getTime() / 1E3) - b.Ha;
  1123. d = d < 60 ? "(" + d + "s) " + c : d < 3600 ? "(" + Math.floor(d / 60) + "m) " + c : "(" + Math.floor(d / 3600) + "h) " + c
  1124. }
  1125. b.K.setAttribute("title", d)
  1126. }
  1127. wa.prototype.ac = function(b) {
  1128. this.wc = b;
  1129. this.tb()
  1130. };
  1131. wa.prototype.setActive = function(b) {
  1132. this.pa = b;
  1133. this.tb()
  1134. };
  1135.  
  1136. function Da(b, c, d) {
  1137. b.sa[c] = d;
  1138. if (b.a.userListShowPrefixChars) {
  1139. var e = "";
  1140. if (b.a.userListShowSingleMode)
  1141. for (f = 0; f < L.length; f++) {
  1142. c = L[f];
  1143. if (b.sa[c]) {
  1144. d = Na(b, c, true);
  1145. if (d.length > 0) e = d.substring(0, 1);
  1146. break
  1147. }
  1148. } else
  1149. for (var f = 0; f < L.length; f++) {
  1150. c = L[f];
  1151. if (b.sa[c]) {
  1152. d = Na(b, c, true);
  1153. if (d.length > 0) e += d.substring(0, 1)
  1154. }
  1155. }
  1156. if (b.Xb.firstChild) b.Xb.firstChild.nodeValue = e;
  1157. else b.Xb.appendChild(b.d.createTextNode(e))
  1158. } else if (b.a.userListShowSingleMode) {
  1159. d = "";
  1160. e = "none";
  1161. for (f = 0; f < L.length; f++) {
  1162. c = L[f];
  1163. if (b.sa[c]) {
  1164. if (e == "none") e = c;
  1165. if (d != "") d += ", ";
  1166. d += Oa(b, c)
  1167. }
  1168. }
  1169. f = Na(b, e);
  1170. D(b.Ka, f, b.a.userListModeIconWidth, b.a.userListModeIconHeight);
  1171. b.Ka.title = d
  1172. } else {
  1173. if (d && !b.ma[c]) {
  1174. b.ma[c] = b.d.createElement("img");
  1175. b.ma[c].style.verticalAlign = b.a.userListModeIconAlign;
  1176. f = Na(b, c);
  1177. D(b.ma[c], f, b.a.userListModeIconWidth, b.a.userListModeIconHeight);
  1178. b.ma[c].title = Oa(b, c);
  1179. b.ma[c].style.paddingLeft = b.a.userListModeSpacing + "px";
  1180. e = null;
  1181. var g = false;
  1182. for (f = 0; f < L.length; f++) {
  1183. if (g && b.ma[L[f]]) e = b.ma[L[f]];
  1184. if (L[f] == c) g = true
  1185. }
  1186. e != null ? b.K.insertBefore(b.ma[c], e) :
  1187. b.K.appendChild(b.ma[c])
  1188. }
  1189. if (!d && b.ma[c]) {
  1190. b.K.removeChild(b.ma[c]);
  1191. delete b.ma[c]
  1192. }
  1193. }
  1194. }
  1195.  
  1196. function Na(b, c) {
  1197. var d = "https://s3.amazonaws.com/mibbit/gfx/mode_none.png";
  1198. if (c == "owner") d = b.a.iconModeOwner;
  1199. else if (c == "admin") d = b.a.iconModeAdmin;
  1200. else if (c == "op") d = b.a.iconModeOp;
  1201. else if (c == "halfop") d = b.a.iconModeHalfop;
  1202. else if (c == "voice") d = b.a.iconModeVoice;
  1203. return d
  1204. }
  1205.  
  1206. function Oa(b, c) {
  1207. if (c == "owner") return E.g("ModeOwner");
  1208. else if (c == "admin") return E.g("ModeAdmin");
  1209. else if (c == "op") return E.g("ModeOp");
  1210. else if (c == "halfop") return E.g("ModeHalfop");
  1211. else if (c == "voice") return E.g("ModeVoice");
  1212. return ""
  1213. }
  1214. var L = ["owner", "admin", "op", "halfop", "voice"];
  1215.  
  1216. function Pa(b, c, d, e, f) {
  1217. this.p = b;
  1218. this.d = b.ownerDocument;
  1219. this.a = c;
  1220. this.ca = e;
  1221. this.Ad = f;
  1222. this.Aa = [];
  1223. this.ib = this.zf = this.Dd = 10;
  1224. this.h = "";
  1225. this.p.style.border = "1px solid " + this.a.chatInputBarBorder;
  1226. this.p.style.background = this.a.chatInputBarBackground;
  1227. this.ha = this.d.createElement("div");
  1228. u({
  1229. padding: this.a.chatInputPadding + "px",
  1230. margin: this.a.chatInputSpacing + "px",
  1231. overflow: "hidden"
  1232. }, this.ha.style);
  1233. this.ea = this.d.createElement("input");
  1234. this.ea.setAttribute("type", "text");
  1235. u({
  1236. width: "100%",
  1237. padding: "0",
  1238. border: "0",
  1239. margin: "0",
  1240. outline: "0"
  1241. }, this.ea.style);
  1242. this.ha.appendChild(d);
  1243. d.appendChild(this.ea);
  1244. this.ta = this.d.createElement("div");
  1245. this.Hb = this.d.createElement("span");
  1246. this.Hb.style.cursor = "pointer";
  1247. this.Hb.onclick = function(g) {
  1248. return function() {
  1249. e.tf(g)
  1250. }
  1251. }(this);
  1252. this.Hb.appendChild(this.d.createTextNode(""));
  1253. this.ta.appendChild(this.Hb);
  1254. u({
  1255. height: 2 + this.ib + "px",
  1256. top: this.a.chatInputSpacing + "px",
  1257. left: this.a.chatInputSpacing + "px"
  1258. }, this.ta.style);
  1259. u({
  1260. position: "absolute",
  1261. textAlign: "right",
  1262. paddingTop: this.a.chatInputPadding +
  1263. "px",
  1264. paddingBottom: this.a.chatInputPadding + "px"
  1265. }, this.ta.style);
  1266. u({
  1267. fontFamily: this.a.chatInputFontFamily,
  1268. fontSize: this.a.chatInputFontSize + "px",
  1269. color: this.a.chatInputNickColor
  1270. }, this.ta.style);
  1271. this.ta.style.display = this.a.chatInputShowNick ? "block" : "none";
  1272. this.La = this.d.createElement("div");
  1273. this.La.appendChild(this.ha);
  1274. this.La.appendChild(this.ta);
  1275. b.appendChild(this.La);
  1276. b.style.position = "relative";
  1277. this.da = new Qa(d, this.ea, this.a.inputHistorySize, true, e.ig);
  1278. this.da.xc = e.xc;
  1279. this.v = {
  1280. content: this.La,
  1281. Gb: null
  1282. };
  1283. this.z();
  1284. this.C()
  1285. }
  1286. Pa.prototype.uc = function(b) {
  1287. for (this.h = b; this.Hb.firstChild;) this.Hb.removeChild(this.Hb.firstChild);
  1288. this.Hb.appendChild(this.d.createTextNode(b + " :"));
  1289. this.C()
  1290. };
  1291. Pa.prototype.z = function() {
  1292. try {
  1293. u({
  1294. padding: this.a.chatInputPadding + "px",
  1295. margin: this.a.chatInputSpacing + "px",
  1296. background: this.a.chatInputBackground,
  1297. border: "1px solid " + this.a.chatInputBorder
  1298. }, this.ha.style);
  1299. u({
  1300. background: this.a.chatInputBackground,
  1301. color: this.a.chatInputColor,
  1302. fontFamily: this.a.chatInputFontFamily,
  1303. fontSize: this.a.chatInputFontSize + "px"
  1304. }, this.ea.style);
  1305. u({
  1306. borderRadius: this.a.chatInputRounding + "px",
  1307. MozBorderRadius: this.a.chatInputRounding + "px",
  1308. WebkitBorderRadius: this.a.chatInputRounding +
  1309. "px",
  1310. color: this.a.colorInText,
  1311. background: this.a.chatInputBarBackground,
  1312. border: "1px solid " + this.a.chatInputBarBorder
  1313. }, this.p.style);
  1314. u({
  1315. position: "absolute",
  1316. top: this.a.chatInputSpacing + "px",
  1317. left: this.a.chatInputSpacing + "px"
  1318. }, this.ta.style);
  1319. u({
  1320. textAlign: "right",
  1321. paddingTop: this.a.chatInputPadding + "px",
  1322. paddingBottom: this.a.chatInputPadding + "px"
  1323. }, this.ta.style);
  1324. u({
  1325. fontFamily: this.a.chatInputFontFamily,
  1326. fontSize: this.a.chatInputFontSize + "px",
  1327. color: this.a.chatInputNickColor
  1328. }, this.ta.style);
  1329. this.ta.style.display =
  1330. this.a.chatInputShowNick ? "block" : "none";
  1331. Ra(this);
  1332. if (this.wb) {
  1333. this.p.removeChild(this.wb);
  1334. delete this.wb
  1335. }
  1336. if (this.fb) {
  1337. this.p.removeChild(this.fb);
  1338. delete this.fb
  1339. }
  1340. if (this.rb) {
  1341. this.p.removeChild(this.rb);
  1342. delete this.rb
  1343. }
  1344. if (this.nb) {
  1345. this.p.removeChild(this.nb);
  1346. delete this.nb
  1347. }
  1348. if (this.pb) {
  1349. this.p.removeChild(this.pb);
  1350. delete this.pb;
  1351. delete this.mb
  1352. }
  1353. delete this.sf;
  1354. Sa(this)
  1355. } catch (b) {
  1356. x && A("RichInputElement.redraw(2)", t(b), C)
  1357. }
  1358. };
  1359. Pa.prototype.C = function() {
  1360. try {
  1361. if (this.Ad) this.zf = this.mb.offsetHeight;
  1362. if (this.v.content == this.La) {
  1363. this.uf = this.ta.offsetWidth;
  1364. if (window.getComputedStyle) {
  1365. var b = window.getComputedStyle(this.ta, null).getPropertyValue("width");
  1366. if (b.substring(b.length - 2, b.length) == "px") this.uf = parseFloat(b.substring(0, b.length - 2))
  1367. }
  1368. }
  1369. b = false;
  1370. if (this.v.content == this.La && this.ea.offsetHeight != 0 && this.ea.offsetHeight != this.Dd) {
  1371. this.Dd = this.ea.offsetHeight;
  1372. this.ib = this.ha.offsetHeight;
  1373. if (window.getComputedStyle) {
  1374. var c = window.getComputedStyle(this.ea,
  1375. null).getPropertyValue("height");
  1376. if (c.substring(c.length - 2, c.length) == "px") this.Dd = parseFloat(c.substring(0, c.length - 2));
  1377. var d = window.getComputedStyle(this.ha, null).getPropertyValue("height");
  1378. if (d.substring(d.length - 2, d.length) == "px") this.ib = parseFloat(d.substring(0, d.length - 2))
  1379. }
  1380. b = true
  1381. }
  1382. if (this.a.chatInputShowNick && this.h != "") this.ha.style.marginLeft = this.a.chatInputSpacing * 2 + this.uf + "px";
  1383. this.ta.style.height = 2 + this.ib + "px";
  1384. return b
  1385. } catch (e) {
  1386. x && A("RichInputElement.layout", "Exception: " + t(e), C)
  1387. }
  1388. return false
  1389. };
  1390.  
  1391. function Ta(b, c) {
  1392. b.xf.nodeValue = c ? "TYPING" : ""
  1393. }
  1394. Pa.prototype.Va = function() {
  1395. var b = this.Dd;
  1396. b += this.a.chatInputPadding * 2;
  1397. b += this.a.chatInputSpacing * 2;
  1398. b += 2;
  1399. if (this.Ad) {
  1400. b += this.zf;
  1401. b += this.a.chatInputSpacing;
  1402. b += 2
  1403. }
  1404. return b
  1405. };
  1406. Pa.prototype.Ub = function(b) {
  1407. window.setTimeout(function(c) {
  1408. return function() {
  1409. c.da.Ub(b)
  1410. }
  1411. }(this), 100)
  1412. };
  1413.  
  1414. function Ra(b) {
  1415. if (b.v && b.v.content != b.La) {
  1416. Ua(b, {
  1417. content: b.La,
  1418. Gb: null
  1419. });
  1420. b.ea.focus();
  1421. window.setTimeout(function(c) {
  1422. return function() {
  1423. Va(c.da, c.Mg)
  1424. }
  1425. }(b), 10)
  1426. }
  1427. }
  1428.  
  1429. function Wa(b) {
  1430. var c = b.d.createTextNode(" | ");
  1431. b.mb.appendChild(c)
  1432. }
  1433.  
  1434. function Xa(b, c) {
  1435. b.v == b.Aa[c] ? Ra(b) : Ua(b, b.Aa[c]);
  1436. b.Aa[c].Gb.blur()
  1437. }
  1438.  
  1439. function Ua(b, c) {
  1440. if (c.content) {
  1441. if (b.v) {
  1442. b.v.content.style.display = "none";
  1443. if (b.v.Gb != null) b.v.Gb.style.color = b.a.colorInMenu;
  1444. b.v.mf && b.v.mf()
  1445. }
  1446. b.v = c;
  1447. if (b.v.Gb != null) b.v.Gb.style.color = b.a.colorInMenuActive;
  1448. b.v.content.style.display = "block";
  1449. b.v.content != b.La && u({
  1450. margin: b.a.chatInputSpacing + "px",
  1451. border: "1px solid " + b.a.chatInputBorder,
  1452. background: b.a.chatInputBackground,
  1453. height: b.ib + 2 * b.a.chatInputPadding + "px"
  1454. }, b.v.content.style);
  1455. b.v && b.v.Zc && b.v.Zc()
  1456. }
  1457. }
  1458.  
  1459. function Ya(b, c) {
  1460. if (b.Aa[c])
  1461. if (b.v == b.Aa[c]) Ra(b);
  1462. else {
  1463. if (b.v.content == b.La) b.Mg = Za(b.da);
  1464. Ua(b, b.Aa[c])
  1465. }
  1466. }
  1467.  
  1468. function $a(b, c, d) {
  1469. var e = null;
  1470. if (d == "/togglemenu smilies") e = "smilies";
  1471. if (d == "/togglemenu colors") e = "colors";
  1472. if (d == "/togglemenu pastebin") e = "pastebin";
  1473. if (d == "/togglemenu minify") e = "minify";
  1474. b.sf && Wa(b);
  1475. b.sf = true;
  1476. var f = b.d.createElement("span");
  1477. f.appendChild(b.d.createTextNode(c));
  1478. f.style.color = b.a.colorInMenu;
  1479. f.style.cursor = "pointer";
  1480. f.style.MozUserSelect = "none";
  1481. f.style.Re = "none";
  1482. f.onmouseover = function() {
  1483. this.style.textDecoration = "underline"
  1484. };
  1485. f.onmouseout = function() {
  1486. this.style.textDecoration = "none"
  1487. };
  1488. if (b.Aa[e]) b.Aa[e].Gb = f;
  1489. f.onclick = function(g) {
  1490. return function() {
  1491. g.ca.mc(d, c);
  1492. f.blur();
  1493. return false
  1494. }
  1495. }(b);
  1496. b.mb.appendChild(f)
  1497. }
  1498.  
  1499. function ab(b, c) {
  1500. var d = b.d.createElement("div");
  1501. d.style.padding = b.a.chatInputPadding + "px";
  1502. u({
  1503. color: b.a.colorInLinks,
  1504. styleFloat: "left",
  1505. cssFloat: "left",
  1506. marginLeft: "4px",
  1507. cursor: "pointer",
  1508. textDecoration: "underline",
  1509. fontFamily: b.a.chatInputFontFamily,
  1510. fontSize: b.a.chatInputFontSize + "px"
  1511. }, d.style);
  1512. d.appendChild(b.d.createTextNode(E.g("InputMenuClose")));
  1513. d.onclick = function(e) {
  1514. return function() {
  1515. Ra(e);
  1516. return false
  1517. }
  1518. }(b);
  1519. c.appendChild(d)
  1520. }
  1521.  
  1522. function bb(b) {
  1523. b.wb = b.d.createElement("div");
  1524. b.wb.style.display = "none";
  1525. b.wb.style.overflow = "hidden";
  1526. var c = {};
  1527. b.Md = [];
  1528. for (var d = 0; d < b.a.iconSmileys.length; d++) {
  1529. var e = b.a.iconSmileys[d];
  1530. if (!c[e.src] && e.src && e.code) {
  1531. c[e.src] = true;
  1532. var f = b.d.createElement("img");
  1533. b.Md.push(f);
  1534. u({
  1535. width: "10px",
  1536. height: "10px",
  1537. border: "1px solid #fff",
  1538. cssFloat: "left",
  1539. styleFloat: "left"
  1540. }, f.style);
  1541. f.src = F.iconSmileysBase + e.src;
  1542. f.onmouseover = function() {
  1543. this.style.border = "1px solid #000"
  1544. };
  1545. f.onmouseout = function() {
  1546. this.style.border =
  1547. "1px solid #fff"
  1548. };
  1549. f.onclick = function(g, h) {
  1550. return function() {
  1551. try {
  1552. g.Ub(h)
  1553. } catch (k) {
  1554. x && A("smiley click", k, C)
  1555. }
  1556. Ra(g)
  1557. }
  1558. }(b, e.code);
  1559. b.wb.appendChild(f)
  1560. }
  1561. }
  1562. b.p.appendChild(b.wb);
  1563. b.wg = function(g) {
  1564. return function() {
  1565. for (var h = 0; h < g.Md.length; h++) {
  1566. g.Md[h].style.width = g.ib + 2 * g.a.chatInputPadding - 2 + "px";
  1567. g.Md[h].style.height = g.ib + 2 * g.a.chatInputPadding - 2 + "px"
  1568. }
  1569. }
  1570. }(b);
  1571. ab(b, b.wb)
  1572. }
  1573.  
  1574. function cb(b) {
  1575. b.fb = b.d.createElement("div");
  1576. b.fb.style.display = "none";
  1577. b.fb.style.overflow = "hidden";
  1578. b.ud = [];
  1579. for (var c = 0; c < db.length; c++) {
  1580. var d = b.d.createElement("div");
  1581. b.ud.push(d);
  1582. u({
  1583. width: "10px",
  1584. height: "10px",
  1585. border: "1px solid #fff",
  1586. cssFloat: "left",
  1587. styleFloat: "left"
  1588. }, d.style);
  1589. d.style.background = db[c].color;
  1590. d.onmouseover = function() {
  1591. this.style.border = "1px solid #000"
  1592. };
  1593. d.onmouseout = function() {
  1594. this.style.border = "1px solid #fff"
  1595. };
  1596. d.onclick = function(e, f) {
  1597. return function() {
  1598. eb(e, f);
  1599. Ra(e)
  1600. }
  1601. }(b, db[c]);
  1602. b.fb.appendChild(d)
  1603. }
  1604. b.p.appendChild(b.fb);
  1605. b.ug = function(e) {
  1606. return function() {
  1607. for (var f = 0; f < e.ud.length; f++) {
  1608. e.ud[f].style.width = e.ib + 2 * e.a.chatInputPadding - 2 + "px";
  1609. e.ud[f].style.height = e.ib + 2 * e.a.chatInputPadding - 2 + "px"
  1610. }
  1611. }
  1612. }(b);
  1613. ab(b, b.fb)
  1614. }
  1615.  
  1616. function fb(b) {
  1617. b.rb = b.d.createElement("div");
  1618. b.rb.style.display = "none";
  1619. b.rb.style.overflow = "hidden";
  1620. var c = b.d.createElement("div");
  1621. c.style.padding = b.a.chatInputPadding + "px";
  1622. u({
  1623. styleFloat: "left",
  1624. cssFloat: "left",
  1625. fontFamily: b.a.chatInputFontFamily,
  1626. fontSize: b.a.chatInputFontSize + "px"
  1627. }, c.style);
  1628. b.rb.appendChild(c);
  1629. var d = b.d.createElement("span");
  1630. d.onclick = function(e) {
  1631. return function() {
  1632. Ra(e);
  1633. e.ca.Rg();
  1634. return false
  1635. }
  1636. }(b);
  1637. u({
  1638. color: b.a.colorInLinks,
  1639. marginLeft: "4px",
  1640. marginRight: "4px",
  1641. cursor: "pointer",
  1642. textDecoration: "underline"
  1643. },
  1644. d.style);
  1645. d.appendChild(b.d.createTextNode("Paste"));
  1646. c.appendChild(b.d.createTextNode("Paste text above, then click:"));
  1647. c.appendChild(d);
  1648. c.appendChild(b.d.createTextNode(" | "));
  1649. b.p.appendChild(b.rb);
  1650. ab(b, b.rb)
  1651. }
  1652.  
  1653. function gb(b) {
  1654. b.nb = b.d.createElement("div");
  1655. b.nb.style.display = "none";
  1656. b.nb.style.overflow = "hidden";
  1657. var c = b.d.createElement("form");
  1658. c.style.display = "block";
  1659. c.style.padding = b.a.chatInputPadding + "px";
  1660. u({
  1661. styleFloat: "left",
  1662. cssFloat: "left",
  1663. fontFamily: b.a.chatInputFontFamily,
  1664. fontSize: b.a.chatInputFontSize + "px"
  1665. }, c.style);
  1666. var d = b.d.createElement("input");
  1667. d.type = "text";
  1668. d.size = "24";
  1669. d.style.outline = "0";
  1670. d.style.margin = "0";
  1671. d.style.padding = "0";
  1672. u({
  1673. fontFamily: b.a.chatInputFontFamily,
  1674. fontSize: b.a.chatInputFontSize +
  1675. "px"
  1676. }, d.style);
  1677. d.style.border = "0";
  1678. d.setAttribute("placeholder", "http://mibbit.com");
  1679. d.style.background = "#eee";
  1680. c.appendChild(b.d.createTextNode("URL:"));
  1681. c.appendChild(d);
  1682. var e = b.d.createElement("span");
  1683. e.onclick = function(g) {
  1684. return function() {
  1685. try {
  1686. Ra(g);
  1687. g.ca.zg(d.value)
  1688. } catch (h) {}
  1689. return false
  1690. }
  1691. }(b);
  1692. c.onsubmit = e.onclick;
  1693. u({
  1694. color: b.a.colorInLinks,
  1695. marginLeft: "4px",
  1696. marginRight: "4px",
  1697. cursor: "pointer",
  1698. textDecoration: "underline"
  1699. }, e.style);
  1700. e.appendChild(b.d.createTextNode("Minify"));
  1701. c.appendChild(e);
  1702. c.appendChild(b.d.createTextNode(" | "));
  1703. b.nb.appendChild(c);
  1704. b.p.appendChild(b.nb);
  1705. var f = function() {
  1706. return function() {
  1707. d.value = "";
  1708. d.focus()
  1709. }
  1710. }();
  1711. b.vg = function() {
  1712. window.setTimeout(f, 100)
  1713. };
  1714. ab(b, b.nb)
  1715. }
  1716.  
  1717. function eb(b, c) {
  1718. if (b.lh) window.setTimeout(function(d) {
  1719. return function() {
  1720. try {
  1721. d.execCommand("foreColor", false, c.color)
  1722. } catch (e) {
  1723. alert(e)
  1724. }
  1725. }
  1726. }(b.d), 200);
  1727. else b.ea.style.color = c.color;
  1728. if (b.ca.De) c.code == 1 ? b.ca.De(null) : b.ca.De(c.code)
  1729. }
  1730. var db = [{
  1731. code: 0,
  1732. color: "#ffffff"
  1733. }, {
  1734. code: 1,
  1735. color: "#000000"
  1736. }, {
  1737. code: 2,
  1738. color: "#000080"
  1739. }, {
  1740. code: 3,
  1741. color: "#008000"
  1742. }, {
  1743. code: 4,
  1744. color: "#ff0000"
  1745. }, {
  1746. code: 5,
  1747. color: "#800040"
  1748. }, {
  1749. code: 6,
  1750. color: "#800080"
  1751. }, {
  1752. code: 7,
  1753. color: "#ff8040"
  1754. }, {
  1755. code: 8,
  1756. color: "#ffff00"
  1757. }, {
  1758. code: 9,
  1759. color: "#80ff00"
  1760. }, {
  1761. code: 10,
  1762. color: "#008080"
  1763. }, {
  1764. code: 11,
  1765. color: "#00ffff"
  1766. }, {
  1767. code: 12,
  1768. color: "#0000ff"
  1769. }, {
  1770. code: 13,
  1771. color: "#ff00ff"
  1772. }, {
  1773. code: 14,
  1774. color: "#808080"
  1775. }, {
  1776. code: 15,
  1777. color: "#c0c0c0"
  1778. }];
  1779.  
  1780. function Sa(b) {
  1781. b.v = {
  1782. content: b.La,
  1783. Gb: null
  1784. };
  1785. b.nh = null;
  1786. bb(b);
  1787. cb(b);
  1788. fb(b);
  1789. gb(b);
  1790. b.Aa.smilies = {
  1791. content: b.wb,
  1792. Zc: b.wg
  1793. };
  1794. b.Aa.colors = {
  1795. content: b.fb,
  1796. Zc: b.ug
  1797. };
  1798. b.Aa.pastebin = {
  1799. content: b.rb,
  1800. Zc: b.ca.Ld,
  1801. mf: b.ca.pg
  1802. };
  1803. b.Aa.minify = {
  1804. content: b.nb,
  1805. Zc: b.vg
  1806. };
  1807. if (b.Ad) {
  1808. b.mb = b.d.createElement("div");
  1809. u({
  1810. color: b.a.colorInMenuSep,
  1811. margin: b.a.chatInputSpacing + "px",
  1812. paddingLeft: "4px",
  1813. paddingTop: "1px",
  1814. paddingBottom: "1px",
  1815. fontFamily: b.a.chatInputMenuFontFamily,
  1816. fontSize: b.a.chatInputMenuFontSize + "px"
  1817. }, b.mb.style);
  1818. b.mb.style.MozUserSelect =
  1819. "none";
  1820. b.mb.style.Re = "none";
  1821. b.mb.style.marginTop = "auto";
  1822. for (var c = [], d = 0; d < b.a.ioCustomMenus.length; d++) c.push({
  1823. title: b.a.ioCustomMenus[d].title,
  1824. command: b.a.ioCustomMenus[d].command
  1825. });
  1826. if (c.length == 0) {
  1827. b.a.ioSmilies && c.push({
  1828. title: E.g("MenuSmilies"),
  1829. command: "/togglemenu smilies"
  1830. });
  1831. b.a.ioColors && c.push({
  1832. title: E.g("MenuColors"),
  1833. command: "/togglemenu colors"
  1834. });
  1835. b.a.ioPastebin && c.push({
  1836. title: E.g("MenuPasteBin"),
  1837. command: "/togglemenu pastebin"
  1838. });
  1839. b.a.ioMinify && c.push({
  1840. title: "Minify URL",
  1841. command: "/togglemenu minify"
  1842. })
  1843. }
  1844. for (d =
  1845. 0; d < c.length; d++) $a(b, c[d].title, c[d].command);
  1846. b.pb = b.d.createElement("table");
  1847. b.pb.setAttribute("border", "0");
  1848. b.pb.setAttribute("cellpadding", "0");
  1849. b.pb.setAttribute("cellspacing", "0");
  1850. b.pb.style.width = "100%";
  1851. b.p.appendChild(b.pb);
  1852. c = b.pb.insertRow(-1);
  1853. c.insertCell(-1).appendChild(b.mb);
  1854. c = c.insertCell(-1);
  1855. c.style.textAlign = "right";
  1856. d = b.d.createElement("div");
  1857. u({
  1858. color: b.a.colorInMenuSep,
  1859. margin: b.a.chatInputSpacing + "px",
  1860. paddingRight: "4px",
  1861. paddingTop: "1px",
  1862. paddingBottom: "1px",
  1863. fontFamily: b.a.chatInputMenuFontFamily,
  1864. fontSize: b.a.chatInputMenuFontSize + "px"
  1865. }, d.style);
  1866. d.style.marginTop = "auto";
  1867. var e = b.d.createElement("span");
  1868. e.style.color = b.a.colorInMenu;
  1869. e.style.marginRight = "4px";
  1870. d.appendChild(e);
  1871. b.xf = b.d.createTextNode("");
  1872. e.appendChild(b.xf);
  1873. if (b.ca.qf) {
  1874. var f = b.d.createElement("span");
  1875. f.appendChild(b.d.createTextNode("Menu"));
  1876. f.style.color = b.a.colorInMenu;
  1877. f.style.cursor = "pointer";
  1878. f.onmouseover = function() {
  1879. return function() {
  1880. f.style.textDecoration = "underline"
  1881. }
  1882. }(b);
  1883. f.onmouseout = function() {
  1884. return function() {
  1885. f.style.textDecoration =
  1886. "none"
  1887. }
  1888. }(b);
  1889. f.onclick = function(g) {
  1890. return function() {
  1891. g.ca.qf()
  1892. }
  1893. }(b);
  1894. d.appendChild(f)
  1895. }
  1896. c.appendChild(d)
  1897. }
  1898. }
  1899.  
  1900. function Qa(b, c, d, e, f) {
  1901. function g(j) {
  1902. return function() {
  1903. hb(j);
  1904. return false
  1905. }
  1906. }
  1907.  
  1908. function h(j) {
  1909. return function(n) {
  1910. return ib(j, n)
  1911. }
  1912. }
  1913.  
  1914. function k(j) {
  1915. return function(n) {
  1916. var o;
  1917. n = n;
  1918. if (!n) n = window.event;
  1919. if (j.dd && n.keyCode != 9) j.dd = false;
  1920. if (n.keyCode == 9) {
  1921. if (j.Rb) {
  1922. var s = j.Q.value,
  1923. w = Za(j),
  1924. p = s.substring(0, w);
  1925. s = s.substring(w, s.length);
  1926. if (j.dd) {
  1927. p = p.substring(0, p.length - (j.bd[j.tabIndex] + j.cd).length);
  1928. j.tabIndex++;
  1929. if (j.tabIndex == j.bd.length) j.tabIndex = 0;
  1930. w = p + j.bd[j.tabIndex] + j.cd;
  1931. j.Q.value = w + s;
  1932. Va(j, w.length)
  1933. } else if ((w =
  1934. p.match(new RegExp("[" + j.eg + "]+$"))) && w.length == 1) {
  1935. w = w[0].toLowerCase();
  1936. p = p.substring(0, p.length - w.length);
  1937. j.cd = p == "" ? ": " : " ";
  1938. var r = [];
  1939. for (nick in j.Rb) j.Rb.hasOwnProperty(nick) && nick.substring(0, w.length).toLowerCase() == w && r.push(j.Rb[nick]);
  1940. if (r.length !== 0)
  1941. if (r.length == 1) {
  1942. j.Q.value = p + r[0] + j.cd + s;
  1943. Va(j, p.length + (r[0] + j.cd).length)
  1944. } else {
  1945. r.sort(j.fg);
  1946. for (var y = r[0].length, z = 0; z < r.length - 1; z++)
  1947. for (; y > 0;) {
  1948. if (r[z].substring(0, y).toLowerCase() == r[z + 1].substring(0, y).toLowerCase()) break;
  1949. y--
  1950. }
  1951. if (y > w.length) {
  1952. w =
  1953. p + r[0].substring(0, y).toLowerCase();
  1954. j.Q.value = w + s;
  1955. Va(j, w.length)
  1956. } else {
  1957. j.dd = true;
  1958. j.bd = r;
  1959. j.tabIndex = 0;
  1960. w = p + j.bd[j.tabIndex] + j.cd;
  1961. j.Q.value = w + s;
  1962. Va(j, w.length)
  1963. }
  1964. }
  1965. }
  1966. }
  1967. } else if (!n.shiftKey && !n.altKey && n.keyCode == 38) {
  1968. if (j.Kb < j.history.length - 1) {
  1969. j.Kb++;
  1970. j.Q.value = j.history[j.Kb];
  1971. Va(j, j.Q.value.length)
  1972. }
  1973. } else !n.shiftKey && !n.altKey && n.keyCode == 40 && jb(j);
  1974. ib(j, n);
  1975. return o
  1976. }
  1977. }
  1978.  
  1979. function l(j) {
  1980. return function() {
  1981. j.history[j.Kb] = j.Q.value;
  1982. j.xc && j.xc(j.Q.value)
  1983. }
  1984. }
  1985. this.cg = e;
  1986. this.history = [];
  1987. this.Kb = 0;
  1988. this.maxLength = d;
  1989. this.Q = c;
  1990. this.Rb = {};
  1991. this.eg = "\\_\\|a-zA-Z0-9\\-\\[\\]\\\\`\\^\\{\\}";
  1992. this.fg = f;
  1993. this.dd = false;
  1994. this.bd = [];
  1995. this.tabIndex = 0;
  1996. this.xc = null;
  1997. c.setAttribute("autocomplete", "off");
  1998. c.setAttribute("spellcheck", "true");
  1999. if (b.addEventListener) {
  2000. b.addEventListener("submit", g(this), false);
  2001. c.addEventListener("keydown", k(this), false);
  2002. c.addEventListener("keypress", h(this), false);
  2003. c.addEventListener("keyup", l(this), false)
  2004. } else {
  2005. b.attachEvent("onsubmit", g(this));
  2006. c.attachEvent("onkeydown", k(this));
  2007. c.attachEvent("onkeypress", h(this));
  2008. c.attachEvent("onkeyup", l(this))
  2009. }
  2010. }
  2011.  
  2012. function kb(b, c) {
  2013. b.Rb[c.toLowerCase()] = c
  2014. }
  2015.  
  2016. function lb(b, c) {
  2017. delete b.Rb[c.toLowerCase()]
  2018. }
  2019.  
  2020. function hb(b) {
  2021. b.dd = false;
  2022. b.history[0] = b.Q.value;
  2023. b.Q.value = "";
  2024. if (b.cg && b.history[0] == b.history[1]) b.history[0] = "";
  2025. else {
  2026. b.history.length >= b.maxLength && b.history.pop();
  2027. b.history.unshift("")
  2028. }
  2029. b.Kb = 0;
  2030. return false
  2031. }
  2032.  
  2033. function jb(b) {
  2034. if (b.Kb > 0) {
  2035. b.Kb--;
  2036. b.Q.value = b.history[b.Kb]
  2037. }
  2038. }
  2039. Qa.prototype.Ub = function(b) {
  2040. var c = this.Q.value,
  2041. d = Za(this);
  2042. this.Q.value = c.substring(0, d) + b + c.substring(d, c.length);
  2043. Va(this, d + b.length)
  2044. };
  2045.  
  2046. function Va(b, c) {
  2047. try {
  2048. if (typeof b.Q.selectionStart != "undefined") b.Q.setSelectionRange(c, c);
  2049. else if (b.Q.createTextRange) {
  2050. var d = b.Q.createTextRange();
  2051. d.move("character", c);
  2052. d.select()
  2053. }
  2054. } catch (e) {}
  2055. }
  2056.  
  2057. function Za(b) {
  2058. try {
  2059. if (typeof b.Q.selectionStart != "undefined") return b.Q.selectionStart;
  2060. else if (b.Q.createTextRange) return document.selection.createRange().getBookmark().charCodeAt(2) - 2
  2061. } catch (c) {}
  2062. return v.length
  2063. }
  2064.  
  2065. function ib(b, c) {
  2066. if (!c) c = window.event;
  2067. if (c.keyCode == 9 || !c.shiftKey && !c.altKey && c.keyCode == 38 && c.charCode == 0 || !c.shiftKey && !c.altKey && c.keyCode == 40 && c.charCode == 0) {
  2068. if (c.stopPropagation) {
  2069. c.stopPropagation();
  2070. c.preventDefault()
  2071. } else {
  2072. c.cancelBubble = true;
  2073. c.returnValue = false
  2074. }
  2075. return false
  2076. }
  2077. return true
  2078. }
  2079.  
  2080. function mb(b, c, d) {
  2081. this.a = c;
  2082. this.p = b;
  2083. this.document = b.ownerDocument;
  2084. this.pf = nb(d);
  2085. this.gf = false;
  2086. this.oh = this.pf ? "#00f" : "#ff8";
  2087. this.ph = this.pf ? "#222" : "#eee";
  2088. this.p.style.zIndex = "100";
  2089. this.Jc = "";
  2090. this.tg = 0;
  2091. this.N = this.document.createElement("div");
  2092. u({
  2093. textAlign: "left",
  2094. whiteSpace: "pre",
  2095. margin: "1px"
  2096. }, this.N.style);
  2097. this.z(true);
  2098. this.N.onmouseover = function(e) {
  2099. return function() {
  2100. e.expand(true)
  2101. }
  2102. }(this);
  2103. this.N.onmouseout = function(e) {
  2104. return function() {
  2105. e.expand(false)
  2106. }
  2107. }(this);
  2108. this.p.appendChild(this.N);
  2109. this.Y = this.N;
  2110. this.ge = 10;
  2111. this.N.style.display = ob ? "none" : "block";
  2112. pb(this, "Mibbit")
  2113. }
  2114. mb.prototype.Va = function() {
  2115. if (ob) return Adverts.height;
  2116. return this.ge + 2
  2117. };
  2118. mb.prototype.z = function(b) {
  2119. if (!(!b && ob)) {
  2120. this.N.style.fontFamily = this.a.infobarFontFamily;
  2121. this.N.style.fontSize = this.a.infobarFontSize + "px";
  2122. this.N.style.padding = this.a.infobarPadding + "px";
  2123. this.N.style.color = this.a.infobarColor;
  2124. this.N.style.border = this.a.infobarBorder ? "1px solid " + this.a.infobarBorder : "0";
  2125. this.N.style.margin = this.a.infobarBorder ? "0px" : "1px";
  2126. this.p.style.background = this.a.infobarBackground;
  2127. this.N.style.display = ob ? "none" : "block"
  2128. }
  2129. };
  2130. mb.prototype.C = function() {
  2131. try {
  2132. if (this.N && this.N.offsetHeight != 0 && this.N.offsetHeight != this.ge) {
  2133. if (!this.gf) this.ge = this.N.offsetHeight;
  2134. return true
  2135. }
  2136. } catch (b) {
  2137. x && A("Infobar.layout", b, C)
  2138. }
  2139. return false
  2140. };
  2141.  
  2142. function pb(b, c, d) {
  2143. if (c == "") c = "NO TOPIC SET";
  2144. b.Jc = c;
  2145. b.tg = (new Date).getTime();
  2146. b.clear();
  2147. var e = b.document.createElement("span");
  2148. if (d) {
  2149. d.reset();
  2150. d.r += c;
  2151. d.A(e)
  2152. } else e.appendChild(b.document.createTextNode(c));
  2153. b.N.appendChild(e)
  2154. }
  2155. mb.prototype.expand = function(b) {
  2156. function c(d, e, f) {
  2157. try {
  2158. d.style[e] = f
  2159. } catch (g) {}
  2160. }
  2161. if (this.gf = b) {
  2162. u({
  2163. overflow: "auto",
  2164. height: "auto",
  2165. background: this.a.infobarBackgroundHighlight
  2166. }, this.p.style);
  2167. u({
  2168. color: this.a.infobarColorHighlight,
  2169. textAlign: "left"
  2170. }, this.Y.style);
  2171. c(this.Y, "whiteSpace", "pre-wrap");
  2172. c(this.Y, "whiteSpace", "-moz-pre-wrap");
  2173. c(this.Y, "whiteSpace", "-pre-wrap");
  2174. c(this.Y, "whiteSpace", "-o-pre-wrap");
  2175. c(this.Y, "wordWrap", "break-word");
  2176. this.Y.style.border = this.a.infobarBorderHighlight ? "1px solid " + this.a.infobarBorderHighlight :
  2177. "0";
  2178. this.Y.style.margin = this.a.infobarBorderHighlight ? "0px" : "1px"
  2179. } else {
  2180. u({
  2181. overflow: "hidden",
  2182. height: this.Va() + "px",
  2183. background: this.a.infobarBackground,
  2184. padding: "0"
  2185. }, this.p.style);
  2186. u({
  2187. color: this.a.infobarColor,
  2188. textAlign: "left",
  2189. whiteSpace: "pre"
  2190. }, this.Y.style);
  2191. c(this.Y, "wordWrap", "normal");
  2192. this.Y.style.border = this.a.infobarBorder ? "1px solid " + this.a.infobarBorder : "0";
  2193. this.Y.style.margin = this.a.infobarBorder ? "0px" : "1px"
  2194. }
  2195. };
  2196. mb.prototype.clear = function() {
  2197. for (; this.N.firstChild;) this.N.removeChild(this.N.firstChild)
  2198. };
  2199. var ob = false;
  2200.  
  2201. function qb(b, c, d, e, f, g, h, k, l, j, n, o) {
  2202. this.u = b;
  2203. this.D = l;
  2204. this.id = d;
  2205. this.we = n;
  2206. this.collapsed = false;
  2207. this.ab = true;
  2208. this.$d = this.Zd = false;
  2209. this.title = f;
  2210. this.content = e;
  2211. this.d = c.ownerDocument;
  2212. this.va = k;
  2213. this.fc = this.Cc = false;
  2214. this.H = h;
  2215. this.se = (new Date).getTime();
  2216. this.hd = j.Bb;
  2217. this.J = c;
  2218. this.J.style.cursor = "pointer";
  2219. this.J.style.MozUserSelect = "none";
  2220. this.J.style.Re = "none";
  2221. this.xa = this.d.createElement("span");
  2222. u({
  2223. display: "block",
  2224. position: "relative",
  2225. paddingRight: "4px"
  2226. }, this.xa.style);
  2227. this.xa.onclick = function(s) {
  2228. return function(w) {
  2229. if (!w) w =
  2230. window.event;
  2231. w = w.target ? w.target : w.srcElement;
  2232. w != s.Nb && w != s.I && j.Xf(s.id);
  2233. return false
  2234. }
  2235. }(this);
  2236. this.L = this.d.createElement("span");
  2237. u({
  2238. textDecoration: "none",
  2239. verticalAlign: "top",
  2240. position: "relative"
  2241. }, this.L.style);
  2242. if (this.H.P) {
  2243. this.kc = this.d.createElement("img");
  2244. b = this.u.ba - 2;
  2245. c = this.u.ba - 2;
  2246. if (this.H.Tb && this.H.Kc)
  2247. if (this.H.Tb < c) {
  2248. c = this.H.Tb;
  2249. b = this.H.Kc
  2250. }
  2251. u({
  2252. width: b + "px",
  2253. height: c + "px",
  2254. display: "inline",
  2255. marginRight: "3px",
  2256. verticalAlign: "top"
  2257. }, this.kc.style);
  2258. D(this.kc, this.H.P, b, c);
  2259. this.L.appendChild(this.kc)
  2260. }
  2261. this.Lf =
  2262. this.d.createTextNode(f);
  2263. this.L.appendChild(this.Lf);
  2264. this.J.title = g;
  2265. this.xa.appendChild(this.L);
  2266. this.J.appendChild(this.xa);
  2267. if (o) {
  2268. this.Nb = this.d.createElement("span");
  2269. this.af = this.d.createTextNode(" << ");
  2270. this.Nb.appendChild(this.af);
  2271. this.L.appendChild(this.Nb);
  2272. this.Nb.onclick = function(s) {
  2273. return function() {
  2274. s.Jd(!s.collapsed);
  2275. return false
  2276. }
  2277. }(this)
  2278. }
  2279. if (j.$e) {
  2280. this.I = this.d.createElement("img");
  2281. u({
  2282. cursor: "pointer",
  2283. width: "12px",
  2284. height: "12px",
  2285. marginLeft: "3px",
  2286. verticalAlign: "top"
  2287. }, this.I.style);
  2288. this.I.title =
  2289. "Close tab";
  2290. this.I.onclick = function(s) {
  2291. return function() {
  2292. j.$e(s.id);
  2293. return false
  2294. }
  2295. }(this);
  2296. D(this.I, "https://s3.amazonaws.com/mibbit/gfx/close-win-grey.png", 12, 12);
  2297. this.I.style.border = "0";
  2298. this.I.onmouseover = function() {
  2299. D(this, "https://s3.amazonaws.com/mibbit/gfx/close-win-red.png", 12, 12)
  2300. };
  2301. this.I.onmouseout = function() {
  2302. D(this, "https://s3.amazonaws.com/mibbit/gfx/close-win-grey.png", 12, 12)
  2303. };
  2304. this.L.appendChild(this.I)
  2305. }
  2306. this.z()
  2307. }
  2308. qb.prototype.Jd = function(b) {
  2309. this.u.Jd(this.id, b);
  2310. this.af.nodeValue = this.collapsed ? " >> " : " << "
  2311. };
  2312.  
  2313. function rb(b, c) {
  2314. b.title = c;
  2315. b.Lf.nodeValue = b.title
  2316. }
  2317.  
  2318. function sb(b) {
  2319. if (b.u.$a == "list") {
  2320. u({
  2321. styleFloat: "none",
  2322. cssFloat: "none",
  2323. marginRight: "0px",
  2324. textAlign: "left",
  2325. marginBottom: "1px"
  2326. }, b.J.style);
  2327. b.xa.style.cssFloat = "none";
  2328. b.xa.style.styleFloat = "none";
  2329. if (b.I) {
  2330. b.L.removeChild(b.I);
  2331. b.L.insertBefore(b.I, b.L.firstChild);
  2332. b.I.style.marginLeft = "0px";
  2333. b.I.style.marginRight = "4px"
  2334. }
  2335. } else {
  2336. u({
  2337. styleFloat: "left",
  2338. cssFloat: "left",
  2339. marginRight: b.D.Kf + "px",
  2340. textAlign: "center",
  2341. marginBottom: "0px"
  2342. }, b.J.style);
  2343. b.xa.style.cssFloat = "left";
  2344. b.xa.style.styleFloat = "left";
  2345. if (b.I) {
  2346. b.L.removeChild(b.I);
  2347. b.L.appendChild(b.I);
  2348. b.I.style.marginLeft = "4px";
  2349. b.I.style.marginRight = "0px"
  2350. }
  2351. }
  2352. b.z()
  2353. }
  2354. qb.prototype.z = function() {
  2355. this.J.style.height = this.u.ba + "px";
  2356. this.xa.style.height = this.u.ba + "px";
  2357. this.xa.style.fontSize = this.D.fontSize + "px";
  2358. this.xa.style.lineHeight = this.D.fontSize + "px";
  2359. this.L.style.fontSize = this.D.fontSize + "px";
  2360. this.L.style.lineHeight = this.D.fontSize + "px";
  2361. this.L.style.fontFamily = this.D.fontFamily;
  2362. this.L.style.fontWeight = this.D.fontWeight;
  2363. this.L.style.marginLeft = this.D.padding + "px";
  2364. this.L.style.marginRight = this.D.padding + "px";
  2365. this.L.style.top = this.D.padding + "px";
  2366. if (this.H.P) {
  2367. var b =
  2368. this.u.ba - 2,
  2369. c = this.u.ba - 2;
  2370. if (this.H.Tb && this.H.Kc)
  2371. if (this.H.Tb < c) {
  2372. c = this.H.Tb;
  2373. b = this.H.Kc
  2374. }
  2375. this.kc.style.width = b + "px";
  2376. this.kc.style.height = c + "px";
  2377. D(this.kc, this.H.P, b, c)
  2378. }
  2379. tb(this, this.va)
  2380. };
  2381. var vb = {};
  2382.  
  2383. function wb(b, c, d, e, f, g, h, k) {
  2384. b = (c ? "l" : "r") + "-" + (d ? "1" : "0") + "-" + e + "-" + f + "-" + g + "-" + h + "-" + k;
  2385. if (vb[b]) return vb[b];
  2386. try {
  2387. var l = document.createElement("canvas");
  2388. if (!l.getContext) return false;
  2389. l.setAttribute("width", e);
  2390. l.setAttribute("height", f);
  2391. var j = l.getContext("2d");
  2392. j.fillStyle = k;
  2393. j.fillRect(0, 0, e, f);
  2394. var n = j.createLinearGradient(0, 0, 0, f * 2);
  2395. n.addColorStop(0, h);
  2396. n.addColorStop(0.1, h);
  2397. n.addColorStop(1, "#000");
  2398. j.fillStyle = d ? h : n;
  2399. var o = Math.min(e, f) / 3;
  2400. j.beginPath();
  2401. if (c) {
  2402. j.moveTo(o, 0.5);
  2403. j.lineTo(e - 0.5, 0.5);
  2404. j.lineTo(e -
  2405. 0.5, f);
  2406. j.lineTo(0.5, f);
  2407. j.lineTo(0.5, o);
  2408. j.bezierCurveTo(0.5, o / 3, o / 3, 0.5, o, 0.5)
  2409. } else {
  2410. j.moveTo(e - 0.5 - o, 0.5);
  2411. j.lineTo(0.5, 0.5);
  2412. j.lineTo(0.5, f);
  2413. j.lineTo(e - 0.5, f);
  2414. j.lineTo(e - 0.5, o);
  2415. j.bezierCurveTo(e - 0.5, o / 2, e - 0.5 - o / 2, 1, e - 0.5 - o, 0.5)
  2416. }
  2417. j.fill();
  2418. j.beginPath();
  2419. if (c) {
  2420. j.moveTo(0.5, f);
  2421. j.lineTo(0.5, o);
  2422. j.bezierCurveTo(0.5, o / 2, o / 2, 0.5, o, 0.5);
  2423. j.lineTo(e - 0.5, 0.5)
  2424. } else {
  2425. j.moveTo(e - 0.5, f);
  2426. j.lineTo(e - 0.5, o);
  2427. j.bezierCurveTo(e - 0.5, o / 2, e - 0.5 - o / 2, 0.5, e - 0.5 - o, 0.5);
  2428. j.lineTo(0.5, 0.5)
  2429. }
  2430. j.strokeStyle = g;
  2431. j.lineWidth = 1;
  2432. j.lineCap = "butt";
  2433. j.stroke();
  2434. var s = l.toDataURL();
  2435. return vb[b] = s
  2436. } catch (w) {}
  2437. return false
  2438. }
  2439.  
  2440. function tb(b, c) {
  2441. function d(l) {
  2442. var j = l.indexOf(" ");
  2443. if (j != -1) l = l.substring(0, j);
  2444. j = "ffffff";
  2445. if (l.charAt(0) == "#") {
  2446. if (l.length == 7) j = l.substring(1, l.length);
  2447. if (l.length == 4) j = l.substring(1, 2) + l.substring(1, 2) + l.substring(2, 3) + l.substring(2, 3) + l.substring(3, 4) + l.substring(3, 4)
  2448. } else if (l.length == 6) j = l;
  2449. return j
  2450. }
  2451. b.va = c;
  2452. var e = d(b.H.background),
  2453. f = d(b.D.background),
  2454. g = d(b.H.border),
  2455. h = wb(b, true, c, 200, b.u.ba, b.H.border, b.H.background, b.D.background),
  2456. k = wb(b, false, c, 200, b.u.ba, b.H.border, b.H.background, b.D.background);
  2457. if (b.u.$a == "top" && h && k) {
  2458. b.xa.style.background = "transparent url('" + k + "') no-repeat scroll right top";
  2459. b.J.style.background = "transparent url('" + h + "') no-repeat scroll left top"
  2460. } else {
  2461. e = "/img/tab?" + (b.u.$a == "list" ? "vertical&" : "") + "color=" + e + (g ? "&bcolor=" + g : "") + (f ? "&bgcolor=" + f : "") + (c ? "&selected=true" : "");
  2462. if (b.u.ba != 20) e += "&height=" + b.u.ba;
  2463. b.xa.style.background = "transparent url(" + e + "&right=true) no-repeat scroll right top";
  2464. b.J.style.background = "transparent url(" + e + ") no-repeat scroll left top"
  2465. }
  2466. b.L.style.color =
  2467. c ? b.D.color : b.fc ? b.D.Pb : b.Cc ? b.D.Ob : b.D.Zf;
  2468. if (b.I) b.I.style.display = b.u.qg ? "inline" : c ? "inline" : "none";
  2469. b.J.style.marginLeft = b.u.$a == "list" ? c ? "4px" : "0px" : "0px"
  2470. }
  2471. qb.prototype.close = function() {
  2472. if (this.va) {
  2473. this.hd && this.hd(this.id, false);
  2474. this.content.style.display = "none";
  2475. tb(this, false)
  2476. }
  2477. };
  2478. qb.prototype.open = function() {
  2479. if (this.va) return false;
  2480. this.content.style.display = "block";
  2481. tb(this, true);
  2482. this.hd && this.hd(this.id, true);
  2483. this.se = (new Date).getTime();
  2484. xb(this);
  2485. return true
  2486. };
  2487. qb.prototype.pa = function(b) {
  2488. if (!this.va) {
  2489. if (!this.fc && b) {
  2490. var c = this.u.ec;
  2491. this.u.ec++;
  2492. c == 0 && this.u.M(true);
  2493. this.fc = true;
  2494. this.L.style.color = this.D.Pb
  2495. }
  2496. if (!this.Cc) {
  2497. this.u.Dc == 0 && this.u.M(true);
  2498. this.u.Dc++;
  2499. this.Cc = true;
  2500. if (!this.fc) this.L.style.color = this.D.Ob
  2501. }!this.ab && this.we && yb(this.u.l[this.we], b)
  2502. }
  2503. };
  2504.  
  2505. function xb(b) {
  2506. b.fc && b.u.ec--;
  2507. if (b.Cc) {
  2508. b.u.Dc--;
  2509. if (b.u.Dc == 0) b.u.M(false);
  2510. else b.u.ec == 0 && b.u.M(true)
  2511. }
  2512. b.Cc = false;
  2513. b.fc = false
  2514. }
  2515. qb.prototype.Va = function() {
  2516. return this.D.padding * 2 + this.L.offsetHeight
  2517. };
  2518.  
  2519. function yb(b, c) {
  2520. if (c) b.$d = true;
  2521. else b.Zd = true;
  2522. if (b.$d) b.Nb.style.color = b.D.Pb;
  2523. else if (b.Zd) b.Nb.style.color = b.D.Ob
  2524. }
  2525.  
  2526. function zb(b) {
  2527. b.Zd = false;
  2528. b.$d = false;
  2529. b.Nb.style.color = b.D.color
  2530. }
  2531.  
  2532. function Ab(b, c, d, e, f) {
  2533. this.a = c;
  2534. this.d = b.ownerDocument;
  2535. this.l = {};
  2536. this.cf = 0;
  2537. this.q = [];
  2538. this.ec = this.Dc = 0;
  2539. this.Ea = b;
  2540. this.$a = "top";
  2541. this.Qd = e;
  2542. this.ba = f;
  2543. this.Ea.style.textAlign = "left";
  2544. this.X = this.d.createElement("div");
  2545. this.X.style.overflow = "hidden";
  2546. this.X.style.zIndex = "90";
  2547. this.zc = this.d.createElement("ul");
  2548. u({
  2549. listStyleType: "none",
  2550. listStyleImage: "none",
  2551. listStylePosition: "outside",
  2552. margin: "0",
  2553. padding: "0",
  2554. verticalAlign: "bottom",
  2555. overflow: "hidden"
  2556. }, this.zc.style);
  2557. c = this.d.createElement("div");
  2558. c.style.position =
  2559. "relative";
  2560. this.X.appendChild(this.zc);
  2561. c.appendChild(this.X);
  2562. b.appendChild(c);
  2563. if (this.qd = d) {
  2564. this.gc = this.d.createElement("div");
  2565. this.Ea.appendChild(this.gc);
  2566. u({
  2567. position: "absolute",
  2568. right: "0px",
  2569. top: Bb + "px",
  2570. width: "40px",
  2571. height: this.ba + "px",
  2572. textAlign: "right",
  2573. paddingTop: this.Qd + "px",
  2574. background: this.a.tabBackgroundColor
  2575. }, this.gc.style);
  2576. this.Ra = this.d.createElement("div");
  2577. this.Ra.style.display = "none";
  2578. this.gc.appendChild(this.Ra);
  2579. this.bb = this.d.createElement("span");
  2580. this.bb.appendChild(this.d.createTextNode("<"));
  2581. u({
  2582. color: "#eee",
  2583. fontSize: "15px",
  2584. fontWeight: "bold",
  2585. cursor: "pointer",
  2586. textDecoration: "none"
  2587. }, this.bb.style);
  2588. this.bb.onclick = function(g) {
  2589. return function() {
  2590. var h = Cb(g);
  2591. h > 0 && Db(g, h - 1)
  2592. }
  2593. }(this);
  2594. this.db = this.d.createElement("a");
  2595. this.db.appendChild(this.d.createTextNode(">"));
  2596. u({
  2597. color: "#eee",
  2598. fontSize: "15px",
  2599. fontWeight: "bold",
  2600. cursor: "pointer",
  2601. textDecoration: "none"
  2602. }, this.db.style);
  2603. this.db.onclick = function(g) {
  2604. return function() {
  2605. var h = Cb(g);
  2606. h + 1 < Eb(g) && Db(g, h + 1)
  2607. }
  2608. }(this);
  2609. this.Ra.appendChild(this.bb);
  2610. this.Ra.appendChild(this.d.createTextNode(" "));
  2611. this.Ra.appendChild(this.db);
  2612. this.X.style.marginRight = "40px"
  2613. }
  2614. Fb(this, this.$a == "list");
  2615. this.z()
  2616. }
  2617.  
  2618. function Gb(b) {
  2619. for (i in b.l) b.l.hasOwnProperty(i) && b.l[i].close()
  2620. }
  2621.  
  2622. function Hb(b, c, d) {
  2623. if (!b.l[c]) return false;
  2624. var e = b.l[c];
  2625. delete b.l[c];
  2626. b.l[d] = e;
  2627. e.id = d;
  2628. return true
  2629. }
  2630.  
  2631. function Ib(b, c) {
  2632. if (!b.l[c]) return false;
  2633. var d = c + ".dead" + b.cf;
  2634. Hb(b, c, d);
  2635. rb(b.l[d], b.l[d].title + " (dead)");
  2636. b.l[d].I.onclick = function(e) {
  2637. return function() {
  2638. Jb(e, d)
  2639. }
  2640. }(b);
  2641. b.cf++;
  2642. return true
  2643. }
  2644. Ab.prototype.Jd = function(b, c) {
  2645. x && A("setCollapse", "Channel " + b + " : " + c, M);
  2646. var d = this.l[b];
  2647. if (d.collapsed = c) d.Ud = false;
  2648. c || zb(d);
  2649. for (var e = 0; e < this.q.length; e++)
  2650. if (this.q[e].we == b) {
  2651. x && A("setCollapse", "CH " + this.q[e].id, M);
  2652. this.q[e].J.style.display = c ? "none" : "block";
  2653. this.q[e].ab = !c;
  2654. if (this.q[e].va && c) {
  2655. this.q[e].close();
  2656. d.Ud = this.q[e];
  2657. d.open()
  2658. }
  2659. }
  2660. if (!c && d.Ud) {
  2661. Gb(this);
  2662. d.Ud.open()
  2663. }
  2664. };
  2665.  
  2666. function Kb(b, c, d) {
  2667. if (!d) return true;
  2668. if ((b = b.l[d]) && b.collapsed) return false;
  2669. return true
  2670. }
  2671.  
  2672. function Lb(b, c, d, e, f, g, h, k, l, j, n, o) {
  2673. x && A("addTab", "Adding " + c + " : " + n + " " + o, M);
  2674. try {
  2675. b.l[c] && x && A("addTab", "We already have a tab of that ID! " + c, C);
  2676. if (n) {
  2677. var s = b.l[n];
  2678. if (s && s.collapsed) l = true
  2679. }
  2680. if (l) d.style.display = "none";
  2681. else Gb(b);
  2682. var w = b.d.createElement("li");
  2683. u({
  2684. listStyleType: "none",
  2685. margin: "0",
  2686. padding: "0",
  2687. display: "block",
  2688. position: "relative",
  2689. whiteSpace: "nowrap"
  2690. }, w.style);
  2691. w.style.paddingLeft = "4px";
  2692. var p = {};
  2693. p.Bb = g;
  2694. if (j) p.$e = function(z) {
  2695. return function(B) {
  2696. var H = true;
  2697. if (h) H = h(B);
  2698. H && Jb(z, B)
  2699. }
  2700. }(b);
  2701. p.Xf =
  2702. function(z) {
  2703. return function(B) {
  2704. if (typeof z.l[B] != "undefined") {
  2705. Gb(z);
  2706. z.l[B].open()
  2707. }
  2708. }
  2709. }(b);
  2710. var r = new qb(b, w, c, d, e, f, k, !l, b.ka, p, n, o);
  2711. sb(r);
  2712. x && A("addTab", "setting hidden? " + c + " : " + n + " " + b.l[n], M);
  2713. if (n)
  2714. if ((s = b.l[n]) && s.collapsed) {
  2715. x && A("addTab", "setting hidden " + c, M);
  2716. r.J.style.display = "none";
  2717. r.ab = false
  2718. }
  2719. Mb(b, r);
  2720. if (b.Ra && b.size() > 1) b.Ra.style.display = "block";
  2721. return r
  2722. } catch (y) {
  2723. x && A("addTab", "exception " + y, C)
  2724. }
  2725. }
  2726.  
  2727. function Mb(b, c) {
  2728. for (var d, e, f = 0; f < b.q.length; f++) {
  2729. var g = b.q[f];
  2730. if (g.ab) e = g;
  2731. if (g.id > c.id) {
  2732. d = g.J;
  2733. break
  2734. }
  2735. }
  2736. if (e && e.J.style.display == "none") c.J.style.display = "none";
  2737. d ? b.zc.insertBefore(c.J, d) : b.zc.appendChild(c.J);
  2738. b.l[c.id] = c;
  2739. b.q.push(c);
  2740. b.q.sort(function(h, k) {
  2741. if (h.id > k.id) return 1;
  2742. if (h.id < k.id) return -1;
  2743. return 0
  2744. })
  2745. }
  2746.  
  2747. function Nb(b, c) {
  2748. b.zc.removeChild(c.J);
  2749. for (var d = 0; d < b.q.length; d++)
  2750. if (b.q[d] == c) {
  2751. b.q.splice(d, 1);
  2752. break
  2753. }
  2754. delete b.l[c.id]
  2755. }
  2756.  
  2757. function Jb(b, c) {
  2758. c = b.l[c];
  2759. if (!c) return false;
  2760. c.content.parentNode.removeChild(c.content);
  2761. xb(c);
  2762. Nb(b, c);
  2763. if (c.va) {
  2764. c = 0;
  2765. var d;
  2766. for (i in b.l)
  2767. if (b.l.hasOwnProperty(i))
  2768. if (b.l[i].se > c) {
  2769. c = b.l[i].se;
  2770. d = b.l[i]
  2771. }
  2772. d && d.open()
  2773. }
  2774. if (b.Ra && b.size() < 2) b.Ra.style.display = "none";
  2775. return true
  2776. }
  2777.  
  2778. function Db(b, c) {
  2779. for (var d = 0, e = 0; d < b.q.length; d++) {
  2780. var f = b.q[d];
  2781. if (f.ab) f.J.style.display = e < c ? "none" : "block";
  2782. f.ab && e++
  2783. }
  2784. }
  2785.  
  2786. function Cb(b) {
  2787. for (var c = 0, d = 0; c < b.q.length; c++) {
  2788. var e = b.q[c];
  2789. if (e.ab && e.J.style.display == "block") return d;
  2790. e.ab && d++
  2791. }
  2792. return 0
  2793. }
  2794.  
  2795. function Eb(b) {
  2796. for (var c = 0, d = 0; d < b.q.length; d++) b.q[d].ab && c++;
  2797. return c
  2798. }
  2799. Ab.prototype.size = function() {
  2800. return this.q.length
  2801. };
  2802. Ab.prototype.M = function(b) {
  2803. if (this.Ra) {
  2804. var c = this.ec > 0;
  2805. if (b) {
  2806. this.bb.style.color = c ? this.ka.Pb : this.ka.Ob;
  2807. this.db.style.color = c ? this.ka.Pb : this.ka.Ob
  2808. } else {
  2809. this.bb.style.color = this.ka.td;
  2810. this.db.style.color = this.ka.td
  2811. }
  2812. }
  2813. };
  2814. Ab.prototype.z = function() {
  2815. this.qg = this.a.tabIndividualCloses;
  2816. this.ka = {
  2817. fontFamily: this.a.tabFontFamily,
  2818. fontSize: this.a.tabFontSize,
  2819. fontWeight: "bold",
  2820. padding: this.a.tabPadding,
  2821. color: this.a.tabTextColor,
  2822. Pb: this.a.tabTextColorActivityMe,
  2823. Ob: this.a.tabTextColorActivity,
  2824. Zf: this.a.tabTextColorInactive,
  2825. Kf: this.a.tabSpacing,
  2826. td: this.a.tabTextColorArrows,
  2827. background: this.a.tabBackgroundColor
  2828. };
  2829. this.Ea.style.background = this.a.tabBackgroundColor;
  2830. this.gc && u({
  2831. top: Bb + "px",
  2832. height: this.ba + "px",
  2833. paddingTop: this.Qd + "px",
  2834. background: this.a.tabBackgroundColor
  2835. }, this.gc.style);
  2836. if (this.qd)
  2837. if (this.ec > 0) {
  2838. this.bb.style.color = this.ka.Pb;
  2839. this.db.style.color = this.ka.Pb
  2840. } else if (this.Dc > 0) {
  2841. this.bb.style.color = this.ka.Ob;
  2842. this.db.style.color = this.ka.Ob
  2843. } else {
  2844. this.bb.style.color = this.ka.td;
  2845. this.db.style.color = this.ka.td
  2846. }
  2847. for (i in this.l)
  2848. if (this.l.hasOwnProperty(i)) {
  2849. this.l[i].D = this.ka;
  2850. sb(this.l[i])
  2851. }
  2852. var b = 0;
  2853. for (i in this.l)
  2854. if (this.l.hasOwnProperty(i)) {
  2855. var c = this.l[i].Va();
  2856. if (c > b) b = c
  2857. }
  2858. if (b != 0 && b != this.ba) {
  2859. this.ba = b;
  2860. Fb(this, this.$a == "list")
  2861. }
  2862. };
  2863.  
  2864. function Ob(b) {
  2865. Fb(b, b.$a == "top");
  2866. b.a.useTabList = b.$a == "list"
  2867. }
  2868.  
  2869. function Fb(b, c) {
  2870. if (!(O && c)) {
  2871. if (typeof Q != "undefined" && b == Q) Pb = Bb + (c ? 0 : b.Qd + b.ba);
  2872. b.$a = c ? "list" : "top";
  2873. b.Ea.style.height = c ? "auto" : b.ba + "px";
  2874. b.Ea.style.overflow = c ? "auto" : "hidden";
  2875. b.Ea.style.top = c ? Pb + "px" : "";
  2876. b.Ea.style.bottom = c ? Qb + "px" : "";
  2877. b.Ea.style.left = c ? "0px" : "";
  2878. b.Ea.style.width = c ? F.tabListWidth + "px" : "auto";
  2879. b.Ea.style.position = c ? "absolute" : "static";
  2880. b.Ea.style.paddingTop = c ? "0px" : b.Qd + "px";
  2881. b.X.style.height = c ? "auto" : b.ba + "px";
  2882. b.X.style.marginRight = c ? "0px" : b.qd ? "40px" : "0px";
  2883. b.zc.style.height = c ? "auto" :
  2884. b.ba + "px";
  2885. if (b.Pc) {
  2886. b.Pc.style.styleFloat = c ? "none" : "left";
  2887. b.Pc.style.cssFloat = c ? "none" : "left";
  2888. b.Pc.style.marginRight = (c ? "0" : b.ka.Kf) + "px";
  2889. b.Pc.style.marginBottom = c ? "1px" : "0px";
  2890. b.Pc.style.textAlign = c ? "left" : "center"
  2891. }
  2892. for (var d = 0; d < b.q.length; d++) {
  2893. sb(b.q[d]);
  2894. b.q[d].content.style.top = Pb + "px";
  2895. b.q[d].content.style.left = (c ? F.tabListWidth : 0) + "px";
  2896. b.q[d].J.style.display = b.q[d].ab ? "block" : "none"
  2897. }
  2898. if (b.qd) b.gc.style.display = c ? "none" : "block"
  2899. }
  2900. }
  2901.  
  2902. function D(b, c, d, e) {
  2903. b.style.width = d + "px";
  2904. b.style.height = e + "px";
  2905. d = navigator.appVersion.split("MSIE");
  2906. if (parseFloat(d[1]) >= 5.5 && document.body.qa) {
  2907. b.src = "/icons/blank.gif";
  2908. b.style.filter = "progid:DXImageTransform.Microsoft.AlphaImageLoader(src='" + c + "', sizingMethod='scale')"
  2909. } else b.src = c
  2910. }
  2911.  
  2912. function R() {
  2913. this.r = "";
  2914. this.Qc = {};
  2915. this.A = function(b) {
  2916. b.appendChild(b.ownerDocument.createTextNode(this.r));
  2917. this.r = ""
  2918. }
  2919. }
  2920.  
  2921. function Rb(b, c) {
  2922. b.Qc = c
  2923. }
  2924. R.prototype.reset = function() {
  2925. this.o && this.o.reset();
  2926. this.r = ""
  2927. };
  2928.  
  2929. function Sb(b, c) {
  2930. b.r += c
  2931. }
  2932.  
  2933. function Tb(b, c, d) {
  2934. this.o = b;
  2935. this.A = function(e) {
  2936. var f = this.r.match(Ub);
  2937. if (f)
  2938. for (var g = 0; g < f.length; g++)
  2939. if (f[g].length == 1) this.o.r += f[g];
  2940. else if (f[g].substring(0, 6).toLowerCase() == "irc://" && d && d.ircLink) {
  2941. this.o.A(e);
  2942. var h = e.ownerDocument.createElement("span");
  2943. u({
  2944. textDecoration: "underline",
  2945. cursor: "pointer",
  2946. outline: "none",
  2947. color: c ? c.colorIRCLinks : "red"
  2948. }, h.style);
  2949. h.appendChild(e.ownerDocument.createTextNode(f[g]));
  2950. h.onclick = function(p) {
  2951. return function() {
  2952. d.ircLink(p);
  2953. h.blur();
  2954. return false
  2955. }
  2956. }(f[g]);
  2957. e.appendChild(h)
  2958. } else {
  2959. var k =
  2960. false,
  2961. l = null;
  2962. if (this.Qc && this.Qc.links && this.Qc.links[f[g]]) l = this.Qc.links[f[g]];
  2963. if (d && d.mediaCheck) {
  2964. var j = d.mediaCheck(f[g]);
  2965. if (j && j.P) {
  2966. this.o.A(e);
  2967. h = e.ownerDocument.createElement("img");
  2968. u({
  2969. border: "2px dotted #cc6",
  2970. cursor: "pointer",
  2971. width: j.le + "px",
  2972. height: j.ke + "px"
  2973. }, h.style);
  2974. h.src = j.P;
  2975. h.onclick = function(p, r, y) {
  2976. return function() {
  2977. d[y](p, r);
  2978. return false
  2979. }
  2980. }(j.match, f[g], j.Cb);
  2981. h.title = j.vd + " (" + f[g] + ")";
  2982. e.appendChild(h);
  2983. if (j.wd || l && l.id || l && l.idata) {
  2984. var n = e.ownerDocument.createElement("img");
  2985. n.style.height =
  2986. "16px";
  2987. n.style.width = "16px";
  2988. n.style.paddingLeft = "2px";
  2989. n.src = "https://s3.amazonaws.com/mibbit/gfx/information.png";
  2990. if (l && l.id) {
  2991. n.title = "Getting info...";
  2992. h.id = l.id;
  2993. n.id = l.id + "_i"
  2994. } else {
  2995. var o = "";
  2996. for (var s in l.idata)
  2997. if (l.idata.hasOwnProperty(s) && s != "thumb") o = o + s.toUpperCase() + ": " + l.idata[s] + " \n";
  2998. n.title = o;
  2999. h.title = o;
  3000. if (l.idata.thumb) h.src = l.idata.thumb
  3001. }
  3002. e.appendChild(n)
  3003. }
  3004. k = true
  3005. }
  3006. }
  3007. if (!k) {
  3008. this.o.A(e);
  3009. k = f[g];
  3010. h = e.ownerDocument.createElement("a");
  3011. h.href = l && l.url ? l.url : k;
  3012. if (c && c.openLinksInExtra) h.onclick = function(p) {
  3013. return function() {
  3014. d.web(p);
  3015. return false
  3016. }
  3017. }(f[g]);
  3018. k = f[g];
  3019. var w = k.indexOf("?");
  3020. if (w != -1) k = k.substring(0, w);
  3021. k = k.match(/^(.+)\.(jpg|jpeg|png|gif)$/i);
  3022. n = e.ownerDocument.createTextNode(l && l.display ? l.display : f[g]);
  3023. w = h;
  3024. if (k && c && c.parseReplaceImages) {
  3025. n = e.ownerDocument.createElement("img");
  3026. n.style.width = c.parseReplaceImagesWidth + "px";
  3027. n.style.height = c.parseReplaceImagesHeight + "px";
  3028. n.src = l && l.id || l && l.idata ? "https://s3.amazonaws.com/mibbit/gfx/information.png" : Vb + "/" + c.parseReplaceImagesWidth + "x" + c.parseReplaceImagesHeight + "/" + f[g];
  3029. w =
  3030. n;
  3031. h.onclick = function(p) {
  3032. return function() {
  3033. d.showImage(p);
  3034. return false
  3035. }
  3036. }(f[g])
  3037. }
  3038. h.style.outline = "none";
  3039. h.style.color = c ? h.id ? c.colorLinksWait : c.colorLinks : "blue";
  3040. h.target = "_blank";
  3041. h.title = l && l.hover ? l.hover : f[g] + " (new window)";
  3042. o = false;
  3043. if (d && d.mediaCheck)
  3044. if (j = d.mediaCheck(f[g])) {
  3045. h.onclick = function(p) {
  3046. return function() {
  3047. d[j.Cb](p);
  3048. return false
  3049. }
  3050. }(f[g]);
  3051. n = f[g];
  3052. o = n.lastIndexOf("/");
  3053. if (o != -1) n = n.substring(o + 1, n.length);
  3054. n = e.ownerDocument.createTextNode(n);
  3055. h.title = f[g] + " (View next to chat)";
  3056. o = e.ownerDocument.createElement("img");
  3057. o.style.height = "16px";
  3058. o.style.width = "16px";
  3059. o.src = "https://s3.amazonaws.com/mibbit/gfx/information.png";
  3060. o.style.paddingLeft = "2px";
  3061. o.title = j.re;
  3062. o.onclick = h.onclick
  3063. }
  3064. h.appendChild(n);
  3065. e.appendChild(h);
  3066. o && e.appendChild(o);
  3067. if (l && l.id || l && l.hover || l && l.idata) {
  3068. n = e.ownerDocument.createElement("img");
  3069. n.style.height = "16px";
  3070. n.style.width = "16px";
  3071. n.src = "https://s3.amazonaws.com/mibbit/gfx/information.png";
  3072. n.style.paddingLeft = "2px";
  3073. if (l && l.id) {
  3074. n.title = "Getting info...";
  3075. w.id = l.id;
  3076. n.id = l.id + "_i"
  3077. } else if (l && l.idata) {
  3078. o =
  3079. "";
  3080. for (s in l.idata)
  3081. if (l.idata.hasOwnProperty(s) && s != "thumb") o = o + s.toUpperCase() + ": " + l.idata[s] + " \n";
  3082. n.title = o;
  3083. h.title = o;
  3084. if (l.idata.thumb && k && c && c.parseReplaceImages) w.src = l.idata.thumb
  3085. } else n.title = h.title;
  3086. e.appendChild(n)
  3087. }
  3088. }
  3089. }
  3090. this.o.A(e);
  3091. this.r = ""
  3092. }
  3093. }
  3094. Tb.prototype = new R;
  3095. var Vb = "http://thumbnails.mibbit.com/unsafe",
  3096. Ub = /((http[s]?:\/\/|ftp:\/\/|irc:\/\/)([0-9a-zA-Z\$\-\#\~\_\.\+\!\*\'\[\]\{\}\|\\\^\`\,\/\%\;\:\@\&\?\=]+))|(.+?)/gi;
  3097.  
  3098. function Xb(b, c) {
  3099. this.o = b;
  3100. this.$c = c.iconSmileys;
  3101. this.a = c;
  3102. b = "";
  3103. for (c = 0; c < this.$c.length; c++) {
  3104. var d = this.$c[c].code;
  3105. if (d != "") b += "(" + d.replace(/([\\\|\^\+\-\*\.\[\]\(\)\?\$\{\}\!\=\:])/g, "\\$1") + ")|"
  3106. }
  3107. this.Lg = new RegExp(b + "(.+?)", "g");
  3108. this.A = function(e) {
  3109. var f = this.r.match(this.Lg);
  3110. if (f)
  3111. for (var g = 0; g < f.length; g++)
  3112. if (f[g].length == 1) this.o.r += f[g];
  3113. else {
  3114. this.o.A(e);
  3115. for (var h = 0; h < this.$c.length; h++)
  3116. if (f[g] == this.$c[h].code) {
  3117. var k = e.ownerDocument.createElement("img");
  3118. k.style.border = "0";
  3119. k.style.height = this.a.sizeSmiliesToText ?
  3120. "1em" : this.a.iconSmileysHeight ? this.a.iconSmileysHeight + "px" : "";
  3121. k.style.width = this.a.sizeSmiliesToText ? "1em" : this.a.iconSmileysWidth ? this.a.iconSmileysWidth + "px" : "";
  3122. k.src = this.a.iconSmileysBase + this.$c[h].src;
  3123. h = e.ownerDocument.createElement("span");
  3124. h.style.display = "none";
  3125. h.appendChild(e.ownerDocument.createTextNode(f[g]));
  3126. h.onclick = function(l, j) {
  3127. return function() {
  3128. var n = l.style.display == "none";
  3129. l.style.display = n ? "inline" : "none";
  3130. j.style.display = n ? "none" : "inline";
  3131. return false
  3132. }
  3133. }(k, h);
  3134. k.onclick = h.onclick;
  3135. e.appendChild(k);
  3136. e.appendChild(h);
  3137. break
  3138. }
  3139. }
  3140. this.o.A(e);
  3141. this.r = ""
  3142. }
  3143. }
  3144. Xb.prototype = new R;
  3145.  
  3146. function Yb(b, c, d) {
  3147. this.o = c;
  3148. this.vf = b;
  3149. this.Cg = d;
  3150. this.A = function(e) {
  3151. this.r.replace(/([^a-zA-Z0-9\_\|\-\[\]\\\`\^\{\}]*)([a-zA-Z0-9\_\|\-\[\]\\\`\^\{\}]*)([^a-zA-Z0-9\_\|\-\[\]\\\`\^\{\}]*)/g, function(f) {
  3152. return function(g, h, k, l) {
  3153. if (k && f.vf.hasOwnProperty(k.toLowerCase()) && f.vf[k.toLowerCase()]) {
  3154. h && Sb(f.o, h);
  3155. f.o.A(e);
  3156. g = e.ownerDocument.createElement("span");
  3157. f.Cg(k.toLowerCase(), g);
  3158. g.appendChild(e.ownerDocument.createTextNode(k));
  3159. e.appendChild(g);
  3160. l && Sb(f.o, l)
  3161. } else {
  3162. k = (h ? h : "") + (k ? k : "") + (l ? l : "");
  3163. k !== "" &&
  3164. Sb(f.o, k)
  3165. }
  3166. }
  3167. }(this));
  3168. this.o.A(e);
  3169. this.r = ""
  3170. }
  3171. }
  3172. Yb.prototype = new R;
  3173.  
  3174. function Zb(b, c, d) {
  3175. this.o = c;
  3176. this.A = function(e) {
  3177. var f = this.r.match($b);
  3178. if (f)
  3179. for (var g = 0; g < f.length; g++)
  3180. if (f[g].length == 1) this.o.r += f[g];
  3181. else {
  3182. this.o.A(e);
  3183. var h = e.ownerDocument.createElement("span");
  3184. u({
  3185. color: d.colorChannels,
  3186. cursor: "pointer",
  3187. textDecoration: "underline",
  3188. outline: "none"
  3189. }, h.style);
  3190. h.onclick = function(k) {
  3191. return function() {
  3192. b(k);
  3193. return false
  3194. }
  3195. }(f[g]);
  3196. h.appendChild(e.ownerDocument.createTextNode(f[g]));
  3197. e.appendChild(h)
  3198. }
  3199. this.o.A(e);
  3200. this.r = ""
  3201. }
  3202. }
  3203. Zb.prototype = new R;
  3204. var $b = /(\#([\S]+))|(.+?)/g;
  3205.  
  3206. function ac(b) {
  3207. this.o = b;
  3208. this.A = function(c) {
  3209. var d = this.r.match(bc);
  3210. if (d)
  3211. for (var e = 0; e < d.length; e++)
  3212. if (d[e].length == 1) this.o.r += d[e];
  3213. else {
  3214. var f = "none",
  3215. g = d[e].substring(0, 1),
  3216. h = d[e].substring(d[e].length - 1, d[e].length);
  3217. if (d[e].length > 2)
  3218. if (g == "_" && h == "_") f = "underline";
  3219. else if (g == "*" && h == "*") f = "bold";
  3220. else if (g == "/" && h == "/") f = "italic";
  3221. if (f == "none") this.o.r += d[e];
  3222. else {
  3223. this.o.A(c);
  3224. g = c.ownerDocument.createElement("span");
  3225. if (f == "italic") g.style.fontStyle = "italic";
  3226. if (f == "underline") g.style.textDecoration = "underline";
  3227. if (f == "bold") g.style.fontWeight = "bold";
  3228. g.appendChild(c.ownerDocument.createTextNode(d[e]));
  3229. c.appendChild(g)
  3230. }
  3231. }
  3232. this.o.A(c);
  3233. this.r = ""
  3234. }
  3235. }
  3236. ac.prototype = new R;
  3237. var bc = /([\/\_\*a-zA-Z0-9]+)|(.+?)/g;
  3238.  
  3239. function cc(b) {
  3240. this.o = b;
  3241. this.kb = this.jb = false;
  3242. this.Ca = this.Ga = null;
  3243. this.be = {
  3244. 0: "#ffffff",
  3245. 1: "#000000",
  3246. 2: "#000080",
  3247. 3: "#008000",
  3248. 4: "#ff0000",
  3249. 5: "#800040",
  3250. 6: "#800080",
  3251. 7: "#ff8040",
  3252. 8: "#ffff00",
  3253. 9: "#80ff00",
  3254. 10: "#008080",
  3255. 11: "#00ffff",
  3256. 12: "#0000ff",
  3257. 13: "#ff00ff",
  3258. 14: "#808080",
  3259. 15: "#c0c0c0"
  3260. };
  3261. this.e = function(c) {
  3262. var d = c;
  3263. if (this.jb || this.kb || this.Ga !== null || this.Ca !== null) {
  3264. d = c.ownerDocument.createElement("span");
  3265. if (this.jb) d.style.fontWeight = "bold";
  3266. if (this.kb) d.style.textDecoration = "underline";
  3267. if (this.Ga) d.style.color =
  3268. this.Ga;
  3269. if (this.Ca) d.style.background = this.Ca;
  3270. c.appendChild(d)
  3271. }
  3272. this.o.A(d)
  3273. };
  3274. this.reset = function() {
  3275. this.kb = this.jb = false;
  3276. this.Ca = this.Ga = null;
  3277. this.r = this.Jg = "";
  3278. this.o && this.o.reset()
  3279. };
  3280. this.A = function(c) {
  3281. for (var d = this.r, e = 0; e < d.length; e++) {
  3282. var f = d.charAt(e);
  3283. if (f == "\u0003") {
  3284. f = "";
  3285. var g = 0,
  3286. h = 0,
  3287. k = false;
  3288. if (e + 1 < d.length) {
  3289. for (e++; e < d.length; e++) {
  3290. var l = d.charAt(e);
  3291. if (l >= "0" && l <= "9")
  3292. if (!k && g == 2 || k && h == 2) {
  3293. e--;
  3294. break
  3295. } else {
  3296. f += l;
  3297. if (k) h++;
  3298. else g++
  3299. }
  3300. else if (l == ",") {
  3301. if (k) {
  3302. e--;
  3303. break
  3304. }
  3305. f += l;
  3306. k = true
  3307. } else {
  3308. e--;
  3309. break
  3310. }
  3311. }
  3312. this.e(c);
  3313. f = f.split(",");
  3314. g = true;
  3315. if (typeof f[0] != "undefined" && f[0] !== "") {
  3316. this.Ga = this.be[parseInt(f[0], 10) & 15];
  3317. g = false
  3318. }
  3319. if (typeof f[1] != "undefined" && f[1] !== "") {
  3320. this.Ca = this.be[parseInt(f[1], 10) & 15];
  3321. g = false
  3322. }
  3323. if (g) this.Ga = this.Ca = null
  3324. }
  3325. } else if (f == "\u0002") {
  3326. this.e(c);
  3327. this.jb = !this.jb
  3328. } else if (f == "\u001f") {
  3329. this.e(c);
  3330. this.kb = !this.kb
  3331. } else if (f == "\u000f") {
  3332. this.e(c);
  3333. this.reset()
  3334. } else this.o.r += f
  3335. }
  3336. this.e(c);
  3337. this.r = ""
  3338. }
  3339. }
  3340. cc.prototype = new R;
  3341.  
  3342. function dc(b) {
  3343. this.o = b;
  3344. this.of = this.kb = this.jb = false;
  3345. this.Ca = this.Ga = null;
  3346. this.be = {
  3347. 0: "#ffffff",
  3348. 1: "#000000",
  3349. 2: "#000080",
  3350. 3: "#008000",
  3351. 4: "#ff0000",
  3352. 5: "#800040",
  3353. 6: "#800080",
  3354. 7: "#ff8040",
  3355. 8: "#ffff00",
  3356. 9: "#80ff00",
  3357. 10: "#008080",
  3358. 11: "#00ffff",
  3359. 12: "#0000ff",
  3360. 13: "#ff00ff",
  3361. 14: "#808080",
  3362. 15: "#c0c0c0"
  3363. };
  3364. this.e = function(c) {
  3365. var d = c;
  3366. if (this.jb || this.kb || this.Ga !== null || this.Ca !== null) {
  3367. d = c.ownerDocument.createElement("span");
  3368. if (this.jb) d.style.fontWeight = "bold";
  3369. if (this.kb) d.style.textDecoration = "underline";
  3370. if (this.of) d.style.fontStyle =
  3371. "italic";
  3372. if (this.Ga) d.style.color = this.Ga;
  3373. if (this.Ca) d.style.background = this.Ca;
  3374. c.appendChild(d)
  3375. }
  3376. this.o.A(d)
  3377. };
  3378. this.reset = function() {
  3379. this.of = this.kb = this.jb = false;
  3380. this.Ca = this.Ga = null;
  3381. this.r = this.Jg = "";
  3382. this.o && this.o.reset()
  3383. };
  3384. this.A = function(c) {
  3385. for (var d = this.r, e = 0; e < d.length; e++) {
  3386. var f = d.charAt(e);
  3387. if (f == "\u001b") {
  3388. e++;
  3389. if (e < d.length && d.charAt(e) == "[") {
  3390. f = "";
  3391. for (e++; e < d.length;) {
  3392. var g = d.charAt(e);
  3393. if (g == "m") break;
  3394. f += g;
  3395. e++
  3396. }
  3397. }
  3398. } else this.o.r += f
  3399. }
  3400. this.e(c);
  3401. this.r = ""
  3402. }
  3403. }
  3404. dc.prototype = new R;
  3405.  
  3406. function ec(b, c, d) {
  3407. this.a = c;
  3408. this.p = b;
  3409. this.d = b.ownerDocument;
  3410. this.hf = d;
  3411. this.e = [];
  3412. this.fa = this.d.createElement("table");
  3413. u({
  3414. background: this.a.chatOutputBackground,
  3415. tableLayout: "fixed",
  3416. borderCollapse: "collapse",
  3417. border: "0",
  3418. width: "100%",
  3419. height: "100%"
  3420. }, this.fa.style);
  3421. this.fa.setAttribute("cellpadding", "0");
  3422. this.fa.setAttribute("cellspacing", "0");
  3423. this.p.appendChild(this.fa);
  3424. this.ee = {
  3425. tb: function(e) {
  3426. u({
  3427. height: "1em",
  3428. overflow: "hidden",
  3429. fontFamily: "Arial, Helvetica, sans-serif",
  3430. paddingBottom: "1px",
  3431. paddingTop: "1px",
  3432. paddingLeft: "3px",
  3433. fontSize: "13px",
  3434. borderTop: "1px solid #c8c8ff"
  3435. }, e.style);
  3436. e.setAttribute("valign", "top");
  3437. e.appendChild(e.ownerDocument.createTextNode(" "))
  3438. },
  3439. oc: function(e) {
  3440. u({
  3441. background: "#cad69f",
  3442. fontFamily: "Arial, Helvetica, sans-serif",
  3443. fontSize: "11px",
  3444. borderRight: "1px solid #888"
  3445. }, e.style);
  3446. e.appendChild(e.ownerDocument.createTextNode(" "))
  3447. },
  3448. pc: function(e) {
  3449. u({
  3450. background: "#e4eace",
  3451. fontFamily: "Arial, Helvetica, sans-serif",
  3452. fontSize: "11px",
  3453. borderRight: "1px solid #888"
  3454. }, e.style);
  3455. e.appendChild(e.ownerDocument.createTextNode(" "))
  3456. }
  3457. }
  3458. }
  3459. ec.prototype.clear = function() {
  3460. for (; this.fa.rows.length > 0;) {
  3461. this.fa.deleteRow(0);
  3462. this.e.shift()
  3463. }
  3464. };
  3465. ec.prototype.z = function() {
  3466. this.fa.style.background = this.a.chatOutputBackground;
  3467. var b = this.e;
  3468. for (this.e = []; this.fa.rows.length > 0;) this.fa.deleteRow(0);
  3469. for (var c = 0; c < b.length; c++)
  3470. if (b[c].Ef) fc(this, b[c].id, b[c].Ef, b[c].Cb);
  3471. else b[c].Ye ? gc(this, b[c].id, b[c].Ye) : this.jd(b[c].id)
  3472. };
  3473.  
  3474. function hc(b, c) {
  3475. for (var d = c + " ", e = 0; e < b.e.length; e++)
  3476. if (b.e[e].id.substring(0, d.length) == d || b.e[e].id == c) {
  3477. b.fa.deleteRow(e);
  3478. b.e.splice(e, 1);
  3479. e--
  3480. }
  3481. }
  3482.  
  3483. function ic(b, c, d) {
  3484. for (var e = c + " ", f = 0; f < b.e.length; f++)
  3485. if (b.e[f].id.substring(0, e.length) == e || b.e[f].id == c) u(d, b.e[f].jg.style)
  3486. }
  3487.  
  3488. function jc(b) {
  3489. var c = 1 + (b.a.chatOutputShowTimes ? 1 : 0) + (b.a.chatOutputShowNicks ? 1 : 0);
  3490. if (b.a.chatOutputMaxLines != 0)
  3491. for (; b.fa.rows.length > 0;) {
  3492. if (b.fa.rows[0].cells.length == c && b.fa.rows.length < b.a.chatOutputMaxLines) break;
  3493. b.fa.deleteRow(0);
  3494. b.e.shift()
  3495. }
  3496. }
  3497. ec.prototype.jd = function(b) {
  3498. var c = this.fa.insertRow(-1);
  3499. this.e.push({
  3500. id: "" + b
  3501. });
  3502. b = c.insertCell(-1);
  3503. if (kc) b.style.paddingRight = "15px";
  3504. b.colSpan = 1 + (this.a.chatOutputShowTimes ? 1 : 0) + (this.a.chatOutputShowNicks ? 1 : 0);
  3505. b.style.borderTop = "1px solid red";
  3506. jc(this)
  3507. };
  3508.  
  3509. function gc(b, c, d, e) {
  3510. function f(l, j, n) {
  3511. try {
  3512. l.style[j] = n
  3513. } catch (o) {}
  3514. }
  3515. var g = b.fa.insertRow(-1);
  3516. if (e) g.style.display = "none";
  3517. var h, k;
  3518. if (b.a.chatOutputRTL) {
  3519. e = g.insertCell(-1);
  3520. if (b.a.chatOutputShowNicks) k = g.insertCell(-1);
  3521. if (b.a.chatOutputShowTimes) h = g.insertCell(-1)
  3522. } else {
  3523. if (b.a.chatOutputShowTimes) h = g.insertCell(-1);
  3524. if (b.a.chatOutputShowNicks) k = g.insertCell(-1);
  3525. e = g.insertCell(-1)
  3526. }
  3527. b.e.push({
  3528. id: "" + c,
  3529. Ye: d,
  3530. jg: e,
  3531. Jh: g
  3532. });
  3533. if (b.a.chatOutputShowTimes) {
  3534. h.style.width = b.a.chatOutputTimeWidth + "px";
  3535. h.style.overflow = "hidden";
  3536. d && d.pc ? d.pc(h) : b.ee.pc(h)
  3537. }
  3538. if (b.a.chatOutputShowNicks) {
  3539. k.style.width = b.a.chatOutputNickWidth + "px";
  3540. k.style.overflow = "hidden";
  3541. f(k, "wordWrap", "break-word");
  3542. d && d.oc ? d.oc(k) : b.ee.oc(k)
  3543. }
  3544. if (kc) e.style.paddingRight = "15px";
  3545. f(e, "whiteSpace", "pre-wrap");
  3546. f(e, "whiteSpace", "-moz-pre-wrap");
  3547. f(e, "whiteSpace", "-pre-wrap");
  3548. f(e, "whiteSpace", "-o-pre-wrap");
  3549. f(e, "wordWrap", "break-word");
  3550. d ? d.tb(e) : b.ee.tb(e);
  3551. jc(b)
  3552. }
  3553.  
  3554. function fc(b, c, d, e) {
  3555. var f = b.fa.insertRow(-1);
  3556. b.e.push({
  3557. id: "" + c,
  3558. Ef: d,
  3559. Cb: e
  3560. });
  3561. f = f.insertCell(-1);
  3562. if (kc) f.style.paddingRight = "15px";
  3563. f.colSpan = 1 + (b.a.chatOutputShowTimes ? 1 : 0) + (b.a.chatOutputShowNicks ? 1 : 0);
  3564. u({
  3565. borderTop: "1px solid " + b.a.chatPaneBorder,
  3566. borderBottom: "1px solid " + b.a.chatPaneBorder,
  3567. padding: "3px"
  3568. }, f.style);
  3569. var g = b.d.createElement("div");
  3570. if (kc) g.style.marginRight = "15px";
  3571. f.appendChild(g);
  3572. d(g);
  3573. d = b.d.createElement("div");
  3574. if (kc) d.style.marginRight = "15px";
  3575. d.style.textAlign = "right";
  3576. g = b.d.createElement("img");
  3577. D(g, "https://s3.amazonaws.com/mibbit/gfx/close-win-red.png", 12, 12);
  3578. g.border = 0;
  3579. g.style.marginRight = "4px";
  3580. g.style.cursor = "pointer";
  3581. g.title = E.g("ChatOutputRemove");
  3582. g.onclick = function(h) {
  3583. return function() {
  3584. try {
  3585. hc(h, c);
  3586. h.hf && h.hf();
  3587. e && e()
  3588. } catch (k) {}
  3589. return false
  3590. }
  3591. }(b);
  3592. d.appendChild(g);
  3593. f.appendChild(d);
  3594. jc(b)
  3595. }
  3596.  
  3597. function lc(b, c, d, e, f, g, h, k, l, j) {
  3598. u({
  3599. overflow: "hidden",
  3600. fontFamily: d.chatFontFamily,
  3601. paddingBottom: d.chatPaddingBottom + "px",
  3602. paddingTop: d.chatPaddingTop + "px",
  3603. paddingLeft: "3px",
  3604. fontSize: d.chatFontSize + "px",
  3605. color: h,
  3606. background: d.chatBackground,
  3607. verticalAlign: "bottom"
  3608. }, c.style);
  3609. if (d.chatBackgroundLines != "") c.style.borderTop = "1px solid " + d.chatBackgroundLines;
  3610. c.setAttribute("valign", "top");
  3611. if (d.chatOutputRTL) c.style.direction = "rtl";
  3612. var n;
  3613. if (!d.chatOutputShowNicks) {
  3614. n = c.ownerDocument.createElement("span");
  3615. if (d.chatBackgroundHighlight) {
  3616. n.onmouseover =
  3617. function(s) {
  3618. return function() {
  3619. e && ic(s, e.toLowerCase(), {
  3620. background: d.chatBackgroundHighlight
  3621. })
  3622. }
  3623. }(b);
  3624. n.onmouseout = function(s) {
  3625. return function() {
  3626. e && ic(s, e.toLowerCase(), {
  3627. background: d.chatBackground
  3628. })
  3629. }
  3630. }(b)
  3631. }
  3632. if (g) n.onclick = function() {
  3633. g(e)
  3634. };
  3635. u({
  3636. fontFamily: d.nickFontFamily,
  3637. fontSize: d.nickFontSize + "px",
  3638. color: f
  3639. }, n.style);
  3640. e && n.appendChild(c.ownerDocument.createTextNode(d.chatOutputNickLeft + e + d.chatOutputNickRight))
  3641. }
  3642. n && !d.chatOutputRTL && c.appendChild(n);
  3643. if (l) try {
  3644. k.reset();
  3645. j && Rb(k, j);
  3646. k.r += l;
  3647. k.A(c)
  3648. } catch (o) {
  3649. x &&
  3650. A("Renderer", "Render error " + o, C)
  3651. } else c.style.height = "1em";
  3652. n && d.chatOutputRTL && c.appendChild(n)
  3653. }
  3654. ec.prototype.oc = function(b, c, d, e, f) {
  3655. u({
  3656. overflow: "hidden",
  3657. fontFamily: c.nickFontFamily,
  3658. paddingBottom: c.chatPaddingBottom + "px",
  3659. paddingTop: c.chatPaddingTop + "px",
  3660. paddingRight: "3px",
  3661. fontSize: c.nickFontSize + "px",
  3662. background: c.nickBackground,
  3663. color: e
  3664. }, b.style);
  3665. if (f) b.onclick = function() {
  3666. f(d)
  3667. };
  3668. if (c.chatBackgroundLines != "") b.style.borderTop = "1px solid " + c.nickBackground;
  3669. if (c.nickBorderRight)
  3670. if (c.chatOutputRTL) b.style.borderLeft = "1px solid " + c.nickBorderRight;
  3671. else b.style.borderRight = "1px solid " + c.nickBorderRight;
  3672. b.setAttribute("align", c.chatOutputRTL ? "left" : "right");
  3673. b.setAttribute("valign", c.nickVerticalAlign);
  3674. if (c.chatOutputRTL) b.style.direction = "rtl";
  3675. b.appendChild(b.ownerDocument.createTextNode(d ? d : " "));
  3676. if (c.chatBackgroundHighlight) {
  3677. b.onmouseover = function(g) {
  3678. return function() {
  3679. d && ic(g, d.toLowerCase(), {
  3680. background: c.chatBackgroundHighlight
  3681. })
  3682. }
  3683. }(this);
  3684. b.onmouseout = function(g) {
  3685. return function() {
  3686. d && ic(g, d.toLowerCase(), {
  3687. background: c.chatBackground
  3688. })
  3689. }
  3690. }(this)
  3691. }
  3692. };
  3693. ec.prototype.pc = function(b, c, d) {
  3694. function e(j, n, o) {
  3695. for (j = "" + j; j.length < n;) j = o + j;
  3696. return j
  3697. }
  3698.  
  3699. function f(j, n) {
  3700. n = n.replace(/%H/g, e(j.getHours(), 2, "0"));
  3701. n = n.replace(/%I/g, e(j.getHours() % 12 || 12, 2, "0"));
  3702. n = n.replace(/%k/g, e(j.getHours(), 2, " "));
  3703. n = n.replace(/%l/g, e(j.getHours() % 12 || 12, 2, " "));
  3704. n = n.replace(/%M/g, e(j.getMinutes(), 2, "0"));
  3705. n = n.replace(/%p/g, j.getHours() > 11 ? "PM" : "AM");
  3706. n = n.replace(/%P/g, j.getHours() > 11 ? "pm" : "am");
  3707. n = n.replace(/%S/g, e(j.getSeconds(), 2, "0"));
  3708. n = n.replace(/%Y/g, j.getFullYear());
  3709. n = n.replace(/%y/g,
  3710. e(j.getYear() % 100, 2, "0"));
  3711. n = n.replace(/%m/g, e(j.getMonth() + 1, 2, "0"));
  3712. n = n.replace(/%b/g, g[j.getMonth()].substring(0, 3));
  3713. n = n.replace(/%B/g, g[j.getMonth()]);
  3714. n = n.replace(/%a/g, h[j.getDay()].substring(0, 3));
  3715. n = n.replace(/%A/g, h[j.getDay()]);
  3716. n = n.replace(/%d/g, e(j.getDate(), 2, "0"));
  3717. n = n.replace(/%e/g, e(j.getDate(), 2, " "));
  3718. return n = n.replace(/%%/g, "%")
  3719. }
  3720. u({
  3721. overflow: "hidden",
  3722. fontFamily: c.timeFontFamily,
  3723. paddingBottom: c.chatPaddingBottom + "px",
  3724. paddingTop: c.chatPaddingTop + "px",
  3725. paddingLeft: "2px",
  3726. fontSize: c.timeFontSize +
  3727. "px",
  3728. color: c.timeColor,
  3729. background: c.timeBackground
  3730. }, b.style);
  3731. if (c.chatBackgroundLines != "") b.style.borderTop = "1px solid " + c.timeBackground;
  3732. if (c.timeBorderRight)
  3733. if (c.chatOutputRTL) b.style.borderLeft = "1px solid " + c.timeBorderRight;
  3734. else b.style.borderRight = "1px solid " + c.timeBorderRight;
  3735. b.setAttribute("align", c.chatOutputRTL ? "right" : "left");
  3736. b.setAttribute("valign", c.nickVerticalAlign);
  3737. if (c.chatOutputRTL) b.style.direction = "rtl";
  3738. var g = ["January", "February", "March", "April", "May", "June", "July", "August", "September",
  3739. "October", "November", "December"
  3740. ],
  3741. h = ["Sunday", "Monday", "Tuesday", "Wednesday", "Thursday", "Friday", "Saturday"];
  3742. if (d) {
  3743. var k = new Date;
  3744. k.setTime(d);
  3745. d = new Date;
  3746. var l = "";
  3747. l = k.getYear() == d.getYear() && k.getMonth() == d.getMonth() && k.getDate() == d.getDate() ? f(k, c.formatTime) : f(k, c.formatDate);
  3748. b.appendChild(b.ownerDocument.createTextNode(l))
  3749. } else b.appendChild(b.ownerDocument.createTextNode(" "))
  3750. };
  3751.  
  3752. function mc(b, c, d) {
  3753. this.element = b;
  3754. this.d = b.ownerDocument;
  3755. this.a = c;
  3756. this.Bh = d;
  3757. this.Bd = false
  3758. }
  3759.  
  3760. function nc(b, c) {
  3761. if (b.Bd) b.Hc.style.display = c ? "none" : "block"
  3762. }
  3763.  
  3764. function oc(b, c, d, e) {
  3765. b.clear();
  3766. if (!e) {
  3767. var f = b.d.createElement("div");
  3768. u({
  3769. textAlign: "right",
  3770. overflow: "hidden",
  3771. height: "15px",
  3772. borderBottom: "1px solid #000",
  3773. padding: "4px",
  3774. fontSize: "13px",
  3775. fontWeight: "bold",
  3776. background: "#ccc"
  3777. }, f.style);
  3778. var g = b.d.createElement("span");
  3779. u({
  3780. color: "#222",
  3781. cursor: "pointer",
  3782. textDecoration: "underline"
  3783. }, g.style);
  3784. g.onclick = function(k) {
  3785. return function() {
  3786. k.clear();
  3787. d();
  3788. return false
  3789. }
  3790. }(b);
  3791. g.appendChild(b.d.createTextNode("Close"));
  3792. if (c) {
  3793. var h = b.d.createElement("a");
  3794. h.style.color = "#222";
  3795. h.href = c;
  3796. h.target = "_blank";
  3797. h.appendChild(b.d.createTextNode("Pop out"));
  3798. h.onclick = function(k) {
  3799. return function() {
  3800. k.clear();
  3801. d();
  3802. return true
  3803. }
  3804. }(b);
  3805. f.appendChild(h);
  3806. f.appendChild(b.d.createTextNode(" | "))
  3807. }
  3808. f.appendChild(g);
  3809. b.element.appendChild(f)
  3810. }
  3811. b.Hc = b.d.createElement("div");
  3812. u({
  3813. position: "absolute",
  3814. top: "24px",
  3815. bottom: "0px",
  3816. left: "0px",
  3817. right: "0px"
  3818. }, b.Hc.style);
  3819. if (e) b.Hc.style.top = "0px";
  3820. b.element.appendChild(b.Hc);
  3821. return b.Hc
  3822. }
  3823. mc.prototype.clear = function() {
  3824. for (; this.element.firstChild;) this.element.removeChild(this.element.firstChild)
  3825. };
  3826.  
  3827. function pc(b, c, d, e) {
  3828. b.Bd = true;
  3829. d = oc(b, c, d, e);
  3830. b.T = b.d.createElement("iframe");
  3831. b.T.style.width = "100%";
  3832. b.T.style.height = "100%";
  3833. b.T.style.minHeight = "100%";
  3834. d.appendChild(b.T);
  3835. b.T.src = c
  3836. }
  3837.  
  3838. function qc(b, c, d) {
  3839. pc(b, "https://docs.google.com/viewer?url=" + encodeURIComponent(c) + "&embedded=true", d)
  3840. }
  3841. mc.prototype.Ae = function(b) {
  3842. try {
  3843. this.T.contentWindow.mibbit_recv(b)
  3844. } catch (c) {}
  3845. };
  3846.  
  3847. function rc(b, c, d, e) {
  3848. b.Bd = false;
  3849. b = oc(b, d, e);
  3850. d = 100;
  3851. e = 81;
  3852. try {
  3853. if (b.offsetWidth / b.offsetHeight < 425 / 344) {
  3854. d = b.offsetWidth;
  3855. e = Math.floor(d * 344 / 425)
  3856. } else {
  3857. e = b.offsetHeight;
  3858. d = Math.floor(e * 425 / 344)
  3859. }
  3860. } catch (f) {}
  3861. b.style.textAlign = "center";
  3862. b.innerHTML = '<object style="margin:auto" width="' + d + '" height="' + e + '"><param name="movie" value="https://www.youtube.com/v/' + c + '&hl=en&fs=1"></param><param name="allowFullScreen" value="true"></param><embed src="https://www.youtube.com/v/' + c + '&hl=en&fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="' +
  3863. d + '" height="' + e + '"></embed></object>'
  3864. }
  3865.  
  3866. function sc(b, c, d) {
  3867. b.Bd = false;
  3868. var e = oc(b, c, d),
  3869. f = b.d.createElement("img");
  3870. e.style.textAlign = "center";
  3871. e.appendChild(f);
  3872. f.onload = function() {
  3873. return function() {
  3874. if (f.width > e.offsetWidth || f.height > e.offsetHeight) try {
  3875. if (e.offsetWidth / e.offsetHeight > f.width / f.height) {
  3876. f.style.width = "auto";
  3877. f.style.height = "100%"
  3878. } else {
  3879. f.style.width = "100%";
  3880. f.style.height = "auto"
  3881. }
  3882. } catch (g) {}
  3883. }
  3884. }();
  3885. f.src = c
  3886. }
  3887.  
  3888. function tc(b) {
  3889. this.p = b;
  3890. this.d = b.ownerDocument;
  3891. this.id = tc.kh++;
  3892. this.loaded = false;
  3893. this.T = this.d.createElement("iframe");
  3894. this.T.attachEvent ? this.T.attachEvent("onload", function(c) {
  3895. return function() {
  3896. uc(c)
  3897. }
  3898. }(this)) : this.T.addEventListener("load", function(c) {
  3899. return function() {
  3900. uc(c)
  3901. }
  3902. }(this), false);
  3903. this.T.style.width = "100%";
  3904. this.T.style.height = "100%";
  3905. this.T.frameBorder = "0";
  3906. b.appendChild(this.T)
  3907. }
  3908.  
  3909. function uc(b) {
  3910. b.me = b.T.contentDocument ? b.T.contentDocument : b.T.contentWindow ? b.T.contentWindow.document : null;
  3911. if (b.me != null) try {
  3912. b.me.designMode = "on";
  3913. b.loaded = true;
  3914. b.T.contentWindow.focus()
  3915. } catch (c) {
  3916. x && A("PasteBin", "Can't set designMode", C)
  3917. } else x && A("PasteBin", "Can't find doc...", C)
  3918. }
  3919. tc.prototype.Kd = function(b) {
  3920. this.p.style.display = b ? "block" : "none";
  3921. if (b) {
  3922. if (!this.loaded) this.T.src = "/e.html";
  3923. window.setTimeout(function(c) {
  3924. return function() {
  3925. c.loaded || uc(c)
  3926. }
  3927. }(this), 100)
  3928. }
  3929. };
  3930. tc.prototype.vb = function() {
  3931. return this.p.style.display == "block"
  3932. };
  3933. tc.prototype.value = function() {
  3934. var b = this.me.body.innerHTML;
  3935. b = b.replace(/<br>/gi, "\n");
  3936. b = b.replace(/<p>/i, "");
  3937. b = b.replace(/<p>/gi, "\n");
  3938. b = b.replace(/<\/td>/gi, "\t");
  3939. b = b.replace(/<\/tr>/gi, "\n");
  3940. b = b.replace(/<\/div>/gi, "\n");
  3941. b = b.replace(/<\/pre>/gi, "\n");
  3942. b = b.replace(/<.*?>/g, "");
  3943. b = b.replace(/&nbsp;/gi, " ");
  3944. b = b.replace(/&lt;/gi, "<");
  3945. b = b.replace(/&gt;/gi, ">");
  3946. return b = b.replace(/&amp;/gi, "&")
  3947. };
  3948.  
  3949. function vc(b) {
  3950. u({
  3951. overflow: "hidden",
  3952. fontFamily: "Arial,Helvetica,sans-serif",
  3953. paddingBottom: "1px",
  3954. paddingTop: "1px",
  3955. paddingLeft: "3px",
  3956. fontSize: "13px",
  3957. borderTop: "1px solid #c8c8ff"
  3958. }, b.style);
  3959. b.setAttribute("valign", "top");
  3960. var c = b.ownerDocument,
  3961. d = c.createElement("table");
  3962. u({
  3963. padding: "2px",
  3964. border: "1px solid #444",
  3965. background: "#cce",
  3966. fontSize: "11px"
  3967. }, d.style);
  3968. d.border = 0;
  3969. d.setAttribute("border", "0");
  3970. d.setAttribute("cellpadding", "2");
  3971. d.setAttribute("cellspacing", "0");
  3972. var e = d.insertRow(-1);
  3973. u({
  3974. background: "#aac",
  3975. borderBottom: "1px solid #444"
  3976. }, e.style);
  3977. e = e.insertCell(-1);
  3978. e.setAttribute("colspan", "2");
  3979. e.colSpan = "2";
  3980. u({
  3981. fontWeight: "bold",
  3982. fontSize: "13px",
  3983. textAlign: "center"
  3984. }, e.style);
  3985. e.appendChild(c.createTextNode("Mibbit help"));
  3986. e = {
  3987. help: "Display this help",
  3988. clear: "Clear the chat output in this channel",
  3989. "query nick [msg]": "Open a PM to a user, with an optional message",
  3990. "ignore nick": "Ignore the user in this channel",
  3991. "unignore nick": "Unignore the user in this channel",
  3992. ulshow: "Show the user list",
  3993. ulhide: "Hide the user list",
  3994. "showurl url": "Show a url/media next to the chat",
  3995. pastebin: "Show the pastebin",
  3996. "server addr [nick]": "Connect to another server"
  3997. };
  3998. for (var f in e)
  3999. if (e.hasOwnProperty(f) && e.hasOwnProperty(f)) {
  4000. var g = d.insertRow(-1),
  4001. h = g.insertCell(-1);
  4002. h.setAttribute("valign", "top");
  4003. h.appendChild(c.createTextNode("/" + f));
  4004. h.style.color = "green";
  4005. h.style.paddingRight = "2px";
  4006. g = g.insertCell(-1);
  4007. g.setAttribute("valign", "top");
  4008. g.appendChild(c.createTextNode(e[f]));
  4009. g.style.color = "#444"
  4010. }
  4011. c = c.createElement("div");
  4012. c.style.border = "none";
  4013. c.style.padding = "5px";
  4014. c.appendChild(d);
  4015. b.appendChild(c)
  4016. }
  4017.  
  4018. function wc(b, c, d) {
  4019. return function(e) {
  4020. u({
  4021. overflow: "hidden",
  4022. fontFamily: "Arial, Helvetica, sans-serif",
  4023. paddingBottom: "1px",
  4024. paddingTop: "1px",
  4025. paddingLeft: "3px",
  4026. borderTop: "1px solid #c8c8ff"
  4027. }, e.style);
  4028. e.setAttribute("valign", "top");
  4029. var f = e.ownerDocument,
  4030. g = f.createElement("table");
  4031. g.border = 0;
  4032. g.setAttribute("border", "0");
  4033. g.setAttribute("cellpadding", "0");
  4034. g.setAttribute("cellspacing", "0");
  4035. u({
  4036. fontSize: c.chatFontSize + "px",
  4037. width: "100%",
  4038. background: "#bbb",
  4039. border: "1px solid #222"
  4040. }, g.style);
  4041. var h = g.insertRow(-1);
  4042. h.style.borderBottom = "1px solid #222";
  4043. var k = h.insertCell(-1);
  4044. k.colSpan = "2";
  4045. u({
  4046. fontWeight: "bold",
  4047. fontSize: "17px",
  4048. color: "#6cb12a",
  4049. padding: "2px",
  4050. background: "url(https://s3.amazonaws.com/mibbit/gfx/bottom-bg.png)"
  4051. }, k.style);
  4052. h = f.createElement("img");
  4053. h.style.marginRight = "4px";
  4054. D(h, "https://s3.amazonaws.com/mibbit/gfx/magnifier.png", 16, 16);
  4055. k.appendChild(h);
  4056. k.appendChild(f.createTextNode("Whois " + b.nick + "?"));
  4057. var l = g.insertRow(-1),
  4058. j = l.insertCell(-1);
  4059. j.setAttribute("valign", "top");
  4060. j.style.borderRight = "1px solid #222";
  4061. j.style.width = "64px";
  4062. h = f.createElement("img");
  4063. h.style.margin = "4px";
  4064. D(h, "https://s3.amazonaws.com/mibbit/gfx/user" + (b.mibbituser ? "_green" : "") + ".png", 64, 64);
  4065. j.appendChild(h);
  4066. j = l.insertCell(-1);
  4067. j.setAttribute("valign", "top");
  4068. var n = f.createElement("table");
  4069. j.appendChild(n);
  4070. var o = {
  4071. nick: "Nickname",
  4072. user: "Username",
  4073. host: "Hostname",
  4074. realip: "IP",
  4075. realhost: "Host",
  4076. idd: "Identified",
  4077. realname: "Real name",
  4078. away: "Away message",
  4079. server: "Server",
  4080. ssl: "SSL",
  4081. modes: "Modes",
  4082. help: "Help",
  4083. operator: "Operator",
  4084. serverinfo: "Server info",
  4085. idle: "Idle time",
  4086. channels: "Channels",
  4087. client: "IRC Client",
  4088. browser: "Browser",
  4089. backend: "Backend",
  4090. connectip: "Connect IP"
  4091. };
  4092. for (var s in o)
  4093. if (o.hasOwnProperty(s) && b.hasOwnProperty(s)) {
  4094. var w = o[s],
  4095. p = n.insertRow(-1),
  4096. r = p.insertCell(-1);
  4097. p = p.insertCell(-1);
  4098. r.setAttribute("valign", "top");
  4099. r.style.whiteSpace = "nowrap";
  4100. p.setAttribute("valign", "top");
  4101. r.appendChild(f.createTextNode(w + ":"));
  4102. r.style.color = "#464";
  4103. r.style.textAlign = "right";
  4104. r.style.paddingRight = "2px";
  4105. d.reset();
  4106. d.r += b[s];
  4107. d.A(p)
  4108. }
  4109. if (b.mibbituser) {
  4110. k.colSpan =
  4111. "3";
  4112. j.style.borderRight = "1px solid #222";
  4113. j.style.width = "45%";
  4114. r = l.insertCell(-1);
  4115. r.setAttribute("valign", "top");
  4116. var y = f.createElement("table");
  4117. r.appendChild(y);
  4118.  
  4119. function z(P, N) {
  4120. var I = y.insertRow(-1),
  4121. J = I.insertCell(-1);
  4122. I = I.insertCell(-1);
  4123. J.setAttribute("valign", "top");
  4124. J.appendChild(f.createTextNode(P + ":"));
  4125. J.style.color = "#464";
  4126. J.style.textAlign = "right";
  4127. J.style.paddingRight = "2px";
  4128. J.style.whiteSpace = "nowrap";
  4129. I.setAttribute("valign", "top");
  4130. I.style.color = "#000";
  4131. I.appendChild(f.createTextNode(N))
  4132. }
  4133.  
  4134. function B(P,
  4135. N) {
  4136. var I = y.insertRow(-1),
  4137. J = I.insertCell(-1);
  4138. I = I.insertCell(-1);
  4139. J.setAttribute("valign", "top");
  4140. J.appendChild(f.createTextNode(P + ":"));
  4141. J.style.color = "#464";
  4142. J.style.textAlign = "right";
  4143. J.style.paddingRight = "2px";
  4144. J.style.whiteSpace = "nowrap";
  4145. I.setAttribute("valign", "top");
  4146. I.style.color = "#000";
  4147. P = f.createElement("a");
  4148. P.href = N;
  4149. P.target = "_blank";
  4150. P.style.color = "blue";
  4151. P.appendChild(f.createTextNode(N));
  4152. I.appendChild(P)
  4153. }
  4154. b.mibbitusername && z("Mibbit username", b.mibbitusername);
  4155. z("On Mibbit for", b.onlinetime);
  4156. b.cc &&
  4157. z("Country", b.cc);
  4158. if (b.ct && b.tz) {
  4159. function H(P) {
  4160. return ("00" + P).substr(-2)
  4161. }
  4162. k = new Date(parseInt(b.ct));
  4163. k = H(k.getUTCHours()) + ":" + H(k.getUTCMinutes()) + ":" + H(k.getUTCSeconds());
  4164. l = "+";
  4165. if (b.tz < 0) {
  4166. l = "-";
  4167. b.tz = -b.tz
  4168. }
  4169. j = H(Math.floor(b.tz / 60));
  4170. n = H(b.tz - 60 * j);
  4171. z("Local time", k + " UTC" + l + j + n)
  4172. }
  4173. b.embed && z("Mibbit client", "Widget");
  4174. b.premium && z("Premium", "Yes");
  4175. if (b.profile) {
  4176. k = {
  4177. sex: "Sex",
  4178. age: "Age",
  4179. location: "Location",
  4180. homepage: "Web site"
  4181. };
  4182. l = ba(b.profile);
  4183. for (s in k)
  4184. if (k.hasOwnProperty(s) && l.hasOwnProperty(s)) s == "homepage" ?
  4185. B(k[s], l[s]) : z(k[s], l[s]);
  4186. if (l.avatar) h.src = l.avatar
  4187. }
  4188. }
  4189. s = f.createElement("div");
  4190. s.style.border = "none";
  4191. s.style.padding = "5px";
  4192. s.appendChild(g);
  4193. e.appendChild(s)
  4194. }
  4195. }
  4196.  
  4197. function xc(b, c) {
  4198. return function(d) {
  4199. d.setAttribute("valign", "top");
  4200. u({
  4201. overflow: "hidden",
  4202. fontFamily: "Arial, Helvetica, sans-serif",
  4203. paddingBottom: "1px",
  4204. paddingTop: "1px",
  4205. paddingLeft: "3px",
  4206. fontSize: "13px",
  4207. borderTop: "1px solid #c8c8ff"
  4208. }, d.style);
  4209. var e = d.ownerDocument,
  4210. f = e.createElement("table");
  4211. u({
  4212. border: "1px solid #222",
  4213. background: "#bbb",
  4214. width: "100%"
  4215. }, f.style);
  4216. f.border = 0;
  4217. f.setAttribute("border", "0");
  4218. f.setAttribute("cellpadding", "0");
  4219. f.setAttribute("cellspacing", "0");
  4220. var g = f.insertRow(-1);
  4221. g.style.borderBottom =
  4222. "1px solid #222";
  4223. g = g.insertCell(-1);
  4224. u({
  4225. fontWeight: "bold",
  4226. fontSize: "17px",
  4227. color: "#ff0",
  4228. padding: "2px",
  4229. background: "url(https://s3.amazonaws.com/mibbit/gfx/bottom-bg.png)"
  4230. }, g.style);
  4231. var h = e.createElement("img");
  4232. h.style.marginRight = "4px";
  4233. D(h, "https://s3.amazonaws.com/mibbit/gfx/exclamation.png", 16, 16);
  4234. g.appendChild(h);
  4235. g.appendChild(e.createTextNode("Global message from Mibbit"));
  4236. h = e.createElement("span");
  4237. h.style.fontSize = "13px";
  4238. h.style.color = "#ddd";
  4239. h.appendChild(e.createTextNode(" (" + (new Date).toString() +
  4240. ")"));
  4241. g.appendChild(h);
  4242. g = f.insertRow(-1).insertCell(-1);
  4243. g.style.padding = "4px";
  4244. g.style.fontSize = "15px";
  4245. c.reset();
  4246. c.r += b;
  4247. c.A(g);
  4248. e = e.createElement("div");
  4249. e.style.border = "none";
  4250. e.style.padding = "5px";
  4251. e.appendChild(f);
  4252. d.appendChild(e)
  4253. }
  4254. }
  4255.  
  4256. function yc(b, c, d) {
  4257. return function(e) {
  4258. try {
  4259. u({
  4260. overflow: "hidden",
  4261. fontFamily: c.chatFontFamily,
  4262. paddingBottom: c.chatPaddingBottom + "px",
  4263. paddingTop: c.chatPaddingTop + "px",
  4264. paddingLeft: "3px",
  4265. fontSize: c.chatFontSize + "px",
  4266. color: c.colorBan,
  4267. background: c.chatBackground
  4268. }, e.style);
  4269. if (c.chatBackgroundLines != "") e.style.borderTop = "1px solid " + c.chatBackgroundLines;
  4270. e.setAttribute("valign", "top");
  4271. var f = e.ownerDocument;
  4272. if (d) {
  4273. var g = f.createElement("img");
  4274. D(g, "https://s3.amazonaws.com/mibbit/gfx/close-win-red.png", 12, 12);
  4275. g.style.marginRight = "4px";
  4276. g.border = 0;
  4277. g.title = "Remove ban";
  4278. g.style.cursor = "pointer";
  4279. g.onclick = function(o) {
  4280. return function() {
  4281. d(o);
  4282. return false
  4283. }
  4284. }(b.mask);
  4285. e.appendChild(g)
  4286. }
  4287. var h = f.createElement("span");
  4288. h.appendChild(f.createTextNode(b.mask + " "));
  4289. e.appendChild(h);
  4290. var k = f.createElement("span");
  4291. k.style.color = "#888";
  4292. k.appendChild(f.createTextNode(b.who + " "));
  4293. e.appendChild(k);
  4294. var l = new Date;
  4295. l.setTime(b.ctime * 1E3);
  4296. var j = f.createElement("span");
  4297. j.style.color = "#9c9";
  4298. j.appendChild(f.createTextNode("(" + l + ") "));
  4299. e.appendChild(j)
  4300. } catch (n) {
  4301. x && A("BanListRenderer", n, C)
  4302. }
  4303. }
  4304. }
  4305.  
  4306. function zc(b, c) {
  4307. this.URL = b;
  4308. this.hb = c;
  4309. this.onerror = q();
  4310. this.s = Ac();
  4311. this.Yc = null;
  4312. this.Xc = this.$b = 0;
  4313. this.tc = this.Ff = null;
  4314. this.Lb = [];
  4315. this.Za = null;
  4316. this.Of = this.Pf = this.fh = this.Nf = this.Mf = this.Wc = 0
  4317. }
  4318.  
  4319. function Ac() {
  4320. if (window.XMLHttpRequest) return new XMLHttpRequest;
  4321. else if (window.ActiveXObject) try {
  4322. return new ActiveXObject("Msxml2.XMLHTTP")
  4323. } catch (b) {
  4324. try {
  4325. return new ActiveXObject("Microsoft.XMLHTTP")
  4326. } catch (c) {}
  4327. }
  4328. alert("Giving up :( Cannot create an XMLHTTP instance");
  4329. return false
  4330. }
  4331.  
  4332. function Bc(b) {
  4333. function c(d, e) {
  4334. try {
  4335. b.setRequestHeader(d, e)
  4336. } catch (f) {}
  4337. }
  4338. if (!zc.jh) {
  4339. c("User-Agent", null);
  4340. c("Accept", null);
  4341. c("Accept-Language", null);
  4342. c("Content-Type", "M;");
  4343. c("Cookie", null);
  4344. c("Connection", "keep-alive");
  4345. c("Keep-Alive", null)
  4346. }
  4347. }
  4348. zc.prototype.G = function(b) {
  4349. b = t(b) + "\n";
  4350. var c = encodeURIComponent(b).replace(/%../g, "x").length;
  4351. if (c > 64E3) this.onerror("That packet will never get through! Too big. (MAX_POST_LEN=64000)");
  4352. else {
  4353. this.Lb.push({
  4354. data: b,
  4355. size: c,
  4356. stime: (new Date).getTime()
  4357. });
  4358. this.Yc || this.Za || this.Na(200)
  4359. }
  4360. };
  4361.  
  4362. function Cc(b) {
  4363. if (!(b.Yc || b.Lb.length === 0)) try {
  4364. b.Yc = "Sending...";
  4365. b.s.abort();
  4366. b.s.onreadystatechange = function(h) {
  4367. return function() {
  4368. h.Pe()
  4369. }
  4370. }(b);
  4371. try {
  4372. b.s.onerror = function(h) {
  4373. return function() {
  4374. h.Qe()
  4375. }
  4376. }(b)
  4377. } catch (c) {}
  4378. b.s.open("POST", b.URL + "-s" + (b.Pa == "" ? "" : "-" + b.Pa), true);
  4379. Bc(b.s);
  4380. b.Xc = "";
  4381. for (var d = b.$b = 0, e = 0; e < b.Lb.length; e++) {
  4382. if (d + b.Lb[e].size > 64E3) break;
  4383. var f = b.Lb[e].data;
  4384. f = '{"seq":' + b.Wc + "," + f.substring(1, f.length);
  4385. b.Wc++;
  4386. b.Xc += f;
  4387. b.$b++;
  4388. d += b.Lb[e].size
  4389. }
  4390. b.onerror("Sending " + b.$b + " packets... Length=" +
  4391. b.Xc.length + " Size=" + d);
  4392. b.s.send(b.Xc);
  4393. b.Ff = (new Date).getTime();
  4394. b.tc = window.setTimeout(function(h) {
  4395. return function() {
  4396. h.onerror("Timer: retrying...");
  4397. h.Na(5E3)
  4398. }
  4399. }(b), 12E4);
  4400. b.Mf++
  4401. } catch (g) {
  4402. b.onerror("flushSend error: " + g);
  4403. b.Na(5E3)
  4404. }
  4405. }
  4406. zc.prototype.Na = function(b) {
  4407. this.onerror("Retry(" + b + ")");
  4408. this.Za && window.clearTimeout(this.Za);
  4409. if (this.tc) {
  4410. window.clearTimeout(this.tc);
  4411. this.tc = null
  4412. }
  4413. if (this.s) try {
  4414. this.s.abort()
  4415. } catch (c) {}
  4416. this.s = Ac();
  4417. this.Yc = null;
  4418. this.Za = window.setTimeout(function(d) {
  4419. return function() {
  4420. d.Za = null;
  4421. Cc(d)
  4422. }
  4423. }(this), b)
  4424. };
  4425. zc.prototype.Qe = function() {
  4426. this.onerror("xhrError was called!");
  4427. this.Na(5E3)
  4428. };
  4429. zc.prototype.Pe = function() {
  4430. this.onerror("xhrChange...");
  4431. try {
  4432. if (this.s.readyState == 4) {
  4433. if (this.s.status == 200) {
  4434. try {
  4435. this.hb.psh && this.hb.psh(this.$b)
  4436. } catch (b) {}
  4437. this.Pf += this.$b;
  4438. for (var c = 0; c < this.$b; c++) this.Lb.shift();
  4439. this.$b = 0;
  4440. window.clearTimeout(this.tc);
  4441. this.tc = null;
  4442. var d = (new Date).getTime() - this.Ff;
  4443. this.hb.recv(this.s.responseText);
  4444. this.Nf++;
  4445. this.fh += d;
  4446. this.Of += this.Xc.length
  4447. } else throw new Error("Server status " + this.s.status);
  4448. this.Yc = null;
  4449. Cc(this)
  4450. }
  4451. } catch (e) {
  4452. this.onerror("xhrChange Exception " +
  4453. e);
  4454. this.Na(5E3)
  4455. }
  4456. };
  4457. zc.prototype.reset = function() {
  4458. this.onerror("reset called");
  4459. this.Wc = 0;
  4460. this.Lb = []
  4461. };
  4462.  
  4463. function Dc(b, c) {
  4464. this.URL = b;
  4465. this.Pa = "";
  4466. this.Fh = (new Date).getTime();
  4467. this.Le = false;
  4468. this.onerror = q();
  4469. this.hb = c;
  4470. this.O = [];
  4471. this.sb = [];
  4472. this.s = Ec();
  4473. this.Td = false;
  4474. this.Be = this.sc = this.rc = null;
  4475. this.wa = [];
  4476. this.Zb = 0;
  4477. this.Nd = null;
  4478. this.Ce = 0;
  4479. this.Za = null;
  4480. this.Sc = this.Oa = false;
  4481. this.$g = this.ah = this.eh = this.dh = this.bh = 0
  4482. }
  4483. Dc.prototype.reset = function() {
  4484. this.Pa = ""
  4485. };
  4486. Dc.prototype.stop = function() {
  4487. if (this.Oa != false) {
  4488. this.Gh = (new Date).getTime();
  4489. this.Oa = false;
  4490. try {
  4491. for (var b in this.O) this.O.hasOwnProperty(b) && this.O[b].close && this.O[b].close();
  4492. this.rc && this.s.abort();
  4493. var c = Ec();
  4494. c.open("POST", this.URL + "-s" + (this.Pa == "" ? "" : "-" + this.Pa), false);
  4495. c.send('{"cmd":"shutdown"}\n')
  4496. } catch (d) {
  4497. this.onerror("Shutdown failed " + d)
  4498. }
  4499. }
  4500. };
  4501.  
  4502. function Fc(b, c) {
  4503. if (c != b.Sc) {
  4504. for (var d in b.O)
  4505. if (b.O.hasOwnProperty(d)) try {
  4506. c ? b.O[d].Sc() : Gc(b.O[d])
  4507. } catch (e) {}
  4508. b.Sc = c;
  4509. try {
  4510. b.hb.ooh(c)
  4511. } catch (f) {}
  4512. }
  4513. }
  4514.  
  4515. function Ec() {
  4516. if (window.XMLHttpRequest) return new XMLHttpRequest;
  4517. else if (window.ActiveXObject) try {
  4518. return new ActiveXObject("Msxml2.XMLHTTP")
  4519. } catch (b) {
  4520. try {
  4521. return new ActiveXObject("Microsoft.XMLHTTP")
  4522. } catch (c) {}
  4523. }
  4524. alert("Giving up :( Cannot create an XMLHTTP instance");
  4525. return false
  4526. }
  4527. Dc.prototype.start = function() {
  4528. this.onerror("Starting...");
  4529. if (this.Oa) this.onerror("Already running...");
  4530. else {
  4531. this.Oa = true;
  4532. Hc(this)
  4533. }
  4534. };
  4535.  
  4536. function Hc(b) {
  4537. if (b.Ce > 5) b.onerror("Session changes not sticking!");
  4538. else if (!b.rc) {
  4539. b.onerror("Sending new request...");
  4540. b.s = Ec();
  4541. try {
  4542. b.rc = "Requesting...";
  4543. b.Td = false;
  4544. b.s.onreadystatechange = function(e) {
  4545. return function() {
  4546. e.Pe()
  4547. }
  4548. }(b);
  4549. try {
  4550. b.s.onerror = function(e) {
  4551. return function() {
  4552. e.Qe()
  4553. }
  4554. }(b)
  4555. } catch (c) {}
  4556. b.s.open("POST", b.URL + "-r" + (b.Pa == "" ? "" : "-" + b.Pa), true);
  4557. Bc(b.s);
  4558. b.s.send("{}");
  4559. b.Be = (new Date).getTime();
  4560. b.sc = window.setTimeout(function(e) {
  4561. return function() {
  4562. e.onerror("Recv timed out");
  4563. Fc(e, false);
  4564. e.Na()
  4565. }
  4566. }(b),
  4567. 15E4);
  4568. b.bh++
  4569. } catch (d) {
  4570. b.onerror("Exception when sending request: " + d);
  4571. Fc(b, false);
  4572. b.Na()
  4573. }
  4574. }
  4575. }
  4576. Dc.prototype.Na = function() {
  4577. this.Za && window.clearTimeout(this.Za);
  4578. if (this.sc) {
  4579. window.clearTimeout(this.sc);
  4580. this.sc = null
  4581. }
  4582. this.rc = null;
  4583. if (this.Oa) {
  4584. if (this.s) try {
  4585. this.s.abort()
  4586. } catch (b) {}
  4587. this.s = Ec();
  4588. this.Za = window.setTimeout(function(c) {
  4589. return function() {
  4590. c.Za = null;
  4591. Hc(c)
  4592. }
  4593. }(this), 5E3)
  4594. }
  4595. };
  4596. Dc.prototype.Qe = function() {
  4597. this.onerror("xhrError was called!");
  4598. Fc(this, false);
  4599. this.Na()
  4600. };
  4601. Dc.prototype.Pe = function() {
  4602. try {
  4603. this.onerror("xhrChange " + this.s.readyState);
  4604. if (this.s.readyState == 4) {
  4605. window.clearTimeout(this.sc);
  4606. this.sc = null;
  4607. this.onerror("xhrChange status=" + this.s.status);
  4608. if (this.s.status == 200) {
  4609. this.rc = "Parsing response...";
  4610. this.dh++;
  4611. this.eh += (new Date).getTime() - this.Be;
  4612. var b = this.s.responseText,
  4613. c = this.Tg !== "";
  4614. try {
  4615. Ic(this, b)
  4616. } catch (d) {}
  4617. var e = this.Tg !== "";
  4618. if (!c && !e) {
  4619. this.onerror("Could not get session ID!");
  4620. this.stop()
  4621. }
  4622. Fc(this, true)
  4623. } else throw new Error("Status " + this.s.status);
  4624. this.rc = null;
  4625. this.Oa && window.setTimeout(function(g) {
  4626. return function() {
  4627. Hc(g)
  4628. }
  4629. }(this), 10)
  4630. } else if (this.s.readyState == 1) this.Td = true
  4631. } catch (f) {
  4632. b = (new Date).getTime() - this.Be;
  4633. this.onerror("xhrChange " + f + " " + this.Td + " " + b);
  4634. if (!this.Td || b < 5E3) Fc(this, false);
  4635. this.Na()
  4636. }
  4637. };
  4638.  
  4639. function Jc(b, c, d) {
  4640. b.O[c] = d;
  4641. if (typeof b.sb[c] != "undefined") {
  4642. for (; b.sb[c].length > 0;) d.Ya(b.sb[c].shift());
  4643. delete b.sb[c]
  4644. }
  4645. }
  4646.  
  4647. function Kc(b, c) {
  4648. if (!b.O[c]) return false;
  4649. b.O[c].close && b.O[c].close();
  4650. delete b.O[c];
  4651. delete b.sb[c];
  4652. return true
  4653. }
  4654.  
  4655. function Ic(b, c) {
  4656. if (b.Oa) {
  4657. if (c) {
  4658. var d = c.split("\n");
  4659. b.$g += c.length;
  4660. for (c = 0; c < d.length; c++)
  4661. if (d[c] !== "") {
  4662. b.ah++;
  4663. var e;
  4664. try {
  4665. e = eval("(" + d[c] + ")")
  4666. } catch (f) {
  4667. b.onerror("parseResponse " + f + " " + d[c])
  4668. }
  4669. if (e)
  4670. if (typeof e.seq == "undefined") try {
  4671. b.hb.gph(e)
  4672. } catch (g) {
  4673. b.onerror("ProcessPackets.gph " + g)
  4674. } else b.wa.push(e)
  4675. }
  4676. }
  4677. Lc(b)
  4678. }
  4679. }
  4680.  
  4681. function Lc(b) {
  4682. for (var c = 0; b.wa.length > 0;) {
  4683. if (c > 10) {
  4684. window.setTimeout(function(j) {
  4685. return function() {
  4686. Lc(j)
  4687. }
  4688. }(b), 50);
  4689. return
  4690. }
  4691. if (b.wa[0].seq != b.Zb) {
  4692. for (b.wa.sort(function(j, n) {
  4693. return j.seq - n.seq
  4694. }); b.wa.length > 0 && !b.wa[0].sessionid && b.wa[0].seq < b.Zb;) {
  4695. b.onerror("Packet discarded:" + b.Zb + " : " + b.wa[0].seq);
  4696. b.wa.shift()
  4697. }
  4698. if (b.wa.length == 0) break
  4699. }
  4700. if (b.Nd && (new Date).getTime() - b.Nd > 1E4) {
  4701. b.Nd = null;
  4702. b.onerror("Blocked timeout, packet loss:" + b.Zb + " : " + b.wa[0].seq)
  4703. } else {
  4704. var d = b.wa[0];
  4705. if (!d.sessionid && d.seq != b.Zb) {
  4706. b.onerror("Waiting for packet no: " +
  4707. b.Zb);
  4708. b.Nd = (new Date).getTime();
  4709. break
  4710. }
  4711. }
  4712. d = b.wa.shift();
  4713. c++;
  4714. b.Zb = d.seq + 1;
  4715. try {
  4716. if (d.sessionid) {
  4717. b.Ce++;
  4718. b.Pa = d.sessionid;
  4719. try {
  4720. b.hb.ssh(b.Pa, d)
  4721. } catch (e) {
  4722. b.onerror("ProcessPackets.ssh " + e)
  4723. }
  4724. b.Le || b.Na()
  4725. } else b.Ce = 0;
  4726. if (d.allchannels == "true")
  4727. for (var f in b.O) b.O.hasOwnProperty(f) && b.O[f].Ya(d);
  4728. else if (d.channel)
  4729. if (d.cmd == "close") Kc(b, d.channel);
  4730. else if (b.O[d.channel]) try {
  4731. b.O[d.channel].Ya(d)
  4732. } catch (g) {} else {
  4733. var h = false;
  4734. if (!b.sb[d.channel]) {
  4735. h = true;
  4736. b.sb[d.channel] = []
  4737. }
  4738. b.sb[d.channel].push(d);
  4739. if (h) b.hb.nch(d.channel,
  4740. d) || delete b.sb[d.channel]
  4741. } else try {
  4742. b.hb.gph(d)
  4743. } catch (k) {
  4744. b.onerror("ProcessPackets.gph " + k)
  4745. }
  4746. } catch (l) {
  4747. b.onerror("ProcessPackets " + l + " " + d)
  4748. }
  4749. }
  4750. }
  4751.  
  4752. function Mc(b, c) {
  4753. b.Ig = b.start;
  4754. b.Le = true;
  4755. b.start = function() {
  4756. if (!this.Oa) {
  4757. this.Oe = function(f) {
  4758. return function() {
  4759. f.onerror("websocket failed");
  4760. f.start = this.Ig;
  4761. f.Le = false;
  4762. c.G = c.Hg;
  4763. try {
  4764. f.zb.onopen = q();
  4765. f.zb.onmessage = q();
  4766. f.zb.onclose = q();
  4767. f.zb.close()
  4768. } catch (g) {}
  4769. f.Oa = false;
  4770. Fc(f, false);
  4771. f.start()
  4772. }
  4773. }(this);
  4774. this.Ua = window.setTimeout(function(f) {
  4775. return function() {
  4776. f.Oe()
  4777. }
  4778. }(this), 5E3);
  4779. this.Ne = [];
  4780. this.Lh = [];
  4781. try {
  4782. this.zb = new WebSocket("ws" + (window.location.protocol.toLowerCase() == "http:" ? "" : "s") + "://" + window.location.host +
  4783. "/mibbit")
  4784. } catch (d) {
  4785. try {
  4786. this.zb = new MozWebSocket("ws" + (window.location.protocol.toLowerCase() == "http:" ? "" : "s") + "://" + window.location.host + "/mibbit")
  4787. } catch (e) {
  4788. this.Oe();
  4789. if (this.Ua) {
  4790. window.clearTimeout(this.Ua);
  4791. delete this.Ua
  4792. }
  4793. }
  4794. }
  4795. this.zb.onopen = function(f) {
  4796. return function() {
  4797. f.onerror("Using a websocket");
  4798. f.Oa = true;
  4799. Fc(f, true)
  4800. }
  4801. }(this);
  4802. this.zb.onmessage = function(f) {
  4803. return function(g) {
  4804. if (f.Ua) {
  4805. window.clearTimeout(f.Ua);
  4806. delete f.Ua
  4807. }
  4808. Ic(f, g.data);
  4809. f.Pa != "" && setTimeout(function() {
  4810. return function() {
  4811. for (; f.Ne.length >
  4812. 0;) c.G(f.Ne.shift())
  4813. }
  4814. }(), 0)
  4815. }
  4816. }(this);
  4817. this.zb.onclose = function(f) {
  4818. return function() {
  4819. f.onerror("websocket closed");
  4820. Fc(f, false);
  4821. f.Oa = false;
  4822. if (f.Ua) {
  4823. window.clearTimeout(f.Ua);
  4824. delete f.Ua;
  4825. f.Oe()
  4826. } else f.start()
  4827. }
  4828. }(this)
  4829. }
  4830. };
  4831. c.Hg = c.G;
  4832. c.G = function(d) {
  4833. return function(e) {
  4834. this.Ua && wsAttempted.push(e);
  4835. if (d.Sc) {
  4836. e = t(e) + "\n";
  4837. e = '{"seq":' + this.Wc + "," + e.substring(1, e.length);
  4838. this.Wc++;
  4839. c.Mf++;
  4840. d.zb.send(e);
  4841. c.Nf++;
  4842. c.Pf++;
  4843. c.Of += e.length
  4844. } else d.Ne.push(e)
  4845. }
  4846. }(b)
  4847. }
  4848.  
  4849. function Nc() {
  4850. this.ie = this.mg = null;
  4851. this.Rf = true;
  4852. this.ye = false;
  4853. this.Uf = {};
  4854. this.ne = {};
  4855. this.j = {};
  4856. this.i = {};
  4857. this.lg = function(b, c) {
  4858. try {
  4859. var d = "IRCClient:" + b + ":" + c;
  4860. x && A("embedChannel", d, K);
  4861. var e = new Oc(null, "IRCClient:" + b, this, F);
  4862. e.sg = true;
  4863. this.j["IRCClient:" + b] = e;
  4864. var f = document.getElementById("chats"),
  4865. g = document.createElement("div");
  4866. f.appendChild(g);
  4867. fulltitle = c + " (channel)";
  4868. var h = !(c.substring(0, 1) == "#" || c.substring(0, 1) == "&" || c.substring(0, 1) == "!"),
  4869. k = new Pc(d, g, c, "IRCClient:" + b, e, h, F);
  4870. k.b.U.Te = false;
  4871. k.b.U.Ue =
  4872. this.Rf;
  4873. e.b = k.b;
  4874. this.i[d] = k;
  4875. e.i[d] = k;
  4876. var l = h ? {
  4877. background: F.tabColorPM,
  4878. border: F.tabBColorPM
  4879. } : {
  4880. background: F.tabColorChannel,
  4881. border: F.tabBColorChannel
  4882. },
  4883. j = Lb(Q, d, g, c, fulltitle, function() {
  4884. return function(o, s) {
  4885. k.b.Bb(s)
  4886. }
  4887. }(this), function(o) {
  4888. return function() {
  4889. !e.ya || !F.confirmServerClose ? Qc(o, b) : o.ce(b)
  4890. }
  4891. }(this), l, false, true);
  4892. F.focusNewJoins && this.i[d].b.Bb(true);
  4893. this.i[d].W = j;
  4894. Jc(S, d, this.i[d]);
  4895. Jc(S, "IRCClient:" + b, e)
  4896. } catch (n) {
  4897. x && A("embedChannel", "Exception " + n, C)
  4898. }
  4899. };
  4900. this.Ya = function(b) {
  4901. x && A("IRCClient.recv",
  4902. "p.cmd=" + b.cmd, M);
  4903. try {
  4904. if (b.cmd == "connected") {
  4905. T && T.Wb({
  4906. cmd: "connected"
  4907. });
  4908. if (!this.ye)
  4909. if (Rc) {
  4910. ob = true;
  4911. Adverts.Ee(true)
  4912. }
  4913. var c = "IRCClient:" + b.name;
  4914. if (this.ie && this.ie.toLowerCase() == b.name.toLowerCase()) this.lg(b.name, this.mg);
  4915. else if (!this.j[c]) {
  4916. var d = true;
  4917. if (Rc) d = false;
  4918. var e = document.getElementById("chats"),
  4919. f = document.createElement("div");
  4920. f.style.display = d ? "none" : "block";
  4921. e.appendChild(f);
  4922. var g = new Oc(f, c, this, F);
  4923. this.j[c] = g;
  4924. var h = b.name;
  4925. if (b.network) h = b.network;
  4926. this.j[c].Sg = h;
  4927. var k = Lb(Q, c, f, h, "IRC server " +
  4928. b.name,
  4929. function() {
  4930. return function(w, p) {
  4931. g.b.Bb(p)
  4932. }
  4933. }(this),
  4934. function(w) {
  4935. return function() {
  4936. !g.ya || !F.confirmServerClose ? Qc(w, b.name) : w.ce(b.name)
  4937. }
  4938. }(this), {
  4939. background: F.tabColorServer,
  4940. border: F.tabBColorServer
  4941. }, d, true, false, true);
  4942. this.j[c].W = k;
  4943. Jc(S, c, this.j[c]);
  4944. !Rc && b.network && Sc(this.j[c].b, "//clientsearch.mibbit.com/client/channels/" + encodeURIComponent(b.network), true)
  4945. }
  4946. } else if (b.cmd == "confailed") b.name != "" && this.If(b.name, b.reason);
  4947. else if (b.cmd == "blacklisted") {
  4948. x && A("IRCClient.recv", "BLACKLISTED", C);
  4949. alert("Your IP address is listed in a blacklist. You may have a virus, trojan or be running an open proxy.\nYou will now be redirected to dronebl.org for more information.");
  4950. window.location = "http://dronebl.org/lookup"
  4951. } else if (b.cmd == "checkconnect") x && A("IRCClient.recv", "checkconnect " + b.allowed, M);
  4952. else if (b.cmd == "disconnected") {
  4953. T && T.Wb({
  4954. cmd: "disconnected"
  4955. });
  4956. Adverts.Ee(false);
  4957. x && A("IRCClient.recv", b, M);
  4958. b.force || this.Jf(b.name, b.reason);
  4959. var l = "IRCClient:" + b.name;
  4960. if (this.j[l]) {
  4961. Kc(S, l);
  4962. this.j[l].closed(!!b.reason &&
  4963. !b.force);
  4964. delete this.j[l]
  4965. }
  4966. Tc("ircdisconnect")
  4967. } else if (b.cmd == "keyaccept") {
  4968. try {
  4969. Q.yg.parentNode.removeChild(Q.yg)
  4970. } catch (j) {}
  4971. this.ye = true;
  4972. x && A("server", "PREMIUM", C);
  4973. Adverts.fe();
  4974. ob = false
  4975. } else if (b.cmd == "sysmsg") x && A("server", b.data, K);
  4976. else if (b.cmd == "status") {
  4977. Uc("irc", b.connections, b.pending, b.pendingDNS, b.hostname, b.pendingSettings, b.readyToConnect);
  4978. x && A("server", "Status: " + t(b), K)
  4979. } else if (b.cmd == "linkinfo") {
  4980. x && A("IRCClient.recv", "Link info: " + b, K);
  4981. d = document.getElementById(b.linkid);
  4982. var n = document.getElementById(b.linkid +
  4983. "_i");
  4984. if (d && n) {
  4985. c = "";
  4986. if (b.followed) c = b.followed;
  4987. else
  4988. for (var o in b.idata)
  4989. if (b.idata.hasOwnProperty(o) && o != "thumb") c = c + o.toUpperCase() + ": " + b.idata[o] + " \n";
  4990. d.title = c;
  4991. d.style.color = F.qh;
  4992. n.title = c;
  4993. if (b.idata.thumb) d.src = b.idata.thumb
  4994. } else x && A("IRCClient.recv", "Link not found :/ " + b.linkid, C)
  4995. } else x && A("IRCClient.recv", b, M)
  4996. } catch (s) {
  4997. x && A("IRCClient.recv", "exception " + b + ":" + s, C)
  4998. }
  4999. };
  5000. this.Gg = function() {
  5001. x && A("IRCClient.notifyServersDisconnect", "notifyServersDisconnect", K);
  5002. Tc("ircdisconnect");
  5003. try {
  5004. for (rname in this.j) this.j.hasOwnProperty(rname) &&
  5005. this.j[rname].ic()
  5006. } catch (b) {
  5007. x && A("IRCClient.notifyServersDisconnect", "exception ", C)
  5008. }
  5009. };
  5010. this.wh = function() {
  5011. Tc("ircdisconnect");
  5012. for (rname in this.j) this.j.hasOwnProperty(rname) && this.j[rname].closed(false);
  5013. this.j = {}
  5014. };
  5015. this.kf = 0;
  5016. this.Og = function(b) {
  5017. var c = "GLOB" + this.kf;
  5018. this.kf++;
  5019. var d = function(e) {
  5020. return function() {
  5021. for (rname in e.j) e.j.hasOwnProperty(rname) && Vc(e.j[rname], c)
  5022. }
  5023. }(this);
  5024. for (rname in this.j) this.j.hasOwnProperty(rname) && Wc(this.j[rname], c, b, d)
  5025. };
  5026. this.Ch = function(b) {
  5027. for (rname in this.j)
  5028. if (this.j.hasOwnProperty(rname)) {
  5029. Xc(this.j[rname],
  5030. b);
  5031. this.j[rname].sg || this.j[rname].Ya(b)
  5032. }
  5033. };
  5034. this.uh = function() {
  5035. for (rname in this.j)
  5036. if (this.j.hasOwnProperty(rname)) return true;
  5037. return false
  5038. };
  5039. this.Dh = function(b) {
  5040. Yc = b;
  5041. for (var c in this.j)
  5042. if (this.j.hasOwnProperty(c)) {
  5043. this.j[c].b.C();
  5044. U(this.j[c].b)
  5045. }
  5046. for (c in this.i)
  5047. if (this.i.hasOwnProperty(c)) {
  5048. this.i[c].b.C();
  5049. U(this.i[c].b)
  5050. }
  5051. };
  5052. this.Yf = function(b) {
  5053. x && A("closedchannel", "Added ignore for : " + b, K);
  5054. this.ne[b] = true
  5055. };
  5056. this.$f = function(b) {
  5057. x && A("closedchannel", "Removed ignore for : " + b, K);
  5058. delete this.ne[b]
  5059. };
  5060. this.Uc =
  5061. function(b) {
  5062. x && A("IRCClient.prefsUpdated", "prefsUpdated", K);
  5063. for (var c in this.i)
  5064. if (this.i.hasOwnProperty(c)) {
  5065. this.i[c].Uc(b);
  5066. var d = this.i[c].za,
  5067. e = this.i[c].W;
  5068. e.H = {
  5069. background: d ? F.tabColorPM : F.tabColorChannel,
  5070. border: d ? F.tabBColorPM : F.tabBColorChannel
  5071. };
  5072. tb(e, e.va)
  5073. }
  5074. if (this.ie == null)
  5075. for (c in this.j)
  5076. if (this.j.hasOwnProperty(c)) {
  5077. this.j[c].Uc(b);
  5078. d = this.j[c].W;
  5079. d.H = {
  5080. background: F.tabColorServer,
  5081. border: F.tabBColorServer
  5082. };
  5083. tb(d, d.va)
  5084. }
  5085. }
  5086. }
  5087.  
  5088. function Qc(b, c) {
  5089. var d = "IRCClient:" + c;
  5090. if (b.j[d].ya) V.G({
  5091. channel: "IRCClient",
  5092. cmd: "disconnect",
  5093. data: c
  5094. });
  5095. else if (b.j[d]) {
  5096. b.j[d].closed(false);
  5097. delete b.j[d]
  5098. }
  5099. }
  5100. Nc.prototype.ce = function(b) {
  5101. window.confirm("Are you sure you want to disconnect from " + b + "?") && Qc(this, b)
  5102. };
  5103. Nc.prototype.If = function(b, c) {
  5104. c && alert(b + ": " + c)
  5105. };
  5106. Nc.prototype.Jf = function(b, c) {
  5107. c && alert(b + ": " + c)
  5108. };
  5109.  
  5110. function Zc(b, c, d, e, f, g, h, k, l) {
  5111. try {
  5112. if (!(d == "" || c == "")) {
  5113. b = {
  5114. channel: "IRCClient",
  5115. cmd: "connect"
  5116. };
  5117. if (c.substring(0, 1) == "!") {
  5118. b.proxied = true;
  5119. c = c.substring(1, c.length)
  5120. }
  5121. c = c.replace(/\s+/g, "").replace(/\.+/g, ".").replace(/^\./, "").replace(/\.$/, "").toLowerCase();
  5122. d = d.replace(/\s+/g, "");
  5123. e = e.replace(/\s+/g, "");
  5124. f = f.replace(/\n/g, "");
  5125. f = f.replace(/\r/g, "");
  5126. b.data = c;
  5127. b.nick = d;
  5128. b.pass = e != null && e ? e : "";
  5129. b.authmethod = k;
  5130. if (!f || f == null) f = "";
  5131. b.joinchannels = f;
  5132. if (l) b.charset = l;
  5133. if (h) b.forced = true;
  5134. x && A("connect", t(b), K);
  5135. V.G(b)
  5136. }
  5137. } catch (j) {
  5138. x &&
  5139. A("irc.connectServer", "exception " + j, C)
  5140. }
  5141. }
  5142.  
  5143. function $c(b, c, d) {
  5144. try {
  5145. if (d.cmd == "typing") return false;
  5146. if (b.i[c]) return false;
  5147. for (ii in S.O)
  5148. if (S.O.hasOwnProperty(ii))
  5149. if (ii.toLowerCase() == c.toLowerCase()) {
  5150. S.O[ii].Ya(d);
  5151. return false
  5152. }
  5153. if (b.ne[c]) {
  5154. x && A("newCHandler", "Ignored : " + c, K);
  5155. return false
  5156. }
  5157. if (d.cmd == "part") return false;
  5158. if (d.cmd == "infobar") return false;
  5159. if (d.channeltype == "log") return true;
  5160. var e = !!b.Uf[c],
  5161. f = d.channeltype == "pm";
  5162. if (f && !F.allowIncommingPMs) {
  5163. x && A("newCHandler", "Ignored PM : " + c, K);
  5164. return false
  5165. }
  5166. if (f && F.blurPMs) e = true;
  5167. if (!f && !F.focusNewJoins) e =
  5168. true;
  5169. if (f && d.userInitiated) e = false;
  5170. fulltitle = f ? c + "(pm)" : c + " (channel)";
  5171. var g = c,
  5172. h = c.indexOf(":", 10);
  5173. if (h) g = g.substring(0, h);
  5174. var k = b.j[g],
  5175. l = document.getElementById("chats"),
  5176. j = document.createElement("div");
  5177. if (e) j.style.display = "none";
  5178. l.appendChild(j);
  5179. if (!e)
  5180. if (Kb(Q, c, g)) Gb(Q);
  5181. else Q.l[g] && Q.l[g].Jd(false);
  5182. var n = new Pc(c, j, d.localchannel, g, k, f, F);
  5183. b.i[c] = n;
  5184. k.i[c] = n;
  5185. var o = Lb(Q, c, j, d.localchannel, fulltitle, function() {
  5186. return function(w, p) {
  5187. n.b.Bb(p)
  5188. }
  5189. }(b), function(w) {
  5190. return function(p) {
  5191. w.i[p] && ad(w.i[p]);
  5192. return true
  5193. }
  5194. }(b), {
  5195. background: f ? F.tabColorPM : F.tabColorChannel,
  5196. border: f ? F.tabBColorPM : F.tabBColorChannel
  5197. }, e, true, g, false);
  5198. if (f || F.focusNewJoins) e || b.i[c].b.Bb(true);
  5199. b.i[c].W = o;
  5200. e && o.pa();
  5201. Jc(S, c, b.i[c]);
  5202. f && Tc("newpm");
  5203. bd && f && bd.Fg(c, d.localchannel)
  5204. } catch (s) {
  5205. x && A("newCHandler", "Exception " + s, C)
  5206. }
  5207. return true
  5208. }
  5209.  
  5210. function cd(b, c) {
  5211. if (!Rc && b.j["IRCClient:" + c.server]) {
  5212. b = b.j["IRCClient:" + c.server].b;
  5213. pb(b.Ia, "Lag: " + (c.timeout ? "-" : c.lag + "ms"), b.Rd)
  5214. }
  5215. }
  5216.  
  5217. function dd(b, c) {
  5218. try {
  5219. var d = c.split(" ");
  5220. b = {
  5221. channel: "IRCClient",
  5222. cmd: "connect"
  5223. };
  5224. b.data = d[0];
  5225. b.nick = ed();
  5226. if (fd) b.nick = fd;
  5227. if (d[1]) b.nick = d[1];
  5228. b.pass = "";
  5229. b.authmethod = "";
  5230. b.joinchannels = "";
  5231. x && A("connect", "to " + b.data + " nick=" + b.nick + " pass=" + b.pass + " authmethod=" + b.authmethod, K);
  5232. V.G(b)
  5233. } catch (e) {
  5234. x && A("irc.connectServer", "exception " + e, C)
  5235. }
  5236. }
  5237.  
  5238. function gd(b, c) {
  5239. b = {};
  5240. var d = false,
  5241. e = false;
  5242. if (c.search(/^(ircs?:\/\/)$/i) != -1) return null;
  5243. b.ssl = c.search(/^(ircs:)/i) != -1;
  5244. b.port = b.ssl ? 9999 : 6667;
  5245. c = c.match(/^ircs?:\/\/([^\/\s]+)?(\/[^\s]*)?$/i);
  5246. if (!c || !c[1]) return null;
  5247. var f = c[1],
  5248. g = "";
  5249. if (typeof c[2] != "undefined") g = c[2];
  5250. c = f.match(/^([^\:]+)(\:\+?\d+)?$/);
  5251. if (!c) return null;
  5252. b.host = c[1].toLowerCase();
  5253. if (typeof c[2] != "undefined") {
  5254. d = true;
  5255. b.port = c[2].substr(1);
  5256. if (b.port.substring(0, 1) == "+") {
  5257. b.port = b.port.substr(1);
  5258. b.ssl = true
  5259. }
  5260. } else if (b.host.indexOf(".") !=
  5261. -1) d = true;
  5262. if (!d) {
  5263. c = hd[b.host.toLowerCase()];
  5264. if (!c) return null;
  5265. if (b.ssl && c.Gf) {
  5266. b.host = c.Gf.host;
  5267. b.port = c.Gf.port
  5268. } else if (!b.ssl && c.t) {
  5269. b.host = c.t.host;
  5270. b.port = c.t.port
  5271. } else return null
  5272. }
  5273. if (g) {
  5274. c = g.match(/^\/([^\?\s\/,]*)?\/?(,[^\?]*)?(\?.*)?$/);
  5275. if (!c) return null;
  5276. b.target = typeof c[1] != "undefined" ? decodeURIComponent(c[1]) : "";
  5277. if (b.target.search(/[\x07,\s]/) != -1) return null;
  5278. if (typeof c[2] != "undefined")
  5279. for (d = c[2].toLowerCase().split(","); d.length;) {
  5280. g = d.pop();
  5281. if (g != "")
  5282. if (g == "isnick") e = true;
  5283. else if (g == "isserver") b.isServer =
  5284. true;
  5285. else if (g == "needpass") b.needPass = true;
  5286. else if (g == "needkey") e || (b.needKey = true)
  5287. }
  5288. if (!e && "#&+".indexOf(b.target.substring(0, 1)) == -1) b.target = "#" + b.target;
  5289. if (typeof c[3] != "undefined")
  5290. for (c = c[3].substr(1).split("&"); c.length;) {
  5291. d = c.pop().split("=");
  5292. g = d[0].toLowerCase();
  5293. if (g == "msg") b.msg = decodeURIComponent(d[1]);
  5294. else if (g == "pass") {
  5295. b.needPass = true;
  5296. b.pass = decodeURIComponent(d[1])
  5297. } else if (g == "key") {
  5298. if (!e) {
  5299. b.needKey = true;
  5300. b.key = decodeURIComponent(d[1])
  5301. }
  5302. } else if (g == "charset") b.charset = decodeURIComponent(d[1])
  5303. }
  5304. }
  5305. return b
  5306. }
  5307. var hd = {
  5308. mibbit: {
  5309. server: {
  5310. host: "irc.mibbit.net",
  5311. port: 6667
  5312. },
  5313. serverssl: {
  5314. host: "irc.mibbit.net",
  5315. port: 6697
  5316. }
  5317. },
  5318. moznet: {
  5319. server: {
  5320. host: "irc.mozilla.org",
  5321. port: 6667
  5322. },
  5323. serverssl: {
  5324. host: "irc.mozilla.org",
  5325. port: 6697
  5326. }
  5327. },
  5328. hybridnet: {
  5329. server: {
  5330. host: "irc.ssc.net",
  5331. port: 6667
  5332. }
  5333. },
  5334. slashnet: {
  5335. server: {
  5336. host: "irc.slashnet.org",
  5337. port: 6667
  5338. }
  5339. },
  5340. dalnet: {
  5341. server: {
  5342. host: "irc.dal.net",
  5343. port: 6667
  5344. }
  5345. },
  5346. undernet: {
  5347. server: {
  5348. host: "irc.undernet.org",
  5349. port: 6667
  5350. }
  5351. },
  5352. webbnet: {
  5353. server: {
  5354. host: "irc.webbnet.info",
  5355. port: 6667
  5356. }
  5357. },
  5358. quakenet: {
  5359. server: {
  5360. host: "irc.quakenet.org",
  5361. port: 6667
  5362. }
  5363. },
  5364. ircnet: {
  5365. server: {
  5366. host: "irc.open-ircnet.net",
  5367. port: 6667
  5368. }
  5369. },
  5370. freenode: {
  5371. server: {
  5372. host: "irc.freenode.net",
  5373. port: 6667
  5374. }
  5375. },
  5376. serenia: {
  5377. serverssl: {
  5378. host: "irc.serenia.net",
  5379. port: 9999
  5380. }
  5381. },
  5382. efnet: {
  5383. server: {
  5384. host: "irc.prison.net",
  5385. port: 6667
  5386. }
  5387. },
  5388. hispano: {
  5389. server: {
  5390. host: "irc.irc-hispano.org",
  5391. port: 6667
  5392. }
  5393. }
  5394. },
  5395. id = ["UTF-8", "Big5", "ISO-8859-1", "ISO-8859-2", "ISO-8859-3", "ISO-8859-4", "ISO-8859-5", "ISO-8859-6", "ISO-8859-7", "ISO-8859-8", "ISO-8859-9", "ISO-8859-13", "ISO-8859-15", "windows-1250", "windows-1251", "windows-1252", "windows-1253", "windows-1254",
  5396. "windows-1255", "windows-1256", "windows-1257", "windows-1258"
  5397. ];
  5398.  
  5399. function Pc(b, c, d, e, f, g, h) {
  5400. function k(p) {
  5401. return function(r) {
  5402. p.W && p.W.pa(r);
  5403. if (T) T.alert(r ? E.g("AlertsMyName") : E.g("AlertsGeneral"))
  5404. }
  5405. }
  5406.  
  5407. function l(p) {
  5408. return function(r) {
  5409. p.t.send({
  5410. cmd: "text",
  5411. chan: this.f,
  5412. data: "/join " + r
  5413. })
  5414. }
  5415. }
  5416.  
  5417. function j(p) {
  5418. return function(r) {
  5419. if (p.wc) {
  5420. if (r == "" || r.substring(0, 1) == "/" && r.substring(0, 2) != "//") p.ac(false)
  5421. } else if (r != "" && (r.substring(0, 1) != "/" || r.substring(0, 2) == "//")) p.ac(true)
  5422. }
  5423. }
  5424.  
  5425. function n(p) {
  5426. return function(r, y) {
  5427. if (y.substring(0, 8) == "usermenu") {
  5428. y = parseInt(y.substring(8, y.length));
  5429. if (p.a.usermenus[y]) {
  5430. var z = p.a.usermenus[y].command;
  5431. z = z.replace(/\$nick/g, r);
  5432. var B = p.b.U.F[r.toLowerCase()];
  5433. if (B) {
  5434. if (B.user) z = z.replace(/\$user/g, B.user);
  5435. if (B.host) z = z.replace(/\$host/g, B.host)
  5436. }
  5437. if ((new jd({
  5438. command: z,
  5439. match: p.a.usermenus[y].title
  5440. })).execCommand({
  5441. f: p.f,
  5442. h: p.t.Xa
  5443. }, [], function() {
  5444. return function(H) {
  5445. p.Ba(H)
  5446. }
  5447. }(), function() {
  5448. return function() {
  5449. p.b.focus()
  5450. }
  5451. }(), "", 0, 0)) return
  5452. }
  5453. } else if (y == "banu") {
  5454. if ((B = p.b.U.F[r.toLowerCase()]) && B.user) {
  5455. p.t.send({
  5456. cmd: "text",
  5457. chan: p.f,
  5458. data: "/mode " + p.f + " +b " + B.user +
  5459. "@*"
  5460. });
  5461. p.t.send({
  5462. cmd: "text",
  5463. chan: p.f,
  5464. data: "/kick " + r
  5465. })
  5466. }
  5467. } else if (y == "banh") {
  5468. if ((B = p.b.U.F[r.toLowerCase()]) && B.host) {
  5469. p.t.send({
  5470. cmd: "text",
  5471. chan: p.f,
  5472. data: "/mode " + p.f + " +b *@" + B.host
  5473. });
  5474. p.t.send({
  5475. cmd: "text",
  5476. chan: p.f,
  5477. data: "/kick " + r
  5478. })
  5479. }
  5480. } else if (y == "ignore") kd(p.b, r, true);
  5481. else if (y == "unignore") kd(p.b, r, false);
  5482. else if (y == "getoptions") {
  5483. z = [];
  5484. for (y = 0; y < p.a.usermenus.length; y++) z.push({
  5485. id: "usermenu" + y,
  5486. desc: p.a.usermenus[y].title
  5487. });
  5488. if (p.Ed)
  5489. if (p.b.U.F[r.toLowerCase()]) {
  5490. B = p.b.U.F[r.toLowerCase()];
  5491. if (B.mibbituser ==
  5492. "true")
  5493. if (B.user != "Mibbit" && B.user != "cgiirc") B.user && z.push({
  5494. id: "banu",
  5495. desc: "Ban " + B.user + "@*"
  5496. });
  5497. else B.host && z.push({
  5498. id: "banh",
  5499. desc: "Ban *@" + B.host
  5500. });
  5501. else {
  5502. B.user && z.push({
  5503. id: "banu",
  5504. desc: "Ban " + B.user + "@*"
  5505. });
  5506. B.host && z.push({
  5507. id: "banh",
  5508. desc: "Ban *@" + B.host
  5509. })
  5510. }
  5511. }
  5512. ld(p.b, r) ? z.push({
  5513. id: "unignore",
  5514. desc: E.g("UMenu_Unignore")
  5515. }) : z.push({
  5516. id: "ignore",
  5517. desc: E.g("UMenu_Ignore")
  5518. });
  5519. return z
  5520. }
  5521. p.b.focus()
  5522. }
  5523. }
  5524.  
  5525. function o(p) {
  5526. return function(r) {
  5527. p.ra.jc = r
  5528. }
  5529. }
  5530.  
  5531. function s(p) {
  5532. return function() {
  5533. try {
  5534. if (!p.ya) return false;
  5535. p.Ba(p.b.n.ea.value)
  5536. } catch (r) {
  5537. x &&
  5538. A("submit", r, C)
  5539. }
  5540. return false
  5541. }
  5542. }
  5543. x && A("ChatChannel", "ch=" + b + ", chan=" + d + ", sname=" + e + ", sobj=" + f, K);
  5544. this.na = b;
  5545. this.f = d;
  5546. this.Mb = e;
  5547. this.t = f;
  5548. this.za = g;
  5549. this.ya = true;
  5550. this.a = h;
  5551. this.Ed = this.wc = false;
  5552. x && A("ChatChannel", "New chat channel for " + d, K);
  5553. this.Yb = 0;
  5554. this.ra = new md;
  5555. c.style.background = g ? this.a.tabColorPM : this.a.tabColorChannel;
  5556. b = {};
  5557. b.Id = s(this);
  5558. b.xc = j(this);
  5559. b.hh = n(this);
  5560. b.eb = l(this);
  5561. b.M = k(this);
  5562. b.mc = function(p) {
  5563. return function(r, y, z) {
  5564. y = new jd({
  5565. command: r,
  5566. match: y
  5567. });
  5568. x && A("processCommand", r, K);
  5569. y.execCommand({
  5570. f: p.f,
  5571. h: z ? z : p.t.Xa
  5572. }, [], function() {
  5573. return function(B) {
  5574. p.Ba(B)
  5575. }
  5576. }(), function() {
  5577. return function() {
  5578. p.b.focus()
  5579. }
  5580. }(), "", 0, 0)
  5581. }
  5582. }(this);
  5583. this.df = b.mc;
  5584. b.De = o(this);
  5585. b.Qg = function(p) {
  5586. return function(r) {
  5587. r != "" && V.G({
  5588. cmd: "paste",
  5589. channel: "PasteBin",
  5590. returnchannel: p.na,
  5591. data: r
  5592. })
  5593. }
  5594. }(this);
  5595. b.Pg = function(p) {
  5596. return function(r) {
  5597. r != "" && V.G({
  5598. cmd: "minify",
  5599. channel: "LinkManager",
  5600. returnchannel: p.na,
  5601. url: r
  5602. })
  5603. }
  5604. }(this);
  5605. b.gh = function(p) {
  5606. return function(r) {
  5607. p.t.send({
  5608. cmd: "text",
  5609. chan: p.f,
  5610. data: "/mode " + p.f + " -b " + r
  5611. });
  5612. p.b.focus()
  5613. }
  5614. }(this);
  5615. if (this.a.ircNickClick) b.Dg =
  5616. function(p) {
  5617. return function(r) {
  5618. if (r) {
  5619. Za(p.b.n.da) == 0 ? p.b.n.Ub(r + ": ") : p.b.n.Ub(r + " ");
  5620. p.b.focus()
  5621. }
  5622. }
  5623. }(this);
  5624. b.Hf = function(p) {
  5625. return function(r) {
  5626. if (W) {
  5627. if (!Rc) {
  5628. var y = PermalinkInfo.create(p.b.d, p.Mb.substring(10, p.Mb.length), p.f);
  5629. r("Link to channel", function() {
  5630. ea(W, {
  5631. element: y
  5632. })
  5633. })
  5634. }
  5635. p.Ed && r("Set topic", function() {
  5636. W.alert("Set topic for " + p.f, function(H) {
  5637. H && H != p.b.U.Jc && p.Ba("/topic " + H)
  5638. }, true, p.b.U.Jc)
  5639. })
  5640. }
  5641. for (var z = 0; z < p.a.channelmenus.length; z++) {
  5642. var B = p.a.channelmenus[z];
  5643. r(B.title, function(H) {
  5644. return function() {
  5645. var P =
  5646. new jd({
  5647. command: H.command,
  5648. match: H.title
  5649. });
  5650. x && A("setupoptions", "Running ch menu... " + H.command, K);
  5651. P.execCommand({
  5652. f: p.f,
  5653. h: p.t.Xa
  5654. }, [], function() {
  5655. return function(N) {
  5656. p.Ba(N)
  5657. }
  5658. }(), function() {
  5659. return function() {
  5660. p.b.focus()
  5661. }
  5662. }(), "", 0, 0)
  5663. }
  5664. }(B))
  5665. }
  5666. }
  5667. }(this);
  5668. b.Cf = function(p) {
  5669. return function(r) {
  5670. V.G({
  5671. cmd: "plugin",
  5672. channel: p.na,
  5673. data: r
  5674. })
  5675. }
  5676. }(this);
  5677. b.tf = function(p) {
  5678. return function() {
  5679. p.t.yd("Change nickname", function() {
  5680. return function(r) {
  5681. r && p.t.send({
  5682. cmd: "text",
  5683. data: "/nick " + r
  5684. })
  5685. }
  5686. }())
  5687. }
  5688. }(this);
  5689. this.b = new X(c, !this.za, this.a,
  5690. b, true, g ? this.a.tabColorPM : this.a.tabColorChannel);
  5691. this.b.f = this.na;
  5692. this.b.uc(this.t.Xa);
  5693. pb(this.b.Ia, nd, this.b.Rd);
  5694. try {
  5695. this.b.n.ea.maxLength = 361
  5696. } catch (w) {}
  5697. if (!this.za && od) {
  5698. this.b.U.Cd = od;
  5699. this.b.U.Ac = true
  5700. }!this.za && this.a.noUListInChannels && pd(this.b, false);
  5701. if (this.za) {
  5702. this.b.$[this.f.toLowerCase()] = this.f;
  5703. this.b.$[this.b.h.toLowerCase()] = this.b.h;
  5704. kb(this.b.n.da, this.f);
  5705. kb(this.b.n.da, this.b.h)
  5706. }
  5707. }
  5708.  
  5709. function qd(b) {
  5710. !Rc && !b.za && rd.match(">" + b.t.Sg + ">" + b.f, {
  5711. f: b.f,
  5712. h: b.t.Xa
  5713. }, function(c) {
  5714. return function(d) {
  5715. c.Ba(d)
  5716. }
  5717. }(b), function() {
  5718. return q()
  5719. }(b), function(c) {
  5720. return function() {
  5721. c.b.focus()
  5722. }
  5723. }(b))
  5724. }
  5725. Pc.prototype.Ba = function(b) {
  5726. if (this.Yb > 3) x && A("ChatChannel", "Max recurse. Bad alias? (" + b + ")" + this.Yb, C);
  5727. else {
  5728. this.Yb++;
  5729. if (b) {
  5730. var c = b.toLowerCase(),
  5731. d = b;
  5732. if (d.toLowerCase().substring(0, 4) == "/me ")
  5733. if (this.za || sd(this.b)) {
  5734. var e = d.substring(4);
  5735. if (e = td.apply(e, false, this.df)) {
  5736. c = {
  5737. cmd: "emote",
  5738. idd: true,
  5739. local: true,
  5740. emote: ud(this.ra, e),
  5741. nick: this.b.h
  5742. };
  5743. this.t.send({
  5744. cmd: "text",
  5745. chan: this.f,
  5746. data: "/me " + ud(this.ra, e)
  5747. });
  5748. this.b.Ma(c);
  5749. this.ac(false);
  5750. this.Yb--;
  5751. return false
  5752. }
  5753. } else {
  5754. this.Yb--;
  5755. return false
  5756. }
  5757. else if (d.substring(0,
  5758. 2) == "//" || d.substring(0, 1) != "/") {
  5759. if (d.substring(0, 2) == "//") d = d.substring(1, b.length);
  5760. if ((d = td.apply(d, false, this.df)) && (this.za || sd(this.b))) {
  5761. c = {
  5762. cmd: "msg",
  5763. nick: this.b.h,
  5764. local: true,
  5765. idd: true,
  5766. msg: ud(this.ra, d)
  5767. };
  5768. if (d.substring(0, 1) == "/") d = "/" + d;
  5769. if (this.a.parseChannels && d.match(/^([\s]*)\#([\S]+)([\s]*)$/g)) {
  5770. x && A("CHANNEL", "Matched regexp...", C);
  5771. var f = {
  5772. he: false
  5773. };
  5774. f.Zg = window.setTimeout(function(k) {
  5775. return function() {
  5776. k.t.send({
  5777. cmd: "text",
  5778. chan: k.f,
  5779. data: ud(k.ra, d)
  5780. });
  5781. f.he = true
  5782. }
  5783. }(this), 5E3);
  5784. c.channelclick = function(k) {
  5785. return function(l) {
  5786. if (!f.he) {
  5787. window.clearTimeout(f.Zg);
  5788. f.he = true;
  5789. var j = Y(k.b, "^^ " + l + " was not sent to this channel. Please use /join to join channels.", {}, k.a.colorSystem, null, false, k.b.k);
  5790. k.b.e("error", j)
  5791. }
  5792. k.b.w.eb(l)
  5793. }
  5794. }(this)
  5795. } else this.t.send({
  5796. cmd: "text",
  5797. chan: this.f,
  5798. data: ud(this.ra, d)
  5799. });
  5800. this.b.Ma(c);
  5801. this.ac(false)
  5802. }
  5803. this.Yb--;
  5804. return false
  5805. }
  5806. if (c.substring(0, 7) == "/style ") {
  5807. b = b.substring(7, b.length);
  5808. e = b.split(" ");
  5809. this.ra.reset();
  5810. for (c = 0; c < e.length; c++) {
  5811. if (e[c] == "bold") this.ra.bold = true;
  5812. if (e[c] == "underline") this.ra.Ie = true;
  5813. var g = parseInt(e[c]);
  5814. if (!isNaN(g))
  5815. if (this.ra.jc ===
  5816. null) this.ra.jc = g;
  5817. else this.ra.rd = g
  5818. }
  5819. } else if (c == "/style") this.ra.reset();
  5820. else if (c == "/redraw") this.b.z();
  5821. else if (c == "/mute") {
  5822. vd = false;
  5823. e = Y(this.b, "Sounds off", {}, this.a.colorSystem, null, false, this.b.k);
  5824. this.b.e("sounds", e)
  5825. } else if (c == "/unmute") {
  5826. vd = true;
  5827. e = Y(this.b, "Sounds on", {}, this.a.colorSystem, null, false, this.b.k);
  5828. this.b.e("sounds", e)
  5829. } else if (c.substring(0, 7) == "/splay ") wd(b.substring(7, b.length));
  5830. else if (c.substring(0, 6) == "/echo ") this.b.Ma({
  5831. cmd: "msg",
  5832. nick: "*",
  5833. local: true,
  5834. idd: true,
  5835. msg: b.substring(6,
  5836. b.length)
  5837. });
  5838. else if (W && !this.za && c == "/permalink") {
  5839. e = PermalinkInfo.create(this.b.d, this.Mb.substring(10, this.Mb.length), this.f);
  5840. W && ea(W, {
  5841. element: e
  5842. })
  5843. } else if (c.substring(0, 7) == "/umode ") this.t.send({
  5844. cmd: "text",
  5845. chan: this.f,
  5846. data: "/mode " + this.b.h + " " + b.substring(7, b.length)
  5847. });
  5848. else if (c.substring(0, 7) == "/query ") {
  5849. e = b.substring(7, b.length);
  5850. g = null;
  5851. c = e.indexOf(" ");
  5852. if (c != -1) {
  5853. g = e.substring(c + 1, e.length);
  5854. e = e.substring(0, c)
  5855. }
  5856. c = {
  5857. channeltype: "pm",
  5858. userInitiated: true
  5859. };
  5860. c.channel = this.Mb + ":" + e.toLowerCase();
  5861. c.localchannel =
  5862. e;
  5863. $c(G, c.channel, c);
  5864. g && this.t.i[c.channel].Ba(g)
  5865. } else if (c.substring(0, 8) == "/minify ") {
  5866. e = b.substring(8, b.length);
  5867. V.G({
  5868. channel: "LinkManager",
  5869. cmd: "minify",
  5870. url: e,
  5871. returnchannel: this.na
  5872. })
  5873. } else if (c.substring(0, 8) == "/server ") dd(G, b.substring(8, b.length));
  5874. else if (c == "/debug") xd();
  5875. else if (c == "/notify on") {
  5876. this.b.U.gd = true;
  5877. e = Y(this.b, "Notifications on", {}, this.a.colorSystem, null, false, this.b.k);
  5878. this.b.e("notify", e)
  5879. } else if (c == "/notify off") {
  5880. this.b.U.gd = false;
  5881. e = Y(this.b, "Notifications off", {}, this.a.colorSystem,
  5882. null, false, this.b.k);
  5883. this.b.e("notify", e)
  5884. } else if (c == "/togglemenu smilies") Ya(this.b.n, "smilies");
  5885. else if (c == "/togglemenu colors") Ya(this.b.n, "colors");
  5886. else if (c == "/togglemenu pastebin") Ya(this.b.n, "pastebin");
  5887. else if (c == "/togglemenu minify") Ya(this.b.n, "minify");
  5888. else if (c == "/ulshow") pd(this.b, true);
  5889. else if (c == "/ulhide") pd(this.b, false);
  5890. else if (c == "/help") yd(this.b, vc);
  5891. else if (c.substring(0, 8) == "/remove ") {
  5892. hc(this.b.la, b.substring(8, b.length));
  5893. U(this.b)
  5894. } else if (c == "/clear") zd(this.b);
  5895. else if (c.substring(0,
  5896. 9) == "/showurl ") {
  5897. e = b.substring(9, b.length);
  5898. Sc(this.b, e)
  5899. } else if (c.substring(0, 8) == "/ignore ") {
  5900. e = b.substring(8, b.length);
  5901. kd(this.b, e, true)
  5902. } else if (c.substring(0, 10) == "/unignore ") {
  5903. e = b.substring(10, b.length);
  5904. kd(this.b, e, false)
  5905. } else if (c == "/pastebin") Xa(this.b.n, "pastebin");
  5906. else if (c.substring(0, 6) == "/bbon ") {
  5907. g = (new Date).getTime();
  5908. e = b.substring(6, b.length);
  5909. this.b.U.Xd[e] = true;
  5910. this.b.e("bb", Y(this.b, "Bridgebot on: " + e, {}, this.a.colorNotice, null, false, this.b.k, g))
  5911. } else if (c.substring(0, 7) == "/bboff ") {
  5912. g =
  5913. (new Date).getTime();
  5914. e = b.substring(7, b.length);
  5915. delete this.b.U.Xd[e];
  5916. this.b.e("bb", Y(this.b, "Bridgebot off: " + e, {}, this.a.colorNotice, null, false, this.b.k, g))
  5917. } else if (c == "/hints") {
  5918. g = (new Date).getTime();
  5919. var h = Ad(od, 20);
  5920. for (c = 0; c < h.length; c++) {
  5921. e = "Hint: " + h[c];
  5922. this.b.e("hints", Y(this.b, e, {}, this.a.colorNotice, null, false, this.b.k, g))
  5923. }
  5924. } else {
  5925. rd.match(b, {
  5926. f: this.f,
  5927. h: this.t.Xa
  5928. }, function(k) {
  5929. return function(l) {
  5930. k.Ba(l)
  5931. }
  5932. }(this), function(k) {
  5933. return function() {
  5934. k.t.send({
  5935. cmd: "text",
  5936. chan: k.f,
  5937. data: b
  5938. })
  5939. }
  5940. }(this), function(k) {
  5941. return function() {
  5942. k.b.focus()
  5943. }
  5944. }(this));
  5945. this.ac(false)
  5946. }
  5947. }
  5948. this.Yb--
  5949. }
  5950. };
  5951. Pc.prototype.ac = function(b) {
  5952. if (this.t.ya && (this.za || sd(this.b))) {
  5953. b != this.wc && V.G({
  5954. cmd: "typing",
  5955. channel: this.na,
  5956. typing: b
  5957. });
  5958. var c = this.b;
  5959. c.c && Fa(c.c, c.h, b)
  5960. }
  5961. this.wc = b
  5962. };
  5963. Pc.prototype.remove = function(b) {
  5964. this.ya = false;
  5965. this.b.close();
  5966. Kc(S, this.na);
  5967. Bd(this.t, this.na);
  5968. if (b) this.W && Ib(Q, this.W.id);
  5969. else this.W && Jb(Q, this.W.id)
  5970. };
  5971. Pc.prototype.ic = function() {
  5972. this.b.ic()
  5973. };
  5974.  
  5975. function ad(b) {
  5976. if (!b.za && sd(b.b)) {
  5977. b.t.send({
  5978. cmd: "text",
  5979. chan: b.f,
  5980. data: "/part " + b.f
  5981. });
  5982. b.t.pe.Yf(b.na)
  5983. }
  5984. b.remove(false)
  5985. }
  5986. Pc.prototype.Ya = function(b) {
  5987. if (this.ya) try {
  5988. this.b.Ma(b);
  5989. if (b.nick == this.b.h && (b.cmd == "usermode" || b.cmd == "join") || b.cmd == "nicklist") {
  5990. var c = sd(this.b);
  5991. if (c) this.Ed = c.sa.owner || c.sa.admin || c.sa.op
  5992. }
  5993. b.nick == this.b.h && b.cmd == "join" && qd(this);
  5994. if (b.cmd == "changenick" && b.nick.toLowerCase() == this.f.toLowerCase()) {
  5995. var d = this.Mb + ":" + b.newnick.toLowerCase();
  5996. (Q.l[d] ? true : false) && Ib(Q, d);
  5997. if (this.W) {
  5998. c = Q;
  5999. var e = this.na;
  6000. if (c.l[e]) {
  6001. var f = c.l[e];
  6002. Nb(c, f);
  6003. f.id = d;
  6004. Mb(c, f)
  6005. }
  6006. rb(this.W, b.newnick.toLowerCase())
  6007. }
  6008. delete this.b.$[this.f.toLowerCase()];
  6009. Kc(S, this.na);
  6010. this.f = b.newnick.toLowerCase();
  6011. this.na = d;
  6012. this.b.f = this.na;
  6013. Jc(S, this.na, this);
  6014. this.b.$[this.f.toLowerCase()] = this.f
  6015. }
  6016. if (this.a.showChannelTabUsers && this.b.c) {
  6017. var g = this.b.c.size();
  6018. rb(this.W, this.f + " (" + g + ")")
  6019. }
  6020. } catch (h) {
  6021. x && A("recv", h + "( " + b + " )", C)
  6022. }
  6023. };
  6024. Pc.prototype.Uc = function(b) {
  6025. x && A("ChatChannel", "prefsUpdated: " + b, K);
  6026. if (b && b == "CGMlayout") {
  6027. this.b.C();
  6028. U(this.b)
  6029. } else {
  6030. Cd(this.b);
  6031. this.b.z();
  6032. U(this.b);
  6033. this.b.p.style.background = this.za ? this.a.tabColorPM : this.a.tabColorChannel;
  6034. if (this.b.c) rb(this.W, this.f + (this.a.showChannelTabUsers ? " (" + this.b.c.size() + ")" : ""))
  6035. }
  6036. };
  6037. var nd = "For the latest news checkout the blog: http://blog.mibbit.com";
  6038.  
  6039. function Oc(b, c, d, e) {
  6040. function f(k) {
  6041. return function() {
  6042. k.W && k.W.pa(false);
  6043. T && T.alert("Server stuff !")
  6044. }
  6045. }
  6046.  
  6047. function g(k) {
  6048. return function(l) {
  6049. k.send({
  6050. cmd: "text",
  6051. chan: this.f,
  6052. data: "/join " + l
  6053. })
  6054. }
  6055. }
  6056.  
  6057. function h(k) {
  6058. return function() {
  6059. try {
  6060. if (!k.ya) return false;
  6061. k.Ba(k.b.n.ea.value)
  6062. } catch (l) {
  6063. x && A("IRCServerTab", "onsubmit " + l, C)
  6064. }
  6065. return false
  6066. }
  6067. }
  6068. this.Mb = this.f = c;
  6069. this.Xa = "unknown";
  6070. this.Ed = false;
  6071. this.ya = true;
  6072. this.ed = 1;
  6073. this.a = e;
  6074. this.Hh = new R;
  6075. this.k = new Zb(function(k) {
  6076. return function(l) {
  6077. k.send({
  6078. cmd: "text",
  6079. chan: k.f,
  6080. data: "/join " +
  6081. l
  6082. })
  6083. }
  6084. }(this), new Tb(new cc(new R), this.a), this.a);
  6085. this.pe = d;
  6086. this.i = {};
  6087. c = {};
  6088. c.Id = h(this);
  6089. c.eb = g(this);
  6090. c.M = f(this);
  6091. c.tf = function(k) {
  6092. return function() {
  6093. k.yd("Change nickname", function() {
  6094. return function(l) {
  6095. l && k.send({
  6096. cmd: "text",
  6097. data: "/nick " + l
  6098. })
  6099. }
  6100. }())
  6101. }
  6102. }(this);
  6103. if (b) {
  6104. b.style.background = this.a.tabColorServer;
  6105. this.b = new X(b, false, this.a, c, false, this.a.tabColorServer);
  6106. pb(this.b.Ia, nd, this.b.Rd)
  6107. }
  6108. }
  6109. Oc.prototype.Ba = function(b) {
  6110. if (b) {
  6111. var c = b.toLowerCase();
  6112. if (c.substring(0, 7) == "/query ") {
  6113. var d = b.substring(7, b.length);
  6114. c = null;
  6115. var e = d.indexOf(" ");
  6116. if (e != -1) {
  6117. c = d.substring(e + 1, d.length);
  6118. d = d.substring(0, e)
  6119. }
  6120. e = {
  6121. channeltype: "pm",
  6122. userInitiated: true
  6123. };
  6124. e.channel = this.Mb + ":" + d.toLowerCase();
  6125. e.localchannel = d;
  6126. $c(G, e.channel, e);
  6127. if (c)(d = this.i[e.channel]) && d.Ba(c)
  6128. } else if (c == "/debug") xd();
  6129. else if (c == "/help") yd(this.b, vc);
  6130. else if (c == "/clear") zd(this.b);
  6131. else if (c == "/redraw") this.b.z();
  6132. else if (c == "/mute") {
  6133. vd = false;
  6134. c = Y(this.b, "Sounds off", {}, this.a.colorSystem, null, false, this.b.k);
  6135. this.b.e("sounds", c)
  6136. } else if (c == "/unmute") {
  6137. vd = true;
  6138. c = Y(this.b, "Sounds on", {}, this.a.colorSystem, null, false, this.b.k);
  6139. this.b.e("sounds", c)
  6140. } else if (c.substring(0, 7) == "/splay ") wd(b.substring(7, b.length));
  6141. else if (c.substring(0, 6) == "/echo ") this.b.Ma({
  6142. cmd: "msg",
  6143. nick: "*",
  6144. local: true,
  6145. idd: true,
  6146. msg: b.substring(6, b.length)
  6147. });
  6148. else if (c.substring(0, 7) == "/umode ") this.t.send({
  6149. cmd: "text",
  6150. chan: this.f,
  6151. data: "/mode " + this.b.h + " " + b.substring(7, b.length)
  6152. });
  6153. else if (c.substring(0, 8) == "/server ") dd(G, b.substring(8, b.length));
  6154. else if (c.substring(0, 9) == "/showurl ") {
  6155. c = b.substring(9, b.length);
  6156. Sc(this.b, c)
  6157. } else rd.match(b, {
  6158. f: "",
  6159. h: this.Xa
  6160. }, function(f) {
  6161. return function(g) {
  6162. f.Ba(g)
  6163. }
  6164. }(this), function(f) {
  6165. return function() {
  6166. f.send({
  6167. cmd: "text",
  6168. chan: f.f,
  6169. data: b
  6170. })
  6171. }
  6172. }(this))
  6173. }
  6174. };
  6175. Oc.prototype.close = q();
  6176. Oc.prototype.send = function(b) {
  6177. b.channel = this.f;
  6178. V.G(b)
  6179. };
  6180. Oc.prototype.Ya = function(b) {
  6181. this.ya = true;
  6182. try {
  6183. var c = false;
  6184. if (b.cmd == "whoisreply")
  6185. if (b.user) c = Dd(this, b);
  6186. else {
  6187. c = true;
  6188. this.b.Ma({
  6189. cmd: "log",
  6190. nick: "",
  6191. message: b.nick + " is away (" + b.away + ")"
  6192. })
  6193. }
  6194. if (b.cmd == "channellist" || b.cmd == "whowas" || b.cmd == "who" || b.cmd == "invite") c = Dd(this, b);
  6195. b.cmd == "whoisreply" && Xc(this, {
  6196. cmd: "userdetails",
  6197. nick: b.nick,
  6198. user: b.user,
  6199. host: b.host
  6200. });
  6201. if ((b.cmd == "notice" || b.cmd == "ctcp") && this.a.noticesToActiveTab) c = Dd(this, b);
  6202. if (b.cmd == "error" && this.a.errorsToActiveTab) c = Dd(this, b);
  6203. if (b.cmd == "infobar" ||
  6204. b.cmd == "away" || b.cmd == "part" || b.cmd == "changenick" || b.cmd == "init") {
  6205. b.cmd == "infobar" && this.b.Ma(b);
  6206. Xc(this, b);
  6207. c = true
  6208. }
  6209. b.cmd == "nickprompt" && this.yd(b.reason, function(e) {
  6210. return function(f) {
  6211. f && e.send({
  6212. cmd: "text",
  6213. data: "/nick " + f
  6214. })
  6215. }
  6216. }(this));
  6217. if (b.cmd == "changenick") b.nick == this.Xa && Ed(this, b.newnick);
  6218. else if (b.cmd == "init") Ed(this, b.nick);
  6219. else if (b.cmd == "closedchannel") {
  6220. x && A("closedchannel", "cc cmd for : " + b.chan, K);
  6221. this.pe.$f(b.chan)
  6222. }
  6223. c || this.b.Ma(b)
  6224. } catch (d) {
  6225. x && A(this.f + " (recv)", d + " (" + b + ")", C)
  6226. }
  6227. };
  6228.  
  6229. function Ed(b, c) {
  6230. b.Xa = c;
  6231. b.b.uc(b.Xa)
  6232. }
  6233.  
  6234. function Dd(b, c) {
  6235. for (ch in b.i)
  6236. if (b.i.hasOwnProperty(ch))
  6237. if (b.i[ch].W.va) {
  6238. b.i[ch].Ya(c);
  6239. return true
  6240. }
  6241. return false
  6242. }
  6243.  
  6244. function Wc(b, c, d, e) {
  6245. b.kg || Fd(b.b, c, new xc(d, b.b.Me), e);
  6246. for (ch in b.i) b.i.hasOwnProperty(ch) && Fd(b.i[ch].b, c, new xc(d, b.b.Me), e)
  6247. }
  6248.  
  6249. function Vc(b, c) {
  6250. b.kg || hc(b.b.la, c);
  6251. for (ch in b.i) b.i.hasOwnProperty(ch) && hc(b.i[ch].b.la, c)
  6252. }
  6253.  
  6254. function Xc(b, c) {
  6255. for (ch in b.i) b.i.hasOwnProperty(ch) && b.i[ch].Ya(c)
  6256. }
  6257.  
  6258. function Bd(b, c) {
  6259. x && A(b.f, "Removing channel: " + c, K);
  6260. delete b.i[c];
  6261. delete b.pe.i[c]
  6262. }
  6263. Oc.prototype.ic = function() {
  6264. this.ya = false;
  6265. this.b.ic();
  6266. for (ch in this.i) this.i.hasOwnProperty(ch) && this.i[ch].ic()
  6267. };
  6268. Oc.prototype.closed = function(b) {
  6269. this.ya = false;
  6270. Kc(S, this.f);
  6271. var c = (new Date).getTime();
  6272. this.b.e(Y(this.b, "- - - - Disconnected - - - -", {}, "red", null, false, this.k, c));
  6273. this.b.close();
  6274. if (b) this.W && Ib(Q, this.f);
  6275. else this.W && Jb(Q, this.W.id);
  6276. for (ch in this.i) this.i.hasOwnProperty(ch) && this.i[ch].remove(false);
  6277. for (ch in this.i) this.i.hasOwnProperty(ch) && Bd(this, ch)
  6278. };
  6279. Oc.prototype.Uc = function() {
  6280. Cd(this.b);
  6281. this.b.z();
  6282. this.b.p.style.background = this.a.tabColorServer
  6283. };
  6284. Oc.prototype.yd = function(b, c) {
  6285. b = window.prompt("Please choose a new nickname (" + b + ")");
  6286. c(b)
  6287. };
  6288.  
  6289. function Gd() {
  6290. this.Ec = []
  6291. }
  6292. Gd.prototype.clear = function() {
  6293. this.Ec = []
  6294. };
  6295. Gd.prototype.load = function(b) {
  6296. this.Ec = [];
  6297. for (var c = 0; c < b.length; c++) this.Ec.push(new jd(b[c]))
  6298. };
  6299. Gd.prototype.match = function(b, c, d, e, f) {
  6300. try {
  6301. for (var g = 0; g < this.Ec.length; g++)
  6302. if (this.Ec[g].exec(b, c, d, f)) return
  6303. } catch (h) {
  6304. x && A("aliases", "Issue running match " + h, K)
  6305. }
  6306. e && e()
  6307. };
  6308. Gd.prototype.prompt = function(b, c) {
  6309. c && c("")
  6310. };
  6311.  
  6312. function jd(b) {
  6313. this.od = b.match;
  6314. this.bf = b.command.split(/\s\|\s/)
  6315. }
  6316.  
  6317. function Hd(b, c, d, e) {
  6318. if (c == "") return e;
  6319. return c + (d ? " " : "") + e
  6320. }
  6321. jd.prototype.execCommand = function(b, c, d, e, f, g, h) {
  6322. for (var k = g; k < this.bf.length; k++) {
  6323. g = this.bf[k].split(/\s/);
  6324. var l = f,
  6325. j = true;
  6326. f = "";
  6327. for (var n = h; n < g.length; n++) {
  6328. var o = g[n];
  6329. if (!(n == 0 && o.toLowerCase() == "/say"))
  6330. if (o.match(/^\#?\$?\$\d+$/)) {
  6331. h = o.match(/^\#?\$?\$(\d+)$/)[1];
  6332. if (h > c.length || h < 1) {
  6333. if (o.match(/^\#?\$\$/)) {
  6334. l = "";
  6335. break
  6336. }
  6337. return false
  6338. }
  6339. l = Hd(this, l, j, (o.substring(0, 1) == "#" ? "#" : "") + c[h - 1]);
  6340. j = true
  6341. } else if (o.match(/^\$\d+\-\d+$/)) {
  6342. o = o.match(/^\$(\d+)\-(\d+)$/);
  6343. h = o[1];
  6344. o = o[2];
  6345. if (h > c.length || o > c.length || o < h ||
  6346. h < 1 || o < 1) return false;
  6347. for (h = h; h <= o; h++) {
  6348. l = Hd(this, l, j, c[h - 1]);
  6349. j = true
  6350. }
  6351. } else if (o.match(/^\$\d+\-$/)) {
  6352. h = o.match(/^\$(\d+)\-$/)[1];
  6353. if (h > c.length || h < 1) return false;
  6354. for (h = h; h <= c.length; h++) {
  6355. l = Hd(this, l, j, c[h - 1]);
  6356. j = true
  6357. }
  6358. } else if (o == "#") {
  6359. l = Hd(this, l, j, b.f);
  6360. j = true
  6361. } else if (o.match(/^\$me([\.\,\!\?]?)/i)) {
  6362. h = o.match(/^\$me([\.\,\!\?]?)/i);
  6363. l = Hd(this, l, j, b.h + h[1]);
  6364. j = true
  6365. } else if (o == "$?") {
  6366. f = function(w) {
  6367. return function(p) {
  6368. l = Hd(w, l, j, p);
  6369. w.execCommand(b, c, d, e, l, k, n + 1)
  6370. }
  6371. }(this);
  6372. Gd.prototype.prompt(this.od, f);
  6373. return true
  6374. } else if (o ==
  6375. "$+") j = false;
  6376. else {
  6377. if (o.substring(0, 2) == "\\u" || o.substring(0, 2) == "\\x") try {
  6378. l = Hd(this, l, j, String.fromCharCode(parseInt(o.substring(2, o.length), 16)))
  6379. } catch (s) {} else l = Hd(this, l, j, o);
  6380. j = true
  6381. }
  6382. }
  6383. l != "" && d(l);
  6384. h = 0
  6385. }
  6386. e && e();
  6387. return false
  6388. };
  6389. jd.prototype.exec = function(b, c, d, e) {
  6390. var f = b.split(/\s/);
  6391. if (this.od && f.length > 0 && (f[0].toLowerCase() == this.od.toLowerCase() || b.toLowerCase() == this.od.toLowerCase())) {
  6392. f.shift();
  6393. this.execCommand(c, f, d, e, "", 0, 0);
  6394. return true
  6395. }
  6396. return false
  6397. };
  6398.  
  6399. function Id(b, c, d, e) {
  6400. this.a = e;
  6401. this.window = b;
  6402. this.zd = false;
  6403. this.rh = 0;
  6404. this.nd = false;
  6405. this.je = 0;
  6406. this.jf = c;
  6407. this.We = d;
  6408. this.Wb = function(f) {
  6409. window != window.parent && window.parent.postMessage && window.parent.postMessage(t(f), "*")
  6410. };
  6411. this.alert = function(f) {
  6412. if (this.a.windowAlertMaxFlashes == 0) return false;
  6413. if (this.nd) return false;
  6414. if (this.zd) return false;
  6415. this.window.document.title = "* " + f + " *";
  6416. this.nd = true;
  6417. this.je = 0;
  6418. var g = true,
  6419. h = this.window.setInterval(function(k) {
  6420. return function() {
  6421. if (k.zd) {
  6422. k.window.document.title = k.jf;
  6423. k.nd = false;
  6424. k.window.clearInterval(h)
  6425. } else if (k.je > k.a.windowAlertMaxFlashes) {
  6426. k.window.document.title = "[ " + f + " ]";
  6427. k.nd = false;
  6428. k.window.clearInterval(h)
  6429. } else {
  6430. k.je++;
  6431. k.window.document.title = g ? k.We : "* " + f + " *";
  6432. g = !g
  6433. }
  6434. }
  6435. }(this), this.a.windowAlertPeriod);
  6436. return true
  6437. };
  6438. this.xg = 0;
  6439. this.Fc = function(f) {
  6440. this.xg++;
  6441. var g = function(k) {
  6442. return function() {
  6443. k.zd = true;
  6444. k.window.document.title = k.jf;
  6445. return true
  6446. }
  6447. }(this),
  6448. h = function(k) {
  6449. return function() {
  6450. k.zd = false;
  6451. k.window.document.title = k.We;
  6452. return true
  6453. }
  6454. }(this);
  6455. if (f.addEventListener) {
  6456. f.addEventListener("focus",
  6457. g, false);
  6458. f.addEventListener("blur", h, false)
  6459. } else {
  6460. f.attachEvent("onfocus", g);
  6461. f.attachEvent("onblur", h)
  6462. }
  6463. }
  6464. }
  6465.  
  6466. function Jd() {
  6467. this.hasFocus = true;
  6468. this.Qb = null;
  6469. this.Gd = {};
  6470. this.Jb = [];
  6471. this.Ib = {};
  6472. this.Bf = 0;
  6473. this.Fg = function(d, e) {
  6474. if (!this.hasFocus)
  6475. if (!this.Gd[d]) {
  6476. this.Gd[d] = e;
  6477. this.Jb.push(e);
  6478. this.update()
  6479. }
  6480. };
  6481. this.wf = function(d, e) {
  6482. if (!this.hasFocus) {
  6483. if (this.Ib[d]) this.Ib[d].rf++;
  6484. else this.Ib[d] = {
  6485. rf: 1,
  6486. ng: e
  6487. };
  6488. this.Bf++;
  6489. this.update()
  6490. }
  6491. };
  6492. this.update = function() {
  6493. this.Qb != null && this.Qb.cancel();
  6494. var d = "";
  6495. if (this.Jb.length > 0) {
  6496. d += this.Jb.length + " New PM" + (this.Jb.length == 1 ? "" : "s");
  6497. if (this.Jb.length < 4) {
  6498. d += " (";
  6499. for (var e = 0; e < this.Jb.length; e++) {
  6500. if (e >
  6501. 0) d += ", ";
  6502. d += this.Jb[e]
  6503. }
  6504. d += ")"
  6505. }
  6506. }
  6507. var f = "";
  6508. for (e in this.Ib)
  6509. if (this.Ib.hasOwnProperty(e))
  6510. if (!this.Gd[e]) {
  6511. if (f != "") f += ", ";
  6512. f += this.Ib[e].ng + "(" + this.Ib[e].rf + ")"
  6513. }
  6514. if (f != "") {
  6515. if (d != "") d += ", ";
  6516. d += "New chat from " + f
  6517. }
  6518. if (window.webkitNotifications && F.desktopNotifications)
  6519. if (window.webkitNotifications.checkPermission() == 0) {
  6520. this.Qb = window.webkitNotifications.createNotification("http://mibbit.com/icon.png", "Mibbit", d);
  6521. this.Qb.show()
  6522. } else x && A("Notifications", "NO PERMISSION TO DISPLAY NOTIFICATIONS")
  6523. };
  6524. this.reset =
  6525. function() {
  6526. this.Qb != null && this.Qb.cancel();
  6527. this.Qb = null;
  6528. this.Gd = {};
  6529. this.Jb = [];
  6530. this.Ib = {};
  6531. this.Bf = 0
  6532. };
  6533. this.Fc = function(d, e, f) {
  6534. if (d.addEventListener) {
  6535. d.addEventListener("focus", e, false);
  6536. d.addEventListener("blur", f, false)
  6537. } else {
  6538. d.attachEvent("onfocus", e);
  6539. d.attachEvent("onblur", f)
  6540. }
  6541. };
  6542. var b = function(d) {
  6543. return function() {
  6544. d.hasFocus = true;
  6545. d.reset();
  6546. x && A("Notifications", "onfocus")
  6547. }
  6548. }(this),
  6549. c = function(d) {
  6550. return function() {
  6551. d.hasFocus = false;
  6552. x && A("Notifications", "onblur")
  6553. }
  6554. }(this);
  6555. this.Fc(window, b, c)
  6556. }
  6557.  
  6558. function md() {
  6559. this.Ie = this.bold = false;
  6560. this.rd = this.jc = null
  6561. }
  6562. md.prototype.reset = function() {
  6563. this.Ie = this.bold = false;
  6564. this.rd = this.jc = null
  6565. };
  6566.  
  6567. function ud(b, c) {
  6568. var d = "";
  6569. if (b.bold) d += "\u0002";
  6570. if (b.Ie) d += "\u001f";
  6571. var e = "";
  6572. if (b.jc != null) e += b.jc;
  6573. if (b.rd != null) e += "," + b.rd;
  6574. if (e != "") d += "\u0003" + e;
  6575. b = d.substring(d.length - 1, d.length);
  6576. e = c.substring(0, 1);
  6577. if (b >= "0" && b <= "9" && e >= "0" && e <= "9") d += " ";
  6578. d += c;
  6579. return d
  6580. }
  6581.  
  6582. function X(b, c, d, e, f, g, h) {
  6583. try {
  6584. this.Af = h;
  6585. this.Fd = this.ue = this.ve = false;
  6586. this.p = b;
  6587. this.a = d;
  6588. this.d = b.ownerDocument;
  6589. this.w = e;
  6590. this.aa = this.a.extraContentWidth;
  6591. this.U = new Kd(this);
  6592. this.h = "unknown";
  6593. this.$ = {};
  6594. this.ed = 0;
  6595. this.Lc = true;
  6596. this.Ve = f;
  6597. Cd(this);
  6598. this.vc = new R;
  6599. this.ob = new cc(new R);
  6600. this.ob = new Tb(this.ob, this.a);
  6601. if (!Rc) this.ob = new Zb(e.eb, this.ob, this.a);
  6602. this.ob = new ac(this.ob);
  6603. d = {};
  6604. d.th = function(n) {
  6605. n = n.substring(6, n.length);
  6606. var o = "",
  6607. s = n.indexOf("/");
  6608. if (s != -1) {
  6609. o = n.substring(s + 1, n.length);
  6610. n = n.substring(0,
  6611. s);
  6612. if ("#&+".indexOf(o.substring(0, 1)) == -1) o = "#" + o
  6613. }
  6614. try {
  6615. s = "mib_" + Ld;
  6616. if (fd) s = fd;
  6617. var w = "",
  6618. p = "",
  6619. r = F.defaultCharset;
  6620. if (Md) {
  6621. var y = Md.rg;
  6622. if (y)
  6623. for (var z = 0; z < y.length; z++)
  6624. if (y[z].Sf == n) {
  6625. s = y[z].h;
  6626. w = y[z].Kg;
  6627. p = y[z].Tf;
  6628. r = y[z].charset;
  6629. break
  6630. }
  6631. }
  6632. Zc(G, n, s, w, o, false, false, p, r)
  6633. } catch (B) {}
  6634. };
  6635. this.Me = new Zb(e.eb, new Tb(new R, this.a, d), this.a);
  6636. this.Wf = new Zb(e.eb, new Tb(new cc(new R)), this.a);
  6637. f = {};
  6638. u(this.a, f);
  6639. f.yh = false;
  6640. this.Rd = new ac(new Zb(e.eb, new Tb(new cc(new R), f, d), this.a));
  6641. u({
  6642. border: "0",
  6643. fontSize: "13px",
  6644. position: "absolute",
  6645. textAlign: "left",
  6646. overflow: "hidden"
  6647. }, b.style);
  6648. this.lb = {
  6649. left: 0,
  6650. right: 0,
  6651. top: Pb,
  6652. bottom: Qb
  6653. };
  6654. if (!O && this.a.useTabList) this.lb.left = this.a.tabListWidth;
  6655. u({
  6656. top: this.lb.top + "px",
  6657. bottom: this.lb.bottom + "px",
  6658. left: this.lb.left + "px",
  6659. right: this.lb.right + "px"
  6660. }, b.style);
  6661. this.S = Nd(this);
  6662. u({
  6663. display: "block",
  6664. overflow: "auto",
  6665. overflowX: "hidden"
  6666. }, this.S.style);
  6667. if (kc) this.S.style.marginRight = "15px";
  6668. b.appendChild(this.S);
  6669. this.Fb = this.d.createElement("div");
  6670. u({
  6671. padding: "0",
  6672. margin: "0",
  6673. position: "absolute",
  6674. top: "0px",
  6675. left: "0px",
  6676. right: "0px",
  6677. overflow: "hidden"
  6678. }, this.Fb.style);
  6679. this.Ia = new mb(this.Fb, this.a, g);
  6680. b.appendChild(this.Fb);
  6681. if (c) {
  6682. this.oa = true;
  6683. this.X = this.d.createElement("div");
  6684. u({
  6685. position: "absolute",
  6686. right: "0px",
  6687. overflow: "auto",
  6688. overflowX: "hidden",
  6689. textAlign: "left"
  6690. }, this.X.style);
  6691. b.appendChild(this.X);
  6692. this.c = new ga(this.X, e.hh, this.a)
  6693. }
  6694. this.ha = this.d.createElement("div");
  6695. u({
  6696. position: "absolute",
  6697. overflow: "hidden",
  6698. bottom: "0px",
  6699. left: "0px",
  6700. right: "0px"
  6701. }, this.ha.style);
  6702. e.zg = function(n) {
  6703. return function(o) {
  6704. n.w.Pg(o)
  6705. }
  6706. }(this);
  6707. e.Ld =
  6708. function(n) {
  6709. return function() {
  6710. n.Ld(true)
  6711. }
  6712. }(this);
  6713. e.pg = function(n) {
  6714. return function() {
  6715. n.Ld(false)
  6716. }
  6717. }(this);
  6718. e.Rg = function(n) {
  6719. return function() {
  6720. n.w.Qg(n.Tc.value())
  6721. }
  6722. }(this);
  6723. if (c) {
  6724. e.qf = function(n) {
  6725. return function() {
  6726. Od(n, !n.ua)
  6727. }
  6728. }(this);
  6729. this.Z = this.d.createElement("div");
  6730. u({
  6731. position: "absolute",
  6732. right: "0px",
  6733. overflow: "auto",
  6734. overflowX: "hidden",
  6735. textAlign: "left"
  6736. }, this.Z.style);
  6737. this.Z.style.display = "none";
  6738. this.ua = false;
  6739. b.appendChild(this.Z)
  6740. }
  6741. e.ig = function(n) {
  6742. return function(o, s) {
  6743. var w = n.c.c[o],
  6744. p = n.c.c[s];
  6745. if (n.a.chatInputTabSort ==
  6746. "idle" && w && p) {
  6747. if (w.Ha > p.Ha) return -1;
  6748. if (w.Ha < p.Ha) return 1
  6749. } else {
  6750. if (o < s) return -1;
  6751. if (o > s) return 1
  6752. }
  6753. return 0
  6754. }
  6755. }(this);
  6756. this.xd = this.d.createElement("form");
  6757. this.xd.style.display = "inline";
  6758. this.xd.setAttribute("accept-charset", "UTF-8");
  6759. this.xd.onsubmit = e.Id;
  6760. this.n = new Pa(this.ha, this.a, this.xd, e, this.a.showInputOptions && this.Ve);
  6761. b.appendChild(this.ha);
  6762. this.qb = Nd(this);
  6763. this.Tc = new tc(this.qb);
  6764. b.appendChild(this.qb);
  6765. this.gb = Nd(this);
  6766. this.gb.style.background = "white";
  6767. var k = function(n) {
  6768. return function(o) {
  6769. n.w.Cf &&
  6770. n.w.Cf(o)
  6771. }
  6772. }(this);
  6773. this.Fa = new mc(this.gb, this.a, k);
  6774. b.appendChild(this.gb);
  6775. this.ub = this.d.createElement("div");
  6776. u({
  6777. padding: "0",
  6778. position: "absolute",
  6779. right: "0px",
  6780. bottom: "0px",
  6781. cursor: "pointer",
  6782. textAlign: "center",
  6783. fontSize: "13px",
  6784. verticalAlign: "middle"
  6785. }, this.ub.style);
  6786. this.ub.onclick = function(n) {
  6787. return function() {
  6788. e.Id();
  6789. hb(n.n.da);
  6790. n.focus()
  6791. }
  6792. }(this);
  6793. this.ub.appendChild(document.createTextNode(E.g("SendButton")));
  6794. b.appendChild(this.ub);
  6795. if (O) {
  6796. this.onresize = function(n) {
  6797. return function() {
  6798. Pd(n)
  6799. }
  6800. }(this);
  6801. window.attachEvent ?
  6802. window.attachEvent("onresize", this.onresize) : window.addEventListener("resize", this.onresize, false);
  6803. window.setTimeout(function(n) {
  6804. return function() {
  6805. n.C();
  6806. Pd(n)
  6807. }
  6808. }(this), 100)
  6809. }
  6810.  
  6811. function l(n) {
  6812. return function() {
  6813. n.focus()
  6814. }
  6815. }
  6816. this.la = new ec(this.S, this.a, l(this));
  6817. for (b = 0; b < 40; b++) gc(this.la, this.ed++, Y(this));
  6818. this.z();
  6819. U(this);
  6820. T && T.Fc(this.n.ea)
  6821. } catch (j) {
  6822. x && A("ChatGuiModule", j, C)
  6823. }
  6824. }
  6825. var Yc;
  6826. X.prototype.z = function() {
  6827. if (this.Lc) {
  6828. this.ve = false;
  6829. this.c && this.c.z();
  6830. this.la.z();
  6831. this.n.Ad = this.a.showInputOptions && this.Ve;
  6832. this.n.z();
  6833. this.Ia.z();
  6834. u({
  6835. background: this.a.sendButtonBackground,
  6836. border: "1px solid " + this.a.sendButtonBorder,
  6837. color: this.a.sendButtonColor,
  6838. fontFamily: this.a.chatInputFontFamily,
  6839. fontSize: this.a.chatInputFontSize + "px",
  6840. padding: this.a.chatInputPadding + "px",
  6841. Vf: this.a.chatInputRounding + "px",
  6842. MozBorderRadius: this.a.chatInputRounding + "px",
  6843. WebkitBorderRadius: this.a.chatInputRounding + "px"
  6844. },
  6845. this.ub.style);
  6846. var b = {
  6847. background: this.a.chatPaneBackground,
  6848. border: "1px solid " + this.a.chatPaneBorder
  6849. };
  6850. b.borderRadius = this.a.chatPaneRounding + "px";
  6851. b.MozBorderRadius = this.a.chatPaneRounding + "px";
  6852. b.WebkitBorderRadius = this.a.chatPaneRounding + "px";
  6853. b.padding = this.a.chatPaneRounding + "px";
  6854. u(b, this.S.style);
  6855. u(b, this.gb.style);
  6856. u(b, this.qb.style);
  6857. this.C()
  6858. } else this.ve = true
  6859. };
  6860.  
  6861. function Nd(b) {
  6862. b = b.d.createElement("div");
  6863. u({
  6864. position: "absolute",
  6865. overflow: "hidden",
  6866. display: "none",
  6867. left: "0px",
  6868. right: "0px"
  6869. }, b.style);
  6870. return b
  6871. }
  6872.  
  6873. function Qd(b, c) {
  6874. b.Ta = c;
  6875. b.a.hideULonEC && pd(b, !c);
  6876. b.C();
  6877. U(b)
  6878. }
  6879. X.prototype.Ld = function(b) {
  6880. this.Tc.Kd(b);
  6881. this.C();
  6882. U(this)
  6883. };
  6884.  
  6885. function pd(b, c) {
  6886. if (!b.Tc.vb()) {
  6887. c && b.ua && Od(b, false);
  6888. if (b.c) {
  6889. b.oa = c;
  6890. b.Hd = c;
  6891. b.C();
  6892. U(b)
  6893. }
  6894. }
  6895. }
  6896.  
  6897. function Od(b, c) {
  6898. if (!b.Tc.vb()) {
  6899. if (c && b.oa) {
  6900. b.Hd = true;
  6901. b.oa = false
  6902. }
  6903. if (!c && !b.oa && b.Hd) b.oa = true;
  6904. b.ua = c;
  6905. if (b.ua) {
  6906. for (; b.Z.firstChild;) b.Z.removeChild(b.Z.firstChild);
  6907. var d = function(f) {
  6908. return function() {
  6909. Od(f, false)
  6910. }
  6911. }(b);
  6912.  
  6913. function e(f, g, h) {
  6914. var k = f.ownerDocument.createElement("div");
  6915. u({
  6916. border: "1px solid #888",
  6917. background: "#ccc",
  6918. padding: "3px",
  6919. margin: "2px",
  6920. fontFamily: "sans-serif",
  6921. cursor: "pointer",
  6922. fontSize: "13px",
  6923. borderRadius: "3px",
  6924. MozBorderRadius: "3px",
  6925. WebkitBorderRadius: "3px"
  6926. }, k.style);
  6927. k.appendChild(f.ownerDocument.createTextNode(g));
  6928. k.onmouseover = function() {
  6929. u({
  6930. border: "1px solid #ccc",
  6931. background: "#eee"
  6932. }, this.style)
  6933. };
  6934. k.onmouseout = function() {
  6935. u({
  6936. border: "1px solid #888",
  6937. background: "#ccc"
  6938. }, this.style)
  6939. };
  6940. k.onclick = function() {
  6941. d();
  6942. h && h()
  6943. };
  6944. f.appendChild(k)
  6945. }
  6946. e(b.Z, b.Hd ? "Hide userlist" : "Show userlist", function(f) {
  6947. return function() {
  6948. pd(f, !f.Hd)
  6949. }
  6950. }(b));
  6951. e(b.Z, b.a.needSendButton ? "Hide send button" : "Show send button", function(f) {
  6952. return function() {
  6953. f.a.needSendButton = !f.a.needSendButton;
  6954. Rd(f.a)
  6955. }
  6956. }(b));
  6957. b.w.Hf && b.w.Hf(function(f) {
  6958. return function(g, h) {
  6959. e(f,
  6960. g, h)
  6961. }
  6962. }(b.Z), b.Z)
  6963. }
  6964. b.C();
  6965. U(b);
  6966. b.focus()
  6967. }
  6968. }
  6969.  
  6970. function U(b) {
  6971. b.S.scrollTop = b.S.scrollHeight
  6972. }
  6973.  
  6974. function Sd(b) {
  6975. return b.S.scrollTop + b.S.clientHeight >= b.S.scrollHeight - b.a.chatFontSize
  6976. }
  6977. X.prototype.focus = function() {
  6978. try {
  6979. this.n.ea.focus()
  6980. } catch (b) {}
  6981. };
  6982.  
  6983. function Td() {}
  6984. X.prototype.jd = function() {
  6985. if (!this.ld) {
  6986. this.ld = true;
  6987. this.la.jd("--MARKER--")
  6988. }
  6989. };
  6990.  
  6991. function sd(b) {
  6992. if (b.c) return b.c.c[b.h];
  6993. return null
  6994. }
  6995.  
  6996. function zd(b) {
  6997. b.la.clear();
  6998. for (var c = 0; c < 40; c++) gc(b.la, b.ed++, Y(b));
  6999. U(b)
  7000. }
  7001. X.prototype.e = function(b, c, d) {
  7002. var e = Sd(this);
  7003. if (!d && !this.Lc && this.a.showMarkers) this.ld || this.jd();
  7004. gc(this.la, b + " " + this.ed++, c, d);
  7005. !d && e && U(this)
  7006. };
  7007.  
  7008. function yd(b, c) {
  7009. Fd(b, b.ed++, c)
  7010. }
  7011.  
  7012. function Fd(b, c, d, e) {
  7013. var f = Sd(b);
  7014. fc(b.la, c, d, e);
  7015. f && U(b)
  7016. }
  7017. X.prototype.Gc = function() {
  7018. if (this.c) {
  7019. this.$ = {};
  7020. this.n.da.Rb = {};
  7021. this.U.Gc();
  7022. this.c.clear();
  7023. Cd(this)
  7024. } else {
  7025. delete this.$[this.h.toLowerCase()];
  7026. lb(this.n.da, this.h)
  7027. }
  7028. };
  7029. X.prototype.close = function() {
  7030. this.c && this.c.fe();
  7031. if (this.onresize) window.detachEvent ? window.detachEvent("onresize", this.onresize) : window.removeEventListener("resize", this.onresize, false)
  7032. };
  7033.  
  7034. function ld(b, c) {
  7035. return typeof b.U.Eb[c] != "undefined"
  7036. }
  7037.  
  7038. function kd(b, c, d) {
  7039. var e = null;
  7040. if (b.c) e = b.c.c[c];
  7041. if (d) {
  7042. b.U.Eb[c] = true;
  7043. if (e) {
  7044. e.yf = e.P;
  7045. Ka(e, {
  7046. name: "ignored",
  7047. title: "Ignored"
  7048. })
  7049. }
  7050. } else {
  7051. delete b.U.Eb[c];
  7052. e && e.yf && Ka(e, e.yf)
  7053. }
  7054. }
  7055. X.prototype.Bb = function(b) {
  7056. (this.Lc = b) && this.ve && this.z();
  7057. b && this.ue && this.C();
  7058. if (b) {
  7059. if (this.n.C() || this.Ia.C()) this.C()
  7060. } else if (this.ld) {
  7061. this.ld = false;
  7062. hc(this.la, "--MARKER--")
  7063. }
  7064. try {
  7065. if (b) {
  7066. U(this);
  7067. window.setTimeout(function(d) {
  7068. return function() {
  7069. d.focus()
  7070. }
  7071. }(this), 200)
  7072. } else window.focus()
  7073. } catch (c) {
  7074. x && A("activecb", c, C)
  7075. }
  7076. };
  7077. X.prototype.C = function() {
  7078. if (this.Lc) {
  7079. this.ue = false;
  7080. try {
  7081. this.n.C();
  7082. this.Ia.C();
  7083. var b = true;
  7084. if (O) b = false;
  7085. var c = this.n.Va() + 2 + this.a.cgmMargins * 2,
  7086. d = this.Ia.Va(),
  7087. e = this.a.cgmMargins + d,
  7088. f = this.a.cgmMargins + 2 + this.a.userListWidth;
  7089. if (b) {
  7090. if (!this.Da) {
  7091. this.Da = this.d.createElement("div");
  7092. this.Da.onmousedown = function(j) {
  7093. return function(n) {
  7094. if (!n) n = window.event;
  7095. j.Fd = true;
  7096. j.gg = n.clientX;
  7097. j.hg = j.a.userListWidth;
  7098. j.Ta && nc(j.Fa, true);
  7099. document.onmousemove = function() {
  7100. return function(o) {
  7101. if (!o) o = window.event;
  7102. j.a.userListWidth =
  7103. j.hg + (j.gg - o.clientX);
  7104. if (j.a.userListWidth < 0) j.a.userListWidth = 0;
  7105. o = document.body.clientWidth - 2 - 2 - j.a.cgmMargins * 3;
  7106. if (j.Ta) o -= j.aa + 2 + j.a.cgmMargins;
  7107. if (!O && j.a.useTabList) o -= j.a.tabListWidth;
  7108. if (j.a.userListWidth > o) j.a.userListWidth = o;
  7109. j.C();
  7110. return false
  7111. }
  7112. }();
  7113. document.onmouseup = function() {
  7114. j.Fd = false;
  7115. document.onmousemove = null;
  7116. document.onmouseup = null;
  7117. nc(j.Fa, false);
  7118. j.C();
  7119. U(j);
  7120. j.focus();
  7121. Rd(j.a, "CGMlayout")
  7122. };
  7123. return false
  7124. }
  7125. }(this);
  7126. this.p.appendChild(this.Da);
  7127. u({
  7128. position: "absolute",
  7129. cursor: "move"
  7130. }, this.Da.style);
  7131. this.Da.onmouseover = function() {
  7132. this.style.background = "#888"
  7133. };
  7134. this.Da.onmouseout = function() {
  7135. this.style.background = "transparent"
  7136. }
  7137. }
  7138. this.Da.style.width = this.a.cgmMargins + "px";
  7139. this.Da.style.top = e + this.a.cgmMargins + "px";
  7140. this.Da.style.bottom = c + "px";
  7141. this.Da.style.right = (this.Ta && this.a.extraContentPosition == "right" ? f + this.aa + 2 + this.a.cgmMargins : f) + "px";
  7142. this.Da.style.display = this.oa || this.ua ? "block" : "none"
  7143. }
  7144. u({
  7145. padding: "0",
  7146. margin: "0",
  7147. position: "absolute",
  7148. top: "0px",
  7149. left: "0px",
  7150. height: d + "px",
  7151. right: "0px",
  7152. overflow: "hidden"
  7153. },
  7154. this.Fb.style);
  7155. Ud(this, this.Fb, 1, 1, 0, 1);
  7156. var g = this.a.cgmMargins;
  7157. if (!O && this.a.useTabList) g += this.a.tabListWidth;
  7158. if (!this.Af || !this.Af.Eg) Adverts.Ug(g, this.a.cgmMargins + Pb);
  7159. u({
  7160. position: "absolute",
  7161. overflow: "hidden",
  7162. bottom: "0px",
  7163. left: "0px",
  7164. height: this.n.Va() + "px",
  7165. right: (this.a.needSendButton ? f : 0) + "px"
  7166. }, this.ha.style);
  7167. Ud(this, this.ha, 0, 1, 1, 1);
  7168. this.ub.style.display = this.a.needSendButton ? "block" : "none";
  7169. this.ub.style.height = this.n.Va() - 2 * this.a.chatInputPadding + "px";
  7170. this.ub.style.width = this.a.userListWidth -
  7171. 2 * this.a.chatInputPadding + "px";
  7172. Ud(this, this.ub, 0, 1, 1, 0);
  7173. if (this.Tc.vb()) {
  7174. this.qb.style.top = e + "px";
  7175. this.qb.style.bottom = c + "px";
  7176. Ud(this, this.qb, 1, 1, 0, 1);
  7177. this.S.style.display = "none";
  7178. if (this.oa) this.X.style.display = "none";
  7179. if (this.ua) this.Z.style.display = "none";
  7180. if (this.Ta) this.gb.style.display = "none"
  7181. } else {
  7182. var h = document.body.clientWidth - 2 - 2 - this.a.cgmMargins * 3;
  7183. if (this.oa || this.ua) h -= this.a.userListWidth + this.a.cgmMargins + 2;
  7184. if (!O && this.a.useTabList) h -= this.a.tabListWidth;
  7185. if (this.aa > h) this.aa = h;
  7186. if (kc) this.S.style.marginRight =
  7187. "15px";
  7188. u({
  7189. display: "block",
  7190. top: e + "px",
  7191. bottom: c + "px"
  7192. }, this.S.style);
  7193. this.S.style.left = (this.Ta && this.a.extraContentPosition == "left" ? this.aa + 2 + this.a.cgmMargins : "0") + "px";
  7194. this.S.style.right = (this.oa || this.ua ? f : 0) + (this.Ta && this.a.extraContentPosition != "left" ? this.aa + 2 + this.a.cgmMargins : 0) + "px";
  7195. Ud(this, this.S, 1, 1, 0, 1);
  7196. this.X && Ud(this, this.X, 1, 1, 0, 0);
  7197. this.Z && Ud(this, this.Z, 1, 1, 0, 0);
  7198. if (this.oa) {
  7199. u({
  7200. position: "absolute",
  7201. right: (this.Ta && this.a.extraContentPosition == "right" ? this.aa + 2 + this.a.cgmMargins : "0") +
  7202. "px",
  7203. overflow: "auto",
  7204. display: "block",
  7205. top: e + "px",
  7206. bottom: c + "px",
  7207. width: this.a.userListWidth - 2 * this.a.ulistPaneRounding + "px",
  7208. overflowX: "hidden",
  7209. textAlign: "left"
  7210. }, this.X.style);
  7211. if (this.Z) this.Z.style.display = "none"
  7212. } else if (this.ua) {
  7213. u({
  7214. position: "absolute",
  7215. right: (this.Ta && this.a.extraContentPosition == "right" ? this.aa + 2 + this.a.cgmMargins : "0") + "px",
  7216. overflow: "auto",
  7217. display: "block",
  7218. top: e + "px",
  7219. bottom: c + "px",
  7220. width: this.a.userListWidth - 2 * this.a.ulistPaneRounding + "px",
  7221. padding: this.a.ulistPaneRounding + "px",
  7222. overflowX: "hidden",
  7223. textAlign: "left"
  7224. }, this.Z.style);
  7225. if (this.X) this.X.style.display = "none"
  7226. } else {
  7227. if (this.X) this.X.style.display = "none";
  7228. if (this.Z) this.Z.style.display = "none"
  7229. }
  7230. if (this.Ta) {
  7231. u({
  7232. display: "block",
  7233. top: e + "px",
  7234. bottom: c + "px",
  7235. width: this.aa + "px",
  7236. left: this.a.extraContentPosition == "left" ? "0px" : "auto",
  7237. right: this.a.extraContentPosition == "left" ? "auto" : ((this.oa || this.ua) && this.a.extraContentPosition != "right" ? f : 0) + "px"
  7238. }, this.gb.style);
  7239. Ud(this, this.gb, 1, 1, 0, 1);
  7240. if (b) {
  7241. if (!this.ia) {
  7242. this.ia = this.d.createElement("div");
  7243. this.ia.onmousedown =
  7244. function(j) {
  7245. return function(n) {
  7246. if (!n) n = window.event;
  7247. j.Fd = true;
  7248. j.ef = n.clientX;
  7249. j.ff = j.aa;
  7250. j.Ta && nc(j.Fa, true);
  7251. document.onmousemove = function() {
  7252. return function(o) {
  7253. if (!o) o = window.event;
  7254. j.aa = j.a.extraContentPosition == "left" ? j.ff - (j.ef - o.clientX) : j.ff + (j.ef - o.clientX);
  7255. if (j.aa < 0) j.aa = 0;
  7256. o = document.body.clientWidth - 2 - 2 - j.a.cgmMargins * 3;
  7257. if (j.oa || j.ua) o -= j.a.userListWidth + j.a.cgmMargins + 2;
  7258. if (!O && j.a.useTabList) o -= j.a.tabListWidth;
  7259. if (j.aa > o) j.aa = o;
  7260. j.C();
  7261. return false
  7262. }
  7263. }();
  7264. document.onmouseup = function() {
  7265. j.Fd = false;
  7266. document.onmousemove = null;
  7267. document.onmouseup = null;
  7268. nc(j.Fa, false);
  7269. j.C();
  7270. U(j);
  7271. j.focus()
  7272. };
  7273. return false
  7274. }
  7275. }(this);
  7276. this.p.appendChild(this.ia);
  7277. u({
  7278. position: "absolute",
  7279. cursor: "move"
  7280. }, this.ia.style);
  7281. this.ia.onmouseover = function() {
  7282. this.style.background = "#888"
  7283. };
  7284. this.ia.onmouseout = function() {
  7285. this.style.background = "transparent"
  7286. }
  7287. }
  7288. if (this.a.extraContentPosition == "left") {
  7289. this.ia.style.right = "auto";
  7290. this.ia.style.left = this.aa + 2 + this.a.cgmMargins + "px"
  7291. } else if (this.a.extraContentPosition == "middle") {
  7292. var k = this.oa || this.ua ?
  7293. this.a.userListWidth + this.a.cgmMargins + 2 : 0;
  7294. k += this.aa + 2 + this.a.cgmMargins;
  7295. this.ia.style.left = "auto";
  7296. this.ia.style.right = k + "px"
  7297. } else {
  7298. this.ia.style.left = "auto";
  7299. this.ia.style.right = this.aa + 2 + this.a.cgmMargins + "px"
  7300. }
  7301. u({
  7302. width: this.a.cgmMargins + "px",
  7303. top: e + this.a.cgmMargins + "px",
  7304. bottom: c + "px",
  7305. display: "block"
  7306. }, this.ia.style)
  7307. }
  7308. } else {
  7309. if (this.ia) this.ia.style.display = "none";
  7310. this.gb.style.display = "none"
  7311. }
  7312. }
  7313. O && Pd(this)
  7314. } catch (l) {
  7315. x && A("ChatGuiModule.layout", l, C)
  7316. }
  7317. } else this.ue = true
  7318. };
  7319.  
  7320. function Pd(b) {
  7321. var c = document.body.clientHeight - b.lb.top - b.lb.bottom,
  7322. d = document.body.clientWidth - b.lb.left - b.lb.right;
  7323. b.p.style.height = c + "px";
  7324. b.p.style.width = d + "px";
  7325. var e = c - (b.n.Va() + 2 + b.Ia.Va() + F.cgmMargins * 4 + 4);
  7326. d = d - 2 - F.cgmMargins * 2;
  7327. x && A("size", "height=" + c + " " + e, K);
  7328. b.S.style.height = e - 2 * b.a.chatPaneRounding + "px";
  7329. if (b.oa) b.X.style.height = e - 2 * b.a.ulistPaneRounding + "px";
  7330. if (b.ua) b.Z.style.height = e - 2 * b.a.ulistPaneRounding + "px";
  7331. b.gb.style.height = e + "px";
  7332. if (b.qb) {
  7333. b.qb.style.height = e - 2 * b.a.chatPaneRounding +
  7334. "px";
  7335. b.qb.style.width = d - 2 * b.a.chatPaneRounding + "px"
  7336. }
  7337. c = parseInt(b.S.style.left);
  7338. e = parseInt(b.S.style.right);
  7339. b.S.style.width = d - 2 * b.a.chatPaneRounding - c - e + "px";
  7340. c = parseInt(b.ha.style.left);
  7341. e = parseInt(b.ha.style.right);
  7342. b.ha.style.width = d - c - e + "px";
  7343. c = parseInt(b.Fb.style.left);
  7344. e = parseInt(b.Fb.style.right);
  7345. b.Fb.style.width = d - c - e + "px"
  7346. }
  7347.  
  7348. function Ud(b, c, d, e, f, g) {
  7349. b = b.a.cgmMargins + "px";
  7350. if (d) c.style.marginTop = b;
  7351. if (e) c.style.marginRight = b;
  7352. if (f) c.style.marginBottom = b;
  7353. if (g) c.style.marginLeft = b
  7354. }
  7355. X.prototype.ic = function() {
  7356. try {
  7357. var b = (new Date).getTime();
  7358. this.e("system", Y(this, "You have disconnected from the server", {}, "red", "system", false, this.vc, b));
  7359. this.Gc()
  7360. } catch (c) {
  7361. x && A("disconnected", "disconnected error... " + c, C)
  7362. }
  7363. };
  7364. var Vd = [{
  7365. Df: "parseYouTubes",
  7366. Cb: "youtube",
  7367. vd: "Show YouTube video",
  7368. P: "https://s3.amazonaws.com/mibbit/gfx/youtube.png",
  7369. le: 42,
  7370. ke: 30,
  7371. match: /youtube\.com\/watch\?.*v\=([a-zA-Z0-9\_\-]*)/i,
  7372. wd: true
  7373. }, {
  7374. Df: "parseGoogleViewer",
  7375. Cb: "gview",
  7376. vd: "gview",
  7377. match: /.*\.(pdf|ppt|doc|xls|xlsx|pptx|pages|ai|psd|dxf|svg|eps|ps|ttf|xps)/i,
  7378. re: "View next to chat",
  7379. wd: false
  7380. }];
  7381.  
  7382. function Wd(b, c) {
  7383. for (var d = 0; d < Vd.length; d++) {
  7384. var e = Vd[d],
  7385. f = c.match(e.match);
  7386. if (f) return {
  7387. le: e.le,
  7388. ke: e.ke,
  7389. P: e.P,
  7390. Cb: e.Cb,
  7391. vd: e.vd,
  7392. wd: e.wd,
  7393. match: f,
  7394. enabled: b.a && b.a[e.Df],
  7395. re: e.re
  7396. }
  7397. }
  7398. return false
  7399. }
  7400.  
  7401. function Sc(b, c, d) {
  7402. var e = Wd(b, c);
  7403. if (e) {
  7404. Qd(b, true);
  7405. e.Cb == "youtube" && rc(b.Fa, e.match[1], c, function(f) {
  7406. return function() {
  7407. Qd(f, false)
  7408. }
  7409. }(b))
  7410. } else {
  7411. Qd(b, true);
  7412. e = function(f) {
  7413. return function() {
  7414. Qd(f, false)
  7415. }
  7416. }(b);
  7417. if (d) e = q();
  7418. pc(b.Fa, c, e, d)
  7419. }
  7420. }
  7421.  
  7422. function Cd(b) {
  7423. b.k = Xd(b, b.w);
  7424. if (b.a.parseSimple) b.Vc = new ac(b.Vc);
  7425. if (b.a.parseSmilies) b.Vc = new Xb(b.Vc, b.a);
  7426. if (b.a.parseLinks) b.Vc = new Tb(b.Vc, b.a, Yd(b));
  7427. x && A("createRenderer", "Created a new renderer", K)
  7428. }
  7429.  
  7430. function Yd(b) {
  7431. var c = {};
  7432. c.youtube = function(d) {
  7433. return function(e, f) {
  7434. if (e[1]) {
  7435. Qd(d, true);
  7436. rc(d.Fa, e[1], f, function() {
  7437. Qd(d, false)
  7438. })
  7439. }
  7440. }
  7441. }(b);
  7442. c.web = function(d) {
  7443. return function(e) {
  7444. Qd(d, true);
  7445. pc(d.Fa, e, function() {
  7446. Qd(d, false)
  7447. })
  7448. }
  7449. }(b);
  7450. c.gview = function(d) {
  7451. return function(e) {
  7452. Qd(d, true);
  7453. qc(d.Fa, e, function() {
  7454. Qd(d, false)
  7455. })
  7456. }
  7457. }(b);
  7458. c.showImage = function(d) {
  7459. return function(e) {
  7460. Qd(d, true);
  7461. sc(d.Fa, e, function() {
  7462. Qd(d, false)
  7463. })
  7464. }
  7465. }(b);
  7466. c.mediaCheck = function(d) {
  7467. return function(e) {
  7468. e = Wd(d, e);
  7469. if (!e.enabled) return false;
  7470. return e
  7471. }
  7472. }(b);
  7473. c.ircLink =
  7474. function(d) {
  7475. d = d.substring(6, d.length);
  7476. var e = "",
  7477. f = d.indexOf("/");
  7478. if (f != -1) {
  7479. e = d.substring(f + 1, d.length);
  7480. d = d.substring(0, f);
  7481. if ("#&+".indexOf(e.substring(0, 1)) == -1) e = "#" + e
  7482. }
  7483. try {
  7484. var g = ed();
  7485. if (fd) g = fd;
  7486. var h = f = "",
  7487. k = F.defaultCharset;
  7488. if (Md) {
  7489. var l = Md.rg;
  7490. if (l)
  7491. for (var j = 0; j < l.length; j++)
  7492. if (l[j].Sf == d) {
  7493. g = l[j].h;
  7494. f = l[j].Kg;
  7495. h = l[j].Tf;
  7496. k = l[j].charset;
  7497. break
  7498. }
  7499. }
  7500. Zc(G, d, g, f, e, false, false, h, k)
  7501. } catch (n) {}
  7502. };
  7503. return c
  7504. }
  7505.  
  7506. function Xd(b, c) {
  7507. var d = new R;
  7508. if (b.xh) d = new dc(d);
  7509. if (b.a.parseSimple) d = new ac(d);
  7510. if (b.a.parseNicks) d = new Yb(b.$, d, function(e) {
  7511. return function(f, g) {
  7512. Zd(e, f, g)
  7513. }
  7514. }(b));
  7515. if (b.a.parseColor) d = new cc(d);
  7516. if (b.a.parseSmilies) d = new Xb(d, b.a);
  7517. if (b.a.parseChannels && c.eb) d = new Zb(c.eb, d, b.a);
  7518. if (b.a.parseLinks) d = new Tb(d, b.a, Yd(b));
  7519. return d
  7520. }
  7521.  
  7522. function Zd(b, c, d) {
  7523. try {
  7524. var e = c == b.h.toLowerCase();
  7525. d.style.color = e ? b.a.nickHighlightMe : b.a.nickHighlight;
  7526. d.style.fontWeight = e ? "bold" : "normal";
  7527. if (b.a.chatBackgroundHighlight) {
  7528. var f = b.la,
  7529. g = b.a;
  7530. d.onmouseover = function() {
  7531. return function() {
  7532. c && ic(f, c.toLowerCase(), {
  7533. background: g.chatBackgroundHighlight
  7534. })
  7535. }
  7536. }();
  7537. d.onmouseout = function() {
  7538. return function() {
  7539. c && ic(f, c.toLowerCase(), {
  7540. background: g.chatBackground
  7541. })
  7542. }
  7543. }()
  7544. }
  7545. } catch (h) {}
  7546. }
  7547.  
  7548. function Y(b, c, d, e, f, g, h, k, l, j, n) {
  7549. e || (e = b.a.colorChat);
  7550. var o = b.a,
  7551. s = b.w.Dg,
  7552. w = b.la,
  7553. p = n ? n : g ? b.a.nickColorMe : j ? b.a.nickColorGuest : l ? b.a.nickColorNotice : b.a.nickColor;
  7554. return {
  7555. tb: function(r) {
  7556. lc(w, r, o, f, p, s, e, h, c, d)
  7557. },
  7558. oc: function(r) {
  7559. w.oc(r, o, f, p, s)
  7560. },
  7561. pc: function(r) {
  7562. w.pc(r, o, k)
  7563. }
  7564. }
  7565. }
  7566. X.prototype.Ma = function(b) {
  7567. this.U.Ma(b)
  7568. };
  7569. var Bb = 94,
  7570. Pb = 120,
  7571. Qb = 0,
  7572. O = false;
  7573. X.prototype.Ae = function(b) {
  7574. this.Fa.Ae(b)
  7575. };
  7576. X.prototype.uc = function(b) {
  7577. this.h = b;
  7578. this.n.uc(b)
  7579. };
  7580.  
  7581. function Kd(b) {
  7582. this.b = b;
  7583. this.a = b.a;
  7584. this.mh = this.Ue = this.Te = true;
  7585. this.Ac = false;
  7586. this.gd = true;
  7587. this.F = {};
  7588. this.Eb = {};
  7589. this.Xd = [];
  7590. this.Jc = ""
  7591. }
  7592. Kd.prototype.Gc = function() {
  7593. this.F = {};
  7594. this.Eb = {}
  7595. };
  7596. Kd.prototype.Ma = function(b) {
  7597. try {
  7598. var c = (new Date).getTime(),
  7599. d = b.channel;
  7600. if (d) {
  7601. var e = d.indexOf(":", 10);
  7602. d = d.substring(e + 1, d.length)
  7603. }
  7604. if (b.cmd == "whoisreply") yd(this.b, new wc(b, this.a, this.b.Me));
  7605. else if (b.cmd == "motd" && this.a.showMOTD) {
  7606. var f = Y(this.b, b.motd, {}, "#888", null, false, this.b.k, c);
  7607. f.tb = function(N) {
  7608. var I = N.a;
  7609. return function(J) {
  7610. u({
  7611. overflow: "hidden",
  7612. fontFamily: "monospace",
  7613. paddingBottom: "1px",
  7614. paddingTop: "1px",
  7615. paddingLeft: "3px",
  7616. fontSize: I.chatFontSize + "px",
  7617. color: "#888",
  7618. background: I.chatBackground
  7619. },
  7620. J.style);
  7621. J.setAttribute("valign", "top");
  7622. N.ob.reset();
  7623. N.ob.r += b.message;
  7624. N.ob.A(J)
  7625. }
  7626. }(this.b);
  7627. this.b.e("motd", f);
  7628. this.Ac && $d(this.Cd, b.message, this.b.$)
  7629. } else if (b.cmd == "infobar")
  7630. if (b.type == "announcement") this.b.Ia.Eh(b.message);
  7631. else {
  7632. if (b.type == "topic") {
  7633. pb(this.b.Ia, b.topic, this.b.Rd);
  7634. this.b.C()
  7635. }
  7636. }
  7637. else if (b.cmd == "whowas") {
  7638. var g = ">>> " + b.nick + " was " + b.user + "@" + b.host + " " + b.realname;
  7639. this.b.e("whowas", Y(this.b, g, {}, this.a.colorNotice, null, false, this.b.k, c))
  7640. } else if (b.cmd == "who") {
  7641. g = ">>> " + b.nick + " (" + b.user +
  7642. "@" + b.host + " " + b.realname + ") " + b.serv + " (" + b.hops + " hops) " + b.chan + " " + b.flag;
  7643. this.b.e("who", Y(this.b, g, {}, this.a.colorNotice, null, false, this.b.k, c))
  7644. } else if (b.cmd == "channellist") {
  7645. g = b.name + " (" + b.users + ") " + b.topic;
  7646. this.b.e("channellist", Y(this.b, g, {}, this.a.colorNotice, null, false, this.b.Wf, c))
  7647. } else if (b.cmd == "invite") {
  7648. this.b.e(b.nick, Y(this.b, "%%% " + b.nick + " " + E.g("InviteText") + " " + b.localchannel, {}, this.a.colorInvite, null, false, this.b.k, c));
  7649. this.b.w.M && this.b.w.M()
  7650. } else if (b.cmd == "notice" && this.Ue) {
  7651. if (!ld(this.b,
  7652. b.nick)) {
  7653. this.b.e(b.nick.toLowerCase(), Y(this.b, b.notice, {}, this.a.colorNotice, b.nick, b.nick == this.b.h, this.b.k, c, true));
  7654. this.b.w.M && this.b.w.M(b.notice.indexOf(this.b.h) != -1)
  7655. }
  7656. } else if (b.cmd == "ctcp" && this.a.showCTCP) {
  7657. if (!ld(this.b, b.nick)) {
  7658. this.b.e(b.nick.toLowerCase(), Y(this.b, b.data, {}, this.a.colorNotice, b.nick, b.nick == this.b.h, this.b.k, c, true));
  7659. this.b.w.M && this.b.w.M(b.data.indexOf(this.b.h) != -1)
  7660. }
  7661. } else if (b.cmd == "ban") this.a.showBans && this.b.e("::ban", Y(this.b, "--- " + b.by + " " + E.g("BanText") + " " +
  7662. b.nick, {}, this.a.colorBan, null, false, this.b.k, c));
  7663. else if (b.cmd == "unban") this.a.showBans && this.b.e("::ban", Y(this.b, "--- " + b.by + " " + E.g("UnbanText") + " " + b.nick, {}, this.a.colorBan, null, false, this.b.k, c));
  7664. else if (b.cmd == "typing") this.b.c ? Fa(this.b.c, b.nick, b.typing) : Ta(this.b.n, b.typing);
  7665. else if (b.cmd == "topic") {
  7666. this.Jc = b.topic;
  7667. this.b.e("::topic", Y(this.b, b.topic, {}, this.a.colorTopic, null, false, this.b.k));
  7668. if (b.nick) {
  7669. var h = new Date;
  7670. this.b.e("::topic", Y(this.b, E.g("TopicText") + " " + b.nick + " " + E.g("TopicText2") +
  7671. " " + h, {}, this.a.colorTopicWho, null, false, this.b.k))
  7672. }
  7673. this.Ac && ae(this.Cd, b.topic, this.b.$)
  7674. } else if (b.cmd == "topicwho") {
  7675. h = new Date;
  7676. h.setTime(b.date * 1E3);
  7677. this.b.e("topic", Y(this.b, E.g("TopicText") + " " + b.creator + " " + E.g("TopicText2") + " " + h, {}, this.a.colorTopicWho, null, false, this.b.k))
  7678. } else if (b.cmd == "away") {
  7679. if (this.b.c && this.b.c.c[b.nick]) {
  7680. var k = this.b.c.c[b.nick];
  7681. if (b.reason) {
  7682. Ba(k, b.reason);
  7683. za(this.b.c, b.nick, false);
  7684. this.a.showAwaysBacks && this.b.e(b.nick.toLowerCase(), Y(this.b, "--- " + b.nick + " " + E.g("AwayText") +
  7685. " (" + b.reason + ")", {}, this.a.colorAway, null, false, this.b.k, c))
  7686. } else {
  7687. Ba(k, b.nick);
  7688. za(this.b.c, b.nick, true);
  7689. this.a.showAwaysBacks && this.b.e(b.nick.toLowerCase(), Y(this.b, "--- " + b.nick + " " + E.g("BackText"), {}, this.a.colorBack, null, false, this.b.k, c))
  7690. }
  7691. }
  7692. } else if (b.cmd == "msg") {
  7693. if (this.b.c) {
  7694. Fa(this.b.c, b.nick, false);
  7695. Aa(this.b.c, b.nick)
  7696. }
  7697. if (!ld(this.b, b.nick)) {
  7698. b.msg.toLowerCase().indexOf(this.b.h.toLowerCase()) != -1 && Tc("mentionednick");
  7699. Tc("newmsg");
  7700. T && T.Wb({
  7701. ae: "newmsg"
  7702. });
  7703. this.gd && bd && bd.wf(b.channel, d);
  7704. var l =
  7705. c;
  7706. if (b.dtime) l = c - b.dtime;
  7707. b.local || (b.msg = td.apply(b.msg, true, this.b.w.mc, b.nick));
  7708. if (b.msg) {
  7709. c = false;
  7710. if (this.Xd[b.nick])
  7711. if (b.msg.substring(0, 3) == "[**") {
  7712. e = b.msg.indexOf(" ");
  7713. if (e != -1) {
  7714. this.Ma({
  7715. cmd: "emote",
  7716. nick: b.msg.substring(3, e),
  7717. emote: b.msg.substring(e + 1, b.msg.length - 2),
  7718. vh: "#844"
  7719. });
  7720. return
  7721. }
  7722. } else if (b.msg.substring(0, 1) == "[") {
  7723. e = b.msg.indexOf("]");
  7724. if (e != -1) {
  7725. b.nick = b.msg.substring(1, e);
  7726. b.msg = b.msg.substring(e + 2, b.msg.length);
  7727. c = "#844"
  7728. }
  7729. }
  7730. var j = this.b.k;
  7731. if (b.channelclick) {
  7732. e = {};
  7733. e.eb = b.channelclick;
  7734. j = Xd(this.b,
  7735. e)
  7736. }
  7737. this.b.e(b.nick.toLowerCase(), Y(this.b, b.msg, typeof b.md == "undefined" ? {} : b.md, b.nick == this.b.h ? this.a.colorChatMe : this.a.colorChat, b.nick, b.nick == this.b.h, j, l, false, !b.idd, c));
  7738. this.b.w.M && this.b.w.M(b.msg.toLowerCase().indexOf(this.b.h.toLowerCase()) != -1)
  7739. }
  7740. }
  7741. this.Ac && $d(this.Cd, b.msg, this.b.$)
  7742. } else if (b.cmd == "emote") {
  7743. if (this.b.c) {
  7744. Fa(this.b.c, b.nick, false);
  7745. Aa(this.b.c, b.nick)
  7746. }
  7747. b.local || (b.emote = td.apply(b.emote, true, this.b.w.mc, b.nick));
  7748. if (b.emote && !ld(this.b, b.nick)) {
  7749. b.emote.toLowerCase().indexOf(this.b.h.toLowerCase()) !=
  7750. -1 && Tc("mentionednick");
  7751. Tc("newmsg");
  7752. T && T.Wb({
  7753. ae: "newmsg"
  7754. });
  7755. this.gd && bd && bd.wf(b.channel, d);
  7756. this.b.e(b.nick.toLowerCase(), Y(this.b, b.nick + " " + b.emote, {}, b.nick == this.b.h ? this.a.colorEmoteMe : this.a.colorEmote, null, b.nick == this.b.h, this.b.k, c, false, !b.idd));
  7757. this.b.w.M && this.b.w.M(b.emote.toLowerCase().indexOf(this.b.h.toLowerCase()) != -1)
  7758. }
  7759. this.Ac && $d(this.Cd, b.emote, this.b.$)
  7760. } else if (b.cmd == "rmsg") {
  7761. b.local || (b.msg = td.apply(b.msg, true, this.b.w.mc, b.nick));
  7762. b.msg && !ld(this.b, b.nick) && this.b.e(b.nick.toLowerCase(),
  7763. Y(this.b, b.msg, {}, this.a.colorChatRecent, b.nick, false, this.b.k, c - b.dtime))
  7764. } else if (b.cmd == "remote") {
  7765. b.local || (b.emote = td.apply(b.emote, true, this.b.w.mc, b.nick));
  7766. b.emote && !ld(this.b, b.nick) && this.b.e(b.nick.toLowerCase(), Y(this.b, b.nick + " " + b.emote, {}, this.a.colorEmoteRecent, null, false, this.b.k, c - b.dtime))
  7767. } else if (b.cmd == "mode") this.a.showUserModes && this.b.e("::mode", Y(this.b, "+++ " + b.msg, {}, this.a.colorUserMode, null, false, this.b.k, c));
  7768. else if (b.cmd == "usermode") {
  7769. function n(N, I, J, ka) {
  7770. return J + " " + E.g("ModeChange1") +
  7771. " " + E.g(N ? "ModeGiven" : "ModeTaken") + " " + I + " " + E.g(N ? "ModeTo" : "ModeFrom") + " " + ka
  7772. }
  7773. if (typeof b.owner != "undefined") {
  7774. this.b.c && Ca(this.b.c, b.nick, "owner", b.owner);
  7775. this.a.showUserModes && this.b.e("::mode", Y(this.b, "+++ " + n(b.owner, E.g("ModeOwner"), b.by, b.nick), {}, this.a.colorUserMode, null, false, this.b.k, c))
  7776. }
  7777. if (typeof b.admin != "undefined") {
  7778. this.b.c && Ca(this.b.c, b.nick, "admin", b.admin);
  7779. this.a.showUserModes && this.b.e("::mode", Y(this.b, "+++ " + n(b.admin, E.g("ModeAdmin"), b.by, b.nick), {}, this.a.colorUserMode, null,
  7780. false, this.b.k, c))
  7781. }
  7782. if (typeof b.halfop != "undefined") {
  7783. this.b.c && Ca(this.b.c, b.nick, "halfop", b.halfop);
  7784. this.a.showUserModes && this.b.e("::mode", Y(this.b, "+++ " + n(b.halfop, E.g("ModeHalfop"), b.by, b.nick), {}, this.a.colorUserMode, null, false, this.b.k, c))
  7785. }
  7786. if (typeof b.op != "undefined") {
  7787. this.b.c && Ca(this.b.c, b.nick, "op", b.op);
  7788. this.a.showUserModes && this.b.e("::mode", Y(this.b, "+++ " + n(b.op, E.g("ModeOp"), b.by, b.nick), {}, this.a.colorUserMode, null, false, this.b.k, c))
  7789. }
  7790. if (typeof b.voice != "undefined") {
  7791. this.b.c && Ca(this.b.c,
  7792. b.nick, "voice", b.voice);
  7793. this.a.showUserModes && this.b.e("::mode", Y(this.b, "+++ " + n(b.voice, E.g("ModeVoice"), b.by, b.nick), {}, this.a.colorUserMode, null, false, this.b.k, c))
  7794. }
  7795. } else if (b.cmd == "nicklist") {
  7796. var o = [];
  7797. for (j = 0; j < b.nicks.length; j++) {
  7798. l = b.nicks[j];
  7799. var s = be(this, l.mibbituser, l.device),
  7800. w = {};
  7801. if (l.info) w = ba(l.info);
  7802. if (this.a.ciUserIcon && w.userIcon) s = {
  7803. title: "Custom icon",
  7804. src: w.userIcon
  7805. };
  7806. var p = l.nick;
  7807. if (l.mibbitaway) p = l.mibbitaway;
  7808. var r = {};
  7809. r.admin = !!l.admin;
  7810. r.op = !!l.op;
  7811. r.halfop = !!l.halfop;
  7812. r.voice = !!l.voice;
  7813. r.owner = !!l.owner;
  7814. r.active = !l.mibbitaway;
  7815. if (this.b.c) {
  7816. var y = -1;
  7817. if (l.hasOwnProperty("idletime")) y = parseInt(l.idletime);
  7818. this.b.c.kd({
  7819. id: l.nick,
  7820. ci: w,
  7821. countrycode: l.cc,
  7822. localtime: l.ct,
  7823. timezone: l.tz,
  7824. nick: l.nick,
  7825. icon: s,
  7826. desc: p,
  7827. modes: r,
  7828. idleTime: y
  7829. })
  7830. }
  7831. this.b.$[l.nick.toLowerCase()] = l.nick;
  7832. kb(this.b.n.da, l.nick);
  7833. if (this.F[l.nick.toLowerCase()]) u({
  7834. device: l.device,
  7835. mibbituser: l.mibbituser,
  7836. embed: l.embed,
  7837. host: l.host
  7838. }, this.F[l.nick.toLowerCase()]);
  7839. else this.F[l.nick.toLowerCase()] = {
  7840. device: l.device,
  7841. mibbituser: l.mibbituser,
  7842. embed: l.embed,
  7843. host: l.host
  7844. }
  7845. }
  7846. this.b.c && Td(this.b, this.b.c.size() + " " + E.g("UserCount"))
  7847. } else if (b.cmd == "userinfo") {
  7848. var z = b.id ? b.id : b.nick;
  7849. s = be(this, b.mibbituser, b.device);
  7850. w = {};
  7851. if (b.info) w = ba(b.info);
  7852. if (this.a.ciUserIcon && w.userIcon) s = {
  7853. title: "Custom icon",
  7854. src: w.userIcon
  7855. };
  7856. p = b.nick;
  7857. if (b.mibbitaway) p = b.mibbitaway;
  7858. if (b.status) p = b.status;
  7859. if (this.b.c) {
  7860. y = -1;
  7861. if (b.hasOwnProperty("idletime")) y = parseInt(b.idletime);
  7862. var B = this.b.c.c[z];
  7863. if (B) {
  7864. B.Ic = b.cc;
  7865. B.te = parseInt(b.ct) - (new Date).getTime();
  7866. B.Ge = b.tz;
  7867. B.P = s;
  7868. B.description =
  7869. p;
  7870. B.Ha = Math.floor((new Date).getTime() / 1E3) - y;
  7871. B.sd = w;
  7872. B.pa = !b.mibbitaway;
  7873. if (b.hasOwnProperty("awaystate")) thuser.pa = !b.awaystate;
  7874. la(this.b.c, z);
  7875. B.z()
  7876. }
  7877. }
  7878. this.F[b.nick.toLowerCase()].device = b.device;
  7879. this.F[b.nick.toLowerCase()].embed = b.embed;
  7880. this.F[b.nick.toLowerCase()].mibbituser = b.mibbituser
  7881. } else if (b.cmd == "join") {
  7882. Tc("userjoin");
  7883. T && T.Wb({
  7884. ae: "userjoin"
  7885. });
  7886. z = b.id ? b.id : b.nick;
  7887. s = be(this, b.mibbituser, b.device);
  7888. w = {};
  7889. if (b.info) w = ba(b.info);
  7890. if (this.a.ciUserIcon && w.userIcon) s = {
  7891. title: "Custom icon",
  7892. src: w.userIcon
  7893. };
  7894. p = b.nick;
  7895. if (b.mibbitaway) p = b.mibbitaway;
  7896. if (b.status) p = b.status;
  7897. if (this.b.c) {
  7898. y = -1;
  7899. if (b.hasOwnProperty("idletime")) y = parseInt(b.idletime);
  7900. r = {};
  7901. r.admin = false;
  7902. r.op = false;
  7903. r.halfop = false;
  7904. r.voice = false;
  7905. r.owner = false;
  7906. r.active = !b.mibbitaway;
  7907. if (b.hasOwnProperty("awaystate")) r.active = !b.awaystate;
  7908. this.b.c && this.b.c.kd({
  7909. id: z,
  7910. ci: w,
  7911. countrycode: b.cc,
  7912. localtime: b.ct,
  7913. timezone: b.tz,
  7914. nick: b.nick,
  7915. icon: s,
  7916. desc: p,
  7917. modes: r,
  7918. idleTime: y
  7919. });
  7920. Td(this.b, this.b.c.size() + " " + E.g("UserCount"))
  7921. }
  7922. if (this.a.showJoinsParts) {
  7923. g = "*** " + b.nick +
  7924. " " + E.g("JoinText") + (b.localchannel ? " " + b.localchannel : "");
  7925. if (this.a.showJoinInfo) {
  7926. g += " " + b.user + "@" + b.host + " ";
  7927. if (b.mibbituser) {
  7928. if (b.device) g += " [" + b.device + "]";
  7929. g += b.embed ? " (Widget)" : " (Mibbit)"
  7930. }
  7931. }
  7932. this.b.e(b.nick.toLowerCase(), Y(this.b, g, {}, this.a.colorJoin, null, false, this.b.k, c))
  7933. }
  7934. this.b.$[z.toLowerCase()] = b.nick;
  7935. kb(this.b.n.da, b.nick);
  7936. this.F[b.nick.toLowerCase()] = {
  7937. user: b.user,
  7938. host: b.host,
  7939. device: b.device,
  7940. embed: b.embed,
  7941. mibbituser: b.mibbituser
  7942. }
  7943. } else if (b.cmd == "userdetails") {
  7944. if (this.F[b.nick.toLowerCase()])
  7945. if (this.F[b.nick.toLowerCase()]) {
  7946. this.F[b.nick.toLowerCase()].user =
  7947. b.user;
  7948. this.F[b.nick.toLowerCase()].host = b.host
  7949. } else this.F[b.nick.toLowerCase()] = {
  7950. user: b.user,
  7951. host: b.host
  7952. }
  7953. } else if (b.cmd == "part") {
  7954. if (this.b.c && this.b.c.c[b.id ? b.id : b.nick]) {
  7955. Tc("userpart");
  7956. T && T.Wb({
  7957. cmd: "userpart"
  7958. });
  7959. z = b.id ? b.id : b.nick;
  7960. this.b.c.nc(z);
  7961. Td(this.b, this.b.c.size() + " " + E.g("UserCount"));
  7962. delete this.b.$[z.toLowerCase()];
  7963. lb(this.b.n.da, b.nick);
  7964. delete this.F[z.toLowerCase()];
  7965. delete this.Eb[b.nick];
  7966. if (this.a.showJoinsParts) {
  7967. if (b.quit) g = "*** " + b.nick + " " + E.g("QuitText") + " (" + b.message + ")";
  7968. else {
  7969. g =
  7970. "*** " + b.nick + " " + E.g("LeftText");
  7971. g += b.localchannel ? " " + b.localchannel : ".";
  7972. if (b.message) g += " (" + b.message + ")"
  7973. }
  7974. if (this.a.showPartInfo) {
  7975. g += " " + b.user + "@" + b.host + " ";
  7976. if (b.mibbituser) {
  7977. if (b.device) g += " [" + b.device + "]";
  7978. g += b.embed ? " (Widget)" : " (Mibbit)"
  7979. }
  7980. }
  7981. this.b.e(b.nick.toLowerCase(), Y(this.b, g, {}, this.a.colorPart, null, false, this.b.k, c))
  7982. }
  7983. }
  7984. if (b.nick == this.b.h) {
  7985. this.b.e(b.nick.toLowerCase(), Y(this.b, "!!! You left " + b.localchannel, {}, this.a.colorPart, null, false, this.b.k, c));
  7986. this.b.Gc()
  7987. }
  7988. } else if (b.cmd == "kick") {
  7989. if (this.b.c &&
  7990. this.b.c.c[b.nick]) {
  7991. Tc("userpart");
  7992. T && T.Wb({
  7993. ae: "userpart"
  7994. });
  7995. this.b.c.nc(b.nick);
  7996. Td(this.b, this.b.c.size() + " " + E.g("UserCount"));
  7997. delete this.b.$[b.nick.toLowerCase()];
  7998. lb(this.b.n.da, b.nick);
  7999. delete this.F[b.nick.toLowerCase()];
  8000. delete this.Eb[b.nick];
  8001. b.reason ? this.b.e(b.nick.toLowerCase(), Y(this.b, "*** " + b.nick + " " + E.g("KickText") + " " + b.kicker + " (" + b.reason + ")", {}, this.a.colorKick, null, false, this.b.k, c)) : this.b.e(b.nick.toLowerCase(), Y(this.b, "*** " + b.nick + " " + E.g("KickText") + " " + b.kicker, {}, this.a.colorKick,
  8002. null, false, this.b.k, c))
  8003. }
  8004. if (b.nick == this.b.h) {
  8005. this.b.e(b.nick.toLowerCase(), Y(this.b, "!!! You have been kicked from " + b.localchannel, {}, this.a.colorKick, null, false, this.b.k, c));
  8006. this.b.Gc()
  8007. }
  8008. } else if (b.cmd == "init") {
  8009. this.b.uc(b.nick);
  8010. if (!this.b.c) {
  8011. this.b.$[b.nick.toLowerCase()] = b.nick;
  8012. kb(this.b.n.da, b.nick)
  8013. }
  8014. } else if (b.cmd == "changenick") {
  8015. if (this.b.c && this.b.c.c[b.nick]) {
  8016. o = this.b.c.c[b.nick];
  8017. o.description == b.nick && Ba(o, b.newnick);
  8018. Ea(this.b.c, b.nick, b.newnick)
  8019. }
  8020. if (ld(this.b, b.nick)) {
  8021. delete this.Eb[b.nick];
  8022. this.Eb[b.newnick] = true
  8023. }
  8024. if (this.b.$[b.nick.toLowerCase()]) {
  8025. this.b.$[b.newnick.toLowerCase()] = b.newnick;
  8026. kb(this.b.n.da, b.newnick);
  8027. this.b.e(b.nick.toLowerCase(), Y(this.b, "*** " + b.nick + " " + E.g("NickText") + " " + b.newnick, {}, this.a.colorChangeNick, null, false, this.b.k, c));
  8028. if (b.nick.toLowerCase() != b.newnick.toLowerCase()) {
  8029. delete this.b.$[b.nick.toLowerCase()];
  8030. lb(this.b.n.da, b.nick)
  8031. }
  8032. }
  8033. if (this.F[b.nick.toLowerCase()]) {
  8034. this.F[b.newnick.toLowerCase()] = this.F[b.nick.toLowerCase()];
  8035. delete this.F[b.nick.toLowerCase()]
  8036. }
  8037. b.nick ==
  8038. this.b.h && this.b.uc(b.newnick)
  8039. } else if (b.cmd == "log" && this.Te) {
  8040. this.b.e("::log", Y(this.b, b.message, {}, this.a.colorSystem, b.nick, false, this.b.vc, c));
  8041. this.b.w.M && this.b.w.M()
  8042. } else if (b.cmd == "error") {
  8043. this.b.e("::error", Y(this.b, b.msg, {}, this.a.colorSystem, "", false, this.b.vc, c));
  8044. this.b.w.M && this.b.w.M()
  8045. } else if (b.cmd == "pastereply") b.error ? this.b.e("::paste", Y(this.b, b.error, {}, this.a.colorNotice, "PasteBin", false, this.b.k, c, true)) : this.b.n.Ub("http://mibpaste.com/" + b.url + " ");
  8046. else if (b.cmd == "minifyreply") this.b.n.Ub("http://miburl.com/" +
  8047. b.uniq + " ");
  8048. else if (b.cmd == "removechat") {
  8049. if (this.a.allowChatRemoval) {
  8050. hc(this.b.la, b.chatid);
  8051. U(this.b)
  8052. }
  8053. } else if (b.cmd == "banlist") {
  8054. h = new Date;
  8055. h.setTime(b.ctime * 1E3);
  8056. var H = Y(this.b, null, {}, this.a.colorBan, null, false, this.b.k);
  8057. H.tb = yc(b, this.a, this.b.w.gh);
  8058. this.b.e("banlist", H)
  8059. } else b.cmd == "plugin" && this.b.Ae(b.data)
  8060. } catch (P) {
  8061. x && A("cmh.process", t(b) + "|" + P, C)
  8062. }
  8063. };
  8064.  
  8065. function be(b, c, d) {
  8066. b = {
  8067. name: "user",
  8068. title: ""
  8069. };
  8070. if (c)
  8071. if (d)
  8072. if (d == "ipod") b = {
  8073. name: "ipod",
  8074. title: "iPod Mibbitian"
  8075. };
  8076. else if (d == "iphone") b = {
  8077. name: "iphone",
  8078. title: "iPhone Mibbitian"
  8079. };
  8080. else {
  8081. if (d == "wii") b = {
  8082. name: "wii",
  8083. title: "Wii Mibbitian"
  8084. }
  8085. } else b = {
  8086. name: "mibbituser",
  8087. title: "Mibbitian"
  8088. };
  8089. return b
  8090. }
  8091.  
  8092. function ce() {
  8093. this.qa = []
  8094. }
  8095. ce.prototype.load = function(b) {
  8096. this.qa = [];
  8097. for (var c = 0; c < b.length; c++) try {
  8098. this.qa.push({
  8099. reg: b[c].reg,
  8100. replacement: b[c].replacement,
  8101. replacein: b[c].replacein,
  8102. replaceout: b[c].replaceout,
  8103. block: b[c].block,
  8104. cmd: b[c].cmd
  8105. })
  8106. } catch (d) {}
  8107. };
  8108. ce.prototype.apply = function(b, c, d, e) {
  8109. for (var f = 0; f < this.qa.length; f++)
  8110. if (c && this.qa[f].replacein || !c && this.qa[f].replaceout) {
  8111. var g = new RegExp(this.qa[f].reg, "g");
  8112. !Rc && d && this.qa[f].cmd && g.test(b) && d(this.qa[f].cmd, this.qa[f].reg, e);
  8113. x && A("filters.apply", "d=" + b + " isin=" + c + " block=" + this.qa[f].block, K);
  8114. if (this.qa[f].block) {
  8115. x && A("filters.apply", "block d=" + b + " rg=" + g + " match=" + g.test(b), K);
  8116. if (g.test(b)) return false
  8117. } else b = b.replace(g, this.qa[f].replacement)
  8118. }
  8119. return b
  8120. };
  8121.  
  8122. function u(b, c) {
  8123. for (v in b)
  8124. if (b.hasOwnProperty(v)) c[v] = b[v]
  8125. }
  8126.  
  8127. function nb(b) {
  8128. if (!b) return true;
  8129. try {
  8130. if (b.substring(0, 1) == "#") {
  8131. b = b.substring(1, b.length);
  8132. var c, d, e;
  8133. if (b.length == 6) {
  8134. e = parseInt(b.substring(0, 2), 16);
  8135. d = parseInt(b.substring(2, 4), 16);
  8136. c = parseInt(b.substring(4, 6), 16);
  8137. return e + d + c > 384
  8138. } else if (b.length == 3) {
  8139. e = parseInt(b.substring(0, 1), 16);
  8140. d = parseInt(b.substring(1, 2), 16);
  8141. c = parseInt(b.substring(2, 3), 16);
  8142. return e + d + c > 24
  8143. }
  8144. }
  8145. } catch (f) {}
  8146. return true
  8147. }
  8148.  
  8149. function de() {
  8150. if (navigator.appName == "Microsoft Internet Explorer") {
  8151. var b = /MSIE ([0-9]{1,}[.0-9]{0,})/.exec(navigator.userAgent);
  8152. if (b != null) return parseFloat(b[1])
  8153. }
  8154. return -1
  8155. }
  8156.  
  8157. function ee() {
  8158. this.ad = [];
  8159. this.Wd = [];
  8160. this.Qa = {}
  8161. }
  8162.  
  8163. function ae(b, c, d) {
  8164. $d(b, c, d);
  8165. if (c = c.match(/[^\s\#\!\@\$\%\^\&\*\(\)\_\+\-\=\{\}\[\]\:\;\"\'\,\.\/\<\>\?\~\|\\]+/g))
  8166. for (var e = 0; e < c.length; e++) {
  8167. var f = c[e].toLowerCase();
  8168. if (!d || !d[f])
  8169. if (" the and for are but not you all any can had her was one our out day get has him his how man new now old see two way who boy did its let put say she too use lol ftw hey that with have this will your from they know want been good much some time very when come here just like long make many more only over such take than them well were what book cool there their which ".indexOf(" " + f +
  8170. " ") == -1 && f.length >= 3 && !f.match(/^[0-9]+$/)) {
  8171. fe(b, f, b.ad);
  8172. b.ad.length > 15 && b.ad.shift()
  8173. }
  8174. }
  8175. }
  8176.  
  8177. function fe(b, c, d) {
  8178. if (c) {
  8179. for (b = 0; b < d.length; b++)
  8180. if (d[b] == c) return;
  8181. d.push(c)
  8182. }
  8183. }
  8184.  
  8185. function $d(b, c, d) {
  8186. if (c = c.match(/[^\s\#\!\@\$\%\^\&\*\(\)\_\+\-\=\{\}\[\]\:\;\"\'\,\.\/\<\>\?\~\|\\]+/g))
  8187. for (var e = 0; e < c.length; e++)
  8188. if (!d || !d[c[e].toLowerCase()]) {
  8189. var f = c[e];
  8190. f = f.toLowerCase();
  8191. if (!(" the and for are but not you all any can had her was one our out day get has him his how man new now old see two way who boy did its let put say she too use lol ftw hey that with have this will your from they know want been good much some time very when come here just like long make many more only over such take than them well were what book cool there their which ".indexOf(" " + f +
  8192. " ") != -1 || f.length < 3 || f.match(/^[0-9]+$/))) {
  8193. b.Wd.push(f);
  8194. if (b.Qa[f]) b.Qa[f]++;
  8195. else b.Qa[f] = 1;
  8196. if (b.Wd.length > 500) {
  8197. f = b.Wd.shift();
  8198. b.Qa[f]--;
  8199. b.Qa[f] == 0 && delete b.Qa[f]
  8200. }
  8201. }
  8202. }
  8203. }
  8204.  
  8205. function Ad(b, c) {
  8206. for (var d = [], e = 0; e < Math.min(b.ad.length, 15); e++) d.push(b.ad[e]);
  8207. var f = {};
  8208. for (e = 0; e < c; e++) {
  8209. var g;
  8210. g = null;
  8211. var h = 0;
  8212. for (var k in b.Qa)
  8213. if (b.Qa.hasOwnProperty(k) && !f[k])
  8214. if (b.Qa[k] > h) {
  8215. h = b.Qa[k];
  8216. g = k
  8217. }
  8218. g = g;
  8219. if (g == null) break;
  8220. f[g] = b.Qa[g];
  8221. fe(b, g, d)
  8222. }
  8223. return d
  8224. }
  8225. var vd = true;
  8226.  
  8227. function Tc(b) {
  8228. F.sounds[b] && F.sounds[b].enabled && wd(F.sounds[b].sound)
  8229. }
  8230.  
  8231. function ge(b) {
  8232. if (b.substr(0, 7) == "http://" || b.substr(0, 8) == "https://") return b;
  8233. if (b.substr(0, 27) == "//static.mibbit.com/sounds/") return "https://s3.amazonaws.com/mibbit/sounds/" + b.substr(27);
  8234. if (b.substr(0, 8) == "/sounds/") return "https://s3.amazonaws.com/mibbit" + b;
  8235. return b
  8236. }
  8237.  
  8238. function wd(b) {
  8239. try {
  8240. if (vd) {
  8241. var c = "",
  8242. d = b.lastIndexOf(".");
  8243. if (d != -1) {
  8244. var e = b.substring(d, b.length).toLowerCase();
  8245. if (e == ".mp3" || e == ".wav" || e == ".ogg" || e == ".m4a") {
  8246. c = e;
  8247. b = b.substring(0, d)
  8248. }
  8249. }
  8250. if ("Audio" in window) {
  8251. var f = new Audio;
  8252. if (c == "") {
  8253. c = f.canPlayType && f.canPlayType('audio/ogg; codecs="vorbis"').replace(/no/, "") ? ".ogg" : f.canPlayType && f.canPlayType("audio/mpeg;").replace(/no/, "") ? ".mp3" : f.canPlayType && f.canPlayType('audio/mp4; codecs="mp4a.40.2"').replace(/no/, "") ? ".m4a" : ".mp3";
  8254. x && A("Sounds", "Picked " + c + " for file " +
  8255. b, K)
  8256. }
  8257. f.src = ge(b + c);
  8258. f.autoplay = true;
  8259. f.play && f.play()
  8260. } else {
  8261. if (c == "") c = ".mp3";
  8262. var g = document.getElementById("current_sound");
  8263. g && g.parentNode.removeChild(g);
  8264. g = document.createElement("bgsound");
  8265. g.id = "current_sound";
  8266. g.setAttribute("src", ge(b + c));
  8267. g.setAttribute("loop", 1);
  8268. document.appendChild(g)
  8269. }
  8270. }
  8271. } catch (h) {
  8272. x && A("Sounds", "Source " + b + " " + h, C)
  8273. }
  8274. }
  8275. var Ma = true,
  8276. he = false,
  8277. kc = false,
  8278. Rc = false,
  8279. ie = "WebSocket" in window ? true : false,
  8280. je = 12E4,
  8281. ke = 9E5,
  8282. le = 2E4,
  8283. me = null,
  8284. ne = [],
  8285. oe = 6,
  8286. F, V, S, pe, Ld, fd, qe = false,
  8287. re, Md, rd, td, W, od, G, x = false,
  8288. M = "FINE",
  8289. K = "INFO",
  8290. C = "WARNING",
  8291. se = {
  8292. FINE: "#aaa",
  8293. INFO: "#00f",
  8294. WARNING: "#f00"
  8295. };
  8296.  
  8297. function A(b, c, d) {
  8298. d == C && V.G({
  8299. cmd: "clientlog",
  8300. m: "WARNING :" + b + " : " + c
  8301. })
  8302. }
  8303. var te = {},
  8304. ue, Q, T, bd, ve = "",
  8305. Z;
  8306. window.onerror = function(b, c, d) {
  8307. x && te && A("onerror", b + " " + c + " :" + d, C)
  8308. };
  8309.  
  8310. function we(b) {
  8311. var c = b.target ? b.target : b.srcElement;
  8312. c = c.tagName ? c.tagName : c.nodeName;
  8313. if (c.toLowerCase() != "input" && c.toLowerCase() != "textarea" && b.keyCode == 8) return false;
  8314. return true
  8315. }
  8316.  
  8317. function xe(b) {
  8318. if (!b) b = window.event;
  8319. return we(b)
  8320. }
  8321.  
  8322. function ye(b) {
  8323. if (!b) b = window.event;
  8324. if (b.altKey) {
  8325. try {
  8326. if (b.keyCode == 37) a: for (var c = Q, d = 0; d < c.q.length; d++) {
  8327. if (c.q[d].va) {
  8328. if (d == 0) break a;
  8329. Gb(c);
  8330. c.q[d - 1].open();
  8331. break
  8332. }
  8333. } else if (b.keyCode == 39) a: {
  8334. c = Q;
  8335. for (d = 0; d < c.q.length; d++)
  8336. if (c.q[d].va) {
  8337. if (d == c.q.length - 1) break a;
  8338. Gb(c);
  8339. c.q[d + 1].open();
  8340. break
  8341. }
  8342. }
  8343. else b.keyCode == 38 && Ob(Q)
  8344. } catch (e) {}
  8345. if (b.keyCode == 37 || b.keyCode == 39) return false
  8346. }
  8347. return we(b)
  8348. }
  8349. document.onkeydown = ye;
  8350. document.onkeypress = xe;
  8351.  
  8352. function ze(b) {
  8353. V.Pa = b;
  8354. V.reset();
  8355. x && A("sessionSetHandler", "mysession=" + Ld + " s=" + b, K);
  8356. if (Ld) {
  8357. W.alert("Connection to Mibbit was lost.");
  8358. G.Gg();
  8359. Uc("")
  8360. }
  8361. Ld = b;
  8362. (new Date).getTime();
  8363. b = new Date;
  8364. var c = -b.getTimezoneOffset();
  8365. b = {
  8366. cmd: "clientinfo",
  8367. localtime: b.getTime() + c * 6E4,
  8368. tzoffset: c
  8369. };
  8370. x && A("sessionSetHandler", "ic = " + t(b), K);
  8371. V.G(b);
  8372. Ae()
  8373. }
  8374.  
  8375. function Be(b) {
  8376. x && A("ooHandler", "oo=" + b, K);
  8377. var c = document.getElementById("connlogo"),
  8378. d = document.getElementById("serverstatus");
  8379. d.style.color = b ? "#aaa" : "#f00";
  8380. c.style.display = b ? "inline" : "none";
  8381. b = b ? ve : E.g("MibbitDisconnected");
  8382. if (d.firstChild) d.firstChild.nodeValue = b;
  8383. else d.appendChild(document.createTextNode(b))
  8384. }
  8385.  
  8386. function Ce(b) {
  8387. try {
  8388. x && A("globalCHandler", t(b), K);
  8389. if (b.cmd == "serverstatus") {
  8390. var c = document.getElementById("serverstatus"),
  8391. d = b.status,
  8392. e = d.lastIndexOf(" ");
  8393. if (e) d = d.substring(0, e);
  8394. if (c.firstChild) c.firstChild.nodeValue = d;
  8395. else c.appendChild(document.createTextNode(d));
  8396. ve = d
  8397. } else if (b.cmd == "global") G.Og(b.msg);
  8398. else if (b.cmd == "ping") {
  8399. var f = (new Date).getTime();
  8400. f = Math.floor((f - b.ts) / 2);
  8401. De("lag: " + f + "ms");
  8402. ne.push(f);
  8403. ne.length > oe && ne.shift()
  8404. } else b.cmd == "lagtime" && cd(G, b)
  8405. } catch (g) {
  8406. x && A("globalCHandler", "Exception " +
  8407. g, C)
  8408. }
  8409. }
  8410.  
  8411. function Ae() {
  8412. x && A("checkLag", "Checking lag...", K);
  8413. me && window.clearTimeout(me);
  8414. me = window.setTimeout(function() {
  8415. me = null;
  8416. De("(TIMEOUT)")
  8417. }, le);
  8418. V.G({
  8419. cmd: "ping",
  8420. ts: (new Date).getTime()
  8421. });
  8422. return false
  8423. }
  8424.  
  8425. function Ee() {
  8426. for (var b = 0, c = 0; c < ne.length; c++) b += ne[c];
  8427. return b = Math.floor(b / ne.length)
  8428. }
  8429.  
  8430. function De(b) {
  8431. me && window.clearTimeout(me);
  8432. me = null;
  8433. var c = document.getElementById("laginfo");
  8434. c.onclick = Ae;
  8435. if (c.firstChild) c.firstChild.nodeValue = b;
  8436. else c.appendChild(document.createTextNode(b))
  8437. }
  8438.  
  8439. function Uc(b, c, d, e) {
  8440. var f = document.getElementById("clientstatus"),
  8441. g = document.getElementById("clientstatus" + b);
  8442. if (!g) {
  8443. g = document.createElement("span");
  8444. g.id = "clientstatus" + b;
  8445. f.appendChild(g)
  8446. }
  8447. for (; g.firstChild;) g.removeChild(g.firstChild);
  8448. if (c + d + e > 0) {
  8449. g.appendChild(document.createTextNode(b.toUpperCase() + ": " + c + " "));
  8450. if (d + e > 0) {
  8451. b = document.createElement("span");
  8452. b.style.color = "#880";
  8453. g.appendChild(b);
  8454. b.appendChild(document.createTextNode("+" + (d + e)))
  8455. }
  8456. }
  8457. }
  8458.  
  8459. function Fe(b, c) {
  8460. if (b.substring(0, 10) == "IRCClient:") return $c(G, b, c);
  8461. x && A("newCHandler", "New channel " + b + " (" + t(c) + ")", K);
  8462. return false
  8463. }
  8464.  
  8465. function Ge(b, c, d, e) {
  8466. if (b) {
  8467. b = document.createElement("span");
  8468. b.style.color = "#666";
  8469. b.appendChild(document.createTextNode(" | "));
  8470. c.appendChild(b)
  8471. }
  8472. b = document.createElement("span");
  8473. u({
  8474. cursor: "pointer",
  8475. fontWeight: "bold",
  8476. color: "#aaa"
  8477. }, b.style);
  8478. b.appendChild(document.createTextNode(d));
  8479. c.appendChild(b);
  8480. b.onclick = e
  8481. }
  8482.  
  8483. function He(b, c, d, e, f, g) {
  8484. if (g && g.type == "Premium") {
  8485. qe = true;
  8486. Ie(true)
  8487. } else qe = false;
  8488. c = document.getElementById("loginstatus");
  8489. if (b) {
  8490. fd = d;
  8491. re = f;
  8492. Md = g;
  8493. x && A("lioHandler", "prefs=" + e, M);
  8494. F.reset();
  8495. F.load(e);
  8496. rd.load(F.aliases);
  8497. for (td.load(F.filters); c.firstChild;) c.removeChild(c.firstChild);
  8498. c.appendChild(document.createTextNode(d));
  8499. Ge(true, c, E.g("Menu_Logout"), function() {
  8500. Je(pe)
  8501. })
  8502. } else {
  8503. fd = null;
  8504. re = {};
  8505. x && A("lioHandler", "Logged out, reset defaultPrefs", M);
  8506. F.reset();
  8507. Rd(F);
  8508. for (Ie(false); c.firstChild;) c.removeChild(c.firstChild);
  8509. Ge(false, c, E.g("Menu_Login"), uGui.Vg);
  8510. Ge(true, c, E.g("Menu_Register"), uGui.Wg);
  8511. Jb(Q, ".XAccount");
  8512. Jb(Q, ".XChannels");
  8513. Jb(Q, ".XPrefs");
  8514. Jb(Q, ".XLogs");
  8515. Jb(Q, ".XProfile")
  8516. }
  8517. uGui.Je(b);
  8518. fa(W)
  8519. }
  8520. var Ke = false;
  8521.  
  8522. function Le() {
  8523. Ke = true;
  8524. Ie(qe)
  8525. }
  8526.  
  8527. function Me() {
  8528. var b = document.createElement("script");
  8529. b.src = "https://www.google.com/jsapi?callback=loadedGoogle&key=" + (document.location.protocol == "https:" ? "ABQIAAAAMWVs2CFZKh4tHpNoyudfehT7a2vVMXy4YJ6gxszjGxhjLi1vThQlwj9IDi0zjID6pApN4CVCYpZgqg" : "ABQIAAAAMWVs2CFZKh4tHpNoyudfehSLjyhLxcdKYU-OPaY8o4Pq0SJYtxQiGwbiPerGixwxOrqB1yCoy0TTOg");
  8530. b.type = "text/javascript";
  8531. document.getElementsByTagName("head")[0].appendChild(b);
  8532. b = de();
  8533. if (b != -1) {
  8534. Ma = false;
  8535. kc = true;
  8536. if (b < 7) he = true
  8537. }
  8538. try {
  8539. if (top.location != location) {
  8540. alert("The official Mibbit website is at www.mibbit.com. Please update your links.");
  8541. top.location.href = document.location.href
  8542. }
  8543. } catch (c) {}
  8544. if (he) O = true;
  8545. od = new ee;
  8546. b = document.createElement("div");
  8547. b.id = "errorlog";
  8548. document.body.appendChild(b);
  8549. W = new ca(b);
  8550. Nc.prototype.If = function(g, h) {
  8551. h && W.alert(g + ": " + h)
  8552. };
  8553. Nc.prototype.Jf = function(g, h, k) {
  8554. if (h) W.alert(g + ": " + h + (k ? "\r\n\r\n" + k : ""))
  8555. };
  8556. Nc.prototype.ce = function(g) {
  8557. W.alert("Are you sure you want to disconnect from " + g + "?", function(h) {
  8558. h && Qc(G, g)
  8559. })
  8560. };
  8561. Oc.prototype.yd = function(g, h) {
  8562. W.alert("Please pick a new nick: ", function(k) {
  8563. k && h(k)
  8564. }, true)
  8565. };
  8566. Gd.prototype.prompt =
  8567. function(g, h) {
  8568. W.alert("Alias " + g + ":", h, true)
  8569. };
  8570. rd = new Gd;
  8571. td = new ce;
  8572. G = new Nc;
  8573. F = new Ne;
  8574. rd.load(F.aliases);
  8575. td.load(F.filters);
  8576. Q = new Ab(document.getElementById("tabs"), F, true, 6, 20);
  8577. Ie(false);
  8578. uGui.Je(false);
  8579. try {
  8580. if (navigator.userAgent.indexOf("Nintendo Wii") != -1) F.needSendButton = true
  8581. } catch (d) {}
  8582. T = new Id(window, "Mibbit", "[ Mibbit ]", F);
  8583. T.Fc(window, "window");
  8584. T.Fc(window.document, "doc");
  8585. bd = new Jd;
  8586. He(false);
  8587. Oe(F, function() {
  8588. function g(h, k) {
  8589. if (h = Q.l[h]) {
  8590. h.content.style.background = F.tabColorGeneral;
  8591. k || (k = {});
  8592. k.background =
  8593. F.tabColorGeneral;
  8594. k.border = F.tabBColorGeneral;
  8595. h.H = k;
  8596. tb(h, h.va)
  8597. }
  8598. }
  8599. Q.z();
  8600. Fb(Q, F.useTabList);
  8601. g("..Welcome", {
  8602. icon: "/icons/house.png",
  8603. iconWidth: 16,
  8604. iconHeight: 16
  8605. });
  8606. g(".XChannels");
  8607. g(".XPrefs", {
  8608. iconWidth: 16,
  8609. iconHeight: 16,
  8610. icon: "/icons/wrench.png"
  8611. });
  8612. g(".XProfile", {
  8613. iconWidth: 16,
  8614. iconHeight: 16,
  8615. icon: "/icons/user_green.png"
  8616. });
  8617. g(".XAccount");
  8618. g(".XLogs");
  8619. g(".Log");
  8620. window.webkitNotifications && F.desktopNotifications && window.webkitNotifications.checkPermission() != 0 && W.alert("Desktop notifications are set in your prefs. Would you like to enable them for this chat backend?",
  8621. function(h) {
  8622. h && window.webkitNotifications.requestPermission(q())
  8623. }, false)
  8624. });
  8625. Oe(F, function() {
  8626. uGui.Je(fd != null)
  8627. });
  8628. Oe(F, function(g) {
  8629. G.Uc(g)
  8630. });
  8631. document.getElementById("chats");
  8632. if (typeof VERSION == "undefined" || $("debug") != null) xd();
  8633. var e = Pe("..Welcome", "Home", "Mibbit Home", false, false, null);
  8634. b = e.ownerDocument.createElement("div");
  8635. u({
  8636. position: "absolute",
  8637. top: "8px",
  8638. bottom: "8px",
  8639. left: "8px",
  8640. right: "8px",
  8641. overflow: "hidden"
  8642. }, b.style);
  8643. e.appendChild(b);
  8644. e = e.ownerDocument.createElement("iframe");
  8645. e.style.width = "100%";
  8646. e.style.height = "100%";
  8647. e.style.minHeight = "100%";
  8648. b.appendChild(e);
  8649. e.src = "https://my.chat.mibbit.com/home";
  8650. if (b = $("url")) Z = gd(G, b);
  8651. if (Z) {
  8652. if (Z.target && "#&+".indexOf(Z.target.substring(0, 1)) == -1) {
  8653. for (b = document.getElementById("ircstargettype"); b.firstChild;) b.removeChild(b.firstChild);
  8654. b.appendChild(document.createTextNode("Target nick:"));
  8655. document.getElementById("ircskeyopt").style.display = "none"
  8656. }
  8657. } else {
  8658. if ($("server") != null) {
  8659. Z = {
  8660. ssl: false,
  8661. port: 6667,
  8662. host: $("server")
  8663. };
  8664. b = Z.host.split(":");
  8665. Z.host = b[0];
  8666. if (b[1]) {
  8667. Z.port =
  8668. b[1];
  8669. if (Z.port.substring(0, 1) == "+") {
  8670. Z.ssl = true;
  8671. Z.port = Z.port.substr(1)
  8672. }
  8673. }
  8674. Z.target = $("channel");
  8675. if (Z.target == null) Z.target = "";
  8676. Z.nick = $("nick");
  8677. Z.pass = $("pass");
  8678. Z.charset = $("charset");
  8679. Z.needPass = $("needPass");
  8680. Z.key = $("key");
  8681. Z.needKey = $("needKey")
  8682. }
  8683. if (b = window.location.hash) {
  8684. Z = {
  8685. ssl: false,
  8686. port: 6667,
  8687. host: "irc.mibbit.net",
  8688. target: b
  8689. };
  8690. e = b.indexOf("@");
  8691. if (e != -1) {
  8692. Z.host = b.substring(e + 1, b.length);
  8693. Z.target = b.substring(0, e)
  8694. }
  8695. var f = b.toLowerCase().indexOf("&server=");
  8696. if (f != -1) {
  8697. Z.host = b.substring(e + 8, b.length);
  8698. Z.target =
  8699. b.substring(0, f)
  8700. }
  8701. b = Z.host.split(":");
  8702. Z.host = b[0];
  8703. if (b[1]) {
  8704. Z.port = b[1];
  8705. if (Z.port.substring(0, 1) == "+") {
  8706. Z.ssl = true;
  8707. Z.port = Z.port.substr(1)
  8708. }
  8709. }
  8710. }
  8711. }
  8712. if (Z) {
  8713. document.getElementById("connectspecific").style.display = "block";
  8714. b = document.getElementById("connectspecific");
  8715. b = Lb(Q, ".Connect", b, "Connect", "Connect", null, Qe(b), {
  8716. background: F.tabColorGeneral,
  8717. border: F.tabBColorGeneral
  8718. }, false);
  8719. Re(document.getElementById("ircconnectform2"), Z, function() {
  8720. Jb(Q, ".Connect")
  8721. }, "f_nick2");
  8722. Gb(Q);
  8723. b.open()
  8724. }
  8725. S = new Dc("/j/mibbit", {
  8726. nch: Fe,
  8727. gph: Ce,
  8728. ooh: Be,
  8729. ssh: ze
  8730. });
  8731. V = new zc("/j/mibbit", {
  8732. recv: function(g) {
  8733. return function(h) {
  8734. Ic(g, h)
  8735. }
  8736. }(S),
  8737. psh: null
  8738. });
  8739. if (typeof VERSION == "undefined" || $("debug") != null) {
  8740. S.onerror = function(g) {
  8741. x && A("rcomms", g, M)
  8742. };
  8743. V.onerror = function(g) {
  8744. x && A("scomms", g, M)
  8745. }
  8746. }
  8747. if (("WebSocket" in window || "MozWebSocket" in window) && $("nowebsocket") == null) {
  8748. x && A("init", "Using Websocket...", K);
  8749. Mc(S, V)
  8750. }
  8751. pe = new Se(He, true);
  8752. Jc(S, "LoginManager", pe);
  8753. S.start();
  8754. De("-");
  8755. window.setInterval(Ae, je);
  8756. window.setInterval(function() {
  8757. V.G({
  8758. cmd: "clientlog",
  8759. m: "avg lag:" +
  8760. Ee() + (ie ? " WS" : "")
  8761. })
  8762. }, ke);
  8763. pe.Fe = function(g) {
  8764. var h = document.getElementById("loginstatus");
  8765. x && A("settingscallback", "prefs=" + g, M);
  8766. F.reset();
  8767. F.load(g);
  8768. rd.load(F.aliases);
  8769. for (td.load(F.filters); h.firstChild;) h.removeChild(h.firstChild);
  8770. h.appendChild(document.createTextNode(fd));
  8771. Ge(true, h, E.g("Menu_Logout"), function() {
  8772. Je(pe)
  8773. })
  8774. };
  8775. pe.Oc = function(g) {
  8776. if (g) {
  8777. for (g = document.getElementById("loginstatus"); g.firstChild;) g.removeChild(g.firstChild);
  8778. g.appendChild(document.createTextNode("Please wait..."))
  8779. }
  8780. };
  8781. pe.Yd = function(g) {
  8782. W.alert(g ?
  8783. "Your password has been changed successfuly" : "Invalid password. Please make sure it is 4-16 characters")
  8784. };
  8785. pe.Nc = function(g, h) {
  8786. x && A("loginCallback", "s=" + g + ", msg=" + h);
  8787. g || W.alert("Invalid login: " + h)
  8788. };
  8789. Jc(S, "IRCClient", G);
  8790. document.getElementById("loading").style.display = "none";
  8791. document.getElementById("mibbitapp").style.display = "block";
  8792. window.clearInterval(loadingtimer)
  8793. }
  8794. window.onbeforeunload = function() {
  8795. if (F.confirmUnload) return "Any Chat Connections will be closed!"
  8796. };
  8797.  
  8798. function Te() {
  8799. S.stop()
  8800. }
  8801.  
  8802. function xd() {
  8803. var b = {};
  8804. b.Id = function() {
  8805. var e = ue.n.ea.value;
  8806. if (e.substring(0, 8) == "/global ") {
  8807. var f = e.indexOf(" ", 8);
  8808. if (f != -1) {
  8809. var g = e.substring(8, f);
  8810. e = e.substring(f + 1, e.length);
  8811. f = (new Date).getTime();
  8812. ue.e("::log", Y(ue, "Sending global...", {}, se.INFO, "", false, ue.vc, f));
  8813. V.G({
  8814. cmd: "global",
  8815. pw: g,
  8816. msg: e
  8817. })
  8818. }
  8819. }
  8820. return false
  8821. };
  8822. b.xc = q();
  8823. b.M = q();
  8824. var c = document.getElementById("chats"),
  8825. d = document.createElement("div");
  8826. d.style.background = "#ccc";
  8827. d.style.display = "none";
  8828. c.appendChild(d);
  8829. ue = new X(d, false, Ue, b, false, "#ccc", {
  8830. Eg: true
  8831. });
  8832. pb(ue.Ia, "Debug console", ue.vc);
  8833. Lb(Q, ".Log", d, "Log", "Debug Log", function(e, f) {
  8834. ue.Bb(e, f);
  8835. Adverts.R && Adverts.Ee(!f)
  8836. }, function() {
  8837. x = false;
  8838. return true
  8839. }, {
  8840. background: "#ccc",
  8841. border: "#888"
  8842. }, true, true);
  8843. A = function(e, f, g) {
  8844. var h = (new Date).getTime();
  8845. ue.e("::log", Y(ue, f, {}, se[g], e, false, ue.vc, h))
  8846. };
  8847. x = true
  8848. }
  8849.  
  8850. function $(b) {
  8851. var c = window.location.search.substring(1);
  8852. if (c.length > 0) {
  8853. begin = c.indexOf(b + "=");
  8854. if (begin != -1) {
  8855. begin += b.length + 1;
  8856. end = c.indexOf("&", begin);
  8857. return decodeURIComponent(c.substring(begin, end == -1 ? c.length : end))
  8858. }
  8859. }
  8860. return null
  8861. }
  8862.  
  8863. function ed() {
  8864. var b = ["amphibulus", "bletch", "bernard", "blinky", "bugweiser", "claude", "curmet", "ferdinand", "figaro", "flabbergaster", "frogaincia", "frogonia", "frogmella", "froglegstew", "frogzilla", "gamakichi", "guacamole", "gunther", "huddler", "kermit", "kermi", "keret", "krebbit", "leaper", "lilybet", "madalynn", "mermi", "mr_fribble", "mortisha", "napoleon", "obi_wan", "panitaliemom", "pachuco", "pheleas_frog", "Puddles", "pudgetta", "quibbit", "quiggle", "schnozzle", "skippydippy", "smerft", "sluggo", "slimer", "sprocket", "sprog",
  8865. "sproing", "squiggy", "stomper", "wikkit", "wilma", "weirdo", "xarcus", "xorcon", "yoshi", "zucchini", "zippity", "zenon", "zelda", "bellows", "charmander", "cornelius", "fuogo", "gretchen", "jasper", "kermie", "rumpler", "findow", "fenster", "kendle", "whidgle", "mohawk", "montezuma", "morton", "mr_evil", "mr_sticky", "mudpit", "onix", "peeves", "raisin", "shmoo", "umbridge", "mr_wibble", "dr_bibble", "mr_boo", "wippler", "reedlepee", "calatalee", "ferminter", "quaddle", "blaphmat", "hatman", "sockmister", "mr_trousers", "mr_pants"
  8866. ];
  8867. if (Math.random() <
  8868. 0.5) return b[Math.floor(Math.random() * b.length)];
  8869. b = "mib_";
  8870. for (var c = 0; c < 6; c++) {
  8871. var d = Math.random() * 36;
  8872. b += "abcdefghijklmnopqrstuvwxyz0123456789".charAt(d)
  8873. }
  8874. return b
  8875. }
  8876. window.init = Me;
  8877. window.shutdown = Te;
  8878. window.loadedGoogle = Le;
  8879. var Ve = null;
  8880.  
  8881. function Ie(b) {
  8882. var c = document.getElementById("header");
  8883. u({
  8884. textAlign: "left",
  8885. background: "url(https://s3.amazonaws.com/mibbit/gradg.png) repeat-x",
  8886. overflow: "hidden"
  8887. }, c.style);
  8888. c.style.height = (b ? 24 : 94) + "px";
  8889. c.style.background = b ? "url(https://s3.amazonaws.com/mibbit/gradg.png) repeat-x 0px -50px" : "url(https://s3.amazonaws.com/mibbit/gradg.png) repeat-x";
  8890. var d = document.getElementById("googa");
  8891. if (!d) {
  8892. d = document.createElement("div");
  8893. d.id = "googa"
  8894. }
  8895. var e = document.getElementById("usermenu1");
  8896. if (!e) {
  8897. e = document.createElement("ul");
  8898. u({
  8899. display: "inline",
  8900. listStyleType: "none",
  8901. fontFamily: "sansSerif",
  8902. fontSize: "11px",
  8903. color: "#666"
  8904. }, e.style);
  8905. e.id = "usermenu1"
  8906. }
  8907. var f = document.getElementById("serverstatus");
  8908. if (!f) {
  8909. f = document.createElement("span");
  8910. u({
  8911. fontSize: "11px",
  8912. padding: "0px"
  8913. }, f.style);
  8914. f.id = "serverstatus"
  8915. }
  8916. var g = document.getElementById("laginfo");
  8917. if (!g) {
  8918. g = document.createElement("span");
  8919. g.id = "laginfo";
  8920. g.title = "Lag between you and Mibbit.";
  8921. u({
  8922. fontSize: "11px",
  8923. color: "#666",
  8924. cursor: "pointer",
  8925. padding: "0px"
  8926. }, g.style)
  8927. }
  8928. var h = document.getElementById("clientstatus");
  8929. if (!h) {
  8930. h = document.createElement("span");
  8931. h.id = "clientstatus";
  8932. u({
  8933. fontSize: "11px",
  8934. color: "#cc0",
  8935. marginLeft: "17px",
  8936. padding: "0px"
  8937. }, h.style)
  8938. }
  8939. var k = document.getElementById("loginstatus");
  8940. if (!k) {
  8941. k = document.createElement("span");
  8942. k.id = "loginstatus";
  8943. u({
  8944. fontSize: "11px",
  8945. color: "#aaa",
  8946. marginLeft: "17px",
  8947. padding: "0px"
  8948. }, k.style)
  8949. }
  8950. for (; c.firstChild;) c.removeChild(c.firstChild);
  8951. if (Ve) {
  8952. window.clearInterval(Ve);
  8953. Ve = null
  8954. }
  8955. if (b) {
  8956. Bb = 24;
  8957. Pb = Bb + 20 + 6;
  8958. b = document.createElement("table");
  8959. b.setAttribute("cellpadding", "0");
  8960. b.setAttribute("cellspacing",
  8961. "0");
  8962. b.setAttribute("border", "0");
  8963. b.style.height = "24px";
  8964. b.style.width = "100%";
  8965. c.appendChild(b);
  8966. c = b.insertRow(-1);
  8967. d = c.insertCell(-1);
  8968. var l = document.createElement("img");
  8969. l.id = "connlogo";
  8970. l.style.width = "24px";
  8971. l.style.height = "24px";
  8972. l.src = "/gfx/icon_24.png";
  8973. d.appendChild(l);
  8974. c.insertCell(-1).appendChild(f);
  8975. c.insertCell(-1).appendChild(g);
  8976. c.insertCell(-1).appendChild(h);
  8977. d = c.insertCell(-1);
  8978. d.style.textAlign = "right";
  8979. d.style.paddingRight = "8px";
  8980. d.appendChild(k);
  8981. k.style.paddingRight = "16px";
  8982. d.appendChild(e)
  8983. } else {
  8984. Bb =
  8985. 94;
  8986. Pb = Bb + 20 + 6;
  8987. b = document.createElement("table");
  8988. b.setAttribute("cellpadding", "0");
  8989. b.setAttribute("cellspacing", "0");
  8990. b.setAttribute("border", "0");
  8991. b.style.height = "90px";
  8992. b.style.width = "100%";
  8993. c.appendChild(b);
  8994. c = b.insertRow(-1);
  8995. b = b.insertRow(-1);
  8996. l = c.insertCell(-1);
  8997. l.rowSpan = 2;
  8998. l.style.width = "170px";
  8999. l.vAlign = "top";
  9000. var j = document.createElement("img");
  9001. j.style.margin = "2px";
  9002. j.style.marginLeft = "8px";
  9003. j.src = "https://s3.amazonaws.com/mibbit/minifrog.png";
  9004. j.style.height = "86px";
  9005. j.style.width = "166px";
  9006. j.title = "Mibbit.com";
  9007. j.title = "Mibbit version ." + (typeof VERSION == "undefined" ? "(dev)" : VERSION);
  9008. l.appendChild(j);
  9009. l = c.insertCell(-1);
  9010. l.rowSpan = 2;
  9011. l.align = "center";
  9012. l.vAlign = "middle";
  9013. l.appendChild(d);
  9014. l = c.insertCell(-1);
  9015. l.vAlign = "top";
  9016. l.noWrap = true;
  9017. l.style.width = "280px";
  9018. c = document.createElement("div");
  9019. u({
  9020. background: "#222423 url(//static.mibbit.com/gfx/blackpanel.png) no-repeat top left",
  9021. border: "2px solid #888",
  9022. borderRadius: "8px",
  9023. MozBorderRadius: "8px",
  9024. WebkitBorderRadius: "8px",
  9025. padding: "4px",
  9026. marginRight: "4px",
  9027. marginTop: "4px",
  9028. height: "60px",
  9029. overflow: "hidden"
  9030. }, c.style);
  9031. c.id = "statusbox";
  9032. l.appendChild(c);
  9033. l = document.createElement("img");
  9034. l.id = "connlogo";
  9035. l.style.width = "17px";
  9036. l.style.height = "17px";
  9037. l.src = "//static.mibbit.com/gfx/online-small.png";
  9038. c.appendChild(l);
  9039. c.appendChild(f);
  9040. c.appendChild(document.createTextNode(" "));
  9041. c.appendChild(g);
  9042. c.appendChild(document.createElement("br"));
  9043. c.appendChild(h);
  9044. c.appendChild(document.createElement("br"));
  9045. c.appendChild(k);
  9046. k = b.insertCell(-1);
  9047. k.vAlign = "bottom";
  9048. k.appendChild(e);
  9049. f = k = 0;
  9050. if (document.body.clientWidth -
  9051. 450 < 728) {
  9052. k = 468;
  9053. f = 60
  9054. } else {
  9055. k = 728;
  9056. f = 90
  9057. }
  9058. for (e = document.createElement("iframe"); d.firstChild;) d.removeChild(d.firstChild);
  9059. d.appendChild(e);
  9060. d.style.width = k + "px";
  9061. d.style.height = f + "px";
  9062. d.style.overflow = "hidden";
  9063. u({
  9064. border: "0",
  9065. overflow: "hidden",
  9066. margin: "0",
  9067. width: k + "px",
  9068. height: f + "px"
  9069. }, e.style);
  9070. e.setAttribute("framespacing", "0");
  9071. e.setAttribute("frameborder", "no");
  9072. e.setAttribute("scrolling", "no");
  9073. if (k == 728) {
  9074. e.id = "ae6e7b42";
  9075. e.name = "ae6e7b42";
  9076. e.src = "https://as.mibbit.com/www/delivery/afr.php?refresh=120&zoneid=1&target=_blank&cb=" +
  9077. Math.random();
  9078. d = document.createElement("a");
  9079. d.href = "https://as.mibbit.com/www/delivery/ck.php?n=a4414c80&cb=" + Math.random();
  9080. d.target = "_blank";
  9081. k = document.createElement("img");
  9082. k.border = "0";
  9083. k.src = "https://as.mibbit.com/www/delivery/avw.php?zoneid=1&cb=" + Math.random() + "&n=a4414c80";
  9084. e.appendChild(d);
  9085. d.appendChild(k)
  9086. } else if (k == 468) {
  9087. e.id = "a98f5f04";
  9088. e.name = "a98f5f04";
  9089. e.src = "https://as.mibbit.com/www/delivery/afr.php?refresh=120&zoneid=2&target=_blank&cb=" + Math.random();
  9090. d = document.createElement("a");
  9091. d.href =
  9092. "https://as.mibbit.com/www/delivery/ck.php?n=aa3899a0&cb=" + Math.random();
  9093. d.target = "_blank";
  9094. k = document.createElement("img");
  9095. k.border = "0";
  9096. k.src = "https://as.mibbit.com/www/delivery/avw.php?zoneid=2&cb=" + Math.random() + "&n=aa3899a0";
  9097. e.appendChild(d);
  9098. d.appendChild(k)
  9099. }
  9100. }
  9101. Fb(Q, Q.$a == "list");
  9102. Q.z()
  9103. }
  9104.  
  9105. function Re(b, c, d, e) {
  9106. function f(ha, aa) {
  9107. var xa = document.createElement("option");
  9108. xa.value = ha;
  9109. xa.appendChild(document.createTextNode(aa));
  9110. return xa
  9111. }
  9112.  
  9113. function g(ha, aa, xa) {
  9114. var Wb = aa.style.display != "block";
  9115. aa.style.display = Wb ? "block" : "none";
  9116. ha.style.color = Wb ? "#b51abf" : "#444";
  9117. try {
  9118. if (Wb) xa && xa.focus();
  9119. else ha.blur()
  9120. } catch (kf) {}
  9121. return Wb
  9122. }
  9123. var h = document.createElement("form");
  9124. b.appendChild(h);
  9125. b = document.createElement("div");
  9126. u({
  9127. width: "480px",
  9128. margin: "auto",
  9129. textAlign: "center"
  9130. }, b.style);
  9131. b.style.marginTop = "16px";
  9132. h.appendChild(b);
  9133. var k = document.createElement("table");
  9134. k.setAttribute("cellpadding", "0");
  9135. k.setAttribute("cellspacing", "0");
  9136. k.setAttribute("border", "0");
  9137. u({
  9138. width: "100%",
  9139. margin: "auto",
  9140. fontFamily: "sans-serif",
  9141. border: "2px solid #51661c",
  9142. color: "#000",
  9143. background: "#fff"
  9144. }, k.style);
  9145. k.style.borderRadius = "10px";
  9146. k.style.MozBorderRadius = "10px";
  9147. k.style.WebkitBorderRadius = "10px";
  9148. k.style.padding = "10px";
  9149. b.appendChild(k);
  9150. var l = k.insertRow(-1).insertCell(-1);
  9151. u({
  9152. textAlign: "center",
  9153. background: "#ccc",
  9154. fontSize: "15px",
  9155. color: "#51661c",
  9156. fontWeight: "bold",
  9157. borderRadius: "4px",
  9158. MozBorderRadius: "4px",
  9159. WebkitBorderRadius: "4px"
  9160. }, l.style);
  9161. l.appendChild(document.createTextNode("IRC: "));
  9162. if (!c || !c.host) {
  9163. var j = document.createElement("select");
  9164. l.appendChild(j);
  9165. ircnets.sort(function(ha, aa) {
  9166. if (ha.name == "Mibbit") return -1;
  9167. if (aa.name == "Mibbit") return 1;
  9168. if (ha.name.toLowerCase() < aa.name.toLowerCase()) return -1;
  9169. if (ha.name.toLowerCase() > aa.name.toLowerCase()) return 1;
  9170. return 0
  9171. });
  9172. for (var n = 0; n < ircnets.length; n++) {
  9173. b = ircnets[n];
  9174. b = f(b.addr, b.name + (b.webirc ?
  9175. " [webirc]" : ""));
  9176. j.appendChild(b)
  9177. }
  9178. } else {
  9179. b = document.createElement("span");
  9180. u({
  9181. color: "#444",
  9182. fontSize: "13px"
  9183. }, b.style);
  9184. l.appendChild(b);
  9185. var o = ":" + (c.ssl ? "+" : "") + c.port;
  9186. if (!c.ssl && c.port == 6667) o = "";
  9187. b.appendChild(document.createTextNode(c.host + o))
  9188. }
  9189. b = document.createElement("span");
  9190. l.appendChild(document.createTextNode(" "));
  9191. l.appendChild(b);
  9192. b.style.fontSize = "11px";
  9193. b.style.color = "#444";
  9194. n = k.insertRow(-1).insertCell(-1);
  9195. k = document.createElement("table");
  9196. k.width = "100%";
  9197. k.setAttribute("cellspacing", "2");
  9198. k.setAttribute("border",
  9199. "0");
  9200. k.setAttribute("cellpadding", "2");
  9201. n.appendChild(k);
  9202. l = k.insertRow(-1).insertCell(-1);
  9203. l.colSpan = "6";
  9204. if (!c || !c.host) {
  9205. b.firstChild && b.appendChild(document.createTextNode(" | "));
  9206. var s = document.createElement("span");
  9207. u({
  9208. fontSize: "11px",
  9209. color: "#444",
  9210. textDecoration: "underline",
  9211. cursor: "pointer"
  9212. }, s.style);
  9213. s.appendChild(document.createTextNode("Server"));
  9214. b.appendChild(s);
  9215. var w = document.createElement("input");
  9216. w.size = "14";
  9217. w.type = "text";
  9218. u({
  9219. background: "#fff",
  9220. padding: "2px",
  9221. fontFamily: "Sans-Serif",
  9222. fontSize: "13px",
  9223. color: "#222",
  9224. border: "1px solid #484",
  9225. borderRadius: "4px",
  9226. MozBorderRadius: "4px",
  9227. WebkitBorderRadius: "4px"
  9228. }, w.style);
  9229. w.value = "";
  9230. var p = We(document.createTextNode("Server address:"), w, "Specify SSL with a '+' eg irc.mibbit.net:+6697");
  9231. l.appendChild(p);
  9232. s.onclick = function() {
  9233. w.value = "";
  9234. j.disabled = g(s, p, w);
  9235. return false
  9236. }
  9237. }
  9238. var r = document.createElement("select");
  9239. u({
  9240. border: "1px solid #484",
  9241. background: "white",
  9242. fontFamily: "sansSerif",
  9243. fontSize: "13px",
  9244. color: "#222"
  9245. }, r.style);
  9246. n = document.createElement("option");
  9247. n.value =
  9248. "nickserv";
  9249. n.appendChild(document.createTextNode("NickServ"));
  9250. r.appendChild(n);
  9251. n = document.createElement("option");
  9252. n.value = "pass";
  9253. n.appendChild(document.createTextNode("Pass"));
  9254. r.appendChild(n);
  9255. var y = document.createElement("option");
  9256. y.value = "auth";
  9257. y.appendChild(document.createTextNode("Auth"));
  9258. r.appendChild(y);
  9259. n = document.createElement("option");
  9260. n.value = "sasl-plain";
  9261. n.appendChild(document.createTextNode("SASL PLAIN"));
  9262. r.appendChild(n);
  9263. n = document.createElement("option");
  9264. n.value = "sasl-dh-blowfish";
  9265. n.appendChild(document.createTextNode("SASL BLOWFISH"));
  9266. r.appendChild(n);
  9267. var z = document.createElement("input");
  9268. z.size = "14";
  9269. z.type = "password";
  9270. u({
  9271. background: "#fff",
  9272. padding: "2px",
  9273. fontFamily: "Sans-Serif",
  9274. fontSize: "13px",
  9275. color: "#222",
  9276. border: "1px solid #484",
  9277. borderRadius: "4px",
  9278. MozBorderRadius: "4px",
  9279. WebkitBorderRadius: "4px"
  9280. }, z);
  9281. z.value = "";
  9282. var B = We(r, z);
  9283. l.appendChild(B);
  9284. y = document.createElement("span");
  9285. u({
  9286. fontSize: "11px",
  9287. color: "#444",
  9288. textDecoration: "underline",
  9289. cursor: "pointer"
  9290. }, y.style);
  9291. y.appendChild(document.createTextNode("Auth"));
  9292. b.firstChild && b.appendChild(document.createTextNode(" | "));
  9293. b.appendChild(y);
  9294. y.onclick = function() {
  9295. g(y, B, z);
  9296. return false
  9297. };
  9298. if (c && c.pass) {
  9299. z.value = c.pass;
  9300. g(y, B)
  9301. } else c && c.needPass && g(y, B);
  9302. var H = document.createElement("select");
  9303. u({
  9304. border: "1px solid #484",
  9305. background: "white",
  9306. fontFamily: "sansSerif",
  9307. fontSize: "13px",
  9308. color: "#222"
  9309. }, H.style);
  9310. for (n = 0; n < id.length; n++) {
  9311. o = id[n];
  9312. H.appendChild(f(o, o))
  9313. }
  9314. var P = We(document.createTextNode("Charset:"), H);
  9315. l.appendChild(P);
  9316. var N = document.createElement("span");
  9317. u({
  9318. fontSize: "11px",
  9319. color: "#444",
  9320. textDecoration: "underline",
  9321. cursor: "pointer"
  9322. },
  9323. N.style);
  9324. N.onclick = function() {
  9325. g(N, P, H);
  9326. return false
  9327. };
  9328. N.appendChild(document.createTextNode("Charset"));
  9329. b.firstChild && b.appendChild(document.createTextNode(" | "));
  9330. b.appendChild(N);
  9331. if (c && c.charset) {
  9332. H.value = c.charset;
  9333. g(N, P)
  9334. }
  9335. if (c) {
  9336. var I = document.createElement("input");
  9337. u({
  9338. border: "1px solid #484",
  9339. background: "white",
  9340. fontFamily: "sansSerif",
  9341. fontSize: "13px",
  9342. color: "#222"
  9343. }, I.style);
  9344. var J = We(document.createTextNode("Channel key:"), I);
  9345. l.appendChild(J);
  9346. var ka = document.createElement("span");
  9347. u({
  9348. fontSize: "11px",
  9349. color: "#444",
  9350. textDecoration: "underline",
  9351. cursor: "pointer"
  9352. }, ka.style);
  9353. ka.onclick = function() {
  9354. g(ka, J, I);
  9355. return false
  9356. };
  9357. ka.appendChild(document.createTextNode("Key"));
  9358. b.firstChild && b.appendChild(document.createTextNode(" | "));
  9359. b.appendChild(ka);
  9360. if (c && c.key) {
  9361. I.value = c.key;
  9362. g(ka, J, I)
  9363. } else c && c.needKey && g(ka, J, I)
  9364. }
  9365. b = k.insertRow(-1);
  9366. k = b.insertCell(-1);
  9367. k.width = "46";
  9368. n = document.createElement("img");
  9369. n.src = "/gfx/irc_icon.png";
  9370. n.width = "46";
  9371. n.height = "45";
  9372. k.appendChild(n);
  9373. k = b.insertCell(-1);
  9374. k.align = "right";
  9375. k.width = "40";
  9376. k.appendChild(document.createTextNode("Nick:"));
  9377. k = b.insertCell(-1);
  9378. var ya = document.createElement("input");
  9379. ya.type = "text";
  9380. ya.size = "8";
  9381. u({
  9382. background: "#fff",
  9383. padding: "2px",
  9384. fontFamily: "Sans-Serif",
  9385. fontSize: "13px",
  9386. color: "#222",
  9387. border: "1px solid #484",
  9388. borderRadius: "4px",
  9389. MozBorderRadius: "4px",
  9390. WebkitBorderRadius: "4px"
  9391. }, ya.style);
  9392. ya.id = e;
  9393. ya.value = ed();
  9394. k.appendChild(ya);
  9395. if (c && c.nick) ya.value = c.nick;
  9396. e = b.insertCell(-1);
  9397. e.align = "right";
  9398. e.width = "70";
  9399. e.appendChild(document.createTextNode("Channel:"));
  9400. e = b.insertCell(-1);
  9401. if (!c || !c.target) {
  9402. var ub = document.createElement("input");
  9403. ub.type = "text";
  9404. ub.size = "8";
  9405. u({
  9406. background: "#fff",
  9407. padding: "2px",
  9408. fontFamily: "Sans-Serif",
  9409. fontSize: "13px",
  9410. color: "#222",
  9411. border: "1px solid #484",
  9412. borderRadius: "4px",
  9413. MozBorderRadius: "4px",
  9414. WebkitBorderRadius: "4px"
  9415. }, ub.style);
  9416. e.appendChild(ub)
  9417. } else {
  9418. k = document.createElement("span");
  9419. u({
  9420. color: "#888",
  9421. fontWeight: "bold"
  9422. }, k.style);
  9423. k.appendChild(document.createTextNode(c.target));
  9424. e.appendChild(k)
  9425. }
  9426. e = b.insertCell(-1);
  9427. b = document.createElement("input");
  9428. b.type = "submit";
  9429. b.className = "abutton";
  9430. b.value = "Go";
  9431. e.appendChild(b);
  9432. h.onsubmit = function() {
  9433. return function() {
  9434. try {
  9435. var ha, aa;
  9436. ha = c && c.host ? c.host + ":" + (c.ssl ? "+" : "") + c.port : w.value == "" ? j.value : w.value;
  9437. aa = c && c.target ? c.target : ub.value;
  9438. if (I && I.value) aa += " " + I.value;
  9439. x && A("irc.connect", "Channel=" + aa, K);
  9440. Zc(G, ha, ya.value, z.value, aa, false, false, r.value, H.value)
  9441. } catch (xa) {
  9442. x && A("irc.connect", "exception " + xa, C)
  9443. }
  9444. d && d();
  9445. return false
  9446. }
  9447. }()
  9448. }
  9449.  
  9450. function We(b, c, d) {
  9451. var e = document.createElement("div");
  9452. u({
  9453. display: "none",
  9454. borderBottom: "1px solid #aaa"
  9455. }, e.style);
  9456. var f = document.createElement("table");
  9457. e.appendChild(f);
  9458. f.width = "100%";
  9459. f.setAttribute("cellspacing", "2");
  9460. f.setAttribute("border", "0");
  9461. f.setAttribute("cellpadding", "0");
  9462. var g = f.insertRow(-1),
  9463. h = g.insertCell(-1);
  9464. h.align = "right";
  9465. h.width = "50%";
  9466. h.appendChild(b);
  9467. b = g.insertCell(-1);
  9468. b.align = "left";
  9469. b.appendChild(c);
  9470. if (d) {
  9471. c = f.insertRow(-1).insertCell(-1);
  9472. c.colSpan = "2";
  9473. c.align = "center";
  9474. f = document.createElement("span");
  9475. u({
  9476. fontSize: "11px",
  9477. color: "#888"
  9478. }, f.style);
  9479. f.appendChild(document.createTextNode(d));
  9480. c.appendChild(f)
  9481. }
  9482. return e
  9483. }
  9484. uGui = {};
  9485. uGui.v = undefined;
  9486. uGui.Bc = undefined;
  9487. uGui.Ih = function(b, c, d) {
  9488. if (uGui.Bc != c) {
  9489. uGui.v && uGui.Ze();
  9490. c.style.display = "inline";
  9491. b.style.color = "#f99";
  9492. uGui.Bc = c;
  9493. uGui.v = b;
  9494. d && d.focus()
  9495. } else uGui.Ze()
  9496. };
  9497. uGui.Ze = function() {
  9498. if (uGui.Bc) {
  9499. uGui.Bc.style.display = "none";
  9500. uGui.v.style.color = "white";
  9501. delete uGui.v;
  9502. delete uGui.Bc
  9503. }
  9504. };
  9505. uGui.Vg = function() {
  9506. var b = document.createElement("div");
  9507. u({
  9508. overflow: "hidden",
  9509. position: "absolute",
  9510. top: "24px",
  9511. bottom: "8px",
  9512. left: "8px",
  9513. right: "8px"
  9514. }, b.style);
  9515. var c = document.createElement("iframe");
  9516. c.style.width = "100%";
  9517. c.style.height = "100%";
  9518. c.src = "https://my.chat.mibbit.com/login";
  9519. b.appendChild(c);
  9520. ea(W, {
  9521. element: b,
  9522. closecb: q(),
  9523. initcb: q()
  9524. })
  9525. };
  9526. uGui.Wg = function() {
  9527. var b = document.createElement("div");
  9528. u({
  9529. overflow: "hidden",
  9530. position: "absolute",
  9531. top: "24px",
  9532. bottom: "8px",
  9533. left: "8px",
  9534. right: "8px"
  9535. }, b.style);
  9536. var c = document.createElement("iframe");
  9537. c.style.width = "100%";
  9538. c.style.height = "100%";
  9539. c.src = "https://my.chat.mibbit.com/signup";
  9540. b.appendChild(c);
  9541. ea(W, {
  9542. element: b,
  9543. closecb: q(),
  9544. initcb: q()
  9545. })
  9546. };
  9547. uGui.Je = function(b) {
  9548. function c(e, f, g, h) {
  9549. var k = document.createElement("li");
  9550. k.style.display = "inline";
  9551. e.appendChild(k);
  9552. var l;
  9553. if (h) {
  9554. l = document.createElement("a");
  9555. l.href = h;
  9556. l.target = "_blank"
  9557. } else {
  9558. l = document.createElement("span");
  9559. l.style.cursor = "pointer"
  9560. }
  9561. u({
  9562. color: "#eee",
  9563. textDecoration: "none",
  9564. fontSize: "11px",
  9565. fontWeight: "bold",
  9566. fontFamily: "sans-serif"
  9567. }, l.style);
  9568. if (g) l.onclick = function() {
  9569. return function() {
  9570. try {
  9571. g(l)
  9572. } catch (j) {}
  9573. return false
  9574. }
  9575. }(l);
  9576. l.appendChild(document.createTextNode(f));
  9577. k.appendChild(l)
  9578. }
  9579. for (var d =
  9580. document.getElementById("usermenu1"); d.firstChild;) d.removeChild(d.firstChild);
  9581. if (b) {
  9582. c(d, E.g("Menu_Account"), Xe);
  9583. d.appendChild(document.createTextNode(" | "));
  9584. c(d, E.g("Menu_Prefs"), Ye);
  9585. d.appendChild(document.createTextNode(" | "));
  9586. c(d, E.g("Menu_Profile"), Ze);
  9587. d.appendChild(document.createTextNode(" | "));
  9588. c(d, E.g("Menu_Channels"), $e);
  9589. d.appendChild(document.createTextNode(" | "));
  9590. c(d, E.g("Menu_Logs"), af)
  9591. }
  9592. };
  9593.  
  9594. function Se(b, c) {
  9595. this.Qf = c;
  9596. this.bg = 31536E7;
  9597. this.lc = b;
  9598. this.qe = this.Vb = this.ag = false;
  9599. this.ih = this.Vd = this.Sd = null;
  9600. this.Se = true;
  9601. this.Fe = this.Yd = this.Xe = this.Ah = this.Nc = this.Oc = null;
  9602. window.setInterval(function(d) {
  9603. return function() {
  9604. if (d.qe) {
  9605. var e = new Date;
  9606. e = new Date(e.getTime() + 5E3);
  9607. document.cookie = "mc=1; path=/; domain=.mibbit.com; expires=" + e.toGMTString();
  9608. e = ";" + document.cookie;
  9609. var f = e.indexOf(";uid=");
  9610. if (f == -1) f = e.indexOf(" uid=");
  9611. if (f != -1) {
  9612. var g = e.indexOf(";", f + 5);
  9613. f = unescape(e.substring(f + 5, g == -1 ?
  9614. e.length : g));
  9615. !d.qc && f != "" && !d.Vb && bf(d, f)
  9616. } else if (d.Vb) {
  9617. x && A("loginManager", "Logout", K);
  9618. Je(d)
  9619. }
  9620. f = e.indexOf(";cmd=");
  9621. if (f == -1) f = e.indexOf(" cmd=");
  9622. if (f != -1) {
  9623. g = e.indexOf(";", f + 5);
  9624. e = decodeURIComponent(e.substring(f + 5, g == -1 ? e.length : g));
  9625. document.cookie = "cmd=; path=/; domain=.mibbit.com; expires=" + (new Date).toGMTString();
  9626. e = ba(e);
  9627. for (f = 0; f < e.length; f++)
  9628. if (e[f].cmd == "connect") {
  9629. g = e[f].addr;
  9630. var h = e[f].channels,
  9631. k = e[f].nick ? e[f].nick : "",
  9632. l = e[f].pass ? e[f].pass : "",
  9633. j = e[f].charset ? e[f].charset : "",
  9634. n = e[f].authmethod ?
  9635. e[f].authmethod : "";
  9636. if (Md) {
  9637. var o = Md.ircserverdetails;
  9638. if (o)
  9639. for (var s = 0; s < o.length; s++)
  9640. if (o[s].addr == g) {
  9641. if (k == "") k = o[s].nick;
  9642. if (l == "") l = o[s].pass;
  9643. if (n == "") n = o[s].authmethod;
  9644. if (j == "") j = o[s].charset;
  9645. break
  9646. }
  9647. }
  9648. if (k == "") {
  9649. k = ed();
  9650. if (fd) k = fd
  9651. }
  9652. if (j == "") j = F.defaultCharset;
  9653. Zc(G, g, k, l, h, false, false, n, j)
  9654. } else if (e[f].cmd == "reload") {
  9655. x && A("loginManager", "Requesting a reload... " + d.Sd, K);
  9656. !d.qc && d.Vd && cf(d, d.Vd)
  9657. }
  9658. }
  9659. }
  9660. }
  9661. }(this), 500)
  9662. }
  9663. Se.prototype.Sc = function() {
  9664. x && A("loginManager", "ONLINE", K);
  9665. this.qe = true;
  9666. var b = {
  9667. channel: "LoginManager",
  9668. cmd: "guest"
  9669. };
  9670. b.version = typeof VERSION == "undefined" ? "dev" : VERSION;
  9671. b.uagent = navigator.userAgent;
  9672. V.G(b)
  9673. };
  9674.  
  9675. function Gc(b) {
  9676. x && A("loginManager", "OFFLINE", K);
  9677. b.qe = false;
  9678. b.qc = false;
  9679. b.ag = false;
  9680. df(b, false)
  9681. }
  9682. Se.prototype.Ya = function(b) {
  9683. try {
  9684. if (b.cmd == "loginreply") {
  9685. this.qc = false;
  9686. this.Oc && this.Oc(false);
  9687. if (b.data == "failure") {
  9688. var c = new Date;
  9689. document.cookie = "uid=; expires=" + c.toGMTString();
  9690. document.cookie = "uid=; expires=" + c.toGMTString() + "; path=/";
  9691. this.Nc && this.Nc(false, b.reason);
  9692. this.lc && this.lc(false)
  9693. } else if (b.data == "success") {
  9694. this.Nc && this.Nc(true);
  9695. var d = {};
  9696. if (b.profile) d = ba(b.profile);
  9697. c = {};
  9698. if (b.account) c = ba(b.account);
  9699. var e = b.uid,
  9700. f = b.aid,
  9701. g = b.username,
  9702. h = b.prefs;
  9703. b = d;
  9704. c = c;
  9705. this.Vb = true;
  9706. this.Sd = e;
  9707. this.Vd =
  9708. f;
  9709. this.ih = g;
  9710. this.a = h;
  9711. if (this.Qf) {
  9712. var k = new Date;
  9713. document.cookie = "uid=; expires=" + k.toGMTString();
  9714. document.cookie = "uid=; expires=" + k.toGMTString() + "; path=/";
  9715. document.cookie = "uid=; expires=" + k.toGMTString() + "; path=/; domain=.chat.mibbit.com";
  9716. k = new Date(k.getTime() + this.bg);
  9717. document.cookie = typeof VERSION == "undefined" ? "uid=" + this.Sd + (this.Se ? "; expires=" + k.toGMTString() : "") + "; path=/;" : "uid=" + this.Sd + (this.Se ? "; expires=" + k.toGMTString() : "") + "; path=/; domain=.chat.mibbit.com"
  9718. }
  9719. this.lc && this.lc(true,
  9720. f, g, h, b, c)
  9721. }
  9722. } else if (b.cmd == "chgusernamereply") this.Xe && this.Xe(b.success);
  9723. else if (b.cmd == "chgpasswordreply") this.Yd && this.Yd(b.success);
  9724. else if (b.cmd == "loggedout") df(this, true);
  9725. else if (b.cmd == "settings") {
  9726. this.qc = false;
  9727. this.Fe && this.Fe(b.prefs)
  9728. }
  9729. } catch (l) {}
  9730. };
  9731.  
  9732. function df(b, c) {
  9733. b.Vb = false;
  9734. if (b.Qf && c) {
  9735. c = new Date;
  9736. document.cookie = "uid=; expires=" + c.toGMTString();
  9737. document.cookie = "uid=; expires=" + c.toGMTString() + "; path=/";
  9738. document.cookie = "uid=; expires=" + c.toGMTString() + "; path=/; domain=.chat.mibbit.com"
  9739. }
  9740. b.lc && b.lc(false)
  9741. }
  9742.  
  9743. function bf(b, c) {
  9744. if (!b.Vb) {
  9745. b.qc = true;
  9746. b.Oc && b.Oc(true);
  9747. V.G({
  9748. channel: "LoginManager",
  9749. cmd: "continue",
  9750. uid: c
  9751. })
  9752. }
  9753. }
  9754.  
  9755. function cf(b, c) {
  9756. b.qc = true;
  9757. V.G({
  9758. channel: "LoginManager",
  9759. cmd: "loadprefs",
  9760. settings: c
  9761. })
  9762. }
  9763.  
  9764. function Je(b) {
  9765. b.Vb && V.G({
  9766. channel: "LoginManager",
  9767. cmd: "logout"
  9768. })
  9769. }
  9770.  
  9771. function Ne() {
  9772. this.reset()
  9773. }
  9774. Ne.prototype.reset = function() {
  9775. this.userListColorNormal = "#444444";
  9776. this.userListColorTyping = "#ff0000";
  9777. this.userListColorInactive = "#888888";
  9778. this.userListMenuColor = "#444444";
  9779. this.userListMenuBackground = "#cccccc";
  9780. this.userListMenuBackgroundHover = "#ddddff";
  9781. this.userGroupColor = "#eee";
  9782. this.userGroupBackground = "#2c629a";
  9783. this.userListHover = "#bbbbbb";
  9784. this.ulistPaneBorder = "#666666";
  9785. this.ulistPaneBackground = "#dddddd";
  9786. this.userListSelected = "#aaaaaa";
  9787. this.userListWidth = 148;
  9788. this.userListPadding = 0;
  9789. this.userListGroups = [{
  9790. def: "chatting",
  9791. title: "Chatting",
  9792. hideOnEmpty: true,
  9793. startHidden: false
  9794. }, {
  9795. def: "!chatting",
  9796. title: "Idlers",
  9797. hideOnEmpty: true,
  9798. startHidden: false
  9799. }];
  9800. this.userListSort = "chatting,owner,admin,op,halfop,voice,active";
  9801. this.userListFontSize = 13;
  9802. this.userListFontFamily = "Arial,Helvetica,sans-serif";
  9803. this.userListMenuFontSize = 11;
  9804. this.userListMenuFontFamily = "Arial,Helvetica,sans-serif";
  9805. this.userGroupFontSize = 13;
  9806. this.userGroupFontFamily = "Arial,Helvetica,sans-serif";
  9807. this.userListMenuAutoCloseTime = 3E3;
  9808. this.doubleClickTime =
  9809. 400;
  9810. this.userListBoldOnChat = this.doubleClickToPM = true;
  9811. this.userListChattingTime = 600;
  9812. this.userListShowIcons = true;
  9813. this.userListIconWidth = this.userListIconHeight = 16;
  9814. this.userListShowPrefixChars = false;
  9815. this.userListModeIconWidth = this.userListModeIconHeight = 16;
  9816. this.userListShowModesLeft = this.userListShowSingleMode = false;
  9817. this.userListModeSpacing = 2;
  9818. this.iconModeOwner = "https://s3.amazonaws.com/mibbit/gfx/mode_owner.png";
  9819. this.iconModeAdmin = "https://s3.amazonaws.com/mibbit/gfx/mode_admin.png";
  9820. this.iconModeOp =
  9821. "https://s3.amazonaws.com/mibbit/gfx/mode_op.png";
  9822. this.iconModeHalfop = "https://s3.amazonaws.com/mibbit/gfx/mode_halfop.png";
  9823. this.iconModeVoice = "https://s3.amazonaws.com/mibbit/gfx/mode_voice.png";
  9824. this.ulicon_user = "https://s3.amazonaws.com/mibbit/gfx/user.png";
  9825. this.ulicon_mibbituser = "https://s3.amazonaws.com/mibbit/gfx/user_green.png";
  9826. this.ulicon_ignored = "https://s3.amazonaws.com/mibbit/gfx/user_gray.png";
  9827. this.ulicon_ipod = "https://s3.amazonaws.com/mibbit/gfx/user_ipod.png";
  9828. this.ulicon_iphone = "https://s3.amazonaws.com/mibbit/gfx/user_iphone.png";
  9829. this.ulicon_wii = "https://s3.amazonaws.com/mibbit/gfx/user_wii.png";
  9830. this.userListModeIconAlign = this.userListIconAlign = "bottom";
  9831. this.ulistPaneRounding = 6;
  9832. this.chatInputBarBorder = "#666666";
  9833. this.chatInputBarBackground = "#dddddd url('https://s3.amazonaws.com/mibbit/gfx/grad1.png') repeat-x";
  9834. this.chatInputColor = "#000000";
  9835. this.chatInputFontFamily = "Arial,Helvetica,sans-serif";
  9836. this.chatInputFontSize = 15;
  9837. this.chatInputBorder = "#888888";
  9838. this.chatInputBackground = "#ffffff";
  9839. this.chatInputSpacing = 4;
  9840. this.chatInputPadding =
  9841. 2;
  9842. this.chatInputNickColor = "#008800";
  9843. this.needSendButton = this.chatInputShowNick = false;
  9844. this.sendButtonBorder = "#666666";
  9845. this.sendButtonBackground = "#dddddd url('https://s3.amazonaws.com/mibbit/gfx/grad1.png') repeat-x";
  9846. this.sendButtonColor = "#000";
  9847. this.showInputOptions = true;
  9848. this.colorInMenuSep = "#0000aa";
  9849. this.colorInMenu = "#585858";
  9850. this.colorInMenuActive = "#000000";
  9851. this.colorInLinks = "#0000ff";
  9852. this.colorInText = "#000000";
  9853. this.ioMinify = this.ioPastebin = this.ioColors = this.ioSmilies = true;
  9854. this.ioCustomMenus = [];
  9855. this.chatInputMenuFontFamily = "Arial,Helvetica,sans-serif";
  9856. this.chatInputMenuFontSize = 11;
  9857. this.chatInputRounding = 6;
  9858. this.chatInputTabSort = "idle";
  9859. this.chatOutputShowTimes = true;
  9860. this.timeBorderRight = "#888888";
  9861. this.timeBackground = "#eeeeee";
  9862. this.formatTime = "%H:%M";
  9863. this.timeFontFamily = "Arial,Helvetica,sans-serif";
  9864. this.timeFontSize = 11;
  9865. this.timeColor = "#444444";
  9866. this.chatOutputTimeWidth = 30;
  9867. this.formatDate = "%a";
  9868. this.chatOutputShowNicks = true;
  9869. this.nickBorderRight = "#888888";
  9870. this.nickBackground = "#cccccc";
  9871. this.chatOutputNickLeft =
  9872. "<";
  9873. this.nickFontFamily = "Arial,Helvetica,sans-serif";
  9874. this.nickFontSize = 11;
  9875. this.nickColor = "#0000ff";
  9876. this.chatOutputNickWidth = 110;
  9877. this.chatOutputNickRight = ">: ";
  9878. this.nickColorMe = "#224422";
  9879. this.nickColorGuest = "#008800";
  9880. this.nickColorNotice = "#a20814";
  9881. this.nickVerticalAlign = "middle";
  9882. this.chatBackground = "#ffffff";
  9883. this.chatPaneBorder = "#666666";
  9884. this.chatPaneBackground = "#ffffff";
  9885. this.chatBackgroundHighlight = "#ffffaa";
  9886. this.chatFontFamily = "Arial,Helvetica,sans-serif";
  9887. this.chatFontSize = 13;
  9888. this.chatPaddingBottom =
  9889. this.chatPaddingTop = 1;
  9890. this.chatBackgroundLines = "#eeeeee";
  9891. this.chatOutputBackground = "transparent";
  9892. this.chatOutputRTL = false;
  9893. this.chatPaneRounding = 0;
  9894. this.infobarFontFamily = "Arial,Helvetica,sans-serif";
  9895. this.infobarFontSize = 15;
  9896. this.infobarPadding = 3;
  9897. this.infobarColor = "#000";
  9898. this.infobarBackground = "transparent";
  9899. this.infobarBorder = "";
  9900. this.infobarColorHighlight = "#444";
  9901. this.infobarBackgroundHighlight = "#ccc";
  9902. this.infobarBorderHighlight = "#444";
  9903. this.cgmMargins = 6;
  9904. this.extraContentPosition = "middle";
  9905. this.extraContentWidth =
  9906. 400;
  9907. this.hideULonEC = true;
  9908. this.chatOutputMaxLines = 250;
  9909. this.showMarkers = this.showChannelUsers = true;
  9910. this.noUListInChannels = false;
  9911. this.showChannelOptions = true;
  9912. this.tabColorServer = "#5ecf96";
  9913. this.tabColorChannel = "#5e96cf";
  9914. this.tabColorPM = "#8c8c8c";
  9915. this.tabBColorPM = this.tabBColorChannel = this.tabBColorServer = "#aaaaaa";
  9916. this.iconSmileysBase = "https://s3.amazonaws.com/mibbit/gfx/smilies/";
  9917. this.iconSmileysWidth = this.iconSmileysHeight = 19;
  9918. this.iconSmileys = [{
  9919. code: ":)",
  9920. src: "yel02.png"
  9921. }, {
  9922. code: ":-)",
  9923. src: "yel02.png"
  9924. }, {
  9925. code: ":(",
  9926. src: "yel36.png"
  9927. }, {
  9928. code: ":-(",
  9929. src: "yel36.png"
  9930. }, {
  9931. code: ":D",
  9932. src: "yel06.png"
  9933. }, {
  9934. code: ":-D",
  9935. src: "yel06.png"
  9936. }, {
  9937. code: ":s",
  9938. src: "yel07.png"
  9939. }, {
  9940. code: ":-s",
  9941. src: "yel07.png"
  9942. }, {
  9943. code: ":/",
  9944. src: "yel22.png"
  9945. }, {
  9946. code: ":-/",
  9947. src: "yel22.png"
  9948. }, {
  9949. code: ":P",
  9950. src: "yel40.png"
  9951. }, {
  9952. code: ":-P",
  9953. src: "yel40.png"
  9954. }, {
  9955. code: ":p",
  9956. src: "yel40.png"
  9957. }, {
  9958. code: ":-p",
  9959. src: "yel40.png"
  9960. }, {
  9961. code: ":O",
  9962. src: "yel54.png"
  9963. }, {
  9964. code: ":-O",
  9965. src: "yel54.png"
  9966. }, {
  9967. code: ":o",
  9968. src: "yel54.png"
  9969. }, {
  9970. code: ":-o",
  9971. src: "yel54.png"
  9972. }, {
  9973. code: ";)",
  9974. src: "yel08.png"
  9975. }, {
  9976. code: ";-)",
  9977. src: "yel08.png"
  9978. }];
  9979. this.colorChatMe = this.colorChat = "#000000";
  9980. this.colorEmoteMe = this.colorEmote = "#cc4444";
  9981. this.nickHighlight = "#668866";
  9982. this.nickHighlightMe = "#44aa44";
  9983. this.colorChatRecent = "#888888";
  9984. this.colorEmoteRecent = "#ee8888";
  9985. this.colorJoin = "#008800";
  9986. this.colorPart = "#880000";
  9987. this.colorBack = "#66cc66";
  9988. this.colorAway = "#cc6666";
  9989. this.colorKick = "#880000";
  9990. this.colorInvite = "#6666cc";
  9991. this.colorTopic = "#000088";
  9992. this.colorTopicWho = "#008888";
  9993. this.colorChangeNick = "#888800";
  9994. this.colorNotice = this.colorSystem = "#880000";
  9995. this.colorBan =
  9996. "#2222cc";
  9997. this.colorUserMode = "#666622";
  9998. this.colorLinks = "#0000ff";
  9999. this.colorIRCLinks = "#ff0000";
  10000. this.colorChannels = "#008800";
  10001. this.parseSmilies = true;
  10002. this.sizeSmiliesToText = false;
  10003. this.parseSimple = this.parseColor = this.parseNicks = this.parseLinks = this.parseChannels = true;
  10004. this.openLinksInExtra = false;
  10005. this.parseReplaceImages = true;
  10006. this.parseReplaceImagesHeight = this.parseReplaceImagesWidth = 32;
  10007. this.showAwaysBacks = this.showJoinsParts = this.parseGoogleViewer = this.parseYouTubes = true;
  10008. this.showPartInfo = this.showJoinInfo =
  10009. false;
  10010. this.showRecentChat = this.showCTCP = this.showMOTD = this.showUserModes = this.showBans = true;
  10011. this.waitingbackground = "#222";
  10012. this.waitingcolor = "#ccc";
  10013. this.waitingimage = "https://s3.amazonaws.com/mibbit/gfx/loading.gif";
  10014. this.customloading = "Connecting to server...";
  10015. this.promptbackground = "#222";
  10016. this.promptcolor = "#ccc";
  10017. this.promptimage = "https://s3.amazonaws.com/mibbit/gfx/button_connect.png";
  10018. this.customprompt = "Chat Now";
  10019. this.nickprompt = "Choose a nickname";
  10020. this.tabColorGeneral = "#aaaaaa";
  10021. this.tabColorYServer =
  10022. "#c0c0f3";
  10023. this.tabColorYChannel = "#c0f3c0";
  10024. this.tabBColorGeneral = "#cccccc";
  10025. this.tabBColorYServer = "#c0c0f3";
  10026. this.tabBColorYChannel = "#c0f3c0";
  10027. this.tabTextColor = this.tabBackgroundColor = "#000000";
  10028. this.tabTextColorInactive = "#222222";
  10029. this.tabTextColorActivityMe = "#DEDE43";
  10030. this.tabTextColorActivity = "#f0f0f0";
  10031. this.tabTextColorArrows = "#aaaaaa";
  10032. this.tabFontFamily = "Arial,Helvetica,sans-serif";
  10033. this.tabSpacing = 4;
  10034. this.tabPadding = 3;
  10035. this.tabFontSize = 11;
  10036. this.colorLinksWait = "#aaaacc";
  10037. this.useTabList = false;
  10038. this.tabListWidth =
  10039. 160;
  10040. this.logChannels = this.logPMs = this.ircNickClick = false;
  10041. this.confirmUnload = this.confirmServerClose = this.allowIncommingPMs = true;
  10042. this.autoAway = 7200;
  10043. this.autoAwayMessage = "Auto away";
  10044. this.blurPMs = this.focusNewJoins = this.autoBack = true;
  10045. this.windowAlertPeriod = 500;
  10046. this.windowAlertMaxFlashes = 3;
  10047. this.desktopNotifications = false;
  10048. this.errorsToActiveTab = this.noticesToActiveTab = true;
  10049. this.language = "en";
  10050. this.inputHistorySize = 250;
  10051. this.allowChatRemoval = true;
  10052. this.defaultCharset = "UTF-8";
  10053. this.showChannelTabUsers = true;
  10054. this.tabIndividualCloses = false;
  10055. this.autoconnects = [];
  10056. this.aliases = [{
  10057. match: "/j",
  10058. command: "/join $1-"
  10059. }, {
  10060. match: "/cs",
  10061. command: "/msg ChanServ $1-"
  10062. }, {
  10063. match: "/ns",
  10064. command: "/msg NickServ $1-"
  10065. }, {
  10066. match: "/ms",
  10067. command: "/msg MemoServ $1-"
  10068. }, {
  10069. match: "/os",
  10070. command: "/msg OperServ $1-"
  10071. }, {
  10072. match: "/bs",
  10073. command: "/msg BotServ $1-"
  10074. }, {
  10075. match: "/voice",
  10076. command: "/mode # +v $1"
  10077. }, {
  10078. match: "/unvoice",
  10079. command: "/mode # -v $1"
  10080. }, {
  10081. match: "/devoice",
  10082. command: "/mode # -v $1"
  10083. }, {
  10084. match: "/ban",
  10085. command: "/mode # +b $1"
  10086. }, {
  10087. match: "/unban",
  10088. command: "/mode # -b $1"
  10089. }, {
  10090. match: "/deban",
  10091. command: "/mode # -b $1"
  10092. }, {
  10093. match: "/op",
  10094. command: "/mode # +o $1"
  10095. }, {
  10096. match: "/unop",
  10097. command: "/mode # -o $1"
  10098. }, {
  10099. match: "/deop",
  10100. command: "/mode # -o $1"
  10101. }, {
  10102. match: "/halfop",
  10103. command: "/mode # +h $1"
  10104. }, {
  10105. match: "/unhalfop",
  10106. command: "/mode # -h $1"
  10107. }, {
  10108. match: "/dehalfop",
  10109. command: "/mode # -h $1"
  10110. }, {
  10111. match: "/admin",
  10112. command: "/mode # +a $1"
  10113. }, {
  10114. match: "/unadmin",
  10115. command: "/mode # -a $1"
  10116. }, {
  10117. match: "/deadmin",
  10118. command: "/mode # -a $1"
  10119. }, {
  10120. match: "/owner",
  10121. command: "/mode # +q $1"
  10122. }, {
  10123. match: "/unowner",
  10124. command: "/mode # -q $1"
  10125. }, {
  10126. match: "/deowner",
  10127. command: "/mode # -q $1"
  10128. }];
  10129. this.filters = [{
  10130. reg: "\\bmibbiturl\\b",
  10131. replacement: "http://chat.mibbit.com",
  10132. replacein: true,
  10133. replaceout: true,
  10134. block: false,
  10135. cmd: "/splay http://static.mibbit.com/sounds/beep1 | /echo cool eh"
  10136. }];
  10137. this.usermenus = [{
  10138. title: "PM",
  10139. command: "/query $nick"
  10140. }, {
  10141. title: "Whois",
  10142. command: "/whois $nick"
  10143. }];
  10144. this.channelmenus = [];
  10145. this.sounds = {
  10146. newpm: {
  10147. sound: "https://s3.amazonaws.com/mibbit/sounds/ribbit",
  10148. enabled: false
  10149. },
  10150. ircdisconnect: {
  10151. sound: "https://s3.amazonaws.com/mibbit/sounds/beep1",
  10152. enabled: false
  10153. },
  10154. mentionednick: {
  10155. sound: "https://s3.amazonaws.com/mibbit/sounds/beep2",
  10156. enabled: false
  10157. },
  10158. newmsg: {
  10159. sound: "https://s3.amazonaws.com/mibbit/sounds/msg",
  10160. enabled: false
  10161. },
  10162. userjoin: {
  10163. sound: "https://s3.amazonaws.com/mibbit/sounds/join",
  10164. enabled: false
  10165. },
  10166. userpart: {
  10167. sound: "https://s3.amazonaws.com/mibbit/sounds/part",
  10168. enabled: false
  10169. }
  10170. };
  10171. this.ciUserListColorNormal = this.ciUserIcon = false
  10172. };
  10173. Ne.prototype.load = function(b, c) {
  10174. try {
  10175. x && A("UserPrefs", "Loading prefs (" + b + ")", K);
  10176. var d = ba(b);
  10177. try {
  10178. this.autoconnects = [];
  10179. for (var e in d) {
  10180. var f = d[e];
  10181. if (e == "autoconnects" && f) {
  10182. this.autoconnects = f;
  10183. x && A("UserPrefs", "Loading autos (" + this.autoconnects + ") " + this.autoconnects.length, K)
  10184. } else if (e == "sounds") u(f, this[e]);
  10185. else if (this.hasOwnProperty(e)) {
  10186. if (f == "true" || f == "false") f = f == "true" ? true : false;
  10187. this[e] = f
  10188. }
  10189. }
  10190. } catch (g) {
  10191. x && A("UserPrefs", g, C)
  10192. }
  10193. c || Rd(this)
  10194. } catch (h) {
  10195. x && A("UserPrefs", h, C)
  10196. }
  10197. };
  10198. Ne.prototype.Mc = [];
  10199.  
  10200. function Oe(b, c) {
  10201. x && A("UserPrefs", "ADD listener... (" + b.Mc.length + ")", K);
  10202. b.Mc.push(c)
  10203. }
  10204.  
  10205. function Rd(b, c) {
  10206. x && A("UserPrefs", "Telling listeners... (" + b.Mc.length + ")", K);
  10207. for (var d = 0; d < b.Mc.length; d++) try {
  10208. b.Mc[d](c)
  10209. } catch (e) {
  10210. x && A("UserPrefs", e, C)
  10211. }
  10212. }
  10213. var Ue = new Ne;
  10214.  
  10215. function ef(b) {
  10216. this.p = b;
  10217. this.document = b.ownerDocument;
  10218. b.style.overflow = "auto";
  10219. b.style.textAlign = "center";
  10220. var c = this.document.createElement("div");
  10221. c.style.width = "100%";
  10222. c.style.margin = "auto";
  10223. c.style.marginTop = "10px";
  10224. c.style.textAlign = "center";
  10225. c.style.fontSize = "17px";
  10226. c.style.color = "#222";
  10227. c.style.fontWeight = "bold";
  10228. c.appendChild(this.document.createTextNode("My Logs"));
  10229. b.appendChild(c);
  10230. c = this.document.createElement("iframe");
  10231. var d = this.document.createElement("div");
  10232. u({
  10233. background: "white",
  10234. margin: "auto",
  10235. textAlign: "center",
  10236. position: "absolute",
  10237. top: "90px",
  10238. left: "16px",
  10239. bottom: "16px",
  10240. right: "16px",
  10241. overflow: "hidden"
  10242. }, d.style);
  10243. b.appendChild(d);
  10244. d.appendChild(c);
  10245. c.width = "100%";
  10246. c.height = "100%";
  10247. c.style.minHeight = "100%";
  10248. c.src = "https://my.chat.mibbit.com/pmlogs"
  10249. }
  10250.  
  10251. function ff(b) {
  10252. this.p = b;
  10253. this.document = b.ownerDocument;
  10254. b.style.overflow = "auto";
  10255. b.style.textAlign = "center";
  10256. var c = this.document.createElement("h2");
  10257. c.style.paddingTop = "10px";
  10258. c.appendChild(this.document.createTextNode("My Profile"));
  10259. b.appendChild(c);
  10260. c = this.document.createElement("form");
  10261. c.style.textAlign = "center";
  10262. c.style.display = "inline";
  10263. c.onsubmit = function() {
  10264. return false
  10265. };
  10266. b.appendChild(c);
  10267. var d = gf(this);
  10268. hf(this, d.insertRow(-1), "General");
  10269. jf(this, d.insertRow(-1), "Age", "age");
  10270. jf(this, d.insertRow(-1), "Sex",
  10271. "sex");
  10272. jf(this, d.insertRow(-1), "Location", "location");
  10273. jf(this, d.insertRow(-1), "Home page", "homepage");
  10274. jf(this, d.insertRow(-1), "Pic URL", "avatar");
  10275. c.appendChild(d);
  10276. d = this.document.createElement("input");
  10277. d.type = "submit";
  10278. d.value = "Save and close";
  10279. d.style.marginTop = "10px";
  10280. d.className = "abutton";
  10281. d.onclick = function() {
  10282. return function() {
  10283. pe.Vb && V.G({
  10284. channel: "LoginManager",
  10285. cmd: "profile",
  10286. profile: re
  10287. });
  10288. Jb(Q, ".XProfile")
  10289. }
  10290. }(this);
  10291. c.appendChild(d);
  10292. c = this.document.createElement("div");
  10293. c.style.paddingTop = "10px";
  10294. c.appendChild(this.document.createTextNode("This profile data is public and will be shown in a /whois."));
  10295. b.appendChild(c)
  10296. }
  10297.  
  10298. function gf(b) {
  10299. b = b.document.createElement("table");
  10300. b.setAttribute("border", "0");
  10301. b.setAttribute("cell-padding", "0");
  10302. b.setAttribute("cell-spacing", "0");
  10303. u({
  10304. borderCollapse: "collapse",
  10305. margin: "auto",
  10306. fontFamily: "sans-serif",
  10307. width: "480px",
  10308. padding: "0px",
  10309. background: "#888",
  10310. border: "1px solid #444"
  10311. }, b.style);
  10312. b.style.marginTop = "4px";
  10313. return b
  10314. }
  10315.  
  10316. function hf(b, c, d) {
  10317. c = c.insertCell(-1);
  10318. c.setAttribute("colspan", "2");
  10319. c.colSpan = "2";
  10320. u({
  10321. width: "480px",
  10322. padding: "1px",
  10323. textAlign: "center",
  10324. background: "#888",
  10325. color: "#eee",
  10326. fontWeight: "bold",
  10327. border: "1px solid #444"
  10328. }, c.style);
  10329. c.appendChild(b.document.createTextNode(d))
  10330. }
  10331.  
  10332. function jf(b, c, d, e) {
  10333. var f = {
  10334. textAlign: "left",
  10335. padding: "2px",
  10336. border: "1px solid #888",
  10337. background: "#ccc"
  10338. },
  10339. g = c.insertCell(-1);
  10340. u(f, g.style);
  10341. g.style.textAlign = "right";
  10342. g.appendChild(b.document.createTextNode(d));
  10343. var h = b.document.createElement("input");
  10344. u({
  10345. type: "text",
  10346. size: "24",
  10347. value: typeof re[e] == "undefined" ? "" : re[e]
  10348. }, h);
  10349. h.onkeyup = function() {
  10350. return function() {
  10351. re[e] = h.value
  10352. }
  10353. }(b);
  10354. b = c.insertCell(-1);
  10355. u(f, b.style);
  10356. b.appendChild(h)
  10357. }
  10358.  
  10359. function Qe(b) {
  10360. u({
  10361. background: F.tabColorGeneral,
  10362. border: "0",
  10363. fontSize: "13px",
  10364. position: "absolute",
  10365. textAlign: "left",
  10366. overflow: "auto"
  10367. }, b.style);
  10368. var c = {
  10369. left: 0,
  10370. right: 0,
  10371. top: Pb,
  10372. bottom: Qb
  10373. };
  10374. if (!O && F.useTabList) c.left = F.tabListWidth;
  10375. b.style.top = c.top + "px";
  10376. b.style.bottom = c.bottom + "px";
  10377. b.style.left = c.left + "px";
  10378. b.style.right = c.right + "px";
  10379. if (O) {
  10380. var d = function(f) {
  10381. return function() {
  10382. var g = parseInt(f.style.left),
  10383. h = parseInt(f.style.right);
  10384. f.style.width = document.body.clientWidth - g - h + "px";
  10385. g = parseInt(f.style.top);
  10386. h = parseInt(f.style.bottom);
  10387. f.style.height = document.body.clientHeight - g - h + "px"
  10388. }
  10389. }(b);
  10390. window.attachEvent ? window.attachEvent("onresize", d) : window.addEventListener("resize", d, false);
  10391. window.setTimeout(d, 100)
  10392. }
  10393.  
  10394. function e() {
  10395. window.detachEvent ? window.detachEvent("onresize", d) : window.removeEventListener("resize", d, false);
  10396. return true
  10397. }
  10398. return O ? e : null
  10399. }
  10400.  
  10401. function Pe(b, c, d, e, f, g) {
  10402. try {
  10403. var h;
  10404. var k = Q;
  10405. if (k.l[b]) {
  10406. Gb(k);
  10407. k.l[b].open();
  10408. h = true
  10409. } else h = false;
  10410. if (!h) {
  10411. var l = document.getElementById("chats"),
  10412. j = document.createElement("div"),
  10413. n = Qe(j);
  10414. if (f) j.style.display = "none";
  10415. l.appendChild(j);
  10416. g || (g = {});
  10417. g.background = F.tabColorGeneral;
  10418. g.border = F.tabBColorGeneral;
  10419. j.style.background = F.tabColorGeneral;
  10420. Lb(Q, b, j, c, d, null, n, g, f, e);
  10421. return j
  10422. }
  10423. } catch (o) {
  10424. x && A("showUserTab", "e=" + o)
  10425. }
  10426. }
  10427.  
  10428. function $e() {
  10429. var b = Pe(".XChannels", "Channels", "Channels", true, false, null);
  10430. if (b) {
  10431. var c = b.ownerDocument.createElement("div");
  10432. u({
  10433. position: "absolute",
  10434. top: "8px",
  10435. bottom: "8px",
  10436. left: "8px",
  10437. right: "8px",
  10438. overflow: "hidden"
  10439. }, c.style);
  10440. b.appendChild(c);
  10441. b = b.ownerDocument.createElement("iframe");
  10442. b.style.width = "100%";
  10443. b.style.height = "100%";
  10444. b.style.minHeight = "100%";
  10445. c.appendChild(b);
  10446. b.src = "https://my.chat.mibbit.com/mychannels"
  10447. }
  10448. }
  10449.  
  10450. function Ye() {
  10451. var b = Pe(".XPrefs", "Prefs", "Preferences", true, false, {
  10452. Kc: 16,
  10453. Tb: 16,
  10454. P: "https://s3.amazonaws.com/mibbit/gfx/wrench.png"
  10455. });
  10456. if (b) {
  10457. var c = b.ownerDocument.createElement("div");
  10458. u({
  10459. position: "absolute",
  10460. top: "8px",
  10461. bottom: "8px",
  10462. left: "8px",
  10463. right: "8px",
  10464. overflow: "hidden"
  10465. }, c.style);
  10466. b.appendChild(c);
  10467. b = b.ownerDocument.createElement("iframe");
  10468. b.style.width = "100%";
  10469. b.style.height = "100%";
  10470. b.style.minHeight = "100%";
  10471. c.appendChild(b);
  10472. b.src = "https://my.chat.mibbit.com/myprefs"
  10473. }
  10474. }
  10475.  
  10476. function Ze() {
  10477. var b = Pe(".XProfile", "Profile", "Profile", true, false, {
  10478. Kc: 16,
  10479. Tb: 16,
  10480. P: "https://s3.amazonaws.com/mibbit/gfx/user_green.png"
  10481. });
  10482. b && new ff(b)
  10483. }
  10484.  
  10485. function Xe() {
  10486. var b = Pe(".XAccount", "Account", "Account", true, false, null);
  10487. if (b) {
  10488. var c = b.ownerDocument.createElement("div");
  10489. u({
  10490. position: "absolute",
  10491. top: "8px",
  10492. bottom: "8px",
  10493. left: "8px",
  10494. right: "8px",
  10495. overflow: "hidden"
  10496. }, c.style);
  10497. b.appendChild(c);
  10498. b = b.ownerDocument.createElement("iframe");
  10499. b.style.width = "100%";
  10500. b.style.height = "100%";
  10501. b.style.minHeight = "100%";
  10502. c.appendChild(b);
  10503. b.src = "https://my.chat.mibbit.com/myaccount"
  10504. }
  10505. }
  10506.  
  10507. function af() {
  10508. var b = Pe(".XLogs", "Logs", "Logs", true, false);
  10509. if (b) var c = new ef(b);
  10510. logHandler.Kh = c;
  10511. logHandler.load()
  10512. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement