|
1 /*! |
|
2 * Bootstrap v3.3.5 (http://getbootstrap.com) |
|
3 * Copyright 2011-2015 Twitter, Inc. |
|
4 * Licensed under the MIT license |
|
5 */ |
|
6 |
|
7 if (typeof jQuery === 'undefined') { |
|
8 throw new Error('Bootstrap\'s JavaScript requires jQuery') |
|
9 } |
|
10 |
|
11 +function ($) { |
|
12 'use strict'; |
|
13 var version = $.fn.jquery.split(' ')[0].split('.'); |
|
14 if ((version[0] < 2 && version[1] < 9) || (version[0] == 1 && version[1] == 9 && version[2] < 1)) { |
|
15 throw new Error('Bootstrap\'s JavaScript requires jQuery version 1.9.1 or higher') |
|
16 } |
|
17 }(jQuery); |
|
18 |
|
19 /* ======================================================================== |
|
20 * Bootstrap: transition.js v3.3.5 |
|
21 * http://getbootstrap.com/javascript/#transitions |
|
22 * ======================================================================== |
|
23 * Copyright 2011-2015 Twitter, Inc. |
|
24 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
25 * ======================================================================== */ |
|
26 |
|
27 |
|
28 +function ($) { |
|
29 'use strict'; |
|
30 |
|
31 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) |
|
32 // ============================================================ |
|
33 |
|
34 function transitionEnd() { |
|
35 var el = document.createElement('bootstrap'); |
|
36 |
|
37 var transEndEventNames = { |
|
38 WebkitTransition: 'webkitTransitionEnd', |
|
39 MozTransition: 'transitionend', |
|
40 OTransition: 'oTransitionEnd otransitionend', |
|
41 transition: 'transitionend' |
|
42 }; |
|
43 |
|
44 for (var name in transEndEventNames) { |
|
45 if (el.style[name] !== undefined) { |
|
46 return {end: transEndEventNames[name]} |
|
47 } |
|
48 } |
|
49 |
|
50 return false; // explicit for ie8 ( ._.) |
|
51 } |
|
52 |
|
53 // http://blog.alexmaccaw.com/css-transitions |
|
54 $.fn.emulateTransitionEnd = function (duration) { |
|
55 var called = false; |
|
56 var $el = this; |
|
57 $(this).one('bsTransitionEnd', function () { |
|
58 called = true |
|
59 }); |
|
60 var callback = function () { |
|
61 if (!called) $($el).trigger($.support.transition.end) |
|
62 }; |
|
63 setTimeout(callback, duration); |
|
64 return this |
|
65 }; |
|
66 |
|
67 $(function () { |
|
68 $.support.transition = transitionEnd(); |
|
69 |
|
70 if (!$.support.transition) return; |
|
71 |
|
72 $.event.special.bsTransitionEnd = { |
|
73 bindType: $.support.transition.end, |
|
74 delegateType: $.support.transition.end, |
|
75 handle: function (e) { |
|
76 if ($(e.target).is(this)) return e.handleObj.handler.apply(this, arguments) |
|
77 } |
|
78 } |
|
79 }) |
|
80 |
|
81 }(jQuery); |
|
82 |
|
83 /* ======================================================================== |
|
84 * Bootstrap: alert.js v3.3.5 |
|
85 * http://getbootstrap.com/javascript/#alerts |
|
86 * ======================================================================== |
|
87 * Copyright 2011-2015 Twitter, Inc. |
|
88 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
89 * ======================================================================== */ |
|
90 |
|
91 |
|
92 +function ($) { |
|
93 'use strict'; |
|
94 |
|
95 // ALERT CLASS DEFINITION |
|
96 // ====================== |
|
97 |
|
98 var dismiss = '[data-dismiss="alert"]'; |
|
99 var Alert = function (el) { |
|
100 $(el).on('click', dismiss, this.close) |
|
101 }; |
|
102 |
|
103 Alert.VERSION = '3.3.5'; |
|
104 |
|
105 Alert.TRANSITION_DURATION = 150; |
|
106 |
|
107 Alert.prototype.close = function (e) { |
|
108 var $this = $(this); |
|
109 var selector = $this.attr('data-target'); |
|
110 |
|
111 if (!selector) { |
|
112 selector = $this.attr('href'); |
|
113 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7 |
|
114 } |
|
115 |
|
116 var $parent = $(selector); |
|
117 |
|
118 if (e) e.preventDefault(); |
|
119 |
|
120 if (!$parent.length) { |
|
121 $parent = $this.closest('.alert') |
|
122 } |
|
123 |
|
124 $parent.trigger(e = $.Event('close.bs.alert')); |
|
125 |
|
126 if (e.isDefaultPrevented()) return; |
|
127 |
|
128 $parent.removeClass('in'); |
|
129 |
|
130 function removeElement() { |
|
131 // detach from parent, fire event then clean up data |
|
132 $parent.detach().trigger('closed.bs.alert').remove() |
|
133 } |
|
134 |
|
135 $.support.transition && $parent.hasClass('fade') ? |
|
136 $parent |
|
137 .one('bsTransitionEnd', removeElement) |
|
138 .emulateTransitionEnd(Alert.TRANSITION_DURATION) : |
|
139 removeElement() |
|
140 }; |
|
141 |
|
142 |
|
143 // ALERT PLUGIN DEFINITION |
|
144 // ======================= |
|
145 |
|
146 function Plugin(option) { |
|
147 return this.each(function () { |
|
148 var $this = $(this); |
|
149 var data = $this.data('bs.alert'); |
|
150 |
|
151 if (!data) $this.data('bs.alert', (data = new Alert(this))); |
|
152 if (typeof option == 'string') data[option].call($this) |
|
153 }) |
|
154 } |
|
155 |
|
156 var old = $.fn.alert; |
|
157 |
|
158 $.fn.alert = Plugin; |
|
159 $.fn.alert.Constructor = Alert; |
|
160 |
|
161 |
|
162 // ALERT NO CONFLICT |
|
163 // ================= |
|
164 |
|
165 $.fn.alert.noConflict = function () { |
|
166 $.fn.alert = old; |
|
167 return this |
|
168 }; |
|
169 |
|
170 |
|
171 // ALERT DATA-API |
|
172 // ============== |
|
173 |
|
174 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) |
|
175 |
|
176 }(jQuery); |
|
177 |
|
178 /* ======================================================================== |
|
179 * Bootstrap: button.js v3.3.5 |
|
180 * http://getbootstrap.com/javascript/#buttons |
|
181 * ======================================================================== |
|
182 * Copyright 2011-2015 Twitter, Inc. |
|
183 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
184 * ======================================================================== */ |
|
185 |
|
186 |
|
187 +function ($) { |
|
188 'use strict'; |
|
189 |
|
190 // BUTTON PUBLIC CLASS DEFINITION |
|
191 // ============================== |
|
192 |
|
193 var Button = function (element, options) { |
|
194 this.$element = $(element); |
|
195 this.options = $.extend({}, Button.DEFAULTS, options); |
|
196 this.isLoading = false |
|
197 }; |
|
198 |
|
199 Button.VERSION = '3.3.5'; |
|
200 |
|
201 Button.DEFAULTS = { |
|
202 loadingText: 'loading...' |
|
203 }; |
|
204 |
|
205 Button.prototype.setState = function (state) { |
|
206 var d = 'disabled'; |
|
207 var $el = this.$element; |
|
208 var val = $el.is('input') ? 'val' : 'html'; |
|
209 var data = $el.data(); |
|
210 |
|
211 state += 'Text'; |
|
212 |
|
213 if (data.resetText == null) $el.data('resetText', $el[val]()); |
|
214 |
|
215 // push to event loop to allow forms to submit |
|
216 setTimeout($.proxy(function () { |
|
217 $el[val](data[state] == null ? this.options[state] : data[state]); |
|
218 |
|
219 if (state == 'loadingText') { |
|
220 this.isLoading = true; |
|
221 $el.addClass(d).attr(d, d) |
|
222 } else if (this.isLoading) { |
|
223 this.isLoading = false; |
|
224 $el.removeClass(d).removeAttr(d) |
|
225 } |
|
226 }, this), 0) |
|
227 }; |
|
228 |
|
229 Button.prototype.toggle = function () { |
|
230 var changed = true; |
|
231 var $parent = this.$element.closest('[data-toggle="buttons"]'); |
|
232 |
|
233 if ($parent.length) { |
|
234 var $input = this.$element.find('input'); |
|
235 if ($input.prop('type') == 'radio') { |
|
236 if ($input.prop('checked')) changed = false; |
|
237 $parent.find('.active').removeClass('active'); |
|
238 this.$element.addClass('active') |
|
239 } else if ($input.prop('type') == 'checkbox') { |
|
240 if (($input.prop('checked')) !== this.$element.hasClass('active')) changed = false; |
|
241 this.$element.toggleClass('active') |
|
242 } |
|
243 $input.prop('checked', this.$element.hasClass('active')); |
|
244 if (changed) $input.trigger('change') |
|
245 } else { |
|
246 this.$element.attr('aria-pressed', !this.$element.hasClass('active')); |
|
247 this.$element.toggleClass('active') |
|
248 } |
|
249 }; |
|
250 |
|
251 |
|
252 // BUTTON PLUGIN DEFINITION |
|
253 // ======================== |
|
254 |
|
255 function Plugin(option) { |
|
256 return this.each(function () { |
|
257 var $this = $(this); |
|
258 var data = $this.data('bs.button'); |
|
259 var options = typeof option == 'object' && option; |
|
260 |
|
261 if (!data) $this.data('bs.button', (data = new Button(this, options))); |
|
262 |
|
263 if (option == 'toggle') data.toggle(); |
|
264 else if (option) data.setState(option) |
|
265 }) |
|
266 } |
|
267 |
|
268 var old = $.fn.button; |
|
269 |
|
270 $.fn.button = Plugin; |
|
271 $.fn.button.Constructor = Button; |
|
272 |
|
273 |
|
274 // BUTTON NO CONFLICT |
|
275 // ================== |
|
276 |
|
277 $.fn.button.noConflict = function () { |
|
278 $.fn.button = old; |
|
279 return this |
|
280 }; |
|
281 |
|
282 |
|
283 // BUTTON DATA-API |
|
284 // =============== |
|
285 |
|
286 $(document) |
|
287 .on('click.bs.button.data-api', '[data-toggle^="button"]', function (e) { |
|
288 var $btn = $(e.target); |
|
289 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn'); |
|
290 Plugin.call($btn, 'toggle'); |
|
291 if (!($(e.target).is('input[type="radio"]') || $(e.target).is('input[type="checkbox"]'))) e.preventDefault() |
|
292 }) |
|
293 .on('focus.bs.button.data-api blur.bs.button.data-api', '[data-toggle^="button"]', function (e) { |
|
294 $(e.target).closest('.btn').toggleClass('focus', /^focus(in)?$/.test(e.type)) |
|
295 }) |
|
296 |
|
297 }(jQuery); |
|
298 |
|
299 /* ======================================================================== |
|
300 * Bootstrap: carousel.js v3.3.5 |
|
301 * http://getbootstrap.com/javascript/#carousel |
|
302 * ======================================================================== |
|
303 * Copyright 2011-2015 Twitter, Inc. |
|
304 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
305 * ======================================================================== */ |
|
306 |
|
307 |
|
308 +function ($) { |
|
309 'use strict'; |
|
310 |
|
311 // CAROUSEL CLASS DEFINITION |
|
312 // ========================= |
|
313 |
|
314 var Carousel = function (element, options) { |
|
315 this.$element = $(element); |
|
316 this.$indicators = this.$element.find('.carousel-indicators'); |
|
317 this.options = options; |
|
318 this.paused = null; |
|
319 this.sliding = null; |
|
320 this.interval = null; |
|
321 this.$active = null; |
|
322 this.$items = null; |
|
323 |
|
324 this.options.keyboard && this.$element.on('keydown.bs.carousel', $.proxy(this.keydown, this)); |
|
325 |
|
326 this.options.pause == 'hover' && !('ontouchstart' in document.documentElement) && this.$element |
|
327 .on('mouseenter.bs.carousel', $.proxy(this.pause, this)) |
|
328 .on('mouseleave.bs.carousel', $.proxy(this.cycle, this)) |
|
329 }; |
|
330 |
|
331 Carousel.VERSION = '3.3.5'; |
|
332 |
|
333 Carousel.TRANSITION_DURATION = 600; |
|
334 |
|
335 Carousel.DEFAULTS = { |
|
336 interval: 5000, |
|
337 pause: 'hover', |
|
338 wrap: true, |
|
339 keyboard: true |
|
340 }; |
|
341 |
|
342 Carousel.prototype.keydown = function (e) { |
|
343 if (/input|textarea/i.test(e.target.tagName)) return; |
|
344 switch (e.which) { |
|
345 case 37: |
|
346 this.prev(); |
|
347 break; |
|
348 case 39: |
|
349 this.next(); |
|
350 break; |
|
351 default: |
|
352 return |
|
353 } |
|
354 |
|
355 e.preventDefault() |
|
356 }; |
|
357 |
|
358 Carousel.prototype.cycle = function (e) { |
|
359 e || (this.paused = false); |
|
360 |
|
361 this.interval && clearInterval(this.interval); |
|
362 |
|
363 this.options.interval |
|
364 && !this.paused |
|
365 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)); |
|
366 |
|
367 return this |
|
368 }; |
|
369 |
|
370 Carousel.prototype.getItemIndex = function (item) { |
|
371 this.$items = item.parent().children('.item'); |
|
372 return this.$items.index(item || this.$active) |
|
373 }; |
|
374 |
|
375 Carousel.prototype.getItemForDirection = function (direction, active) { |
|
376 var activeIndex = this.getItemIndex(active); |
|
377 var willWrap = (direction == 'prev' && activeIndex === 0) |
|
378 || (direction == 'next' && activeIndex == (this.$items.length - 1)); |
|
379 if (willWrap && !this.options.wrap) return active; |
|
380 var delta = direction == 'prev' ? -1 : 1; |
|
381 var itemIndex = (activeIndex + delta) % this.$items.length; |
|
382 return this.$items.eq(itemIndex) |
|
383 }; |
|
384 |
|
385 Carousel.prototype.to = function (pos) { |
|
386 var that = this; |
|
387 var activeIndex = this.getItemIndex(this.$active = this.$element.find('.item.active')); |
|
388 |
|
389 if (pos > (this.$items.length - 1) || pos < 0) return; |
|
390 |
|
391 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { |
|
392 that.to(pos) |
|
393 }); // yes, "slid" |
|
394 if (activeIndex == pos) return this.pause().cycle(); |
|
395 |
|
396 return this.slide(pos > activeIndex ? 'next' : 'prev', this.$items.eq(pos)) |
|
397 }; |
|
398 |
|
399 Carousel.prototype.pause = function (e) { |
|
400 e || (this.paused = true); |
|
401 |
|
402 if (this.$element.find('.next, .prev').length && $.support.transition) { |
|
403 this.$element.trigger($.support.transition.end); |
|
404 this.cycle(true) |
|
405 } |
|
406 |
|
407 this.interval = clearInterval(this.interval); |
|
408 |
|
409 return this |
|
410 }; |
|
411 |
|
412 Carousel.prototype.next = function () { |
|
413 if (this.sliding) return; |
|
414 return this.slide('next') |
|
415 }; |
|
416 |
|
417 Carousel.prototype.prev = function () { |
|
418 if (this.sliding) return; |
|
419 return this.slide('prev') |
|
420 }; |
|
421 |
|
422 Carousel.prototype.slide = function (type, next) { |
|
423 var $active = this.$element.find('.item.active'); |
|
424 var $next = next || this.getItemForDirection(type, $active); |
|
425 var isCycling = this.interval; |
|
426 var direction = type == 'next' ? 'left' : 'right'; |
|
427 var that = this; |
|
428 |
|
429 if ($next.hasClass('active')) return (this.sliding = false); |
|
430 |
|
431 var relatedTarget = $next[0]; |
|
432 var slideEvent = $.Event('slide.bs.carousel', { |
|
433 relatedTarget: relatedTarget, |
|
434 direction: direction |
|
435 }); |
|
436 this.$element.trigger(slideEvent); |
|
437 if (slideEvent.isDefaultPrevented()) return; |
|
438 |
|
439 this.sliding = true; |
|
440 |
|
441 isCycling && this.pause(); |
|
442 |
|
443 if (this.$indicators.length) { |
|
444 this.$indicators.find('.active').removeClass('active'); |
|
445 var $nextIndicator = $(this.$indicators.children()[this.getItemIndex($next)]); |
|
446 $nextIndicator && $nextIndicator.addClass('active') |
|
447 } |
|
448 |
|
449 var slidEvent = $.Event('slid.bs.carousel', {relatedTarget: relatedTarget, direction: direction}); // yes, "slid" |
|
450 if ($.support.transition && this.$element.hasClass('slide')) { |
|
451 $next.addClass(type); |
|
452 $next[0].offsetWidth; // force reflow |
|
453 $active.addClass(direction); |
|
454 $next.addClass(direction); |
|
455 $active |
|
456 .one('bsTransitionEnd', function () { |
|
457 $next.removeClass([type, direction].join(' ')).addClass('active'); |
|
458 $active.removeClass(['active', direction].join(' ')); |
|
459 that.sliding = false; |
|
460 setTimeout(function () { |
|
461 that.$element.trigger(slidEvent) |
|
462 }, 0) |
|
463 }) |
|
464 .emulateTransitionEnd(Carousel.TRANSITION_DURATION) |
|
465 } else { |
|
466 $active.removeClass('active'); |
|
467 $next.addClass('active'); |
|
468 this.sliding = false; |
|
469 this.$element.trigger(slidEvent) |
|
470 } |
|
471 |
|
472 isCycling && this.cycle(); |
|
473 |
|
474 return this |
|
475 }; |
|
476 |
|
477 |
|
478 // CAROUSEL PLUGIN DEFINITION |
|
479 // ========================== |
|
480 |
|
481 function Plugin(option) { |
|
482 return this.each(function () { |
|
483 var $this = $(this); |
|
484 var data = $this.data('bs.carousel'); |
|
485 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option); |
|
486 var action = typeof option == 'string' ? option : options.slide; |
|
487 |
|
488 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))); |
|
489 if (typeof option == 'number') data.to(option); |
|
490 else if (action) data[action](); |
|
491 else if (options.interval) data.pause().cycle() |
|
492 }) |
|
493 } |
|
494 |
|
495 var old = $.fn.carousel; |
|
496 |
|
497 $.fn.carousel = Plugin; |
|
498 $.fn.carousel.Constructor = Carousel; |
|
499 |
|
500 |
|
501 // CAROUSEL NO CONFLICT |
|
502 // ==================== |
|
503 |
|
504 $.fn.carousel.noConflict = function () { |
|
505 $.fn.carousel = old; |
|
506 return this |
|
507 }; |
|
508 |
|
509 |
|
510 // CAROUSEL DATA-API |
|
511 // ================= |
|
512 |
|
513 var clickHandler = function (e) { |
|
514 var href; |
|
515 var $this = $(this); |
|
516 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')); // strip for ie7 |
|
517 if (!$target.hasClass('carousel')) return; |
|
518 var options = $.extend({}, $target.data(), $this.data()); |
|
519 var slideIndex = $this.attr('data-slide-to'); |
|
520 if (slideIndex) options.interval = false; |
|
521 |
|
522 Plugin.call($target, options); |
|
523 |
|
524 if (slideIndex) { |
|
525 $target.data('bs.carousel').to(slideIndex) |
|
526 } |
|
527 |
|
528 e.preventDefault() |
|
529 }; |
|
530 |
|
531 $(document) |
|
532 .on('click.bs.carousel.data-api', '[data-slide]', clickHandler) |
|
533 .on('click.bs.carousel.data-api', '[data-slide-to]', clickHandler); |
|
534 |
|
535 $(window).on('load', function () { |
|
536 $('[data-ride="carousel"]').each(function () { |
|
537 var $carousel = $(this); |
|
538 Plugin.call($carousel, $carousel.data()) |
|
539 }) |
|
540 }) |
|
541 |
|
542 }(jQuery); |
|
543 |
|
544 /* ======================================================================== |
|
545 * Bootstrap: collapse.js v3.3.5 |
|
546 * http://getbootstrap.com/javascript/#collapse |
|
547 * ======================================================================== |
|
548 * Copyright 2011-2015 Twitter, Inc. |
|
549 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
550 * ======================================================================== */ |
|
551 |
|
552 |
|
553 +function ($) { |
|
554 'use strict'; |
|
555 |
|
556 // COLLAPSE PUBLIC CLASS DEFINITION |
|
557 // ================================ |
|
558 |
|
559 var Collapse = function (element, options) { |
|
560 this.$element = $(element); |
|
561 this.options = $.extend({}, Collapse.DEFAULTS, options); |
|
562 this.$trigger = $('[data-toggle="collapse"][href="#' + element.id + '"],' + |
|
563 '[data-toggle="collapse"][data-target="#' + element.id + '"]'); |
|
564 this.transitioning = null; |
|
565 |
|
566 if (this.options.parent) { |
|
567 this.$parent = this.getParent() |
|
568 } else { |
|
569 this.addAriaAndCollapsedClass(this.$element, this.$trigger) |
|
570 } |
|
571 |
|
572 if (this.options.toggle) this.toggle() |
|
573 }; |
|
574 |
|
575 Collapse.VERSION = '3.3.5'; |
|
576 |
|
577 Collapse.TRANSITION_DURATION = 350; |
|
578 |
|
579 Collapse.DEFAULTS = { |
|
580 toggle: true |
|
581 }; |
|
582 |
|
583 Collapse.prototype.dimension = function () { |
|
584 var hasWidth = this.$element.hasClass('width'); |
|
585 return hasWidth ? 'width' : 'height' |
|
586 }; |
|
587 |
|
588 Collapse.prototype.show = function () { |
|
589 if (this.transitioning || this.$element.hasClass('in')) return; |
|
590 |
|
591 var activesData; |
|
592 var actives = this.$parent && this.$parent.children('.panel').children('.in, .collapsing'); |
|
593 |
|
594 if (actives && actives.length) { |
|
595 activesData = actives.data('bs.collapse'); |
|
596 if (activesData && activesData.transitioning) return |
|
597 } |
|
598 |
|
599 var startEvent = $.Event('show.bs.collapse'); |
|
600 this.$element.trigger(startEvent); |
|
601 if (startEvent.isDefaultPrevented()) return; |
|
602 |
|
603 if (actives && actives.length) { |
|
604 Plugin.call(actives, 'hide'); |
|
605 activesData || actives.data('bs.collapse', null) |
|
606 } |
|
607 |
|
608 var dimension = this.dimension(); |
|
609 |
|
610 this.$element |
|
611 .removeClass('collapse') |
|
612 .addClass('collapsing')[dimension](0) |
|
613 .attr('aria-expanded', true); |
|
614 |
|
615 this.$trigger |
|
616 .removeClass('collapsed') |
|
617 .attr('aria-expanded', true); |
|
618 |
|
619 this.transitioning = 1; |
|
620 |
|
621 var complete = function () { |
|
622 this.$element |
|
623 .removeClass('collapsing') |
|
624 .addClass('collapse in')[dimension](''); |
|
625 this.transitioning = 0; |
|
626 this.$element |
|
627 .trigger('shown.bs.collapse') |
|
628 }; |
|
629 |
|
630 if (!$.support.transition) return complete.call(this); |
|
631 |
|
632 var scrollSize = $.camelCase(['scroll', dimension].join('-')); |
|
633 |
|
634 this.$element |
|
635 .one('bsTransitionEnd', $.proxy(complete, this)) |
|
636 .emulateTransitionEnd(Collapse.TRANSITION_DURATION)[dimension](this.$element[0][scrollSize]) |
|
637 }; |
|
638 |
|
639 Collapse.prototype.hide = function () { |
|
640 if (this.transitioning || !this.$element.hasClass('in')) return; |
|
641 |
|
642 var startEvent = $.Event('hide.bs.collapse'); |
|
643 this.$element.trigger(startEvent); |
|
644 if (startEvent.isDefaultPrevented()) return; |
|
645 |
|
646 var dimension = this.dimension(); |
|
647 |
|
648 this.$element[dimension](this.$element[dimension]())[0].offsetHeight; |
|
649 |
|
650 this.$element |
|
651 .addClass('collapsing') |
|
652 .removeClass('collapse in') |
|
653 .attr('aria-expanded', false); |
|
654 |
|
655 this.$trigger |
|
656 .addClass('collapsed') |
|
657 .attr('aria-expanded', false); |
|
658 |
|
659 this.transitioning = 1; |
|
660 |
|
661 var complete = function () { |
|
662 this.transitioning = 0; |
|
663 this.$element |
|
664 .removeClass('collapsing') |
|
665 .addClass('collapse') |
|
666 .trigger('hidden.bs.collapse') |
|
667 }; |
|
668 |
|
669 if (!$.support.transition) return complete.call(this); |
|
670 |
|
671 this.$element |
|
672 [dimension](0) |
|
673 .one('bsTransitionEnd', $.proxy(complete, this)) |
|
674 .emulateTransitionEnd(Collapse.TRANSITION_DURATION) |
|
675 }; |
|
676 |
|
677 Collapse.prototype.toggle = function () { |
|
678 this[this.$element.hasClass('in') ? 'hide' : 'show']() |
|
679 }; |
|
680 |
|
681 Collapse.prototype.getParent = function () { |
|
682 return $(this.options.parent) |
|
683 .find('[data-toggle="collapse"][data-parent="' + this.options.parent + '"]') |
|
684 .each($.proxy(function (i, element) { |
|
685 var $element = $(element); |
|
686 this.addAriaAndCollapsedClass(getTargetFromTrigger($element), $element) |
|
687 }, this)) |
|
688 .end() |
|
689 }; |
|
690 |
|
691 Collapse.prototype.addAriaAndCollapsedClass = function ($element, $trigger) { |
|
692 var isOpen = $element.hasClass('in'); |
|
693 |
|
694 $element.attr('aria-expanded', isOpen); |
|
695 $trigger |
|
696 .toggleClass('collapsed', !isOpen) |
|
697 .attr('aria-expanded', isOpen) |
|
698 }; |
|
699 |
|
700 function getTargetFromTrigger($trigger) { |
|
701 var href; |
|
702 var target = $trigger.attr('data-target') |
|
703 || (href = $trigger.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, ''); // strip for ie7 |
|
704 |
|
705 return $(target) |
|
706 } |
|
707 |
|
708 |
|
709 // COLLAPSE PLUGIN DEFINITION |
|
710 // ========================== |
|
711 |
|
712 function Plugin(option) { |
|
713 return this.each(function () { |
|
714 var $this = $(this); |
|
715 var data = $this.data('bs.collapse'); |
|
716 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option); |
|
717 |
|
718 if (!data && options.toggle && /show|hide/.test(option)) options.toggle = false; |
|
719 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))); |
|
720 if (typeof option == 'string') data[option]() |
|
721 }) |
|
722 } |
|
723 |
|
724 var old = $.fn.collapse; |
|
725 |
|
726 $.fn.collapse = Plugin; |
|
727 $.fn.collapse.Constructor = Collapse; |
|
728 |
|
729 |
|
730 // COLLAPSE NO CONFLICT |
|
731 // ==================== |
|
732 |
|
733 $.fn.collapse.noConflict = function () { |
|
734 $.fn.collapse = old; |
|
735 return this |
|
736 }; |
|
737 |
|
738 |
|
739 // COLLAPSE DATA-API |
|
740 // ================= |
|
741 |
|
742 $(document).on('click.bs.collapse.data-api', '[data-toggle="collapse"]', function (e) { |
|
743 var $this = $(this); |
|
744 |
|
745 if (!$this.attr('data-target')) e.preventDefault(); |
|
746 |
|
747 var $target = getTargetFromTrigger($this); |
|
748 var data = $target.data('bs.collapse'); |
|
749 var option = data ? 'toggle' : $this.data(); |
|
750 |
|
751 Plugin.call($target, option) |
|
752 }) |
|
753 |
|
754 }(jQuery); |
|
755 |
|
756 /* ======================================================================== |
|
757 * Bootstrap: dropdown.js v3.3.5 |
|
758 * http://getbootstrap.com/javascript/#dropdowns |
|
759 * ======================================================================== |
|
760 * Copyright 2011-2015 Twitter, Inc. |
|
761 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
762 * ======================================================================== */ |
|
763 |
|
764 |
|
765 +function ($) { |
|
766 'use strict'; |
|
767 |
|
768 // DROPDOWN CLASS DEFINITION |
|
769 // ========================= |
|
770 |
|
771 var backdrop = '.dropdown-backdrop'; |
|
772 var toggle = '[data-toggle="dropdown"]'; |
|
773 var Dropdown = function (element) { |
|
774 $(element).on('click.bs.dropdown', this.toggle) |
|
775 }; |
|
776 |
|
777 Dropdown.VERSION = '3.3.5'; |
|
778 |
|
779 function getParent($this) { |
|
780 var selector = $this.attr('data-target'); |
|
781 |
|
782 if (!selector) { |
|
783 selector = $this.attr('href'); |
|
784 selector = selector && /#[A-Za-z]/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7 |
|
785 } |
|
786 |
|
787 var $parent = selector && $(selector); |
|
788 |
|
789 return $parent && $parent.length ? $parent : $this.parent() |
|
790 } |
|
791 |
|
792 function clearMenus(e) { |
|
793 if (e && e.which === 3) return; |
|
794 $(backdrop).remove(); |
|
795 $(toggle).each(function () { |
|
796 var $this = $(this); |
|
797 var $parent = getParent($this); |
|
798 var relatedTarget = {relatedTarget: this}; |
|
799 |
|
800 if (!$parent.hasClass('open')) return; |
|
801 |
|
802 if (e && e.type == 'click' && /input|textarea/i.test(e.target.tagName) && $.contains($parent[0], e.target)) return; |
|
803 |
|
804 $parent.trigger(e = $.Event('hide.bs.dropdown', relatedTarget)); |
|
805 |
|
806 if (e.isDefaultPrevented()) return; |
|
807 |
|
808 $this.attr('aria-expanded', 'false'); |
|
809 $parent.removeClass('open').trigger('hidden.bs.dropdown', relatedTarget) |
|
810 }) |
|
811 } |
|
812 |
|
813 Dropdown.prototype.toggle = function (e) { |
|
814 var $this = $(this); |
|
815 |
|
816 if ($this.is('.disabled, :disabled')) return; |
|
817 |
|
818 var $parent = getParent($this); |
|
819 var isActive = $parent.hasClass('open'); |
|
820 |
|
821 clearMenus(); |
|
822 |
|
823 if (!isActive) { |
|
824 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { |
|
825 // if mobile we use a backdrop because click events don't delegate |
|
826 $(document.createElement('div')) |
|
827 .addClass('dropdown-backdrop') |
|
828 .insertAfter($(this)) |
|
829 .on('click', clearMenus) |
|
830 } |
|
831 |
|
832 var relatedTarget = {relatedTarget: this}; |
|
833 $parent.trigger(e = $.Event('show.bs.dropdown', relatedTarget)); |
|
834 |
|
835 if (e.isDefaultPrevented()) return; |
|
836 |
|
837 $this |
|
838 .trigger('focus') |
|
839 .attr('aria-expanded', 'true'); |
|
840 |
|
841 $parent |
|
842 .toggleClass('open') |
|
843 .trigger('shown.bs.dropdown', relatedTarget) |
|
844 } |
|
845 |
|
846 return false |
|
847 }; |
|
848 |
|
849 Dropdown.prototype.keydown = function (e) { |
|
850 if (!/(38|40|27|32)/.test(e.which) || /input|textarea/i.test(e.target.tagName)) return; |
|
851 |
|
852 var $this = $(this); |
|
853 |
|
854 e.preventDefault(); |
|
855 e.stopPropagation(); |
|
856 |
|
857 if ($this.is('.disabled, :disabled')) return; |
|
858 |
|
859 var $parent = getParent($this); |
|
860 var isActive = $parent.hasClass('open'); |
|
861 |
|
862 if (!isActive && e.which != 27 || isActive && e.which == 27) { |
|
863 if (e.which == 27) $parent.find(toggle).trigger('focus'); |
|
864 return $this.trigger('click') |
|
865 } |
|
866 |
|
867 var desc = ' li:not(.disabled):visible a'; |
|
868 var $items = $parent.find('.dropdown-menu' + desc); |
|
869 |
|
870 if (!$items.length) return; |
|
871 |
|
872 var index = $items.index(e.target); |
|
873 |
|
874 if (e.which == 38 && index > 0) index--; // up |
|
875 if (e.which == 40 && index < $items.length - 1) index++; // down |
|
876 if (!~index) index = 0; |
|
877 |
|
878 $items.eq(index).trigger('focus') |
|
879 }; |
|
880 |
|
881 |
|
882 // DROPDOWN PLUGIN DEFINITION |
|
883 // ========================== |
|
884 |
|
885 function Plugin(option) { |
|
886 return this.each(function () { |
|
887 var $this = $(this); |
|
888 var data = $this.data('bs.dropdown'); |
|
889 |
|
890 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))); |
|
891 if (typeof option == 'string') data[option].call($this) |
|
892 }) |
|
893 } |
|
894 |
|
895 var old = $.fn.dropdown; |
|
896 |
|
897 $.fn.dropdown = Plugin; |
|
898 $.fn.dropdown.Constructor = Dropdown; |
|
899 |
|
900 |
|
901 // DROPDOWN NO CONFLICT |
|
902 // ==================== |
|
903 |
|
904 $.fn.dropdown.noConflict = function () { |
|
905 $.fn.dropdown = old; |
|
906 return this |
|
907 }; |
|
908 |
|
909 |
|
910 // APPLY TO STANDARD DROPDOWN ELEMENTS |
|
911 // =================================== |
|
912 |
|
913 $(document) |
|
914 .on('click.bs.dropdown.data-api', clearMenus) |
|
915 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { |
|
916 e.stopPropagation() |
|
917 }) |
|
918 .on('click.bs.dropdown.data-api', toggle, Dropdown.prototype.toggle) |
|
919 .on('keydown.bs.dropdown.data-api', toggle, Dropdown.prototype.keydown) |
|
920 .on('keydown.bs.dropdown.data-api', '.dropdown-menu', Dropdown.prototype.keydown) |
|
921 |
|
922 }(jQuery); |
|
923 |
|
924 /* ======================================================================== |
|
925 * Bootstrap: modal.js v3.3.5 |
|
926 * http://getbootstrap.com/javascript/#modals |
|
927 * ======================================================================== |
|
928 * Copyright 2011-2015 Twitter, Inc. |
|
929 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
930 * ======================================================================== */ |
|
931 |
|
932 |
|
933 +function ($) { |
|
934 'use strict'; |
|
935 |
|
936 // MODAL CLASS DEFINITION |
|
937 // ====================== |
|
938 |
|
939 var Modal = function (element, options) { |
|
940 this.options = options; |
|
941 this.$body = $(document.body); |
|
942 this.$element = $(element); |
|
943 this.$dialog = this.$element.find('.modal-dialog'); |
|
944 this.$backdrop = null; |
|
945 this.isShown = null; |
|
946 this.originalBodyPad = null; |
|
947 this.scrollbarWidth = 0; |
|
948 this.ignoreBackdropClick = false; |
|
949 |
|
950 if (this.options.remote) { |
|
951 this.$element |
|
952 .find('.modal-content') |
|
953 .load(this.options.remote, $.proxy(function () { |
|
954 this.$element.trigger('loaded.bs.modal') |
|
955 }, this)) |
|
956 } |
|
957 }; |
|
958 |
|
959 Modal.VERSION = '3.3.5'; |
|
960 |
|
961 Modal.TRANSITION_DURATION = 300; |
|
962 Modal.BACKDROP_TRANSITION_DURATION = 150; |
|
963 |
|
964 Modal.DEFAULTS = { |
|
965 backdrop: true, |
|
966 keyboard: true, |
|
967 show: true |
|
968 }; |
|
969 |
|
970 Modal.prototype.toggle = function (_relatedTarget) { |
|
971 return this.isShown ? this.hide() : this.show(_relatedTarget) |
|
972 }; |
|
973 |
|
974 Modal.prototype.show = function (_relatedTarget) { |
|
975 var that = this; |
|
976 var e = $.Event('show.bs.modal', {relatedTarget: _relatedTarget}); |
|
977 |
|
978 this.$element.trigger(e); |
|
979 |
|
980 if (this.isShown || e.isDefaultPrevented()) return; |
|
981 |
|
982 this.isShown = true; |
|
983 |
|
984 this.checkScrollbar(); |
|
985 this.setScrollbar(); |
|
986 this.$body.addClass('modal-open'); |
|
987 |
|
988 this.escape(); |
|
989 this.resize(); |
|
990 |
|
991 this.$element.on('click.dismiss.bs.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)); |
|
992 |
|
993 this.$dialog.on('mousedown.dismiss.bs.modal', function () { |
|
994 that.$element.one('mouseup.dismiss.bs.modal', function (e) { |
|
995 if ($(e.target).is(that.$element)) that.ignoreBackdropClick = true |
|
996 }) |
|
997 }); |
|
998 |
|
999 this.backdrop(function () { |
|
1000 var transition = $.support.transition && that.$element.hasClass('fade'); |
|
1001 |
|
1002 if (!that.$element.parent().length) { |
|
1003 that.$element.appendTo(that.$body); // don't move modals dom position |
|
1004 } |
|
1005 |
|
1006 that.$element |
|
1007 .show() |
|
1008 .scrollTop(0); |
|
1009 |
|
1010 that.adjustDialog(); |
|
1011 |
|
1012 if (transition) { |
|
1013 that.$element[0].offsetWidth; // force reflow |
|
1014 } |
|
1015 |
|
1016 that.$element.addClass('in'); |
|
1017 |
|
1018 that.enforceFocus(); |
|
1019 |
|
1020 var e = $.Event('shown.bs.modal', {relatedTarget: _relatedTarget}); |
|
1021 |
|
1022 transition ? |
|
1023 that.$dialog // wait for modal to slide in |
|
1024 .one('bsTransitionEnd', function () { |
|
1025 that.$element.trigger('focus').trigger(e) |
|
1026 }) |
|
1027 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : |
|
1028 that.$element.trigger('focus').trigger(e) |
|
1029 }) |
|
1030 }; |
|
1031 |
|
1032 Modal.prototype.hide = function (e) { |
|
1033 if (e) e.preventDefault(); |
|
1034 |
|
1035 e = $.Event('hide.bs.modal'); |
|
1036 |
|
1037 this.$element.trigger(e); |
|
1038 |
|
1039 if (!this.isShown || e.isDefaultPrevented()) return; |
|
1040 |
|
1041 this.isShown = false; |
|
1042 |
|
1043 this.escape(); |
|
1044 this.resize(); |
|
1045 |
|
1046 $(document).off('focusin.bs.modal'); |
|
1047 |
|
1048 this.$element |
|
1049 .removeClass('in') |
|
1050 .off('click.dismiss.bs.modal') |
|
1051 .off('mouseup.dismiss.bs.modal'); |
|
1052 |
|
1053 this.$dialog.off('mousedown.dismiss.bs.modal'); |
|
1054 |
|
1055 $.support.transition && this.$element.hasClass('fade') ? |
|
1056 this.$element |
|
1057 .one('bsTransitionEnd', $.proxy(this.hideModal, this)) |
|
1058 .emulateTransitionEnd(Modal.TRANSITION_DURATION) : |
|
1059 this.hideModal() |
|
1060 }; |
|
1061 |
|
1062 Modal.prototype.enforceFocus = function () { |
|
1063 $(document) |
|
1064 .off('focusin.bs.modal') // guard against infinite focus loop |
|
1065 .on('focusin.bs.modal', $.proxy(function (e) { |
|
1066 if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { |
|
1067 this.$element.trigger('focus') |
|
1068 } |
|
1069 }, this)) |
|
1070 }; |
|
1071 |
|
1072 Modal.prototype.escape = function () { |
|
1073 if (this.isShown && this.options.keyboard) { |
|
1074 this.$element.on('keydown.dismiss.bs.modal', $.proxy(function (e) { |
|
1075 e.which == 27 && this.hide() |
|
1076 }, this)) |
|
1077 } else if (!this.isShown) { |
|
1078 this.$element.off('keydown.dismiss.bs.modal') |
|
1079 } |
|
1080 }; |
|
1081 |
|
1082 Modal.prototype.resize = function () { |
|
1083 if (this.isShown) { |
|
1084 $(window).on('resize.bs.modal', $.proxy(this.handleUpdate, this)) |
|
1085 } else { |
|
1086 $(window).off('resize.bs.modal') |
|
1087 } |
|
1088 }; |
|
1089 |
|
1090 Modal.prototype.hideModal = function () { |
|
1091 var that = this; |
|
1092 this.$element.hide(); |
|
1093 this.backdrop(function () { |
|
1094 that.$body.removeClass('modal-open'); |
|
1095 that.resetAdjustments(); |
|
1096 that.resetScrollbar(); |
|
1097 that.$element.trigger('hidden.bs.modal') |
|
1098 }) |
|
1099 }; |
|
1100 |
|
1101 Modal.prototype.removeBackdrop = function () { |
|
1102 this.$backdrop && this.$backdrop.remove(); |
|
1103 this.$backdrop = null |
|
1104 }; |
|
1105 |
|
1106 Modal.prototype.backdrop = function (callback) { |
|
1107 var that = this; |
|
1108 var animate = this.$element.hasClass('fade') ? 'fade' : ''; |
|
1109 |
|
1110 if (this.isShown && this.options.backdrop) { |
|
1111 var doAnimate = $.support.transition && animate; |
|
1112 |
|
1113 this.$backdrop = $(document.createElement('div')) |
|
1114 .addClass('modal-backdrop ' + animate) |
|
1115 .appendTo(this.$body); |
|
1116 |
|
1117 this.$element.on('click.dismiss.bs.modal', $.proxy(function (e) { |
|
1118 if (this.ignoreBackdropClick) { |
|
1119 this.ignoreBackdropClick = false; |
|
1120 return |
|
1121 } |
|
1122 if (e.target !== e.currentTarget) return; |
|
1123 this.options.backdrop == 'static' |
|
1124 ? this.$element[0].focus() |
|
1125 : this.hide() |
|
1126 }, this)); |
|
1127 |
|
1128 if (doAnimate) this.$backdrop[0].offsetWidth; // force reflow |
|
1129 |
|
1130 this.$backdrop.addClass('in'); |
|
1131 |
|
1132 if (!callback) return; |
|
1133 |
|
1134 doAnimate ? |
|
1135 this.$backdrop |
|
1136 .one('bsTransitionEnd', callback) |
|
1137 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : |
|
1138 callback() |
|
1139 |
|
1140 } else if (!this.isShown && this.$backdrop) { |
|
1141 this.$backdrop.removeClass('in'); |
|
1142 |
|
1143 var callbackRemove = function () { |
|
1144 that.removeBackdrop(); |
|
1145 callback && callback() |
|
1146 }; |
|
1147 $.support.transition && this.$element.hasClass('fade') ? |
|
1148 this.$backdrop |
|
1149 .one('bsTransitionEnd', callbackRemove) |
|
1150 .emulateTransitionEnd(Modal.BACKDROP_TRANSITION_DURATION) : |
|
1151 callbackRemove() |
|
1152 |
|
1153 } else if (callback) { |
|
1154 callback() |
|
1155 } |
|
1156 }; |
|
1157 |
|
1158 // these following methods are used to handle overflowing modals |
|
1159 |
|
1160 Modal.prototype.handleUpdate = function () { |
|
1161 this.adjustDialog() |
|
1162 }; |
|
1163 |
|
1164 Modal.prototype.adjustDialog = function () { |
|
1165 var modalIsOverflowing = this.$element[0].scrollHeight > document.documentElement.clientHeight; |
|
1166 |
|
1167 this.$element.css({ |
|
1168 paddingLeft: !this.bodyIsOverflowing && modalIsOverflowing ? this.scrollbarWidth : '', |
|
1169 paddingRight: this.bodyIsOverflowing && !modalIsOverflowing ? this.scrollbarWidth : '' |
|
1170 }) |
|
1171 }; |
|
1172 |
|
1173 Modal.prototype.resetAdjustments = function () { |
|
1174 this.$element.css({ |
|
1175 paddingLeft: '', |
|
1176 paddingRight: '' |
|
1177 }) |
|
1178 }; |
|
1179 |
|
1180 Modal.prototype.checkScrollbar = function () { |
|
1181 var fullWindowWidth = window.innerWidth; |
|
1182 if (!fullWindowWidth) { // workaround for missing window.innerWidth in IE8 |
|
1183 var documentElementRect = document.documentElement.getBoundingClientRect(); |
|
1184 fullWindowWidth = documentElementRect.right - Math.abs(documentElementRect.left) |
|
1185 } |
|
1186 this.bodyIsOverflowing = document.body.clientWidth < fullWindowWidth; |
|
1187 this.scrollbarWidth = this.measureScrollbar() |
|
1188 }; |
|
1189 |
|
1190 Modal.prototype.setScrollbar = function () { |
|
1191 var bodyPad = parseInt((this.$body.css('padding-right') || 0), 10); |
|
1192 this.originalBodyPad = document.body.style.paddingRight || ''; |
|
1193 if (this.bodyIsOverflowing) this.$body.css('padding-right', bodyPad + this.scrollbarWidth) |
|
1194 }; |
|
1195 |
|
1196 Modal.prototype.resetScrollbar = function () { |
|
1197 this.$body.css('padding-right', this.originalBodyPad) |
|
1198 }; |
|
1199 |
|
1200 Modal.prototype.measureScrollbar = function () { // thx walsh |
|
1201 var scrollDiv = document.createElement('div'); |
|
1202 scrollDiv.className = 'modal-scrollbar-measure'; |
|
1203 this.$body.append(scrollDiv); |
|
1204 var scrollbarWidth = scrollDiv.offsetWidth - scrollDiv.clientWidth; |
|
1205 this.$body[0].removeChild(scrollDiv); |
|
1206 return scrollbarWidth |
|
1207 }; |
|
1208 |
|
1209 |
|
1210 // MODAL PLUGIN DEFINITION |
|
1211 // ======================= |
|
1212 |
|
1213 function Plugin(option, _relatedTarget) { |
|
1214 return this.each(function () { |
|
1215 var $this = $(this); |
|
1216 var data = $this.data('bs.modal'); |
|
1217 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option); |
|
1218 |
|
1219 if (!data) $this.data('bs.modal', (data = new Modal(this, options))); |
|
1220 if (typeof option == 'string') data[option](_relatedTarget); |
|
1221 else if (options.show) data.show(_relatedTarget) |
|
1222 }) |
|
1223 } |
|
1224 |
|
1225 var old = $.fn.modal; |
|
1226 |
|
1227 $.fn.modal = Plugin; |
|
1228 $.fn.modal.Constructor = Modal; |
|
1229 |
|
1230 |
|
1231 // MODAL NO CONFLICT |
|
1232 // ================= |
|
1233 |
|
1234 $.fn.modal.noConflict = function () { |
|
1235 $.fn.modal = old; |
|
1236 return this |
|
1237 }; |
|
1238 |
|
1239 |
|
1240 // MODAL DATA-API |
|
1241 // ============== |
|
1242 |
|
1243 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { |
|
1244 var $this = $(this); |
|
1245 var href = $this.attr('href'); |
|
1246 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))); // strip for ie7 |
|
1247 var option = $target.data('bs.modal') ? 'toggle' : $.extend({remote: !/#/.test(href) && href}, $target.data(), $this.data()); |
|
1248 |
|
1249 if ($this.is('a')) e.preventDefault(); |
|
1250 |
|
1251 $target.one('show.bs.modal', function (showEvent) { |
|
1252 if (showEvent.isDefaultPrevented()) return; // only register focus restorer if modal will actually get shown |
|
1253 $target.one('hidden.bs.modal', function () { |
|
1254 $this.is(':visible') && $this.trigger('focus') |
|
1255 }) |
|
1256 }); |
|
1257 Plugin.call($target, option, this) |
|
1258 }) |
|
1259 |
|
1260 }(jQuery); |
|
1261 |
|
1262 /* ======================================================================== |
|
1263 * Bootstrap: tooltip.js v3.3.5 |
|
1264 * http://getbootstrap.com/javascript/#tooltip |
|
1265 * Inspired by the original jQuery.tipsy by Jason Frame |
|
1266 * ======================================================================== |
|
1267 * Copyright 2011-2015 Twitter, Inc. |
|
1268 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
1269 * ======================================================================== */ |
|
1270 |
|
1271 |
|
1272 +function ($) { |
|
1273 'use strict'; |
|
1274 |
|
1275 // TOOLTIP PUBLIC CLASS DEFINITION |
|
1276 // =============================== |
|
1277 |
|
1278 var Tooltip = function (element, options) { |
|
1279 this.type = null; |
|
1280 this.options = null; |
|
1281 this.enabled = null; |
|
1282 this.timeout = null; |
|
1283 this.hoverState = null; |
|
1284 this.$element = null; |
|
1285 this.inState = null; |
|
1286 |
|
1287 this.init('tooltip', element, options) |
|
1288 }; |
|
1289 |
|
1290 Tooltip.VERSION = '3.3.5'; |
|
1291 |
|
1292 Tooltip.TRANSITION_DURATION = 150; |
|
1293 |
|
1294 Tooltip.DEFAULTS = { |
|
1295 animation: true, |
|
1296 placement: 'top', |
|
1297 selector: false, |
|
1298 template: '<div class="tooltip" role="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>', |
|
1299 trigger: 'hover focus', |
|
1300 title: '', |
|
1301 delay: 0, |
|
1302 html: false, |
|
1303 container: false, |
|
1304 viewport: { |
|
1305 selector: 'body', |
|
1306 padding: 0 |
|
1307 } |
|
1308 }; |
|
1309 |
|
1310 Tooltip.prototype.init = function (type, element, options) { |
|
1311 this.enabled = true; |
|
1312 this.type = type; |
|
1313 this.$element = $(element); |
|
1314 this.options = this.getOptions(options); |
|
1315 this.$viewport = this.options.viewport && $($.isFunction(this.options.viewport) ? this.options.viewport.call(this, this.$element) : (this.options.viewport.selector || this.options.viewport)); |
|
1316 this.inState = {click: false, hover: false, focus: false}; |
|
1317 |
|
1318 if (this.$element[0] instanceof document.constructor && !this.options.selector) { |
|
1319 throw new Error('`selector` option must be specified when initializing ' + this.type + ' on the window.document object!') |
|
1320 } |
|
1321 |
|
1322 var triggers = this.options.trigger.split(' '); |
|
1323 |
|
1324 for (var i = triggers.length; i--;) { |
|
1325 var trigger = triggers[i]; |
|
1326 |
|
1327 if (trigger == 'click') { |
|
1328 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) |
|
1329 } else if (trigger != 'manual') { |
|
1330 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focusin'; |
|
1331 var eventOut = trigger == 'hover' ? 'mouseleave' : 'focusout'; |
|
1332 |
|
1333 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)); |
|
1334 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) |
|
1335 } |
|
1336 } |
|
1337 |
|
1338 this.options.selector ? |
|
1339 (this._options = $.extend({}, this.options, {trigger: 'manual', selector: ''})) : |
|
1340 this.fixTitle() |
|
1341 }; |
|
1342 |
|
1343 Tooltip.prototype.getDefaults = function () { |
|
1344 return Tooltip.DEFAULTS |
|
1345 }; |
|
1346 |
|
1347 Tooltip.prototype.getOptions = function (options) { |
|
1348 options = $.extend({}, this.getDefaults(), this.$element.data(), options); |
|
1349 |
|
1350 if (options.delay && typeof options.delay == 'number') { |
|
1351 options.delay = { |
|
1352 show: options.delay, |
|
1353 hide: options.delay |
|
1354 } |
|
1355 } |
|
1356 |
|
1357 return options |
|
1358 }; |
|
1359 |
|
1360 Tooltip.prototype.getDelegateOptions = function () { |
|
1361 var options = {}; |
|
1362 var defaults = this.getDefaults(); |
|
1363 |
|
1364 this._options && $.each(this._options, function (key, value) { |
|
1365 if (defaults[key] != value) options[key] = value |
|
1366 }); |
|
1367 |
|
1368 return options |
|
1369 }; |
|
1370 |
|
1371 Tooltip.prototype.enter = function (obj) { |
|
1372 var self = obj instanceof this.constructor ? |
|
1373 obj : $(obj.currentTarget).data('bs.' + this.type); |
|
1374 |
|
1375 if (!self) { |
|
1376 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()); |
|
1377 $(obj.currentTarget).data('bs.' + this.type, self) |
|
1378 } |
|
1379 |
|
1380 if (obj instanceof $.Event) { |
|
1381 self.inState[obj.type == 'focusin' ? 'focus' : 'hover'] = true |
|
1382 } |
|
1383 |
|
1384 if (self.tip().hasClass('in') || self.hoverState == 'in') { |
|
1385 self.hoverState = 'in'; |
|
1386 return |
|
1387 } |
|
1388 |
|
1389 clearTimeout(self.timeout); |
|
1390 |
|
1391 self.hoverState = 'in'; |
|
1392 |
|
1393 if (!self.options.delay || !self.options.delay.show) return self.show(); |
|
1394 |
|
1395 self.timeout = setTimeout(function () { |
|
1396 if (self.hoverState == 'in') self.show() |
|
1397 }, self.options.delay.show) |
|
1398 }; |
|
1399 |
|
1400 Tooltip.prototype.isInStateTrue = function () { |
|
1401 for (var key in this.inState) { |
|
1402 if (this.inState[key]) return true |
|
1403 } |
|
1404 |
|
1405 return false |
|
1406 }; |
|
1407 |
|
1408 Tooltip.prototype.leave = function (obj) { |
|
1409 var self = obj instanceof this.constructor ? |
|
1410 obj : $(obj.currentTarget).data('bs.' + this.type); |
|
1411 |
|
1412 if (!self) { |
|
1413 self = new this.constructor(obj.currentTarget, this.getDelegateOptions()); |
|
1414 $(obj.currentTarget).data('bs.' + this.type, self) |
|
1415 } |
|
1416 |
|
1417 if (obj instanceof $.Event) { |
|
1418 self.inState[obj.type == 'focusout' ? 'focus' : 'hover'] = false |
|
1419 } |
|
1420 |
|
1421 if (self.isInStateTrue()) return; |
|
1422 |
|
1423 clearTimeout(self.timeout); |
|
1424 |
|
1425 self.hoverState = 'out'; |
|
1426 |
|
1427 if (!self.options.delay || !self.options.delay.hide) return self.hide(); |
|
1428 |
|
1429 self.timeout = setTimeout(function () { |
|
1430 if (self.hoverState == 'out') self.hide() |
|
1431 }, self.options.delay.hide) |
|
1432 }; |
|
1433 |
|
1434 Tooltip.prototype.show = function () { |
|
1435 var e = $.Event('show.bs.' + this.type); |
|
1436 |
|
1437 if (this.hasContent() && this.enabled) { |
|
1438 this.$element.trigger(e); |
|
1439 |
|
1440 var inDom = $.contains(this.$element[0].ownerDocument.documentElement, this.$element[0]); |
|
1441 if (e.isDefaultPrevented() || !inDom) return; |
|
1442 var that = this; |
|
1443 |
|
1444 var $tip = this.tip(); |
|
1445 |
|
1446 var tipId = this.getUID(this.type); |
|
1447 |
|
1448 this.setContent(); |
|
1449 $tip.attr('id', tipId); |
|
1450 this.$element.attr('aria-describedby', tipId); |
|
1451 |
|
1452 if (this.options.animation) $tip.addClass('fade'); |
|
1453 |
|
1454 var placement = typeof this.options.placement == 'function' ? |
|
1455 this.options.placement.call(this, $tip[0], this.$element[0]) : |
|
1456 this.options.placement; |
|
1457 |
|
1458 var autoToken = /\s?auto?\s?/i; |
|
1459 var autoPlace = autoToken.test(placement); |
|
1460 if (autoPlace) placement = placement.replace(autoToken, '') || 'top'; |
|
1461 |
|
1462 $tip |
|
1463 .detach() |
|
1464 .css({top: 0, left: 0, display: 'block'}) |
|
1465 .addClass(placement) |
|
1466 .data('bs.' + this.type, this); |
|
1467 |
|
1468 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element); |
|
1469 this.$element.trigger('inserted.bs.' + this.type); |
|
1470 |
|
1471 var pos = this.getPosition(); |
|
1472 var actualWidth = $tip[0].offsetWidth; |
|
1473 var actualHeight = $tip[0].offsetHeight; |
|
1474 |
|
1475 if (autoPlace) { |
|
1476 var orgPlacement = placement; |
|
1477 var viewportDim = this.getPosition(this.$viewport); |
|
1478 |
|
1479 placement = placement == 'bottom' && pos.bottom + actualHeight > viewportDim.bottom ? 'top' : |
|
1480 placement == 'top' && pos.top - actualHeight < viewportDim.top ? 'bottom' : |
|
1481 placement == 'right' && pos.right + actualWidth > viewportDim.width ? 'left' : |
|
1482 placement == 'left' && pos.left - actualWidth < viewportDim.left ? 'right' : |
|
1483 placement; |
|
1484 |
|
1485 $tip |
|
1486 .removeClass(orgPlacement) |
|
1487 .addClass(placement) |
|
1488 } |
|
1489 |
|
1490 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight); |
|
1491 |
|
1492 this.applyPlacement(calculatedOffset, placement); |
|
1493 |
|
1494 var complete = function () { |
|
1495 var prevHoverState = that.hoverState; |
|
1496 that.$element.trigger('shown.bs.' + that.type); |
|
1497 that.hoverState = null; |
|
1498 |
|
1499 if (prevHoverState == 'out') that.leave(that) |
|
1500 }; |
|
1501 |
|
1502 $.support.transition && this.$tip.hasClass('fade') ? |
|
1503 $tip |
|
1504 .one('bsTransitionEnd', complete) |
|
1505 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : |
|
1506 complete() |
|
1507 } |
|
1508 }; |
|
1509 |
|
1510 Tooltip.prototype.applyPlacement = function (offset, placement) { |
|
1511 var $tip = this.tip(); |
|
1512 var width = $tip[0].offsetWidth; |
|
1513 var height = $tip[0].offsetHeight; |
|
1514 |
|
1515 // manually read margins because getBoundingClientRect includes difference |
|
1516 var marginTop = parseInt($tip.css('margin-top'), 10); |
|
1517 var marginLeft = parseInt($tip.css('margin-left'), 10); |
|
1518 |
|
1519 // we must check for NaN for ie 8/9 |
|
1520 if (isNaN(marginTop)) marginTop = 0; |
|
1521 if (isNaN(marginLeft)) marginLeft = 0; |
|
1522 |
|
1523 offset.top += marginTop; |
|
1524 offset.left += marginLeft; |
|
1525 |
|
1526 // $.fn.offset doesn't round pixel values |
|
1527 // so we use setOffset directly with our own function B-0 |
|
1528 $.offset.setOffset($tip[0], $.extend({ |
|
1529 using: function (props) { |
|
1530 $tip.css({ |
|
1531 top: Math.round(props.top), |
|
1532 left: Math.round(props.left) |
|
1533 }) |
|
1534 } |
|
1535 }, offset), 0); |
|
1536 |
|
1537 $tip.addClass('in'); |
|
1538 |
|
1539 // check to see if placing tip in new offset caused the tip to resize itself |
|
1540 var actualWidth = $tip[0].offsetWidth; |
|
1541 var actualHeight = $tip[0].offsetHeight; |
|
1542 |
|
1543 if (placement == 'top' && actualHeight != height) { |
|
1544 offset.top = offset.top + height - actualHeight |
|
1545 } |
|
1546 |
|
1547 var delta = this.getViewportAdjustedDelta(placement, offset, actualWidth, actualHeight); |
|
1548 |
|
1549 if (delta.left) offset.left += delta.left; |
|
1550 else offset.top += delta.top; |
|
1551 |
|
1552 var isVertical = /top|bottom/.test(placement); |
|
1553 var arrowDelta = isVertical ? delta.left * 2 - width + actualWidth : delta.top * 2 - height + actualHeight; |
|
1554 var arrowOffsetPosition = isVertical ? 'offsetWidth' : 'offsetHeight'; |
|
1555 |
|
1556 $tip.offset(offset); |
|
1557 this.replaceArrow(arrowDelta, $tip[0][arrowOffsetPosition], isVertical) |
|
1558 }; |
|
1559 |
|
1560 Tooltip.prototype.replaceArrow = function (delta, dimension, isVertical) { |
|
1561 this.arrow() |
|
1562 .css(isVertical ? 'left' : 'top', 50 * (1 - delta / dimension) + '%') |
|
1563 .css(isVertical ? 'top' : 'left', '') |
|
1564 }; |
|
1565 |
|
1566 Tooltip.prototype.setContent = function () { |
|
1567 var $tip = this.tip(); |
|
1568 var title = this.getTitle(); |
|
1569 |
|
1570 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title); |
|
1571 $tip.removeClass('fade in top bottom left right') |
|
1572 }; |
|
1573 |
|
1574 Tooltip.prototype.hide = function (callback) { |
|
1575 var that = this; |
|
1576 var $tip = $(this.$tip); |
|
1577 var e = $.Event('hide.bs.' + this.type); |
|
1578 |
|
1579 function complete() { |
|
1580 if (that.hoverState != 'in') $tip.detach(); |
|
1581 that.$element |
|
1582 .removeAttr('aria-describedby') |
|
1583 .trigger('hidden.bs.' + that.type); |
|
1584 callback && callback() |
|
1585 } |
|
1586 |
|
1587 this.$element.trigger(e); |
|
1588 |
|
1589 if (e.isDefaultPrevented()) return; |
|
1590 |
|
1591 $tip.removeClass('in'); |
|
1592 |
|
1593 $.support.transition && $tip.hasClass('fade') ? |
|
1594 $tip |
|
1595 .one('bsTransitionEnd', complete) |
|
1596 .emulateTransitionEnd(Tooltip.TRANSITION_DURATION) : |
|
1597 complete(); |
|
1598 |
|
1599 this.hoverState = null; |
|
1600 |
|
1601 return this |
|
1602 }; |
|
1603 |
|
1604 Tooltip.prototype.fixTitle = function () { |
|
1605 var $e = this.$element; |
|
1606 if ($e.attr('title') || typeof $e.attr('data-original-title') != 'string') { |
|
1607 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') |
|
1608 } |
|
1609 }; |
|
1610 |
|
1611 Tooltip.prototype.hasContent = function () { |
|
1612 return this.getTitle() |
|
1613 }; |
|
1614 |
|
1615 Tooltip.prototype.getPosition = function ($element) { |
|
1616 $element = $element || this.$element; |
|
1617 |
|
1618 var el = $element[0]; |
|
1619 var isBody = el.tagName == 'BODY'; |
|
1620 |
|
1621 var elRect = el.getBoundingClientRect(); |
|
1622 if (elRect.width == null) { |
|
1623 // width and height are missing in IE8, so compute them manually; see https://github.com/twbs/bootstrap/issues/14093 |
|
1624 elRect = $.extend({}, elRect, {width: elRect.right - elRect.left, height: elRect.bottom - elRect.top}) |
|
1625 } |
|
1626 var elOffset = isBody ? {top: 0, left: 0} : $element.offset(); |
|
1627 var scroll = {scroll: isBody ? document.documentElement.scrollTop || document.body.scrollTop : $element.scrollTop()}; |
|
1628 var outerDims = isBody ? {width: $(window).width(), height: $(window).height()} : null; |
|
1629 |
|
1630 return $.extend({}, elRect, scroll, outerDims, elOffset) |
|
1631 }; |
|
1632 |
|
1633 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { |
|
1634 return placement == 'bottom' ? {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} : |
|
1635 placement == 'top' ? {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} : |
|
1636 placement == 'left' ? {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} : |
|
1637 /* placement == 'right' */ {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} |
|
1638 |
|
1639 }; |
|
1640 |
|
1641 Tooltip.prototype.getViewportAdjustedDelta = function (placement, pos, actualWidth, actualHeight) { |
|
1642 var delta = {top: 0, left: 0}; |
|
1643 if (!this.$viewport) return delta; |
|
1644 |
|
1645 var viewportPadding = this.options.viewport && this.options.viewport.padding || 0; |
|
1646 var viewportDimensions = this.getPosition(this.$viewport); |
|
1647 |
|
1648 if (/right|left/.test(placement)) { |
|
1649 var topEdgeOffset = pos.top - viewportPadding - viewportDimensions.scroll; |
|
1650 var bottomEdgeOffset = pos.top + viewportPadding - viewportDimensions.scroll + actualHeight; |
|
1651 if (topEdgeOffset < viewportDimensions.top) { // top overflow |
|
1652 delta.top = viewportDimensions.top - topEdgeOffset |
|
1653 } else if (bottomEdgeOffset > viewportDimensions.top + viewportDimensions.height) { // bottom overflow |
|
1654 delta.top = viewportDimensions.top + viewportDimensions.height - bottomEdgeOffset |
|
1655 } |
|
1656 } else { |
|
1657 var leftEdgeOffset = pos.left - viewportPadding; |
|
1658 var rightEdgeOffset = pos.left + viewportPadding + actualWidth; |
|
1659 if (leftEdgeOffset < viewportDimensions.left) { // left overflow |
|
1660 delta.left = viewportDimensions.left - leftEdgeOffset |
|
1661 } else if (rightEdgeOffset > viewportDimensions.right) { // right overflow |
|
1662 delta.left = viewportDimensions.left + viewportDimensions.width - rightEdgeOffset |
|
1663 } |
|
1664 } |
|
1665 |
|
1666 return delta |
|
1667 }; |
|
1668 |
|
1669 Tooltip.prototype.getTitle = function () { |
|
1670 var title; |
|
1671 var $e = this.$element; |
|
1672 var o = this.options; |
|
1673 |
|
1674 title = $e.attr('data-original-title') |
|
1675 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title); |
|
1676 |
|
1677 return title |
|
1678 }; |
|
1679 |
|
1680 Tooltip.prototype.getUID = function (prefix) { |
|
1681 do prefix += ~~(Math.random() * 1000000); |
|
1682 while (document.getElementById(prefix)); |
|
1683 return prefix |
|
1684 }; |
|
1685 |
|
1686 Tooltip.prototype.tip = function () { |
|
1687 if (!this.$tip) { |
|
1688 this.$tip = $(this.options.template); |
|
1689 if (this.$tip.length != 1) { |
|
1690 throw new Error(this.type + ' `template` option must consist of exactly 1 top-level element!') |
|
1691 } |
|
1692 } |
|
1693 return this.$tip |
|
1694 }; |
|
1695 |
|
1696 Tooltip.prototype.arrow = function () { |
|
1697 return (this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow')) |
|
1698 }; |
|
1699 |
|
1700 Tooltip.prototype.enable = function () { |
|
1701 this.enabled = true |
|
1702 }; |
|
1703 |
|
1704 Tooltip.prototype.disable = function () { |
|
1705 this.enabled = false |
|
1706 }; |
|
1707 |
|
1708 Tooltip.prototype.toggleEnabled = function () { |
|
1709 this.enabled = !this.enabled |
|
1710 }; |
|
1711 |
|
1712 Tooltip.prototype.toggle = function (e) { |
|
1713 var self = this; |
|
1714 if (e) { |
|
1715 self = $(e.currentTarget).data('bs.' + this.type); |
|
1716 if (!self) { |
|
1717 self = new this.constructor(e.currentTarget, this.getDelegateOptions()); |
|
1718 $(e.currentTarget).data('bs.' + this.type, self) |
|
1719 } |
|
1720 } |
|
1721 |
|
1722 if (e) { |
|
1723 self.inState.click = !self.inState.click; |
|
1724 if (self.isInStateTrue()) self.enter(self); |
|
1725 else self.leave(self) |
|
1726 } else { |
|
1727 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) |
|
1728 } |
|
1729 }; |
|
1730 |
|
1731 Tooltip.prototype.destroy = function () { |
|
1732 var that = this; |
|
1733 clearTimeout(this.timeout); |
|
1734 this.hide(function () { |
|
1735 that.$element.off('.' + that.type).removeData('bs.' + that.type); |
|
1736 if (that.$tip) { |
|
1737 that.$tip.detach() |
|
1738 } |
|
1739 that.$tip = null; |
|
1740 that.$arrow = null; |
|
1741 that.$viewport = null |
|
1742 }) |
|
1743 }; |
|
1744 |
|
1745 |
|
1746 // TOOLTIP PLUGIN DEFINITION |
|
1747 // ========================= |
|
1748 |
|
1749 function Plugin(option) { |
|
1750 return this.each(function () { |
|
1751 var $this = $(this); |
|
1752 var data = $this.data('bs.tooltip'); |
|
1753 var options = typeof option == 'object' && option; |
|
1754 |
|
1755 if (!data && /destroy|hide/.test(option)) return; |
|
1756 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))); |
|
1757 if (typeof option == 'string') data[option]() |
|
1758 }) |
|
1759 } |
|
1760 |
|
1761 var old = $.fn.tooltip; |
|
1762 |
|
1763 $.fn.tooltip = Plugin; |
|
1764 $.fn.tooltip.Constructor = Tooltip; |
|
1765 |
|
1766 |
|
1767 // TOOLTIP NO CONFLICT |
|
1768 // =================== |
|
1769 |
|
1770 $.fn.tooltip.noConflict = function () { |
|
1771 $.fn.tooltip = old; |
|
1772 return this |
|
1773 } |
|
1774 |
|
1775 }(jQuery); |
|
1776 |
|
1777 /* ======================================================================== |
|
1778 * Bootstrap: popover.js v3.3.5 |
|
1779 * http://getbootstrap.com/javascript/#popovers |
|
1780 * ======================================================================== |
|
1781 * Copyright 2011-2015 Twitter, Inc. |
|
1782 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
1783 * ======================================================================== */ |
|
1784 |
|
1785 |
|
1786 +function ($) { |
|
1787 'use strict'; |
|
1788 |
|
1789 // POPOVER PUBLIC CLASS DEFINITION |
|
1790 // =============================== |
|
1791 |
|
1792 var Popover = function (element, options) { |
|
1793 this.init('popover', element, options) |
|
1794 }; |
|
1795 |
|
1796 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js'); |
|
1797 |
|
1798 Popover.VERSION = '3.3.5'; |
|
1799 |
|
1800 Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, { |
|
1801 placement: 'right', |
|
1802 trigger: 'click', |
|
1803 content: '', |
|
1804 template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' |
|
1805 }); |
|
1806 |
|
1807 |
|
1808 // NOTE: POPOVER EXTENDS tooltip.js |
|
1809 // ================================ |
|
1810 |
|
1811 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype); |
|
1812 |
|
1813 Popover.prototype.constructor = Popover; |
|
1814 |
|
1815 Popover.prototype.getDefaults = function () { |
|
1816 return Popover.DEFAULTS |
|
1817 }; |
|
1818 |
|
1819 Popover.prototype.setContent = function () { |
|
1820 var $tip = this.tip(); |
|
1821 var title = this.getTitle(); |
|
1822 var content = this.getContent(); |
|
1823 |
|
1824 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title); |
|
1825 $tip.find('.popover-content').children().detach().end()[ // we use append for html objects to maintain js events |
|
1826 this.options.html ? (typeof content == 'string' ? 'html' : 'append') : 'text' |
|
1827 ](content); |
|
1828 |
|
1829 $tip.removeClass('fade top bottom left right in'); |
|
1830 |
|
1831 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do |
|
1832 // this manually by checking the contents. |
|
1833 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() |
|
1834 }; |
|
1835 |
|
1836 Popover.prototype.hasContent = function () { |
|
1837 return this.getTitle() || this.getContent() |
|
1838 }; |
|
1839 |
|
1840 Popover.prototype.getContent = function () { |
|
1841 var $e = this.$element; |
|
1842 var o = this.options; |
|
1843 |
|
1844 return $e.attr('data-content') |
|
1845 || (typeof o.content == 'function' ? |
|
1846 o.content.call($e[0]) : |
|
1847 o.content) |
|
1848 }; |
|
1849 |
|
1850 Popover.prototype.arrow = function () { |
|
1851 return (this.$arrow = this.$arrow || this.tip().find('.arrow')) |
|
1852 }; |
|
1853 |
|
1854 |
|
1855 // POPOVER PLUGIN DEFINITION |
|
1856 // ========================= |
|
1857 |
|
1858 function Plugin(option) { |
|
1859 return this.each(function () { |
|
1860 var $this = $(this); |
|
1861 var data = $this.data('bs.popover'); |
|
1862 var options = typeof option == 'object' && option; |
|
1863 |
|
1864 if (!data && /destroy|hide/.test(option)) return; |
|
1865 if (!data) $this.data('bs.popover', (data = new Popover(this, options))); |
|
1866 if (typeof option == 'string') data[option]() |
|
1867 }) |
|
1868 } |
|
1869 |
|
1870 var old = $.fn.popover; |
|
1871 |
|
1872 $.fn.popover = Plugin; |
|
1873 $.fn.popover.Constructor = Popover; |
|
1874 |
|
1875 |
|
1876 // POPOVER NO CONFLICT |
|
1877 // =================== |
|
1878 |
|
1879 $.fn.popover.noConflict = function () { |
|
1880 $.fn.popover = old; |
|
1881 return this |
|
1882 } |
|
1883 |
|
1884 }(jQuery); |
|
1885 |
|
1886 /* ======================================================================== |
|
1887 * Bootstrap: scrollspy.js v3.3.5 |
|
1888 * http://getbootstrap.com/javascript/#scrollspy |
|
1889 * ======================================================================== |
|
1890 * Copyright 2011-2015 Twitter, Inc. |
|
1891 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
1892 * ======================================================================== */ |
|
1893 |
|
1894 |
|
1895 +function ($) { |
|
1896 'use strict'; |
|
1897 |
|
1898 // SCROLLSPY CLASS DEFINITION |
|
1899 // ========================== |
|
1900 |
|
1901 function ScrollSpy(element, options) { |
|
1902 this.$body = $(document.body); |
|
1903 this.$scrollElement = $(element).is(document.body) ? $(window) : $(element); |
|
1904 this.options = $.extend({}, ScrollSpy.DEFAULTS, options); |
|
1905 this.selector = (this.options.target || '') + ' .nav li > a'; |
|
1906 this.offsets = []; |
|
1907 this.targets = []; |
|
1908 this.activeTarget = null; |
|
1909 this.scrollHeight = 0; |
|
1910 |
|
1911 this.$scrollElement.on('scroll.bs.scrollspy', $.proxy(this.process, this)); |
|
1912 this.refresh(); |
|
1913 this.process() |
|
1914 } |
|
1915 |
|
1916 ScrollSpy.VERSION = '3.3.5'; |
|
1917 |
|
1918 ScrollSpy.DEFAULTS = { |
|
1919 offset: 10 |
|
1920 }; |
|
1921 |
|
1922 ScrollSpy.prototype.getScrollHeight = function () { |
|
1923 return this.$scrollElement[0].scrollHeight || Math.max(this.$body[0].scrollHeight, document.documentElement.scrollHeight) |
|
1924 }; |
|
1925 |
|
1926 ScrollSpy.prototype.refresh = function () { |
|
1927 var that = this; |
|
1928 var offsetMethod = 'offset'; |
|
1929 var offsetBase = 0; |
|
1930 |
|
1931 this.offsets = []; |
|
1932 this.targets = []; |
|
1933 this.scrollHeight = this.getScrollHeight(); |
|
1934 |
|
1935 if (!$.isWindow(this.$scrollElement[0])) { |
|
1936 offsetMethod = 'position'; |
|
1937 offsetBase = this.$scrollElement.scrollTop() |
|
1938 } |
|
1939 |
|
1940 this.$body |
|
1941 .find(this.selector) |
|
1942 .map(function () { |
|
1943 var $el = $(this); |
|
1944 var href = $el.data('target') || $el.attr('href'); |
|
1945 var $href = /^#./.test(href) && $(href); |
|
1946 |
|
1947 return ($href |
|
1948 && $href.length |
|
1949 && $href.is(':visible') |
|
1950 && [[$href[offsetMethod]().top + offsetBase, href]]) || null |
|
1951 }) |
|
1952 .sort(function (a, b) { |
|
1953 return a[0] - b[0] |
|
1954 }) |
|
1955 .each(function () { |
|
1956 that.offsets.push(this[0]); |
|
1957 that.targets.push(this[1]) |
|
1958 }) |
|
1959 }; |
|
1960 |
|
1961 ScrollSpy.prototype.process = function () { |
|
1962 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset; |
|
1963 var scrollHeight = this.getScrollHeight(); |
|
1964 var maxScroll = this.options.offset + scrollHeight - this.$scrollElement.height(); |
|
1965 var offsets = this.offsets; |
|
1966 var targets = this.targets; |
|
1967 var activeTarget = this.activeTarget; |
|
1968 var i; |
|
1969 |
|
1970 if (this.scrollHeight != scrollHeight) { |
|
1971 this.refresh() |
|
1972 } |
|
1973 |
|
1974 if (scrollTop >= maxScroll) { |
|
1975 return activeTarget != (i = targets[targets.length - 1]) && this.activate(i) |
|
1976 } |
|
1977 |
|
1978 if (activeTarget && scrollTop < offsets[0]) { |
|
1979 this.activeTarget = null; |
|
1980 return this.clear() |
|
1981 } |
|
1982 |
|
1983 for (i = offsets.length; i--;) { |
|
1984 activeTarget != targets[i] |
|
1985 && scrollTop >= offsets[i] |
|
1986 && (offsets[i + 1] === undefined || scrollTop < offsets[i + 1]) |
|
1987 && this.activate(targets[i]) |
|
1988 } |
|
1989 }; |
|
1990 |
|
1991 ScrollSpy.prototype.activate = function (target) { |
|
1992 this.activeTarget = target; |
|
1993 |
|
1994 this.clear(); |
|
1995 |
|
1996 var selector = this.selector + |
|
1997 '[data-target="' + target + '"],' + |
|
1998 this.selector + '[href="' + target + '"]'; |
|
1999 |
|
2000 var active = $(selector) |
|
2001 .parents('li') |
|
2002 .addClass('active'); |
|
2003 |
|
2004 if (active.parent('.dropdown-menu').length) { |
|
2005 active = active |
|
2006 .closest('li.dropdown') |
|
2007 .addClass('active') |
|
2008 } |
|
2009 |
|
2010 active.trigger('activate.bs.scrollspy') |
|
2011 }; |
|
2012 |
|
2013 ScrollSpy.prototype.clear = function () { |
|
2014 $(this.selector) |
|
2015 .parentsUntil(this.options.target, '.active') |
|
2016 .removeClass('active') |
|
2017 }; |
|
2018 |
|
2019 |
|
2020 // SCROLLSPY PLUGIN DEFINITION |
|
2021 // =========================== |
|
2022 |
|
2023 function Plugin(option) { |
|
2024 return this.each(function () { |
|
2025 var $this = $(this); |
|
2026 var data = $this.data('bs.scrollspy'); |
|
2027 var options = typeof option == 'object' && option; |
|
2028 |
|
2029 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))); |
|
2030 if (typeof option == 'string') data[option]() |
|
2031 }) |
|
2032 } |
|
2033 |
|
2034 var old = $.fn.scrollspy; |
|
2035 |
|
2036 $.fn.scrollspy = Plugin; |
|
2037 $.fn.scrollspy.Constructor = ScrollSpy; |
|
2038 |
|
2039 |
|
2040 // SCROLLSPY NO CONFLICT |
|
2041 // ===================== |
|
2042 |
|
2043 $.fn.scrollspy.noConflict = function () { |
|
2044 $.fn.scrollspy = old; |
|
2045 return this |
|
2046 }; |
|
2047 |
|
2048 |
|
2049 // SCROLLSPY DATA-API |
|
2050 // ================== |
|
2051 |
|
2052 $(window).on('load.bs.scrollspy.data-api', function () { |
|
2053 $('[data-spy="scroll"]').each(function () { |
|
2054 var $spy = $(this); |
|
2055 Plugin.call($spy, $spy.data()) |
|
2056 }) |
|
2057 }) |
|
2058 |
|
2059 }(jQuery); |
|
2060 |
|
2061 /* ======================================================================== |
|
2062 * Bootstrap: tab.js v3.3.5 |
|
2063 * http://getbootstrap.com/javascript/#tabs |
|
2064 * ======================================================================== |
|
2065 * Copyright 2011-2015 Twitter, Inc. |
|
2066 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
2067 * ======================================================================== */ |
|
2068 |
|
2069 |
|
2070 +function ($) { |
|
2071 'use strict'; |
|
2072 |
|
2073 // TAB CLASS DEFINITION |
|
2074 // ==================== |
|
2075 |
|
2076 var Tab = function (element) { |
|
2077 // jscs:disable requireDollarBeforejQueryAssignment |
|
2078 this.element = $(element); |
|
2079 // jscs:enable requireDollarBeforejQueryAssignment |
|
2080 }; |
|
2081 |
|
2082 Tab.VERSION = '3.3.5'; |
|
2083 |
|
2084 Tab.TRANSITION_DURATION = 150; |
|
2085 |
|
2086 Tab.prototype.show = function () { |
|
2087 var $this = this.element; |
|
2088 var $ul = $this.closest('ul:not(.dropdown-menu)'); |
|
2089 var selector = $this.data('target'); |
|
2090 |
|
2091 if (!selector) { |
|
2092 selector = $this.attr('href'); |
|
2093 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, ''); // strip for ie7 |
|
2094 } |
|
2095 |
|
2096 if ($this.parent('li').hasClass('active')) return; |
|
2097 |
|
2098 var $previous = $ul.find('.active:last a'); |
|
2099 var hideEvent = $.Event('hide.bs.tab', { |
|
2100 relatedTarget: $this[0] |
|
2101 }); |
|
2102 var showEvent = $.Event('show.bs.tab', { |
|
2103 relatedTarget: $previous[0] |
|
2104 }); |
|
2105 |
|
2106 $previous.trigger(hideEvent); |
|
2107 $this.trigger(showEvent); |
|
2108 |
|
2109 if (showEvent.isDefaultPrevented() || hideEvent.isDefaultPrevented()) return; |
|
2110 |
|
2111 var $target = $(selector); |
|
2112 |
|
2113 this.activate($this.closest('li'), $ul); |
|
2114 this.activate($target, $target.parent(), function () { |
|
2115 $previous.trigger({ |
|
2116 type: 'hidden.bs.tab', |
|
2117 relatedTarget: $this[0] |
|
2118 }); |
|
2119 $this.trigger({ |
|
2120 type: 'shown.bs.tab', |
|
2121 relatedTarget: $previous[0] |
|
2122 }) |
|
2123 }) |
|
2124 }; |
|
2125 |
|
2126 Tab.prototype.activate = function (element, container, callback) { |
|
2127 var $active = container.find('> .active'); |
|
2128 var transition = callback |
|
2129 && $.support.transition |
|
2130 && ($active.length && $active.hasClass('fade') || !!container.find('> .fade').length); |
|
2131 |
|
2132 function next() { |
|
2133 $active |
|
2134 .removeClass('active') |
|
2135 .find('> .dropdown-menu > .active') |
|
2136 .removeClass('active') |
|
2137 .end() |
|
2138 .find('[data-toggle="tab"]') |
|
2139 .attr('aria-expanded', false); |
|
2140 |
|
2141 element |
|
2142 .addClass('active') |
|
2143 .find('[data-toggle="tab"]') |
|
2144 .attr('aria-expanded', true); |
|
2145 |
|
2146 if (transition) { |
|
2147 element[0].offsetWidth; // reflow for transition |
|
2148 element.addClass('in') |
|
2149 } else { |
|
2150 element.removeClass('fade') |
|
2151 } |
|
2152 |
|
2153 if (element.parent('.dropdown-menu').length) { |
|
2154 element |
|
2155 .closest('li.dropdown') |
|
2156 .addClass('active') |
|
2157 .end() |
|
2158 .find('[data-toggle="tab"]') |
|
2159 .attr('aria-expanded', true) |
|
2160 } |
|
2161 |
|
2162 callback && callback() |
|
2163 } |
|
2164 |
|
2165 $active.length && transition ? |
|
2166 $active |
|
2167 .one('bsTransitionEnd', next) |
|
2168 .emulateTransitionEnd(Tab.TRANSITION_DURATION) : |
|
2169 next(); |
|
2170 |
|
2171 $active.removeClass('in') |
|
2172 }; |
|
2173 |
|
2174 |
|
2175 // TAB PLUGIN DEFINITION |
|
2176 // ===================== |
|
2177 |
|
2178 function Plugin(option) { |
|
2179 return this.each(function () { |
|
2180 var $this = $(this); |
|
2181 var data = $this.data('bs.tab'); |
|
2182 |
|
2183 if (!data) $this.data('bs.tab', (data = new Tab(this))); |
|
2184 if (typeof option == 'string') data[option]() |
|
2185 }) |
|
2186 } |
|
2187 |
|
2188 var old = $.fn.tab; |
|
2189 |
|
2190 $.fn.tab = Plugin; |
|
2191 $.fn.tab.Constructor = Tab; |
|
2192 |
|
2193 |
|
2194 // TAB NO CONFLICT |
|
2195 // =============== |
|
2196 |
|
2197 $.fn.tab.noConflict = function () { |
|
2198 $.fn.tab = old; |
|
2199 return this |
|
2200 }; |
|
2201 |
|
2202 |
|
2203 // TAB DATA-API |
|
2204 // ============ |
|
2205 |
|
2206 var clickHandler = function (e) { |
|
2207 e.preventDefault(); |
|
2208 Plugin.call($(this), 'show') |
|
2209 }; |
|
2210 |
|
2211 $(document) |
|
2212 .on('click.bs.tab.data-api', '[data-toggle="tab"]', clickHandler) |
|
2213 .on('click.bs.tab.data-api', '[data-toggle="pill"]', clickHandler) |
|
2214 |
|
2215 }(jQuery); |
|
2216 |
|
2217 /* ======================================================================== |
|
2218 * Bootstrap: affix.js v3.3.5 |
|
2219 * http://getbootstrap.com/javascript/#affix |
|
2220 * ======================================================================== |
|
2221 * Copyright 2011-2015 Twitter, Inc. |
|
2222 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/master/LICENSE) |
|
2223 * ======================================================================== */ |
|
2224 |
|
2225 |
|
2226 +function ($) { |
|
2227 'use strict'; |
|
2228 |
|
2229 // AFFIX CLASS DEFINITION |
|
2230 // ====================== |
|
2231 |
|
2232 var Affix = function (element, options) { |
|
2233 this.options = $.extend({}, Affix.DEFAULTS, options); |
|
2234 |
|
2235 this.$target = $(this.options.target) |
|
2236 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) |
|
2237 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)); |
|
2238 |
|
2239 this.$element = $(element); |
|
2240 this.affixed = null; |
|
2241 this.unpin = null; |
|
2242 this.pinnedOffset = null; |
|
2243 |
|
2244 this.checkPosition() |
|
2245 }; |
|
2246 |
|
2247 Affix.VERSION = '3.3.5'; |
|
2248 |
|
2249 Affix.RESET = 'affix affix-top affix-bottom'; |
|
2250 |
|
2251 Affix.DEFAULTS = { |
|
2252 offset: 0, |
|
2253 target: window |
|
2254 }; |
|
2255 |
|
2256 Affix.prototype.getState = function (scrollHeight, height, offsetTop, offsetBottom) { |
|
2257 var scrollTop = this.$target.scrollTop(); |
|
2258 var position = this.$element.offset(); |
|
2259 var targetHeight = this.$target.height(); |
|
2260 |
|
2261 if (offsetTop != null && this.affixed == 'top') return scrollTop < offsetTop ? 'top' : false; |
|
2262 |
|
2263 if (this.affixed == 'bottom') { |
|
2264 if (offsetTop != null) return (scrollTop + this.unpin <= position.top) ? false : 'bottom'; |
|
2265 return (scrollTop + targetHeight <= scrollHeight - offsetBottom) ? false : 'bottom' |
|
2266 } |
|
2267 |
|
2268 var initializing = this.affixed == null; |
|
2269 var colliderTop = initializing ? scrollTop : position.top; |
|
2270 var colliderHeight = initializing ? targetHeight : height; |
|
2271 |
|
2272 if (offsetTop != null && scrollTop <= offsetTop) return 'top'; |
|
2273 if (offsetBottom != null && (colliderTop + colliderHeight >= scrollHeight - offsetBottom)) return 'bottom'; |
|
2274 |
|
2275 return false |
|
2276 }; |
|
2277 |
|
2278 Affix.prototype.getPinnedOffset = function () { |
|
2279 if (this.pinnedOffset) return this.pinnedOffset; |
|
2280 this.$element.removeClass(Affix.RESET).addClass('affix'); |
|
2281 var scrollTop = this.$target.scrollTop(); |
|
2282 var position = this.$element.offset(); |
|
2283 return (this.pinnedOffset = position.top - scrollTop) |
|
2284 }; |
|
2285 |
|
2286 Affix.prototype.checkPositionWithEventLoop = function () { |
|
2287 setTimeout($.proxy(this.checkPosition, this), 1) |
|
2288 }; |
|
2289 |
|
2290 Affix.prototype.checkPosition = function () { |
|
2291 if (!this.$element.is(':visible')) return; |
|
2292 |
|
2293 var height = this.$element.height(); |
|
2294 var offset = this.options.offset; |
|
2295 var offsetTop = offset.top; |
|
2296 var offsetBottom = offset.bottom; |
|
2297 var scrollHeight = Math.max($(document).height(), $(document.body).height()); |
|
2298 |
|
2299 if (typeof offset != 'object') offsetBottom = offsetTop = offset; |
|
2300 if (typeof offsetTop == 'function') offsetTop = offset.top(this.$element); |
|
2301 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom(this.$element); |
|
2302 |
|
2303 var affix = this.getState(scrollHeight, height, offsetTop, offsetBottom); |
|
2304 |
|
2305 if (this.affixed != affix) { |
|
2306 if (this.unpin != null) this.$element.css('top', ''); |
|
2307 |
|
2308 var affixType = 'affix' + (affix ? '-' + affix : ''); |
|
2309 var e = $.Event(affixType + '.bs.affix'); |
|
2310 |
|
2311 this.$element.trigger(e); |
|
2312 |
|
2313 if (e.isDefaultPrevented()) return; |
|
2314 |
|
2315 this.affixed = affix; |
|
2316 this.unpin = affix == 'bottom' ? this.getPinnedOffset() : null; |
|
2317 |
|
2318 this.$element |
|
2319 .removeClass(Affix.RESET) |
|
2320 .addClass(affixType) |
|
2321 .trigger(affixType.replace('affix', 'affixed') + '.bs.affix') |
|
2322 } |
|
2323 |
|
2324 if (affix == 'bottom') { |
|
2325 this.$element.offset({ |
|
2326 top: scrollHeight - height - offsetBottom |
|
2327 }) |
|
2328 } |
|
2329 }; |
|
2330 |
|
2331 |
|
2332 // AFFIX PLUGIN DEFINITION |
|
2333 // ======================= |
|
2334 |
|
2335 function Plugin(option) { |
|
2336 return this.each(function () { |
|
2337 var $this = $(this); |
|
2338 var data = $this.data('bs.affix'); |
|
2339 var options = typeof option == 'object' && option; |
|
2340 |
|
2341 if (!data) $this.data('bs.affix', (data = new Affix(this, options))); |
|
2342 if (typeof option == 'string') data[option]() |
|
2343 }) |
|
2344 } |
|
2345 |
|
2346 var old = $.fn.affix; |
|
2347 |
|
2348 $.fn.affix = Plugin; |
|
2349 $.fn.affix.Constructor = Affix; |
|
2350 |
|
2351 |
|
2352 // AFFIX NO CONFLICT |
|
2353 // ================= |
|
2354 |
|
2355 $.fn.affix.noConflict = function () { |
|
2356 $.fn.affix = old; |
|
2357 return this |
|
2358 }; |
|
2359 |
|
2360 |
|
2361 // AFFIX DATA-API |
|
2362 // ============== |
|
2363 |
|
2364 $(window).on('load', function () { |
|
2365 $('[data-spy="affix"]').each(function () { |
|
2366 var $spy = $(this); |
|
2367 var data = $spy.data(); |
|
2368 |
|
2369 data.offset = data.offset || {}; |
|
2370 |
|
2371 if (data.offsetBottom != null) data.offset.bottom = data.offsetBottom; |
|
2372 if (data.offsetTop != null) data.offset.top = data.offsetTop; |
|
2373 |
|
2374 Plugin.call($spy, data) |
|
2375 }) |
|
2376 }) |
|
2377 |
|
2378 }(jQuery); |