You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

provide.js 531 B

13 vuotta sitten
14 vuotta sitten
14 vuotta sitten
14 vuotta sitten
11 vuotta sitten
14 vuotta sitten
14 vuotta sitten
123456789101112131415161718192021222324
  1. // Copyright (c) 2013, Web Notes Technologies Pvt. Ltd. and Contributors
  2. // MIT License. See license.txt
  3. // provide a namespace
  4. if(!window.wn)wn = {}
  5. wn.provide = function(namespace) {
  6. // docs: create a namespace //
  7. var nsl = namespace.split('.');
  8. var parent = window;
  9. for(var i=0; i<nsl.length; i++) {
  10. var n = nsl[i];
  11. if(!parent[n]) {
  12. parent[n] = {}
  13. }
  14. parent = parent[n];
  15. }
  16. return parent;
  17. }
  18. wn.provide("locals");
  19. wn.provide("wn.settings");
  20. wn.provide("wn.utils");
  21. wn.provide("wn.ui");
  22. wn.provide("wn.modules");