This module processes messages by prompting a modal panel.
With nodejs:
The module dialog
is a typical browser-module.
In the browser:
For browser-usage, ITSA has a predefined loaderfiles. Once included, a global ITSA
object with default features is available. For customized loaderfiles, read: Customized build.
<script src="/itsabuild-min.js"></script>
The messages
-module generates messages by emitting appropriate events. This module subscribes to the following events:
These events are caught and handled by dialog
. When multiple messages occur simultaniously, the get inside a queue, where all messages are handled one by one (FIFO). However, error
-messages have higher priority than warn
-messages, which have higher priority than normal messages. When a messages gets in the queue that has a higher priority than the current message displayed, the the current messages gets back in the queue, to enable the higher-priority message to be displayed.
Messages get finished once the dialog-panel is closed (on of the button is pressed), which will resolve the message-promise. When a message-promise inside the queue gets resolved, it will be removed out of the queue.
ITSA.alert('I am an alert').then(
function() {
// the message is closed here
}
);
var askName = ITSA.prompt('Please enter your name:', {defaultValue: 'someone', label: 'Name'});
askName.then(function(value) {
ITSA.alert('Your name is: '+value);
});