]> jfr.im git - z_archive/KronOS.git/blobdiff - public/js/application.js
Added error messages for failed login
[z_archive/KronOS.git] / public / js / application.js
index 1a85954f84ed97aa8d5a3464824cb6eb2cbe976a..2acce4099e72f50479c27d71c73d3b499393fec3 100644 (file)
@@ -59,10 +59,17 @@ function submitLogin() {
                        jQuery('#loginModal').modal('hide');
                        loadMenu();
                        loadBackground();
+               } else {
+                       throwError(resp.error, 'error', '.messagebody');
                }
        }, "json");
 }
 
+function throwError(e, t, c) {
+       error = '<div class="alert alert-block alert-' + t + '"><button type="button" class="close" data-dismiss="alert">&times;</button>' + e + '</div>'
+       jQuery(c).append(error);
+}
+
 jQuery(function () {
        state = {}