indvd00m@0: /* ========================================================== indvd00m@0: * bootstrap-alert.js v2.3.1 indvd00m@0: * http://twitter.github.com/bootstrap/javascript.html#alerts 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: /* ALERT CLASS DEFINITION indvd00m@0: * ====================== */ indvd00m@0: indvd00m@0: var dismiss = '[data-dismiss="alert"]' indvd00m@0: , Alert = function (el) { indvd00m@0: $(el).on('click', dismiss, this.close) indvd00m@0: } indvd00m@0: indvd00m@0: Alert.prototype.close = function (e) { indvd00m@0: var $this = $(this) indvd00m@0: , selector = $this.attr('data-target') indvd00m@0: , $parent indvd00m@0: indvd00m@0: if (!selector) { indvd00m@0: selector = $this.attr('href') indvd00m@0: selector = selector && selector.replace(/.*(?=#[^\s]*$)/, '') //strip for ie7 indvd00m@0: } indvd00m@0: indvd00m@0: $parent = $(selector) indvd00m@0: indvd00m@0: e && e.preventDefault() indvd00m@0: indvd00m@0: $parent.length || ($parent = $this.hasClass('alert') ? $this : $this.parent()) indvd00m@0: indvd00m@0: $parent.trigger(e = $.Event('close')) indvd00m@0: indvd00m@0: if (e.isDefaultPrevented()) return indvd00m@0: indvd00m@0: $parent.removeClass('in') indvd00m@0: indvd00m@0: function removeElement() { indvd00m@0: $parent indvd00m@0: .trigger('closed') indvd00m@0: .remove() indvd00m@0: } indvd00m@0: indvd00m@0: $.support.transition && $parent.hasClass('fade') ? indvd00m@0: $parent.on($.support.transition.end, removeElement) : indvd00m@0: removeElement() indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* ALERT PLUGIN DEFINITION indvd00m@0: * ======================= */ indvd00m@0: indvd00m@0: var old = $.fn.alert indvd00m@0: indvd00m@0: $.fn.alert = function (option) { indvd00m@0: return this.each(function () { indvd00m@0: var $this = $(this) indvd00m@0: , data = $this.data('alert') indvd00m@0: if (!data) $this.data('alert', (data = new Alert(this))) indvd00m@0: if (typeof option == 'string') data[option].call($this) indvd00m@0: }) indvd00m@0: } indvd00m@0: indvd00m@0: $.fn.alert.Constructor = Alert indvd00m@0: indvd00m@0: indvd00m@0: /* ALERT NO CONFLICT indvd00m@0: * ================= */ indvd00m@0: indvd00m@0: $.fn.alert.noConflict = function () { indvd00m@0: $.fn.alert = old indvd00m@0: return this indvd00m@0: } indvd00m@0: indvd00m@0: indvd00m@0: /* ALERT DATA-API indvd00m@0: * ============== */ indvd00m@0: indvd00m@0: $(document).on('click.alert.data-api', dismiss, Alert.prototype.close) indvd00m@0: indvd00m@0: }(window.jQuery);