feat: remove note options from legacy options menu
This commit is contained in:
@@ -79,72 +79,6 @@
|
|||||||
)
|
)
|
||||||
.sk-label Options
|
.sk-label Options
|
||||||
.sk-menu-panel.dropdown-menu(ng-if='self.state.showOptionsMenu')
|
.sk-menu-panel.dropdown-menu(ng-if='self.state.showOptionsMenu')
|
||||||
.sk-menu-panel-section
|
|
||||||
.sk-menu-panel-header
|
|
||||||
.sk-menu-panel-header-title Note Options
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(true); self.togglePin()'
|
|
||||||
desc="'Pin or unpin a note from the top of your list'",
|
|
||||||
label="self.note.pinned ? 'Unpin' : 'Pin'"
|
|
||||||
)
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(true); self.toggleArchiveNote()'
|
|
||||||
desc="'Archive or unarchive a note from your Archived system tag'",
|
|
||||||
label="self.note.archived ? 'Unarchive' : 'Archive'"
|
|
||||||
)
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(true); self.toggleLockNote()'
|
|
||||||
desc="'Prevent unintentional editing of a note'",
|
|
||||||
label="self.noteLocked ? 'Enable Editing' : 'Prevent Editing'"
|
|
||||||
)
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(true); self.toggleProtectNote()'
|
|
||||||
desc=`'Protecting a note will require credentials to view it'`,
|
|
||||||
label="self.note.protected ? 'Unprotect' : 'Protect'"
|
|
||||||
)
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(true); self.toggleNotePreview()'
|
|
||||||
circle="self.note.hidePreview ? 'danger' : 'success'",
|
|
||||||
circle-align="'right'",
|
|
||||||
desc="'Hide or unhide the note preview from the list of notes'",
|
|
||||||
label="'Preview'"
|
|
||||||
)
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(); self.deleteNote()'
|
|
||||||
desc="'Send this note to the trash'",
|
|
||||||
label="'Move to Trash'",
|
|
||||||
ng-show='!self.state.altKeyDown && !self.note.trashed && !self.note.errorDecrypting',
|
|
||||||
stylekit-class="'warning'"
|
|
||||||
)
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(); self.deleteNotePermanently()'
|
|
||||||
desc="'Delete this note permanently from all your devices'",
|
|
||||||
label="'Delete Permanently'",
|
|
||||||
ng-show='!self.note.trashed && self.note.errorDecrypting',
|
|
||||||
stylekit-class="'danger'"
|
|
||||||
)
|
|
||||||
div(ng-if='self.note.trashed || self.state.altKeyDown')
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(true); self.restoreTrashedNote()'
|
|
||||||
desc="'Undelete this note and restore it back into your notes'",
|
|
||||||
label="'Restore'",
|
|
||||||
ng-show='self.note.trashed',
|
|
||||||
stylekit-class="'info'"
|
|
||||||
)
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(true); self.deleteNotePermanently()'
|
|
||||||
desc="'Delete this note permanently from all your devices'",
|
|
||||||
label="'Delete Permanently'",
|
|
||||||
stylekit-class="'danger'"
|
|
||||||
)
|
|
||||||
menu-row(
|
|
||||||
action='self.selectedMenuItem(true); self.emptyTrash()'
|
|
||||||
desc="'Permanently delete all notes in the trash'",
|
|
||||||
label="'Empty Trash'",
|
|
||||||
ng-show='self.note.trashed || !self.state.altKeyDown',
|
|
||||||
stylekit-class="'danger'",
|
|
||||||
subtitle="self.getTrashCount() + ' notes in trash'"
|
|
||||||
)
|
|
||||||
.sk-menu-panel-section
|
.sk-menu-panel-section
|
||||||
.sk-menu-panel-header
|
.sk-menu-panel-header
|
||||||
.sk-menu-panel-header-title Global Display
|
.sk-menu-panel-header-title Global Display
|
||||||
|
|||||||
@@ -697,118 +697,6 @@ class EditorViewCtrl extends PureViewCtrl<unknown, EditorState> {
|
|||||||
this.application.deleteItem(note);
|
this.application.deleteItem(note);
|
||||||
}
|
}
|
||||||
|
|
||||||
restoreTrashedNote() {
|
|
||||||
this.save(
|
|
||||||
this.note,
|
|
||||||
copyEditorValues(this.editorValues),
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
(mutator) => {
|
|
||||||
mutator.trashed = false;
|
|
||||||
},
|
|
||||||
true
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
deleteNotePermanently() {
|
|
||||||
this.deleteNote(true);
|
|
||||||
}
|
|
||||||
|
|
||||||
getTrashCount() {
|
|
||||||
return this.application.getTrashedItems().length;
|
|
||||||
}
|
|
||||||
|
|
||||||
async emptyTrash() {
|
|
||||||
const count = this.getTrashCount();
|
|
||||||
if (
|
|
||||||
await confirmDialog({
|
|
||||||
text: StringEmptyTrash(count),
|
|
||||||
confirmButtonStyle: 'danger',
|
|
||||||
})
|
|
||||||
) {
|
|
||||||
this.application.emptyTrash();
|
|
||||||
this.application.sync();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
togglePin() {
|
|
||||||
const note = this.note;
|
|
||||||
this.save(
|
|
||||||
note,
|
|
||||||
copyEditorValues(this.editorValues),
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
(mutator) => {
|
|
||||||
mutator.pinned = !note.pinned;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleLockNote() {
|
|
||||||
const note = this.note;
|
|
||||||
this.save(
|
|
||||||
note,
|
|
||||||
copyEditorValues(this.editorValues),
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
(mutator) => {
|
|
||||||
mutator.locked = !note.locked;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async toggleProtectNote() {
|
|
||||||
if (this.note.protected) {
|
|
||||||
void this.application.unprotectNote(this.note);
|
|
||||||
} else {
|
|
||||||
const note = await this.application.protectNote(this.note);
|
|
||||||
if (note?.protected && !this.application.hasProtectionSources()) {
|
|
||||||
this.setShowProtectedWarning(true);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleNotePreview() {
|
|
||||||
const note = this.note;
|
|
||||||
this.save(
|
|
||||||
note,
|
|
||||||
copyEditorValues(this.editorValues),
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
(mutator) => {
|
|
||||||
mutator.hidePreview = !note.hidePreview;
|
|
||||||
}
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
toggleArchiveNote() {
|
|
||||||
const note = this.note;
|
|
||||||
if (note.locked) {
|
|
||||||
alertDialog({
|
|
||||||
text: note.archived
|
|
||||||
? STRING_UNARCHIVE_LOCKED_ATTEMPT
|
|
||||||
: STRING_ARCHIVE_LOCKED_ATTEMPT,
|
|
||||||
});
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
this.save(
|
|
||||||
note,
|
|
||||||
copyEditorValues(this.editorValues),
|
|
||||||
true,
|
|
||||||
false,
|
|
||||||
true,
|
|
||||||
(mutator) => {
|
|
||||||
mutator.archived = !note.archived;
|
|
||||||
},
|
|
||||||
/** If we are unarchiving, and we are in the archived tag, close the editor */
|
|
||||||
note.archived && this.appState.selectedTag?.isArchiveTag
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
async reloadTags() {
|
async reloadTags() {
|
||||||
if (!this.note) {
|
if (!this.note) {
|
||||||
return;
|
return;
|
||||||
|
|||||||
Reference in New Issue
Block a user