changeset 116:d7d7cdcba3b4

Fix WebSocket support checking. Check for window.WebSocket instead of WebSocket.
author John "Elwin" Edwards <elwin@sdf.org>
date Mon, 16 Jul 2012 14:52:04 -0700
parents 7ef3a1a084b9
children c08717cb7793
files rlgterm.js
diffstat 1 files changed, 5 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/rlgterm.js	Mon Jul 16 10:28:55 2012 -0700
+++ b/rlgterm.js	Mon Jul 16 14:52:04 2012 -0700
@@ -417,7 +417,7 @@
     else
       break;
   }
-  if (!WebSocket) {
+  if (!window.WebSocket) {
     message("Your browser does not support WebSockets. You can still play, " +
             "but it will be slower, and may not work in the future.", "warn");
   }
@@ -523,7 +523,7 @@
 
 /* Handles the status socket, opening and closing it when necessary. */
 function wsCurrent() {
-  if (!WebSocket)
+  if (!window.WebSocket)
     return;
   if (session.id) {
     /* Don't bother with status if already playing/watching. */
@@ -561,7 +561,7 @@
 }
 
 function getcurrent(clear) {
-  if (WebSocket) {
+  if (window.WebSocket) {
     return;
   }
   if (session.id || clear) {
@@ -674,7 +674,7 @@
 function startgame(game) {
   if (session.id != null || !session.lcred)
     return;
-  if (WebSocket) {
+  if (window.WebSocket) {
     wsStart(game);
     return;
   }
@@ -794,7 +794,7 @@
 function startwatching(gamenumber) {
   if (session.id != null)
     return;
-  if (WebSocket) {
+  if (window.WebSocket) {
     wsWatch(gamenumber);
     return;
   }