e34016e9846cdb585f75e00bcadbf28bcf5eedc5.svn-base 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. if (!dojo._hasResource["dojo._base._loader.loader_debug"]) { // _hasResource
  2. // checks added
  3. // by build. Do
  4. // not use
  5. // _hasResource
  6. // directly in
  7. // your code.
  8. dojo._hasResource["dojo._base._loader.loader_debug"] = true;
  9. dojo.provide("dojo._base._loader.loader_debug");
  10. // Override dojo.provide, so we can trigger the next
  11. // script tag for the next local module. We can only add one
  12. // at a time because there are browsers that execute script tags
  13. // in the order that the code is received, and not in the DOM order.
  14. dojo.nonDebugProvide = dojo.provide;
  15. dojo.provide = function(resourceName) {
  16. var dbgQueue = dojo["_xdDebugQueue"];
  17. if (dbgQueue && dbgQueue.length > 0
  18. && resourceName == dbgQueue["currentResourceName"]) {
  19. // Set a timeout so the module can be executed into existence.
  20. // Normally the
  21. // dojo.provide call in a module is the first line. Don't want to
  22. // risk attaching
  23. // another script tag until the current one finishes executing.
  24. window.setTimeout(
  25. "dojo._xdDebugFileLoaded('" + resourceName + "')", 1);
  26. }
  27. return dojo.nonDebugProvide.apply(dojo, arguments);
  28. }
  29. dojo._xdDebugFileLoaded = function(resourceName) {
  30. var dbgQueue = this._xdDebugQueue;
  31. if (resourceName && resourceName == dbgQueue.currentResourceName) {
  32. dbgQueue.shift();
  33. }
  34. if (dbgQueue.length == 0) {
  35. dbgQueue.currentResourceName = null;
  36. this._xdNotifyLoaded();
  37. } else {
  38. dbgQueue.currentResourceName = dbgQueue[0].resourceName;
  39. var element = document.createElement("script");
  40. element.type = "text/javascript";
  41. element.src = dbgQueue[0].resourcePath;
  42. document.getElementsByTagName("head")[0].appendChild(element);
  43. }
  44. }
  45. }