PageSourceSearch

https://www.osfi-bsif.gc.ca/themes/contrib/wxt_bootstrap/js/bootstrap/popover.js?tlrnjq

js osfi-bsif.gc.ca collected 2026-09-24 08:41:47 UTC 3,406 bytes, 123 lines download raw bytes

vendor: 3,406 bytes, lines 1-123
1/* ========================================================================
2 * Bootstrap: popover.js v3.4.4
3 * https://bootstrap.7pro.ca/docs/3.4/javascript/#popovers
4 * ========================================================================
5 * Copyright 2024 Entreprise 7pro.ca Inc.
6 * Licensed under MIT (https://github.com/entreprise7pro/bootstrap/blob/v3-dev/LICENSE)
7 * Copyright 2011-2019 Twitter, Inc.
8 * Licensed under MIT (https://github.com/twbs/bootstrap/blob/v3-dev/LICENSE)
9 * ======================================================================== */
10
11
12+function ($) {
13  'use strict';
14
15  // POPOVER PUBLIC CLASS DEFINITION
16  // ===============================
17
18  var Popover = function (element, options) {
19    this.init('popover', element, options)
20  }
21
22  if (!$.fn.tooltip) throw new Error('Popover requires tooltip.js')
23
24  Popover.VERSION = '3.4.4'
25
26  Popover.DEFAULTS = $.extend({}, $.fn.tooltip.Constructor.DEFAULTS, {
27    placement: 'right',
28    trigger: 'click',
29    content: '',
30    template: '<div class="popover" role="tooltip"><div class="arrow"></div><h3 class="popover-title"></h3><div class="popover-content"></div></div>'
31  })
32
33
34  // NOTE: POPOVER EXTENDS tooltip.js
35  // ================================
36
37  Popover.prototype = $.extend({}, $.fn.tooltip.Constructor.prototype)
38
39  Popover.prototype.constructor = Popover
40
41  Popover.prototype.getDefaults = function () {
42    return Popover.DEFAULTS
43  }
44
45  Popover.prototype.setContent = function () {
46    var $tip    = this.tip()
47    var title   = this.getTitle()
48    var content = this.getContent()
49
50    if (this.options.html) {
51      var typeContent = typeof content
52
53      if (this.options.sanitize) {
54        title = this.sanitizeHtml(title)
55
56        if (typeContent === 'string') {
57          content = this.sanitizeHtml(content)
58        }
59      }
60
61      $tip.find('.popover-title').html(title)
62      $tip.find('.popover-content').children().detach().end()[
63        typeContent === 'string' ? 'html' : 'append'
64      ](content)
65    } else {
66      $tip.find('.popover-title').text(title)
67      $tip.find('.popover-content').children().detach().end().text(content)
68    }
69
70    $tip.removeClass('fade top bottom left right in')
71
72    $tip.find('.popover-title').hide()
73  }
74
75  Popover.prototype.hasContent = function () {
76    return this.getTitle() || this.getContent()
77  }
78
79  Popover.prototype.getContent = function () {
80    var $e = this.$element
81    var o  = this.options
82
83    return $e.attr('data-content')
84      || (typeof o.content == 'function' ?
85        o.content.call($e[0]) :
86        o.content)
87  }
88
89  Popover.prototype.arrow = function () {
90    return (this.$arrow = this.$arrow || this.tip().find('.arrow'))
91  }
92
93
94  // POPOVER PLUGIN DEFINITION
95  // =========================
96
97  function Plugin(option) {
98    return this.each(function () {
99      var $this   = $(this)
100      var data    = $this.data('bs.popover')
101      var options = typeof option == 'object' && option
102
103      if (!data && /destroy|hide/.test(option)) return
104      if (!data) $this.data('bs.popover', (data = new Popover(this, options)))
105      if (typeof option == 'string') data[option]()
106    })
107  }
108
109  var old = $.fn.popover
110
111  $.fn.popover             = Plugin
112  $.fn.popover.Constructor = Popover
113
114
115  // POPOVER NO CONFLICT
116  // ===================
117
118  $.fn.popover.noConflict = function () {
119    $.fn.popover = old
120    return this
121  }
122
123}(jQuery);

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.