mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
235 lines
6.9 KiB
JavaScript
235 lines
6.9 KiB
JavaScript
__PluginManager__.registerPlugins({
|
|
menu: {
|
|
path: __pmConfig__.assetsPath + '/menu',
|
|
module: '/menu.js',
|
|
css: [
|
|
'/menu.css'
|
|
],
|
|
type: 'loader',
|
|
deps: ['lib', 'align', 'dataStructures', 'animations', 'userAction', 'Collection', 'support', 'ActionCollection', 'Action', 'Viewer']
|
|
},
|
|
lib: {
|
|
path: __pmConfig__.assetsPath + '/lib',
|
|
module: '/lib.js',
|
|
type: 'loader',
|
|
},
|
|
align: {
|
|
path: __pmConfig__.assetsPath + '/align',
|
|
module: '/align.js',
|
|
type: 'loader',
|
|
deps: ['support']
|
|
},
|
|
support: {
|
|
path: __pmConfig__.assetsPath + '/support',
|
|
module: '/support.js',
|
|
type: 'loader',
|
|
},
|
|
jquery: {
|
|
path: __pmConfig__.assetsPath + '/jquery',
|
|
module: '/jquery.min.js',
|
|
type: 'loader',
|
|
alias: '$',
|
|
},
|
|
popper: {
|
|
path: __pmConfig__.assetsPath + '/popper',
|
|
alias: 'popper.js',
|
|
module: '/popper.js',
|
|
type: 'loader',
|
|
css: '/popper.css',
|
|
},
|
|
bsCore: {
|
|
path: __pmConfig__.assetsPath + '/bsCore',
|
|
module: '/bsCore.js',
|
|
type: 'loader',
|
|
css: [
|
|
'/bsCore.css'
|
|
]
|
|
},
|
|
bsToast: {
|
|
path: __pmConfig__.assetsPath + '/bsToast',
|
|
module: '/bsToast.js',
|
|
type: 'loader',
|
|
deps: ['bsCore'],
|
|
},
|
|
bsToastService: {
|
|
path: __pmConfig__.assetsPath + '/bsToastService',
|
|
module: '/bsToastService.js',
|
|
type: 'loader',
|
|
css: [
|
|
'/bsToastService.css'
|
|
],
|
|
deps: ['bsToast', 'support', 'Collection'],
|
|
},
|
|
Tooltip: {
|
|
path: __pmConfig__.assetsPath + '/tooltip',
|
|
module: '/tooltip.js',
|
|
type: 'loader',
|
|
css: '/tooltip.css',
|
|
onInstall: function(){
|
|
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
|
|
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
|
|
return new __pmGlobal__.Tooltip(tooltipTriggerEl, {sanitize: false});
|
|
});
|
|
},
|
|
deps: ['popper', 'bsCore'],
|
|
},
|
|
Popover: {
|
|
path: __pmConfig__.assetsPath + '/popover',
|
|
module: '/popover.js',
|
|
type: 'loader',
|
|
css: '/popover.css',
|
|
onInstall: function(){
|
|
var popoverTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="popover"]'));
|
|
var popoverList = popoverTriggerList.map(function (popoverTriggerEl) {
|
|
return new __pmGlobal__.Popover(popoverTriggerEl);
|
|
});
|
|
},
|
|
deps: ['popper', 'bsCore', 'Tooltip'],
|
|
},
|
|
mask: {
|
|
path: __pmConfig__.assetsPath + '/mask',
|
|
module: '/mask.js',
|
|
type: 'loader',
|
|
deps: ['jquery'],
|
|
},
|
|
toolkit: {
|
|
path: __pmConfig__.assetsPath + '/toolkit',
|
|
module: '/toolkit.js',
|
|
type: 'loader',
|
|
css: ['/toolkit.css'],
|
|
deps: ['jquery', 'mask'],
|
|
},
|
|
Modal: {
|
|
path: __pmConfig__.assetsPath + '/modal',
|
|
module: '/modal.js',
|
|
type: 'loader',
|
|
css: [
|
|
'/modal.css',
|
|
],
|
|
deps: ['bsCore'],
|
|
onRegister: function (plugin) {
|
|
plugin.onLoadConditionHandler = function (event) {
|
|
if(event.target && event.target.dataset && event.target.dataset.bsTarget && event.target.dataset.bsToggle === 'modal') {
|
|
kit.exec(plugin.id, function(){
|
|
var newEvent = new Event("click");
|
|
event.target.dispatchEvent(newEvent);
|
|
});
|
|
}
|
|
};
|
|
window.addEventListener('click', plugin.onLoadConditionHandler, false);
|
|
},
|
|
onInstall: function (plugin) {
|
|
if(plugin.onLoadConditionHandler) {
|
|
window.removeEventListener('click', plugin.onLoadConditionHandler, false);
|
|
}
|
|
},
|
|
},
|
|
collapse: {
|
|
path: __pmConfig__.assetsPath + '/collapse',
|
|
module: '/collapse.js',
|
|
type: 'loader',
|
|
css: [
|
|
'/collapse.css',
|
|
],
|
|
deps: ['bsCore'],
|
|
onRegister: function (plugin) {
|
|
//kit.PluginManager.install('collapse')
|
|
},
|
|
onInstall: function (plugin) {
|
|
},
|
|
},
|
|
datepicker: {
|
|
path: __pmConfig__.assetsPath + '/datepicker',
|
|
module: '/js/datepicker.js',
|
|
type: 'loader',
|
|
css: [
|
|
'/css/datepicker.css',
|
|
],
|
|
deps: ['jquery'],
|
|
onRegister: function (plugin) {
|
|
//kit.PluginManager.install(plugin.id)
|
|
},
|
|
onInstall: function (plugin) {
|
|
},
|
|
},
|
|
cookie: {
|
|
path: __pmConfig__.assetsPath + '/cookie',
|
|
module: '/cookie.js',
|
|
type: 'loader',
|
|
},
|
|
animations: {
|
|
path: __pmConfig__.assetsPath + '/animations',
|
|
css: '/animations.css',
|
|
module: '/animations.js',
|
|
type: 'loader',
|
|
},
|
|
Collection: {
|
|
path: __pmConfig__.assetsPath + '/collection',
|
|
module: '/collection.js',
|
|
type: 'loader',
|
|
deps: ['support'],
|
|
},
|
|
dataStructures: {
|
|
path: __pmConfig__.assetsPath + '/dataStructures',
|
|
module: '/dataStructures.js',
|
|
type: 'loader',
|
|
},
|
|
userAction: {
|
|
path: __pmConfig__.assetsPath + '/userAction',
|
|
module: '/userAction.js',
|
|
type: 'loader',
|
|
deps: ['support', 'ActionCollection', 'Action', 'Viewer'],
|
|
},
|
|
Viewer: {
|
|
path: __pmConfig__.assetsPath + '/Viewer',
|
|
module: '/Viewer.js',
|
|
type: 'loader',
|
|
deps: ['Collection', 'support', 'ActionCollection', 'Action'],
|
|
},
|
|
ActionCollection: {
|
|
path: __pmConfig__.assetsPath + '/ActionCollection',
|
|
module: '/ActionCollection.js',
|
|
type: 'loader',
|
|
deps: ['Collection', 'support', 'Action'],
|
|
},
|
|
Action: {
|
|
path: __pmConfig__.assetsPath + '/Action',
|
|
module: '/Action.js',
|
|
type: 'loader',
|
|
deps: ['support'],
|
|
},
|
|
date: {
|
|
path: __pmConfig__.assetsPath + '/date',
|
|
module: '/date.js',
|
|
type: 'loader',
|
|
deps: [],
|
|
},
|
|
testing: {
|
|
path: __pmConfig__.assetsPath + '/testing',
|
|
module: '/testing.js',
|
|
type: 'loader',
|
|
deps: ['Logger'],
|
|
},
|
|
Logger: {
|
|
path: __pmConfig__.assetsPath + '/logger',
|
|
module: '/logger.js',
|
|
css: '/logger.css',
|
|
type: 'loader',
|
|
},
|
|
|
|
});
|
|
|
|
__pmConfig__.debug && (function(){
|
|
console.log('%ckit.reg', 'color:#2053ff');
|
|
document.addEventListener("DOMContentLoaded", function () {
|
|
console.log('%cDOMContentLoaded', 'color:#2053ff');
|
|
});
|
|
__PluginManager__.exec(function () {
|
|
console.log('%ckit.exec', 'color:#2053ff');
|
|
});
|
|
}());
|
|
__PluginManager__.ready(__pmConfig__.autoloadPluginList, function () {
|
|
__pmConfig__.debug && (function() {
|
|
console.log('%ckit.ready', 'color:#2053ff');
|
|
}());
|
|
}); |