mirror of
https://github.com/zadam/trilium.git
synced 2025-11-17 10:40:41 +01:00
rename info service to toast service
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import noteDetailService from '../services/note_detail.js';
|
||||
import server from '../services/server.js';
|
||||
import infoService from "../services/info.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
import attributeAutocompleteService from "../services/attribute_autocomplete.js";
|
||||
import utils from "../services/utils.js";
|
||||
@@ -168,7 +168,7 @@ function AttributesModel() {
|
||||
|
||||
await showAttributes(attributes);
|
||||
|
||||
infoService.showMessage("Attributes have been saved.");
|
||||
toastService.showMessage("Attributes have been saved.");
|
||||
|
||||
const ctx = noteDetailService.getActiveTabContext();
|
||||
|
||||
|
||||
@@ -2,7 +2,7 @@ import treeService from '../services/tree.js';
|
||||
import server from '../services/server.js';
|
||||
import treeCache from "../services/tree_cache.js";
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
import infoService from "../services/info.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import utils from "../services/utils.js";
|
||||
|
||||
const $dialog = $("#branch-prefix-dialog");
|
||||
@@ -38,7 +38,7 @@ async function savePrefix() {
|
||||
|
||||
$dialog.modal('hide');
|
||||
|
||||
infoService.showMessage("Branch prefix has been saved.");
|
||||
toastService.showMessage("Branch prefix has been saved.");
|
||||
}
|
||||
|
||||
$form.submit(() => {
|
||||
|
||||
@@ -1,7 +1,7 @@
|
||||
import treeUtils from "../services/tree_utils.js";
|
||||
import utils from "../services/utils.js";
|
||||
import ws from "../services/ws.js";
|
||||
import infoService from "../services/info.js";
|
||||
import toastService from "../services/toast.js";
|
||||
|
||||
const $dialog = $("#export-dialog");
|
||||
const $form = $("#export-form");
|
||||
@@ -122,16 +122,16 @@ ws.subscribeToMessages(async message => {
|
||||
}
|
||||
|
||||
if (message.type === 'task-error') {
|
||||
infoService.closePersistent(message.taskId);
|
||||
infoService.showError(message.message);
|
||||
toastService.closePersistent(message.taskId);
|
||||
toastService.showError(message.message);
|
||||
}
|
||||
else if (message.type === 'task-progress-count') {
|
||||
infoService.showPersistent(makeToast(message.taskId, "Export in progress: " + message.progressCount));
|
||||
toastService.showPersistent(makeToast(message.taskId, "Export in progress: " + message.progressCount));
|
||||
}
|
||||
else if (message.type === 'task-succeeded') {
|
||||
const toast = makeToast(message.taskId, "Import finished successfully.");
|
||||
toast.closeAfter = 5000;
|
||||
|
||||
infoService.showPersistent(toast);
|
||||
toastService.showPersistent(toast);
|
||||
}
|
||||
});
|
||||
@@ -1,5 +1,5 @@
|
||||
import libraryLoader from "../services/library_loader.js";
|
||||
import infoService from "../services/info.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import utils from "../services/utils.js";
|
||||
import noteDetailService from "../services/note_detail.js";
|
||||
|
||||
@@ -22,7 +22,7 @@ async function convertMarkdownToHtml(text) {
|
||||
|
||||
textEditor.model.insertContent(modelFragment, textEditor.model.document.selection);
|
||||
|
||||
infoService.showMessage("Markdown content has been imported into the document.");
|
||||
toastService.showMessage("Markdown content has been imported into the document.");
|
||||
}
|
||||
|
||||
export async function importMarkdownInline() {
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import server from "../../services/server.js";
|
||||
import infoService from "../../services/info.js";
|
||||
import toastService from "../../services/toast.js";
|
||||
|
||||
export default class AdvancedOptions {
|
||||
constructor() {
|
||||
@@ -13,26 +13,26 @@ export default class AdvancedOptions {
|
||||
this.$forceFullSyncButton.click(async () => {
|
||||
await server.post('sync/force-full-sync');
|
||||
|
||||
infoService.showMessage("Full sync triggered");
|
||||
toastService.showMessage("Full sync triggered");
|
||||
});
|
||||
|
||||
this.$fillSyncRowsButton.click(async () => {
|
||||
await server.post('sync/fill-sync-rows');
|
||||
|
||||
infoService.showMessage("Sync rows filled successfully");
|
||||
toastService.showMessage("Sync rows filled successfully");
|
||||
});
|
||||
|
||||
this.$anonymizeButton.click(async () => {
|
||||
await server.post('anonymization/anonymize');
|
||||
|
||||
infoService.showMessage("Created anonymized database");
|
||||
toastService.showMessage("Created anonymized database");
|
||||
});
|
||||
|
||||
this.$cleanupSoftDeletedButton.click(async () => {
|
||||
if (confirm("Do you really want to clean up soft-deleted items?")) {
|
||||
await server.post('cleanup/cleanup-soft-deleted-items');
|
||||
|
||||
infoService.showMessage("Soft deleted items have been cleaned up");
|
||||
toastService.showMessage("Soft deleted items have been cleaned up");
|
||||
}
|
||||
});
|
||||
|
||||
@@ -40,14 +40,14 @@ export default class AdvancedOptions {
|
||||
if (confirm("Do you really want to clean up unused images?")) {
|
||||
await server.post('cleanup/cleanup-unused-images');
|
||||
|
||||
infoService.showMessage("Unused images have been cleaned up");
|
||||
toastService.showMessage("Unused images have been cleaned up");
|
||||
}
|
||||
});
|
||||
|
||||
this.$vacuumDatabaseButton.click(async () => {
|
||||
await server.post('cleanup/vacuum-database');
|
||||
|
||||
infoService.showMessage("Database has been vacuumed");
|
||||
toastService.showMessage("Database has been vacuumed");
|
||||
});
|
||||
}
|
||||
}
|
||||
@@ -1,6 +1,6 @@
|
||||
import server from "../../services/server.js";
|
||||
import protectedSessionHolder from "../../services/protected_session_holder.js";
|
||||
import infoService from "../../services/info.js";
|
||||
import toastService from "../../services/toast.js";
|
||||
|
||||
export default class ChangePasswordOptions {
|
||||
constructor() {
|
||||
@@ -39,7 +39,7 @@ export default class ChangePasswordOptions {
|
||||
protectedSessionHolder.resetProtectedSession();
|
||||
}
|
||||
else {
|
||||
infoService.showError(result.message);
|
||||
toastService.showError(result.message);
|
||||
}
|
||||
});
|
||||
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import optionsService from "../../services/options.js";
|
||||
import server from "../../services/server.js";
|
||||
import infoService from "../../services/info.js";
|
||||
import toastService from "../../services/toast.js";
|
||||
|
||||
export default class ProtectedSessionOptions {
|
||||
constructor() {
|
||||
@@ -12,14 +12,14 @@ export default class ProtectedSessionOptions {
|
||||
|
||||
this.$spellCheckEnabled.change(() => {
|
||||
const opts = { 'spellCheckEnabled': this.$spellCheckEnabled.is(":checked") ? "true" : "false" };
|
||||
server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));
|
||||
server.put('options', opts).then(() => toastService.showMessage("Options change have been saved."));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
this.$spellCheckLanguageCode.change(() => {
|
||||
const opts = { 'spellCheckLanguageCode': this.$spellCheckLanguageCode.val() };
|
||||
server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));
|
||||
server.put('options', opts).then(() => toastService.showMessage("Options change have been saved."));
|
||||
|
||||
return false;
|
||||
});
|
||||
@@ -30,7 +30,7 @@ export default class ProtectedSessionOptions {
|
||||
server.put('options', { 'protectedSessionTimeout': protectedSessionTimeout }).then(() => {
|
||||
optionsService.reloadOptions();
|
||||
|
||||
infoService.showMessage("Options change have been saved.");
|
||||
toastService.showMessage("Options change have been saved.");
|
||||
});
|
||||
|
||||
return false;
|
||||
@@ -38,7 +38,7 @@ export default class ProtectedSessionOptions {
|
||||
|
||||
this.$noteRevisionsTimeInterval.change(() => {
|
||||
const opts = { 'noteRevisionSnapshotTimeInterval': this.$noteRevisionsTimeInterval.val() };
|
||||
server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));
|
||||
server.put('options', opts).then(() => toastService.showMessage("Options change have been saved."));
|
||||
|
||||
return false;
|
||||
});
|
||||
|
||||
@@ -1,5 +1,5 @@
|
||||
import server from "../../services/server.js";
|
||||
import infoService from "../../services/info.js";
|
||||
import toastService from "../../services/toast.js";
|
||||
|
||||
export default class SyncOptions {
|
||||
constructor() {
|
||||
@@ -15,10 +15,10 @@ export default class SyncOptions {
|
||||
const result = await server.post('sync/test');
|
||||
|
||||
if (result.success) {
|
||||
infoService.showMessage(result.message);
|
||||
toastService.showMessage(result.message);
|
||||
}
|
||||
else {
|
||||
infoService.showError("Sync server handshake failed, error: " + result.message);
|
||||
toastService.showError("Sync server handshake failed, error: " + result.message);
|
||||
}
|
||||
});
|
||||
}
|
||||
@@ -36,7 +36,7 @@ export default class SyncOptions {
|
||||
'syncProxy': this.$syncProxy.val()
|
||||
};
|
||||
|
||||
server.put('options', opts).then(() => infoService.showMessage("Options change have been saved."));
|
||||
server.put('options', opts).then(() => toastService.showMessage("Options change have been saved."));
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -1,6 +1,6 @@
|
||||
import libraryLoader from '../services/library_loader.js';
|
||||
import server from '../services/server.js';
|
||||
import infoService from "../services/info.js";
|
||||
import toastService from "../services/toast.js";
|
||||
import utils from "../services/utils.js";
|
||||
|
||||
const $dialog = $("#sql-console-dialog");
|
||||
@@ -63,11 +63,11 @@ async function execute() {
|
||||
});
|
||||
|
||||
if (!result.success) {
|
||||
infoService.showError(result.error);
|
||||
toastService.showError(result.error);
|
||||
return;
|
||||
}
|
||||
else {
|
||||
infoService.showMessage("Query was executed successfully.");
|
||||
toastService.showMessage("Query was executed successfully.");
|
||||
}
|
||||
|
||||
const rows = result.rows;
|
||||
|
||||
Reference in New Issue
Block a user