scripts/loader-src.js
/**
     * Start load or inject content. If the requested script is not available in the localStorage
     * it will be loaded from the provided url. If the script is present in the localStorage
     * it will be injected into the DOM.
     * @param {string} scriptname identifier of the script in the local cache
     * */
Start load or inject content. If the requested script is not available in the localStorage
it will be loaded from the provided url. If the script is present in the localStorage
it will be injected into the DOM.
@param {string} scriptname identifier of the script in the local cache
Start load or inject content . If the requested script is not available in the localStorage it will be loaded from the provided url . If the script is present in the localStorage it will be injected into the DOM . @param { string } scriptname identifier of the script in the local cache
requireScript(scriptname) {
        let version = this.scripts[scriptname].version;
        let url = this.scripts[scriptname].url;
        let cache = this.scripts[scriptname].cache;
        let content = localStorage.getItem(scriptname);
        if (content && cache !== this.cacheUseVariant.noCache) {
             if content persist in localStorage and cache caching is possible
            this.injectScript(content, url, scriptname, version, cache);
        } else {
             else load and cache script if need
            this.loadScript(url, scriptname, cache, version);
        }
    }
requireScript ( scriptname ) { let version = this . scripts [ scriptname ] . version ; let url = this . scripts [ scriptname ] . url ; let cache = this . scripts [ scriptname ] . cache ; let content = localStorage . getItem ( scriptname ) ; if ( content && cache !== this . cacheUseVariant . noCache ) { this . injectScript ( content , url , scriptname , version , cache ) ; } else { this . loadScript ( url , scriptname , cache , version ) ; } }
Start load or inject content.
Start load or inject content .
// /** version string that is used to check if the script needs to be updated
         * @type {string} */ /** `path/to/script.js` that should be caced; can be local (or cross domain with CORS header allowing cross domain access)
         * @type {string} */ /** If for requested script cache is not required
         * @type {number} */ /** content from local Storage
         * @type {string|null} */ // if content persist in localStorage and cache caching is possible // else load and cache script if need