PageSourceSearch

https://www.whatiftheworld.com/wp-content/themes/witw/js/plugins.js

js whatiftheworld.com collected 2026-10-02 06:36:06 UTC 32,071 bytes, 277 lines download raw bytes

1// Avoid `console` errors in browsers that lack a console.
2(function() {
3    var method;
4    var noop = function () {};
5    var methods = [
6        'assert', 'clear', 'count', 'debug', 'dir', 'dirxml', 'error',
7        'exception', 'group', 'groupCollapsed', 'groupEnd', 'info', 'log',
8        'markTimeline', 'profile', 'profileEnd', 'table', 'time', 'timeEnd',
9        'timeStamp', 'trace', 'warn'
10    ];
11    var length = methods.length;
12    var console = (window.console = window.console || {});
13
14    while (length--) {
15        method = methods[length];
16
17        // Only stub undefined methods.
18        if (!console[method]) {
19            console[method] = noop;
20        }
21    }
22}());
23
24
25
26/*
27 * WordPress Ajax Load More
28 * https://github.com/dcooney/wordpress-ajax-load-more
29 *
30 * Copyright 2014 Connekt Media - http://cnkt.ca/ajax-load-more/
31 * Free to use under the GPLv2 license.
32 * http://www.gnu.org/licenses/gpl-2.0.html
33 *
34 * Author: Darren Cooney
35 * Twitter: @KaptonKaos
36 */
37var page = 0;
38(function (jQuery) {
39    "use strict";
40    var AjaxLoadMore = {};
41
42    //Set vars
43    var speed = 300,
44        $init = true,
45        $loading = true,
46        $finished = false,
47        $window = $(window),
48        $button_text = '',
49        $data,
50        $el = jQuery('#ajax-load-more'),
51        $content = jQuery('#ajax-load-more ul'),
52        $delay = 150,
53        $scroll = true,
54		$prefix = '_ajax_load_',
55        $path = $content.attr('data-path'),
56        $max_pages = $content.attr('data-max-pages'),
57        $layout = $content.attr('data-layout'),
58        $transition = $content.attr('data-transition'),
59        $offset = $content.attr('data-offset');
60    
61	page = ($content.attr('data-page') ? $content.attr('data-page') : 1);
62
63    AjaxLoadMore.init = function () {
64        // Bug fix: Prevent loading of unnessasry posts by moving the user to top of page
65        jQuery('html').scrollTop(0);
66
67        // ** EDIT THIS PATH **
68        // Path to theme folder
69        if ($path === undefined) {
70            $path = './wp-content/themes/your-theme-name';
71        }
72
73        // Max numbe rof pages to load while scrolling
74        if ($max_pages === undefined) {
75            $max_pages = 5;
76        }
77
78        // Max numbe rof pages to load while scrolling
79        if ($transition === undefined) {
80            $transition = 'slide';
81        } else if ($transition === "fade") {
82            $transition = 'fade';
83        } else {
84            $transition = 'slide';
85        }
86
87        // Define button text
88        if ($content.attr('data-button-text') === undefined) {
89            $button_text = 'Older Posts';
90        } else {
91            $button_text = $content.attr('data-button-text');
92        }
93
94        // Define on Scroll event
95        if ($content.attr('data-scroll') === undefined) {
96            $scroll = true;
97        } else if ($content.attr('data-scroll') === "false") {
98            $scroll = false;
99        } else {
100            $scroll = true;
101        }
102
103        // Add load more button
104        $el.append('<div class="load-more-btn-wrap"><button id="load-more" data-display-posts="12" class="more gotham-med">' + $button_text + '</button></div>');
105        var $button = jQuery('#load-more');
106
107        // if($content.attr('data-display-posts')) {
108        //   var numPosts = $content.attr('data-display-posts');
109        // }
110        // console.log(numPosts);
111
112        jQuery('#load-more').text("Loading...");
113        // Load posts function
114
115        AjaxLoadMore.loadPosts = function () {
116            $button.addClass('loading');
117			var requestData = {
118				artist: $content.attr('data-artist'),
119				postType: $content.attr('data-post-type'),
120				category: $content.attr('data-category'),
121				author: $content.attr('data-author'),
122				taxonomy: $content.attr('data-taxonomy'),
123				tag: $content.attr('data-tag'),
124				search: $content.attr('data-search'),
125				postNotIn: $content.attr('data-post-not-in'),
126				numPosts: $content.attr('data-display-posts'),
127				offset: $offset,
128				pageNumber: page,
129				online: $content.attr('data-online'),
130				layout: $content.attr('data-layout'),
131			};
132            jQuery.ajax({
133                type: "GET",
134                data: requestData,
135                dataType: "html", // parse the data as html
136                url: $path + "/ajax-load-more.php",
137                beforeSend: function () {
138                    if (page != 1) {
139                        $button.addClass('loading');
140                    }
141                },
142                success: function (data) {
143                    $data = jQuery(data); // Convert data to an object
144                    console.log($data);
145                    if ($init) {
146                        $button.text($button_text);
147                        $init = false;
148                    }
149                    if ($data.length > 0) {
150                      if(!$content.attr('data-offset') && $content.attr('data-display-posts')) {
151						  console.log(1);
152                        $offset = $content.attr('data-display-posts');
153                      }
154                      if($content.attr('data-layout') == 'grid' && (page > 1) || (page == 1 && $offset > 0)) {
155						console.log(2);
156                        if((data.match(/<div class="exhibition">/g) || []).length < 12) {
157                          $button.addClass('done');
158                        }
159                        $loading = false;
160                      	// $content.children('.'+$prefix+'reveal').append($data);
161						var $el = $('.'+$prefix+'reveal');
162                      	$el.append($data);				
163                      } else {
164						 console.log(3);
165                        var $el = $('<div class="'+$prefix+'reveal"/>');
166                      	$el.append($data);
167                      	$el.hide();
168                      	$content.append($el);
169
170                        if($transition === 'fade'){// Fade transition
171  	                    	$el.fadeIn(speed, 'alm_easeInOutQuad', function(){
172  		                    	$loading = false;
173  	                            $button.delay(speed).removeClass('loading');
174  	                            // if ($data.length < $content.attr('data-display-posts')) {
175  	                            if ($data.length < requestData.numPosts) {
176  	                                $finished = true;
177  	                                $button.addClass('done');
178  	                            }
179  	                    	});
180                      	}else{// Slide transition
181  	                    	$el.slideDown(speed, 'alm_easeInOutQuad', function(){
182  		                    	$loading = false;
183  	                            $button.delay(speed).removeClass('loading');
184  	                            // if ($data.length < $content.attr('data-display-posts')) {
185  	                            if ($data.length < requestData.numPosts) {
186  	                                $finished = true;
187  	                                $button.addClass('done');
188  	                            }
189  	                    	});
190                      	}
191                      }
192                    } else {
193                        $button.delay(speed).removeClass('loading').addClass('done');
194                        $loading = false;
195                        $finished = true;
196                    }
197                },
198                error: function (jqXHR, textStatus, errorThrown) {
199                    $loading = false;
200                    $button.removeClass('loading');
201                    //alert(jqXHR + " :: " + textStatus + " :: " + errorThrown);
202                }
203            });
204        }
205
206        setTimeout(function() {
207          if($button.attr('data-display-posts')) {
208            $content.attr('data-display-posts', $button.attr('data-display-posts'));
209          }
210        }, 2000);
211
212        $button.click(function () {
213          console.log('click');
214          console.log($loading);
215          console.log($finished);
216          console.log($(this).hasClass('done'));
217            if (!$loading && !$finished && !$(this).hasClass('done')) {
218              console.log('load');
219                $loading = true;
220                page++;
221                AjaxLoadMore.loadPosts();
222            }
223        });
224
225        if ($scroll) {
226            $window.scroll(function () {
227                var content_offset = $button.offset();
228                if (!$loading && !$finished && $window.scrollTop() >= Math.round(content_offset.top - ($window.height() - 150)) && page < $max_pages) {
229                    $loading = true;
230                    page++;
231                    AjaxLoadMore.loadPosts();
232                }
233            });
234        }
235        AjaxLoadMore.loadPosts();
236    }
237
238    //Init Ajax load More
239    if (jQuery("#ajax-load-more").length) {
240        //Check if file exists and path is correct
241        jQuery.ajax({
242            type: 'HEAD',
243            url: $path + '/ajax-load-more.php', //or your url
244            complete: function (e, d) {
245                if (e.status == 404) { // Not found
246                    //alert("Could not locate ajax-load-more, please check your file path.");
247                    console.log("Could not locate ajax-load-more, please check your file path.");
248                } else { // Found!
249                    AjaxLoadMore.init();
250                }
251            }
252        })
253    }
254
255    //Custom easing function
256    jQuery.easing.alm_easeInOutQuad = function (x, t, b, c, d) {
257		if ((t/=d/2) < 1) return c/2*t*t + b;
258		return -c/2 * ((--t)*(t-2) - 1) + b;
259	}
260
261})(jQuery);
262
263/* DropKick */
264(function(t,e,i){"use strict";var n=navigator.userAgent.match(/MSIE ([0-9]{1,}[\.0-9]{0,})/),a=!!n,d=a&&parseFloat(n[1])<7,r=navigator.userAgent.match(/iPad|iPhone|Android|IEMobile|BlackBerry/i),o=a?"mousedown":"click",l="onwheel"in e?"wheel":"onmousewheel"in i?"mousewheel":"MouseScrollEvent"in e&&"DOMMouseScroll MozMousePixelScroll",s={fired:!1,fire:function(){t(i).on(o,".dk_options a",function(){var e=t(this),i=e.parent(),n=e.parents(".dk_container").first();return i.hasClass("disabled")||i.closest(".dk_optgroup",n).hasClass("disabled")||(i.hasClass("dk_option_current")||(b(e,n),$(e.parent(),n)),m(n)),!1}).on(l,".dk_options_inner",function(t){var e=t.originalEvent.wheelDelta||-t.originalEvent.deltaY||-t.originalEvent.detail;return a?(this.scrollTop-=Math.round(e/10),!1):e>0&&this.scrollTop<=0||0>e&&this.scrollTop>=this.scrollHeight-this.offsetHeight?!1:!0}).on({"keydown.dk_nav":function(t){var e=v||_;e&&A(t,e)},click:function(e){var i,n=t(e.target);if(v&&0===n.closest(".dk_container").length)m(v);else{if(n.is(".dk_toggle, .dk_label"))return i=n.parents(".dk_container").first(),i.hasClass("dk_open")?m(i):(v&&m(v),!i.attr("disabled")&&x(i,e)),!1;n.attr("for")&&t("#dk_container_"+n.attr("for"))[0]&&t("#dk_container_"+n.attr("for")).trigger("focus.dropkick")}}}),this.fired=!0}},p={},c=[],f={left:37,up:38,right:39,down:40,enter:13,tab:9,zero:48,z:90,last:221},u=['<div class="dk_container" id="dk_container_{{ id }}" tabindex="{{ tabindex }}" aria-hidden="true">','<a class="dk_toggle dk_label">{{ label }}</a>','<div class="dk_options">','<ul class="dk_options_inner" role="main" aria-hidden="true">',"</ul>","</div>","</div>"].join(""),h='<li class="{{ current }}{{ disabled }}"><a data-dk-dropdown-value="{{ value }}">{{ text }}</a></li>',k='<li class="dk_optgroup{{ disabled }}"><span>{{ text }}</span>',g={startSpeed:400,theme:!1,changes:!1,syncReverse:!0,nativeMobile:!0,autoWidth:!0},v=null,_=null,b=function(t,e,i){var n=e.data("dropkick"),a=n.$select,d=t.length?t:n.$original,r=d.attr("data-dk-dropdown-value")||t.attr("value"),o=d.text();e.find(".dk_label").html(o?o:"&nbsp;"),i?a.val(r):a.val(r).trigger("change"),n.settings.change&&!i&&!n.settings.syncReverse&&n.settings.change.call(a,r,o)},m=function(t){t.removeClass("dk_open dk_open_top"),v=null},C=function(i){if(i.data("dropkick").settings.fixedMove)return"up"==i.data("dropkick").settings.fixedMove?!1:!0;var n=i.find(".dk_toggle"),a=i.find(".dk_options").outerHeight(),d=t(e).height()-n.outerHeight()-n.offset().top+t(e).scrollTop(),r=n.offset().top-t(e).scrollTop();return r>a?d>a:!0},w=function(t,e,i){var n=t.find(".dk_options_inner"),a=e.prevAll("li").outerHeight()*e.prevAll("li").length+(e.closest(".dk_optgroup",n).length&&e.closest(".dk_optgroup",n).prevAll("li").outerHeight()*e.closest(".dk_optgroup",n).prevAll("li").length),d=n.scrollTop(),r=n.height()+n.scrollTop()-e.outerHeight();(i&&"keydown"===i.type||d>a||a>r)&&n.scrollTop(a)},x=function(t,e){var i=C(t),n="dk_open"+(i?"":" dk_open_top");t.find(".dk_options").css({top:i?t.find(".dk_toggle").outerHeight()-1:"",bottom:i?"":t.find(".dk_toggle").outerHeight()-1}),v=t.addClass(n),w(t,t.find(".dk_option_current"),e)},$=function(t,e,i){e.find(".dk_option_current").removeClass("dk_option_current"),t.addClass("dk_option_current"),w(e,t,i)},A=function(e,i){var n,a,d,r,o,l,s,p=e.keyCode,c=i.data("dropkick"),u=String.fromCharCode(p),h=i.find(".dk_options"),k=i.hasClass("dk_open"),g=h.find("li:not(.disabled)"),v=i.find(".dk_option_current"),_=v.closest(".dk_optgroup",h),C=g.first().hasClass("dk_optgroup")?g.first().find("li:not(.disabled)").first():g.first(),w=g.last().hasClass("dk_optgroup")?g.last().find("li:not(.disabled)").last():g.last();switch(p){case f.enter:k?v.hasClass("disabled")||(b(v.find("a"),i),m(i)):x(i,e),e.preventDefault();break;case f.tab:k&&(v.length&&b(v.find("a"),i),m(i));break;case f.up:k?(a=v.prevAll("li:not(.disabled)").first(),a.hasClass("dk_optgroup")&&(a=a.find("li:not(.disabled)").last()),!a.length&&_.length&&(a=_.prevAll("li:not(.disabled)").first().hasClass("dk_optgroup")?_.prevAll("li:not(.disabled)").first().find("li:not(.disabled)").last():_.prevAll("li:not(.disabled)").first()),$(a.length?a:w,i,e)):x(i,e),e.preventDefault();break;case f.down:k?(n=v.nextAll("li:not(.disabled)").first(),n.hasClass("dk_optgroup")&&(n=n.find("li:not(.disabled)").first()),!n.length&&_.length&&(n=_.nextAll("li:not(.disabled)").first().hasClass("dk_optgroup")?_.nextAll("li:not(.disabled)").first().find("li:not(.disabled)").first():_.nextAll("li:not(.disabled)").first()),$(n.length?n:C,i,e)):x(i,e),e.preventDefault()}if(p>=f.zero&&p<=f.z){for(d=(new Date).getTime(),null===c.finder||void 0===c.finder?(c.finder=u.toUpperCase(),c.timer=d):d>parseInt(c.timer,10)+1e3?(c.finder=u.toUpperCase(),c.timer=d):(c.finder=c.finder+u.toUpperCase(),c.timer=d),r=g.find("a"),o=0,l=r.length;l>o;o++)if(s=t(r[o]),0===s.html().toUpperCase().indexOf(c.finder)&&!s.closest(".dk_optgroup",h).hasClass("disabled")){b(s,i),$(s.parent(),i,e);break}i.data("dropkick",c)}},y=function(e){return t.trim(e).length>0?e:!1},T=function(e,i){var n,a,d,r,o,l=function(e){var n=e.val(),a=e.html(),d=void 0!==e.attr("disabled");return h.replace("{{ value }}",n).replace("{{ current }}",y(n)!==i.value||d?"":"dk_option_current").replace("{{ disabled }}",d?"disabled":"").replace("{{ text }}",t.trim(a)?t.trim(a):"&nbsp;")},s=e.replace("{{ id }}",i.id).replace("{{ label }}",i.label).replace("{{ tabindex }}",i.tabindex),p=[];if(i.options&&i.options.length)for(a=0,d=i.options.length;d>a;a++){if(r=t(i.options[a]),r.is("option"))o=0===a&&void 0!==r.attr("selected")&&void 0!==r.attr("disabled")?null:l(r);else if(r.is("optgroup")){if(o=k.replace("{{ text }}",r.attr("label")||"---").replace("{{ disabled }}",void 0!==r.attr("disabled")?" disabled":""),t(i.options[a]).children().length){o+="<ul>";
264for(var c=0,f=t(i.options[a]).children().length;f>c;c++){var u=t(i.options[a]).children().eq(c);o+=l(u)}o+="</ul>"}o+="</li>"}p[p.length]=o}return n=t(s),n.find(".dk_options_inner").html(p.join("")),n};p.init=function(e){return e=t.extend({},g,e),u=e.dropdownTemplate?e.dropdownTemplate:u,h=e.optionTemplate?e.optionTemplate:h,!s.fired&&s.fire(),this.each(function(){var i,n=t(this),a=n.find(":selected").first(),d=n.children(),o=n.data("dropkick")||{},l=n.attr("id")||n.attr("name"),s=n.parent(".dk_wrap"),p=e.width||s.length?s.width()-(n.innerWidth()-n.width()):n.outerWidth(),f=n.attr("tabindex")||"0",h=!!n.attr("disabled"),k=!1;return o.id?n:(o.settings=e,o.tabindex=f,o.id=l,o.$original=a,o.$select=n,o.value=y(n.val())||y(a.attr("value")),o.label=a.text()?a.text():"&nbsp;",o.options=d,o.theme=e.theme||"default",k=T(u,o),o.settings.autoWidth&&k.find(".dk_toggle").css({width:p+"px"}),h&&k.attr({disabled:"disabled",tabindex:-1}),n.before(k).appendTo(k.addClass("dk_theme_"+o.theme)),s.length?(s.removeClass("dk_wrap"),k.show()):k.fadeIn(e.startSpeed),o.$dk=k,n.data("dropkick",o),k.addClass(n.attr("class")),k.data("dropkick",o),c[c.length]=n,k.on({"focus.dropkick":function(){_=!k.attr("disabled")&&k.addClass("dk_focus")},"blur.dropkick":function(){k.removeClass("dk_focus"),_=null}}),r&&o.settings.nativeMobile&&k.addClass("dk_mobile"),o.settings.syncReverse&&n.on("change",function(e){var i=n.val(),a=t('a[data-dk-dropdown-value="'+i+'"]',k),d=a.text();k.find(".dk_label").html(d?d:"&nbsp;"),$(a.parent(),k,e),o.settings.change&&o.settings.change.call(n,i,d)}),i=n.attr("form")?t("#"+n.attr("form").replace(" ",", #")):n.closest("form"),void(i.length&&i.on("reset",function(){n.dropkick("reset")})))})},p.theme=function(e){var i=t(this).data("dropkick"),n=i.$dk,a="dk_theme_"+i.theme;i.theme=e||i.theme,n.removeClass(a).addClass("dk_theme_"+e)},p.reset=function(e){return this.each(function(){var i=t(this).data("dropkick"),n=i.$dk,a=t('a[data-dk-dropdown-value="'+i.$original.attr("value")+'"]',n);i.$original.prop("selected",!0),$(a.parent(),n),b(a,n,!e)})},p.setValue=function(e){return this.each(function(){var i=t(this).data("dropkick").$dk,n=t('.dk_options a[data-dk-dropdown-value="'+e+'"]',i);n.length&&b(n,i)|$(n.parent(),i)})},p.refresh=function(e){return this.each(function(){var i,n,a=t(this).data("dropkick"),d=a.$select,r=a.$dk;a.options=d.children(),n=T(u,a).find(".dk_options_inner"),r.find(".dk_options_inner").replaceWith(n),a.$original.parent().length||(a.$original=d.find(":selected").first(),a.label=a.$original.text()),i=t('a[data-dk-dropdown-value="'+d.val()+'"]',r),$(i.parent(),r),b(i,r,!e)})},p.destroy=function(){return this.each(function(){var e=t(this).data("dropkick");e.$dk.before(function(){return e.$select.removeData("dropkick")}).remove()})},p.clone=function(e,i,n){var a=[];t.each(this,function(d){var r=t(this).data("dropkick"),o=r.settings,l=r.$select.clone();o.autoWidth&&(o.width=r.$dk.find(".dk_label").width()),i&&l.attr({id:i}),n&&l.attr({name:n}),l.removeData("dropkick"),e===!1?a[d]=l[0]:(l.dropkick(o),a[d]=l.data("dropkick").$dk[0])})},p.disable=function(e){return this.each(function(){var i=t(this).data("dropkick"),n=i.$select,a=i.$dk;e===!1?(n.removeAttr("disabled"),a.removeAttr("disabled").attr({tabindex:i.tabindex})):(a.hasClass("dk_open")&&m(a),n.attr({disabled:"disabled"}),a.attr({disabled:"disabled",tabindex:-1}))})},t.fn.dropkick=function(t){if(!d){if(p[t])return p[t].apply(this,Array.prototype.slice.call(arguments,1));if("object"==typeof t||!t)return p.init.apply(this,arguments)}}})(jQuery,window,document);
265
266/*!
267 * imagesLoaded PACKAGED v3.1.4
268 * JavaScript is all like "You images are done yet or what?"
269 * MIT License
270 */
271
272(function(){function e(){}function t(e,t){for(var n=e.length;n--;)if(e[n].listener===t)return n;return-1}function n(e){return function(){return this[e].apply(this,arguments)}}var i=e.prototype,r=this,o=r.EventEmitter;i.getListeners=function(e){var t,n,i=this._getEvents();if("object"==typeof e){t={};for(n in i)i.hasOwnProperty(n)&&e.test(n)&&(t[n]=i[n])}else t=i[e]||(i[e]=[]);return t},i.flattenListeners=function(e){var t,n=[];for(t=0;e.length>t;t+=1)n.push(e[t].listener);return n},i.getListenersAsObject=function(e){var t,n=this.getListeners(e);return n instanceof Array&&(t={},t[e]=n),t||n},i.addListener=function(e,n){var i,r=this.getListenersAsObject(e),o="object"==typeof n;for(i in r)r.hasOwnProperty(i)&&-1===t(r[i],n)&&r[i].push(o?n:{listener:n,once:!1});return this},i.on=n("addListener"),i.addOnceListener=function(e,t){return this.addListener(e,{listener:t,once:!0})},i.once=n("addOnceListener"),i.defineEvent=function(e){return this.getListeners(e),this},i.defineEvents=function(e){for(var t=0;e.length>t;t+=1)this.defineEvent(e[t]);return this},i.removeListener=function(e,n){var i,r,o=this.getListenersAsObject(e);for(r in o)o.hasOwnProperty(r)&&(i=t(o[r],n),-1!==i&&o[r].splice(i,1));return this},i.off=n("removeListener"),i.addListeners=function(e,t){return this.manipulateListeners(!1,e,t)},i.removeListeners=function(e,t){return this.manipulateListeners(!0,e,t)},i.manipulateListeners=function(e,t,n){var i,r,o=e?this.removeListener:this.addListener,s=e?this.removeListeners:this.addListeners;if("object"!=typeof t||t instanceof RegExp)for(i=n.length;i--;)o.call(this,t,n[i]);else for(i in t)t.hasOwnProperty(i)&&(r=t[i])&&("function"==typeof r?o.call(this,i,r):s.call(this,i,r));return this},i.removeEvent=function(e){var t,n=typeof e,i=this._getEvents();if("string"===n)delete i[e];else if("object"===n)for(t in i)i.hasOwnProperty(t)&&e.test(t)&&delete i[t];else delete this._events;return this},i.removeAllListeners=n("removeEvent"),i.emitEvent=function(e,t){var n,i,r,o,s=this.getListenersAsObject(e);for(r in s)if(s.hasOwnProperty(r))for(i=s[r].length;i--;)n=s[r][i],n.once===!0&&this.removeListener(e,n.listener),o=n.listener.apply(this,t||[]),o===this._getOnceReturnValue()&&this.removeListener(e,n.listener);return this},i.trigger=n("emitEvent"),i.emit=function(e){var t=Array.prototype.slice.call(arguments,1
272);return this.emitEvent(e,t)},i.setOnceReturnValue=function(e){return this._onceReturnValue=e,this},i._getOnceReturnValue=function(){return this.hasOwnProperty("_onceReturnValue")?this._onceReturnValue:!0},i._getEvents=function(){return this._events||(this._events={})},e.noConflict=function(){return r.EventEmitter=o,e},"function"==typeof define&&define.amd?define("eventEmitter/EventEmitter",[],function(){return e}):"object"==typeof module&&module.exports?module.exports=e:this.EventEmitter=e}).call(this),function(e){function t(t){var n=e.event;return n.target=n.target||n.srcElement||t,n}var n=document.documentElement,i=function(){};n.addEventListener?i=function(e,t,n){e.addEventListener(t,n,!1)}:n.attachEvent&&(i=function(e,n,i){e[n+i]=i.handleEvent?function(){var n=t(e);i.handleEvent.call(i,n)}:function(){var n=t(e);i.call(e,n)},e.attachEvent("on"+n,e[n+i])});var r=function(){};n.removeEventListener?r=function(e,t,n){e.removeEventListener(t,n,!1)}:n.detachEvent&&(r=function(e,t,n){e.detachEvent("on"+t,e[t+n]);try{delete e[t+n]}catch(i){e[t+n]=void 0}});var o={bind:i,unbind:r};"function"==typeof define&&define.amd?define("eventie/eventie",o):e.eventie=o}(this),function(e,t){"function"==typeof define&&define.amd?define(["eventEmitter/EventEmitter","eventie/eventie"],function(n,i){return t(e,n,i)}):"object"==typeof exports?module.exports=t(e,require("eventEmitter"),require("eventie")):e.imagesLoaded=t(e,e.EventEmitter,e.eventie)}(this,function(e,t,n){function i(e,t){for(var n in t)e[n]=t[n];return e}function r(e){return"[object Array]"===d.call(e)}function o(e){var t=[];if(r(e))t=e;else if("number"==typeof e.length)for(var n=0,i=e.length;i>n;n++)t.push(e[n]);else t.push(e);return t}function s(e,t,n){if(!(this instanceof s))return new s(e,t);"string"==typeof e&&(e=document.querySelectorAll(e)),this.elements=o(e),this.options=i({},this.options),"function"==typeof t?n=t:i(this.options,t),n&&this.on("always",n),this.getImages(),a&&(this.jqDeferred=new a.Deferred);var r=this;setTimeout(function(){r.check()})}function c(e){this.img=e}function f(e){this.src=e,v[e]=this}var a=e.jQuery,u=e.console,h=u!==void 0,d=Object.prototype.toString;s.prototype=new t,s.prototype.options={},s.prototype.getImages=function(){this.images=[];for(var e=0,t=this.elements.length;t>e;e++){var n=this.elements[e];"IMG"===n.nodeName&&this.addImage(n);for(var i=n.querySelectorAll("img"),r=0,o=i.length;o>r;r++){var s=i[r];this.addImage(s)}}},s.prototype.addImage=function(e){var t=new c(e);this.images.push(t)},s.prototype.check=function(){function e(e,r){return t.options.debug&&h&&u.log("confirm",e,r),t.progress(e),n++,n===i&&t.complete(),!0}var t=this,n=0,i=this.images.length;if(this.hasAnyBroken=!1,!i)return this.complete(),void 0;for(var r=0;i>r;r++){var o=this.images[r];o.on("confirm",e),o.check()}},s.prototype.progress=function(e){this.hasAnyBroken=this.hasAnyBroken||!e.isLoaded;var t=this;setTimeout(function(){t.emit("progress",t,e),t.jqDeferred&&t.jqDeferred.notify&&t.jqDeferred.notify(t,e)})},s.prototype.complete=function(){var e=this.hasAnyBroken?"fail":"done";this.isComplete=!0;var t=this;setTimeout(function(){if(t.emit(e,t),t.emit("always",t),t.jqDeferred){var n=t.hasAnyBroken?"reject":"resolve";t.jqDeferred[n](t)}})},a&&(a.fn.imagesLoaded=function(e,t){var n=new s(this,e,t);return n.jqDeferred.promise(a(this))}),c.prototype=new t,c.prototype.check=function(){var e=v[this.img.src]||new f(this.img.src);if(e.isConfirmed)return this.confirm(e.isLoaded,"cached was confirmed"),void 0;if(this.img.complete&&void 0!==this.img.naturalWidth)return this.confirm(0!==this.img.naturalWidth,"naturalWidth"),void 0;var t=this;e.on("confirm",function(e,n){return t.confirm(e.isLoaded,n),!0}),e.check()},c.prototype.confirm=function(e,t){this.isLoaded=e,this.emit("confirm",this,t)};var v={};return f.prototype=new t,f.prototype.check=function(){if(!this.isChecked){var e=new Image;n.bind(e,"load",this),n.bind(e,"error",this),e.src=this.src,this.isChecked=!0}},f.prototype.handleEvent=function(e){var t="on"+e.type;this[t]&&this[t](e)},f.prototype.onload=function(e){this.confirm(!0,"onload"),this.unbindProxyEvents(e)},f.prototype.onerror=function(e){this.confirm(!1,"onerror"),this.unbindProxyEvents(e)},f.prototype.confirm=function(e,t){this.isConfirmed=!0,this.isLoaded=e,this.emit
272("confirm",this,t)},f.prototype.unbindProxyEvents=function(e){n.unbind(e.target,"load",this),n.unbind(e.target,"error",this)},s});
273
274//	LiteBox v1.3, Copyright 2014, Joe Mottershaw, https://github.com/joemottershaw/
275//	===============================================================================
276
277!function(e,t){function o(t,o){this.element=t,this.$element=e(this.element),this.options=e.extend({},a,o),this._defaults=a,this._name=l,this.init()}function i(){return t.innerHeight?t.innerHeight:e(t).height()}function n(t){e(t).each(function(){var t=new Image;t.src=this,t.width>0&&e("<img />").attr("src",this).addClass("litebox-preload").appendTo("body").hide()})}var l="liteBox",a={revealSpeed:400,background:"rgba(0,0,0,.8)",overlayClose:!0,escKey:!0,navKey:!0,closeTip:"tip-l-fade",closeTipText:"Close",prevTip:"tip-t-fade",prevTipText:"Previous",nextTip:"tip-t-fade",nextTipText:"Next",callbackInit:function(){},callbackBeforeOpen:function(){},callbackAfterOpen:function(){},callbackBeforeClose:function(){},callbackAfterClose:function(){},callbackError:function(){},callbackPrev:function(){},callbackNext:function(){},errorMessage:"Error loading content."};o.prototype={init:function(){var t=this;this.$element.on("click",function(e){e.preventDefault(),t.openLitebox()}),keyEsc=27,keyLeft=37,keyRight=39,e("body").off("keyup").on("keyup",function(o){t.options.escKey&&o.keyCode==keyEsc&&t.closeLitebox(),t.options.navKey&&o.keyCode==keyLeft&&e(".litebox-prev").trigger("click"),t.options.navKey&&o.keyCode==keyRight&&e(".litebox-next").trigger("click")}),this.options.callbackInit.call(this)},openLitebox:function(){var t=this;this.options.callbackBeforeOpen.call(this),t.buildLitebox();var o=this.$element;if(t.populateLitebox(o),t.options.overlayClose&&$litebox.on("click",function(o){(o.target===this||e(o.target).hasClass("litebox-container")||e(o.target).hasClass("litebox-error"))&&t.closeLitebox()}),$close.on("click",function(){t.closeLitebox()}),this.$element.attr("data-litebox-group")){var t=this,i=this.$element.attr("data-litebox-group"),l=e('[data-litebox-group="'+this.$element.attr("data-litebox-group")+'"]'),a=[];e('[data-litebox-group="'+i+'"]').each(function(){var t=e(this).attr("href");a.push(t)}),n(a),e(".litebox-nav").show(),$prevNav.off("click").on("click",function(){t.options.callbackPrev.call(this);var i=l.index(o);o=l.eq(i-1),e(o).length||(o=l.last()),t.populateLitebox(o)}),$nextNav.off("click").on("click",function(){t.options.callbackNext.call(this);var i=l.index(o);o=l.eq(i+1),e(o).length||(o=l.first()),t.populateLitebox(o)})}this.options.callbackAfterOpen.call(this)},buildLitebox:function(){$litebox=e("<div>",{"class":"litebox-overlay"}),$close=e("<div>",{"class":"litebox-close "+this.options.closeTip,"data-tooltip":this.options.closeTipText}),$text=e("<div>",{"class":"litebox-text"}),$error=e('<div class="litebox-error"><span>'+this.options.errorMessage+"</span></div>"),$prevNav=e("<div>",{"class":"litebox-nav litebox-prev "+this.options.prevTip,"data-tooltip":this.options.prevTipText}),$nextNav=e("<div>",{"class":"litebox-nav litebox-next "+this.options.nextTip,"data-tooltip":this.options.nextTipText}),$container=e("<div>",{"class":"litebox-container"}),$loader=e("<div>",{"class":"litebox-loader"}),e("body").prepend($litebox.css({"background-color":this.options.background})),$litebox.append($close,$text,$prevNav,$nextNav,$container),$litebox.fadeIn(this.options.revealSpeed)},populateLitebox:function(t){var o=this,i=t.attr("href"),n=e(".litebox-content");$litebox.append($loader);var l=t.attr("data-litebox-text");if("undefined"==typeof l||""==l?(e(".litebox-text").removeClass("active"),e(".litebox-text").html()):(e(".litebox-text").html(l),e(".litebox-text").addClass("active")),null!==i.match(/\.(jpeg|jpg|gif|png|bmp)/i)){var a=e("<img>",{src:i,"class":"litebox-content"});o.transitionContent("image",n,a),e("img.litebox-content").imagesLoaded(function(){$loader.remove()}),a.error(function(){o.liteboxError(),$loader.remove()})}else if(videoURL=i.match(/(youtube|youtu|vimeo|dailymotion|kickstarter)\.(com|be)\/((watch\?v=([-\w]+))|(video\/([-\w]+))|(projects\/([-\w]+)\/([-\w]+))|([-\w]+))/)){var r="";if("youtube"==videoURL[1]&&(r="http://www.youtube.com/v/"+videoURL[5]),"youtu"==videoURL[1]&&(r="http://www.youtube.com/v/"+videoURL[3]),"vimeo"==videoURL[1]&&(r="http://player.vimeo.com/video/"+videoURL[3]),"dailymotion"==videoURL[1]&&(r="https://www.dailymotion.com/embed/video/"+videoURL[7]),"kickstarter"==videoURL[1]&&(r="https://www.kickstarter.com/projects/"+videoURL[9]+"/"+videoURL[10]+"/widget/video.html"),r){var s=e("<iframe>",{src:r,frameborder:"0",vspace:"0",hspace:"0",scrolling:"no",allowfullscreen:"","class":"litebox-content",style:"background: #000"});o.transitionContent("embed",n,s),s.load(function(){$loader.remove()})}}else if("#"==i.substring(0,1))e(i).length?($html=e("<div>",{"class":"litebox-content litebox-inline-html"}),$html.append(e(i).clone()),o.transitionContent("inline",n,$html)):o.liteboxError(),$loader.remove();else{var s=e("<iframe>",{src:i,frameborder:"0",vspace:"0",hspace:"0",scrolling:"auto","class":"litebox-content",allowfullscreen:""});o.transitionContent("iframe",n,s),s.load(function(){$loader.remove()})}},transitionContent:function(o,i,n){var l=this;"inline"!=o&&$container.removeClass("litebox-scroll"),i.remove(),$container.append(n),"inline"==o&&$container.addClass("litebox-scroll"),l.centerContent(),e(t).on("resize",function(){l.centerContent()})},centerContent:function(){$litebox.css({height:i()}),$container.css({"line-height":$container.height()+"px"}),"undefined"!=typeof $html&&e(".litebox-inline-html").outerHeight()<$container.height()&&e(".litebox-inline-html").css({"margin-top":"-"+e(".litebox-inline-html").outerHeight()/2+"px",to
277p:"50%"})},closeLitebox:function(){this.options.callbackBeforeClose.call(this),$litebox.fadeOut(this.options.revealSpeed,function(){e(".litebox-nav").hide(),$litebox.empty().remove(),e(".litebox-preload").remove()}),e(".tipsy").fadeOut(this.options.revealSpeed,function(){e(this).remove()}),e(".litebox-prev").off("click"),e(".litebox-next").off("click"),this.options.callbackAfterClose.call(this)},liteboxError:function(){this.options.callbackError.call(this),$container.append($error)}},e.fn[l]=function(t){return this.each(function(){e.data(this,l)||e.data(this,l,new o(this,t))})}}(jQuery,window,document);

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.