File indexing completed on 2024-05-19 06:00:16
0001 /*! 0002 * Bootstrap v3.0.3 (http://getbootstrap.com) 0003 * Copyright 2013 Twitter, Inc. 0004 * Licensed under http://www.apache.org/licenses/LICENSE-2.0 0005 */ 0006 0007 if (typeof jQuery === "undefined") { throw new Error("Bootstrap requires jQuery") } 0008 0009 /* ======================================================================== 0010 * Bootstrap: transition.js v3.0.3 0011 * http://getbootstrap.com/javascript/#transitions 0012 * ======================================================================== 0013 * Copyright 2013 Twitter, Inc. 0014 * 0015 * Licensed under the Apache License, Version 2.0 (the "License"); 0016 * you may not use this file except in compliance with the License. 0017 * You may obtain a copy of the License at 0018 * 0019 * http://www.apache.org/licenses/LICENSE-2.0 0020 * 0021 * Unless required by applicable law or agreed to in writing, software 0022 * distributed under the License is distributed on an "AS IS" BASIS, 0023 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0024 * See the License for the specific language governing permissions and 0025 * limitations under the License. 0026 * ======================================================================== */ 0027 0028 0029 +function ($) { "use strict"; 0030 0031 // CSS TRANSITION SUPPORT (Shoutout: http://www.modernizr.com/) 0032 // ============================================================ 0033 0034 function transitionEnd() { 0035 var el = document.createElement('bootstrap') 0036 0037 var transEndEventNames = { 0038 'WebkitTransition' : 'webkitTransitionEnd' 0039 , 'MozTransition' : 'transitionend' 0040 , 'OTransition' : 'oTransitionEnd otransitionend' 0041 , 'transition' : 'transitionend' 0042 } 0043 0044 for (var name in transEndEventNames) { 0045 if (el.style[name] !== undefined) { 0046 return { end: transEndEventNames[name] } 0047 } 0048 } 0049 } 0050 0051 // http://blog.alexmaccaw.com/css-transitions 0052 $.fn.emulateTransitionEnd = function (duration) { 0053 var called = false, $el = this 0054 $(this).one($.support.transition.end, function () { called = true }) 0055 var callback = function () { if (!called) $($el).trigger($.support.transition.end) } 0056 setTimeout(callback, duration) 0057 return this 0058 } 0059 0060 $(function () { 0061 $.support.transition = transitionEnd() 0062 }) 0063 0064 }(jQuery); 0065 0066 /* ======================================================================== 0067 * Bootstrap: alert.js v3.0.3 0068 * http://getbootstrap.com/javascript/#alerts 0069 * ======================================================================== 0070 * Copyright 2013 Twitter, Inc. 0071 * 0072 * Licensed under the Apache License, Version 2.0 (the "License"); 0073 * you may not use this file except in compliance with the License. 0074 * You may obtain a copy of the License at 0075 * 0076 * http://www.apache.org/licenses/LICENSE-2.0 0077 * 0078 * Unless required by applicable law or agreed to in writing, software 0079 * distributed under the License is distributed on an "AS IS" BASIS, 0080 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0081 * See the License for the specific language governing permissions and 0082 * limitations under the License. 0083 * ======================================================================== */ 0084 0085 0086 +function ($) { "use strict"; 0087 0088 // ALERT CLASS DEFINITION 0089 // ====================== 0090 0091 var dismiss = '[data-dismiss="alert"]' 0092 var Alert = function (el) { 0093 $(el).on('click', dismiss, this.close) 0094 } 0095 0096 Alert.prototype.close = function (e) { 0097 var $this = $(this) 0098 var selector = $this.attr('data-target') 0099 0100 if (!selector) { 0101 selector = $this.attr('href') 0102 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7 0103 } 0104 0105 var $parent = $(selector) 0106 0107 if (e) e.preventDefault() 0108 0109 if (!$parent.length) { 0110 $parent = $this.hasClass('alert') ? $this : $this.parent() 0111 } 0112 0113 $parent.trigger(e = $.Event('close.bs.alert')) 0114 0115 if (e.isDefaultPrevented()) return 0116 0117 $parent.removeClass('in') 0118 0119 function removeElement() { 0120 $parent.trigger('closed.bs.alert').remove() 0121 } 0122 0123 $.support.transition && $parent.hasClass('fade') ? 0124 $parent 0125 .one($.support.transition.end, removeElement) 0126 .emulateTransitionEnd(150) : 0127 removeElement() 0128 } 0129 0130 0131 // ALERT PLUGIN DEFINITION 0132 // ======================= 0133 0134 var old = $.fn.alert 0135 0136 $.fn.alert = function (option) { 0137 return this.each(function () { 0138 var $this = $(this) 0139 var data = $this.data('bs.alert') 0140 0141 if (!data) $this.data('bs.alert', (data = new Alert(this))) 0142 if (typeof option == 'string') data[option].call($this) 0143 }) 0144 } 0145 0146 $.fn.alert.Constructor = Alert 0147 0148 0149 // ALERT NO CONFLICT 0150 // ================= 0151 0152 $.fn.alert.noConflict = function () { 0153 $.fn.alert = old 0154 return this 0155 } 0156 0157 0158 // ALERT DATA-API 0159 // ============== 0160 0161 $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close) 0162 0163 }(jQuery); 0164 0165 /* ======================================================================== 0166 * Bootstrap: button.js v3.0.3 0167 * http://getbootstrap.com/javascript/#buttons 0168 * ======================================================================== 0169 * Copyright 2013 Twitter, Inc. 0170 * 0171 * Licensed under the Apache License, Version 2.0 (the "License"); 0172 * you may not use this file except in compliance with the License. 0173 * You may obtain a copy of the License at 0174 * 0175 * http://www.apache.org/licenses/LICENSE-2.0 0176 * 0177 * Unless required by applicable law or agreed to in writing, software 0178 * distributed under the License is distributed on an "AS IS" BASIS, 0179 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0180 * See the License for the specific language governing permissions and 0181 * limitations under the License. 0182 * ======================================================================== */ 0183 0184 0185 +function ($) { "use strict"; 0186 0187 // BUTTON PUBLIC CLASS DEFINITION 0188 // ============================== 0189 0190 var Button = function (element, options) { 0191 this.$element = $(element) 0192 this.options = $.extend({}, Button.DEFAULTS, options) 0193 } 0194 0195 Button.DEFAULTS = { 0196 loadingText: 'loading...' 0197 } 0198 0199 Button.prototype.setState = function (state) { 0200 var d = 'disabled' 0201 var $el = this.$element 0202 var val = $el.is('input') ? 'val' : 'html' 0203 var data = $el.data() 0204 0205 state = state + 'Text' 0206 0207 if (!data.resetText) $el.data('resetText', $el[val]()) 0208 0209 $el[val](data[state] || this.options[state]) 0210 0211 // push to event loop to allow forms to submit 0212 setTimeout(function () { 0213 state == 'loadingText' ? 0214 $el.addClass(d).attr(d, d) : 0215 $el.removeClass(d).removeAttr(d); 0216 }, 0) 0217 } 0218 0219 Button.prototype.toggle = function () { 0220 var $parent = this.$element.closest('[data-toggle="buttons"]') 0221 var changed = true 0222 0223 if ($parent.length) { 0224 var $input = this.$element.find('input') 0225 if ($input.prop('type') === 'radio') { 0226 // see if clicking on current one 0227 if ($input.prop('checked') && this.$element.hasClass('active')) 0228 changed = false 0229 else 0230 $parent.find('.active').removeClass('active') 0231 } 0232 if (changed) $input.prop('checked', !this.$element.hasClass('active')).trigger('change') 0233 } 0234 0235 if (changed) this.$element.toggleClass('active') 0236 } 0237 0238 0239 // BUTTON PLUGIN DEFINITION 0240 // ======================== 0241 0242 var old = $.fn.button 0243 0244 $.fn.button = function (option) { 0245 return this.each(function () { 0246 var $this = $(this) 0247 var data = $this.data('bs.button') 0248 var options = typeof option == 'object' && option 0249 0250 if (!data) $this.data('bs.button', (data = new Button(this, options))) 0251 0252 if (option == 'toggle') data.toggle() 0253 else if (option) data.setState(option) 0254 }) 0255 } 0256 0257 $.fn.button.Constructor = Button 0258 0259 0260 // BUTTON NO CONFLICT 0261 // ================== 0262 0263 $.fn.button.noConflict = function () { 0264 $.fn.button = old 0265 return this 0266 } 0267 0268 0269 // BUTTON DATA-API 0270 // =============== 0271 0272 $(document).on('click.bs.button.data-api', '[data-toggle^=button]', function (e) { 0273 var $btn = $(e.target) 0274 if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') 0275 $btn.button('toggle') 0276 e.preventDefault() 0277 }) 0278 0279 }(jQuery); 0280 0281 /* ======================================================================== 0282 * Bootstrap: carousel.js v3.0.3 0283 * http://getbootstrap.com/javascript/#carousel 0284 * ======================================================================== 0285 * Copyright 2013 Twitter, Inc. 0286 * 0287 * Licensed under the Apache License, Version 2.0 (the "License"); 0288 * you may not use this file except in compliance with the License. 0289 * You may obtain a copy of the License at 0290 * 0291 * http://www.apache.org/licenses/LICENSE-2.0 0292 * 0293 * Unless required by applicable law or agreed to in writing, software 0294 * distributed under the License is distributed on an "AS IS" BASIS, 0295 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0296 * See the License for the specific language governing permissions and 0297 * limitations under the License. 0298 * ======================================================================== */ 0299 0300 0301 +function ($) { "use strict"; 0302 0303 // CAROUSEL CLASS DEFINITION 0304 // ========================= 0305 0306 var Carousel = function (element, options) { 0307 this.$element = $(element) 0308 this.$indicators = this.$element.find('.carousel-indicators') 0309 this.options = options 0310 this.paused = 0311 this.sliding = 0312 this.interval = 0313 this.$active = 0314 this.$items = null 0315 0316 this.options.pause == 'hover' && this.$element 0317 .on('mouseenter', $.proxy(this.pause, this)) 0318 .on('mouseleave', $.proxy(this.cycle, this)) 0319 } 0320 0321 Carousel.DEFAULTS = { 0322 interval: 5000 0323 , pause: 'hover' 0324 , wrap: true 0325 } 0326 0327 Carousel.prototype.cycle = function (e) { 0328 e || (this.paused = false) 0329 0330 this.interval && clearInterval(this.interval) 0331 0332 this.options.interval 0333 && !this.paused 0334 && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) 0335 0336 return this 0337 } 0338 0339 Carousel.prototype.getActiveIndex = function () { 0340 this.$active = this.$element.find('.item.active') 0341 this.$items = this.$active.parent().children() 0342 0343 return this.$items.index(this.$active) 0344 } 0345 0346 Carousel.prototype.to = function (pos) { 0347 var that = this 0348 var activeIndex = this.getActiveIndex() 0349 0350 if (pos > (this.$items.length - 1) || pos < 0) return 0351 0352 if (this.sliding) return this.$element.one('slid.bs.carousel', function () { that.to(pos) }) 0353 if (activeIndex == pos) return this.pause().cycle() 0354 0355 return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) 0356 } 0357 0358 Carousel.prototype.pause = function (e) { 0359 e || (this.paused = true) 0360 0361 if (this.$element.find('.next, .prev').length && $.support.transition.end) { 0362 this.$element.trigger($.support.transition.end) 0363 this.cycle(true) 0364 } 0365 0366 this.interval = clearInterval(this.interval) 0367 0368 return this 0369 } 0370 0371 Carousel.prototype.next = function () { 0372 if (this.sliding) return 0373 return this.slide('next') 0374 } 0375 0376 Carousel.prototype.prev = function () { 0377 if (this.sliding) return 0378 return this.slide('prev') 0379 } 0380 0381 Carousel.prototype.slide = function (type, next) { 0382 var $active = this.$element.find('.item.active') 0383 var $next = next || $active[type]() 0384 var isCycling = this.interval 0385 var direction = type == 'next' ? 'left' : 'right' 0386 var fallback = type == 'next' ? 'first' : 'last' 0387 var that = this 0388 0389 if (!$next.length) { 0390 if (!this.options.wrap) return 0391 $next = this.$element.find('.item')[fallback]() 0392 } 0393 0394 this.sliding = true 0395 0396 isCycling && this.pause() 0397 0398 var e = $.Event('slide.bs.carousel', { relatedTarget: $next[0], direction: direction }) 0399 0400 if ($next.hasClass('active')) return 0401 0402 if (this.$indicators.length) { 0403 this.$indicators.find('.active').removeClass('active') 0404 this.$element.one('slid.bs.carousel', function () { 0405 var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) 0406 $nextIndicator && $nextIndicator.addClass('active') 0407 }) 0408 } 0409 0410 if ($.support.transition && this.$element.hasClass('slide')) { 0411 this.$element.trigger(e) 0412 if (e.isDefaultPrevented()) return 0413 $next.addClass(type) 0414 $next[0].offsetWidth // force reflow 0415 $active.addClass(direction) 0416 $next.addClass(direction) 0417 $active 0418 .one($.support.transition.end, function () { 0419 $next.removeClass([type, direction].join(' ')).addClass('active') 0420 $active.removeClass(['active', direction].join(' ')) 0421 that.sliding = false 0422 setTimeout(function () { that.$element.trigger('slid.bs.carousel') }, 0) 0423 }) 0424 .emulateTransitionEnd(600) 0425 } else { 0426 this.$element.trigger(e) 0427 if (e.isDefaultPrevented()) return 0428 $active.removeClass('active') 0429 $next.addClass('active') 0430 this.sliding = false 0431 this.$element.trigger('slid.bs.carousel') 0432 } 0433 0434 isCycling && this.cycle() 0435 0436 return this 0437 } 0438 0439 0440 // CAROUSEL PLUGIN DEFINITION 0441 // ========================== 0442 0443 var old = $.fn.carousel 0444 0445 $.fn.carousel = function (option) { 0446 return this.each(function () { 0447 var $this = $(this) 0448 var data = $this.data('bs.carousel') 0449 var options = $.extend({}, Carousel.DEFAULTS, $this.data(), typeof option == 'object' && option) 0450 var action = typeof option == 'string' ? option : options.slide 0451 0452 if (!data) $this.data('bs.carousel', (data = new Carousel(this, options))) 0453 if (typeof option == 'number') data.to(option) 0454 else if (action) data[action]() 0455 else if (options.interval) data.pause().cycle() 0456 }) 0457 } 0458 0459 $.fn.carousel.Constructor = Carousel 0460 0461 0462 // CAROUSEL NO CONFLICT 0463 // ==================== 0464 0465 $.fn.carousel.noConflict = function () { 0466 $.fn.carousel = old 0467 return this 0468 } 0469 0470 0471 // CAROUSEL DATA-API 0472 // ================= 0473 0474 $(document).on('click.bs.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { 0475 var $this = $(this), href 0476 var $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 0477 var options = $.extend({}, $target.data(), $this.data()) 0478 var slideIndex = $this.attr('data-slide-to') 0479 if (slideIndex) options.interval = false 0480 0481 $target.carousel(options) 0482 0483 if (slideIndex = $this.attr('data-slide-to')) { 0484 $target.data('bs.carousel').to(slideIndex) 0485 } 0486 0487 e.preventDefault() 0488 }) 0489 0490 $(window).on('load', function () { 0491 $('[data-ride="carousel"]').each(function () { 0492 var $carousel = $(this) 0493 $carousel.carousel($carousel.data()) 0494 }) 0495 }) 0496 0497 }(jQuery); 0498 0499 /* ======================================================================== 0500 * Bootstrap: collapse.js v3.0.3 0501 * http://getbootstrap.com/javascript/#collapse 0502 * ======================================================================== 0503 * Copyright 2013 Twitter, Inc. 0504 * 0505 * Licensed under the Apache License, Version 2.0 (the "License"); 0506 * you may not use this file except in compliance with the License. 0507 * You may obtain a copy of the License at 0508 * 0509 * http://www.apache.org/licenses/LICENSE-2.0 0510 * 0511 * Unless required by applicable law or agreed to in writing, software 0512 * distributed under the License is distributed on an "AS IS" BASIS, 0513 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0514 * See the License for the specific language governing permissions and 0515 * limitations under the License. 0516 * ======================================================================== */ 0517 0518 0519 +function ($) { "use strict"; 0520 0521 // COLLAPSE PUBLIC CLASS DEFINITION 0522 // ================================ 0523 0524 var Collapse = function (element, options) { 0525 this.$element = $(element) 0526 this.options = $.extend({}, Collapse.DEFAULTS, options) 0527 this.transitioning = null 0528 0529 if (this.options.parent) this.$parent = $(this.options.parent) 0530 if (this.options.toggle) this.toggle() 0531 } 0532 0533 Collapse.DEFAULTS = { 0534 toggle: true 0535 } 0536 0537 Collapse.prototype.dimension = function () { 0538 var hasWidth = this.$element.hasClass('width') 0539 return hasWidth ? 'width' : 'height' 0540 } 0541 0542 Collapse.prototype.show = function () { 0543 if (this.transitioning || this.$element.hasClass('in')) return 0544 0545 var startEvent = $.Event('show.bs.collapse') 0546 this.$element.trigger(startEvent) 0547 if (startEvent.isDefaultPrevented()) return 0548 0549 var actives = this.$parent && this.$parent.find('> .panel > .in') 0550 0551 if (actives && actives.length) { 0552 var hasData = actives.data('bs.collapse') 0553 if (hasData && hasData.transitioning) return 0554 actives.collapse('hide') 0555 hasData || actives.data('bs.collapse', null) 0556 } 0557 0558 var dimension = this.dimension() 0559 0560 this.$element 0561 .removeClass('collapse') 0562 .addClass('collapsing') 0563 [dimension](0) 0564 0565 this.transitioning = 1 0566 0567 var complete = function () { 0568 this.$element 0569 .removeClass('collapsing') 0570 .addClass('in') 0571 [dimension]('auto') 0572 this.transitioning = 0 0573 this.$element.trigger('shown.bs.collapse') 0574 } 0575 0576 if (!$.support.transition) return complete.call(this) 0577 0578 var scrollSize = $.camelCase(['scroll', dimension].join('-')) 0579 0580 this.$element 0581 .one($.support.transition.end, $.proxy(complete, this)) 0582 .emulateTransitionEnd(350) 0583 [dimension](this.$element[0][scrollSize]) 0584 } 0585 0586 Collapse.prototype.hide = function () { 0587 if (this.transitioning || !this.$element.hasClass('in')) return 0588 0589 var startEvent = $.Event('hide.bs.collapse') 0590 this.$element.trigger(startEvent) 0591 if (startEvent.isDefaultPrevented()) return 0592 0593 var dimension = this.dimension() 0594 0595 this.$element 0596 [dimension](this.$element[dimension]()) 0597 [0].offsetHeight 0598 0599 this.$element 0600 .addClass('collapsing') 0601 .removeClass('collapse') 0602 .removeClass('in') 0603 0604 this.transitioning = 1 0605 0606 var complete = function () { 0607 this.transitioning = 0 0608 this.$element 0609 .trigger('hidden.bs.collapse') 0610 .removeClass('collapsing') 0611 .addClass('collapse') 0612 } 0613 0614 if (!$.support.transition) return complete.call(this) 0615 0616 this.$element 0617 [dimension](0) 0618 .one($.support.transition.end, $.proxy(complete, this)) 0619 .emulateTransitionEnd(350) 0620 } 0621 0622 Collapse.prototype.toggle = function () { 0623 this[this.$element.hasClass('in') ? 'hide' : 'show']() 0624 } 0625 0626 0627 // COLLAPSE PLUGIN DEFINITION 0628 // ========================== 0629 0630 var old = $.fn.collapse 0631 0632 $.fn.collapse = function (option) { 0633 return this.each(function () { 0634 var $this = $(this) 0635 var data = $this.data('bs.collapse') 0636 var options = $.extend({}, Collapse.DEFAULTS, $this.data(), typeof option == 'object' && option) 0637 0638 if (!data) $this.data('bs.collapse', (data = new Collapse(this, options))) 0639 if (typeof option == 'string') data[option]() 0640 }) 0641 } 0642 0643 $.fn.collapse.Constructor = Collapse 0644 0645 0646 // COLLAPSE NO CONFLICT 0647 // ==================== 0648 0649 $.fn.collapse.noConflict = function () { 0650 $.fn.collapse = old 0651 return this 0652 } 0653 0654 0655 // COLLAPSE DATA-API 0656 // ================= 0657 0658 $(document).on('click.bs.collapse.data-api', '[data-toggle=collapse]', function (e) { 0659 var $this = $(this), href 0660 var target = $this.attr('data-target') 0661 || e.preventDefault() 0662 || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 0663 var $target = $(target) 0664 var data = $target.data('bs.collapse') 0665 var option = data ? 'toggle' : $this.data() 0666 var parent = $this.attr('data-parent') 0667 var $parent = parent && $(parent) 0668 0669 if (!data || !data.transitioning) { 0670 if ($parent) $parent.find('[data-toggle=collapse][data-parent="' + parent + '"]').not($this).addClass('collapsed') 0671 $this[$target.hasClass('in') ? 'addClass' : 'removeClass']('collapsed') 0672 } 0673 0674 $target.collapse(option) 0675 }) 0676 0677 }(jQuery); 0678 0679 /* ======================================================================== 0680 * Bootstrap: dropdown.js v3.0.3 0681 * http://getbootstrap.com/javascript/#dropdowns 0682 * ======================================================================== 0683 * Copyright 2013 Twitter, Inc. 0684 * 0685 * Licensed under the Apache License, Version 2.0 (the "License"); 0686 * you may not use this file except in compliance with the License. 0687 * You may obtain a copy of the License at 0688 * 0689 * http://www.apache.org/licenses/LICENSE-2.0 0690 * 0691 * Unless required by applicable law or agreed to in writing, software 0692 * distributed under the License is distributed on an "AS IS" BASIS, 0693 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0694 * See the License for the specific language governing permissions and 0695 * limitations under the License. 0696 * ======================================================================== */ 0697 0698 0699 +function ($) { "use strict"; 0700 0701 // DROPDOWN CLASS DEFINITION 0702 // ========================= 0703 0704 var backdrop = '.dropdown-backdrop' 0705 var toggle = '[data-toggle=dropdown]' 0706 var Dropdown = function (element) { 0707 $(element).on('click.bs.dropdown', this.toggle) 0708 } 0709 0710 Dropdown.prototype.toggle = function (e) { 0711 var $this = $(this) 0712 0713 if ($this.is('.disabled, :disabled')) return 0714 0715 var $parent = getParent($this) 0716 var isActive = $parent.hasClass('open') 0717 0718 clearMenus() 0719 0720 if (!isActive) { 0721 if ('ontouchstart' in document.documentElement && !$parent.closest('.navbar-nav').length) { 0722 // if mobile we use a backdrop because click events don't delegate 0723 $('<div class="dropdown-backdrop"/>').insertAfter($(this)).on('click', clearMenus) 0724 } 0725 0726 $parent.trigger(e = $.Event('show.bs.dropdown')) 0727 0728 if (e.isDefaultPrevented()) return 0729 0730 $parent 0731 .toggleClass('open') 0732 .trigger('shown.bs.dropdown') 0733 0734 $this.focus() 0735 } 0736 0737 return false 0738 } 0739 0740 Dropdown.prototype.keydown = function (e) { 0741 if (!/(38|40|27)/.test(e.keyCode)) return 0742 0743 var $this = $(this) 0744 0745 e.preventDefault() 0746 e.stopPropagation() 0747 0748 if ($this.is('.disabled, :disabled')) return 0749 0750 var $parent = getParent($this) 0751 var isActive = $parent.hasClass('open') 0752 0753 if (!isActive || (isActive && e.keyCode == 27)) { 0754 if (e.which == 27) $parent.find(toggle).focus() 0755 return $this.click() 0756 } 0757 0758 var $items = $('[role=menu] li:not(.divider):visible a', $parent) 0759 0760 if (!$items.length) return 0761 0762 var index = $items.index($items.filter(':focus')) 0763 0764 if (e.keyCode == 38 && index > 0) index-- // up 0765 if (e.keyCode == 40 && index < $items.length - 1) index++ // down 0766 if (!~index) index=0 0767 0768 $items.eq(index).focus() 0769 } 0770 0771 function clearMenus() { 0772 $(backdrop).remove() 0773 $(toggle).each(function (e) { 0774 var $parent = getParent($(this)) 0775 if (!$parent.hasClass('open')) return 0776 $parent.trigger(e = $.Event('hide.bs.dropdown')) 0777 if (e.isDefaultPrevented()) return 0778 $parent.removeClass('open').trigger('hidden.bs.dropdown') 0779 }) 0780 } 0781 0782 function getParent($this) { 0783 var selector = $this.attr('data-target') 0784 0785 if (!selector) { 0786 selector = $this.attr('href') 0787 selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 0788 } 0789 0790 var $parent = selector && $(selector) 0791 0792 return $parent && $parent.length ? $parent : $this.parent() 0793 } 0794 0795 0796 // DROPDOWN PLUGIN DEFINITION 0797 // ========================== 0798 0799 var old = $.fn.dropdown 0800 0801 $.fn.dropdown = function (option) { 0802 return this.each(function () { 0803 var $this = $(this) 0804 var data = $this.data('bs.dropdown') 0805 0806 if (!data) $this.data('bs.dropdown', (data = new Dropdown(this))) 0807 if (typeof option == 'string') data[option].call($this) 0808 }) 0809 } 0810 0811 $.fn.dropdown.Constructor = Dropdown 0812 0813 0814 // DROPDOWN NO CONFLICT 0815 // ==================== 0816 0817 $.fn.dropdown.noConflict = function () { 0818 $.fn.dropdown = old 0819 return this 0820 } 0821 0822 0823 // APPLY TO STANDARD DROPDOWN ELEMENTS 0824 // =================================== 0825 0826 $(document) 0827 .on('click.bs.dropdown.data-api', clearMenus) 0828 .on('click.bs.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) 0829 .on('click.bs.dropdown.data-api' , toggle, Dropdown.prototype.toggle) 0830 .on('keydown.bs.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) 0831 0832 }(jQuery); 0833 0834 /* ======================================================================== 0835 * Bootstrap: modal.js v3.0.3 0836 * http://getbootstrap.com/javascript/#modals 0837 * ======================================================================== 0838 * Copyright 2013 Twitter, Inc. 0839 * 0840 * Licensed under the Apache License, Version 2.0 (the "License"); 0841 * you may not use this file except in compliance with the License. 0842 * You may obtain a copy of the License at 0843 * 0844 * http://www.apache.org/licenses/LICENSE-2.0 0845 * 0846 * Unless required by applicable law or agreed to in writing, software 0847 * distributed under the License is distributed on an "AS IS" BASIS, 0848 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 0849 * See the License for the specific language governing permissions and 0850 * limitations under the License. 0851 * ======================================================================== */ 0852 0853 0854 +function ($) { "use strict"; 0855 0856 // MODAL CLASS DEFINITION 0857 // ====================== 0858 0859 var Modal = function (element, options) { 0860 this.options = options 0861 this.$element = $(element) 0862 this.$backdrop = 0863 this.isShown = null 0864 0865 if (this.options.remote) this.$element.load(this.options.remote) 0866 } 0867 0868 Modal.DEFAULTS = { 0869 backdrop: true 0870 , keyboard: true 0871 , show: true 0872 } 0873 0874 Modal.prototype.toggle = function (_relatedTarget) { 0875 return this[!this.isShown ? 'show' : 'hide'](_relatedTarget) 0876 } 0877 0878 Modal.prototype.show = function (_relatedTarget) { 0879 var that = this 0880 var e = $.Event('show.bs.modal', { relatedTarget: _relatedTarget }) 0881 0882 this.$element.trigger(e) 0883 0884 if (this.isShown || e.isDefaultPrevented()) return 0885 0886 this.isShown = true 0887 0888 this.escape() 0889 0890 this.$element.on('click.dismiss.modal', '[data-dismiss="modal"]', $.proxy(this.hide, this)) 0891 0892 this.backdrop(function () { 0893 var transition = $.support.transition && that.$element.hasClass('fade') 0894 0895 if (!that.$element.parent().length) { 0896 that.$element.appendTo(document.body) // don't move modals dom position 0897 } 0898 0899 that.$element.show() 0900 0901 if (transition) { 0902 that.$element[0].offsetWidth // force reflow 0903 } 0904 0905 that.$element 0906 .addClass('in') 0907 .attr('aria-hidden', false) 0908 0909 that.enforceFocus() 0910 0911 var e = $.Event('shown.bs.modal', { relatedTarget: _relatedTarget }) 0912 0913 transition ? 0914 that.$element.find('.modal-dialog') // wait for modal to slide in 0915 .one($.support.transition.end, function () { 0916 that.$element.focus().trigger(e) 0917 }) 0918 .emulateTransitionEnd(300) : 0919 that.$element.focus().trigger(e) 0920 }) 0921 } 0922 0923 Modal.prototype.hide = function (e) { 0924 if (e) e.preventDefault() 0925 0926 e = $.Event('hide.bs.modal') 0927 0928 this.$element.trigger(e) 0929 0930 if (!this.isShown || e.isDefaultPrevented()) return 0931 0932 this.isShown = false 0933 0934 this.escape() 0935 0936 $(document).off('focusin.bs.modal') 0937 0938 this.$element 0939 .removeClass('in') 0940 .attr('aria-hidden', true) 0941 .off('click.dismiss.modal') 0942 0943 $.support.transition && this.$element.hasClass('fade') ? 0944 this.$element 0945 .one($.support.transition.end, $.proxy(this.hideModal, this)) 0946 .emulateTransitionEnd(300) : 0947 this.hideModal() 0948 } 0949 0950 Modal.prototype.enforceFocus = function () { 0951 $(document) 0952 .off('focusin.bs.modal') // guard against infinite focus loop 0953 .on('focusin.bs.modal', $.proxy(function (e) { 0954 if (this.$element[0] !== e.target && !this.$element.has(e.target).length) { 0955 this.$element.focus() 0956 } 0957 }, this)) 0958 } 0959 0960 Modal.prototype.escape = function () { 0961 if (this.isShown && this.options.keyboard) { 0962 this.$element.on('keyup.dismiss.bs.modal', $.proxy(function (e) { 0963 e.which == 27 && this.hide() 0964 }, this)) 0965 } else if (!this.isShown) { 0966 this.$element.off('keyup.dismiss.bs.modal') 0967 } 0968 } 0969 0970 Modal.prototype.hideModal = function () { 0971 var that = this 0972 this.$element.hide() 0973 this.backdrop(function () { 0974 that.removeBackdrop() 0975 that.$element.trigger('hidden.bs.modal') 0976 }) 0977 } 0978 0979 Modal.prototype.removeBackdrop = function () { 0980 this.$backdrop && this.$backdrop.remove() 0981 this.$backdrop = null 0982 } 0983 0984 Modal.prototype.backdrop = function (callback) { 0985 var that = this 0986 var animate = this.$element.hasClass('fade') ? 'fade' : '' 0987 0988 if (this.isShown && this.options.backdrop) { 0989 var doAnimate = $.support.transition && animate 0990 0991 this.$backdrop = $('<div class="modal-backdrop ' + animate + '" />') 0992 .appendTo(document.body) 0993 0994 this.$element.on('click.dismiss.modal', $.proxy(function (e) { 0995 if (e.target !== e.currentTarget) return 0996 this.options.backdrop == 'static' 0997 ? this.$element[0].focus.call(this.$element[0]) 0998 : this.hide.call(this) 0999 }, this)) 1000 1001 if (doAnimate) this.$backdrop[0].offsetWidth // force reflow 1002 1003 this.$backdrop.addClass('in') 1004 1005 if (!callback) return 1006 1007 doAnimate ? 1008 this.$backdrop 1009 .one($.support.transition.end, callback) 1010 .emulateTransitionEnd(150) : 1011 callback() 1012 1013 } else if (!this.isShown && this.$backdrop) { 1014 this.$backdrop.removeClass('in') 1015 1016 $.support.transition && this.$element.hasClass('fade')? 1017 this.$backdrop 1018 .one($.support.transition.end, callback) 1019 .emulateTransitionEnd(150) : 1020 callback() 1021 1022 } else if (callback) { 1023 callback() 1024 } 1025 } 1026 1027 1028 // MODAL PLUGIN DEFINITION 1029 // ======================= 1030 1031 var old = $.fn.modal 1032 1033 $.fn.modal = function (option, _relatedTarget) { 1034 return this.each(function () { 1035 var $this = $(this) 1036 var data = $this.data('bs.modal') 1037 var options = $.extend({}, Modal.DEFAULTS, $this.data(), typeof option == 'object' && option) 1038 1039 if (!data) $this.data('bs.modal', (data = new Modal(this, options))) 1040 if (typeof option == 'string') data[option](_relatedTarget) 1041 else if (options.show) data.show(_relatedTarget) 1042 }) 1043 } 1044 1045 $.fn.modal.Constructor = Modal 1046 1047 1048 // MODAL NO CONFLICT 1049 // ================= 1050 1051 $.fn.modal.noConflict = function () { 1052 $.fn.modal = old 1053 return this 1054 } 1055 1056 1057 // MODAL DATA-API 1058 // ============== 1059 1060 $(document).on('click.bs.modal.data-api', '[data-toggle="modal"]', function (e) { 1061 var $this = $(this) 1062 var href = $this.attr('href') 1063 var $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 1064 var option = $target.data('modal') ? 'toggle' : $.extend({ remote: !/#/.test(href) && href }, $target.data(), $this.data()) 1065 1066 e.preventDefault() 1067 1068 $target 1069 .modal(option, this) 1070 .one('hide', function () { 1071 $this.is(':visible') && $this.focus() 1072 }) 1073 }) 1074 1075 $(document) 1076 .on('show.bs.modal', '.modal', function () { $(document.body).addClass('modal-open') }) 1077 .on('hidden.bs.modal', '.modal', function () { $(document.body).removeClass('modal-open') }) 1078 1079 }(jQuery); 1080 1081 /* ======================================================================== 1082 * Bootstrap: tooltip.js v3.0.3 1083 * http://getbootstrap.com/javascript/#tooltip 1084 * Inspired by the original jQuery.tipsy by Jason Frame 1085 * ======================================================================== 1086 * Copyright 2013 Twitter, Inc. 1087 * 1088 * Licensed under the Apache License, Version 2.0 (the "License"); 1089 * you may not use this file except in compliance with the License. 1090 * You may obtain a copy of the License at 1091 * 1092 * http://www.apache.org/licenses/LICENSE-2.0 1093 * 1094 * Unless required by applicable law or agreed to in writing, software 1095 * distributed under the License is distributed on an "AS IS" BASIS, 1096 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1097 * See the License for the specific language governing permissions and 1098 * limitations under the License. 1099 * ======================================================================== */ 1100 1101 1102 +function ($) { "use strict"; 1103 1104 // TOOLTIP PUBLIC CLASS DEFINITION 1105 // =============================== 1106 1107 var Tooltip = function (element, options) { 1108 this.type = 1109 this.options = 1110 this.enabled = 1111 this.timeout = 1112 this.hoverState = 1113 this.$element = null 1114 1115 this.init('tooltip', element, options) 1116 } 1117 1118 Tooltip.DEFAULTS = { 1119 animation: true 1120 , placement: 'top' 1121 , selector: false 1122 , template: '<div class="tooltip"><div class="tooltip-arrow"></div><div class="tooltip-inner"></div></div>' 1123 , trigger: 'hover focus' 1124 , title: '' 1125 , delay: 0 1126 , html: false 1127 , container: false 1128 } 1129 1130 Tooltip.prototype.init = function (type, element, options) { 1131 this.enabled = true 1132 this.type = type 1133 this.$element = $(element) 1134 this.options = this.getOptions(options) 1135 1136 var triggers = this.options.trigger.split(' ') 1137 1138 for (var i = triggers.length; i--;) { 1139 var trigger = triggers[i] 1140 1141 if (trigger == 'click') { 1142 this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) 1143 } else if (trigger != 'manual') { 1144 var eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' 1145 var eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' 1146 1147 this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) 1148 this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) 1149 } 1150 } 1151 1152 this.options.selector ? 1153 (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : 1154 this.fixTitle() 1155 } 1156 1157 Tooltip.prototype.getDefaults = function () { 1158 return Tooltip.DEFAULTS 1159 } 1160 1161 Tooltip.prototype.getOptions = function (options) { 1162 options = $.extend({}, this.getDefaults(), this.$element.data(), options) 1163 1164 if (options.delay && typeof options.delay == 'number') { 1165 options.delay = { 1166 show: options.delay 1167 , hide: options.delay 1168 } 1169 } 1170 1171 return options 1172 } 1173 1174 Tooltip.prototype.getDelegateOptions = function () { 1175 var options = {} 1176 var defaults = this.getDefaults() 1177 1178 this._options && $.each(this._options, function (key, value) { 1179 if (defaults[key] != value) options[key] = value 1180 }) 1181 1182 return options 1183 } 1184 1185 Tooltip.prototype.enter = function (obj) { 1186 var self = obj instanceof this.constructor ? 1187 obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) 1188 1189 clearTimeout(self.timeout) 1190 1191 self.hoverState = 'in' 1192 1193 if (!self.options.delay || !self.options.delay.show) return self.show() 1194 1195 self.timeout = setTimeout(function () { 1196 if (self.hoverState == 'in') self.show() 1197 }, self.options.delay.show) 1198 } 1199 1200 Tooltip.prototype.leave = function (obj) { 1201 var self = obj instanceof this.constructor ? 1202 obj : $(obj.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) 1203 1204 clearTimeout(self.timeout) 1205 1206 self.hoverState = 'out' 1207 1208 if (!self.options.delay || !self.options.delay.hide) return self.hide() 1209 1210 self.timeout = setTimeout(function () { 1211 if (self.hoverState == 'out') self.hide() 1212 }, self.options.delay.hide) 1213 } 1214 1215 Tooltip.prototype.show = function () { 1216 var e = $.Event('show.bs.'+ this.type) 1217 1218 if (this.hasContent() && this.enabled) { 1219 this.$element.trigger(e) 1220 1221 if (e.isDefaultPrevented()) return 1222 1223 var $tip = this.tip() 1224 1225 this.setContent() 1226 1227 if (this.options.animation) $tip.addClass('fade') 1228 1229 var placement = typeof this.options.placement == 'function' ? 1230 this.options.placement.call(this, $tip[0], this.$element[0]) : 1231 this.options.placement 1232 1233 var autoToken = /\s?auto?\s?/i 1234 var autoPlace = autoToken.test(placement) 1235 if (autoPlace) placement = placement.replace(autoToken, '') || 'top' 1236 1237 $tip 1238 .detach() 1239 .css({ top: 0, left: 0, display: 'block' }) 1240 .addClass(placement) 1241 1242 this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) 1243 1244 var pos = this.getPosition() 1245 var actualWidth = $tip[0].offsetWidth 1246 var actualHeight = $tip[0].offsetHeight 1247 1248 if (autoPlace) { 1249 var $parent = this.$element.parent() 1250 1251 var orgPlacement = placement 1252 var docScroll = document.documentElement.scrollTop || document.body.scrollTop 1253 var parentWidth = this.options.container == 'body' ? window.innerWidth : $parent.outerWidth() 1254 var parentHeight = this.options.container == 'body' ? window.innerHeight : $parent.outerHeight() 1255 var parentLeft = this.options.container == 'body' ? 0 : $parent.offset().left 1256 1257 placement = placement == 'bottom' && pos.top + pos.height + actualHeight - docScroll > parentHeight ? 'top' : 1258 placement == 'top' && pos.top - docScroll - actualHeight < 0 ? 'bottom' : 1259 placement == 'right' && pos.right + actualWidth > parentWidth ? 'left' : 1260 placement == 'left' && pos.left - actualWidth < parentLeft ? 'right' : 1261 placement 1262 1263 $tip 1264 .removeClass(orgPlacement) 1265 .addClass(placement) 1266 } 1267 1268 var calculatedOffset = this.getCalculatedOffset(placement, pos, actualWidth, actualHeight) 1269 1270 this.applyPlacement(calculatedOffset, placement) 1271 this.$element.trigger('shown.bs.' + this.type) 1272 } 1273 } 1274 1275 Tooltip.prototype.applyPlacement = function(offset, placement) { 1276 var replace 1277 var $tip = this.tip() 1278 var width = $tip[0].offsetWidth 1279 var height = $tip[0].offsetHeight 1280 1281 // manually read margins because getBoundingClientRect includes difference 1282 var marginTop = parseInt($tip.css('margin-top'), 10) 1283 var marginLeft = parseInt($tip.css('margin-left'), 10) 1284 1285 // we must check for NaN for ie 8/9 1286 if (isNaN(marginTop)) marginTop = 0 1287 if (isNaN(marginLeft)) marginLeft = 0 1288 1289 offset.top = offset.top + marginTop 1290 offset.left = offset.left + marginLeft 1291 1292 $tip 1293 .offset(offset) 1294 .addClass('in') 1295 1296 // check to see if placing tip in new offset caused the tip to resize itself 1297 var actualWidth = $tip[0].offsetWidth 1298 var actualHeight = $tip[0].offsetHeight 1299 1300 if (placement == 'top' && actualHeight != height) { 1301 replace = true 1302 offset.top = offset.top + height - actualHeight 1303 } 1304 1305 if (/bottom|top/.test(placement)) { 1306 var delta = 0 1307 1308 if (offset.left < 0) { 1309 delta = offset.left * -2 1310 offset.left = 0 1311 1312 $tip.offset(offset) 1313 1314 actualWidth = $tip[0].offsetWidth 1315 actualHeight = $tip[0].offsetHeight 1316 } 1317 1318 this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') 1319 } else { 1320 this.replaceArrow(actualHeight - height, actualHeight, 'top') 1321 } 1322 1323 if (replace) $tip.offset(offset) 1324 } 1325 1326 Tooltip.prototype.replaceArrow = function(delta, dimension, position) { 1327 this.arrow().css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') 1328 } 1329 1330 Tooltip.prototype.setContent = function () { 1331 var $tip = this.tip() 1332 var title = this.getTitle() 1333 1334 $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) 1335 $tip.removeClass('fade in top bottom left right') 1336 } 1337 1338 Tooltip.prototype.hide = function () { 1339 var that = this 1340 var $tip = this.tip() 1341 var e = $.Event('hide.bs.' + this.type) 1342 1343 function complete() { 1344 if (that.hoverState != 'in') $tip.detach() 1345 } 1346 1347 this.$element.trigger(e) 1348 1349 if (e.isDefaultPrevented()) return 1350 1351 $tip.removeClass('in') 1352 1353 $.support.transition && this.$tip.hasClass('fade') ? 1354 $tip 1355 .one($.support.transition.end, complete) 1356 .emulateTransitionEnd(150) : 1357 complete() 1358 1359 this.$element.trigger('hidden.bs.' + this.type) 1360 1361 return this 1362 } 1363 1364 Tooltip.prototype.fixTitle = function () { 1365 var $e = this.$element 1366 if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { 1367 $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') 1368 } 1369 } 1370 1371 Tooltip.prototype.hasContent = function () { 1372 return this.getTitle() 1373 } 1374 1375 Tooltip.prototype.getPosition = function () { 1376 var el = this.$element[0] 1377 return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { 1378 width: el.offsetWidth 1379 , height: el.offsetHeight 1380 }, this.$element.offset()) 1381 } 1382 1383 Tooltip.prototype.getCalculatedOffset = function (placement, pos, actualWidth, actualHeight) { 1384 return placement == 'bottom' ? { top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2 } : 1385 placement == 'top' ? { top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2 } : 1386 placement == 'left' ? { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth } : 1387 /* placement == 'right' */ { top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width } 1388 } 1389 1390 Tooltip.prototype.getTitle = function () { 1391 var title 1392 var $e = this.$element 1393 var o = this.options 1394 1395 title = $e.attr('data-original-title') 1396 || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) 1397 1398 return title 1399 } 1400 1401 Tooltip.prototype.tip = function () { 1402 return this.$tip = this.$tip || $(this.options.template) 1403 } 1404 1405 Tooltip.prototype.arrow = function () { 1406 return this.$arrow = this.$arrow || this.tip().find('.tooltip-arrow') 1407 } 1408 1409 Tooltip.prototype.validate = function () { 1410 if (!this.$element[0].parentNode) { 1411 this.hide() 1412 this.$element = null 1413 this.options = null 1414 } 1415 } 1416 1417 Tooltip.prototype.enable = function () { 1418 this.enabled = true 1419 } 1420 1421 Tooltip.prototype.disable = function () { 1422 this.enabled = false 1423 } 1424 1425 Tooltip.prototype.toggleEnabled = function () { 1426 this.enabled = !this.enabled 1427 } 1428 1429 Tooltip.prototype.toggle = function (e) { 1430 var self = e ? $(e.currentTarget)[this.type](this.getDelegateOptions()).data('bs.' + this.type) : this 1431 self.tip().hasClass('in') ? self.leave(self) : self.enter(self) 1432 } 1433 1434 Tooltip.prototype.destroy = function () { 1435 this.hide().$element.off('.' + this.type).removeData('bs.' + this.type) 1436 } 1437 1438 1439 // TOOLTIP PLUGIN DEFINITION 1440 // ========================= 1441 1442 var old = $.fn.tooltip 1443 1444 $.fn.tooltip = function (option) { 1445 return this.each(function () { 1446 var $this = $(this) 1447 var data = $this.data('bs.tooltip') 1448 var options = typeof option == 'object' && option 1449 1450 if (!data) $this.data('bs.tooltip', (data = new Tooltip(this, options))) 1451 if (typeof option == 'string') data[option]() 1452 }) 1453 } 1454 1455 $.fn.tooltip.Constructor = Tooltip 1456 1457 1458 // TOOLTIP NO CONFLICT 1459 // =================== 1460 1461 $.fn.tooltip.noConflict = function () { 1462 $.fn.tooltip = old 1463 return this 1464 } 1465 1466 }(jQuery); 1467 1468 /* ======================================================================== 1469 * Bootstrap: popover.js v3.0.3 1470 * http://getbootstrap.com/javascript/#popovers 1471 * ======================================================================== 1472 * Copyright 2013 Twitter, Inc. 1473 * 1474 * Licensed under the Apache License, Version 2.0 (the "License"); 1475 * you may not use this file except in compliance with the License. 1476 * You may obtain a copy of the License at 1477 * 1478 * http://www.apache.org/licenses/LICENSE-2.0 1479 * 1480 * Unless required by applicable law or agreed to in writing, software 1481 * distributed under the License is distributed on an "AS IS" BASIS, 1482 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1483 * See the License for the specific language governing permissions and 1484 * limitations under the License. 1485 * ======================================================================== */ 1486 1487 1488 +function ($) { "use strict"; 1489 1490 // POPOVER PUBLIC CLASS DEFINITION 1491 // =============================== 1492 1493 var Popover = function (element, options) { 1494 this.init('popover', element, options) 1495 } 1496 1497 if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') 1498 1499 Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, { 1500 placement: 'right' 1501 , trigger: 'click' 1502 , content: '' 1503 , template: '<div class="popover"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>' 1504 }) 1505 1506 1507 // NOTE: POPOVER EXTENDS tooltip.js 1508 // ================================ 1509 1510 Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) 1511 1512 Popover.prototype.constructor = Popover 1513 1514 Popover.prototype.getDefaults = function () { 1515 return Popover.DEFAULTS 1516 } 1517 1518 Popover.prototype.setContent = function () { 1519 var $tip = this.tip() 1520 var title = this.getTitle() 1521 var content = this.getContent() 1522 1523 $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) 1524 $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) 1525 1526 $tip.removeClass('fade top bottom left right in') 1527 1528 // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do 1529 // this manually by checking the contents. 1530 if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() 1531 } 1532 1533 Popover.prototype.hasContent = function () { 1534 return this.getTitle() || this.getContent() 1535 } 1536 1537 Popover.prototype.getContent = function () { 1538 var $e = this.$element 1539 var o = this.options 1540 1541 return $e.attr('data-content') 1542 || (typeof o.content == 'function' ? 1543 o.content.call($e[0]) : 1544 o.content) 1545 } 1546 1547 Popover.prototype.arrow = function () { 1548 return this.$arrow = this.$arrow || this.tip().find('.arrow') 1549 } 1550 1551 Popover.prototype.tip = function () { 1552 if (!this.$tip) this.$tip = $(this.options.template) 1553 return this.$tip 1554 } 1555 1556 1557 // POPOVER PLUGIN DEFINITION 1558 // ========================= 1559 1560 var old = $.fn.popover 1561 1562 $.fn.popover = function (option) { 1563 return this.each(function () { 1564 var $this = $(this) 1565 var data = $this.data('bs.popover') 1566 var options = typeof option == 'object' && option 1567 1568 if (!data) $this.data('bs.popover', (data = new Popover(this, options))) 1569 if (typeof option == 'string') data[option]() 1570 }) 1571 } 1572 1573 $.fn.popover.Constructor = Popover 1574 1575 1576 // POPOVER NO CONFLICT 1577 // =================== 1578 1579 $.fn.popover.noConflict = function () { 1580 $.fn.popover = old 1581 return this 1582 } 1583 1584 }(jQuery); 1585 1586 /* ======================================================================== 1587 * Bootstrap: scrollspy.js v3.0.3 1588 * http://getbootstrap.com/javascript/#scrollspy 1589 * ======================================================================== 1590 * Copyright 2013 Twitter, Inc. 1591 * 1592 * Licensed under the Apache License, Version 2.0 (the "License"); 1593 * you may not use this file except in compliance with the License. 1594 * You may obtain a copy of the License at 1595 * 1596 * http://www.apache.org/licenses/LICENSE-2.0 1597 * 1598 * Unless required by applicable law or agreed to in writing, software 1599 * distributed under the License is distributed on an "AS IS" BASIS, 1600 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1601 * See the License for the specific language governing permissions and 1602 * limitations under the License. 1603 * ======================================================================== */ 1604 1605 1606 +function ($) { "use strict"; 1607 1608 // SCROLLSPY CLASS DEFINITION 1609 // ========================== 1610 1611 function ScrollSpy(element, options) { 1612 var href 1613 var process = $.proxy(this.process, this) 1614 1615 this.$element = $(element).is('body') ? $(window) : $(element) 1616 this.$body = $('body') 1617 this.$scrollElement = this.$element.on('scroll.bs.scroll-spy.data-api', process) 1618 this.options = $.extend({}, ScrollSpy.DEFAULTS, options) 1619 this.selector = (this.options.target 1620 || ((href = $(element).attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 1621 || '') + ' .nav li > a' 1622 this.offsets = $([]) 1623 this.targets = $([]) 1624 this.activeTarget = null 1625 1626 this.refresh() 1627 this.process() 1628 } 1629 1630 ScrollSpy.DEFAULTS = { 1631 offset: 10 1632 } 1633 1634 ScrollSpy.prototype.refresh = function () { 1635 var offsetMethod = this.$element[0] == window ? 'offset' : 'position' 1636 1637 this.offsets = $([]) 1638 this.targets = $([]) 1639 1640 var self = this 1641 var $targets = this.$body 1642 .find(this.selector) 1643 .map(function () { 1644 var $el = $(this) 1645 var href = $el.data('target') || $el.attr('href') 1646 var $href = /^#\w/.test(href) && $(href) 1647 1648 return ($href 1649 && $href.length 1650 && [[ $href[offsetMethod]().top + (!$.isWindow(self.$scrollElement.get(0)) && self.$scrollElement.scrollTop()), href ]]) || null 1651 }) 1652 .sort(function (a, b) { return a[0] - b[0] }) 1653 .each(function () { 1654 self.offsets.push(this[0]) 1655 self.targets.push(this[1]) 1656 }) 1657 } 1658 1659 ScrollSpy.prototype.process = function () { 1660 var scrollTop = this.$scrollElement.scrollTop() + this.options.offset 1661 var scrollHeight = this.$scrollElement[0].scrollHeight || this.$body[0].scrollHeight 1662 var maxScroll = scrollHeight - this.$scrollElement.height() 1663 var offsets = this.offsets 1664 var targets = this.targets 1665 var activeTarget = this.activeTarget 1666 var i 1667 1668 if (scrollTop >= maxScroll) { 1669 return activeTarget != (i = targets.last()[0]) && this.activate(i) 1670 } 1671 1672 for (i = offsets.length; i--;) { 1673 activeTarget != targets[i] 1674 && scrollTop >= offsets[i] 1675 && (!offsets[i + 1] || scrollTop <= offsets[i + 1]) 1676 && this.activate( targets[i] ) 1677 } 1678 } 1679 1680 ScrollSpy.prototype.activate = function (target) { 1681 this.activeTarget = target 1682 1683 $(this.selector) 1684 .parents('.active') 1685 .removeClass('active') 1686 1687 var selector = this.selector 1688 + '[data-target="' + target + '"],' 1689 + this.selector + '[href="' + target + '"]' 1690 1691 var active = $(selector) 1692 .parents('li') 1693 .addClass('active') 1694 1695 if (active.parent('.dropdown-menu').length) { 1696 active = active 1697 .closest('li.dropdown') 1698 .addClass('active') 1699 } 1700 1701 active.trigger('activate.bs.scrollspy') 1702 } 1703 1704 1705 // SCROLLSPY PLUGIN DEFINITION 1706 // =========================== 1707 1708 var old = $.fn.scrollspy 1709 1710 $.fn.scrollspy = function (option) { 1711 return this.each(function () { 1712 var $this = $(this) 1713 var data = $this.data('bs.scrollspy') 1714 var options = typeof option == 'object' && option 1715 1716 if (!data) $this.data('bs.scrollspy', (data = new ScrollSpy(this, options))) 1717 if (typeof option == 'string') data[option]() 1718 }) 1719 } 1720 1721 $.fn.scrollspy.Constructor = ScrollSpy 1722 1723 1724 // SCROLLSPY NO CONFLICT 1725 // ===================== 1726 1727 $.fn.scrollspy.noConflict = function () { 1728 $.fn.scrollspy = old 1729 return this 1730 } 1731 1732 1733 // SCROLLSPY DATA-API 1734 // ================== 1735 1736 $(window).on('load', function () { 1737 $('[data-spy="scroll"]').each(function () { 1738 var $spy = $(this) 1739 $spy.scrollspy($spy.data()) 1740 }) 1741 }) 1742 1743 }(jQuery); 1744 1745 /* ======================================================================== 1746 * Bootstrap: tab.js v3.0.3 1747 * http://getbootstrap.com/javascript/#tabs 1748 * ======================================================================== 1749 * Copyright 2013 Twitter, Inc. 1750 * 1751 * Licensed under the Apache License, Version 2.0 (the "License"); 1752 * you may not use this file except in compliance with the License. 1753 * You may obtain a copy of the License at 1754 * 1755 * http://www.apache.org/licenses/LICENSE-2.0 1756 * 1757 * Unless required by applicable law or agreed to in writing, software 1758 * distributed under the License is distributed on an "AS IS" BASIS, 1759 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1760 * See the License for the specific language governing permissions and 1761 * limitations under the License. 1762 * ======================================================================== */ 1763 1764 1765 +function ($) { "use strict"; 1766 1767 // TAB CLASS DEFINITION 1768 // ==================== 1769 1770 var Tab = function (element) { 1771 this.element = $(element) 1772 } 1773 1774 Tab.prototype.show = function () { 1775 var $this = this.element 1776 var $ul = $this.closest('ul:not(.dropdown-menu)') 1777 var selector = $this.data('target') 1778 1779 if (!selector) { 1780 selector = $this.attr('href') 1781 selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 1782 } 1783 1784 if ($this.parent('li').hasClass('active')) return 1785 1786 var previous = $ul.find('.active:last a')[0] 1787 var e = $.Event('show.bs.tab', { 1788 relatedTarget: previous 1789 }) 1790 1791 $this.trigger(e) 1792 1793 if (e.isDefaultPrevented()) return 1794 1795 var $target = $(selector) 1796 1797 this.activate($this.parent('li'), $ul) 1798 this.activate($target, $target.parent(), function () { 1799 $this.trigger({ 1800 type: 'shown.bs.tab' 1801 , relatedTarget: previous 1802 }) 1803 }) 1804 } 1805 1806 Tab.prototype.activate = function (element, container, callback) { 1807 var $active = container.find('> .active') 1808 var transition = callback 1809 && $.support.transition 1810 && $active.hasClass('fade') 1811 1812 function next() { 1813 $active 1814 .removeClass('active') 1815 .find('> .dropdown-menu > .active') 1816 .removeClass('active') 1817 1818 element.addClass('active') 1819 1820 if (transition) { 1821 element[0].offsetWidth // reflow for transition 1822 element.addClass('in') 1823 } else { 1824 element.removeClass('fade') 1825 } 1826 1827 if (element.parent('.dropdown-menu')) { 1828 element.closest('li.dropdown').addClass('active') 1829 } 1830 1831 callback && callback() 1832 } 1833 1834 transition ? 1835 $active 1836 .one($.support.transition.end, next) 1837 .emulateTransitionEnd(150) : 1838 next() 1839 1840 $active.removeClass('in') 1841 } 1842 1843 1844 // TAB PLUGIN DEFINITION 1845 // ===================== 1846 1847 var old = $.fn.tab 1848 1849 $.fn.tab = function ( option ) { 1850 return this.each(function () { 1851 var $this = $(this) 1852 var data = $this.data('bs.tab') 1853 1854 if (!data) $this.data('bs.tab', (data = new Tab(this))) 1855 if (typeof option == 'string') data[option]() 1856 }) 1857 } 1858 1859 $.fn.tab.Constructor = Tab 1860 1861 1862 // TAB NO CONFLICT 1863 // =============== 1864 1865 $.fn.tab.noConflict = function () { 1866 $.fn.tab = old 1867 return this 1868 } 1869 1870 1871 // TAB DATA-API 1872 // ============ 1873 1874 $(document).on('click.bs.tab.data-api', '[data-toggle="tab"], [data-toggle="pill"]', function (e) { 1875 e.preventDefault() 1876 $(this).tab('show') 1877 }) 1878 1879 }(jQuery); 1880 1881 /* ======================================================================== 1882 * Bootstrap: affix.js v3.0.3 1883 * http://getbootstrap.com/javascript/#affix 1884 * ======================================================================== 1885 * Copyright 2013 Twitter, Inc. 1886 * 1887 * Licensed under the Apache License, Version 2.0 (the "License"); 1888 * you may not use this file except in compliance with the License. 1889 * You may obtain a copy of the License at 1890 * 1891 * http://www.apache.org/licenses/LICENSE-2.0 1892 * 1893 * Unless required by applicable law or agreed to in writing, software 1894 * distributed under the License is distributed on an "AS IS" BASIS, 1895 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 1896 * See the License for the specific language governing permissions and 1897 * limitations under the License. 1898 * ======================================================================== */ 1899 1900 1901 +function ($) { "use strict"; 1902 1903 // AFFIX CLASS DEFINITION 1904 // ====================== 1905 1906 var Affix = function (element, options) { 1907 this.options = $.extend({}, Affix.DEFAULTS, options) 1908 this.$window = $(window) 1909 .on('scroll.bs.affix.data-api', $.proxy(this.checkPosition, this)) 1910 .on('click.bs.affix.data-api', $.proxy(this.checkPositionWithEventLoop, this)) 1911 1912 this.$element = $(element) 1913 this.affixed = 1914 this.unpin = null 1915 1916 this.checkPosition() 1917 } 1918 1919 Affix.RESET = 'affix affix-top affix-bottom' 1920 1921 Affix.DEFAULTS = { 1922 offset: 0 1923 } 1924 1925 Affix.prototype.checkPositionWithEventLoop = function () { 1926 setTimeout($.proxy(this.checkPosition, this), 1) 1927 } 1928 1929 Affix.prototype.checkPosition = function () { 1930 if (!this.$element.is(':visible')) return 1931 1932 var scrollHeight = $(document).height() 1933 var scrollTop = this.$window.scrollTop() 1934 var position = this.$element.offset() 1935 var offset = this.options.offset 1936 var offsetTop = offset.top 1937 var offsetBottom = offset.bottom 1938 1939 if (typeof offset != 'object') offsetBottom = offsetTop = offset 1940 if (typeof offsetTop == 'function') offsetTop = offset.top() 1941 if (typeof offsetBottom == 'function') offsetBottom = offset.bottom() 1942 1943 var affix = this.unpin != null && (scrollTop + this.unpin <= position.top) ? false : 1944 offsetBottom != null && (position.top + this.$element.height() >= scrollHeight - offsetBottom) ? 'bottom' : 1945 offsetTop != null && (scrollTop <= offsetTop) ? 'top' : false 1946 1947 if (this.affixed === affix) return 1948 if (this.unpin) this.$element.css('top', '') 1949 1950 this.affixed = affix 1951 this.unpin = affix == 'bottom' ? position.top - scrollTop : null 1952 1953 this.$element.removeClass(Affix.RESET).addClass('affix' + (affix ? '-' + affix : '')) 1954 1955 if (affix == 'bottom') { 1956 this.$element.offset({ top: document.body.offsetHeight - offsetBottom - this.$element.height() }) 1957 } 1958 } 1959 1960 1961 // AFFIX PLUGIN DEFINITION 1962 // ======================= 1963 1964 var old = $.fn.affix 1965 1966 $.fn.affix = function (option) { 1967 return this.each(function () { 1968 var $this = $(this) 1969 var data = $this.data('bs.affix') 1970 var options = typeof option == 'object' && option 1971 1972 if (!data) $this.data('bs.affix', (data = new Affix(this, options))) 1973 if (typeof option == 'string') data[option]() 1974 }) 1975 } 1976 1977 $.fn.affix.Constructor = Affix 1978 1979 1980 // AFFIX NO CONFLICT 1981 // ================= 1982 1983 $.fn.affix.noConflict = function () { 1984 $.fn.affix = old 1985 return this 1986 } 1987 1988 1989 // AFFIX DATA-API 1990 // ============== 1991 1992 $(window).on('load', function () { 1993 $('[data-spy="affix"]').each(function () { 1994 var $spy = $(this) 1995 var data = $spy.data() 1996 1997 data.offset = data.offset || {} 1998 1999 if (data.offsetBottom) data.offset.bottom = data.offsetBottom 2000 if (data.offsetTop) data.offset.top = data.offsetTop 2001 2002 $spy.affix(data) 2003 }) 2004 }) 2005 2006 }(jQuery);