gouguInit.js 876 B

12345678910111213141516171819202122232425262728293031323334353637
  1. window.rootPath = (function (src) {
  2. src = document.currentScript
  3. ? document.currentScript.src
  4. : document.scripts[document.scripts.length - 1].src;
  5. return src.substring(0, src.lastIndexOf("/") + 1);
  6. })();
  7. window.rootVersion = (function (src) {
  8. src = document.currentScript
  9. ? document.currentScript.src
  10. : document.scripts[document.scripts.length - 1].src;
  11. return src.split('?v=')[1];
  12. })();
  13. if (typeof $ == "undefined") {
  14. window.jQuery = layui.jquery;
  15. window.$ = layui.jquery;
  16. }
  17. if (typeof moduleInit == "undefined") {
  18. window.moduleInit = [];
  19. }
  20. var module = {};
  21. if (moduleInit.length > 0) {
  22. for (var i = 0; i < moduleInit.length; i++) {
  23. module[moduleInit[i]] = moduleInit[i];
  24. }
  25. }
  26. layui.config({
  27. base: rootPath + "module/",
  28. version: rootVersion
  29. }).extend(module).use(moduleInit, function () {
  30. if (typeof gouguInit === 'function') {
  31. gouguInit();
  32. }
  33. });