Compare commits

...

10 Commits

11 changed files with 26 additions and 14 deletions

2
package-lock.json generated
View File

@@ -1,6 +1,6 @@
{
"name": "trilium",
"version": "0.30.2-beta",
"version": "0.30.3-beta",
"lockfileVersion": 1,
"requires": true,
"dependencies": {

View File

@@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.30.3-beta",
"version": "0.30.4",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {

View File

@@ -106,7 +106,7 @@ class Note extends Entity {
/** @returns {Promise} */
async setJsonContent(content) {
await this.setContent(JSON.stringify(content));
await this.setContent(JSON.stringify(content, null, '\t'));
}
/** @returns {boolean} true if this note is the root of the note tree. Root note has "root" noteId */

View File

@@ -1 +1 @@
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#fafafa" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shield"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg>
<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24" fill="none" stroke="#000000" stroke-opacity="0.03" stroke-width="2" stroke-linecap="round" stroke-linejoin="round" class="feather feather-shield"><path d="M12 22s8-4 8-10V5l-8-3-8 3v7c0 6 8 10 8 10z"></path></svg>

Before

Width:  |  Height:  |  Size: 274 B

After

Width:  |  Height:  |  Size: 296 B

View File

@@ -137,6 +137,10 @@ function linkTypeChanged() {
$linkTypes.change(linkTypeChanged);
// return back focus to note text detail after quitting add link
// the problem is that cursor position is reset
$dialog.on("hidden.bs.modal", () => noteDetailText.focus());
export default {
showDialog
};

View File

@@ -9,6 +9,8 @@ async function getAndExecuteBundle(noteId, originEntity = null) {
}
async function executeBundle(bundle, originEntity) {
console.log(bundle);
const apiContext = await ScriptContext(bundle.noteId, bundle.allNoteIds, originEntity);
try {
@@ -17,7 +19,7 @@ async function executeBundle(bundle, originEntity) {
}.call(apiContext));
}
catch (e) {
infoService.showAndLogError(`Execution of script "${bundle.note.title}" (${bundle.note.noteId}) failed with error: ${e.message}`);
infoService.showAndLogError(`Execution of ${bundle.noteId} failed with error: ${e.message}`);
}
}

View File

@@ -17,9 +17,13 @@ async function getRecentChanges() {
dateModifiedTo DESC
LIMIT 1000`);
if (!protectedSessionService.isProtectedSessionAvailable()) {
for (const change of recentChanges) {
if (change.current_isProtected) {
for (const change of recentChanges) {
if (change.current_isProtected) {
if (protectedSessionService.isProtectedSessionAvailable()) {
change.title = protectedSessionService.decryptNoteTitle(change.noteId, change.title);
change.current_title = protectedSessionService.decryptNoteTitle(change.noteId, change.current_title);
}
else {
change.title = change.current_title = "[Protected]";
}
}

View File

@@ -1 +1 @@
module.exports = { buildDate:"2019-03-03T20:47:50+01:00", buildRevision: "95d8f07458853dbad08964e7ec1af1d50792b0a2" };
module.exports = { buildDate:"2019-03-07T22:40:05+01:00", buildRevision: "02eddc347abebce63a8882f6f83ac73655005849" };

View File

@@ -116,7 +116,7 @@ async function getDateNote(dateStr) {
dateNote = await createNote(monthNote.noteId, noteTitle);
}
await attributeService.createLabel(dateNote.noteId, DATE_LABEL, dateStr);
await attributeService.createLabel(dateNote.noteId, DATE_LABEL, dateStr.substr(0, 10));
}
return dateNote;

View File

@@ -15,7 +15,7 @@ function setDataKey(decryptedDataKey) {
}
function setProtectedSessionId(req) {
cls.namespace.set('protectedSessionId', req.headers['trilium-protected-session-id']);
cls.namespace.set('protectedSessionId', req.headers['trilium-protected-session-id'] || req.query.protectedSessionId);
}
function getProtectedSessionId() {
@@ -62,7 +62,9 @@ function decryptNoteContent(noteContent) {
}
try {
noteContent.content = dataEncryptionService.decrypt(getDataKey(), noteContent.content);
if (noteContent.content != null) {
noteContent.content = dataEncryptionService.decrypt(getDataKey(), noteContent.content.toString());
}
}
catch (e) {
e.message = `Cannot decrypt note content for noteContentId=${noteContent.noteContentId}: ` + e.message;

View File

@@ -65,10 +65,10 @@ async function executeScript(script, params, startNoteId, currentNoteId, originE
const bundle = await getScriptBundle(currentNote);
return await executeBundle(bundle, startNote, originEntity);
return await executeBundle(bundle, { startNote, originEntity });
}
async function execute(ctx, script, params = []) {
async function execute(ctx, script) {
// scripts run as "server" sourceId so clients recognize the changes as "foreign" and update themselves
cls.namespace.set('sourceId', sourceIdService.getCurrentSourceId());