info@54: /* ======================================================================== info@54: * Bootstrap: popover.js v3.0.3 info@54: * http://getbootstrap.com/javascript/#popovers info@54: * ======================================================================== info@54: * Copyright 2013 Twitter, Inc. info@54: * info@54: * Licensed under the Apache License, Version 2.0 (the "License"); info@54: * you may not use this file except in compliance with the License. info@54: * You may obtain a copy of the License at info@54: * info@54: * http://www.apache.org/licenses/LICENSE-2.0 info@54: * info@54: * Unless required by applicable law or agreed to in writing, software info@54: * distributed under the License is distributed on an "AS IS" BASIS, info@54: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. info@54: * See the License for the specific language governing permissions and info@54: * limitations under the License. info@54: * ======================================================================== */ info@54: info@54: info@54: +function ($) { "use strict"; info@54: info@54: // POPOVER PUBLIC CLASS DEFINITION info@54: // =============================== info@54: info@54: var Popover = function (element, options) { info@54: this.init('popover', element, options) info@54: } info@54: info@54: if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js') info@54: info@54: Popover.DEFAULTS = $.extend({} , $.fn.tooltip.Constructor.DEFAULTS, { info@54: placement: 'right' info@54: , trigger: 'click' info@54: , content: '' info@54: , template: '

' info@54: }) info@54: info@54: info@54: // NOTE: POPOVER EXTENDS tooltip.js info@54: // ================================ info@54: info@54: Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype) info@54: info@54: Popover.prototype.constructor = Popover info@54: info@54: Popover.prototype.getDefaults = function () { info@54: return Popover.DEFAULTS info@54: } info@54: info@54: Popover.prototype.setContent = function () { info@54: var $tip = this.tip() info@54: var title = this.getTitle() info@54: var content = this.getContent() info@54: info@54: $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) info@54: $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) info@54: info@54: $tip.removeClass('fade top bottom left right in') info@54: info@54: // IE8 doesn't accept hiding via the `:empty` pseudo selector, we have to do info@54: // this manually by checking the contents. info@54: if (!$tip.find('.popover-title').html()) $tip.find('.popover-title').hide() info@54: } info@54: info@54: Popover.prototype.hasContent = function () { info@54: return this.getTitle() || this.getContent() info@54: } info@54: info@54: Popover.prototype.getContent = function () { info@54: var $e = this.$element info@54: var o = this.options info@54: info@54: return $e.attr('data-content') info@54: || (typeof o.content == 'function' ? info@54: o.content.call($e[0]) : info@54: o.content) info@54: } info@54: info@54: Popover.prototype.arrow = function () { info@54: return this.$arrow = this.$arrow || this.tip().find('.arrow') info@54: } info@54: info@54: Popover.prototype.tip = function () { info@54: if (!this.$tip) this.$tip = $(this.options.template) info@54: return this.$tip info@54: } info@54: info@54: info@54: // POPOVER PLUGIN DEFINITION info@54: // ========================= info@54: info@54: var old = $.fn.popover info@54: info@54: $.fn.popover = function (option) { info@54: return this.each(function () { info@54: var $this = $(this) info@54: var data = $this.data('bs.popover') info@54: var options = typeof option == 'object' && option info@54: info@54: if (!data) $this.data('bs.popover', (data = new Popover(this, options))) info@54: if (typeof option == 'string') data[option]() info@54: }) info@54: } info@54: info@54: $.fn.popover.Constructor = Popover info@54: info@54: info@54: // POPOVER NO CONFLICT info@54: // =================== info@54: info@54: $.fn.popover.noConflict = function () { info@54: $.fn.popover = old info@54: return this info@54: } info@54: info@54: }(jQuery);