PageRenderTime 61ms CodeModel.GetById 22ms RepoModel.GetById 1ms app.codeStats 0ms

/examples/twitter/widgets.js

http://github.com/jterrace/js.js
JavaScript | 1637 lines | 1637 code | 0 blank | 0 comment | 409 complexity | 771e6f26c627bacf2ce2217e7c41091b MD5 | raw file
Possible License(s): BSD-3-Clause

Large files files are truncated, but you can click here to view the full file

  1. if (!window.__twttrlr) {
  2. (function(a, b) {
  3. function s(a) {
  4. for (var b = 1, c; c = arguments[b]; b++) for (var d in c) a[d] = c[d];
  5. return a
  6. }
  7. function t(a) {
  8. return Array.prototype.slice.call(a)
  9. }
  10. function v(a, b) {
  11. for (var c = 0, d; d = a[c]; c++) if (b == d) return c;
  12. return -1
  13. }
  14. function w() {
  15. var a = t(arguments),
  16. b = [];
  17. for (var c = 0, d = a.length; c < d; c++) a[c].length > 0 && b.push(a[c].replace(/\/$/, ""));
  18. return b.join("/")
  19. }
  20. function x(a, b, c) {
  21. var d = b.split("/"),
  22. e = a;
  23. while (d.length > 1) {
  24. var f = d.shift();
  25. e = e[f] = e[f] || {}
  26. }
  27. e[d[0]] = c
  28. }
  29. function y() {}
  30. function z(a, b) {
  31. this.id = this.path = a, this.force = !! b
  32. }
  33. function A(a, b) {
  34. this.id = a, this.body = b, typeof b == "undefined" && (this.path = this.resolvePath(a))
  35. }
  36. function B(a, b) {
  37. this.deps = a, this.collectResults = b, this.deps.length == 0 && this.complete()
  38. }
  39. function C(a, b) {
  40. this.deps = a, this.collectResults = b
  41. }
  42. function D() {
  43. for (var a in d) if (d[a].readyState == "interactive") return l[d[a].id]
  44. }
  45. function E(a, b) {
  46. var d;
  47. return !a && c && (d = k || D()), d ? (delete l[d.scriptId], d.body = b, d.execute()) : (j = d = new A(a, b), i[d.id] = d), d
  48. }
  49. function F() {
  50. var a = t(arguments),
  51. b, c;
  52. return typeof a[0] == "string" && (b = a.shift()), c = a.shift(), E(b, c)
  53. }
  54. function G(a, b) {
  55. var c = b.id || "",
  56. d = c.split("/");
  57. d.pop();
  58. var e = d.join("/");
  59. return a.replace(/^\./, e)
  60. }
  61. function H(a, b) {
  62. function d(a) {
  63. return A.exports[G(a, b)]
  64. }
  65. var c = [];
  66. for (var e = 0, f = a.length; e < f; e++) {
  67. if (a[e] == "require") {
  68. c.push(d);
  69. continue
  70. }
  71. if (a[e] == "exports") {
  72. b.exports = b.exports || {}, c.push(b.exports);
  73. continue
  74. }
  75. c.push(d(a[e]))
  76. }
  77. return c
  78. }
  79. function I() {
  80. var a = t(arguments),
  81. b = [],
  82. c, d;
  83. return typeof a[0] == "string" && (c = a.shift()), u(a[0]) && (b = a.shift()), d = a.shift(), E(c, function(a) {
  84. function f() {
  85. var e = H(t(b), c),
  86. f;
  87. typeof d == "function" ? f = d.apply(c, e) : f = d, typeof f == "undefined" && (f = c.exports), a(f)
  88. }
  89. var c = this,
  90. e = [];
  91. for (var g = 0, h = b.length; g < h; g++) {
  92. var i = b[g];
  93. v(["require", "exports"], i) == -1 && e.push(G(i, c))
  94. }
  95. e.length > 0 ? J.apply(this, e.concat(f)) : f()
  96. })
  97. }
  98. function J() {
  99. var a = t(arguments),
  100. b, c;
  101. typeof a[a.length - 1] == "function" && (b = a.pop()), typeof a[a.length - 1] == "boolean" && (c = a.pop());
  102. var d = new B(K(a, c), c);
  103. return b && d.then(b), d
  104. }
  105. function K(a, b) {
  106. var c = [];
  107. for (var d = 0, e; e = a[d]; d++) typeof e == "string" && (e = L(e)), u(e) && (e = new C(K(e, b), b)), c.push(e);
  108. return c
  109. }
  110. function L(a) {
  111. var b, c;
  112. for (var d = 0, e; e = J.matchers[d]; d++) {
  113. var f = e[0],
  114. g = e[1];
  115. if (b = a.match(f)) return g(a)
  116. }
  117. throw new Error(a + " was not recognised by loader")
  118. }
  119. function N() {
  120. return a.using = m, a.provide = n, a.define = o, a.loadrunner = p, M
  121. }
  122. function O(a) {
  123. for (var b = 0; b < J.bundles.length; b++) for (var c in J.bundles[b]) if (c != a && v(J.bundles[b][c], a) > -1) return c
  124. }
  125. var c = a.attachEvent && !a.opera,
  126. d = b.getElementsByTagName("script"),
  127. e = 0,
  128. f, g = b.createElement("script"),
  129. h = {},
  130. i = {},
  131. j, k, l = {},
  132. m = a.using,
  133. n = a.provide,
  134. o = a.define,
  135. p = a.loadrunner;
  136. for (var q = 0, r; r = d[q]; q++) if (r.src.match(/loadrunner\.js(\?|#|$)/)) {
  137. f = r;
  138. break
  139. }
  140. var u = Array.isArray ||
  141. function(a) {
  142. return a.constructor == Array
  143. };
  144. y.prototype.then = function(b) {
  145. var c = this;
  146. return this.started || (this.started = !0, this.start()), this.completed ? b.apply(a, this.results) : (this.callbacks = this.callbacks || [], this.callbacks.push(b)), this
  147. }, y.prototype.start = function() {}, y.prototype.complete = function() {
  148. if (!this.completed) {
  149. this.results = t(arguments), this.completed = !0;
  150. if (this.callbacks) for (var b = 0, c; c = this.callbacks[b]; b++) c.apply(a, this.results)
  151. }
  152. }, z.loaded = [], z.prototype = new y, z.prototype.start = function() {
  153. var a = this,
  154. b, c, d;
  155. return (d = i[this.id]) ? (d.then(function() {
  156. a.complete()
  157. }), this) : ((b = h[this.id]) ? b.then(function() {
  158. a.loaded()
  159. }) : !this.force && v(z.loaded, this.id) > -1 ? this.loaded() : (c = O(this.id)) ? J(c, function() {
  160. a.loaded()
  161. }) : this.load(), this)
  162. }, z.prototype.load = function() {
  163. var b = this;
  164. h[this.id] = b;
  165. var c = g.cloneNode(!1);
  166. this.scriptId = c.id = "LR" + ++e, c.type = "text/javascript", c.async = !0, c.onerror = function() {
  167. throw new Error(b.path + " not loaded")
  168. }, c.onreadystatechange = c.onload = function(c) {
  169. c = a.event || c;
  170. if (c.type == "load" || v(["loaded", "complete"], this.readyState) > -1) this.onreadystatechange = null, b.loaded()
  171. }, c.src = this.path, k = this, d[0].parentNode.insertBefore(c, d[0]), k = null, l[c.id] = this
  172. }, z.prototype.loaded = function() {
  173. this.complete()
  174. }, z.prototype.complete = function() {
  175. v(z.loaded, this.id) == -1 && z.loaded.push(this.id), delete h[this.id], y.prototype.complete.apply(this, arguments)
  176. }, A.exports = {}, A.prototype = new z, A.prototype.resolvePath = function(a) {
  177. return w(J.path, a + ".js")
  178. }, A.prototype.start = function() {
  179. var a, b, c = this,
  180. d;
  181. this.body ? this.execute() : (a = A.exports[this.id]) ? this.exp(a) : (b = i[this.id]) ? b.then(function(a) {
  182. c.exp(a)
  183. }) : (bundle = O(this.id)) ? J(bundle, function() {
  184. c.start()
  185. }) : (i[this.id] = this, this.load())
  186. }, A.prototype.loaded = function() {
  187. var a, b, d = this;
  188. c ? (b = A.exports[this.id]) ? this.exp(b) : (a = i[this.id]) && a.then(function(a) {
  189. d.exp(a)
  190. }) : (a = j, j = null, a.id = a.id || this.id, a.then(function(a) {
  191. d.exp(a)
  192. }))
  193. }, A.prototype.complete = function() {
  194. delete i[this.id], z.prototype.complete.apply(this, arguments)
  195. }, A.prototype.execute = function() {
  196. var a = this;
  197. typeof this.body == "object" ? this.exp(this.body) : typeof this.body == "function" && this.body.apply(window, [function(b) {
  198. a.exp(b)
  199. }])
  200. }, A.prototype.exp = function(a) {
  201. this.complete(this.exports = A.exports[this.id] = a || {})
  202. }, B.prototype = new y, B.prototype.start = function() {
  203. function b() {
  204. var b = [];
  205. a.collectResults && (b[0] = {});
  206. for (var c = 0, d; d = a.deps[c]; c++) {
  207. if (!d.completed) return;
  208. d.results.length > 0 && (a.collectResults ? d instanceof C ? s(b[0], d.results[0]) : x(b[0], d.id, d.results[0]) : b = b.concat(d.results))
  209. }
  210. a.complete.apply(a, b)
  211. }
  212. var a = this;
  213. for (var c = 0, d; d = this.deps[c]; c++) d.then(b);
  214. return this
  215. }, C.prototype = new y, C.prototype.start = function() {
  216. var a = this,
  217. b = 0,
  218. c = [];
  219. return a.collectResults && (c[0] = {}), function d() {
  220. var e = a.deps[b++];
  221. e ? e.then(function(b) {
  222. e.results.length > 0 && (a.collectResults ? e instanceof C ? s(c[0], e.results[0]) : x(c[0], e.id, e.results[0]) : c.push(e.results[0])), d()
  223. }) : a.complete.apply(a, c)
  224. }(), this
  225. }, I.amd = {};
  226. var M = function(a) {
  227. return a(J, F, M, define)
  228. };
  229. M.Script = z, M.Module = A, M.Collection = B, M.Sequence = C, M.Dependency = y, M.noConflict = N, a.loadrunner = M, a.using = J, a.provide = F, a.define = I, J.path = "", J.matchers = [], J.matchers.add = function(a, b) {
  230. this.unshift([a, b])
  231. }, J.matchers.add(/(^script!|\.js$)/, function(a) {
  232. var b = new z(a.replace(/^\$/, J.path.replace(/\/$/, "") + "/").replace(/^script!/, ""), !1);
  233. return b.id = a, b
  234. }), J.matchers.add(/^[a-zA-Z0-9_\-\/]+$/, function(a) {
  235. return new A(a)
  236. }), J.bundles = [], f && (J.path = f.getAttribute("data-path") || f.src.split(/loadrunner\.js/)[0] || "", (main = f.getAttribute("data-main")) && J.apply(a, main.split(/\s*,\s*/)).then(function() {}))
  237. })(this, document);
  238. (window.__twttrlr = loadrunner.noConflict());
  239. }
  240. __twttrlr(function(using, provide, loadrunner, define) {
  241. provide("util/iframe", function(a) {
  242. a(function(a) {
  243. var b = document.createElement("div"),
  244. c;
  245. b.innerHTML = "<iframe allowtransparency='true' frameborder='0' scrolling='no'></iframe>", c = b.firstChild, c.src = a.url, c.className = a.className || "";
  246. if (a.css) for (var d in a.css) c.style[d] = a.css[d];
  247. if (a.attributes) for (var e in a.attributes) c.setAttribute(e, a.attributes[e]);
  248. return a.replace ? a.replace.parentNode.replaceChild(c, a.replace) : document.body.insertBefore(c, document.body.firstChild), c
  249. })
  250. });
  251. provide("util/querystring", function(a) {
  252. function b(a) {
  253. return encodeURIComponent(a).replace(/\+/g, "%2B")
  254. }
  255. function c(a) {
  256. return decodeURIComponent(a)
  257. }
  258. function d(a) {
  259. var c = [];
  260. for (var d in a) a[d] !== null && typeof a[d] != "undefined" && c.push(b(d) + "=" + b(a[d]));
  261. return c.sort().join("&")
  262. }
  263. function e(a) {
  264. var b = {},
  265. d, e, f, g;
  266. if (a) {
  267. d = a.split("&");
  268. for (g = 0; f = d[g]; g++) e = f.split("="), e.length == 2 && (b[c(e[0])] = c(e[1]))
  269. }
  270. return b
  271. }
  272. function f(a, b) {
  273. var c = d(b);
  274. return c.length > 0 ? a.indexOf("?") >= 0 ? a + "&" + d(b) : a + "?" + d(b) : a
  275. }
  276. a({
  277. url: f,
  278. decode: e,
  279. encode: d,
  280. encodePart: b,
  281. decodePart: c
  282. })
  283. });
  284. provide("util/nodeselect", function(a) {
  285. var b = document,
  286. c = "querySelectorAll" in b ?
  287. function(a, c) {
  288. return b.querySelectorAll(a + "." + c)
  289. } : "getElementsByClassName" in b ?
  290. function(a, c) {
  291. var d = b.getElementsByClassName(c),
  292. e, f = [];
  293. for (i = 0; e = d[i]; i++) e.tagName.toLowerCase() == a && f.push(e);
  294. return f
  295. } : function(a, c) {
  296. var d = b.getElementsByTagName(a),
  297. e, f = new RegExp("(?:^|\\s+)" + c + "(?:\\s+|$)"),
  298. g = [];
  299. for (i = 0; e = d[i]; i++) f.test(e.className) && g.push(e);
  300. return g
  301. };
  302. a(c)
  303. });
  304. provide("$vendor/domready/ready.js", function(exports) {
  305. !
  306. function(a) {
  307. function k() {
  308. b = 1;
  309. for (var a = 0, d = c.length; a < d; a++) c[a]()
  310. }
  311. var b = 0,
  312. c = [],
  313. d, e, f = !1,
  314. g = a.createElement("a"),
  315. h = "DOMContentLoaded",
  316. i = "addEventListener",
  317. j = "onreadystatechange";
  318. /^loade|c/.test(a.readyState) && (b = 1), a[i] && a[i](h, e = function() {
  319. a.removeEventListener(h, e, f), k()
  320. }, f), g.doScroll && a.attachEvent(j, d = function() {
  321. /^c/.test(a.readyState) && (a.detachEvent(j, d), k())
  322. });
  323. var l = g.doScroll ?
  324. function(a) {
  325. self != top ? b ? a() : c.push(a) : !
  326. function() {
  327. try {
  328. g.doScroll("left")
  329. } catch (b) {
  330. return setTimeout(function() {
  331. l(a)
  332. }, 50)
  333. }
  334. a()
  335. }()
  336. } : function(a) {
  337. b ? a() : c.push(a)
  338. };
  339. typeof module != "undefined" && module.exports ? module.exports = {
  340. domReady: l
  341. } : window.domReady = l
  342. }(document);
  343. exports();
  344. loadrunner.Script.loaded.push("$vendor/domready/ready.js")
  345. });
  346. provide("util/domready", function(a) {
  347. using("$vendor/domready/ready.js", function() {
  348. a(domReady)
  349. })
  350. });
  351. provide("util/util", function(a) {
  352. function b(a) {
  353. for (var b = 1, c; c = arguments[b]; b++) for (var d in c) a[d] = c[d];
  354. return a
  355. }
  356. function c(a) {
  357. return b([], a)
  358. }
  359. function d(a) {
  360. for (var b in a) a.hasOwnProperty(b) && !a[b] && a[b] !== !1 && a[b] !== 0 && delete a[b]
  361. }
  362. function e(a, b) {
  363. if (a.indexOf) return a.indexOf(b);
  364. for (var c = 0, d; d = a[c]; c++) if (b == d) return c;
  365. return -1
  366. }
  367. function f(a, b) {
  368. if (!a) return null;
  369. if (!b) return a;
  370. if (a.filter) return a.filter(b);
  371. var c = [],
  372. d = 0,
  373. e = a.length;
  374. for (; d < e; d++) b(a[d]) && c.push(a[d]);
  375. return c
  376. }
  377. function g(a, b) {
  378. if (a.contains) return a.contains(b);
  379. var c = b.parentNode;
  380. while (c) {
  381. if (c === a) return !0;
  382. c = c.parentNode
  383. }
  384. return !1
  385. }
  386. a({
  387. aug: b,
  388. array: c,
  389. indexOf: e,
  390. filter: f,
  391. compact: d,
  392. containsElement: g
  393. })
  394. });
  395. provide("tfw/widget/base", function(a) {
  396. using("util/util", "util/domready", "util/nodeselect", "util/querystring", "util/iframe", function(b, c, d, e, f) {
  397. function m(a) {
  398. if (!a) return;
  399. return a.lang ? a.lang : m(a.parentNode)
  400. }
  401. function n() {
  402. var a = i.widgets,
  403. b, c;
  404. for (var e in a) {
  405. e.match(/\./) ? b = d.apply(this, e.split(".")) : b = document.getElementsByTagName(e);
  406. for (var f = 0, g; g = b[f]; f++) {
  407. if (g.getAttribute("data-twttr-rendered")) continue;
  408. g.setAttribute("data-twttr-rendered", "true"), c = new a[e](g), j.list.push(c), j.byId[c.id] = c, c.render(i)
  409. }
  410. }
  411. }
  412. function o(a) {
  413. i = a
  414. }
  415. function p() {
  416. n()
  417. }
  418. function q(a) {
  419. return a && j.byId[a] ? j.byId[a].element : null
  420. }
  421. var g = 0,
  422. h, i, j = {
  423. list: [],
  424. byId: {}
  425. },
  426. k = {
  427. ko: {
  428. "%{followers_count} followers": "%{followers_count}명의 팔로워",
  429. "100K+": "100만 이상",
  430. "10k unit": "만 단위",
  431. Follow: "팔로우",
  432. "Follow %{screen_name}": "%{screen_name} 팔로우하기",
  433. K: "천",
  434. M: "백만",
  435. Tweet: "트윗",
  436. "Tweet %{hashtag}": "%{hashtag} 관련 트윗하기",
  437. "Tweet to %{name}": "%{name}님에게 트윗하기"
  438. },
  439. no: {
  440. "%{followers_count} followers": "%{followers_count} føgere",
  441. "100K+": "100K+",
  442. "10k unit": "10k ",
  443. Follow: "Følg",
  444. "Follow %{screen_name}": "Følg %{screen_name}",
  445. K: "K",
  446. M: "M",
  447. Tweet: "Tweet",
  448. "Tweet %{hashtag}": "Tweet %{hashtag}",
  449. "Tweet to %{name}": "Send tweet til %{name}"
  450. },
  451. fil: {
  452. "%{followers_count} followers": "%{followers_count} mga tagasunod",
  453. "100K+": "100K+",
  454. "10k unit": "10k yunit",
  455. Follow: "Sundan",
  456. "Follow %{screen_name}": "Sundan si %{screen_name}",
  457. K: "K",
  458. M: "M",
  459. Tweet: "I-tweet",
  460. "Tweet %{hashtag}": "I-tweet ang %{hashtag}",
  461. "Tweet to %{name}": "Mag-Tweet kay %{name}"
  462. },
  463. sv: {
  464. "%{followers_count} followers": "%{followers_count} följare",
  465. "100K+": "100K+",
  466. "10k unit": "10k",
  467. Follow: "Följ",
  468. "Follow %{screen_name}": "Följ %{screen_name}",
  469. K: "K",
  470. M: "M",
  471. Tweet: "Tweeta",
  472. "Tweet %{hashtag}": "Tweeta %{hashtag}",
  473. "Tweet to %{name}": "Tweeta till %{name}"
  474. },
  475. nl: {
  476. "%{followers_count} followers": "%{followers_count} volgers",
  477. "100K+": "100k+",
  478. "10k unit": "10k-eenheid",
  479. Follow: "Volgen",
  480. "Follow %{screen_name}": "%{screen_name} volgen",
  481. K: "k",
  482. M: " mln.",
  483. Tweet: "Tweeten",
  484. "Tweet %{hashtag}": "%{hashtag} tweeten",
  485. "Tweet to %{name}": "Tweeten naar %{name}"
  486. },
  487. es: {
  488. "%{followers_count} followers": "%{followers_count} seguidores",
  489. "100K+": "100K+",
  490. "10k unit": "10k unidad",
  491. Follow: "Seguir",
  492. "Follow %{screen_name}": "Seguir a %{screen_name}",
  493. K: "K",
  494. M: "M",
  495. Tweet: "Twittear",
  496. "Tweet %{hashtag}": "Twittear %{hashtag}",
  497. "Tweet to %{name}": "Twittear a %{name}"
  498. },
  499. hu: {
  500. "%{followers_count} followers": "%{followers_count} követő",
  501. "100K+": "100E+",
  502. "10k unit": "10E+",
  503. Follow: "Követés",
  504. "Follow %{screen_name}": "%{screen_name} követése",
  505. K: "E",
  506. M: "M",
  507. Tweet: "Tweet",
  508. "Tweet %{hashtag}": "%{hashtag} tweetelése",
  509. "Tweet to %{name}": "Tweet küldése neki: %{name}"
  510. },
  511. hi: {
  512. "%{followers_count} followers": "%{followers_count} फ़ॉलोअर्स",
  513. "100K+": "१०० हजार+",
  514. "10k unit": "१० हजार इकाईयां",
  515. Follow: "फ़ॉलो",
  516. "Follow %{screen_name}": "%{screen_name} को फ़ॉलो करें",
  517. K: "हजार",
  518. M: "१० लाख",
  519. Tweet: "ट्वीट",
  520. "Tweet %{hashtag}": "ट्वीट %{hashtag}",
  521. "Tweet to %{name}": "%{name} को ट्वीट करें"
  522. },
  523. ja: {
  524. "%{followers_count} followers": "%{followers_count}人のフォロワー",
  525. "100K+": "10万以上",
  526. "10k unit": "万",
  527. Follow: "フォローする",
  528. "Follow %{screen_name}": "%{screen_name}をフォロー",
  529. K: "K",
  530. M: "M",
  531. Tweet: "ツイート",
  532. "Tweet %{hashtag}": "%{hashtag} をツイートする",
  533. "Tweet to %{name}": "%{name}へツイートする"
  534. },
  535. da: {
  536. "%{followers_count} followers": "%{followers_count} følgere",
  537. "100K+": "100K+",
  538. "10k unit": "10k enhed",
  539. Follow: "Følg",
  540. "Follow %{screen_name}": "Følg %{screen_name}",
  541. K: "K",
  542. M: "M",
  543. Tweet: "Tweet",
  544. "Tweet %{hashtag}": "Tweet %{hashtag}",
  545. "Tweet to %{name}": "Tweet til %{name}"
  546. },
  547. ur: {
  548. "%{followers_count} followers": "%{followers_count} فالورز",
  549. "100K+": "1 لاکھ+",
  550. "10k unit": "دس ہزار یونٹ",
  551. Follow: "فالو کریں",
  552. "Follow %{screen_name}": "%{screen_name} کو فالو کریں",
  553. K: "ہزار",
  554. M: "ملین",
  555. Tweet: "ٹویٹ کریں",
  556. "Tweet %{hashtag}": "ٹویٹ کریں %{hashtag}",
  557. "Tweet to %{name}": "%{name} کو ٹویٹ کریں"
  558. },
  559. he: {
  560. "%{followers_count} followers": "%{followers_count} עוקבים",
  561. "100K+": "מאות אלפים",
  562. "10k unit": "עשרות אלפים",
  563. Follow: "מעקב",
  564. "Follow %{screen_name}": "לעקוב אחר %{screen_name}",
  565. K: "אלף",
  566. M: "מיליון",
  567. Tweet: "ציוץ",
  568. "Tweet %{hashtag}": "צייצו %{hashtag}",
  569. "Tweet to %{name}": "ציוץ אל %{name}"
  570. },
  571. pt: {
  572. "%{followers_count} followers": "%{followers_count} seguidores",
  573. "100K+": "+100 mil",
  574. "10k unit": "10 mil unidades",
  575. Follow: "Seguir",
  576. "Follow %{screen_name}": "Seguir %{screen_name}",
  577. K: "Mil",
  578. M: "M",
  579. Tweet: "Tweetar",
  580. "Tweet %{hashtag}": "Tweetar %{hashtag}",
  581. "Tweet to %{name}": "Tweetar para %{name}"
  582. },
  583. ru: {
  584. "%{followers_count} followers": "Читатели: %{followers_count} ",
  585. "100K+": "100 тыс.+",
  586. "10k unit": "блок 10k",
  587. Follow: "Читать",
  588. "Follow %{screen_name}": "Читать %{screen_name}",
  589. K: "тыс.",
  590. M: "млн.",
  591. Tweet: "Твитнуть",
  592. "Tweet %{hashtag}": "Твитнуть %{hashtag}",
  593. "Tweet to %{name}": "Твитнуть %{name}"
  594. },
  595. "zh-cn": {
  596. "%{followers_count} followers": "%{followers_count} 关注者",
  597. "100K+": "10万+",
  598. "10k unit": "1万单元",
  599. Follow: "关注",
  600. "Follow %{screen_name}": "关注 %{screen_name}",
  601. K: "千",
  602. M: "百万",
  603. Tweet: "发推",
  604. "Tweet %{hashtag}": "以 %{hashtag} 发推",
  605. "Tweet to %{name}": "发推给 %{name}"
  606. },
  607. "zh-tw": {
  608. "%{followers_count} followers": "%{followers_count} 位跟隨者",
  609. "100K+": "超過十萬",
  610. "10k unit": "1萬 單位",
  611. Follow: "跟隨",
  612. "Follow %{screen_name}": "跟隨 %{screen_name}",
  613. K: "千",
  614. M: "百萬",
  615. Tweet: "推文",
  616. "Tweet %{hashtag}": "推文%{hashtag}",
  617. "Tweet to %{name}": "推文給%{name}"
  618. },
  619. ar: {
  620. "%{followers_count} followers": "عدد المتابعين %{followers_count}",
  621. "100K+": "+100 ألف",
  622. "10k unit": "10 آلاف وحدة",
  623. Follow: "تابع",
  624. "Follow %{screen_name}": "تابع %{screen_name}",
  625. K: "ألف",
  626. M: "مليون",
  627. Tweet: "غرِّد",
  628. "Tweet %{hashtag}": "غرِّد %{hashtag}",
  629. "Tweet to %{name}": "غرِّد لـ %{name}"
  630. },
  631. it: {
  632. "%{followers_count} followers": "%{followers_count} follower",
  633. "100K+": "100K+",
  634. "10k unit": "10k unità",
  635. Follow: "Segui",
  636. "Follow %{screen_name}": "Segui %{screen_name}",
  637. K: "K",
  638. M: "M",
  639. Tweet: "Tweet",
  640. "Tweet %{hashtag}": "Twitta %{hashtag}",
  641. "Tweet to %{name}": "Twitta a %{name}"
  642. },
  643. id: {
  644. "%{followers_count} followers": "%{followers_count} pengikut",
  645. "100K+": "100 ribu+",
  646. "10k unit": "10 ribu unit",
  647. Follow: "Ikuti",
  648. "Follow %{screen_name}": "Ikuti %{screen_name}",
  649. K: "&nbsp;ribu",
  650. M: "&nbsp;juta",
  651. Tweet: "Tweet",
  652. "Tweet %{hashtag}": "Tweet %{hashtag}",
  653. "Tweet to %{name}": "Tweet ke %{name}"
  654. },
  655. tr: {
  656. "%{followers_count} followers": "%{followers_count} takipçi",
  657. "100K+": "+100 bin",
  658. "10k unit": "10 bin birim",
  659. Follow: "Takip et",
  660. "Follow %{screen_name}": "Takip et: %{screen_name}",
  661. K: "bin",
  662. M: "milyon",
  663. Tweet: "Tweetle",
  664. "Tweet %{hashtag}": "Tweetle: %{hashtag}",
  665. "Tweet to %{name}": "Tweetle: %{name}"
  666. },
  667. fr: {
  668. "%{followers_count} followers": "%{followers_count} abonnés",
  669. "100K+": "100K+",
  670. "10k unit": "unité de 10k",
  671. Follow: "Suivre",
  672. "Follow %{screen_name}": "Suivre %{screen_name}",
  673. K: "K",
  674. M: "M",
  675. Tweet: "Tweeter",
  676. "Tweet %{hashtag}": "Tweeter %{hashtag}",
  677. "Tweet to %{name}": "Tweeter à %{name}"
  678. },
  679. fi: {
  680. "%{followers_count} followers": "%{followers_count} seuraajaa",
  681. "100K+": "100 000+",
  682. "10k unit": "10 000 yksikköä",
  683. Follow: "Seuraa",
  684. "Follow %{screen_name}": "Seuraa käyttäjää %{screen_name}",
  685. K: "tuhatta",
  686. M: "milj.",
  687. Tweet: "Twiittaa",
  688. "Tweet %{hashtag}": "Twiittaa %{hashtag}",
  689. "Tweet to %{name}": "Twiittaa käyttäjälle %{name}"
  690. },
  691. fa: {
  692. "%{followers_count} followers": "%{followers_count} دنبال‌کننده",
  693. "100K+": ">۱۰۰هزار",
  694. "10k unit": "۱۰هزار واحد",
  695. Follow: "دنبال کردن",
  696. "Follow %{screen_name}": "دنبال کردن %{screen_name}",
  697. K: "هزار",
  698. M: "میلیون",
  699. Tweet: "توییت",
  700. "Tweet %{hashtag}": "توییت کردن %{hashtag}",
  701. "Tweet to %{name}": "به %{name} توییت کنید"
  702. },
  703. th: {
  704. "%{followers_count} followers": "%{followers_count} ผู้ติดตาม",
  705. "100K+": "100พัน+",
  706. "10k unit": "หน่วย 10พัน",
  707. Follow: "ติดตาม",
  708. "Follow %{screen_name}": "ติดตาม %{screen_name}",
  709. K: "พัน",
  710. M: "ล้าน",
  711. Tweet: "ทวีต",
  712. "Tweet %{hashtag}": "ทวีต %{hashtag}",
  713. "Tweet to %{name}": "ทวีตถึง %{name}"
  714. },
  715. msa: {
  716. "%{followers_count} followers": "%{followers_count} pengikut",
  717. "100K+": "100 ribu+",
  718. "10k unit": "10 ribu unit",
  719. Follow: "Ikut",
  720. "Follow %{screen_name}": "Ikut %{screen_name}",
  721. K: "ribu",
  722. M: "juta",
  723. Tweet: "Tweet",
  724. "Tweet %{hashtag}": "Tweet %{hashtag}",
  725. "Tweet to %{name}": "Tweet kepada %{name}"
  726. },
  727. pl: {
  728. "%{followers_count} followers": "%{followers_count} obserwujących",
  729. "100K+": "100 tys.+",
  730. "10k unit": "10 tys.",
  731. Follow: "Obserwuj",
  732. "Follow %{screen_name}": "Obserwuj %{screen_name}",
  733. K: "tys.",
  734. M: "mln",
  735. Tweet: "Tweetnij",
  736. "Tweet %{hashtag}": "Tweetnij %{hashtag}",
  737. "Tweet to %{name}": "Tweetnij do %{name}"
  738. },
  739. de: {
  740. "%{followers_count} followers": "%{followers_count} Follower",
  741. "100K+": "100Tsd+",
  742. "10k unit": "10tsd-Einheit",
  743. Follow: "Folgen",
  744. "Follow %{screen_name}": "%{screen_name} folgen",
  745. K: "Tsd",
  746. M: "M",
  747. Tweet: "Twittern",
  748. "Tweet %{hashtag}": "Tweet %{hashtag}",
  749. "Tweet to %{name}": "Tweet an %{name}"
  750. }
  751. },
  752. l = function() {};
  753. b.aug(l.prototype, {
  754. setLanguage: function(a) {
  755. var b;
  756. a || (a = this.params().lang || this.originElement.getAttribute("data-lang") || m(this.originElement)), a = a && a.toLowerCase();
  757. if (!a) return this.lang = "en";
  758. if (k[a]) return this.lang = a;
  759. b = a.replace(/[-_].*/, "");
  760. if (k[b]) return this.lang = b;
  761. this.lang = "en"
  762. },
  763. _: function(a, b) {
  764. var c = this.lang;
  765. b = b || {};
  766. if (!c || !k.hasOwnProperty(c)) c = this.lang = "en";
  767. return a = k[c] && k[c][a] || a, this.ringo(a, b, /%\{([\w_]+)\}/g)
  768. },
  769. ringo: function(a, b, c) {
  770. return c = c || /\{\{([\w_]+)\}\}/g, a.replace(c, function(a, c) {
  771. return b[c] !== undefined ? b[c] : a
  772. })
  773. },
  774. add: function(a) {
  775. j.list.push(this), j.byId[this.id] = a
  776. },
  777. create: function(a, b, c, d) {
  778. return this.id = this.generateId(), f({
  779. url: a,
  780. css: {
  781. width: c[0] + (typeof c[0] != "string" ? "px" : ""),
  782. height: c[1] + (typeof c[1] != "string" ? "px" : "")
  783. },
  784. className: b,
  785. id: this.id,
  786. attributes: d,
  787. replace: this.originElement
  788. })
  789. },
  790. params: function() {
  791. var a = this.originElement.href && this.originElement.href.split("?")[1],
  792. b = a ? e.decode(a) : {};
  793. return (this.params = function() {
  794. return b
  795. })()
  796. },
  797. dataAttr: function(a) {
  798. return this.originElement.getAttribute("data-" + a)
  799. },
  800. generateId: function() {
  801. return this.originElement.id || "twitter-widget-" + g++
  802. },
  803. styles: {
  804. base: "font: normal normal normal 11px/18px 'Helvetica Neue', Arial, sans-serif; margin: 0; padding: 0; white-space: nowrap;",
  805. button: "font-weight: bold; text-shadow: 0 1px 0 rgba(255,255,255,.5);",
  806. large: "font-size: 13px; line-height: 26px;",
  807. vbubble: "font-size: 16px;"
  808. },
  809. width: function() {
  810. throw new Error(name + " not implemented")
  811. },
  812. height: function() {
  813. return this.size == "m" ? 20 : 28
  814. },
  815. dimensions: function() {
  816. return [this.width(), this.height()]
  817. }
  818. }), a({
  819. Base: l,
  820. init: o,
  821. embed: p,
  822. find: q,
  823. TWITTER_PROFILE_URL: /^https?\:\/\/(?:www\.)?twitter\.com\/(?:#!?\/)?([\w_]{1,20})\/?$/
  824. })
  825. })
  826. });
  827. provide("util/events", function(a) {
  828. using("util/util", function(b) {
  829. function d() {
  830. this.completed = !1, this.callbacks = []
  831. }
  832. var c = {
  833. bind: function(a, b) {
  834. return this._handlers = this._handlers || {}, this._handlers[a] = this._handlers[a] || [], this._handlers[a].push(b)
  835. },
  836. unbind: function(a, c) {
  837. if (!this._handlers[a]) return;
  838. if (c) {
  839. var d = b.indexOf(this._handlers[a], c);
  840. d >= 0 && this._handlers[a].splice(d, 1)
  841. } else this._handlers[a] = []
  842. },
  843. trigger: function(a, b) {
  844. var c = this._handlers && this._handlers[a];
  845. b.type = a;
  846. if (c) for (var d = 0, e; e = c[d]; d++) e.call(this, b)
  847. }
  848. };
  849. d.prototype.addCallback = function(a) {
  850. this.completed ? a.apply(this, this.results) : this.callbacks.push(a)
  851. }, d.prototype.complete = function() {
  852. this.results = makeArray(arguments), this.completed = !0;
  853. for (var a = 0, b; b = this.callbacks[a]; a++) b.apply(this, this.results)
  854. }, a({
  855. Emitter: c,
  856. Promise: d
  857. })
  858. })
  859. });
  860. provide("util/uri", function(a) {
  861. using("util/querystring", "util/util", function(b, c) {
  862. function d(a) {
  863. var b;
  864. return a.match(/^https?:\/\//) ? a : (b = location.host, location.port.length > 0 && (b += ":" + location.port), [location.protocol, "//", b, a].join(""))
  865. }
  866. function e() {
  867. var a = document.getElementsByTagName("link");
  868. for (var b = 0, c; c = a[b]; b++) if (c.getAttribute("rel") == "canonical") return d(c.getAttribute("href"));
  869. return null
  870. }
  871. function f() {
  872. var a = document.getElementsByTagName("a"),
  873. b = document.getElementsByTagName("link"),
  874. d = /\bme\b/,
  875. e = /^https?\:\/\/(www\.)?twitter.com\/([a-zA-Z0-9_]+)$/,
  876. f = c.array(a).concat(c.array(b)),
  877. g, h, i;
  878. for (var j = 0, k; k = f[j]; j++) {
  879. h = k.getAttribute("rel"), i = k.getAttribute("href");
  880. if (h && i && h.match(d) && (g = i.match(e))) return g[2]
  881. }
  882. }
  883. a({
  884. absolutize: d,
  885. getCanonicalURL: e,
  886. getScreenNameFromPage: f
  887. })
  888. })
  889. });
  890. provide("tfw/widget/intent", function(a) {
  891. using("util/util", "tfw/widget/base", "util/querystring", "util/uri", function(b, c, d, e) {
  892. function m(a) {
  893. var b = Math.round(k / 2 - h / 2),
  894. c = 0;
  895. j > i && (c = Math.round(j / 2 - i / 2)), window.open(a, "intent", g + ",width=" + h + ",height=" + i + ",left=" + b + ",top=" + c)
  896. }
  897. function n(a, b) {
  898. using("tfw/widget/hubclient", function(c) {
  899. c.openIntent(a, b)
  900. })
  901. }
  902. function o(a) {
  903. var b = "original_referer=" + location.href;
  904. return [a, b].join(a.indexOf("?") == -1 ? "?" : "&")
  905. }
  906. function q(a) {
  907. a = a || window.event;
  908. var b = a.target || a.srcElement,
  909. c, d;
  910. while (b && b.nodeName.toLowerCase() !== "a") b = b.parentNode;
  911. if (b && b.nodeName.toLowerCase() === "a" && b.href) {
  912. c = b.href.match(f);
  913. if (c) {
  914. var e = o(b.href);
  915. e = e.replace(/^http[:]/, "https:"), e = e.replace(/^\/\//, "https://"), twttr.events.hub ? (d = new p(l.generateId(), b), l.add(d), n(e, b), twttr.events.trigger("click", {
  916. target: b,
  917. region: "intent",
  918. type: "click",
  919. data: {}
  920. })) : m(e), a.returnValue = !1, a.preventDefault && a.preventDefault()
  921. }
  922. }
  923. }
  924. var f = /twitter\.com(\:\d{2,4})?\/intent\/(\w+)/,
  925. g = "scrollbars=yes,resizable=yes,toolbar=no,location=yes",
  926. h = 550,
  927. i = 520,
  928. j = screen.height,
  929. k = screen.width,
  930. l, p = function(a, b) {
  931. this.id = a, this.element = this.originElement = b
  932. },
  933. r = function(a) {
  934. this.originElement = [], this.element = a
  935. };
  936. r.prototype = new c.Base, b.aug(r.prototype, {
  937. render: function(a) {
  938. l = this, window.__twitterIntentHandler || (document.addEventListener ? document.addEventListener("click", q, !1) : document.attachEvent && document.attachEvent("onclick", q), window.__twitterIntentHandler = !0)
  939. }
  940. }), a({
  941. Listener: r
  942. })
  943. })
  944. });
  945. provide("lib/twt", function(a) {
  946. a(function(a, b) {
  947. var c = a != "en" ? a + "." : "";
  948. using("$vendor/twt/dist/twt." + c + "min.js", function() {
  949. twt.settings.lang = a, b(twt)
  950. })
  951. })
  952. });
  953. provide("util/decider", function(a) {
  954. function c(a) {
  955. var c = b[a] || !1;
  956. if (!c) return !1;
  957. if (c === !0 || c === 100) return !0;
  958. var d = Math.random() * 100,
  959. e = c >= d;
  960. return b[a] = e, e
  961. }
  962. var b = {
  963. force_new_cookie: 100,
  964. decider_fixture: 12.34
  965. };
  966. a({
  967. isAvailable: c
  968. })
  969. });
  970. provide("util/params", function(a) {
  971. using("util/querystring", function(b) {
  972. var c = function(a) {
  973. var c = a.search.substr(1);
  974. return b.decode(c)
  975. },
  976. d = function(a) {
  977. var c = a.href,
  978. d = c.indexOf("#"),
  979. e = d < 0 ? "" : c.substring(d + 1);
  980. return b.decode(e)
  981. },
  982. e = function(a) {
  983. var b = {},
  984. e = c(a),
  985. f = d(a);
  986. for (var g in e) e.hasOwnProperty(g) && (b[g] = e[g]);
  987. for (var g in f) f.hasOwnProperty(g) && (b[g] = f[g]);
  988. return b
  989. };
  990. a({
  991. combined: e,
  992. fromQuery: c,
  993. fromFragment: d
  994. })
  995. })
  996. });
  997. provide("tfw/widget/env", function(a) {
  998. using("util/params", function(b) {
  999. function d() {
  1000. var a = 36e5,
  1001. d = b.combined(document.location)._;
  1002. return c !== undefined ? c : (c = !1, d && /^\d+$/.test(d) && (c = +(new Date) - parseInt(d) < a), c)
  1003. }
  1004. var c;
  1005. a({
  1006. isDynamicWidget: d
  1007. })
  1008. })
  1009. });
  1010. provide("dom/cookie", function(a) {
  1011. using("util/util", function(b) {
  1012. a(function(a, c, d) {
  1013. var e = b.aug({}, d);
  1014. if (arguments.length > 1 && String(c) !== "[object Object]") {
  1015. if (c === null || c === undefined) e.expires = -1;
  1016. if (typeof e.expires == "number") {
  1017. var f = e.expires,
  1018. g = new Date((new Date).getTime() + f * 60 * 1e3);
  1019. e.expires = g
  1020. }
  1021. return c = String(c), document.cookie = [encodeURIComponent(a), "=", e.raw ? c : encodeURIComponent(c), e.expires ? "; expires=" + e.expires.toUTCString() : "", e.path ? "; path=" + e.path : "", e.domain ? "; domain=" + e.domain : "", e.secure ? "; secure" : ""].join("")
  1022. }
  1023. e = c || {};
  1024. var h, i = e.raw ?
  1025. function(a) {
  1026. return a
  1027. } : decodeURIComponent;
  1028. return (h = (new RegExp("(?:^|; )" + encodeURIComponent(a) + "=([^;]*)")).exec(document.cookie)) ? i(h[1]) : null
  1029. })
  1030. })
  1031. });
  1032. provide("util/donottrack", function(a) {
  1033. using("dom/cookie", function(b) {
  1034. a(function() {
  1035. return b("dnt") ? !0 : document.navigator ? document.navigator["doNotTrack"] == 1 : navigator ? navigator["doNotTrack"] == 1 || navigator["msDoNotTrack"] == 1 : !1
  1036. })
  1037. })
  1038. });
  1039. provide("tfw/widget/guest_cookie", function(a) {
  1040. using("dom/cookie", "util/donottrack", "util/decider", function(b, c, d) {
  1041. function f() {
  1042. var a = b(e) || !1;
  1043. if (!a) return;
  1044. a.match(/^v3\:/) || g()
  1045. }
  1046. function g() {
  1047. b(e) && b(e, null, {
  1048. domain: ".twitter.com",
  1049. path: "/"
  1050. })
  1051. }
  1052. function h() {
  1053. c() && g()
  1054. }
  1055. var e = "pid";
  1056. a({
  1057. set: h,
  1058. destroy: g,
  1059. forceNewCookie: f,
  1060. guest_id_cookie: e
  1061. })
  1062. })
  1063. });
  1064. provide("tfw/widget/tracking", function(a) {
  1065. using("dom/cookie", "util/donottrack", "tfw/widget/guest_cookie", "tfw/widget/env", "util/decider", function(b, c, d, e, f) {
  1066. function i(a, b, c) {
  1067. var d = g + b;
  1068. if (!a) return;
  1069. return a[d] = c, a
  1070. }
  1071. function j(a, f, g, j, k) {
  1072. j || (j = !1), k || (k = !1), f || (f = {}), g = g || "tweetbutton";
  1073. var l = h[g] || h.tweetbutton,
  1074. m = a.ownerDocument.createElement("img"),
  1075. n = [];
  1076. j || (i(f, "referrer", document.referrer.toString()), i(f, "widget", +e.isDynamicWidget()), !k && !c() ? (i(f, "li", + !! b("twid")), i(f, d.guest_id_cookie, b(d.guest_id_cookie) || "")) : i(f, "dnt", "1"));
  1077. for (var o in f) if (f.hasOwnProperty(o)) {
  1078. var p = encodeURIComponent(o),
  1079. q = encodeURIComponent(f[o]);
  1080. q = q.replace(/'/g, "%27"), n.push(p + "=" + q)
  1081. }
  1082. m.src = l + "?" + n.join("&"), m.alt = "", m.style.position = "absolute", m.style.height = "1px", m.style.width = "1px", m.style.top = "-9999px", m.style.left = "-9999px", a.appendChild(m);
  1083. if (g == "tweetembed") {
  1084. var r = {
  1085. twttr_referrer: "referrer",
  1086. twttr_variant: "version",
  1087. lang: "language",
  1088. screen_name: "screen_name"
  1089. },
  1090. s = {
  1091. _category_: "tfw_widgets",
  1092. event_name: g + ":impression"
  1093. };
  1094. for (var o in f) {
  1095. var t = r[o];
  1096. t && (s[t] = f[o])
  1097. }!k && !c() && (f.twttr_li && (s.logged_in = f["twttr_li"] == "1"), s.pid = b(d.guest_id_cookie) || ""), f.status_id && (s.tweet_ids = [f.status_id]), f.twttr_widget && (s.widget = f["twttr_widget"] == "1");
  1098. var m = a.ownerDocument.createElement("img"),
  1099. u = "//r.twimg.com/jot?l=" + encodeURIComponent(JSON.stringify(s)).replace(/'/g, "%27");
  1100. if (k || c()) u += "&dnt=1";
  1101. m.src = u, m.alt = "", m.style.position = "absolute", m.style.height = "1px", m.style.width = "1px", m.style.top = "-9999px", m.style.left = "-9999px", a.appendChild(m)
  1102. }
  1103. }
  1104. var g = "twttr_",
  1105. h = {
  1106. tweetbutton: "//p.twitter.com/t.gif",
  1107. followbutton: "//p.twitter.com/f.gif",
  1108. tweetembed: "//p.twitter.com/e.gif"
  1109. };
  1110. f.isAvailable("force_new_cookie") && d.forceNewCookie(), a({
  1111. addPixel: j,
  1112. addVar: i
  1113. })
  1114. })
  1115. });
  1116. provide("util/tweetparser", function(a) {
  1117. using("util/util", function(b) {
  1118. function g(a, c) {
  1119. var d = document.getElementsByTagName(a),
  1120. e = b.filter(d, function(a) {
  1121. return b.containsElement(c, a)
  1122. });
  1123. return e || []
  1124. }
  1125. function h(a) {
  1126. return a && c.test(a) && RegExp.$1
  1127. }

Large files files are truncated, but you can click here to view the full file