]> git.example.dev Git - binbsis50.git/commitdiff
use the proper way to disable the reconnection
authorLuigi Pinca <luigipinca@gmail.com>
Mon, 27 Jan 2014 11:09:50 +0000 (12:09 +0100)
committerLuigi Pinca <luigipinca@gmail.com>
Mon, 27 Jan 2014 11:09:50 +0000 (12:09 +0100)
public/js/app.js
public/js/home.js

index 4606158dfafadc2aa73e99567879afa95bef204f..40bdf3ac776c9f2a97dd4b8156c8d95def2ba8dd 100644 (file)
     , pvtmsgto
     , subscriber = false
     , roundpoints = 0
-    , roomname = window.location.pathname.replace(/\//g, '')
+    , roomname = location.pathname.replace(/\//g, '')
     , primus
     , stopanimation = false
     , touchplay
     , urlregex = /(https?:\/\/[\-A-Za-z0-9+&@#\/%?=~_()|!:,.;]*[\-A-Za-z0-9+&@#\/%=~_()|])/
-    , uri = window.location.protocol+'//'+window.location.host; // Primus server URI
+    , uri = location.protocol + '//' + location.host; // Primus server URI
 
   var amstrings = [
     'Yes, that\'s the artist. What about the title?'
       html += '<td>'+player.points+'</td>';
       html += '<td>'+player.golds+'</td><td>'+player.silvers+'</td>';
       html += '<td>'+player.bronzes+'</td><td>'+player.guessed+'</td>';
-      var meantime = "N/A";
+      var meantime = 'N/A';
       if (player.guessed !== 0) {
         meantime = player.totguesstime / player.guessed;
         meantime = (meantime / 1000).toFixed(1)+' s';
 
     var html = '<div class="modal-header">';
     html += '<h3>You are joining the '+roomname+' room</h3></div>';
-    html += '<div class="modal-body"><p>'+(msg || "What's your name?")+'</p></div>';
+    html += '<div class="modal-body"><p>'+(msg || 'What\'s your name?')+'</p></div>';
     html += '<div class="modal-footer relative">';
     html += '<input id="login" maxlength="15" type="text" name="nickname" />';
     html += '<button id="join" class="btn btn-success">';
 
   // Set up the app
   setVariables();
-  DOM.modal.modal({keyboard:false, show:false, backdrop:'static'});
+  DOM.modal.modal({
+    backdrop: 'static',
+    keyboard: false,
+    show: false
+  });
   DOM.togglechat.click(hideChat);
 
-  primus = Primus.connect(uri, {'strategy': 'none'});
+  primus = Primus.connect(uri, {strategy: false});
   primus.on('open', function() {
     jplayer = $('#player').jPlayer({
       ready: jplayerReady,
index d93634830e5b3fcae98675d89deb8b48965b5620..2c973c8fe6630e16b1982a78af1b96c601fc9b09 100644 (file)
@@ -3,20 +3,20 @@
     $('.thumbnail').each(function() {
       var urls = data[$(this).attr('href')];
       for (var i = 0; i < urls.length; i++) {
-        $('<img src="'+urls[i]+'" />').appendTo($(this));
+        $('<img src="' + urls[i] + '" />').appendTo($(this));
       }
     });
   });
-  var uri = window.location.protocol+'//'+window.location.host;
-  var primus = Primus.connect(uri, {'strategy': 'none'});
+  var uri = location.protocol + '//' + location.host;
+  var primus = Primus.connect(uri, {strategy: false});
   primus.on('open', function() {
     primus.send('getoverview', function(data) {
       for (var prop in data) {
-        $('#'+prop).text(data[prop]);
+        $('#' + prop).text(data[prop]);
       }
     });
     primus.on('updateoverview', function(room, players) {
-      $('#'+room).text(players);
+      $('#' + room).text(players);
     });
   });
 })();