VirtualBox

source: vbox/trunk/src/libs/dita-ot-1.8.5/doc/yahoo.js@ 98945

Last change on this file since 98945 was 98584, checked in by vboxsync, 2 years ago

Docs: bugref:10302. Setting svn properties of DITA-OT library.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 2.3 KB
Line 
1/*
2This file is part of the DITA Open Toolkit project hosted on
3Sourceforge.net. See the accompanying license.txt file for
4applicable licenses.
5
6Copyright (c) 2006, Yahoo! Inc. All rights reserved.
7Code licensed under the BSD License:
8http://developer.yahoo.net/yui/license.txt
9version: 0.10.0
10*/
11
12/* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
13
14/**
15 * The Yahoo global namespace
16 * @constructor
17 */
18var YAHOO = window.YAHOO || {};
19
20/**
21 * Returns the namespace specified and creates it if it doesn't exist
22 *
23 * YAHOO.namespace("property.package");
24 * YAHOO.namespace("YAHOO.property.package");
25 *
26 * Either of the above would create YAHOO.property, then
27 * YAHOO.property.package
28 *
29 * @param {String} sNameSpace String representation of the desired
30 * namespace
31 * @return {Object} A reference to the namespace object
32 */
33YAHOO.namespace = function( sNameSpace ) {
34
35 if (!sNameSpace || !sNameSpace.length) {
36 return null;
37 }
38
39 var levels = sNameSpace.split(".");
40
41 var currentNS = YAHOO;
42
43 // YAHOO is implied, so it is ignored if it is included
44 for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {
45 currentNS[levels[i]] = currentNS[levels[i]] || {};
46 currentNS = currentNS[levels[i]];
47 }
48
49 return currentNS;
50};
51
52/**
53 * Global log method.
54 */
55YAHOO.log = function(sMsg,sCategory) {
56 if(YAHOO.widget.Logger) {
57 YAHOO.widget.Logger.log(null, sMsg, sCategory);
58 } else {
59 return false;
60 }
61};
62
63YAHOO.namespace("util");
64YAHOO.namespace("widget");
65YAHOO.namespace("example");
Note: See TracBrowser for help on using the repository browser.

© 2025 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette