diff --git a/assets/scripts/ExternalScriptLoader/Providers/googleMaps.js b/assets/scripts/ExternalScriptLoader/Providers/googleMaps.js deleted file mode 100644 index 7260601fe..000000000 --- a/assets/scripts/ExternalScriptLoader/Providers/googleMaps.js +++ /dev/null @@ -1,18 +0,0 @@ -import $ from 'jquery' - -let status - -export function init (options) { - if (!status) { - const apiKey = options.apiKey - const callback = `googleMaps_${Date.now()}` - const url = `https://maps.googleapis.com/maps/api/js?key=${apiKey}&callback=${callback}` - status = new Promise((resolve, reject) => { - window[callback] = () => { - resolve() - } - }) - $.getScript(url) - } - return status -} diff --git a/assets/scripts/ExternalScriptLoader/index.js b/assets/scripts/ExternalScriptLoader/index.js deleted file mode 100644 index f4c8e2929..000000000 --- a/assets/scripts/ExternalScriptLoader/index.js +++ /dev/null @@ -1,33 +0,0 @@ -const providers = {} - -// load all files from ./Providers folder into providers variable -function importAll (moduleRequire) { - moduleRequire.keys().forEach(key => { - providers[key.substr(2, key.length - 5)] = moduleRequire(key).init - }) -} -importAll(require.context('./Providers/', true, /\.js$/)) - -let instance - -class ExternalScriptLoader { - constructor () { - if (!instance) { - instance = this - } - return instance - } - - static getInstance () { - return instance || new ExternalScriptLoader() - } - - initialize (type, options = {}) { - if (!this[type]) { - this[type] = providers[type](options) - } - return this[type] - } -} - -window.FlyntExternalScriptLoader = ExternalScriptLoader