]> git.wh0rd.org - tt-rss.git/blobdiff - lib/dojo/OpenAjax.js
upgrade dojo to 1.8.3 (refs #570)
[tt-rss.git] / lib / dojo / OpenAjax.js
index 0733641ac60530c662d00dd4f7a8ef15329558aa..0b3c8918b6bed929f41118cfeea20bf12757cd78 100644 (file)
 // 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", {});