From 1144eaa37a528602736315cf187eddafc27cabb7 Mon Sep 17 00:00:00 2001 From: Joel Martin Date: Fri, 2 Jul 2010 09:54:55 -0500 Subject: [PATCH] Add global variable option for swf location. The problem is, you can't set WebSocket.__swfLocation before you load web_socket.js (because it creates the WebSocket global), but you also can't reliably set WebSocket.__swfLocation after because if you are doing dynamic script file includes then the onload (i.e. WebSocket.__initialize) may fire before you have a chance to set Websocket.__swfLocation. --- include/web-socket-js/web_socket.js | 3 +++ 1 file changed, 3 insertions(+) diff --git a/include/web-socket-js/web_socket.js b/include/web-socket-js/web_socket.js index 27641f82..5b0afc16 100755 --- a/include/web-socket-js/web_socket.js +++ b/include/web-socket-js/web_socket.js @@ -293,6 +293,9 @@ WebSocket.__tasks = []; WebSocket.__initialize = function() { + if (WebSocket__swfLocation) { + WebSocket.__swfLocation = WebSocket__swfLocation; + } if (!WebSocket.__swfLocation) { console.error("[WebSocket] set WebSocket.__swfLocation to location of WebSocketMain.swf"); return;