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