o.js 1.1 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950
  1. /**
  2. * o.js
  3. *
  4. * Copyright 2013, Moxiecode Systems AB
  5. * Released under GPL License.
  6. *
  7. * License: http://www.plupload.com/license
  8. * Contributing: http://www.plupload.com/contributing
  9. */
  10. /*global moxie:true */
  11. /**
  12. Globally exposed namespace with the most frequently used public classes and handy methods.
  13. @class o
  14. @static
  15. @private
  16. */
  17. (function(exports) {
  18. "use strict";
  19. var o = {}, inArray = exports.moxie.core.utils.Basic.inArray;
  20. // directly add some public classes
  21. // (we do it dynamically here, since for custom builds we cannot know beforehand what modules were included)
  22. (function addAlias(ns) {
  23. var name, itemType;
  24. for (name in ns) {
  25. itemType = typeof(ns[name]);
  26. if (itemType === 'object' && !~inArray(name, ['Exceptions', 'Env', 'Mime'])) {
  27. addAlias(ns[name]);
  28. } else if (itemType === 'function') {
  29. o[name] = ns[name];
  30. }
  31. }
  32. })(exports.moxie);
  33. // add some manually
  34. o.Env = exports.moxie.core.utils.Env;
  35. o.Mime = exports.moxie.core.utils.Mime;
  36. o.Exceptions = exports.moxie.core.Exceptions;
  37. // expose globally
  38. exports.mOxie = o;
  39. if (!exports.o) {
  40. exports.o = o;
  41. }
  42. return o;
  43. })(this);