1+function ($) { 2 'use strict'; 3 4var $document = $(document), 5 $window = $(window), 6 LI = window.LI ? window.LI : (window.LI = {}); 7 8$('html').removeClass('no-js'); 9 10// Debug console 11(function() { 12 if (!window.console) { 13 window.console = {}; 14 } 15 var m = ["log", "info", "warn", "error", "debug", "trace", "dir", "group", "groupCollapsed", "groupEnd", "time", "timeEnd", "profile", "profileEnd", "dirxml", "assert", "count", "markTimeline", "timeStamp", "clear"], 16 func = function() {}; 17 for (var i = 0, l = m.length; i < l; i++) { 18 if (!window.console[m[i]]) { 19 window.console[m[i]] = func; 20 } 21 } 22})(); 23 24// Main options 25LI.options = { 26 debug: false, 27 cookieRedirect: false 28}; 29 30// Injected data 31LI.data = window.LIDataObject || {}; 32 33// Cookie library 34LI.docCookies = { 35 getItem: function(sKey) { 36 return decodeURIComponent(document.cookie.replace(new RegExp("(?:(?:^|.*;)\\s*" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=\\s*([^;]*).*$)|^.*$"), "$1")) || null; 37 }, 38 setItem: function(sKey, sValue, vEnd, sPath, sDomain, bSecure) { 39 if (!sKey || /^(?:expires|max\-age|path|domain|secure)$/i.test(sKey)) { return false; } 40 var sExpires = ""; 41 if (vEnd) { 42 switch (vEnd.constructor) { 43 case Number: 44 sExpires = vEnd === Infinity ? "; expires=Fri, 31 Dec 9999 23:59:59 GMT" : "; max-age=" + vEnd; 45 break; 46 case String: 47 sExpires = "; expires=" + vEnd; 48 break; 49 case Date: 50 sExpires = "; expires=" + vEnd.toUTCString(); 51 break; 52 } 53 } 54 document.cookie = encodeURIComponent(sKey) + "=" + encodeURIComponent(sValue) + sExpires + (sDomain ? "; domain=" + sDomain : "") + (sPath ? "; path=" + sPath : "") + (bSecure ? "; secure" : ""); 55 return true; 56 }, 57 removeItem: function(sKey, sPath, sDomain) { 58 if (!sKey || !this.hasItem(sKey)) { 59 return false; 60 } 61 document.cookie = encodeURIComponent(sKey) + "=; expires=Thu, 01 Jan 1970 00:00:00 GMT" + ( sDomain ? "; domain=" + sDomain : "") + ( sPath ? "; path=" + sPath : ""); 62 return true; 63 }, 64 hasItem: function(sKey) { 65 return (new RegExp("(?:^|;\\s*)" + encodeURIComponent(sKey).replace(/[\-\.\+\*]/g, "\\$&") + "\\s*\\=")).test(document.cookie); 66 } 67}; 68 69// EventManager 70LI.eventManager = { 71 fire: function(func, funcname, args) { 72 if (!LI.events || !LI.events.length) { 73 return; 74 } 75 for (var i = 0, l = LI.events.length; i < l; i++) { 76 var namespace = LI.events[i]; 77 funcname = (funcname === undefined) ? 'init' : funcname; 78 if (namespace && func !== '' && namespace[func] && typeof namespace[func][funcname] === 'function') { 79 namespace[func][funcname](args); 80 } 81 } 82 }, 83 loadEvents: function() { 84 LI.eventManager.fire('common'); 85 $.each(document.body.className.replace(/-/g, '_').split(/\s+/), function(i, classnm) { 86 LI.eventManager.fire(classnm); 87 }); 88 LI.eventManager.fire('finalize'); 89 } 90}; 91LI.events = [{ 92 feature_fancybox: { 93 init: function() { 94 var thumbnails = $('a:has(img)').not('.nofancybox').filter(function() { 95 return /\.(jpe?g|png|gif|bmp)$/i.test($(this).attr('href')); 96 }); 97 var defaultSettings = { 98 helpers: { 99 overlay: { 100 locked: false 101 } 102 } 103 }; 104 var settings = LI.data.fancybox.settings; 105 if (settings instanceof Array && !settings.length) { 106 settings = {}; 107 } 108 settings = $.extend(defaultSettings, settings); 109 110 if (LI.data.fancybox) { 111 switch (LI.data.fancybox.galleryType) { 112 case 'single': 113 var index = 0; 114 thumbnails.each(function() { 115 var $this = $(this); 116 if (!$this.attr('rel')) { 117 index++; 118 $this.attr('rel', 'fancybox-single-' + index); 119 } 120 }); 121 break; 122 case 'post': 123 // Gallery type BY POST and we are on post or page (so only one post or page is visible) 124 if (LI.data.is_single || LI.data.is_page) { 125 thumbnails.each(function() { 126 var $this = $(this); 127 if (!$this.attr('rel')) { 128 $this.attr('rel', 'fancybox'); 129 } 130 }); 131 break; 132 } 133 // Gallery type BY POST, but we are neither on post or page, so we make a different rel attribute on each post 134 var posts = $('.post'); 135 posts.each(function() { 136 var self = this; 137 $(this).find(thumbnails).each(function() { 138 var $this = $(this); 139 if (!$this.attr('rel')) { 140 $this.attr('rel', 'fancybox-post-' + posts.index(self)); 141 } 142 }); 143 }); 144 break; 145 case 'all': 146 thumbnails.each(function() { 147 var $this = $(this); 148 if (!$this.attr('rel')) { 149 $this.attr('rel', 'fancybox'); 150 } 151 }); 152 break; 153 } 154 } 155 156 thumbnails.each(function() { 157 var $this = $(this), 158 title = $this.children('img').attr('title'); 159 if (!title || title == '') { 160 title = $this.children('img').attr('alt'); 161 } 162 $this.attr('title', title); 163 }); 164 165 thumbnails.addClass('fancybox').fancybox(settings); 166 } 167 } 168}]; 169 170// Safari cookie redirect 171window.onload = function() { 172 var href; 173 if (!LI.options.cookieRedirect || navigator.userAgent.indexOf('Safari') == -1 || navigator.userAgent.indexOf('Chrome') != -1) { 174 return; 175 } 176 if (top.location != document.location) { 177 if (document.cookie) { 178 return; 179 } 180 href = document.location.href; 181 href = (href.indexOf('?') == -1) ? href + '?' : href + '&'; 182 top.location.href = href + 'retref=' + encodeURIComponent(document.referrer); 183 } else { 184 document.cookie = 't=' + (new Date().getTime()); 185 href = document.location.href.indexOf('retref='); 186 if (href != -1) { 187 href = decodeURIComponent(document.location.href.substr(href + 7)); 188 window.location.replace(href); 189 } 190 } 191}; 192 193$document.ready(function() { 194 195 var $body = $('body'), 196 $navbar = $(".navbar-affix"), 197 navbarOffsetTop; 198 199 // Bootstrap navbar affix 200 if ($.fn.affix && $navbar.length) { 201 setTimeout(function() { 202 navbarOffsetTop = $navbar.offset().top; 203 $navbar.affix({ 204 offset: { 205 top: navbarOffsetTop 206 } 207 }); 208 }, 10); 209 } 210 211 // jquery.lazyload.js 212 if (LI.data.lazyload) { 213 $("img.lazy").lazyload(LI.data.lazyload); 214 } 215 216 // fire load events 217 LI.eventManager.loadEvents(); 218 219}); 220 221}(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.