popup.js 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. var CORE_FILES = [
  2. "scopeVariable.js",
  3. /** common library */
  4. "lib/txlib.js",
  5. "lib/hyperscript.js",
  6. "lib/template.js",
  7. "lib/dgetty.js",
  8. "lib/xgetty.js",
  9. "lib/rubber.js",
  10. /** trex engine & config */
  11. "trex/trex.js",
  12. "trex/config.js",
  13. "trex/event.js",
  14. /** trex library */
  15. "trex/lib/markup.js",
  16. "trex/lib/domutil.js",
  17. "trex/lib/utils.js",
  18. /** trex mixins */
  19. "trex/mixins/ajax.js",
  20. "trex/mixins/observable.js",
  21. /** trex common */
  22. "popuputil.js"
  23. ];
  24. try {
  25. var urlParams = {};
  26. (function () {
  27. var e,
  28. a = /\+/g, // Regex for replacing addition symbol with a space
  29. r = /([^&=]+)=?([^&]*)/g,
  30. d = function (s) {
  31. return decodeURIComponent(s.replace(a, " "));
  32. },
  33. q = window.location.search.substring(1);
  34. while (e = r.exec(q))
  35. urlParams[d(e[1])] = d(e[2]);
  36. })();
  37. if (urlParams.xssDomain) {
  38. document.domain = urlParams.xssDomain;
  39. }
  40. } catch (e) {
  41. // ignore error when loaded from build script
  42. }
  43. try {
  44. var basePath = opener.EditorJSLoader.getJSBasePath();
  45. } catch (e) {
  46. // ignore error when loaded from build script
  47. }
  48. for (var i = 0; i < CORE_FILES.length; i++) {
  49. if (CORE_FILES[i]) {
  50. var src = basePath + CORE_FILES[i] + '?v=' + new Date().getTime();
  51. document.write('<script type="text/javascript" src="' + src + '" charset="utf-8"></script>');
  52. }
  53. }