mirror of
https://github.com/zadam/trilium.git
synced 2025-06-06 18:08:33 +02:00
rename "note revision" to just "revision"
This commit is contained in:
parent
779751a234
commit
fe908759d1
@ -291,7 +291,7 @@ paths:
|
|||||||
application/json; charset=utf-8:
|
application/json; charset=utf-8:
|
||||||
schema:
|
schema:
|
||||||
$ref: '#/components/schemas/Error'
|
$ref: '#/components/schemas/Error'
|
||||||
/notes/{noteId}/note-revision:
|
/notes/{noteId}/revision:
|
||||||
parameters:
|
parameters:
|
||||||
- name: noteId
|
- name: noteId
|
||||||
in: path
|
in: path
|
||||||
|
@ -146,7 +146,7 @@ function register(router) {
|
|||||||
zipExportService.exportToZip(taskContext, branch, format, res);
|
zipExportService.exportToZip(taskContext, branch, format, res);
|
||||||
});
|
});
|
||||||
|
|
||||||
eu.route(router, 'post' ,'/etapi/notes/:noteId/note-revision', (req, res, next) => {
|
eu.route(router, 'post' ,'/etapi/notes/:noteId/revision', (req, res, next) => {
|
||||||
const note = eu.getAndCheckNote(req.params.noteId);
|
const note = eu.getAndCheckNote(req.params.noteId);
|
||||||
|
|
||||||
note.saveRevision();
|
note.saveRevision();
|
||||||
|
@ -9,9 +9,9 @@ import BasicWidget from "../basic_widget.js";
|
|||||||
import dialogService from "../../services/dialog.js";
|
import dialogService from "../../services/dialog.js";
|
||||||
|
|
||||||
const TPL = `
|
const TPL = `
|
||||||
<div class="note-revisions-dialog modal fade mx-auto" tabindex="-1" role="dialog">
|
<div class="revisions-dialog modal fade mx-auto" tabindex="-1" role="dialog">
|
||||||
<style>
|
<style>
|
||||||
.note-revisions-dialog .note-revision-content-wrapper {
|
.revisions-dialog .revision-content-wrapper {
|
||||||
flex-grow: 1;
|
flex-grow: 1;
|
||||||
margin-left: 20px;
|
margin-left: 20px;
|
||||||
display: flex;
|
display: flex;
|
||||||
@ -19,17 +19,17 @@ const TPL = `
|
|||||||
min-width: 0;
|
min-width: 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-revisions-dialog .note-revision-content {
|
.revisions-dialog .revision-content {
|
||||||
overflow: auto;
|
overflow: auto;
|
||||||
word-break: break-word;
|
word-break: break-word;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-revisions-dialog .note-revision-content img {
|
.revisions-dialog .revision-content img {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
object-fit: contain;
|
object-fit: contain;
|
||||||
}
|
}
|
||||||
|
|
||||||
.note-revisions-dialog .note-revision-content pre {
|
.revisions-dialog .revision-content pre {
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
word-break: break-all;
|
word-break: break-all;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
@ -41,7 +41,7 @@ const TPL = `
|
|||||||
<div class="modal-header">
|
<div class="modal-header">
|
||||||
<h5 class="modal-title mr-auto">Note revisions</h5>
|
<h5 class="modal-title mr-auto">Note revisions</h5>
|
||||||
|
|
||||||
<button class="note-revisions-erase-all-revisions-button btn btn-xs"
|
<button class="revisions-erase-all-revisions-button btn btn-xs"
|
||||||
title="Delete all revisions of this note"
|
title="Delete all revisions of this note"
|
||||||
style="padding: 0 10px 0 10px;" type="button">Delete all revisions</button>
|
style="padding: 0 10px 0 10px;" type="button">Delete all revisions</button>
|
||||||
|
|
||||||
@ -53,19 +53,19 @@ const TPL = `
|
|||||||
</div>
|
</div>
|
||||||
<div class="modal-body" style="display: flex; height: 80vh;">
|
<div class="modal-body" style="display: flex; height: 80vh;">
|
||||||
<div class="dropdown">
|
<div class="dropdown">
|
||||||
<button class="note-revision-list-dropdown" type="button" style="display: none;" data-toggle="dropdown">Dropdown trigger</button>
|
<button class="revision-list-dropdown" type="button" style="display: none;" data-toggle="dropdown">Dropdown trigger</button>
|
||||||
|
|
||||||
<div class="note-revision-list dropdown-menu" style="position: static; height: 100%; overflow: auto;"></div>
|
<div class="revision-list dropdown-menu" style="position: static; height: 100%; overflow: auto;"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="note-revision-content-wrapper">
|
<div class="revision-content-wrapper">
|
||||||
<div style="flex-grow: 0; display: flex; justify-content: space-between;">
|
<div style="flex-grow: 0; display: flex; justify-content: space-between;">
|
||||||
<h3 class="note-revision-title" style="margin: 3px; flex-grow: 100;"></h3>
|
<h3 class="revision-title" style="margin: 3px; flex-grow: 100;"></h3>
|
||||||
|
|
||||||
<div class="note-revision-title-buttons"></div>
|
<div class="revision-title-buttons"></div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div class="note-revision-content"></div>
|
<div class="revision-content"></div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@ -83,12 +83,12 @@ export default class RevisionsDialog extends BasicWidget {
|
|||||||
|
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
this.$list = this.$widget.find(".note-revision-list");
|
this.$list = this.$widget.find(".revision-list");
|
||||||
this.$listDropdown = this.$widget.find(".note-revision-list-dropdown");
|
this.$listDropdown = this.$widget.find(".revision-list-dropdown");
|
||||||
this.$content = this.$widget.find(".note-revision-content");
|
this.$content = this.$widget.find(".revision-content");
|
||||||
this.$title = this.$widget.find(".note-revision-title");
|
this.$title = this.$widget.find(".revision-title");
|
||||||
this.$titleButtons = this.$widget.find(".note-revision-title-buttons");
|
this.$titleButtons = this.$widget.find(".revision-title-buttons");
|
||||||
this.$eraseAllRevisionsButton = this.$widget.find(".note-revisions-erase-all-revisions-button");
|
this.$eraseAllRevisionsButton = this.$widget.find(".revisions-erase-all-revisions-button");
|
||||||
|
|
||||||
this.$listDropdown.dropdown();
|
this.$listDropdown.dropdown();
|
||||||
|
|
||||||
@ -100,7 +100,7 @@ export default class RevisionsDialog extends BasicWidget {
|
|||||||
});
|
});
|
||||||
|
|
||||||
this.$widget.on('shown.bs.modal', () => {
|
this.$widget.on('shown.bs.modal', () => {
|
||||||
this.$list.find(`[data-note-revision-id="${this.revisionId}"]`)
|
this.$list.find(`[data-revision-id="${this.revisionId}"]`)
|
||||||
.trigger('focus');
|
.trigger('focus');
|
||||||
});
|
});
|
||||||
|
|
||||||
@ -148,7 +148,7 @@ export default class RevisionsDialog extends BasicWidget {
|
|||||||
this.$list.append(
|
this.$list.append(
|
||||||
$('<a class="dropdown-item" tabindex="0">')
|
$('<a class="dropdown-item" tabindex="0">')
|
||||||
.text(`${item.dateLastEdited.substr(0, 16)} (${item.contentLength} bytes)`)
|
.text(`${item.dateLastEdited.substr(0, 16)} (${item.contentLength} bytes)`)
|
||||||
.attr('data-note-revision-id', item.revisionId)
|
.attr('data-revision-id', item.revisionId)
|
||||||
.attr('title', `This revision was last edited on ${item.dateLastEdited}`)
|
.attr('title', `This revision was last edited on ${item.dateLastEdited}`)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -168,7 +168,7 @@ export default class RevisionsDialog extends BasicWidget {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async setContentPane() {
|
async setContentPane() {
|
||||||
const revisionId = this.$list.find(".active").attr('data-note-revision-id');
|
const revisionId = this.$list.find(".active").attr('data-revision-id');
|
||||||
|
|
||||||
const revisionItem = this.revisionItems.find(r => r.revisionId === revisionId);
|
const revisionItem = this.revisionItems.find(r => r.revisionId === revisionId);
|
||||||
|
|
||||||
|
@ -8,14 +8,14 @@ const TPL = `
|
|||||||
|
|
||||||
<div class="form-group">
|
<div class="form-group">
|
||||||
<label>Note revision snapshot time interval (in seconds)</label>
|
<label>Note revision snapshot time interval (in seconds)</label>
|
||||||
<input class="note-revision-snapshot-time-interval-in-seconds form-control" type="number" min="10">
|
<input class="revision-snapshot-time-interval-in-seconds form-control" type="number" min="10">
|
||||||
</div>
|
</div>
|
||||||
</div>`;
|
</div>`;
|
||||||
|
|
||||||
export default class RevisionsSnapshotIntervalOptions extends OptionsWidget {
|
export default class RevisionsSnapshotIntervalOptions extends OptionsWidget {
|
||||||
doRender() {
|
doRender() {
|
||||||
this.$widget = $(TPL);
|
this.$widget = $(TPL);
|
||||||
this.$revisionsTimeInterval = this.$widget.find(".note-revision-snapshot-time-interval-in-seconds");
|
this.$revisionsTimeInterval = this.$widget.find(".revision-snapshot-time-interval-in-seconds");
|
||||||
this.$revisionsTimeInterval.on('change', () =>
|
this.$revisionsTimeInterval.on('change', () =>
|
||||||
this.updateOption('revisionSnapshotTimeInterval', this.$revisionsTimeInterval.val()));
|
this.updateOption('revisionSnapshotTimeInterval', this.$revisionsTimeInterval.val()));
|
||||||
}
|
}
|
||||||
|
@ -14,7 +14,7 @@ Content-Type: application/json
|
|||||||
|
|
||||||
###
|
###
|
||||||
|
|
||||||
POST {{triliumHost}}/etapi/notes/{{createdNoteId}}/note-revision
|
POST {{triliumHost}}/etapi/notes/{{createdNoteId}}/revision
|
||||||
Authorization: {{authToken}}
|
Authorization: {{authToken}}
|
||||||
Content-Type: text/plain
|
Content-Type: text/plain
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user