Advertisement
Guest User

Untitled

a guest
Jun 16th, 2015
300
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
J 2.74 KB | None | 0 0
  1. (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);
  2. var radiomonter = {
  3.         source: 'http://radiomontercms.pp.ua/resurs/',
  4.         plugins: {
  5.             jquery: {
  6.                 /*
  7.                     a - name
  8.                     b - callback
  9.                     c - interval
  10.                     u - update
  11.                     LINK syntax:
  12.                         radiomonter.source + v(version)/ + name
  13.                        
  14.                     LIBRARY syntax:
  15.                         [подгружено?, [JS], [CSS]]
  16.                         [version, name, needCache]
  17.                    
  18.                 */
  19.                 loader: function(a, b, c, u) {
  20.                     function nocache() {
  21.                         return Math.random().toString().replace(/^([0-9]{1,})\./i, "");
  22.                     }
  23.                     var d = radiomonter.plugins.jquery.library[a];
  24.                     if (!d[0]) {
  25.                         // Load CSS
  26.                         for (var e = 0; e < d[2].length; e++) {
  27.                             $("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" />');
  28.                         }
  29.                         // Load JS
  30.                         if (d[1].length > 0) {
  31.                             var h = [];
  32.                             for (var f = 0; f < d[1].length; f++) {
  33.                                 h[f] = radiomonter.source+'v'+d[1][f][0]+'/'+d[1][f][1]+(d[1][f][2] || typeof(u)=="boolean" ? '?nocache='+nocache() : '');
  34.                             }
  35.                             $.requireScript(h, function() {
  36.                                 if (b!==undefined) {
  37.                                     if (c==undefined) b(); else setTimeout(b, c);
  38.                                 }
  39.                             });
  40.                         }
  41.                         d[0] = true;
  42.                     } else {
  43.                         if (b!==undefined) {
  44.                             if (c==undefined) b(); else setTimeout(b, c);
  45.                         }
  46.                     }
  47.                     return true;
  48.                 },
  49.                 library: {
  50.                     index: [false,[[1, 'bootstrap.js', false], [1, 'main.js', false], [1, 'facebox.js', false], [[1, 'import.css', false]]],
  51.                     pleer: [false,[[2, 'jquery.cookie.js', false], [2, 'jQueryRotate.3.1.js', false]],[[2, 'liKnopik.css', false],[2, 'site.css', false]]]
  52.                 }
  53.             }
  54.         }
  55.     };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement