9e3935b3b2
Apologies in advance for the insanely huge commit. This commit is primarily based on Anton Linevych's amazing work found here [1]. While he had gone through the pains of making small, atomic changes to each file, I had put off reviewing the PR for a long time. By the time I finally got around to it, the project had changed so much that it didn't make sense to keep the commits the same way. So I've cherry-picked most of his commits, with some changes here and there, and I've squashed them into one commit. [1] https://gitlab.com/linevych/commento-ce/tree/feature/frontend_building_improvements
33 lines
734 B
JavaScript
33 lines
734 B
JavaScript
(function (global, document) {
|
|
"use strict";
|
|
|
|
(document);
|
|
|
|
// Registers a given ID for a fade out after 5 seconds.
|
|
global.registerHide = function(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.commento, document));
|