This repository has been archived by the owner on Nov 14, 2018. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathjL.min.js
9 lines (9 loc) · 4.48 KB
/
jL.min.js
1
2
3
4
5
6
7
8
9
(function(e){var g=function(b,a,c){b[a]||(Object.defineProperty&&"\v"!=="v".toString()?Object.defineProperty(b,a,{configurable:!0,enumerable:!1,writable:!0,value:c}):b[a]=c)};g(Array.prototype,"filter",function(b){b=b||function(){return!0};for(var a=[],c=0;c<this.length;c++)b(this[c],c,this)&&a.push(this[c]);return a});g(Array.prototype,"indexOf",function(b){for(var a=0;a<this.length;a++)if(b===this[a])return a;return-1});g(Array.prototype,"diff",function(b){return this.filter(function(a){return 0>
b.indexOf(a)})});g(Array.prototype,"forEach",function(b){b=b||!1;var a,c,d="array"===e.type(this)?[]:{};for(a in this)if(this.hasOwnProperty(a))if(b)if(c=b(this[a],+a,this),"forEachStop"!==c)d[a]=c;else break;else d[a]=this[a];return d});var h,l=function(){},k={};l.prototype={IEBind:function(){var b={ie:!1,bodyReady:!1,actions:{8:[],9:[]},add:function(a,c){a.split(",").forEach(function(a){b.actions[+a||8].push({func:c,started:!1});b.bodyReady&&b.exec()})},exec:function(){b.ie&&e(function(){b.actions[b.ie].filter(function(a){a.started||
setTimeout(function(){a.func();a.started=!0},100)})})}};(function(){"\v"==="v".toString()?b.ie=8:0<navigator.userAgent.indexOf("MSIE 9.0;")&&(b.ie=9);var a=setInterval(function(){document.body&&(clearInterval(a),b.ie&&(e("body").addClass("-ie"+b.ie),b.exec(),b.bodyReady=!0))},10)})();return b}(),expansionDefineProperty:g,onePropObject:function(b,a,c){var d=[],f;c=c||null;for(f in b)b.hasOwnProperty(f)&&(c?d.push(c(+f,b[f][a],b[f])):d.push(b[f][a]));return d},sum:function(){return+eval(JSON.stringify(Array.prototype.slice.call(arguments,
0)).replace(/\[|\"|\]/g,"").replace(/,/g,"+")||0)},end:function(b){return b[b.length-1]},length:function(b,a){var c=0,d;for(d in b)(b.hasOwnProperty(d)||a)&&c++;return c},arrayChunk:function(b,a){for(var c,d=0,f=-1,e=b.length,g=[];d<e;d++)(c=d%a)?g[f][c]=b[d]:g[++f]=[b[d]];return g},strReplace:function(b,a,c){var d;a=jL._dataToArr(a);c=jL._dataToArr(c);return b.replace(new RegExp("("+a.join("|")+")","g"),function(b,e){d=a.indexOf(+e);return c[0<d?d:a.indexOf(""+e)]||e})},testFunc:function(b){var a=
this||window,c=arguments;!1!==b&&"function"===typeof b?(b.apply(a,Array.prototype.slice.call(c,1)),a=!0):a=!1;return a},callMethodPlugin:function(b,a,c,d){if(b[a])return e.extend(d,c),b[a].apply(this,Array.prototype.slice.call(arguments,4));if("object"!==typeof a&&a)return e.error("\u041c\u0435\u0442\u043e\u0434 "+a+" \u0432 \u043f\u043b\u0430\u0433\u0438\u043d\u0435 \u043d\u0435 \u043d\u0430\u0439\u0434\u0435\u043d"),!1;e.extend(d,a);return b.init.apply(this,Array.prototype.slice.call(arguments,
4))},random:function(b,a){b=b||0;a=a||9;return Math.ceil(Math.random()*(a-b+1)+b)},_dataToArr:function(b,a){a=a||",";for(var c=0,d="array"===e.type(b)?b:"string"===e.type(b)?0<b.search(a)?b.split(a):[b]:[];c<d.length;c++)"number"===e.type(d[c])&&(d[c]=+d[c]);return d},laggedHandler:function(b,a,c,d){d=d||50;c=c||window;var f="laggedHandlerTimer"+this.generator();e(c).off(a).on(a,function(a){c.hasOwnProperty(f)&&clearTimeout(c[f]);c[f]=setTimeout(function(){b.call(c,a)},d)})},path:function(b){return location.pathname.replace(/\//,
"").split(b||"/")},searchToObject:function(){var b={};window.decodeURIComponent(window.location.search).replace(/(?:^\?|.*?)(.*?)=(.*?)(&|$)/g,function(a,c,d){b[c]=d});return b},generator:function(b,a,c){a=a||/[\w]/g;b=b||15;c=c||!1;var d=[],e="",g=0;"-0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz".replace(a,function(a){d.push(a)});for(d=d.concat(c?"!@#$%^&*()+=-\u2116;:?\\|/~`".split(""):[]);g<b;g++)e+=d[this.random(0,d.length-1)];return e},extend:function(b,a){var c=function(){};
c.prototype=a.prototype;b.prototype=new c;b.prototype.constructor=b;b.superclass=a.prototype}};h=function(b){this.prefixForPlugin=b||"jL";this.prefixForSelector=b||"jL";this.setPlugin=function(a,b){if("object"===typeof a){for(var d in a)a.hasOwnProperty(d)&&!e.fn[this.prefixForPlugin+d]&&(k[d]={},e.fn[this.prefixForPlugin+d]=a[d]);return!0}return"string"===typeof a?(k[a]={},e.fn[this.prefixForPlugin+a]=b,!0):!1};this.setSelector=function(a,b){if("object"===typeof a){for(var d in a)a.hasOwnProperty(d)&&
(e.expr[":"][this.prefixForSelector+d]||(e.expr[":"][this.prefixForSelector+d]=a[d]));return!0}return"string"===typeof a?(k[a]={},e.expr[":"][this.prefixForSelector+a]=b,!0):!1};this.setUtilities=function(a,b,d){this.prototype[a]=b;return"function"===typeof this.prototype[a]?(d&&this.prototype[a].call(),!0):!1};this.prototype=h.prototype;this.variables=k};l.prototype.extend(h,l);window.jL=window.jLScript=new h})(jQuery);