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.
This commit is contained in:
Joel Martin 2010-07-02 09:54:55 -05:00
parent b9633f8bfd
commit 1144eaa37a
1 changed files with 3 additions and 0 deletions

View File

@ -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;