someone_

start.js

Aug 19th, 2014
202
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. var d = document,
  2.  
  3. jewz = {
  4.     current: {
  5.         id: "",
  6.         html: ""
  7.     },
  8.     getE: function(a, b) {
  9.         return (b || d).querySelector(a);
  10.     },
  11.     attachE: function(a, b, c) {
  12.         return a.addEventListener(b, c, false);
  13.     },
  14.     fetcher_fn: function() {
  15.         var x = new XMLHttpRequest();
  16.         x.open("GET", "stream/global.js", true);
  17.         x.setRequestHeader("If-Modified-Since", (jewz.cached && jewz.cached.getResponseHeader("Last-Modified")) || (new Date(0)));
  18.         x.onreadystatechange = function() {
  19.             if (x.readyState == 4 && x.status == 2E2) {
  20.                 jewz.cached = x;
  21.                 Function(x.responseText)();
  22.                 jewz.codes();
  23.             }
  24.         };
  25.         x.send();
  26.     },
  27.     fetcher: function() {
  28.         jewz.fetcherId = setInterval(jewz.fetcher_fn, 300000);
  29.     },
  30.     codes: function() {
  31.         if (jewz.current.id == "") {
  32.             jewz.streamS(jewz.mainstream);
  33.         }
  34.         else if (jewz.current.html != jewz.streams[jewz.current.id]) {
  35.             jewz.streamS(jewz.current.id);
  36.         }
  37.     },
  38.     streamS: function(a) {
  39.         jewz.stream().innerHTML =
  40.             jewz.current.html =
  41.             jewz.streams[ jewz.current.id = a ];
  42.         jewz.chat().firstElementChild.height =
  43.             (jewz.getE("embed", jewz.chat()) || jewz.chat().firstElementChild).height =
  44.             jewz.stream().firstElementChild.height;
  45.         jewz.cstream().innerHTML = jewz.getE("#lbottom").innerHTML.match(new RegExp(a + "'\\)\">([^<]*)",""))[1];
  46.     },
  47.     flashC: function(ready) {
  48.         var height, trash;
  49.         if (height = jewz.stream().firstElementChild) {
  50.             height = height.height;
  51.         } else {
  52.             height = "576";
  53.         }
  54.         for (trash in window) if (/^(closure_uid_\d+|env|opt_arg|send_str)$/.test(trash)) delete window[trash];
  55.         jewz.chat().innerHTML = '<object width="355" height="' + height + '" id="chat-embed"><param name="movie" value="http://' + jewz.chatango + '.chatango.com/group" /><param name="AllowScriptAccess" value="always" /><param name="AllowNetworking" value="all" /><param name="AllowFullScreen" value="true" /><param name="wmode" value="direct" /><param name="flashvars" value="cid=0010000014671178455&amp;b=100&amp;c=666666&amp;d=666666&amp;g=333333&amp;j=333333&amp;k=666666&amp;l=CCCCCC&amp;m=FFFFFF&amp;p=10&amp;s=1&amp;t=0&amp;v=0" /><embed src="http://' + jewz.chatango + '.chatango.com/group" width="355" height="' + height + '" allowscriptaccess="always" allownetworking="all" type="application/x-shockwave-flash" allowfullscreen="true" flashvars="cid=0010000014671178455&amp;b=100&amp;c=666666&amp;d=666666&amp;g=333333&amp;j=333333&amp;k=666666&amp;l=CCCCCC&amp;m=FFFFFF&amp;p=10&amp;s=1&amp;t=0&amp;v=0" wmode="direct" /></object>';;
  56.         ready || (localStorage.html5chat = "");
  57.     },
  58.     html5C: function(ready) {
  59.         var s = d.createElement('script'), height;
  60.         if (height = jewz.stream().firstElementChild) {
  61.             height = height.height;
  62.         } else {
  63.             height = "576";
  64.         }
  65.         jewz.chat().innerHTML = '';
  66.         s.id = "cid0020000067740067671";
  67.         s.src = 'http://st.chatango.com/js/gz/emb.js';
  68.         s.style.cssText = "width:355px;height:" + height + "px;";
  69.         s.async = true;
  70.         s.text = '{"handle":"' + jewz.chatango + '","arch":"js","styles":{"a":"FFFFFF","b":100,"c":"000000","d":"000000","e":"FFFFFF","k":"000000","l":"808080","m":"000000","n":"000000","q":"000000","r":100,"usricon":0.79}}';
  71.         jewz.chat().appendChild(s);
  72.         ready || (localStorage.html5chat = "true");
  73.     },
  74.     f5: function(e) {
  75.         if ( (e.which || e.keyCode) == 116 ) {
  76.             if (
  77.                 !jewz.cooldown ||
  78.                     ( (new Date()).getTime() - jewz.cooldown > 3E4 )
  79.                 ) {
  80.                 jewz.cooldown = (new Date()).getTime();
  81.                 jewz.fetcher_fn();
  82.                 jewz.banner();
  83.             } else {
  84.                 alert("You can only refresh every 30 seconds!\n" + (
  85.                     30 - Math.ceil(
  86.                         ( (new Date()).getTime() - jewz.cooldown ) / 1000
  87.                     )
  88.                 ) + " seconds left");
  89.             }
  90.             return false;
  91.         }
  92.     },
  93.     banner: function() {
  94.         jewz.getE('#banner').src = "images/" + jewz.banners[ Math.floor( Math.random() * jewz.banners.length ) ];
  95.     },
  96.     ready: function() {
  97.         jewz.chatango = "entstream";
  98.         jewz.chat = function() {
  99.             return jewz.getE("#cell2");
  100.         };
  101.         jewz.stream = function() {
  102.             return jewz.getE("#cell1");
  103.         };
  104.         jewz.cstream = function() {
  105.             return jewz.getE("#current");
  106.         };
  107.         jewz[localStorage.html5chat ? "html5C" : "flashC"](true);
  108.         jewz.fetcher_fn();
  109.         jewz.fetcher();
  110.         jewz.banner();
  111.         d.onkeydown = jewz.f5;
  112.     }
  113. };
  114.  
  115. jewz.attachE(d, "DOMContentLoaded", jewz.ready);
  116. jewz.attachE(window, "load", function() {
  117.     setTimeout(function(){
  118.         jewz.getE("#hoverinfo").className = 'loaded';
  119.     }, 9E3);
  120. });
RAW Paste Data