2019-05-01 15:11:50 +02:00
|
|
|
( function( global, $ ) {
|
2018-07-13 18:39:55 +02:00
|
|
|
|
2019-05-01 15:11:50 +02:00
|
|
|
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();
|
|
|
|
}
|
|
|
|
};
|
2018-07-13 18:39:55 +02:00
|
|
|
|
2019-05-01 15:11:50 +02:00
|
|
|
})( this, jQuery );
|