Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- (function($){var scripts=[];function loadScript(url,callback,context){var script=scripts[url]||(scripts[url]={loaded:false,callbacks:[]});if(script.loaded){return callback.apply(context)}script.callbacks.push({fn:callback,context:context});if(script.callbacks.length==1){$.ajax({type:'GET',url:url,dataType:'script',cache:true,success:function(){script.loaded=true;$.each(script.callbacks,function(){this.fn.apply(this.context)});script.callbacks.length=0}})}}$.requireScript=function(url,callback,context,options){if(typeof options==='undefined'&&context&&context.hasOwnProperty('parallel')){options=context;context=window}options=$.extend({parallel:true},options);if(!$.isArray(url)){return loadScript(url,callback,context)}var counter=0;if(options.parallel){return $.each(url,function(){loadScript(this,function(){if(++counter==url.length){callback.apply(context)}})})}(function(){if(counter==url.length){return callback.apply(context)}loadScript(url[counter++],arguments.callee)})()};$.requireScript.registerLoaded=function(url){$.each($.makeArray(url),function(){(scripts[url]||(scripts[url]={})).loaded=true})}})(jQuery);
- var radiomonter = {
- source: 'http://radiomontercms.pp.ua/resurs/',
- plugins: {
- jquery: {
- /*
- a - name
- b - callback
- c - interval
- u - update
- LINK syntax:
- radiomonter.source + v(version)/ + name
- LIBRARY syntax:
- [подгружено?, [JS], [CSS]]
- [version, name, needCache]
- */
- loader: function(a, b, c, u) {
- function nocache() {
- return Math.random().toString().replace(/^([0-9]{1,})\./i, "");
- }
- var d = radiomonter.plugins.jquery.library[a];
- if (!d[0]) {
- // Load CSS
- for (var e = 0; e < d[2].length; e++) {
- $("head").append('<link upacket="'+a+'" href="'+radiomonter.source+'v'+d[2][e][0]+'/'+d[2][e][1]+(d[2][e][2] || typeof(u)=="boolean" ? '?nocache='+nocache() : '')+'" rel="stylesheet" />');
- }
- // Load JS
- if (d[1].length > 0) {
- var h = [];
- for (var f = 0; f < d[1].length; f++) {
- h[f] = radiomonter.source+'v'+d[1][f][0]+'/'+d[1][f][1]+(d[1][f][2] || typeof(u)=="boolean" ? '?nocache='+nocache() : '');
- }
- $.requireScript(h, function() {
- if (b!==undefined) {
- if (c==undefined) b(); else setTimeout(b, c);
- }
- });
- }
- d[0] = true;
- } else {
- if (b!==undefined) {
- if (c==undefined) b(); else setTimeout(b, c);
- }
- }
- return true;
- },
- library: {
- index: [false,[[1, 'bootstrap.js', false], [1, 'main.js', false], [1, 'facebox.js', false], [[1, 'import.css', false]]],
- pleer: [false,[[2, 'jquery.cookie.js', false], [2, 'jQueryRotate.3.1.js', false]],[[2, 'liKnopik.css', false],[2, 'site.css', false]]]
- }
- }
- }
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement