indvd00m@0: /* =========================================================== indvd00m@0: * bootstrap-popover.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#popovers 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: /* POPOVER PUBLIC CLASS DEFINITION indvd00m@0: * =============================== */ indvd00m@0: indvd00m@0: var Popover = function (element, options) { indvd00m@0: this.init('popover', element, options) indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* NOTE: POPOVER EXTENDS BOOTSTRAP-TOOLTIP.js indvd00m@0: ========================================== */ indvd00m@0: indvd00m@0: Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype, { indvd00m@0: indvd00m@0: constructor: Popover indvd00m@0: indvd00m@0: , setContent: function () { indvd00m@0: var $tip = this.tip() indvd00m@0: , title = this.getTitle() indvd00m@0: , content = this.getContent() indvd00m@0: indvd00m@0: $tip.find('.popover-title')[this.options.html ? 'html' : 'text'](title) indvd00m@0: $tip.find('.popover-content')[this.options.html ? 'html' : 'text'](content) indvd00m@0: indvd00m@0: $tip.removeClass('fade top bottom left right in') indvd00m@0: } indvd00m@0: indvd00m@0: , hasContent: function () { indvd00m@0: return this.getTitle() || this.getContent() indvd00m@0: } indvd00m@0: indvd00m@0: , getContent: function () { indvd00m@0: var content indvd00m@0: , $e = this.$element indvd00m@0: , o = this.options indvd00m@0: indvd00m@0: content = (typeof o.content == 'function' ? o.content.call($e[0]) : o.content) indvd00m@0: || $e.attr('data-content') indvd00m@0: indvd00m@0: return content indvd00m@0: } indvd00m@0: indvd00m@0: , tip: function () { indvd00m@0: if (!this.$tip) { indvd00m@0: this.$tip = $(this.options.template) indvd00m@0: } indvd00m@0: return this.$tip 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: /* POPOVER PLUGIN DEFINITION indvd00m@0: * ======================= */ indvd00m@0: indvd00m@0: var old = $.fn.popover indvd00m@0: indvd00m@0: $.fn.popover = function (option) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('popover') indvd00m@0: , options = typeof option == 'object' && option indvd00m@0: if (!data) $this.data('popover', (data = new Popover(this, options))) indvd00m@0: if (typeof option == 'string') data[option]() indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.popover.Constructor = Popover indvd00m@0: indvd00m@0: $.fn.popover.defaults = $.extend({} , $.fn.tooltip.defaults, { indvd00m@0: placement: 'right' indvd00m@0: , trigger: 'click' indvd00m@0: , content: '' indvd00m@0: , template: '

' indvd00m@0: }) indvd00m@0: indvd00m@0: indvd00m@0: /* POPOVER NO CONFLICT indvd00m@0: * =================== */ indvd00m@0: indvd00m@0: $.fn.popover.noConflict = function () { indvd00m@0: $.fn.popover = old indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: }(window.jQuery);