core/api/admin_skin/js/messenger.js

40 lines
1.0 KiB
JavaScript
Raw Normal View History

2022-12-11 13:55:49 +05:00
function showErrorMessage(msg) {
Messenger({
extraClasses: 'messenger-fixed messenger-on-right messenger-on-top',
theme: 'flat'
}).post({
message: msg,
type: 'error',
showCloseButton: true
});
}
function progressMessage() {
var i = 0;
Messenger({
extraClasses: 'messenger-fixed messenger-on-right messenger-on-top',
theme: 'flat'
}).run({
errorMessage: 'Error destroying alien planet. Retrying...',
successMessage: 'Alien planet destroyed!',
action: function(opts) {
if (++i < 2) {
return opts.error({
status: 500,
readyState: 0,
responseText: 0
});
} else {
return opts.success();
}
}
});
}
function showSuccess(msg) {
Messenger({
extraClasses: 'messenger-fixed messenger-on-right messenger-on-top',
theme: 'flat'
}).post(msg);
}