mirror of
https://github.com/zadam/trilium.git
synced 2025-11-03 11:56:01 +01:00
Compare commits
13 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
6d2394a9da | ||
|
|
196264b8c2 | ||
|
|
afe24866f0 | ||
|
|
d18a20cc06 | ||
|
|
9c91b0459e | ||
|
|
af21dd4463 | ||
|
|
1ea0d283de | ||
|
|
6e3d8472e1 | ||
|
|
2a9f36a027 | ||
|
|
cf3726289c | ||
|
|
c8e4a5c9e7 | ||
|
|
a3951f1cce | ||
|
|
7c77ae758b |
@@ -74,7 +74,7 @@ async function createMainWindow() {
|
||||
const parsedUrl = url.parse(targetUrl);
|
||||
|
||||
// we still need to allow internal redirects from setup and migration pages
|
||||
if (parsedUrl.hostname !== 'localhost' || parsedUrl.hostname !== '127.0.0.1' || (parsedUrl.path && parsedUrl.path !== '/')) {
|
||||
if (!['localhost', '127.0.0.1'].includes(parsedUrl.hostname) || (parsedUrl.path && parsedUrl.path !== '/')) {
|
||||
ev.preventDefault();
|
||||
}
|
||||
});
|
||||
|
||||
8
package-lock.json
generated
8
package-lock.json
generated
@@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "trilium",
|
||||
"version": "0.33.2-beta",
|
||||
"version": "0.33.5",
|
||||
"lockfileVersion": 1,
|
||||
"requires": true,
|
||||
"dependencies": {
|
||||
@@ -2820,9 +2820,9 @@
|
||||
"integrity": "sha512-PcW2a0tyTuPHz3tWyYqtK6r1fZ3gp+3Sop8Ph+ZYN81Ob5rwmbHEzaqs10N3BEsaGTkh/ooniXK+WwszGlc2+Q=="
|
||||
},
|
||||
"electron": {
|
||||
"version": "6.0.0-beta.10",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-6.0.0-beta.10.tgz",
|
||||
"integrity": "sha512-eKDUv5ZZGjFE2ccBQzBpY6j3oT1NvnHGLcSoGXp6vCWkx+ZYjPyujwG3gW61FK7iL5FMKyg9IlhCOsIy4HEruw==",
|
||||
"version": "6.0.0-beta.11",
|
||||
"resolved": "https://registry.npmjs.org/electron/-/electron-6.0.0-beta.11.tgz",
|
||||
"integrity": "sha512-B6zh9c5pJ0BKKNkOEbF6vKXnBCWgtvY8LaUYDNeR9ttnPP0CCm0oovIoqP9/nN5gL8rlCoCgKWsjmiHu0jg7mA==",
|
||||
"dev": true,
|
||||
"requires": {
|
||||
"@types/node": "^10.12.18",
|
||||
|
||||
@@ -2,7 +2,7 @@
|
||||
"name": "trilium",
|
||||
"productName": "Trilium Notes",
|
||||
"description": "Trilium Notes",
|
||||
"version": "0.33.3",
|
||||
"version": "0.33.6",
|
||||
"license": "AGPL-3.0-only",
|
||||
"main": "electron.js",
|
||||
"bin": {
|
||||
@@ -75,7 +75,7 @@
|
||||
},
|
||||
"devDependencies": {
|
||||
"devtron": "1.4.0",
|
||||
"electron": "6.0.0-beta.10",
|
||||
"electron": "6.0.0-beta.11",
|
||||
"electron-builder": "20.44.2",
|
||||
"electron-compile": "6.4.4",
|
||||
"electron-installer-debian": "2.0.0",
|
||||
|
||||
@@ -7,8 +7,11 @@ const $custom = $("#confirm-dialog-custom");
|
||||
const DELETE_NOTE_BUTTON_ID = "confirm-dialog-delete-note";
|
||||
|
||||
let resolve;
|
||||
let $originallyFocused; // element focused before the dialog was opened so we can return to it afterwards
|
||||
|
||||
function confirm(message) {
|
||||
$originallyFocused = $(':focus');
|
||||
|
||||
$custom.hide();
|
||||
|
||||
glob.activeDialog = $dialog;
|
||||
@@ -55,6 +58,11 @@ $dialog.on("hidden.bs.modal", () => {
|
||||
if (resolve) {
|
||||
resolve(false);
|
||||
}
|
||||
|
||||
if ($originallyFocused) {
|
||||
$originallyFocused.focus();
|
||||
$originallyFocused = null;
|
||||
}
|
||||
});
|
||||
|
||||
function doResolve(ret) {
|
||||
|
||||
@@ -5,8 +5,11 @@ const $infoContent = $("#info-dialog-content");
|
||||
const $okButton = $("#info-dialog-ok-button");
|
||||
|
||||
let resolve;
|
||||
let $originallyFocused; // element focused before the dialog was opened so we can return to it afterwards
|
||||
|
||||
function info(message) {
|
||||
$originallyFocused = $(':focus');
|
||||
|
||||
utils.closeActiveDialog();
|
||||
|
||||
glob.activeDialog = $dialog;
|
||||
@@ -24,6 +27,11 @@ $dialog.on("hidden.bs.modal", () => {
|
||||
if (resolve) {
|
||||
resolve();
|
||||
}
|
||||
|
||||
if ($originallyFocused) {
|
||||
$originallyFocused.focus();
|
||||
$originallyFocused = null;
|
||||
}
|
||||
});
|
||||
|
||||
$okButton.click(() => $dialog.modal("hide"));
|
||||
|
||||
@@ -6,6 +6,7 @@ import treeCache from "./tree_cache.js";
|
||||
import treeUtils from "./tree_utils.js";
|
||||
import hoistedNoteService from "./hoisted_note.js";
|
||||
import noteDetailService from "./note_detail.js";
|
||||
import confirmDialog from "../dialogs/confirm.js";
|
||||
|
||||
async function moveBeforeNode(nodesToMove, beforeNode) {
|
||||
nodesToMove = await filterRootNote(nodesToMove);
|
||||
@@ -82,7 +83,7 @@ async function moveToNode(nodesToMove, toNode) {
|
||||
async function deleteNodes(nodes) {
|
||||
nodes = await filterRootNote(nodes);
|
||||
|
||||
if (nodes.length === 0 || !confirm('Are you sure you want to delete select note(s) and all the sub-notes?')) {
|
||||
if (nodes.length === 0 || !await confirmDialog.confirm('Are you sure you want to delete select note(s) and all the sub-notes?')) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -102,7 +103,7 @@ async function deleteNodes(nodes) {
|
||||
next = nodes[0].getPrevSibling();
|
||||
}
|
||||
|
||||
if (!next && !hoistedNoteService.isTopLevelNode(nodes[0])) {
|
||||
if (!next && !await hoistedNoteService.isTopLevelNode(nodes[0])) {
|
||||
next = nodes[0].getParent();
|
||||
}
|
||||
|
||||
|
||||
@@ -88,10 +88,13 @@ setTimeout(() => {
|
||||
console.log("Lost connection to server");
|
||||
}
|
||||
|
||||
try {
|
||||
ws.send(JSON.stringify({
|
||||
type: 'ping',
|
||||
lastSyncId: lastSyncId
|
||||
}));
|
||||
}
|
||||
catch (e) {} // if the connection is closed then this produces a lot of messages
|
||||
}, 1000);
|
||||
}, 0);
|
||||
|
||||
|
||||
@@ -405,7 +405,7 @@ tabRow.addListener('tabRemove', async ({ detail }) => {
|
||||
|
||||
if (tabContextToDelete) {
|
||||
// sometimes there are orphan autocompletes after closing the tab
|
||||
tabContextToDelete.$tabContent.find('.aa-input').autocomplete('close');
|
||||
tabContextToDelete.closeAutocomplete();
|
||||
|
||||
await tabContextToDelete.saveNoteIfChanged();
|
||||
tabContextToDelete.$tabContent.remove();
|
||||
|
||||
@@ -1,5 +1,4 @@
|
||||
import utils from "./utils.js";
|
||||
import noteDetailService from "./note_detail.js";
|
||||
import infoService from "./info.js";
|
||||
import server from "./server.js";
|
||||
|
||||
|
||||
@@ -8,6 +8,7 @@ class NoteDetailText {
|
||||
constructor(ctx) {
|
||||
this.ctx = ctx;
|
||||
this.$component = ctx.$tabContent.find('.note-detail-text');
|
||||
this.$editorEl = this.$component.find('.note-detail-text-editor');
|
||||
this.textEditor = null;
|
||||
|
||||
this.$component.on("dblclick", "img", e => {
|
||||
@@ -39,7 +40,7 @@ class NoteDetailText {
|
||||
// textEditor might have been initialized during previous await so checking again
|
||||
// looks like double initialization can freeze CKEditor pretty badly
|
||||
if (!this.textEditor) {
|
||||
this.textEditor = await BalloonEditor.create(this.$component[0], {
|
||||
this.textEditor = await BalloonEditor.create(this.$editorEl[0], {
|
||||
placeholder: "Type the content of your note here ..."
|
||||
});
|
||||
|
||||
@@ -73,7 +74,7 @@ class NoteDetailText {
|
||||
}
|
||||
|
||||
focus() {
|
||||
this.$component.focus();
|
||||
this.$editorEl.focus();
|
||||
}
|
||||
|
||||
getEditor() {
|
||||
|
||||
@@ -109,6 +109,8 @@ class TabContext {
|
||||
|
||||
this.setTitleBar();
|
||||
|
||||
this.closeAutocomplete(); // esp. on windows autocomplete is not getting closed automatically
|
||||
|
||||
setTimeout(async () => {
|
||||
// we include the note into recent list only if the user stayed on the note at least 5 seconds
|
||||
if (notePath && notePath === this.notePath) {
|
||||
@@ -334,6 +336,12 @@ class TabContext {
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
closeAutocomplete() {
|
||||
if (utils.isDesktop()) {
|
||||
this.$tabContent.find('.aa-input').autocomplete('close');
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
export default TabContext;
|
||||
@@ -630,10 +630,13 @@ async function createNote(node, parentNoteId, target, extraOptions = {}) {
|
||||
extraClasses: await treeBuilder.getExtraClasses(noteEntity),
|
||||
icon: await treeBuilder.getIcon(noteEntity),
|
||||
folder: extraOptions.type === 'search',
|
||||
lazy: true
|
||||
lazy: true,
|
||||
key: utils.randomString(12) // this should prevent some "duplicate key" errors
|
||||
};
|
||||
|
||||
if (target === 'after') {
|
||||
console.log(`Appending node...`); // to debug duplicated nodes
|
||||
|
||||
await node.appendSibling(newNode).setActive(true);
|
||||
}
|
||||
else if (target === 'into') {
|
||||
@@ -641,6 +644,8 @@ async function createNote(node, parentNoteId, target, extraOptions = {}) {
|
||||
await node.setExpanded();
|
||||
}
|
||||
|
||||
console.log(`Adding node as child...`); // to debug duplicated nodes
|
||||
|
||||
node.addChildren(newNode);
|
||||
|
||||
await node.getLastChild().setActive(true);
|
||||
|
||||
@@ -83,7 +83,8 @@ async function prepareNode(branch) {
|
||||
icon: await getIcon(note),
|
||||
refKey: note.noteId,
|
||||
expanded: branch.isExpanded || hoistedNoteId === note.noteId,
|
||||
lazy: true
|
||||
lazy: true,
|
||||
key: utils.randomString(12) // this should prevent some "duplicate key" errors
|
||||
};
|
||||
|
||||
if (note.hasChildren() || note.type === 'search') {
|
||||
|
||||
@@ -135,13 +135,16 @@ ul.fancytree-container {
|
||||
.note-detail-text h6 { font-size: 1.1em; }
|
||||
|
||||
.note-detail-text {
|
||||
overflow: auto;
|
||||
font-family: var(--detail-text-font-family);
|
||||
}
|
||||
|
||||
.note-detail-text-editor {
|
||||
padding-top: 10px;
|
||||
border: 0 !important;
|
||||
box-shadow: none !important;
|
||||
/* This is because with empty content height of editor is 0 and it's impossible to click into it */
|
||||
min-height: 200px;
|
||||
padding-top: 10px;
|
||||
overflow: auto;
|
||||
font-family: var(--detail-text-font-family);
|
||||
}
|
||||
|
||||
.note-detail-text p:first-child, .note-detail-text::before {
|
||||
|
||||
@@ -1 +1 @@
|
||||
module.exports = { buildDate:"2019-06-24T20:47:50+02:00", buildRevision: "1b831f94a98dbbb7184048f329ea89175841dec2" };
|
||||
module.exports = { buildDate:"2019-07-02T22:26:05+02:00", buildRevision: "196264b8c2fc626e3114d65423c7110cff99ae85" };
|
||||
|
||||
@@ -49,7 +49,9 @@
|
||||
</div>
|
||||
|
||||
<div class="note-detail-component-wrapper">
|
||||
<div class="note-detail-text note-detail-component" tabindex="10000"></div>
|
||||
<div class="note-detail-text note-detail-component" tabindex="10000">
|
||||
<div class="note-detail-text-editor"></div>
|
||||
</div>
|
||||
|
||||
<div class="note-detail-code note-detail-component"></div>
|
||||
|
||||
|
||||
@@ -11,7 +11,9 @@
|
||||
<table class="note-detail-promoted-attributes"></table>
|
||||
|
||||
<div class="note-detail-component-wrapper">
|
||||
<div class="note-detail-text note-detail-component" tabindex="10000"></div>
|
||||
<div class="note-detail-text note-detail-component">
|
||||
<div class="note-detail-text-editor" tabindex="10000"></div>
|
||||
</div>
|
||||
|
||||
<div class="note-detail-code note-detail-component"></div>
|
||||
|
||||
|
||||
Reference in New Issue
Block a user