mirror of
https://gitlab.com/commento/commento.git
synced 2025-06-29 22:56:37 -04:00
frontend: check in html, css, js
This commit is contained in:
31
frontend/js/errors.js
Normal file
31
frontend/js/errors.js
Normal file
@ -0,0 +1,31 @@
|
||||
(function (global, document) {
|
||||
|
||||
// Registers a given ID for a fade out after 5 seconds.
|
||||
global.registerHide = function(id) {
|
||||
var el = $(id);
|
||||
|
||||
setTimeout(function() {
|
||||
$(id).fadeOut("fast");
|
||||
}, 5000);
|
||||
}
|
||||
|
||||
|
||||
// Shows a global message on the given label ID and registers it for hiding.
|
||||
global.showGlobalMessage = function(id, text) {
|
||||
global.textSet(id, text);
|
||||
global.registerHide(id);
|
||||
}
|
||||
|
||||
|
||||
// Shows a global error message.
|
||||
global.globalErrorShow = function(text) {
|
||||
global.showGlobalMessage("#global-error", text);
|
||||
}
|
||||
|
||||
|
||||
// Shows a global success message.
|
||||
global.globalOKShow = function(text) {
|
||||
global.showGlobalMessage("#global-ok", text);
|
||||
}
|
||||
|
||||
} (window, document));
|
Reference in New Issue
Block a user