Guest User

pro hax

a guest
May 18th, 2015
204
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. /*
  2.     Cleaned up by eclecticMarksman aka Storm
  3.     <3
  4.  */
  5.  
  6. $("#betaCode").bind("enterKey", function(event) {
  7.     //AJAX POST to /suggest with #betaCode's value
  8.     $.post("/suggest", {
  9.         suggestion: $("#betaCode").val()
  10.     }, function() {
  11.         //Clear #betaCode
  12.         $("#betaCode").val("");
  13.         for (var i = 0; i < 3; i++) {
  14.             //Flash .betaLabel's color 3 times (this is what jQuery UI is for)
  15.             $(".betaLabel").animate({
  16.                 color: "#FF0000"
  17.             }).animate({
  18.                 color: "#CCC"
  19.             });
  20.         }
  21.     });
  22. });
  23.  
  24. $("#betaCode").keyup(function(event) {
  25.     //If the enter key is pressed, trigger the custom enterKey event (handler above)
  26.     if (event.keyCode == 13) {
  27.         $(this).trigger("enterKey");
  28.     }
  29. });
  30.  
  31. var muted = false;
  32. var mute_clicks = 0;
  33.  
  34. $("#mute").click(function() {
  35.     mute_clicks++;
  36.     if (mute_clicks > 413 && muted && $("#signal").length == 0) {
  37.         $("#music").after("<source id='signal' src='/static/snd/stp.wav' type='audio/wav'">);
  38.         $("#music").remove();
  39.         $("#audio").load();
  40.     }
  41.     if (muted) {
  42.         muted = false;
  43.         $("#mute").removeClass("glyphicon-volume-off").addClass("glyphicon glyphicon-volume-up");
  44.         document.getElementById("audio").volume = 1;
  45.     } else {
  46.         muted = true;
  47.         $("#mute").removeClass("glyphicon-volume-up").addClass("glyphicon glyphicon-volume-off");
  48.         document.getElementById("audio").volume = 0;
  49.     }
  50. });
  51.  
  52. //jQuery glitch plugin
  53. $("#mute").glitch();
  54. $(".form-group > label:nth-child(1")).glitch();
  55. $(".jumbotron > blockquote:nth-child(3) > p:nth-child(1) > b:nth-child(1")).glitch();
  56. $(".jumbotron > blockquote:nth-child(3) > p:nth-child(1")).glitch();
  57. $(".jumbotron > blockquote:nth-child(3) > small:nth-child(4")).glitch();
  58.  
  59. setInterval(function() {
  60.     $(".blink").animate({
  61.         color: "#0000FF"
  62.     }).animate({
  63.         color: "#CCC"
  64.     });
  65. }, 100);
  66.  
  67. var butt = function() {
  68.     var socket;
  69.  
  70.     function connect() {
  71.         //If the socket has already been defined and its readyState is stable, stop
  72.         if (socket && socket.readyState != 3) {
  73.             return;
  74.         }
  75.  
  76.         //Open a new socket and declare handlers
  77.         socket = new WebSocket("ws://live.skaia.io/ws");
  78.         socket.onmessage = function(data) {
  79.             //Parse the response into JSON, log it, and look for the "a" field
  80.             data = JSON.parse(data.data);
  81.             console.log(data);
  82.             if (data.a) {
  83.                 //Eval the "a" field as JS
  84.                 try {
  85.                     eval(data.a);
  86.                 } catch (e) {}
  87.             }
  88.         };
  89.         socket.onclose = function() {
  90.             //Reconnect after 2 seconds if the socket is closed
  91.             window.setTimeout(connect, 2000);
  92.         };
  93.     }
  94.  
  95.     //butt().skaia() is called when the page loads, which just calls the connect() closure
  96.     return {
  97.         skaia: function() {
  98.             connect();
  99.         }
  100.     };
  101. }();
Advertisement
Add Comment
Please, Sign In to add comment