Files
kit/assets/jquery/proxy/jquery-proxy.min.js
T
2026-05-31 13:36:28 +03:00

1 line
1.2 KiB
JavaScript

__PluginManager__.register("jQueryProxy",function(require,exports,module,global){var init=function(c,prop="$",args=[]){c.push([prop,args]);return new Proxy({},{get(target,prop){return function(){return init(c,prop,arguments)}}})};var J=function(){if(!J.init){J.init=true;__PluginManager__.ready("jQuery")}var c=[];J.queue.push(c);return init(c,"$",arguments)};J.queue=[];J.init=false;function JQueryProxy(){}JQueryProxy.prototype.J=J;JQueryProxy.prototype.hasJQuery=function(){return window.hasOwnProperty("jQuery")&&window.jQuery.hasOwnProperty("fn")};JQueryProxy.prototype.hasJQueryIniter=function(){return window.hasOwnProperty("jQuery")&&Object.is(window.jQuery,J)};JQueryProxy.prototype.onJQueryRegister=function(plugin){if(!this.hasJQuery()){(function(w){w.$=w.jQuery=J;plugin.module.initer=J})(window)}};JQueryProxy.prototype.onJQueryInstall=function(plugin){var self=this;if(!plugin.module.initer){return}(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){try{root=root[c[0]].apply(root,c[1])}catch(e){console.warn(ch,e);break}}}}})(window)};module.exports=new JQueryProxy});