mirror of
https://github.com/zadam/trilium.git
synced 2025-03-01 14:22:32 +01:00
Merge branch 'beta'
This commit is contained in:
commit
da8025f1e4
@ -229,11 +229,6 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
return this._getContent();
|
return this._getContent();
|
||||||
}
|
}
|
||||||
|
|
||||||
/** @returns {{dateModified, utcDateModified}} */
|
|
||||||
getContentMetadata() {
|
|
||||||
return sql.getRow(`SELECT dateModified, utcDateModified FROM blobs WHERE blobId = ?`, [this.blobId]);
|
|
||||||
}
|
|
||||||
|
|
||||||
/** @returns {*} */
|
/** @returns {*} */
|
||||||
getJsonContent() {
|
getJsonContent() {
|
||||||
const content = this.getContent();
|
const content = this.getContent();
|
||||||
@ -1589,7 +1584,6 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
saveRevision() {
|
saveRevision() {
|
||||||
return sql.transactional(() => {
|
return sql.transactional(() => {
|
||||||
let noteContent = this.getContent();
|
let noteContent = this.getContent();
|
||||||
const contentMetadata = this.getContentMetadata();
|
|
||||||
|
|
||||||
const revision = new BRevision({
|
const revision = new BRevision({
|
||||||
noteId: this.noteId,
|
noteId: this.noteId,
|
||||||
@ -1598,14 +1592,10 @@ class BNote extends AbstractBeccaEntity {
|
|||||||
type: this.type,
|
type: this.type,
|
||||||
mime: this.mime,
|
mime: this.mime,
|
||||||
isProtected: this.isProtected,
|
isProtected: this.isProtected,
|
||||||
utcDateLastEdited: this.utcDateModified > contentMetadata.utcDateModified
|
utcDateLastEdited: this.utcDateModified,
|
||||||
? this.utcDateModified
|
|
||||||
: contentMetadata.utcDateModified,
|
|
||||||
utcDateCreated: dateUtils.utcNowDateTime(),
|
utcDateCreated: dateUtils.utcNowDateTime(),
|
||||||
utcDateModified: dateUtils.utcNowDateTime(),
|
utcDateModified: dateUtils.utcNowDateTime(),
|
||||||
dateLastEdited: this.dateModified > contentMetadata.dateModified
|
dateLastEdited: this.dateModified,
|
||||||
? this.dateModified
|
|
||||||
: contentMetadata.dateModified,
|
|
||||||
dateCreated: dateUtils.localNowDateTime()
|
dateCreated: dateUtils.localNowDateTime()
|
||||||
}, true);
|
}, true);
|
||||||
|
|
||||||
|
@ -989,6 +989,10 @@ class FNote {
|
|||||||
isOptions() {
|
isOptions() {
|
||||||
return this.noteId.startsWith("_options");
|
return this.noteId.startsWith("_options");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
async getMetadata() {
|
||||||
|
return await server.get(`notes/${this.noteId}/metadata`);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export default FNote;
|
export default FNote;
|
||||||
|
@ -128,8 +128,8 @@ export default class NoteInfoWidget extends NoteContextAwareWidget {
|
|||||||
.attr("title", metadata.dateCreated);
|
.attr("title", metadata.dateCreated);
|
||||||
|
|
||||||
this.$dateModified
|
this.$dateModified
|
||||||
.text(metadata.combinedDateModified.substr(0, 16))
|
.text(metadata.dateModified.substr(0, 16))
|
||||||
.attr("title", metadata.combinedDateModified);
|
.attr("title", metadata.dateModified);
|
||||||
|
|
||||||
this.$type.text(note.type);
|
this.$type.text(note.type);
|
||||||
|
|
||||||
|
@ -21,11 +21,12 @@ function getNoteBlob(req) {
|
|||||||
|
|
||||||
function getNoteMetadata(req) {
|
function getNoteMetadata(req) {
|
||||||
const note = becca.getNoteOrThrow(req.params.noteId);
|
const note = becca.getNoteOrThrow(req.params.noteId);
|
||||||
const contentMetadata = note.getContentMetadata();
|
|
||||||
|
|
||||||
return {
|
return {
|
||||||
dateCreated: note.dateCreated,
|
dateCreated: note.dateCreated,
|
||||||
combinedDateModified: note.utcDateModified > contentMetadata.utcDateModified ? note.dateModified : contentMetadata.dateModified
|
utcDateCreated: note.utcDateCreated,
|
||||||
|
dateModified: note.dateModified,
|
||||||
|
utcDateModified: note.utcDateModified,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user