aboutsummaryrefslogtreecommitdiff
path: root/public/js/alerts.js
diff options
context:
space:
mode:
Diffstat (limited to 'public/js/alerts.js')
-rw-r--r--public/js/alerts.js11
1 files changed, 11 insertions, 0 deletions
diff --git a/public/js/alerts.js b/public/js/alerts.js
new file mode 100644
index 0000000..c1763ed
--- /dev/null
+++ b/public/js/alerts.js
@@ -0,0 +1,11 @@
+$.fn.addAlert = function (kind, message) {
+ var box = '<div class="alert alert-' + kind + ' alert-dismissible" role="alert">' +
+ '<button type="button" class="close" data-dismiss="alert" aria-label="Close"><span aria-hidden="true">&times;</span></button>' +
+ message + '</div>';
+
+ $(this).find('.alerts').append($(box));
+}
+
+$.fn.clearAlerts = function () {
+ $(this).find('.alerts').html('');
+}