-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbootstrap-alerts.min.js
18 lines (18 loc) · 988 Bytes
/
bootstrap-alerts.min.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
/*
* Bootstrap Alerts v1.2.2, jQuery plugin
*
* Copyright(c) 2015, Javier Prieto
* http://jprieton.github.io/bootstrap-alerts/
*
* A jQuery plugin for displaying Bootstrap alerts.
* Licensed under the MIT License
*/
!function(e){"use strict"
e.fn.bootstrapAlert=function(t){var s=e.extend({type:"info",dismissible:!0,heading:"",message:"",clear:!0},t)
if(0===s.type.length)return console.log("bootstrapAlert: type is empty"),!1
if(0===s.message.length)return console.log("bootstrapAlert: message is empty"),!1
var a=e('<div class="alert alert-'+s.type+'" role="alert">')
if(s.dismissible){e(a).addClass("alert-dismissible")
var i=e('<button type="button" class="close" data-dismiss="alert" aria-label="Close">'),l=e('<span aria-hidden="true">').html("×")
e(l).appendTo(i),e(i).appendTo(a)}if(s.heading.length>0){var r=e('<h4 class="alert-heading">').html(s.heading)
e(r).appendTo(a)}return e(a).append(s.message),s.clear&&e(this).empty(),e(a).appendTo(this),this}}(jQuery)