mirror of
https://bitbucket.org/bellord13/kit.git
synced 2026-11-13 19:06:11 +03:00
v2
This commit is contained in:
@@ -0,0 +1,425 @@
|
||||
var __PluginManagerConfigHandler__ = function() {
|
||||
var root = __pmConfig__.assetsPath;
|
||||
return {
|
||||
menu: {
|
||||
path: root + '/menu',
|
||||
module: '/menu.js',
|
||||
css: [
|
||||
'/menu.css'
|
||||
],
|
||||
type: 'HMD',
|
||||
deps: ['lib', 'align', 'dataStructures', 'animations', 'userAction', 'Collection', 'support', 'ActionCollection', 'Action', 'Viewer']
|
||||
},
|
||||
lib: {
|
||||
path: root + '/lib',
|
||||
module: '/lib.js',
|
||||
type: 'HMD',
|
||||
},
|
||||
align: {
|
||||
path: root + '/align',
|
||||
module: '/align.js',
|
||||
type: 'HMD',
|
||||
deps: ['support']
|
||||
},
|
||||
flexKit: {
|
||||
path: root + '/flex-kit',
|
||||
css: '/flex-kit.css'
|
||||
},
|
||||
support: {
|
||||
path: root + '/support',
|
||||
module: '/support.js',
|
||||
type: 'HMD',
|
||||
},
|
||||
jqueryIniter: {
|
||||
type: 'HMD',
|
||||
handler: function(require, exports, module, global){
|
||||
var J = function (){
|
||||
var c = [];
|
||||
J.queue.push(c);
|
||||
c.push(['$', arguments]);
|
||||
var J2 = function(){}
|
||||
J2.ready = function (){
|
||||
c.push(['ready', arguments]);
|
||||
}
|
||||
return J2
|
||||
}
|
||||
J.queue = [];
|
||||
|
||||
function JQueryIniter(){}
|
||||
JQueryIniter.prototype.J = J;
|
||||
JQueryIniter.prototype.hasJQuery = function(){
|
||||
return window.hasOwnProperty('jQuery') && window.jQuery.hasOwnProperty('fn');
|
||||
};
|
||||
JQueryIniter.prototype.hasJQueryIniter = function(){
|
||||
return window.hasOwnProperty('jQuery') && Object.is(window.jQuery, J);
|
||||
};
|
||||
JQueryIniter.prototype.onRegister = function(plugin){
|
||||
if(!this.hasJQuery()){
|
||||
(function(w){
|
||||
w.$ = w.jQuery = J;
|
||||
plugin.module.initer = J;
|
||||
})(window);
|
||||
}
|
||||
};
|
||||
JQueryIniter.prototype.onInstall = function(plugin){
|
||||
var self = this;
|
||||
(function(w){
|
||||
var q = plugin.module.initer.queue;
|
||||
if(self.hasJQueryIniter()){
|
||||
w.$ = w.jQuery = plugin.module.exports;
|
||||
for (var ch of q){
|
||||
var root = w;
|
||||
for (var c of ch){
|
||||
root = root[c[0]].apply(c[0], c[1]);
|
||||
}
|
||||
}
|
||||
}
|
||||
})(window);
|
||||
};
|
||||
|
||||
module.exports = new JQueryIniter();
|
||||
|
||||
},
|
||||
},
|
||||
jquery: {
|
||||
path: root + '/jquery',
|
||||
module: '/jquery.min.js',
|
||||
type: 'UMD',
|
||||
alias: ['$', 'jQuery'],
|
||||
onRegister: function (plugin) {
|
||||
console.log('reg jq');
|
||||
var initer = kit.require('jqueryIniter');
|
||||
initer.onRegister(plugin);
|
||||
},
|
||||
onInstall: function(plugin){
|
||||
var initer = kit.require('jqueryIniter');
|
||||
initer.onInstall(plugin);
|
||||
},
|
||||
},
|
||||
popper: {
|
||||
path: root + '/popper',
|
||||
alias: 'popper.js',
|
||||
module: '/popper.js',
|
||||
type: 'HMD',
|
||||
css: '/popper.css',
|
||||
},
|
||||
bsCore: {
|
||||
path: root + '/bsCore',
|
||||
module: '/bsCore.js',
|
||||
type: 'HMD',
|
||||
css: [
|
||||
'/bsCore.css'
|
||||
]
|
||||
},
|
||||
bsToast: {
|
||||
path: root + '/bsToast',
|
||||
module: '/bsToast.js',
|
||||
type: 'HMD',
|
||||
deps: ['bsCore'],
|
||||
},
|
||||
bsToastService: {
|
||||
path: root + '/bsToastService',
|
||||
module: '/bsToastService.js',
|
||||
type: 'HMD',
|
||||
css: [
|
||||
'/bsToastService.css'
|
||||
],
|
||||
deps: ['bsToast', 'support', 'Collection'],
|
||||
},
|
||||
Tooltip: {
|
||||
path: root + '/tooltip',
|
||||
module: '/tooltip.js',
|
||||
type: 'HMD',
|
||||
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: root + '/tooltip2',
|
||||
module: '/tooltip2.js',
|
||||
type: 'HMD',
|
||||
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: root + '/popover',
|
||||
module: '/popover.js',
|
||||
type: 'HMD',
|
||||
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: root + '/mask',
|
||||
module: '/mask.js',
|
||||
type: 'HMD',
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
toolkit: {
|
||||
path: root + '/toolkit',
|
||||
module: '/toolkit.js',
|
||||
type: 'HMD',
|
||||
css: ['/toolkit.css'],
|
||||
deps: ['jQuery', 'mask', 'support'],
|
||||
},
|
||||
Modal: {
|
||||
path: root + '/modal',
|
||||
module: '/modal.js',
|
||||
type: 'HMD',
|
||||
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: root + '/collapse',
|
||||
module: '/collapse.js',
|
||||
type: 'HMD',
|
||||
css: [
|
||||
'/collapse.css',
|
||||
],
|
||||
deps: ['bsCore'],
|
||||
},
|
||||
datepicker: {
|
||||
path: root + '/datepicker',
|
||||
module: '/js/datepicker.js',
|
||||
type: 'HMD',
|
||||
css: [
|
||||
'/css/datepicker.css',
|
||||
],
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
cookie: {
|
||||
path: root + '/cookie',
|
||||
module: '/cookie.js',
|
||||
type: 'HMD',
|
||||
},
|
||||
animations: {
|
||||
path: root + '/animations',
|
||||
css: '/animations.css',
|
||||
module: '/animations.js',
|
||||
type: 'HMD',
|
||||
},
|
||||
Collection: {
|
||||
path: root + '/collection',
|
||||
module: '/collection.js',
|
||||
type: 'HMD',
|
||||
deps: ['support'],
|
||||
},
|
||||
dataStructures: {
|
||||
path: root + '/dataStructures',
|
||||
module: '/dataStructures.js',
|
||||
type: 'HMD',
|
||||
},
|
||||
userAction: {
|
||||
path: root + '/userAction',
|
||||
module: '/userAction.js',
|
||||
type: 'HMD',
|
||||
deps: ['support', 'ActionCollection', 'Action', 'Viewer'],
|
||||
},
|
||||
Viewer: {
|
||||
path: root + '/Viewer',
|
||||
module: '/Viewer.js',
|
||||
type: 'HMD',
|
||||
deps: ['Collection', 'support', 'ActionCollection', 'Action'],
|
||||
},
|
||||
ActionCollection: {
|
||||
path: root + '/ActionCollection',
|
||||
module: '/ActionCollection.js',
|
||||
type: 'HMD',
|
||||
deps: ['Collection', 'support', 'Action'],
|
||||
},
|
||||
Action: {
|
||||
path: root + '/Action',
|
||||
module: '/Action.js',
|
||||
type: 'HMD',
|
||||
deps: ['support'],
|
||||
},
|
||||
date: {
|
||||
path: root + '/date',
|
||||
module: '/date.js',
|
||||
type: 'HMD',
|
||||
deps: [],
|
||||
},
|
||||
testing: {
|
||||
path: root + '/testing',
|
||||
module: '/testing.js',
|
||||
type: 'module',
|
||||
deps: ['log'],
|
||||
},
|
||||
log: {
|
||||
path: root + '/log',
|
||||
module: '/log.js',
|
||||
css: '/log.css',
|
||||
type: 'HMD',
|
||||
deps: ['support', 'Collection', 'lib']
|
||||
},
|
||||
fancybox: {
|
||||
path: root + '/fancybox',
|
||||
css: '/fancybox.css',
|
||||
js: '/fancybox.umd.js',
|
||||
},
|
||||
lightGallery: {
|
||||
path: root + '/lightGallery',
|
||||
css: '/lightGallery.css',
|
||||
js: '/lightGallery.js',
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
owlCarousel: {
|
||||
path: root + '/owlCarousel',
|
||||
css: '/owlCarousel.css',
|
||||
js: '/owlCarousel.js',
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
Chosen: {
|
||||
path: root + '/chosen',
|
||||
css: '/chosen.css',
|
||||
js: '/chosen.jquery.js',
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
makeCSSAnimations: {
|
||||
path: root + '/makeCSSAnimations',
|
||||
js: '/makeCSSAnimations.js',
|
||||
deps: ['jQuery', 'support'],
|
||||
},
|
||||
mCustomScrollbar: {
|
||||
path: root + '/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: root + '/jqueryMousewheel',
|
||||
alias: 'jquery-mousewheel',
|
||||
js: '/jquery.mousewheel.js',
|
||||
deps: ['jQuery'],
|
||||
onInstall: function (plugin) {
|
||||
plugin.module.exports(kit.require('jQuery'));
|
||||
}
|
||||
},
|
||||
jqueryLazy: {
|
||||
path: root + '/jquery-lazy',
|
||||
alias: 'jquery-lazy',
|
||||
js: [
|
||||
'/jquery.lazy.min.js',
|
||||
'/jquery.lazy.plugins.min.js',
|
||||
],
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
slickCarousel: {
|
||||
path: root + '/slickCarousel',
|
||||
alias: ['slick', 'slick-carousel'],
|
||||
js: '/slick.min.js',
|
||||
css: [
|
||||
'/slick.css',
|
||||
'/slick-theme.css',
|
||||
],
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
mustache: {
|
||||
path: root + '/mustache',
|
||||
alias: ['mustache.js'],
|
||||
js: '/mustache.js',
|
||||
deps: [],
|
||||
},
|
||||
bxSlider: {
|
||||
path: root + '/bxSlider',
|
||||
module: '/jquery.bxslider.min.js',
|
||||
css: [
|
||||
'/jquery.bxslider.min.css',
|
||||
],
|
||||
type: 'import',
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
selectric: {
|
||||
path: root + '/selectric',
|
||||
module: '/jquery.selectric.min.js',
|
||||
css: [
|
||||
'/selectric.css',
|
||||
],
|
||||
type: 'import',
|
||||
alias: ['jquerySelectric'],
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
jBox: {
|
||||
path: root + '/jBox',
|
||||
module: '/jBox.min.js',
|
||||
css: [
|
||||
'/jBox.min.css',
|
||||
],
|
||||
type: 'import',
|
||||
deps: ['jQuery'],
|
||||
},
|
||||
intlTelInput: {
|
||||
path: root + '/intl-tel-input',
|
||||
module: '/js/intlTelInput.min.js',
|
||||
css: [
|
||||
'/css/intlTelInput.min.css',
|
||||
],
|
||||
type: 'import',
|
||||
alias: ['intl-tel-input'],
|
||||
},
|
||||
autoComplete: {
|
||||
path: root + '/autoComplete',
|
||||
module: '/autoComplete.min.js',
|
||||
css: [
|
||||
'/css/autoComplete.css',
|
||||
],
|
||||
type: 'HMD',
|
||||
},
|
||||
};
|
||||
};
|
||||
Reference in New Issue
Block a user