summaryrefslogtreecommitdiff
path: root/lib/dojo/OpenAjax.js
diff options
context:
space:
mode:
authorAndrew Dolgov <[email protected]>2012-08-14 18:59:10 +0400
committerAndrew Dolgov <[email protected]>2012-08-14 18:59:18 +0400
commit1354d17270961fff662d40f90521223f8fd0d73b (patch)
treee9266be71587e47c800303446e968a6d3565e2cf /lib/dojo/OpenAjax.js
parentd04f8c826f5283765f52cf6b98b42a1ed8f2d6bc (diff)
update dojo to 1.7.3
Diffstat (limited to 'lib/dojo/OpenAjax.js')
-rw-r--r--lib/dojo/OpenAjax.js47
1 files changed, 20 insertions, 27 deletions
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()