It's possible to switch different message implementations and use the same interface.
$('#method').change(function () {
switch($('#method').val()) {
case 'jquery-toastmessage':
flash.setting.method = toastmessage;
break;
case 'default':
default:
flash.setting.method = flash.defaultMethod;
break;
}
});
var typeMap = {
danger: 'error',
info: 'notice',
alert: 'warning'
};
var toastmessage = function (message, options) {
flash.formatOptions(options);
options.text = message;
options.stayTime = options.time;
options.type = typeMap[options.type] || options.type;
$().toastmessage('showToast', options);
};