PageSourceSearch

https://pdxsocialhistory.org/assets/bootstrap-alert.js%3Fbody=1

js pdxsocialhistory.org collected 2026-10-02 15:37:14 UTC 2,526 bytes, 100 lines download raw bytes

1/* ==========================================================
2 * bootstrap-alert.js v2.3.1
3 * http://twitter.github.com/bootstrap/javascript.html#alerts
4 * ==========================================================
5 * Copyright 2012 Twitter, Inc.
6 *
7 * Licensed under the Apache License, Version 2.0 (the "License");
8 * you may not use this file except in compliance with the License.
9 * You may obtain a copy of the License at
10 *
11 * http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing, software
14 * distributed under the License is distributed on an "AS IS" BASIS,
15 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 * See the License for the specific language governing permissions and
17 * limitations under the License.
18 * ========================================================== */
19
20
21
22!function ($) {
23
24  "use strict"; // jshint ;_;
25
26
27 /* ALERT CLASS DEFINITION
28  * ====================== */
29
30  var dismiss = '[data-dismiss="alert"]'
31    , Alert = function (el) {
32        $(el).on('click', dismiss, this.close)
33      }
34
35  Alert.prototype.close = function (e) {
36    var $this = $(this)
37      , selector = $this.attr('data-target')
38      , $parent
39
40    if (!selector) {
41      selector = $this.attr('href')
42      selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7
43    }
44
45    $parent = $(selector)
46
47    e && e.preventDefault()
48
49    $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent())
50
51    $parent.trigger(e = $.Event('close'))
52
53    if (e.isDefaultPrevented()) return
54
55    $parent.removeClass('in')
56
57    function removeElement() {
58      $parent
59        .trigger('closed')
60        .remove()
61    }
62
63    $.support.transition && $parent.hasClass('fade') ?
64      $parent.on($.support.transition.end, removeElement) :
65      removeElement()
66  }
67
68
69 /* ALERT PLUGIN DEFINITION
70  * ======================= */
71
72  var old = $.fn.alert
73
74  $.fn.alert = function (option) {
75    return this.each(function () {
76      var $this = $(this)
77        , data = $this.data('alert')
78      if (!data) $this.data('alert', (data = new Alert(this)))
79      if (typeof option == 'string') data[option].call($this)
80    })
81  }
82
83  $.fn.alert.Constructor = Alert
84
85
86 /* ALERT NO CONFLICT
87  * ================= */
88
89  $.fn.alert.noConflict = function () {
90    $.fn.alert = old
91    return this
92  }
93
94
95 /* ALERT DATA-API
96  * ============== */
97
98  $(document).on('click.alert.data-api', dismiss, Alert.prototype.close)
99
100}(window.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.