PageSourceSearch

https://www.lightspeedmagazine.com/wp-content/themes/lightspeed-generate/js/lsscripts.js?ver=1.7.2

js lightspeedmagazine.com collected 2026-09-24 08:50:26 UTC 22,822 bytes, 419 lines download raw bytes

1/*!
2 * jQuery Browser Plugin 0.1.0
3 * https://github.com/gabceb/jquery-browser-plugin
4 *
5 * Original jquery-browser code Copyright 2005, 2015 jQuery Foundation, Inc. and other contributors
6 * http://jquery.org/license
7 *
8 * Modifications Copyright 2015 Gabriel Cebrian
9 * https://github.com/gabceb
10 *
11 * Released under the MIT license
12 *
13 * Date: 23-11-2015
14 */!function(a){"function"==typeof define&&define.amd?define(["jquery"],function(b){return a(b)}):"object"==typeof module&&"object"==typeof module.exports?module.exports=a(require("jquery")):a(window.jQuery)}(function(a){"use strict";function b(a){void 0===a&&(a=window.navigator.userAgent),a=a.toLowerCase();var b=/(edge)\/([\w.]+)/.exec(a)||/(opr)[\/]([\w.]+)/.exec(a)||/(chrome)[ \/]([\w.]+)/.exec(a)||/(iemobile)[\/]([\w.]+)/.exec(a)||/(version)(applewebkit)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+).*(version)[ \/]([\w.]+).*(safari)[ \/]([\w.]+)/.exec(a)||/(webkit)[ \/]([\w.]+)/.exec(a)||/(opera)(?:.*version|)[ \/]([\w.]+)/.exec(a)||/(msie) ([\w.]+)/.exec(a)||a.indexOf("trident")>=0&&/(rv)(?::| )([\w.]+)/.exec(a)||a.indexOf("compatible")<0&&/(mozilla)(?:.*? rv:([\w.]+)|)/.exec(a)||[],c=/(ipad)/.exec(a)||/(ipod)/.exec(a)||/(windows phone)/.exec(a)||/(iphone)/.exec(a)||/(kindle)/.exec(a)||/(silk)/.exec(a)||/(android)/.exec(a)||/(win)/.exec(a)||/(mac)/.exec(a)||/(linux)/.exec(a)||/(cros)/.exec(a)||/(playbook)/.exec(a)||/(bb)/.exec(a)||/(blackberry)/.exec(a)||[],d={},e={browser:b[5]||b[3]||b[1]||"",version:b[2]||b[4]||"0",versionNumber:b[4]||b[2]||"0",platform:c[0]||""};if(e.browser&&(d[e.browser]=!0,d.version=e.version,d.versionNumber=parseInt(e.versionNumber,10)),e.platform&&(d[e.platform]=!0),(d.android||d.bb||d.blackberry||d.ipad||d.iphone||d.ipod||d.kindle||d.playbook||d.silk||d["windows phone"])&&(d.mobile=!0),(d.cros||d.mac||d.linux||d.win)&&(d.desktop=!0),(d.chrome||d.opr||d.safari)&&(d.webkit=!0),d.rv||d.iemobile){var f="msie";e.browser=f,d[f]=!0}if(d.edge){delete d.edge;var g="msedge";e.browser=g,d[g]=!0}if(d.safari&&d.blackberry){var h="blackberry";e.browser=h,d[h]=!0}if(d.safari&&d.playbook){var i="playbook";e.browser=i,d[i]=!0}if(d.bb){var j="blackberry";e.browser=j,d[j]=!0}if(d.opr){var k="opera";e.browser=k,d[k]=!0}if(d.safari&&d.android){var l="android";e.browser=l,d[l]=!0}if(d.safari&&d.kindle){var m="kindle";e.browser=m,d[m]=!0}if(d.safari&&d.silk){var n="silk";e.browser=n,d[n]=!0}return d.name=e.browser,d.platform=e.platform,d}return window.jQBrowser=b(window.navigator.userAgent),window.jQBrowser.uaMatch=b,a&&(a.browser=window.jQBrowser),window.jQBrowser});
15
16// Generated by CoffeeScript 1.6.2
17/*!
18jQuery Waypoints - v2.0.5
19Copyright (c) 2011-2014 Caleb Troughton
20Licensed under the MIT license.
21https://github.com/imakewebthings/jquery-waypoints/blob/master/licenses.txt
22*/
23(function(){var t=[].indexOf||function(t){for(var e=0,n=this.length;e<n;e++){if(e in this&&this[e]===t)return e}return-1},e=[].slice;(function(t,e){if(typeof define==="function"&&define.amd){return define("waypoints",["jquery"],function(n){return e(n,t)})}else{return e(t.jQuery,t)}})(window,function(n,r){var i,o,l,s,f,u,c,a,h,d,p,y,v,w,g,m;i=n(r);a=t.call(r,"ontouchstart")>=0;s={horizontal:{},vertical:{}};f=1;c={};u="waypoints-context-id";p="resize.waypoints";y="scroll.waypoints";v=1;w="waypoints-waypoint-ids";g="waypoint";m="waypoints";o=function(){function t(t){var e=this;this.$element=t;this.element=t[0];this.didResize=false;this.didScroll=false;this.id="context"+f++;this.oldScroll={x:t.scrollLeft(),y:t.scrollTop()};this.waypoints={horizontal:{},vertical:{}};this.element[u]=this.id;c[this.id]=this;t.bind(y,function(){var t;if(!(e.didScroll||a)){e.didScroll=true;t=function(){e.doScroll();return e.didScroll=false};return r.setTimeout(t,n[m].settings.scrollThrottle)}});t.bind(p,function(){var t;if(!e.didResize){e.didResize=true;t=function(){n[m]("refresh");return e.didResize=false};return r.setTimeout(t,n[m].settings.resizeThrottle)}})}t.prototype.doScroll=function(){var t,e=this;t={horizontal:{newScroll:this.$element.scrollLeft(),oldScroll:this.oldScroll.x,forward:"right",backward:"left"},vertical:{newScroll:this.$element.scrollTop(),oldScroll:this.oldScroll.y,forward:"down",backward:"up"}};if(a&&(!t.vertical.oldScroll||!t.vertical.newScroll)){n[m]("refresh")}n.each(t,function(t,r){var i,o,l;l=[];o=r.newScroll>r.oldScroll;i=o?r.forward:r.backward;n.each(e.waypoints[t],function(t,e){var n,i;if(r.oldScroll<(n=e.offset)&&n<=r.newScroll){return l.push(e)}else if(r.newScroll<(i=e.offset)&&i<=r.oldScroll){return l.push(e)}});l.sort(function(t,e){return t.offset-e.offset});if(!o){l.reverse()}return n.each(l,function(t,e){if(e.options.continuous||t===l.length-1){return e.trigger([i])}})});return this.oldScroll={x:t.horizontal.newScroll,y:t.vertical.newScroll}};t.prototype.refresh=function(){var t,e,r,i=this;r=n.isWindow(this.element);e=this.$element.offset();this.doScroll();t={horizontal:{contextOffset:r?0:e.left,contextScroll:r?0:this.oldScroll.x,contextDimension:this.$element.width(),oldScroll:this.oldScroll.x,forward:"right",backward:"left",offsetProp:"left"},vertical:{contextOffset:r?0:e.top,contextScroll:r?0:this.oldScroll.y,contextDimension:r?n[m]("viewportHe
23ight"):this.$element.height(),oldScroll:this.oldScroll.y,forward:"down",backward:"up",offsetProp:"top"}};return n.each(t,function(t,e){return n.each(i.waypoints[t],function(t,r){var i,o,l,s,f;i=r.options.offset;l=r.offset;o=n.isWindow(r.element)?0:r.$element.offset()[e.offsetProp];if(n.isFunction(i)){i=i.apply(r.element)}else if(typeof i==="string"){i=parseFloat(i);if(r.options.offset.indexOf("%")>-1){i=Math.ceil(e.contextDimension*i/100)}}r.offset=o-e.contextOffset+e.contextScroll-i;if(r.options.onlyOnScroll&&l!=null||!r.enabled){return}if(l!==null&&l<(s=e.oldScroll)&&s<=r.offset){return r.trigger([e.backward])}else if(l!==null&&l>(f=e.oldScroll)&&f>=r.offset){return r.trigger([e.forward])}else if(l===null&&e.oldScroll>=r.offset){return r.trigger([e.forward])}})})};t.prototype.checkEmpty=function(){if(n.isEmptyObject(this.waypoints.horizontal)&&n.isEmptyObject(this.waypoints.vertical)){this.$element.unbind([p,y].join(" "));return delete c[this.id]}};return t}();l=function(){function t(t,e,r){var i,o;if(r.offset==="bottom-in-view"){r.offset=function(){var t;t=n[m]("viewportHeight");if(!n.isWindow(e.element)){t=e.$element.height()}return t-n(this).outerHeight()}}this.$element=t;this.element=t[0];this.axis=r.horizontal?"horizontal":"vertical";this.callback=r.handler;this.context=e;this.enabled=r.enabled;this.id="waypoints"+v++;this.offset=null;this.options=r;e.waypoints[this.axis][this.id]=this;s[this.axis][this.id]=this;i=(o=this.element[w])!=null?o:[];i.push(this.id);this.element[w]=i}t.prototype.trigger=function(t){if(!this.enabled){return}if(this.callback!=null){this.callback.apply(this.element,t)}if(this.options.triggerOnce){return this.destroy()}};t.prototype.disable=function(){return this.enabled=false};t.prototype.enable=function(){this.context.refresh();return this.enabled=true};t.prototype.destroy=function(){delete s[this.axis][this.id];delete this.context.waypoints[this.axis][this.id];return this.context.checkEmpty()};t.getWaypointsByElement=function(t){var e,r;r=t[w];if(!r){return[]}e=n.extend({},s.horizontal,s.vertical);return n.map(r,function(t){return e[t]})};return t}();d={init:function(t,e){var r;e=n.extend({},n.fn[g].defaults,e);if((r=e.handler)==null){e.handler=t}this.each(function(){var t,r,i,s;t=n(this);i=(s=e.context)!=null?s:n.fn[g].defaults.context;if(!n.isWindow(i)){i=t.closest(i)}i=n(i);r=c[i[0][u]];if(!r){r=new o(i)}return new l(t,r,e)});n[m]("refresh");return this},disable:function(){return d._invoke.call(this,"disable")},enable:function(){return d._invoke.call(this,"enable")},destroy:function(){return d._invoke.call(this,"destroy")},prev:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e>0){return t.push(n[e-1])}})},next:function(t,e){return d._traverse.call(this,t,e,function(t,e,n){if(e<n.length-1){return t.push(n[e+1])}})},_traverse:function(t,e,i){var o,l;if(t==null){t="vertical"}if(e==null){e=r}l=h.aggregate(e);o=[];this.each(function(){var e;e=n.inArray(this,l[t]);return i(o,e,l[t])});return this.pushStack(o)},_invoke:function(t){this.each(function(){var e;e=l.getWaypointsByElement(this);
23return n.each(e,function(e,n){n[t]();return true})});return this}};n.fn[g]=function(){var t,r;r=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(d[r]){return d[r].apply(this,t)}else if(n.isFunction(r)){return d.init.apply(this,arguments)}else if(n.isPlainObject(r)){return d.init.apply(this,[null,r])}else if(!r){return n.error("jQuery Waypoints needs a callback function or handler option.")}else{return n.error("The "+r+" method does not exist in jQuery Waypoints.")}};n.fn[g].defaults={context:r,continuous:true,enabled:true,horizontal:false,offset:0,triggerOnce:false};h={refresh:function(){return n.each(c,function(t,e){return e.refresh()})},viewportHeight:function(){var t;return(t=r.innerHeight)!=null?t:i.height()},aggregate:function(t){var e,r,i;e=s;if(t){e=(i=c[n(t)[0][u]])!=null?i.waypoints:void 0}if(!e){return[]}r={horizontal:[],vertical:[]};n.each(r,function(t,i){n.each(e[t],function(t,e){return i.push(e)});i.sort(function(t,e){return t.offset-e.offset});r[t]=n.map(i,function(t){return t.element});return r[t]=n.unique(r[t])});return r},above:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset<=t.oldScroll.y})},below:function(t){if(t==null){t=r}return h._filter(t,"vertical",function(t,e){return e.offset>t.oldScroll.y})},left:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset<=t.oldScroll.x})},right:function(t){if(t==null){t=r}return h._filter(t,"horizontal",function(t,e){return e.offset>t.oldScroll.x})},enable:function(){return h._invoke("enable")},disable:function(){return h._invoke("disable")},destroy:function(){return h._invoke("destroy")},extendFn:function(t,e){return d[t]=e},_invoke:function(t){var e;e=n.extend({},s.vertical,s.horizontal);
23return n.each(e,function(e,n){n[t]();return true})},_filter:function(t,e,r){var i,o;i=c[n(t)[0][u]];if(!i){return[]}o=[];n.each(i.waypoints[e],function(t,e){if(r(i,e)){return o.push(e)}});o.sort(function(t,e){return t.offset-e.offset});return n.map(o,function(t){return t.element})}};n[m]=function(){var t,n;n=arguments[0],t=2<=arguments.length?e.call(arguments,1):[];if(h[n]){return h[n].apply(null,t)}else{return h.aggregate.call(null,n)}};n[m].settings={resizeThrottle:100,scrollThrottle:30};return i.on("load.waypoints",function(){return n[m]("refresh")})})}).call(this);
24
25
26$contents = jQuery('.callout').contents();
27$banner = jQuery('.fixed_buy_banner');
28
29
30jQuery('.fixed_buy_banner .inner').append($contents);
31
32
33jQuery('.entry-content').waypoint(function(direction) {
34		if (direction=='down') {
35			$banner.removeClass('animated bounceOutUp hide').addClass('animated bounceInDown');
36		} else if (direction == 'up') {
37			
38			setTimeout(function(){
39				$banner.removeClass('animated bounceInDown').addClass('animated bounceOutUp');
40			
41
42				setTimeout(function(){
43					$banner.addClass('hide');
44				},1000);
45
46			}, 1000);
47
48		}
49	}, {
50		offset: 'bottom-in-view',
51	}
52);
53
54/*
55 * Superfish v1.4.8 - jQuery menu widget
56 * Copyright (c) 2008 Joel Birch
57 *
58 * Dual licensed under the MIT and GPL licenses:
59 * 	http://www.opensource.org/licenses/mit-license.php
60 * 	http://www.gnu.org/licenses/gpl.html
61 *
62 * CHANGELOG: http://users.tpg.com.au/j_birch/plugins/superfish/changelog.txt
63 */ 
64
65;(function($){
66	$.fn.superfish = function(op){
67
68		var sf = $.fn.superfish,
69			c = sf.c,
70			$arrow = $(['<span class="',c.arrowClass,'"> &#187;</span>'].join('')),
71			over = function(){
72				var $$ = $(this), menu = getMenu($$);
73				clearTimeout(menu.sfTimer);
74				$$.showSuperfishUl().siblings().hideSuperfishUl();
75			},
76			out = function(){
77				var $$ = $(this), menu = getMenu($$), o = sf.op;
78				clearTimeout(menu.sfTimer);
79				menu.sfTimer=setTimeout(function(){
80					o.retainPath=($.inArray($$[0],o.$path)>-1);
81					$$.hideSuperfishUl();
82					if (o.$path.length && $$.parents(['li.',o.hoverClass].join('')).length<1){over.call(o.$path);}
83				},o.delay);	
84			},
85			getMenu = function($menu){
86				var menu = $menu.parents(['ul.',c.menuClass,':first'].join(''))[0];
87				sf.op = sf.o[menu.serial];
88				return menu;
89			},
90			addArrow = function($a){ $a.addClass(c.anchorClass).append($arrow.clone()); };
91			
92		return this.each(function() {
93			var s = this.serial = sf.o.length;
94			var o = $.extend({},sf.defaults,op);
95			o.$path = $('li.'+o.pathClass,this).slice(0,o.pathLevels).each(function(){
96				$(this).addClass([o.hoverClass,c.bcClass].join(' '))
97					.filter('li:has(ul)').removeClass(o.pathClass);
98			});
99			sf.o[s] = sf.op = o;
100			
101			$('li:has(ul)',this)[($.fn.hoverIntent && !o.disableHI) ? 'hoverIntent' : 'hover'](over,out).each(function() {
102				if (o.autoArrows) addArrow( $('>a:first-child',this) );
103			})
104			.not('.'+c.bcClass)
105				.hideSuperfishUl();
106			
107			var $a = $('a',this);
108			$a.each(function(i){
109				var $li = $a.eq(i).parents('li');
110				$a.eq(i).focus(function(){over.call($li);}).blur(function(){out.call($li);});
111			});
112			o.onInit.call(this);
113			
114		}).each(function() {
115			var menuClasses = [c.menuClass];
116			if (sf.op.dropShadows  && !($.browser.msie && $.browser.version < 7)) menuClasses.push(c.shadowClass);
117			$(this).addClass(menuClasses.join(' '));
118		});
119	};
120
121	var sf = $.fn.superfish;
122	sf.o = [];
123	sf.op = {};
124	sf.IE7fix = function(){
125		var o = sf.op;
126		if ($.browser.msie && $.browser.version > 6 && o.dropShadows && o.animation.opacity!=undefined)
127			this.toggleClass(sf.c.shadowClass+'-off');
128		};
129	sf.c = {
130		bcClass     : 'sf-breadcrumb',
131		menuClass   : 'sf-js-enabled',
132		anchorClass : 'sf-with-ul',
133		arrowClass  : 'sf-sub-indicator',
134		shadowClass : 'sf-shadow'
135	};
136	sf.defaults = {
137		hoverClass	: 'sfHover',
138		pathClass	: 'overideThisToUse',
139		pathLevels	: 1,
140		delay		: 800,
141		animation	: {opacity:'show'},
142		speed		: 'normal',
143		autoArrows	: true,
144		dropShadows : true,
145		disableHI	: false,		// true disables hoverIntent detection
146		onInit		: function(){}, // callback functions
147		onBeforeShow: function(){},
148		onShow		: function(){},
149		onHide		: function(){}
150	};
151	$.fn.extend({
152		hideSuperfishUl : function(){
153			var o = sf.op,
154				not = (o.retainPath===true) ? o.$path : '';
155			o.retainPath = false;
156			var $ul = $(['li.',o.hoverClass].join(''),this).add(this).not(not).removeClass(o.hoverClass)
157					.find('>ul').hide().css('visibility','hidden');
158			o.onHide.call($ul);
159			return this;
160		},
161		showSuperfishUl : function(){
162			var o = sf.op,
163				sh = sf.c.shadowClass+'-off',
164				$ul = this.addClass(o.hoverClass)
165					.find('>ul:hidden').css('visibility','visible');
166			sf.IE7fix.call($ul);
167			o.onBeforeShow.call($ul);
168			$ul.animate(o.animation,o.speed,function(){ sf.IE7fix.call($ul); o.onShow.call($ul); });
169			return this;
170		}
171	});
172
173})(jQuery);
174(function($){
175	/* hoverIntent by Brian Cherne */
176	$.fn.hoverIntent = function(f,g) {
177		// default configuration options
178		var cfg = {
179			sensitivity: 7,
180			interval: 100,
181			timeout: 0
182		};
183		// override configuration options with user supplied object
184		cfg = $.extend(cfg, g ? { over: f, out: g } : f );
185
186		// instantiate variables
187		// cX, cY = current X and Y position of mouse, updated by mousemove event
188		// pX, pY = previous X and Y position of mouse, set by mouseover and polling interval
189		var cX, cY, pX, pY;
190
191		// A private function for getting mouse position
192		var track = function(ev) {
193			cX = ev.pageX;
194			cY = ev.pageY;
195		};
196
197		// A private function for comparing current and previous mouse position
198		var compare = function(ev,ob) {
199			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
200			// compare mouse positions to see if they've crossed the threshold
201			if ( ( Math.abs(pX-cX) + Math.abs(pY-cY) ) < cfg.sensitivity ) {
202				$(ob).unbind("mousemove",track);
203				// set hoverIntent state to true (so mouseOut can be called)
204				ob.hoverIntent_s = 1;
205				return cfg.over.apply(ob,[ev]);
206			} else {
207				// set previous coordinates for next time
208				pX = cX; pY = cY;
209				// use self-calling timeout, guarantees intervals are spaced out properly (avoids JavaScript timer bugs)
210				ob.hoverIntent_t = setTimeout( function(){compare(ev, ob);} , cfg.interval );
211			}
212		};
213
214		// A private function for delaying the mouseOut function
215		var delay = function(ev,ob) {
216			ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t);
217			ob.hoverIntent_s = 0;
218			return cfg.out.apply(ob,[ev]);
219		};
220
221		// A private function for handling mouse 'hovering'
222		var handleHover = function(e) {
223			// next three lines copied from jQuery.hover, ignore children onMouseOver/onMouseOut
224			var p = (e.type == "mouseover" ? e.fromElement : e.toElement) || e.relatedTarget;
225			while ( p && p != this ) { try { p = p.parentNode; } catch(e) { p = this; } }
226			if ( p == this ) { return false; }
227
228			// copy objects to be passed into t (required for event object to be passed in IE)
229			var ev = jQuery.extend({},e);
230			var ob = this;
231
232			// cancel hoverIntent timer if it exists
233			if (ob.hoverIntent_t) { ob.hoverIntent_t = clearTimeout(ob.hoverIntent_t); }
234
235			// else e.type == "onmouseover"
236			if (e.type == "mouseover") {
237				// set "previous" X and Y position based on initial entry point
238				pX = ev.pageX; pY = ev.pageY;
239				// update "current" X and Y position based on mousemove
240				$(ob).bind("mousemove",track);
241				// start polling interval (self-calling timeout) to compare mouse coordinates over time
242				if (ob.hoverIntent_s != 1) { ob.hoverIntent_t = setTimeout( function(){compare(ev,ob);} , cfg.interval );}
243
244			// else e.type == "onmouseout"
245			} else {
246				// unbind expensive mousemove event
247				$(ob).unbind("mousemove",track);
248				// if hoverIntent state is true, then call the mouseOut function after the specified delay
249				if (ob.hoverIntent_s == 1) { ob.hoverIntent_t = setTimeout( function(){delay(ev,ob);} , cfg.timeout );}
250			}
251		};
252
253		// bind the function to the two event listeners
254		return this.mouseover(handleHover).mouseout(handleHover);
255	};
256	
257})(jQuery);
258
259/* ========================================================================
260 * Bootstrap: dropdown.js v3.3.2
261 * http://getbootstrap.com/javascript/#dropdowns
262 * ========================================================================
263 * Copyright 2011-2015 Twitter, Inc.
264 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE)
265 * ======================================================================== */
266
267
268+function ($) {
269  'use strict';
270
271  // DROPDOWN CLASS DEFINITION
272  // =========================
273
274  var backdrop = '.dropdown-backdrop'
275  var toggle   = '[data-toggle="dropdown"]'
276  var Dropdown = function (element) {
277    $(element).on('click.bs.dropdown', this.toggle)
278  }
279
280  Dropdown.VERSION = '3.3.2'
281
282  Dropdown.prototype.toggle = function (e) {
283    var $this = $(this)
284
285    if ($this.is('.disabled, :disabled')) return
286
287    var $parent  = getParent($this)
288    var isActive = $parent.hasClass('open')
289
290    clearMenus()
291
292    if (!isActive) {
293      if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) {
294        // if mobile we use a backdrop because click events don't delegate
295        $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus)
296      }
297
298      var relatedTarget = { relatedTarget: this }
299      $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget))
300
301      if (e.isDefaultPrevented()) return
302
303      $this
304        .trigger('focus')
305        .attr('aria-expanded', 'true')
306
307      $parent
308        .toggleClass('open')
309        .trigger('shown.bs.dropdown', relatedTarget)
310    }
311
312    return false
313  }
314
315  Dropdown.prototype.keydown = function (e) {
316    if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return
317
318    var $this = $(this)
319
320    e.preventDefault()
321    e.stopPropagation()
322
323    if ($this.is('.disabled, :disabled')) return
324
325    var $parent  = getParent($this)
326    var isActive = $parent.hasClass('open')
327
328    if ((!isActive && e.which != 27) || (isActive && e.which == 27)) {
329      if (e.which == 27) $parent.find(toggle).trigger('focus')
330      return $this.trigger('click')
331    }
332
333    var desc = ' li:not(.divider):visible a'
vendor: 2,519 bytes, lines 334-419
334    var $items = $parent.find('[role="menu"]' + desc + ', [role="listbox"]' + desc)
335
336    if (!$items.length) return
337
338    var index = $items.index(e.target)
339
340    if (e.which == 38 && index > 0)                 index--                        // up
341    if (e.which == 40 && index < $items.length - 1) index++                        // down
342    if (!~index)                                      index = 0
343
344    $items.eq(index).trigger('focus')
345  }
346
347  function clearMenus(e) {
348    if (e && e.which === 3) return
349    $(backdrop).remove()
350    $(toggle).each(function () {
351      var $this         = $(this)
352      var $parent       = getParent($this)
353      var relatedTarget = { relatedTarget: this }
354
355      if (!$parent.hasClass('open')) return
356
357      $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget))
358
359      if (e.isDefaultPrevented()) return
360
361      $this.attr('aria-expanded', 'false')
362      $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget)
363    })
364  }
365
366  function getParent($this) {
367    var selector = $this.attr('data-target')
368
369    if (!selector) {
370      selector = $this.attr('href')
371      selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
372    }
373
374    var $parent = selector && $(selector)
375
376    return $parent && $parent.length ? $parent : $this.parent()
377  }
378
379
380  // DROPDOWN PLUGIN DEFINITION
381  // ==========================
382
383  function Plugin(option) {
384    return this.each(function () {
385      var $this = $(this)
386      var data  = $this.data('bs.dropdown')
387
388      if (!data) $this.data('bs.dropdown', (data = new Dropdown(this)))
389      if (typeof option == 'string') data[option].call($this)
390    })
391  }
392
393  var old = $.fn.dropdown
394
395  $.fn.dropdown             = Plugin
396  $.fn.dropdown.Constructor = Dropdown
397
398
399  // DROPDOWN NO CONFLICT
400  // ====================
401
402  $.fn.dropdown.noConflict = function () {
403    $.fn.dropdown = old
404    return this
405  }
406
407
408  // APPLY TO STANDARD DROPDOWN ELEMENTS
409  // ===================================
410
411  $(document)
412    .on('click.bs.dropdown.data-api', clearMenus)
413    .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() })
414    .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle)
415    .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown)
416    .on('keydown.bs.dropdown.data-api', '[role="menu"]', Dropdown.prototype.keydown)
417    .on('keydown.bs.dropdown.data-api', '[role="listbox"]', Dropdown.prototype.keydown)
418
419}(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.