Skip to content

Commit

Permalink
Merge branch 'beta'
Browse files Browse the repository at this point in the history
# Conflicts:
#	package-lock.json
  • Loading branch information
zadam committed Sep 7, 2023
2 parents 5218f7b + 0b84524 commit c881b39
Show file tree
Hide file tree
Showing 10 changed files with 102 additions and 64 deletions.
84 changes: 42 additions & 42 deletions libraries/ckeditor/ckeditor-content.css
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@
}

/*
* CKEditor 5 (v39.0.1) content styles.
* Generated on Thu, 10 Aug 2023 09:21:07 GMT.
* CKEditor 5 (v39.0.2) content styles.
* Generated on Wed, 06 Sep 2023 07:32:15 GMT.
* For more information, check out https://ckeditor.com/docs/ckeditor5/latest/installation/advanced/content-styles.html
*/

Expand Down Expand Up @@ -197,6 +197,20 @@
.ck-content .todo-list .todo-list__label .todo-list__label__description {
vertical-align: middle;
}
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
.ck-content .image.image_resized {
max-width: 100%;
display: block;
box-sizing: border-box;
}
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
.ck-content .image.image_resized img {
width: 100%;
}
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
.ck-content .image.image_resized > figcaption {
display: block;
}
/* @ckeditor/ckeditor5-image/theme/image.css */
.ck-content .image {
display: table;
Expand Down Expand Up @@ -234,20 +248,6 @@
flex-shrink: 1;
max-width: 100%;
}
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
.ck-content .image.image_resized {
max-width: 100%;
display: block;
box-sizing: border-box;
}
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
.ck-content .image.image_resized img {
width: 100%;
}
/* @ckeditor/ckeditor5-image/theme/imageresize.css */
.ck-content .image.image_resized > figcaption {
display: block;
}
/* @ckeditor/ckeditor5-image/theme/imagecaption.css */
.ck-content .image > figcaption {
display: table-caption;
Expand All @@ -259,32 +259,6 @@
font-size: .75em;
outline-offset: -1px;
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .marker-yellow {
background-color: var(--ck-highlight-marker-yellow);
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .marker-green {
background-color: var(--ck-highlight-marker-green);
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .marker-pink {
background-color: var(--ck-highlight-marker-pink);
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .marker-blue {
background-color: var(--ck-highlight-marker-blue);
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .pen-red {
color: var(--ck-highlight-pen-red);
background-color: transparent;
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .pen-green {
color: var(--ck-highlight-pen-green);
background-color: transparent;
}
/* @ckeditor/ckeditor5-list/theme/list.css */
.ck-content ol {
list-style-type: decimal;
Expand Down Expand Up @@ -321,6 +295,32 @@
.ck-content ul ul ul ul {
list-style-type: square;
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .marker-yellow {
background-color: var(--ck-highlight-marker-yellow);
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .marker-green {
background-color: var(--ck-highlight-marker-green);
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .marker-pink {
background-color: var(--ck-highlight-marker-pink);
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .marker-blue {
background-color: var(--ck-highlight-marker-blue);
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .pen-red {
color: var(--ck-highlight-pen-red);
background-color: transparent;
}
/* @ckeditor/ckeditor5-highlight/theme/highlight.css */
.ck-content .pen-green {
color: var(--ck-highlight-pen-green);
background-color: transparent;
}
/* @ckeditor/ckeditor5-image/theme/imagestyle.css */
.ck-content .image-style-block-align-left,
.ck-content .image-style-block-align-right {
Expand Down
2 changes: 1 addition & 1 deletion libraries/ckeditor/ckeditor.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion libraries/ckeditor/ckeditor.js.map

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"name": "trilium",
"productName": "Trilium Notes",
"description": "Trilium Notes",
"version": "0.61.5-beta",
"version": "0.61.6-beta",
"license": "AGPL-3.0-only",
"main": "electron.js",
"bin": {
Expand Down Expand Up @@ -53,7 +53,7 @@
"escape-html": "1.0.3",
"express": "4.18.2",
"express-partial-content": "1.0.2",
"express-rate-limit": "6.10.0",
"express-rate-limit": "6.11.0",
"express-session": "1.17.3",
"fs-extra": "11.1.1",
"helmet": "7.0.0",
Expand All @@ -68,7 +68,7 @@
"jimp": "0.22.10",
"joplin-turndown-plugin-gfm": "1.0.12",
"jsdom": "22.1.0",
"marked": "7.0.5",
"marked": "8.0.1",
"mime-types": "2.1.35",
"multer": "1.4.5-lts.1",
"node-abi": "3.47.0",
Expand All @@ -91,7 +91,7 @@
"tmp": "0.2.1",
"turndown": "7.1.2",
"unescape": "1.0.1",
"ws": "8.13.0",
"ws": "8.14.0",
"xml2js": "0.6.2",
"yauzl": "2.10.0"
},
Expand Down
7 changes: 6 additions & 1 deletion src/becca/entities/battachment.js
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,12 @@ class BAttachment extends AbstractBeccaEntity {
}

decrypt() {
if (this.isProtected && !this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) {
if (!this.isProtected || !this.attachmentId) {
this.isDecrypted = true;
return;
}

if (!this.isDecrypted && protectedSessionService.isProtectedSessionAvailable()) {
try {
this.title = protectedSessionService.decryptString(this.title);
this.isDecrypted = true;
Expand Down
8 changes: 8 additions & 0 deletions src/public/app/components/tab_manager.js
Original file line number Diff line number Diff line change
Expand Up @@ -647,4 +647,12 @@ export default class TabManager extends Component {
await this.updateDocumentTitle(activeContext);
}
}

async frocaReloadedEvent() {
const activeContext = this.getActiveContext();

if (activeContext) {
await this.updateDocumentTitle(activeContext);
}
}
}
7 changes: 4 additions & 3 deletions src/public/app/widgets/buttons/note_actions.js
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {

doRender() {
this.$widget = $(TPL);
this.$widget.on('show.bs.dropdown', () => this.refreshVisibility(this.note));

this.$convertNoteIntoAttachmentButton = this.$widget.find("[data-trigger-command='convertNoteIntoAttachment']");
this.$findInTextButton = this.$widget.find('.find-in-text-button');
Expand Down Expand Up @@ -92,7 +93,7 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {
});
}

async refreshWithNote(note) {
async refreshVisibility(note) {
this.$convertNoteIntoAttachmentButton.toggle(note.isEligibleForConversionToAttachment());

this.toggleDisabled(this.$findInTextButton, ['text', 'code', 'book'].includes(note.type));
Expand All @@ -103,11 +104,11 @@ export default class NoteActionsWidget extends NoteContextAwareWidget {

this.$renderNoteButton.toggle(note.type === 'render');

this.toggleDisabled(this.$openNoteExternallyButton, utils.isElectron() && !['search'].includes(note.type));
this.toggleDisabled(this.$openNoteExternallyButton, utils.isElectron() && !['search', 'book'].includes(note.type));
this.toggleDisabled(this.$openNoteCustomButton,
utils.isElectron()
&& !utils.isMac() // no implementation for Mac yet
&& !['search'].includes(note.type)
&& !['search', 'book'].includes(note.type)
);

// I don't want to handle all special notes like this, but intuitively user might want to export content of backend log
Expand Down
2 changes: 1 addition & 1 deletion src/services/build.js
Original file line number Diff line number Diff line change
@@ -1 +1 @@
module.exports = { buildDate:"2023-08-16T23:02:15+02:00", buildRevision: "3f7a5504c77263a7118cede5c0d9b450ba37f424" };
module.exports = { buildDate:"2023-09-06T23:57:29+02:00", buildRevision: "6fa9d996e84f87fcb73c3388a5170affd2c2f7cc" };
11 changes: 11 additions & 0 deletions src/services/notes.js
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ const becca = require('../becca/becca');
const BBranch = require('../becca/entities/bbranch');
const BNote = require('../becca/entities/bnote');
const BAttribute = require('../becca/entities/battribute');
const BAttachment = require("../becca/entities/battachment");
const dayjs = require("dayjs");
const htmlSanitizer = require("./html_sanitizer");
const ValidationError = require("../errors/validation_error");
Expand Down Expand Up @@ -810,6 +811,16 @@ function undeleteBranch(branchId, deleteId, taskContext) {
new BAttribute(attributeRow).save({skipValidation: true});
}

const attachmentRows = sql.getRows(`
SELECT * FROM attachments
WHERE isDeleted = 1
AND deleteId = ?
AND ownerId = ?`, [deleteId, noteRow.noteId]);

for (const attachmentRow of attachmentRows) {
new BAttachment(attachmentRow).save();
}

const childBranchIds = sql.getColumn(`
SELECT branches.branchId
FROM branches
Expand Down
35 changes: 24 additions & 11 deletions src/services/revisions.js
Original file line number Diff line number Diff line change
Expand Up @@ -14,21 +14,34 @@ function protectRevisions(note) {
}

for (const revision of note.getRevisions()) {
if (note.isProtected === revision.isProtected) {
continue;
}
if (note.isProtected !== revision.isProtected) {
try {
const content = revision.getContent();

revision.isProtected = note.isProtected;

try {
const content = revision.getContent();
// this will force de/encryption
revision.setContent(content, {forceSave: true});
} catch (e) {
log.error(`Could not un/protect note revision '${revision.revisionId}'`);

throw e;
}
}

revision.isProtected = note.isProtected;
for (const attachment of revision.getAttachments()) {
if (note.isProtected !== attachment.isProtected) {
try {
const content = attachment.getContent();

// this will force de/encryption
revision.setContent(content, {forceSave: true});
} catch (e) {
log.error(`Could not un/protect note revision '${revision.revisionId}'`);
attachment.isProtected = note.isProtected;
attachment.setContent(content, {forceSave: true});
} catch (e) {
log.error(`Could not un/protect attachment '${attachment.attachmentId}'`);

throw e;
throw e;
}
}
}
}
}
Expand Down

0 comments on commit c881b39

Please sign in to comment.