PageSourceSearch

https://ontarionorthland.ca/themes/contrib/wxt_bootstrap/js/bootstrap/alert.js?tlx70r

js ontarionorthland.ca collected 2026-10-01 12:19:26 UTC 2,467 bytes, 97 lines download raw bytes

vendor: 2,467 bytes, lines 1-97
1/* ========================================================================
2 * Bootstrap: alert.js v3.4.4
3 * https://bootstrap.7pro.ca/docs/3.4/javascript/#alerts
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  // ALERT CLASS DEFINITION
16  // ======================
17
18  var dismiss = '[data-dismiss="alert"]'
19  var Alert   = function (el) {
20    $(el).on('click', dismiss, this.close)
21  }
22
23  Alert.VERSION = '3.4.4'
24
25  Alert.TRANSITION_DURATION = 150
26
27  Alert.prototype.close = function (e) {
28    var $this    = $(this)
29    var selector = $this.attr('data-target')
30
31    if (!selector) {
32      selector = $this.attr('href')
33      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') // strip for ie7
34    }
35
36    selector    = selector === '#' ? [] : selector
37    var $parent = $(document).find(selector)
38
39    if (e) e.preventDefault()
40
41    if (!$parent.length) {
42      $parent = $this.closest('.alert')
43    }
44
45    $parent.trigger(e = $.Event('close.bs.alert'))
46
47    if (e.isDefaultPrevented()) return
48
49    $parent.removeClass('in')
50
51    function removeElement() {
52      // detach from parent, fire event then clean up data
53      $parent.detach().trigger('closed.bs.alert').remove()
54    }
55
56    $.support.transition && $parent.hasClass('fade') ?
57      $parent
58        .one('bsTransitionEnd', removeElement)
59        .emulateTransitionEnd(Alert.TRANSITION_DURATION) :
60      removeElement()
61  }
62
63
64  // ALERT PLUGIN DEFINITION
65  // =======================
66
67  function Plugin(option) {
68    return this.each(function () {
69      var $this = $(this)
70      var data  = $this.data('bs.alert')
71
72      if (!data) $this.data('bs.alert', (data = new Alert(this)))
73      if (typeof option == 'string') data[option].call($this)
74    })
75  }
76
77  var old = $.fn.alert
78
79  $.fn.alert             = Plugin
80  $.fn.alert.Constructor = Alert
81
82
83  // ALERT NO CONFLICT
84  // =================
85
86  $.fn.alert.noConflict = function () {
87    $.fn.alert = old
88    return this
89  }
90
91
92  // ALERT DATA-API
93  // ==============
94
95  $(document).on('click.bs.alert.data-api', dismiss, Alert.prototype.close)
96
97}(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.