PageRenderTime 81ms CodeModel.GetById 48ms RepoModel.GetById 10ms app.codeStats 0ms

/Base/MVCUIHtmlHelper/MVCUIHtmlHelper.Web/Content/js/dhtmlx/dhtmlxGrid/codebase/calendar/YAHOO.js

#
JavaScript | 60 lines | 19 code | 14 blank | 27 comment | 5 complexity | 65f29b8250b1c1c773eeab7faf5e69d3 MD5 | raw file
  1. /* Copyright (c) 2006 Yahoo! Inc. All rights reserved. */
  2. /**
  3. * @class The Yahoo global namespace
  4. */
  5. var YAHOO = function() {
  6. return {
  7. /**
  8. * Yahoo presentation platform utils namespace
  9. */
  10. util: {},
  11. /**
  12. * Yahoo presentation platform widgets namespace
  13. */
  14. widget: {},
  15. /**
  16. * Yahoo presentation platform examples namespace
  17. */
  18. example: {},
  19. /**
  20. * Returns the namespace specified and creates it if it doesn't exist
  21. *
  22. * YAHOO.namespace("property.package");
  23. * YAHOO.namespace("YAHOO.property.package");
  24. *
  25. * Either of the above would create YAHOO.property, then
  26. * YAHOO.property.package
  27. *
  28. * @param {String} sNameSpace String representation of the desired
  29. * namespace
  30. * @return {Object} A reference to the namespace object
  31. */
  32. namespace: function( sNameSpace ) {
  33. if (!sNameSpace || !sNameSpace.length) {
  34. return null;
  35. }
  36. var levels = sNameSpace.split(".");
  37. var currentNS = YAHOO;
  38. // YAHOO is implied, so it is ignored if it is included
  39. for (var i=(levels[0] == "YAHOO") ? 1 : 0; i<levels.length; ++i) {
  40. currentNS[levels[i]] = currentNS[levels[i]] || {};
  41. currentNS = currentNS[levels[i]];
  42. }
  43. return currentNS;
  44. }
  45. };
  46. } ();