mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
fix
This commit is contained in:
+3
-4
@@ -231,7 +231,7 @@ window.kit = window.kit || {};
|
||||
script.onerror = () => reject(new Error(`Ошибка загрузки скрипта ${src}`));
|
||||
document.head.append(script);
|
||||
} else {
|
||||
console.warn(`Скрип ${src} уже загружен`);
|
||||
global.config.debug && console.warn(`Скрип ${src} уже загружен`);
|
||||
resolve(script);
|
||||
}
|
||||
}).then(resolveCallback, rejectCallback);
|
||||
@@ -282,7 +282,7 @@ window.kit = window.kit || {};
|
||||
document.head.append(link);
|
||||
resolve(link);
|
||||
} else {
|
||||
console.warn(`Скрип ${src} уже загружен`);
|
||||
global.config.debug && console.warn(`Скрип ${src} уже загружен`);
|
||||
resolve(link);
|
||||
}
|
||||
});
|
||||
@@ -427,7 +427,7 @@ window.kit = window.kit || {};
|
||||
} else if(plugin.config.type === moduleTypeList.import && typeof plugin.config.module === 'string') {
|
||||
setGlobalExtension(pluginId, plugin.config.alias, (typeof module.exports === 'object' && module.exports.default !== undefined)?module.exports.default:module.exports);
|
||||
}
|
||||
console.log('PluginManager.install: plugin ' + pluginId + ' установлен');
|
||||
console.log('%cPluginManager.install: plugin ' + pluginId + ' установлен', "color: green;");
|
||||
plugin.state = stateList.installed;
|
||||
}.bind(this);
|
||||
|
||||
@@ -574,7 +574,6 @@ window.kit = window.kit || {};
|
||||
alias: 'pm',
|
||||
type: moduleTypeList.loader,
|
||||
loader: function(module, exports, require, global) {
|
||||
console.warn('global.config', JSON.stringify(global.config));
|
||||
global.config = global.config || {};
|
||||
global.config = Object.assign(defaultConfig, global.config);
|
||||
}
|
||||
|
||||
@@ -123,31 +123,22 @@ kit.PluginManager.registerPlugins({
|
||||
});
|
||||
|
||||
kit.exec([], function () {
|
||||
console.log('start init');
|
||||
|
||||
function _init(){
|
||||
console.log('_init');
|
||||
console.log('%ckit._init', 'color:#2053ff');
|
||||
kit.PluginManager.install('jquery');
|
||||
kit.PluginManager.install('toolkit');
|
||||
kit.PluginManager.install('tooltip');
|
||||
kit.PluginManager.install('bsCore');
|
||||
|
||||
}
|
||||
|
||||
if (/complete|interactive|loaded/.test(document.readyState)) {
|
||||
// In case the document has finished parsing, document's readyState will
|
||||
// be one of "complete", "interactive" or (non-standard) "loaded".
|
||||
console.log('1');
|
||||
_init();
|
||||
} else {
|
||||
console.log('2');
|
||||
// The document is not ready yet, so wait for the DOMContentLoaded event
|
||||
document.addEventListener("DOMContentLoaded", _init);
|
||||
}
|
||||
console.log('readyState', document.readyState);
|
||||
document.addEventListener("DOMContentLoaded", function () {
|
||||
console.log('DOMContentLoaded', document.readyState);
|
||||
});
|
||||
$(function(){
|
||||
console.log('$', document.readyState, typeof kit.toolkit);
|
||||
});
|
||||
});
|
||||
Reference in New Issue
Block a user