diff options
author | matthew <matthew> | 2006-09-19 15:08:36 +0000 |
---|---|---|
committer | matthew <matthew> | 2006-09-19 15:08:36 +0000 |
commit | 998534c14693435a79181acbbedd70a2ea7ec08d (patch) | |
tree | 395b48ebeddad620e55d918a17d7a9369ea52aa1 /web/build/YAHOO.js | |
parent | adf632f9b1476f4d8bdffe8cfb85d5e88685ff48 (diff) |
Random old code for BCI.
Diffstat (limited to 'web/build/YAHOO.js')
-rw-r--r-- | web/build/YAHOO.js | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/web/build/YAHOO.js b/web/build/YAHOO.js new file mode 100644 index 000000000..33e3ff47d --- /dev/null +++ b/web/build/YAHOO.js @@ -0,0 +1,63 @@ +/* +Copyright (c) 2006 Yahoo! Inc. All rights reserved. +version 0.9.0 +*/ + +/** + * @class The Yahoo global namespace + */ +var YAHOO = function() { + + return { + + /** + * Yahoo presentation platform utils namespace + */ + util: {}, + + /** + * Yahoo presentation platform widgets namespace + */ + widget: {}, + + /** + * Yahoo presentation platform examples namespace + */ + example: {}, + + /** + * Returns the namespace specified and creates it if it doesn't exist + * + * YAHOO.namespace("property.package"); + * YAHOO.namespace("YAHOO.property.package"); + * + * Either of the above would create YAHOO.property, then + * YAHOO.property.package + * + * @param {String} sNameSpace String representation of the desired + * namespace + * @return {Object} A reference to the namespace object + */ + namespace: function( sNameSpace ) { + + if (!sNameSpace || !sNameSpace.length) { + return null; + } + + var levels = sNameSpace.split("."); + + var currentNS = YAHOO; + + // YAHOO is implied, so it is ignored if it is included + for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) { + currentNS[levels[i]] = currentNS[levels[i]] || {}; + currentNS = currentNS[levels[i]]; + } + + return currentNS; + + } + }; + +} (); + |