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