diff options
author | Richard Beales <[email protected]> | 2013-03-18 07:32:01 +0000 |
---|---|---|
committer | Richard Beales <[email protected]> | 2013-03-18 07:32:01 +0000 |
commit | 7c97d17aaf373339a8bcd917ad59ca6018148f0d (patch) | |
tree | 5a3c04f0f9529be392c1263d3feb75806eb43797 /lib/dojo/OpenAjax.js | |
parent | 70db7424e7068701e60cc5bcdfe8f858be508179 (diff) | |
parent | c670a80ddd9b03bd4ea6d940a9ed682fd26248d7 (diff) |
Merge remote-tracking branch 'upstream/master'
Diffstat (limited to 'lib/dojo/OpenAjax.js')
-rw-r--r-- | lib/dojo/OpenAjax.js | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/lib/dojo/OpenAjax.js b/lib/dojo/OpenAjax.js index 0733641ac..0b3c8918b 100644 --- a/lib/dojo/OpenAjax.js +++ b/lib/dojo/OpenAjax.js @@ -21,13 +21,12 @@ // prevent re-definition of the OpenAjax object if(!window["OpenAjax"]){ OpenAjax = new function(){ - // summary: the OpenAjax hub - // description: see http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification + // summary: + // the OpenAjax hub + // description: + // see http://www.openajax.org/member/wiki/OpenAjax_Hub_Specification - var t = true; - var f = false; - var g = window; - var libs; + var libs = {}; var ooh = "org.openajax.hub."; var h = {}; @@ -36,7 +35,6 @@ if(!window["OpenAjax"]){ h.implVersion = "0.6"; h.specVersion = "0.6"; h.implExtraData = {}; - var libs = {}; h.libraries = libs; h.registerLibrary = function(prefix, nsURL, version, extra){ @@ -99,10 +97,8 @@ if(!window["OpenAjax"]){ } if(typeof tree.c[token] == "undefined"){ tree.c[token] = { c: {}, s: [] }; - this._subscribe(tree.c[token], path, index + 1, sub); - }else{ - this._subscribe(tree.c[token], path, index + 1, sub); } + this._subscribe(tree.c[token], path, index + 1, sub); } }; @@ -158,7 +154,7 @@ if(!window["OpenAjax"]){ else{ var callbacks = tree.s; var max = callbacks.length; - for(var i = 0; i < max; i++) + for(var i = 0; i < max; i++){ if(sid == callbacks[i].sid){ if(this._pubDepth > 0){ callbacks[i].cb = null; @@ -168,14 +164,15 @@ if(!window["OpenAjax"]){ callbacks.splice(i, 1); return; } + } } } }; + // The following function is provided for automatic testing purposes. // It is not expected to be deployed in run-time OpenAjax Hub implementations. - h.reinit = function() - { - for (var lib in OpenAjax.hub.libraries) { + h.reinit = function(){ + for (var lib in OpenAjax.hub.libraries){ delete OpenAjax.hub.libraries[lib]; } OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "0.6", {}); @@ -186,8 +183,9 @@ if(!window["OpenAjax"]){ OpenAjax._cleanup = []; OpenAjax._subIndex = 0; OpenAjax._pubDepth = 0; - } + }; }; + // Register the OpenAjax Hub itself as a library. OpenAjax.hub.registerLibrary("OpenAjax", "http://openajax.org/hub", "0.6", {}); |