1/** 2 * Created by pelmen on 14.01.14. 3 */ 4(function ($) { 5 $.solution.script = function () { 6 var _parent = arguments[0] || document; 7 this.parent = function () { 8 return _parent; 9 }; 10 }; 11 12 $.solution.fn.script = function () { 13 return new $.solution.script(this); 14 }; 15 16 $.solution.script.fn = $.solution.script.prototype; 17 18 $.solution.script.fn.load = function () { 19 var _sC = [], _fC = []; 20 $.each(this.parent().parent(), function () { 21 if ($.trim(this.src) == '') { 22 _sC.push(this.innerHTML); 23 } else { 24 if ($.inArray(this.src, $.solution.script.stack) == -1) { 25 _fC.push(this.src); 26 $.solution.script.stack.push(this.src); 27 } 28 } 29 }); 30 if (_fC.length > 0) { 31 var _fCi = 0, _gsCb = undefined, _aCache = $.ajaxSettings.cache, _aAsync = $.ajaxSettings.async; 32 $.ajaxSetup({cache: false, async: false}); 33 $.each(_fC, function () { 34 _fCi++; 35 if (_fCi == _fC.length) 36 _gsCb = function () { 37 $.solution.script.eval(_sC); 38 _sC = []; 39 }; 40 $.getScript(this instanceof String ? this.toString() : this, _gsCb); 41 }); 42 $.ajaxSetup({cache: _aCache, async: _aAsync}); 43 _fC = []; 44 } else { 45 $.solution.script.eval(_sC); 46 _sC = []; 47 } 48 }; 49 50 $.solution.script.fn.loadCss = function () { 51 var _h = document.getElementsByTagName("head")[0]; 52 $.each(this.parent().parent(), function () { 53 if ($.inArray(this.href, $.solution.script.cssStack) == -1) { 54 $.solution.script.cssStack.push(this.href); 55 _h.appendChild(this); 56 } 57 }); 58 }; 59 60 $.solution.script.stack = window._globalJSList || []; 61 $.solution.script.cssStack = window._globalCSSList || []; 62 63 $.solution.script.eval = function (s) { 64 if (typeof s == 'object' && s.length > 0) 65 for (var i = 0; i < s.length; i++) 66 $.solution.script.eval(s[i]); 67 else if (typeof s == 'string') 68 eval($.trim(s.replace('/*<![CDATA[*/', '').replace('/*]]>*/', ''))); 69 }; 70 71 $(function () { 72 $('script[src]').each(function () { 73 $.solution.script.stack.push(this.src); 74 }); 75 $('link[rel="stylesheet"]').each(function () { 76 $.solution.script.cssStack.push(this.href); 77 }); 78 }); 79})(jQuery);
Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.