mirror of
https://github.com/zadam/trilium.git
synced 2024-11-18 13:41:59 +08:00
40 lines
No EOL
717 B
JavaScript
40 lines
No EOL
717 B
JavaScript
import messagingService from "./messaging.js";
|
|
import utils from "./utils.js";
|
|
|
|
function showMessage(message) {
|
|
console.log(utils.now(), "message: ", message);
|
|
|
|
$.notify({
|
|
// options
|
|
message: message
|
|
}, {
|
|
// options
|
|
type: 'success',
|
|
delay: 3000
|
|
});
|
|
}
|
|
|
|
function showError(message, delay = 10000) {
|
|
console.log(utils.now(), "error: ", message);
|
|
|
|
$.notify({
|
|
// options
|
|
message: message
|
|
}, {
|
|
// options
|
|
type: 'danger',
|
|
delay: delay
|
|
});
|
|
}
|
|
|
|
function throwError(message) {
|
|
messagingService.logError(message);
|
|
|
|
throw new Error(message);
|
|
}
|
|
|
|
export default {
|
|
showMessage,
|
|
showError,
|
|
throwError
|
|
} |