mirror of
https://github.com/TriliumNext/Notes.git
synced 2026-01-25 22:48:34 -06:00
continuing in API review
This commit is contained in:
@@ -5,7 +5,7 @@ import messagingService from './messaging.js';
|
||||
import protectedSessionService from './protected_session.js';
|
||||
import treeChangesService from './branches.js';
|
||||
import treeUtils from './tree_utils.js';
|
||||
import editTreePrefixDialog from '../dialogs/edit_tree_prefix.js';
|
||||
import branchPrefixDialog from '../dialogs/branch_prefix.js';
|
||||
import infoService from "./info.js";
|
||||
import treeCache from "./tree_cache.js";
|
||||
|
||||
@@ -83,7 +83,7 @@ const contextMenuOptions = {
|
||||
{title: "Insert child note <kbd>Ctrl+P</kbd>", cmd: "insertChildNote", uiIcon: "ui-icon-plus"},
|
||||
{title: "Delete <kbd>Ctrl+Del</kbd>", cmd: "delete", uiIcon: "ui-icon-trash"},
|
||||
{title: "----"},
|
||||
{title: "Edit tree prefix <kbd>F2</kbd>", cmd: "editTreePrefix", uiIcon: "ui-icon-pencil"},
|
||||
{title: "Edit branch prefix <kbd>F2</kbd>", cmd: "editBranchPrefix", uiIcon: "ui-icon-pencil"},
|
||||
{title: "----"},
|
||||
{title: "Protect branch", cmd: "protectBranch", uiIcon: "ui-icon-locked"},
|
||||
{title: "Unprotect branch", cmd: "unprotectBranch", uiIcon: "ui-icon-unlocked"},
|
||||
@@ -134,8 +134,8 @@ const contextMenuOptions = {
|
||||
else if (ui.cmd === "insertChildNote") {
|
||||
treeService.createNote(node, node.data.noteId, 'into');
|
||||
}
|
||||
else if (ui.cmd === "editTreePrefix") {
|
||||
editTreePrefixDialog.showDialog(node);
|
||||
else if (ui.cmd === "editBranchPrefix") {
|
||||
branchPrefixDialog.showDialog(node);
|
||||
}
|
||||
else if (ui.cmd === "protectBranch") {
|
||||
protectedSessionService.protectBranch(node.data.noteId, true);
|
||||
|
||||
@@ -11,7 +11,7 @@ $("#file-upload").change(async function() {
|
||||
formData.append('upload', this.files[0]);
|
||||
|
||||
const resp = await $.ajax({
|
||||
url: baseApiUrl + 'files/upload/' + noteDetailService.getCurrentNoteId(),
|
||||
url: baseApiUrl + 'notes/' + noteDetailService.getCurrentNoteId() + '/upload',
|
||||
headers: server.getHeaders(),
|
||||
data: formData,
|
||||
type: 'POST',
|
||||
|
||||
@@ -39,8 +39,8 @@ $fileOpen.click(() => {
|
||||
|
||||
function getFileUrl() {
|
||||
// electron needs absolute URL so we extract current host, port, protocol
|
||||
return utils.getHost() + "/api/files/download/" + noteDetailService.getCurrentNoteId()
|
||||
+ "?protectedSessionId=" + encodeURIComponent(protectedSessionHolder.getProtectedSessionId());
|
||||
return utils.getHost() + "/api/notes/" + noteDetailService.getCurrentNoteId()
|
||||
+ "/download?protectedSessionId=" + encodeURIComponent(protectedSessionHolder.getProtectedSessionId());
|
||||
}
|
||||
|
||||
export default {
|
||||
|
||||
@@ -3,7 +3,7 @@ import utils from "./utils.js";
|
||||
import treeChangesService from "./branches.js";
|
||||
import contextMenuService from "./context_menu.js";
|
||||
import treeService from "./tree.js";
|
||||
import editTreePrefixDialog from "../dialogs/edit_tree_prefix.js";
|
||||
import editBranchPrefixDialog from "../dialogs/branch_prefix.js";
|
||||
|
||||
const keyBindings = {
|
||||
"del": node => {
|
||||
@@ -67,7 +67,7 @@ const keyBindings = {
|
||||
return false;
|
||||
},
|
||||
"f2": node => {
|
||||
editTreePrefixDialog.showDialog(node);
|
||||
editBranchPrefixDialog.showDialog(node);
|
||||
},
|
||||
"alt+-": node => {
|
||||
treeService.collapseTree(node);
|
||||
|
||||
Reference in New Issue
Block a user