forked from zhurui/management
1 line
6.9 KiB
JSON
1 line
6.9 KiB
JSON
{"remainingRequest":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js!C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\Tinymce\\dynamicLoadScript.js","dependencies":[{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\Tinymce\\dynamicLoadScript.js","mtime":1622443089431},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\cache-loader\\dist\\cjs.js","mtime":499162500000},{"path":"C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\node_modules\\babel-loader\\lib\\index.js","mtime":499162500000}],"contextDependencies":[],"result":["import \"core-js/modules/es7.symbol.async-iterator\";\nimport \"core-js/modules/es6.symbol\";\nimport \"core-js/modules/web.dom.iterable\";\nvar callbacks = [];\n\nfunction loadedTinymce() {\n // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144\n // check is successfully downloaded script\n return window.tinymce;\n}\n\nvar dynamicLoadScript = function dynamicLoadScript(src, callback) {\n var existingScript = document.getElementById(src);\n\n var cb = callback || function () {};\n\n if (!existingScript) {\n var script = document.createElement('script');\n script.src = src; // src url for the third-party library being loaded.\n\n script.id = src;\n document.body.appendChild(script);\n callbacks.push(cb);\n var onEnd = 'onload' in script ? stdOnEnd : ieOnEnd;\n onEnd(script);\n }\n\n if (existingScript && cb) {\n if (loadedTinymce()) {\n cb(null, existingScript);\n } else {\n callbacks.push(cb);\n }\n }\n\n function stdOnEnd(script) {\n script.onload = function () {\n // this.onload = null here is necessary\n // because even IE9 works not like others\n this.onerror = this.onload = null;\n\n for (var _i = 0, _callbacks = callbacks; _i < _callbacks.length; _i++) {\n var _cb = _callbacks[_i];\n\n _cb(null, script);\n }\n\n callbacks = null;\n };\n\n script.onerror = function () {\n this.onerror = this.onload = null;\n cb(new Error('Failed to load ' + src), script);\n };\n }\n\n function ieOnEnd(script) {\n script.onreadystatechange = function () {\n if (this.readyState !== 'complete' && this.readyState !== 'loaded') return;\n this.onreadystatechange = null;\n var _iteratorNormalCompletion = true;\n var _didIteratorError = false;\n var _iteratorError = undefined;\n\n try {\n for (var _iterator = callbacks[Symbol.iterator](), _step; !(_iteratorNormalCompletion = (_step = _iterator.next()).done); _iteratorNormalCompletion = true) {\n var _cb2 = _step.value;\n\n _cb2(null, script); // there is no way to catch loading errors in IE8\n\n }\n } catch (err) {\n _didIteratorError = true;\n _iteratorError = err;\n } finally {\n try {\n if (!_iteratorNormalCompletion && _iterator.return != null) {\n _iterator.return();\n }\n } finally {\n if (_didIteratorError) {\n throw _iteratorError;\n }\n }\n }\n\n callbacks = null;\n };\n }\n};\n\nexport default dynamicLoadScript;",{"version":3,"sources":["C:\\Users\\27446\\Desktop\\up\\front\\dkha-web-sz-main\\src\\components\\Tinymce\\dynamicLoadScript.js"],"names":["callbacks","loadedTinymce","window","tinymce","dynamicLoadScript","src","callback","existingScript","document","getElementById","cb","script","createElement","id","body","appendChild","push","onEnd","stdOnEnd","ieOnEnd","onload","onerror","Error","onreadystatechange","readyState"],"mappings":";;;AAAA,IAAIA,SAAS,GAAG,EAAhB;;AAEA,SAASC,aAAT,GAAyB;AACvB;AACA;AACA,SAAOC,MAAM,CAACC,OAAd;AACD;;AAED,IAAMC,iBAAiB,GAAG,SAApBA,iBAAoB,CAACC,GAAD,EAAMC,QAAN,EAAmB;AAC3C,MAAMC,cAAc,GAAGC,QAAQ,CAACC,cAAT,CAAwBJ,GAAxB,CAAvB;;AACA,MAAMK,EAAE,GAAGJ,QAAQ,IAAI,YAAW,CAAE,CAApC;;AAEA,MAAI,CAACC,cAAL,EAAqB;AACnB,QAAMI,MAAM,GAAGH,QAAQ,CAACI,aAAT,CAAuB,QAAvB,CAAf;AACAD,IAAAA,MAAM,CAACN,GAAP,GAAaA,GAAb,CAFmB,CAEF;;AACjBM,IAAAA,MAAM,CAACE,EA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AiB;;AAC1BA,UAAAA,IAAE,CAAC,IAAD,EAAOC,MAAP,CAAF,CAD0B,CACT;;AAClB;AALoC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;AAMrCX,MAAAA,SAAS,GAAG,IAAZ;AACD,KAPD;AAQD;AACF,CAhDD;;AAkDA,eAAeI,iBAAf","sourcesContent":["let callbacks = []\n\nfunction loadedTinymce() {\n // to fixed https://github.com/PanJiaChen/vue-element-admin/issues/2144\n // check is successfully downloaded script\n return window.tinymce\n}\n\nconst dynamicLoadScript = (src, callback) => {\n const existingScript = document.getElementById(src)\n const cb = callback || function() {}\n\n if (!existingScript) {\n const script = document.createElement('script')\n script.src = src // src url for the third-party library being loaded.\n script.id = src\n document.body.appendChild(script)\n callbacks.push(cb)\n const onEnd = 'onload' in script ? stdOnEnd : ieOnEnd\n onEnd(script)\n }\n\n if (existingScript && cb) {\n if (loadedTinymce()) {\n cb(null, existingScript)\n } else {\n callbacks.push(cb)\n }\n }\n\n function stdOnEnd(script) {\n script.onload = function() {\n // this.onload = null here is necessary\n // because even IE9 works not like others\n this.onerror = this.onload = null\n for (const cb of callbacks) {\n cb(null, script)\n }\n callbacks = null\n }\n script.onerror = function() {\n this.onerror = this.onload = null\n cb(new Error('Failed to load ' + src), script)\n }\n }\n\n function ieOnEnd(script) {\n script.onreadystatechange = function() {\n if (this.readyState !== 'complete' && this.readyState !== 'loaded') return\n this.onreadystatechange = null\n for (const cb of callbacks) {\n cb(null, script) // there is no way to catch loading errors in IE8\n }\n callbacks = null\n }\n }\n}\n\nexport default dynamicLoadScript\n"]}]} |