mirror of
https://github.com/zadam/trilium.git
synced 2025-11-10 23:35:50 +01:00
reduced dependencies of utils
This commit is contained in:
39
src/public/javascripts/services/info.js
Normal file
39
src/public/javascripts/services/info.js
Normal file
@@ -0,0 +1,39 @@
|
||||
import messagingService from "./messaging.js";
|
||||
|
||||
function showMessage(message) {
|
||||
console.log(now(), "message: ", message);
|
||||
|
||||
$.notify({
|
||||
// options
|
||||
message: message
|
||||
}, {
|
||||
// settings
|
||||
type: 'success',
|
||||
delay: 3000
|
||||
});
|
||||
}
|
||||
|
||||
function showError(message, delay = 10000) {
|
||||
console.log(now(), "error: ", message);
|
||||
|
||||
$.notify({
|
||||
// options
|
||||
message: message
|
||||
}, {
|
||||
// settings
|
||||
type: 'danger',
|
||||
delay: delay
|
||||
});
|
||||
}
|
||||
|
||||
function throwError(message) {
|
||||
messagingService.logError(message);
|
||||
|
||||
throw new Error(message);
|
||||
}
|
||||
|
||||
export default {
|
||||
showMessage,
|
||||
showError,
|
||||
throwError
|
||||
}
|
||||
Reference in New Issue
Block a user