Cleanup socketio stuff for typescript
This commit is contained in:
parent
3ad4422a94
commit
5e4ca8ef83
22 changed files with 246 additions and 210 deletions
|
@ -1,62 +0,0 @@
|
|||
export const flash = {
|
||||
methods: {
|
||||
/**
|
||||
* Flash a message to the event stream in the browser.
|
||||
*
|
||||
* @param {string} message
|
||||
* @param {string} title
|
||||
* @param {string} severity
|
||||
*/
|
||||
flash: function (message, title, severity = 'info') {
|
||||
severity = severity || 'info';
|
||||
if (['danger', 'fatal', 'error'].includes(severity)) {
|
||||
severity = 'error';
|
||||
}
|
||||
|
||||
window.events.$emit('flash', { message, title, severity });
|
||||
},
|
||||
|
||||
/**
|
||||
* Clear all of the flash messages from the screen.
|
||||
*/
|
||||
clearFlashes: function () {
|
||||
window.events.$emit('clear-flashes');
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper function to flash a normal success message to the user.
|
||||
*
|
||||
* @param {string} message
|
||||
*/
|
||||
success: function (message) {
|
||||
this.flash(message, 'Success', 'success');
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper function to flash a normal info message to the user.
|
||||
*
|
||||
* @param {string} message
|
||||
*/
|
||||
info: function (message) {
|
||||
this.flash(message, 'Info', 'info');
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper function to flash a normal warning message to the user.
|
||||
*
|
||||
* @param {string} message
|
||||
*/
|
||||
warning: function (message) {
|
||||
this.flash(message, 'Warning', 'warning');
|
||||
},
|
||||
|
||||
/**
|
||||
* Helper function to flash a normal error message to the user.
|
||||
*
|
||||
* @param {string} message
|
||||
*/
|
||||
error: function (message) {
|
||||
this.flash(message, 'Error', 'danger');
|
||||
},
|
||||
}
|
||||
};
|
Loading…
Add table
Add a link
Reference in a new issue