mirror of
https://github.com/xevidos/codiad.git
synced 2024-12-22 22:02:15 +01:00
47 lines
931 B
JavaScript
Executable file
47 lines
931 B
JavaScript
Executable file
( function( global, $ ) {
|
|
|
|
var codiad = global.codiad;
|
|
|
|
//////////////////////////////////////////////////////////////////////
|
|
// User Alerts / Messages
|
|
//////////////////////////////////////////////////////////////////////
|
|
|
|
codiad.message = {
|
|
|
|
init: function() {},
|
|
|
|
_showMessage: function(toastType, message, options) {
|
|
|
|
options = options || {};
|
|
options.text = message;
|
|
options.type = toastType
|
|
$().toastmessage('showToast', options);
|
|
},
|
|
|
|
success: function( m, options ) {
|
|
|
|
this._showMessage('success', m, options);
|
|
},
|
|
|
|
error: function( m, options ) {
|
|
|
|
this._showMessage('error', m, options);
|
|
},
|
|
|
|
warning: function( m, options ) {
|
|
|
|
this._showMessage('warning', m, options);
|
|
},
|
|
|
|
notice: function( m, options ) {
|
|
|
|
this._showMessage('notice', m, options);
|
|
},
|
|
|
|
hide: function() {
|
|
|
|
$(".toast-item-wrapper").remove();
|
|
}
|
|
};
|
|
|
|
})( this, jQuery );
|