indvd00m@0: /* =================================================== indvd00m@0: * bootstrap-transition.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#transitions indvd00m@0: * =================================================== indvd00m@0: * Copyright 2012 Twitter, Inc. indvd00m@0: * indvd00m@0: * Licensed under the Apache License, Version 2.0 (the "License"); indvd00m@0: * you may not use this file except in compliance with the License. indvd00m@0: * You may obtain a copy of the License at indvd00m@0: * indvd00m@0: * http://www.apache.org/licenses/LICENSE-2.0 indvd00m@0: * indvd00m@0: * Unless required by applicable law or agreed to in writing, software indvd00m@0: * distributed under the License is distributed on an "AS IS" BASIS, indvd00m@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. indvd00m@0: * See the License for the specific language governing permissions and indvd00m@0: * limitations under the License. indvd00m@0: * ========================================================== */ indvd00m@0: indvd00m@0: indvd00m@0: !function ($) { indvd00m@0: indvd00m@0: "use strict"; // jshint ;_; indvd00m@0: indvd00m@0: indvd00m@0: /* CSS TRANSITION SUPPORT (http://www.modernizr.com/) indvd00m@0: * ======================================================= */ indvd00m@0: indvd00m@0: $(function () { indvd00m@0: indvd00m@0: $.support.transition = (function () { indvd00m@0: indvd00m@0: var transitionEnd = (function () { indvd00m@0: indvd00m@0: var el = document.createElement('bootstrap') indvd00m@0: , transEndEventNames = { indvd00m@0: 'WebkitTransition' : 'webkitTransitionEnd' indvd00m@0: , 'MozTransition' : 'transitionend' indvd00m@0: , 'OTransition' : 'oTransitionEnd otransitionend' indvd00m@0: , 'transition' : 'transitionend' indvd00m@0: } indvd00m@0: , name indvd00m@0: indvd00m@0: for (name in transEndEventNames){ indvd00m@0: if (el.style[name] !== undefined) { indvd00m@0: return transEndEventNames[name] indvd00m@0: } indvd00m@0: } indvd00m@0: indvd00m@0: }()) indvd00m@0: indvd00m@0: return transitionEnd && { indvd00m@0: end: transitionEnd indvd00m@0: } indvd00m@0: indvd00m@0: })() indvd00m@0: indvd00m@0: }) indvd00m@0: indvd00m@0: }(window.jQuery);/* ========================================================== indvd00m@0: * bootstrap-alert.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#alerts indvd00m@0: * ========================================================== indvd00m@0: * Copyright 2012 Twitter, Inc. indvd00m@0: * indvd00m@0: * Licensed under the Apache License, Version 2.0 (the "License"); indvd00m@0: * you may not use this file except in compliance with the License. indvd00m@0: * You may obtain a copy of the License at indvd00m@0: * indvd00m@0: * http://www.apache.org/licenses/LICENSE-2.0 indvd00m@0: * indvd00m@0: * Unless required by applicable law or agreed to in writing, software indvd00m@0: * distributed under the License is distributed on an "AS IS" BASIS, indvd00m@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. indvd00m@0: * See the License for the specific language governing permissions and indvd00m@0: * limitations under the License. indvd00m@0: * ========================================================== */ indvd00m@0: indvd00m@0: indvd00m@0: !function ($) { indvd00m@0: indvd00m@0: "use strict"; // jshint ;_; indvd00m@0: indvd00m@0: indvd00m@0: /* ALERT CLASS DEFINITION indvd00m@0: * ====================== */ indvd00m@0: indvd00m@0: var dismiss = '[data-dismiss="alert"]' indvd00m@0: , Alert = function (el) { indvd00m@0: $(el).on('click', dismiss, this.close) indvd00m@0: } indvd00m@0: indvd00m@0: Alert.prototype.close = function (e) { indvd00m@0: var $this = $(this) indvd00m@0: , selector = $this.attr('data-target') indvd00m@0: , $parent indvd00m@0: indvd00m@0: if (!selector) { indvd00m@0: selector = $this.attr('href') indvd00m@0: selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 indvd00m@0: } indvd00m@0: indvd00m@0: $parent = $(selector) indvd00m@0: indvd00m@0: e && e.preventDefault() indvd00m@0: indvd00m@0: $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) indvd00m@0: indvd00m@0: $parent.trigger(e = $.Event('close')) indvd00m@0: indvd00m@0: if (e.isDefaultPrevented()) return indvd00m@0: indvd00m@0: $parent.removeClass('in') indvd00m@0: indvd00m@0: function removeElement() { indvd00m@0: $parent indvd00m@0: .trigger('closed') indvd00m@0: .remove() indvd00m@0: } indvd00m@0: indvd00m@0: $.support.transition && $parent.hasClass('fade') ? indvd00m@0: $parent.on($.support.transition.end, removeElement) : indvd00m@0: removeElement() indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* ALERT PLUGIN DEFINITION indvd00m@0: * ======================= */ indvd00m@0: indvd00m@0: var old = $.fn.alert indvd00m@0: indvd00m@0: $.fn.alert = function (option) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('alert') indvd00m@0: if (!data) $this.data('alert', (data = new Alert(this))) indvd00m@0: if (typeof option == 'string') data[option].call($this) indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.alert.Constructor = Alert indvd00m@0: indvd00m@0: indvd00m@0: /* ALERT NO CONFLICT indvd00m@0: * ================= */ indvd00m@0: indvd00m@0: $.fn.alert.noConflict = function () { indvd00m@0: $.fn.alert = old indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* ALERT DATA-API indvd00m@0: * ============== */ indvd00m@0: indvd00m@0: $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) indvd00m@0: indvd00m@0: }(window.jQuery);/* ============================================================ indvd00m@0: * bootstrap-button.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#buttons indvd00m@0: * ============================================================ indvd00m@0: * Copyright 2012 Twitter, Inc. indvd00m@0: * indvd00m@0: * Licensed under the Apache License, Version 2.0 (the "License"); indvd00m@0: * you may not use this file except in compliance with the License. indvd00m@0: * You may obtain a copy of the License at indvd00m@0: * indvd00m@0: * http://www.apache.org/licenses/LICENSE-2.0 indvd00m@0: * indvd00m@0: * Unless required by applicable law or agreed to in writing, software indvd00m@0: * distributed under the License is distributed on an "AS IS" BASIS, indvd00m@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. indvd00m@0: * See the License for the specific language governing permissions and indvd00m@0: * limitations under the License. indvd00m@0: * ============================================================ */ indvd00m@0: indvd00m@0: indvd00m@0: !function ($) { indvd00m@0: indvd00m@0: "use strict"; // jshint ;_; indvd00m@0: indvd00m@0: indvd00m@0: /* BUTTON PUBLIC CLASS DEFINITION indvd00m@0: * ============================== */ indvd00m@0: indvd00m@0: var Button = function (element, options) { indvd00m@0: this.$element = $(element) indvd00m@0: this.options = $.extend({}, $.fn.button.defaults, options) indvd00m@0: } indvd00m@0: indvd00m@0: Button.prototype.setState = function (state) { indvd00m@0: var d = 'disabled' indvd00m@0: , $el = this.$element indvd00m@0: , data = $el.data() indvd00m@0: , val = $el.is('input') ? 'val' : 'html' indvd00m@0: indvd00m@0: state = state + 'Text' indvd00m@0: data.resetText || $el.data('resetText', $el[val]()) indvd00m@0: indvd00m@0: $el[val](data[state] || this.options[state]) indvd00m@0: indvd00m@0: // push to event loop to allow forms to submit indvd00m@0: setTimeout(function () { indvd00m@0: state == 'loadingText' ? indvd00m@0: $el.addClass(d).attr(d, d) : indvd00m@0: $el.removeClass(d).removeAttr(d) indvd00m@0: }, 0) indvd00m@0: } indvd00m@0: indvd00m@0: Button.prototype.toggle = function () { indvd00m@0: var $parent = this.$element.closest('[data-toggle="buttons-radio"]') indvd00m@0: indvd00m@0: $parent && $parent indvd00m@0: .find('.active') indvd00m@0: .removeClass('active') indvd00m@0: indvd00m@0: this.$element.toggleClass('active') indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* BUTTON PLUGIN DEFINITION indvd00m@0: * ======================== */ indvd00m@0: indvd00m@0: var old = $.fn.button indvd00m@0: indvd00m@0: $.fn.button = function (option) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('button') indvd00m@0: , options = typeof option == 'object' && option indvd00m@0: if (!data) $this.data('button', (data = new Button(this, options))) indvd00m@0: if (option == 'toggle') data.toggle() indvd00m@0: else if (option) data.setState(option) indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.button.defaults = { indvd00m@0: loadingText: 'loading...' indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.button.Constructor = Button indvd00m@0: indvd00m@0: indvd00m@0: /* BUTTON NO CONFLICT indvd00m@0: * ================== */ indvd00m@0: indvd00m@0: $.fn.button.noConflict = function () { indvd00m@0: $.fn.button = old indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* BUTTON DATA-API indvd00m@0: * =============== */ indvd00m@0: indvd00m@0: $(document).on('click.button.data-api', '[data-toggle^=button]', function (e) { indvd00m@0: var $btn = $(e.target) indvd00m@0: if (!$btn.hasClass('btn')) $btn = $btn.closest('.btn') indvd00m@0: $btn.button('toggle') indvd00m@0: }) indvd00m@0: indvd00m@0: }(window.jQuery);/* ========================================================== indvd00m@0: * bootstrap-carousel.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#carousel indvd00m@0: * ========================================================== indvd00m@0: * Copyright 2012 Twitter, Inc. indvd00m@0: * indvd00m@0: * Licensed under the Apache License, Version 2.0 (the "License"); indvd00m@0: * you may not use this file except in compliance with the License. indvd00m@0: * You may obtain a copy of the License at indvd00m@0: * indvd00m@0: * http://www.apache.org/licenses/LICENSE-2.0 indvd00m@0: * indvd00m@0: * Unless required by applicable law or agreed to in writing, software indvd00m@0: * distributed under the License is distributed on an "AS IS" BASIS, indvd00m@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. indvd00m@0: * See the License for the specific language governing permissions and indvd00m@0: * limitations under the License. indvd00m@0: * ========================================================== */ indvd00m@0: indvd00m@0: indvd00m@0: !function ($) { indvd00m@0: indvd00m@0: "use strict"; // jshint ;_; indvd00m@0: indvd00m@0: indvd00m@0: /* CAROUSEL CLASS DEFINITION indvd00m@0: * ========================= */ indvd00m@0: indvd00m@0: var Carousel = function (element, options) { indvd00m@0: this.$element = $(element) indvd00m@0: this.$indicators = this.$element.find('.carousel-indicators') indvd00m@0: this.options = options indvd00m@0: this.options.pause == 'hover' && this.$element indvd00m@0: .on('mouseenter', $.proxy(this.pause, this)) indvd00m@0: .on('mouseleave', $.proxy(this.cycle, this)) indvd00m@0: } indvd00m@0: indvd00m@0: Carousel.prototype = { indvd00m@0: indvd00m@0: cycle: function (e) { indvd00m@0: if (!e) this.paused = false indvd00m@0: if (this.interval) clearInterval(this.interval); indvd00m@0: this.options.interval indvd00m@0: && !this.paused indvd00m@0: && (this.interval = setInterval($.proxy(this.next, this), this.options.interval)) indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: , getActiveIndex: function () { indvd00m@0: this.$active = this.$element.find('.item.active') indvd00m@0: this.$items = this.$active.parent().children() indvd00m@0: return this.$items.index(this.$active) indvd00m@0: } indvd00m@0: indvd00m@0: , to: function (pos) { indvd00m@0: var activeIndex = this.getActiveIndex() indvd00m@0: , that = this indvd00m@0: indvd00m@0: if (pos > (this.$items.length - 1) || pos < 0) return indvd00m@0: indvd00m@0: if (this.sliding) { indvd00m@0: return this.$element.one('slid', function () { indvd00m@0: that.to(pos) indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: if (activeIndex == pos) { indvd00m@0: return this.pause().cycle() indvd00m@0: } indvd00m@0: indvd00m@0: return this.slide(pos > activeIndex ? 'next' : 'prev', $(this.$items[pos])) indvd00m@0: } indvd00m@0: indvd00m@0: , pause: function (e) { indvd00m@0: if (!e) this.paused = true indvd00m@0: if (this.$element.find('.next, .prev').length && $.support.transition.end) { indvd00m@0: this.$element.trigger($.support.transition.end) indvd00m@0: this.cycle(true) indvd00m@0: } indvd00m@0: clearInterval(this.interval) indvd00m@0: this.interval = null indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: , next: function () { indvd00m@0: if (this.sliding) return indvd00m@0: return this.slide('next') indvd00m@0: } indvd00m@0: indvd00m@0: , prev: function () { indvd00m@0: if (this.sliding) return indvd00m@0: return this.slide('prev') indvd00m@0: } indvd00m@0: indvd00m@0: , slide: function (type, next) { indvd00m@0: var $active = this.$element.find('.item.active') indvd00m@0: , $next = next || $active[type]() indvd00m@0: , isCycling = this.interval indvd00m@0: , direction = type == 'next' ? 'left' : 'right' indvd00m@0: , fallback = type == 'next' ? 'first' : 'last' indvd00m@0: , that = this indvd00m@0: , e indvd00m@0: indvd00m@0: this.sliding = true indvd00m@0: indvd00m@0: isCycling && this.pause() indvd00m@0: indvd00m@0: $next = $next.length ? $next : this.$element.find('.item')[fallback]() indvd00m@0: indvd00m@0: e = $.Event('slide', { indvd00m@0: relatedTarget: $next[0] indvd00m@0: , direction: direction indvd00m@0: }) indvd00m@0: indvd00m@0: if ($next.hasClass('active')) return indvd00m@0: indvd00m@0: if (this.$indicators.length) { indvd00m@0: this.$indicators.find('.active').removeClass('active') indvd00m@0: this.$element.one('slid', function () { indvd00m@0: var $nextIndicator = $(that.$indicators.children()[that.getActiveIndex()]) indvd00m@0: $nextIndicator && $nextIndicator.addClass('active') indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: if ($.support.transition && this.$element.hasClass('slide')) { indvd00m@0: this.$element.trigger(e) indvd00m@0: if (e.isDefaultPrevented()) return indvd00m@0: $next.addClass(type) indvd00m@0: $next[0].offsetWidth // force reflow indvd00m@0: $active.addClass(direction) indvd00m@0: $next.addClass(direction) indvd00m@0: this.$element.one($.support.transition.end, function () { indvd00m@0: $next.removeClass([type, direction].join(' ')).addClass('active') indvd00m@0: $active.removeClass(['active', direction].join(' ')) indvd00m@0: that.sliding = false indvd00m@0: setTimeout(function () { that.$element.trigger('slid') }, 0) indvd00m@0: }) indvd00m@0: } else { indvd00m@0: this.$element.trigger(e) indvd00m@0: if (e.isDefaultPrevented()) return indvd00m@0: $active.removeClass('active') indvd00m@0: $next.addClass('active') indvd00m@0: this.sliding = false indvd00m@0: this.$element.trigger('slid') indvd00m@0: } indvd00m@0: indvd00m@0: isCycling && this.cycle() indvd00m@0: indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* CAROUSEL PLUGIN DEFINITION indvd00m@0: * ========================== */ indvd00m@0: indvd00m@0: var old = $.fn.carousel indvd00m@0: indvd00m@0: $.fn.carousel = function (option) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('carousel') indvd00m@0: , options = $.extend({}, $.fn.carousel.defaults, typeof option == 'object' && option) indvd00m@0: , action = typeof option == 'string' ? option : options.slide indvd00m@0: if (!data) $this.data('carousel', (data = new Carousel(this, options))) indvd00m@0: if (typeof option == 'number') data.to(option) indvd00m@0: else if (action) data[action]() indvd00m@0: else if (options.interval) data.pause().cycle() indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.carousel.defaults = { indvd00m@0: interval: 5000 indvd00m@0: , pause: 'hover' indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.carousel.Constructor = Carousel indvd00m@0: indvd00m@0: indvd00m@0: /* CAROUSEL NO CONFLICT indvd00m@0: * ==================== */ indvd00m@0: indvd00m@0: $.fn.carousel.noConflict = function () { indvd00m@0: $.fn.carousel = old indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: /* CAROUSEL DATA-API indvd00m@0: * ================= */ indvd00m@0: indvd00m@0: $(document).on('click.carousel.data-api', '[data-slide], [data-slide-to]', function (e) { indvd00m@0: var $this = $(this), href indvd00m@0: , $target = $($this.attr('data-target') || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '')) //strip for ie7 indvd00m@0: , options = $.extend({}, $target.data(), $this.data()) indvd00m@0: , slideIndex indvd00m@0: indvd00m@0: $target.carousel(options) indvd00m@0: indvd00m@0: if (slideIndex = $this.attr('data-slide-to')) { indvd00m@0: $target.data('carousel').pause().to(slideIndex).cycle() indvd00m@0: } indvd00m@0: indvd00m@0: e.preventDefault() indvd00m@0: }) indvd00m@0: indvd00m@0: }(window.jQuery);/* ============================================================= indvd00m@0: * bootstrap-collapse.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#collapse indvd00m@0: * ============================================================= indvd00m@0: * Copyright 2012 Twitter, Inc. indvd00m@0: * indvd00m@0: * Licensed under the Apache License, Version 2.0 (the "License"); indvd00m@0: * you may not use this file except in compliance with the License. indvd00m@0: * You may obtain a copy of the License at indvd00m@0: * indvd00m@0: * http://www.apache.org/licenses/LICENSE-2.0 indvd00m@0: * indvd00m@0: * Unless required by applicable law or agreed to in writing, software indvd00m@0: * distributed under the License is distributed on an "AS IS" BASIS, indvd00m@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. indvd00m@0: * See the License for the specific language governing permissions and indvd00m@0: * limitations under the License. indvd00m@0: * ============================================================ */ indvd00m@0: indvd00m@0: indvd00m@0: !function ($) { indvd00m@0: indvd00m@0: "use strict"; // jshint ;_; indvd00m@0: indvd00m@0: indvd00m@0: /* COLLAPSE PUBLIC CLASS DEFINITION indvd00m@0: * ================================ */ indvd00m@0: indvd00m@0: var Collapse = function (element, options) { indvd00m@0: this.$element = $(element) indvd00m@0: this.options = $.extend({}, $.fn.collapse.defaults, options) indvd00m@0: indvd00m@0: if (this.options.parent) { indvd00m@0: this.$parent = $(this.options.parent) indvd00m@0: } indvd00m@0: indvd00m@0: this.options.toggle && this.toggle() indvd00m@0: } indvd00m@0: indvd00m@0: Collapse.prototype = { indvd00m@0: indvd00m@0: constructor: Collapse indvd00m@0: indvd00m@0: , dimension: function () { indvd00m@0: var hasWidth = this.$element.hasClass('width') indvd00m@0: return hasWidth ? 'width' : 'height' indvd00m@0: } indvd00m@0: indvd00m@0: , show: function () { indvd00m@0: var dimension indvd00m@0: , scroll indvd00m@0: , actives indvd00m@0: , hasData indvd00m@0: indvd00m@0: if (this.transitioning || this.$element.hasClass('in')) return indvd00m@0: indvd00m@0: dimension = this.dimension() indvd00m@0: scroll = $.camelCase(['scroll', dimension].join('-')) indvd00m@0: actives = this.$parent && this.$parent.find('> .accordion-group > .in') indvd00m@0: indvd00m@0: if (actives && actives.length) { indvd00m@0: hasData = actives.data('collapse') indvd00m@0: if (hasData && hasData.transitioning) return indvd00m@0: actives.collapse('hide') indvd00m@0: hasData || actives.data('collapse', null) indvd00m@0: } indvd00m@0: indvd00m@0: this.$element[dimension](0) indvd00m@0: this.transition('addClass', $.Event('show'), 'shown') indvd00m@0: $.support.transition && this.$element[dimension](this.$element[0][scroll]) indvd00m@0: } indvd00m@0: indvd00m@0: , hide: function () { indvd00m@0: var dimension indvd00m@0: if (this.transitioning || !this.$element.hasClass('in')) return indvd00m@0: dimension = this.dimension() indvd00m@0: this.reset(this.$element[dimension]()) indvd00m@0: this.transition('removeClass', $.Event('hide'), 'hidden') indvd00m@0: this.$element[dimension](0) indvd00m@0: } indvd00m@0: indvd00m@0: , reset: function (size) { indvd00m@0: var dimension = this.dimension() indvd00m@0: indvd00m@0: this.$element indvd00m@0: .removeClass('collapse') indvd00m@0: [dimension](size || 'auto') indvd00m@0: [0].offsetWidth indvd00m@0: indvd00m@0: this.$element[size !== null ? 'addClass' : 'removeClass']('collapse') indvd00m@0: indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: , transition: function (method, startEvent, completeEvent) { indvd00m@0: var that = this indvd00m@0: , complete = function () { indvd00m@0: if (startEvent.type == 'show') that.reset() indvd00m@0: that.transitioning = 0 indvd00m@0: that.$element.trigger(completeEvent) indvd00m@0: } indvd00m@0: indvd00m@0: this.$element.trigger(startEvent) indvd00m@0: indvd00m@0: if (startEvent.isDefaultPrevented()) return indvd00m@0: indvd00m@0: this.transitioning = 1 indvd00m@0: indvd00m@0: this.$element[method]('in') indvd00m@0: indvd00m@0: $.support.transition && this.$element.hasClass('collapse') ? indvd00m@0: this.$element.one($.support.transition.end, complete) : indvd00m@0: complete() indvd00m@0: } indvd00m@0: indvd00m@0: , toggle: function () { indvd00m@0: this[this.$element.hasClass('in') ? 'hide' : 'show']() indvd00m@0: } indvd00m@0: indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* COLLAPSE PLUGIN DEFINITION indvd00m@0: * ========================== */ indvd00m@0: indvd00m@0: var old = $.fn.collapse indvd00m@0: indvd00m@0: $.fn.collapse = function (option) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('collapse') indvd00m@0: , options = $.extend({}, $.fn.collapse.defaults, $this.data(), typeof option == 'object' && option) indvd00m@0: if (!data) $this.data('collapse', (data = new Collapse(this, options))) indvd00m@0: if (typeof option == 'string') data[option]() indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.collapse.defaults = { indvd00m@0: toggle: true indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.collapse.Constructor = Collapse indvd00m@0: indvd00m@0: indvd00m@0: /* COLLAPSE NO CONFLICT indvd00m@0: * ==================== */ indvd00m@0: indvd00m@0: $.fn.collapse.noConflict = function () { indvd00m@0: $.fn.collapse = old indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* COLLAPSE DATA-API indvd00m@0: * ================= */ indvd00m@0: indvd00m@0: $(document).on('click.collapse.data-api', '[data-toggle=collapse]', function (e) { indvd00m@0: var $this = $(this), href indvd00m@0: , target = $this.attr('data-target') indvd00m@0: || e.preventDefault() indvd00m@0: || (href = $this.attr('href')) && href.replace(/.*(?=#[^\s]+$)/, '') //strip for ie7 indvd00m@0: , option = $(target).data('collapse') ? 'toggle' : $this.data() indvd00m@0: $this[$(target).hasClass('in') ? 'addClass' : 'removeClass']('collapsed') indvd00m@0: $(target).collapse(option) indvd00m@0: }) indvd00m@0: indvd00m@0: }(window.jQuery);/* ============================================================ indvd00m@0: * bootstrap-dropdown.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#dropdowns indvd00m@0: * ============================================================ indvd00m@0: * Copyright 2012 Twitter, Inc. indvd00m@0: * indvd00m@0: * Licensed under the Apache License, Version 2.0 (the "License"); indvd00m@0: * you may not use this file except in compliance with the License. indvd00m@0: * You may obtain a copy of the License at indvd00m@0: * indvd00m@0: * http://www.apache.org/licenses/LICENSE-2.0 indvd00m@0: * indvd00m@0: * Unless required by applicable law or agreed to in writing, software indvd00m@0: * distributed under the License is distributed on an "AS IS" BASIS, indvd00m@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. indvd00m@0: * See the License for the specific language governing permissions and indvd00m@0: * limitations under the License. indvd00m@0: * ============================================================ */ indvd00m@0: indvd00m@0: indvd00m@0: !function ($) { indvd00m@0: indvd00m@0: "use strict"; // jshint ;_; indvd00m@0: indvd00m@0: indvd00m@0: /* DROPDOWN CLASS DEFINITION indvd00m@0: * ========================= */ indvd00m@0: indvd00m@0: var toggle = '[data-toggle=dropdown]' indvd00m@0: , Dropdown = function (element) { indvd00m@0: var $el = $(element).on('click.dropdown.data-api', this.toggle) indvd00m@0: $('html').on('click.dropdown.data-api', function () { indvd00m@0: $el.parent().removeClass('open') indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: Dropdown.prototype = { indvd00m@0: indvd00m@0: constructor: Dropdown indvd00m@0: indvd00m@0: , toggle: function (e) { indvd00m@0: var $this = $(this) indvd00m@0: , $parent indvd00m@0: , isActive indvd00m@0: indvd00m@0: if ($this.is('.disabled, :disabled')) return indvd00m@0: indvd00m@0: $parent = getParent($this) indvd00m@0: indvd00m@0: isActive = $parent.hasClass('open') indvd00m@0: indvd00m@0: clearMenus() indvd00m@0: indvd00m@0: if (!isActive) { indvd00m@0: $parent.toggleClass('open') indvd00m@0: } indvd00m@0: indvd00m@0: $this.focus() indvd00m@0: indvd00m@0: return false indvd00m@0: } indvd00m@0: indvd00m@0: , keydown: function (e) { indvd00m@0: var $this indvd00m@0: , $items indvd00m@0: , $active indvd00m@0: , $parent indvd00m@0: , isActive indvd00m@0: , index indvd00m@0: indvd00m@0: if (!/(38|40|27)/.test(e.keyCode)) return indvd00m@0: indvd00m@0: $this = $(this) indvd00m@0: indvd00m@0: e.preventDefault() indvd00m@0: e.stopPropagation() indvd00m@0: indvd00m@0: if ($this.is('.disabled, :disabled')) return indvd00m@0: indvd00m@0: $parent = getParent($this) indvd00m@0: indvd00m@0: isActive = $parent.hasClass('open') indvd00m@0: indvd00m@0: if (!isActive || (isActive && e.keyCode == 27)) { indvd00m@0: if (e.which == 27) $parent.find(toggle).focus() indvd00m@0: return $this.click() indvd00m@0: } indvd00m@0: indvd00m@0: $items = $('[role=menu] li:not(.divider):visible a', $parent) indvd00m@0: indvd00m@0: if (!$items.length) return indvd00m@0: indvd00m@0: index = $items.index($items.filter(':focus')) indvd00m@0: indvd00m@0: if (e.keyCode == 38 && index > 0) index-- // up indvd00m@0: if (e.keyCode == 40 && index < $items.length - 1) index++ // down indvd00m@0: if (!~index) index = 0 indvd00m@0: indvd00m@0: $items indvd00m@0: .eq(index) indvd00m@0: .focus() indvd00m@0: } indvd00m@0: indvd00m@0: } indvd00m@0: indvd00m@0: function clearMenus() { indvd00m@0: $(toggle).each(function () { indvd00m@0: getParent($(this)).removeClass('open') indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: function getParent($this) { indvd00m@0: var selector = $this.attr('data-target') indvd00m@0: , $parent indvd00m@0: indvd00m@0: if (!selector) { indvd00m@0: selector = $this.attr('href') indvd00m@0: selector = selector && /#/.test(selector) && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 indvd00m@0: } indvd00m@0: indvd00m@0: $parent = selector && $(selector) indvd00m@0: indvd00m@0: if (!$parent || !$parent.length) $parent = $this.parent() indvd00m@0: indvd00m@0: return $parent indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* DROPDOWN PLUGIN DEFINITION indvd00m@0: * ========================== */ indvd00m@0: indvd00m@0: var old = $.fn.dropdown indvd00m@0: indvd00m@0: $.fn.dropdown = function (option) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('dropdown') indvd00m@0: if (!data) $this.data('dropdown', (data = new Dropdown(this))) indvd00m@0: if (typeof option == 'string') data[option].call($this) indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.dropdown.Constructor = Dropdown indvd00m@0: indvd00m@0: indvd00m@0: /* DROPDOWN NO CONFLICT indvd00m@0: * ==================== */ indvd00m@0: indvd00m@0: $.fn.dropdown.noConflict = function () { indvd00m@0: $.fn.dropdown = old indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* APPLY TO STANDARD DROPDOWN ELEMENTS indvd00m@0: * =================================== */ indvd00m@0: indvd00m@0: $(document) indvd00m@0: .on('click.dropdown.data-api', clearMenus) indvd00m@0: .on('click.dropdown.data-api', '.dropdown form', function (e) { e.stopPropagation() }) indvd00m@0: .on('click.dropdown-menu', function (e) { e.stopPropagation() }) indvd00m@0: .on('click.dropdown.data-api' , toggle, Dropdown.prototype.toggle) indvd00m@0: .on('keydown.dropdown.data-api', toggle + ', [role=menu]' , Dropdown.prototype.keydown) indvd00m@0: indvd00m@0: }(window.jQuery); indvd00m@0: /* ========================================================= indvd00m@0: * bootstrap-modal.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#modals indvd00m@0: * ========================================================= indvd00m@0: * Copyright 2012 Twitter, Inc. indvd00m@0: * indvd00m@0: * Licensed under the Apache License, Version 2.0 (the "License"); indvd00m@0: * you may not use this file except in compliance with the License. indvd00m@0: * You may obtain a copy of the License at indvd00m@0: * indvd00m@0: * http://www.apache.org/licenses/LICENSE-2.0 indvd00m@0: * indvd00m@0: * Unless required by applicable law or agreed to in writing, software indvd00m@0: * distributed under the License is distributed on an "AS IS" BASIS, indvd00m@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. indvd00m@0: * See the License for the specific language governing permissions and indvd00m@0: * limitations under the License. indvd00m@0: * ========================================================= */ indvd00m@0: indvd00m@0: indvd00m@0: !function ($) { indvd00m@0: indvd00m@0: "use strict"; // jshint ;_; indvd00m@0: indvd00m@0: indvd00m@0: /* MODAL CLASS DEFINITION indvd00m@0: * ====================== */ indvd00m@0: indvd00m@0: var Modal = function (element, options) { indvd00m@0: this.options = options indvd00m@0: this.$element = $(element) indvd00m@0: .delegate('[data-dismiss="modal"]', 'click.dismiss.modal', $.proxy(this.hide, this)) indvd00m@0: this.options.remote && this.$element.find('.modal-body').load(this.options.remote) indvd00m@0: } indvd00m@0: indvd00m@0: Modal.prototype = { indvd00m@0: indvd00m@0: constructor: Modal indvd00m@0: indvd00m@0: , toggle: function () { indvd00m@0: return this[!this.isShown ? 'show' : 'hide']() indvd00m@0: } indvd00m@0: indvd00m@0: , show: function () { indvd00m@0: var that = this indvd00m@0: , e = $.Event('show') indvd00m@0: indvd00m@0: this.$element.trigger(e) indvd00m@0: indvd00m@0: if (this.isShown || e.isDefaultPrevented()) return indvd00m@0: indvd00m@0: this.isShown = true indvd00m@0: indvd00m@0: this.escape() indvd00m@0: indvd00m@0: this.backdrop(function () { indvd00m@0: var transition = $.support.transition && that.$element.hasClass('fade') indvd00m@0: indvd00m@0: if (!that.$element.parent().length) { indvd00m@0: that.$element.appendTo(document.body) //don't move modals dom position indvd00m@0: } indvd00m@0: indvd00m@0: that.$element.show() indvd00m@0: indvd00m@0: if (transition) { indvd00m@0: that.$element[0].offsetWidth // force reflow indvd00m@0: } indvd00m@0: indvd00m@0: that.$element indvd00m@0: .addClass('in') indvd00m@0: .attr('aria-hidden', false) indvd00m@0: indvd00m@0: that.enforceFocus() indvd00m@0: indvd00m@0: transition ? indvd00m@0: that.$element.one($.support.transition.end, function () { that.$element.focus().trigger('shown') }) : indvd00m@0: that.$element.focus().trigger('shown') indvd00m@0: indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: , hide: function (e) { indvd00m@0: e && e.preventDefault() indvd00m@0: indvd00m@0: var that = this indvd00m@0: indvd00m@0: e = $.Event('hide') indvd00m@0: indvd00m@0: this.$element.trigger(e) indvd00m@0: indvd00m@0: if (!this.isShown || e.isDefaultPrevented()) return indvd00m@0: indvd00m@0: this.isShown = false indvd00m@0: indvd00m@0: this.escape() indvd00m@0: indvd00m@0: $(document).off('focusin.modal') indvd00m@0: indvd00m@0: this.$element indvd00m@0: .removeClass('in') indvd00m@0: .attr('aria-hidden', true) indvd00m@0: indvd00m@0: $.support.transition && this.$element.hasClass('fade') ? indvd00m@0: this.hideWithTransition() : indvd00m@0: this.hideModal() indvd00m@0: } indvd00m@0: indvd00m@0: , enforceFocus: function () { indvd00m@0: var that = this indvd00m@0: $(document).on('focusin.modal', function (e) { indvd00m@0: if (that.$element[0] !== e.target && !that.$element.has(e.target).length) { indvd00m@0: that.$element.focus() indvd00m@0: } indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: , escape: function () { indvd00m@0: var that = this indvd00m@0: if (this.isShown && this.options.keyboard) { indvd00m@0: this.$element.on('keyup.dismiss.modal', function ( e ) { indvd00m@0: e.which == 27 && that.hide() indvd00m@0: }) indvd00m@0: } else if (!this.isShown) { indvd00m@0: this.$element.off('keyup.dismiss.modal') indvd00m@0: } indvd00m@0: } indvd00m@0: indvd00m@0: , hideWithTransition: function () { indvd00m@0: var that = this indvd00m@0: , timeout = setTimeout(function () { indvd00m@0: that.$element.off($.support.transition.end) indvd00m@0: that.hideModal() indvd00m@0: }, 500) indvd00m@0: indvd00m@0: this.$element.one($.support.transition.end, function () { indvd00m@0: clearTimeout(timeout) indvd00m@0: that.hideModal() indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: , hideModal: function () { indvd00m@0: var that = this indvd00m@0: this.$element.hide() indvd00m@0: this.backdrop(function () { indvd00m@0: that.removeBackdrop() indvd00m@0: that.$element.trigger('hidden') indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: , removeBackdrop: function () { indvd00m@0: this.$backdrop && this.$backdrop.remove() indvd00m@0: this.$backdrop = null indvd00m@0: } indvd00m@0: indvd00m@0: , backdrop: function (callback) { indvd00m@0: var that = this indvd00m@0: , animate = this.$element.hasClass('fade') ? 'fade' : '' indvd00m@0: indvd00m@0: if (this.isShown && this.options.backdrop) { indvd00m@0: var doAnimate = $.support.transition && animate indvd00m@0: indvd00m@0: this.$backdrop = $('
') indvd00m@0: .appendTo(document.body) indvd00m@0: indvd00m@0: this.$backdrop.click( indvd00m@0: this.options.backdrop == 'static' ? indvd00m@0: $.proxy(this.$element[0].focus, this.$element[0]) indvd00m@0: : $.proxy(this.hide, this) indvd00m@0: ) indvd00m@0: indvd00m@0: if (doAnimate) this.$backdrop[0].offsetWidth // force reflow indvd00m@0: indvd00m@0: this.$backdrop.addClass('in') indvd00m@0: indvd00m@0: if (!callback) return indvd00m@0: indvd00m@0: doAnimate ? indvd00m@0: this.$backdrop.one($.support.transition.end, callback) : indvd00m@0: callback() indvd00m@0: indvd00m@0: } else if (!this.isShown && this.$backdrop) { indvd00m@0: this.$backdrop.removeClass('in') indvd00m@0: indvd00m@0: $.support.transition && this.$element.hasClass('fade')? indvd00m@0: this.$backdrop.one($.support.transition.end, callback) : indvd00m@0: callback() indvd00m@0: indvd00m@0: } else if (callback) { indvd00m@0: callback() indvd00m@0: } indvd00m@0: } indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* MODAL PLUGIN DEFINITION indvd00m@0: * ======================= */ indvd00m@0: indvd00m@0: var old = $.fn.modal indvd00m@0: indvd00m@0: $.fn.modal = function (option) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('modal') indvd00m@0: , options = $.extend({}, $.fn.modal.defaults, $this.data(), typeof option == 'object' && option) indvd00m@0: if (!data) $this.data('modal', (data = new Modal(this, options))) indvd00m@0: if (typeof option == 'string') data[option]() indvd00m@0: else if (options.show) data.show() indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.modal.defaults = { indvd00m@0: backdrop: true indvd00m@0: , keyboard: true indvd00m@0: , show: true indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.modal.Constructor = Modal indvd00m@0: indvd00m@0: indvd00m@0: /* MODAL NO CONFLICT indvd00m@0: * ================= */ indvd00m@0: indvd00m@0: $.fn.modal.noConflict = function () { indvd00m@0: $.fn.modal = old indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* MODAL DATA-API indvd00m@0: * ============== */ indvd00m@0: indvd00m@0: $(document).on('click.modal.data-api', '[data-toggle="modal"]', function (e) { indvd00m@0: var $this = $(this) indvd00m@0: , href = $this.attr('href') indvd00m@0: , $target = $($this.attr('data-target') || (href && href.replace(/.*(?=#[^\s]+$)/, ''))) //strip for ie7 indvd00m@0: , option = $target.data('modal') ? 'toggle' : $.extend({ remote:!/#/.test(href) && href }, $target.data(), $this.data()) indvd00m@0: indvd00m@0: e.preventDefault() indvd00m@0: indvd00m@0: $target indvd00m@0: .modal(option) indvd00m@0: .one('hide', function () { indvd00m@0: $this.focus() indvd00m@0: }) indvd00m@0: }) indvd00m@0: indvd00m@0: }(window.jQuery); indvd00m@0: /* =========================================================== indvd00m@0: * bootstrap-tooltip.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#tooltips indvd00m@0: * Inspired by the original jQuery.tipsy by Jason Frame indvd00m@0: * =========================================================== indvd00m@0: * Copyright 2012 Twitter, Inc. indvd00m@0: * indvd00m@0: * Licensed under the Apache License, Version 2.0 (the "License"); indvd00m@0: * you may not use this file except in compliance with the License. indvd00m@0: * You may obtain a copy of the License at indvd00m@0: * indvd00m@0: * http://www.apache.org/licenses/LICENSE-2.0 indvd00m@0: * indvd00m@0: * Unless required by applicable law or agreed to in writing, software indvd00m@0: * distributed under the License is distributed on an "AS IS" BASIS, indvd00m@0: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. indvd00m@0: * See the License for the specific language governing permissions and indvd00m@0: * limitations under the License. indvd00m@0: * ========================================================== */ indvd00m@0: indvd00m@0: indvd00m@0: !function ($) { indvd00m@0: indvd00m@0: "use strict"; // jshint ;_; indvd00m@0: indvd00m@0: indvd00m@0: /* TOOLTIP PUBLIC CLASS DEFINITION indvd00m@0: * =============================== */ indvd00m@0: indvd00m@0: var Tooltip = function (element, options) { indvd00m@0: this.init('tooltip', element, options) indvd00m@0: } indvd00m@0: indvd00m@0: Tooltip.prototype = { indvd00m@0: indvd00m@0: constructor: Tooltip indvd00m@0: indvd00m@0: , init: function (type, element, options) { indvd00m@0: var eventIn indvd00m@0: , eventOut indvd00m@0: , triggers indvd00m@0: , trigger indvd00m@0: , i indvd00m@0: indvd00m@0: this.type = type indvd00m@0: this.$element = $(element) indvd00m@0: this.options = this.getOptions(options) indvd00m@0: this.enabled = true indvd00m@0: indvd00m@0: triggers = this.options.trigger.split(' ') indvd00m@0: indvd00m@0: for (i = triggers.length; i--;) { indvd00m@0: trigger = triggers[i] indvd00m@0: if (trigger == 'click') { indvd00m@0: this.$element.on('click.' + this.type, this.options.selector, $.proxy(this.toggle, this)) indvd00m@0: } else if (trigger != 'manual') { indvd00m@0: eventIn = trigger == 'hover' ? 'mouseenter' : 'focus' indvd00m@0: eventOut = trigger == 'hover' ? 'mouseleave' : 'blur' indvd00m@0: this.$element.on(eventIn + '.' + this.type, this.options.selector, $.proxy(this.enter, this)) indvd00m@0: this.$element.on(eventOut + '.' + this.type, this.options.selector, $.proxy(this.leave, this)) indvd00m@0: } indvd00m@0: } indvd00m@0: indvd00m@0: this.options.selector ? indvd00m@0: (this._options = $.extend({}, this.options, { trigger: 'manual', selector: '' })) : indvd00m@0: this.fixTitle() indvd00m@0: } indvd00m@0: indvd00m@0: , getOptions: function (options) { indvd00m@0: options = $.extend({}, $.fn[this.type].defaults, this.$element.data(), options) indvd00m@0: indvd00m@0: if (options.delay && typeof options.delay == 'number') { indvd00m@0: options.delay = { indvd00m@0: show: options.delay indvd00m@0: , hide: options.delay indvd00m@0: } indvd00m@0: } indvd00m@0: indvd00m@0: return options indvd00m@0: } indvd00m@0: indvd00m@0: , enter: function (e) { indvd00m@0: var defaults = $.fn[this.type].defaults indvd00m@0: , options = {} indvd00m@0: , self indvd00m@0: indvd00m@0: this._options && $.each(this._options, function (key, value) { indvd00m@0: if (defaults[key] != value) options[key] = value indvd00m@0: }, this) indvd00m@0: indvd00m@0: self = $(e.currentTarget)[this.type](options).data(this.type) indvd00m@0: indvd00m@0: if (!self.options.delay || !self.options.delay.show) return self.show() indvd00m@0: indvd00m@0: clearTimeout(this.timeout) indvd00m@0: self.hoverState = 'in' indvd00m@0: this.timeout = setTimeout(function() { indvd00m@0: if (self.hoverState == 'in') self.show() indvd00m@0: }, self.options.delay.show) indvd00m@0: } indvd00m@0: indvd00m@0: , leave: function (e) { indvd00m@0: var self = $(e.currentTarget)[this.type](this._options).data(this.type) indvd00m@0: indvd00m@0: if (this.timeout) clearTimeout(this.timeout) indvd00m@0: if (!self.options.delay || !self.options.delay.hide) return self.hide() indvd00m@0: indvd00m@0: self.hoverState = 'out' indvd00m@0: this.timeout = setTimeout(function() { indvd00m@0: if (self.hoverState == 'out') self.hide() indvd00m@0: }, self.options.delay.hide) indvd00m@0: } indvd00m@0: indvd00m@0: , show: function () { indvd00m@0: var $tip indvd00m@0: , pos indvd00m@0: , actualWidth indvd00m@0: , actualHeight indvd00m@0: , placement indvd00m@0: , tp indvd00m@0: , e = $.Event('show') indvd00m@0: indvd00m@0: if (this.hasContent() && this.enabled) { indvd00m@0: this.$element.trigger(e) indvd00m@0: if (e.isDefaultPrevented()) return indvd00m@0: $tip = this.tip() indvd00m@0: this.setContent() indvd00m@0: indvd00m@0: if (this.options.animation) { indvd00m@0: $tip.addClass('fade') indvd00m@0: } indvd00m@0: indvd00m@0: placement = typeof this.options.placement == 'function' ? indvd00m@0: this.options.placement.call(this, $tip[0], this.$element[0]) : indvd00m@0: this.options.placement indvd00m@0: indvd00m@0: $tip indvd00m@0: .detach() indvd00m@0: .css({ top: 0, left: 0, display: 'block' }) indvd00m@0: indvd00m@0: this.options.container ? $tip.appendTo(this.options.container) : $tip.insertAfter(this.$element) indvd00m@0: indvd00m@0: pos = this.getPosition() indvd00m@0: indvd00m@0: actualWidth = $tip[0].offsetWidth indvd00m@0: actualHeight = $tip[0].offsetHeight indvd00m@0: indvd00m@0: switch (placement) { indvd00m@0: case 'bottom': indvd00m@0: tp = {top: pos.top + pos.height, left: pos.left + pos.width / 2 - actualWidth / 2} indvd00m@0: break indvd00m@0: case 'top': indvd00m@0: tp = {top: pos.top - actualHeight, left: pos.left + pos.width / 2 - actualWidth / 2} indvd00m@0: break indvd00m@0: case 'left': indvd00m@0: tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left - actualWidth} indvd00m@0: break indvd00m@0: case 'right': indvd00m@0: tp = {top: pos.top + pos.height / 2 - actualHeight / 2, left: pos.left + pos.width} indvd00m@0: break indvd00m@0: } indvd00m@0: indvd00m@0: this.applyPlacement(tp, placement) indvd00m@0: this.$element.trigger('shown') indvd00m@0: } indvd00m@0: } indvd00m@0: indvd00m@0: , applyPlacement: function(offset, placement){ indvd00m@0: var $tip = this.tip() indvd00m@0: , width = $tip[0].offsetWidth indvd00m@0: , height = $tip[0].offsetHeight indvd00m@0: , actualWidth indvd00m@0: , actualHeight indvd00m@0: , delta indvd00m@0: , replace indvd00m@0: indvd00m@0: $tip indvd00m@0: .offset(offset) indvd00m@0: .addClass(placement) indvd00m@0: .addClass('in') indvd00m@0: indvd00m@0: actualWidth = $tip[0].offsetWidth indvd00m@0: actualHeight = $tip[0].offsetHeight indvd00m@0: indvd00m@0: if (placement == 'top' && actualHeight != height) { indvd00m@0: offset.top = offset.top + height - actualHeight indvd00m@0: replace = true indvd00m@0: } indvd00m@0: indvd00m@0: if (placement == 'bottom' || placement == 'top') { indvd00m@0: delta = 0 indvd00m@0: indvd00m@0: if (offset.left < 0){ indvd00m@0: delta = offset.left * -2 indvd00m@0: offset.left = 0 indvd00m@0: $tip.offset(offset) indvd00m@0: actualWidth = $tip[0].offsetWidth indvd00m@0: actualHeight = $tip[0].offsetHeight indvd00m@0: } indvd00m@0: indvd00m@0: this.replaceArrow(delta - width + actualWidth, actualWidth, 'left') indvd00m@0: } else { indvd00m@0: this.replaceArrow(actualHeight - height, actualHeight, 'top') indvd00m@0: } indvd00m@0: indvd00m@0: if (replace) $tip.offset(offset) indvd00m@0: } indvd00m@0: indvd00m@0: , replaceArrow: function(delta, dimension, position){ indvd00m@0: this indvd00m@0: .arrow() indvd00m@0: .css(position, delta ? (50 * (1 - delta / dimension) + "%") : '') indvd00m@0: } indvd00m@0: indvd00m@0: , setContent: function () { indvd00m@0: var $tip = this.tip() indvd00m@0: , title = this.getTitle() indvd00m@0: indvd00m@0: $tip.find('.tooltip-inner')[this.options.html ? 'html' : 'text'](title) indvd00m@0: $tip.removeClass('fade in top bottom left right') indvd00m@0: } indvd00m@0: indvd00m@0: , hide: function () { indvd00m@0: var that = this indvd00m@0: , $tip = this.tip() indvd00m@0: , e = $.Event('hide') indvd00m@0: indvd00m@0: this.$element.trigger(e) indvd00m@0: if (e.isDefaultPrevented()) return indvd00m@0: indvd00m@0: $tip.removeClass('in') indvd00m@0: indvd00m@0: function removeWithAnimation() { indvd00m@0: var timeout = setTimeout(function () { indvd00m@0: $tip.off($.support.transition.end).detach() indvd00m@0: }, 500) indvd00m@0: indvd00m@0: $tip.one($.support.transition.end, function () { indvd00m@0: clearTimeout(timeout) indvd00m@0: $tip.detach() indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.support.transition && this.$tip.hasClass('fade') ? indvd00m@0: removeWithAnimation() : indvd00m@0: $tip.detach() indvd00m@0: indvd00m@0: this.$element.trigger('hidden') indvd00m@0: indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: , fixTitle: function () { indvd00m@0: var $e = this.$element indvd00m@0: if ($e.attr('title') || typeof($e.attr('data-original-title')) != 'string') { indvd00m@0: $e.attr('data-original-title', $e.attr('title') || '').attr('title', '') indvd00m@0: } indvd00m@0: } indvd00m@0: indvd00m@0: , hasContent: function () { indvd00m@0: return this.getTitle() indvd00m@0: } indvd00m@0: indvd00m@0: , getPosition: function () { indvd00m@0: var el = this.$element[0] indvd00m@0: return $.extend({}, (typeof el.getBoundingClientRect == 'function') ? el.getBoundingClientRect() : { indvd00m@0: width: el.offsetWidth indvd00m@0: , height: el.offsetHeight indvd00m@0: }, this.$element.offset()) indvd00m@0: } indvd00m@0: indvd00m@0: , getTitle: function () { indvd00m@0: var title indvd00m@0: , $e = this.$element indvd00m@0: , o = this.options indvd00m@0: indvd00m@0: title = $e.attr('data-original-title') indvd00m@0: || (typeof o.title == 'function' ? o.title.call($e[0]) : o.title) indvd00m@0: indvd00m@0: return title indvd00m@0: } indvd00m@0: indvd00m@0: , tip: function () { indvd00m@0: return this.$tip = this.$tip || $(this.options.template) indvd00m@0: } indvd00m@0: indvd00m@0: , arrow: function(){ indvd00m@0: return this.$arrow = this.$arrow || this.tip().find(".tooltip-arrow") indvd00m@0: } indvd00m@0: indvd00m@0: , validate: function () { indvd00m@0: if (!this.$element[0].parentNode) { indvd00m@0: this.hide() indvd00m@0: this.$element = null indvd00m@0: this.options = null indvd00m@0: } indvd00m@0: } indvd00m@0: indvd00m@0: , enable: function () { indvd00m@0: this.enabled = true indvd00m@0: } indvd00m@0: indvd00m@0: , disable: function () { indvd00m@0: this.enabled = false indvd00m@0: } indvd00m@0: indvd00m@0: , toggleEnabled: function () { indvd00m@0: this.enabled = !this.enabled indvd00m@0: } indvd00m@0: indvd00m@0: , toggle: function (e) { indvd00m@0: var self = e ? $(e.currentTarget)[this.type](this._options).data(this.type) : this indvd00m@0: self.tip().hasClass('in') ? self.hide() : self.show() indvd00m@0: } indvd00m@0: indvd00m@0: , destroy: function () { indvd00m@0: this.hide().$element.off('.' + this.type).removeData(this.type) indvd00m@0: } indvd00m@0: indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* TOOLTIP PLUGIN DEFINITION indvd00m@0: * ========================= */ indvd00m@0: indvd00m@0: var old = $.fn.tooltip indvd00m@0: indvd00m@0: $.fn.tooltip = function ( option ) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('tooltip') indvd00m@0: , options = typeof option == 'object' && option indvd00m@0: if (!data) $this.data('tooltip', (data = new Tooltip(this, options))) indvd00m@0: if (typeof option == 'string') data[option]() indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.tooltip.Constructor = Tooltip indvd00m@0: indvd00m@0: $.fn.tooltip.defaults = { indvd00m@0: animation: true indvd00m@0: , placement: 'top' indvd00m@0: , selector: false indvd00m@0: , template: '