From 1354d17270961fff662d40f90521223f8fd0d73b Mon Sep 17 00:00:00 2001 From: Andrew Dolgov Date: Tue, 14 Aug 2012 18:59:10 +0400 Subject: update dojo to 1.7.3 --- lib/dojo/OpenAjax.js | 47 ++++++++++++++++++++--------------------------- 1 file changed, 20 insertions(+), 27 deletions(-) (limited to 'lib/dojo/OpenAjax.js') diff --git a/lib/dojo/OpenAjax.js b/lib/dojo/OpenAjax.js index f99af1a13..0733641ac 100644 --- a/lib/dojo/OpenAjax.js +++ b/lib/dojo/OpenAjax.js @@ -1,10 +1,3 @@ -/* - Copyright (c) 2004-2011, The Dojo Foundation All Rights Reserved. - Available via Academic Free License >= 2.1 OR the modified BSD license. - see: http://dojotoolkit.org/license for details -*/ - - /******************************************************************************* * OpenAjax.js * @@ -54,11 +47,11 @@ if(!window["OpenAjax"]){ extraData: extra }; this.publish(ooh+"registerLibrary", libs[prefix]); - } + }; h.unregisterLibrary = function(prefix){ this.publish(ooh+"unregisterLibrary", libs[prefix]); delete libs[prefix]; - } + }; h._subscriptions = { c:{}, s:[] }; h._cleanup = []; @@ -74,7 +67,7 @@ if(!window["OpenAjax"]){ var path = name.split("."); this._subscribe(this._subscriptions, path, 0, sub); return handle; - } + }; h.publish = function(name, message){ var path = name.split("."); @@ -88,13 +81,13 @@ if(!window["OpenAjax"]){ delete(this._cleanup); this._cleanup = []; } - } + }; h.unsubscribe = function(sub){ var path = sub.split("."); var sid = path.pop(); this._unsubscribe(this._subscriptions, path, 0, sid); - } + }; h._subscribe = function(tree, path, index, sub){ var token = path[index]; @@ -102,21 +95,21 @@ if(!window["OpenAjax"]){ tree.s.push(sub); }else{ if(typeof tree.c == "undefined"){ - tree.c = {}; + tree.c = {}; } 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); } } - } + }; h._publish = function(tree, path, index, name, msg){ if(typeof tree != "undefined"){ var node; - if(index == path.length) { + if(index == path.length){ node = tree; }else{ this._publish(tree.c[path[index]], path, index + 1, name, msg); @@ -141,33 +134,33 @@ if(!window["OpenAjax"]){ fcb = sc[fcb]; } if((!fcb) || - (fcb.call(sc, name, msg, d))) { + (fcb.call(sc, name, msg, d))){ cb.call(sc, name, msg, d); } } } } } - } + }; - h._unsubscribe = function(tree, path, index, sid) { - if(typeof tree != "undefined") { - if(index < path.length) { + h._unsubscribe = function(tree, path, index, sid){ + if(typeof tree != "undefined"){ + if(index < path.length){ var childNode = tree.c[path[index]]; this._unsubscribe(childNode, path, index + 1, sid); - if(childNode.s.length == 0) { + if(childNode.s.length == 0){ for(var x in childNode.c) - return; + return; delete tree.c[path[index]]; } return; } - else { + else{ var callbacks = tree.s; var max = callbacks.length; for(var i = 0; i < max; i++) - if(sid == callbacks[i].sid) { - if(this._pubDepth > 0) { + if(sid == callbacks[i].sid){ + if(this._pubDepth > 0){ callbacks[i].cb = null; this._cleanup.push(callbacks[i]); } @@ -177,7 +170,7 @@ if(!window["OpenAjax"]){ } } } - } + }; // 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() -- cgit v1.2.3