1// modal trigger 2$('#block---video [rel="modal:open"]').click(function() { 3 var $this = $(this); 4 var $modalInPost = $this.closest('#block---video').find('#---video'); 5 $modalInPost.modal({ 6 backdrop: 'static' 7 }); 8 9 $('.modal-backdrop.in').css({ 10 zIndex: 100000 11 }); 12 $('.modal.in').css({ 13 zIndex: 110000, 14 cursor: 'auto' 15 }); 16 $('#---video.in figure').css({ 17 position: "relative", 18 top: ($(window).height() - $('#---video.in figure').outerHeight()) / 2, 19 maxHeight: 500, 20 maxWidth: 878, 21 margin: "0 35px" 22 }).append('<span id="close----video" onmouseover="this.style.fontWeight=\'bold\';" onmouseout="this.style.fontWeight=\'normal\';" style="position: absolute;z-index: 10000;color: #fff;font-size: 36px;display: block;top: -14px;right: -23px;cursor: pointer;">×</span>'); 23 $('#---video').on('click', '#close----video', function() { 24 $modalInPost.modal('hide'); 25 }); 26 27}); 28 29 30// lazyload 31$(function() { 32 var defaults = { 33 src: "data-src", 34 srcset: "data-srcset", 35 selector: ".lazyload", 36 root: null, 37 rootMargin: "0px", 38 threshold: 0 39 }; 40 var extend = function() { 41 var extended = {}; 42 var deep = false; 43 var i = 0; 44 var length = arguments.length; 45 if (Object.prototype.toString.call(arguments[0]) === "[object Boolean]") { 46 deep = arguments[0]; 47 i++ 48 } 49 var merge = function(obj) { 50 for (var prop in obj) { 51 if (Object.prototype.hasOwnProperty.call(obj, prop)) { 52 if (deep && Object.prototype.toString.call(obj[prop]) === "[object Object]") { 53 extended[prop] = extend(true, extended[prop], obj[prop]) 54 } else { 55 extended[prop] = obj[prop] 56 } 57 } 58 } 59 }; 60 for (; i < length; i++) { 61 var obj = arguments[i]; 62 merge(obj) 63 } 64 return extended 65 }; 66 67 68 function LazyLoad(images, options) { 69 this.settings = extend(defaults, options || {}); 70 this.images = images || document.querySelectorAll(this.settings.selector); 71 this.observer = null; 72 this.init() 73 } 74 LazyLoad.prototype = { 75 init: function() { 76 if (!window.IntersectionObserver) { 77 this.loadImages(); 78 return 79 } 80 var self = this; 81 var observerConfig = { 82 root: this.settings.root, 83 rootMargin: this.settings.rootMargin, 84 threshold: [this.settings.threshold] 85 }; 86 this.observer = new IntersectionObserver(function(entries) { 87 Array.prototype.forEach.call(entries, function(entry) { 88 if (entry.isIntersecting) { 89 self.observer.unobserve(entry.target); 90 var src = entry.target.getAttribute(self.settings.src); 91 var srcset = entry.target.getAttribute(self.settings.srcset); 92 if ("img" === entry.target.tagName.toLowerCase()) { 93 if (src) { 94 entry.target.src = src 95 } 96 if (srcset) { 97 entry.target.srcset = srcset 98 } 99 } else { 100 entry.target.style.backgroundImage = "url(" + src + ")" 101 } 102 } 103 }) 104 }, observerConfig); 105 Array.prototype.forEach.call(this.images, function(image) { 106 self.observer.observe(image) 107 }) 108 }, 109 loadAndDestroy: function() { 110 if (!this.settings) { 111 return 112 } 113 this.loadImages(); 114 this.destroy() 115 }, 116 loadImages: function() { 117 if (!this.settings) { 118 return 119 } 120 var self = this; 121 Array.prototype.forEach.call(this.images, function(image) { 122 var src = image.getAttribute(self.settings.src); 123 var srcset = image.getAttribute(self.settings.srcset); 124 if ("img" === image.tagName.toLowerCase()) { 125 if (src) { 126 image.src = src 127 } 128 if (srcset) { 129 image.srcset = srcset 130 } 131 } else { 132 image.style.backgroundImage = "url('" + src + "')" 133 } 134 }) 135 }, 136 destroy: function() { 137 if (!this.settings) { 138 return 139 } 140 this.observer.disconnect(); 141 this.settings = null 142 } 143 }; 144 var lazyload = function(images, options) {
145 return new LazyLoad(images, options) 146 }; 147 $.fn.lazyload = function(options) { 148 options = options || {}; 149 options.attribute = options.attribute || "data-src"; 150 new LazyLoad($.makeArray(this), options); 151 return this 152 }; 153 $("img.lazyload").lazyload(); 154 155}); 156 157$(function() { 158 if ($('[data-theme="4"]').length > 0) { 159 var pathname = __gc.pathname; 160 var $currentLink = $('#sidebar .panel a[href*="' + pathname + '"]'); 161 162 $currentLink && $currentLink.closest('.panel-group').find('.panel li').removeClass('active') && $currentLink.closest('li').addClass('active').closest('.panel').find('.panel-heading > [data-toggle="collapse"]').trigger('click'); 163 } 164});
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.