Fix WebSocket support checking.

Check for window.WebSocket instead of WebSocket.
This commit is contained in:
John "Elwin" Edwards 2012-07-16 14:52:04 -07:00
parent 59f3a10220
commit 55f7c3e7de

View file

@ -417,7 +417,7 @@ function setup() {
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 @@ function tableCurrent(gamelist) {
/* 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 wsCurrent() {
}
function getcurrent(clear) {
if (WebSocket) {
if (window.WebSocket) {
return;
}
if (session.id || clear) {
@ -674,7 +674,7 @@ function makeStarter(gname) {
function startgame(game) {
if (session.id != null || !session.lcred)
return;
if (WebSocket) {
if (window.WebSocket) {
wsStart(game);
return;
}
@ -794,7 +794,7 @@ function wsStart(game) {
function startwatching(gamenumber) {
if (session.id != null)
return;
if (WebSocket) {
if (window.WebSocket) {
wsWatch(gamenumber);
return;
}