Files
kit/assets/core/core.register.js
T
2024-05-14 16:06:06 +03:00

383 lines
12 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']
},
flexKit: {
path: __pmConfig__.assetsPath + '/flex-kit',
css: '/flex-kit.css'
},
support: {
path: __pmConfig__.assetsPath + '/support',
module: '/support.js',
type: 'loader',
},
jquery: {
path: __pmConfig__.assetsPath + '/jquery',
module: '/jquery.min.js',
type: 'loader',
alias: ['$', 'jQuery'],
autoRequire: true,
},
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(plugin){
var tooltipTriggerList = [].slice.call(document.querySelectorAll('[data-bs-toggle="tooltip"]'));
var tooltipList = tooltipTriggerList.map(function (tooltipTriggerEl) {
return __pmGlobal__.Tooltip.getOrCreateInstance(tooltipTriggerEl, {sanitize: false});
});
},
deps: ['popper', 'bsCore'],
},
Tooltip2: {
path: __pmConfig__.assetsPath + '/tooltip2',
module: '/tooltip2.js',
type: 'loader',
css: '/tooltip2.css',
onInstall: function(plugin){
console.log('tt2 install');
document.addEventListener('mouseover', function(event) {
// console.log(event);
// console.log(event.target);
if(!(event.target && event.target.dataset.kitTooltip2 === 'autoload')) {
return;
}
// console.log(1);
if(kit.support.getNodeData(event.target, 'tooltip2')){
return;
}
// console.log(2);
var tooltip = new __pmGlobal__.Tooltip2(event.target);
tooltip.run();
tooltip.show();
});
// var elements = [].slice.call(document.querySelectorAll('[data-kit-tooltip2="autoload"]'));
// elements.map(function (element) {
// var tooltip = new __pmGlobal__.Tooltip2(element);
// tooltip.run();
// console.log(tooltip);
// });
},
deps: ['Viewer', 'support', 'ActionCollection', 'Action', 'userAction', 'align', 'Collection', 'animations'],
},
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', 'support'],
},
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: ['log'],
},
log: {
path: __pmConfig__.assetsPath + '/log',
module: '/log.js',
css: '/log.css',
type: 'loader',
deps: ['support', 'Collection', 'lib']
},
fancybox: {
path: __pmConfig__.assetsPath + '/fancybox',
css: '/fancybox.css',
js: '/fancybox.umd.js',
},
lightGallery: {
path: __pmConfig__.assetsPath + '/lightGallery',
css: '/lightGallery.css',
js: '/lightGallery.js',
deps: ['jQuery'],
},
owlCarousel: {
path: __pmConfig__.assetsPath + '/owlCarousel',
css: '/owlCarousel.css',
js: '/owlCarousel.js',
deps: ['jQuery'],
},
Chosen: {
path: __pmConfig__.assetsPath + '/chosen',
css: '/chosen.css',
js: '/chosen.jquery.js',
deps: ['jQuery'],
onRegister: function (module) {
}
},
makeCSSAnimations: {
path: __pmConfig__.assetsPath + '/makeCSSAnimations',
js: '/makeCSSAnimations.js',
deps: ['jQuery', 'support'],
},
mCustomScrollbar: {
path: __pmConfig__.assetsPath + '/mCustomScrollbar',
alias: 'malihu-custom-scrollbar-plugin',
js: '/mCustomScrollbar.js',
css: '/jquery.mCustomScrollbar.css',
deps: ['jQuery', 'jqueryMousewheel'],
onInstall: function (plugin) {
plugin.module.exports(kit.require('jQuery'));
}
},
jqueryMousewheel: {
path: __pmConfig__.assetsPath + '/jqueryMousewheel',
alias: 'jquery-mousewheel',
js: '/jquery.mousewheel.js',
deps: ['jQuery'],
onInstall: function (plugin) {
plugin.module.exports(kit.require('jQuery'));
}
},
jqueryLazy: {
path: __pmConfig__.assetsPath + '/jquery-lazy',
alias: 'jquery-lazy',
js: [
'/jquery.lazy.min.js',
'/jquery.lazy.plugins.min.js',
],
deps: ['jQuery'],
},
slickCarousel: {
path: __pmConfig__.assetsPath + '/slickCarousel',
alias: ['slick', 'slick-carousel'],
js: '/slick.min.js',
css: [
'/slick.css',
'/slick-theme.css',
],
deps: ['jQuery'],
},
mustache: {
path: __pmConfig__.assetsPath + '/mustache',
alias: ['mustache.js'],
js: '/mustache.js',
deps: [],
},
bxSlider: {
path: __pmConfig__.assetsPath + '/bxSlider',
module: '/jquery.bxslider.min.js',
css: [
'/jquery.bxslider.min.css',
],
type: 'import',
deps: ['jQuery'],
},
selectric: {
path: __pmConfig__.assetsPath + '/selectric',
module: '/jquery.selectric.min.js',
css: [
'/selectric.css',
],
type: 'import',
alias: ['jquerySelectric'],
deps: ['jQuery'],
},
jBox: {
path: __pmConfig__.assetsPath + '/jBox',
module: '/jBox.min.js',
css: [
'/jBox.min.css',
],
type: 'import',
deps: ['jQuery'],
},
intlTelInput: {
path: __pmConfig__.assetsPath + '/intl-tel-input',
module: '/js/intlTelInput.min.js',
css: [
'/css/intlTelInput.min.css',
],
type: 'import',
alias: ['intl-tel-input'],
},
});
__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');
}());
});