keyboard shortcuts for ribbon tabs

This commit is contained in:
zadam
2021-06-27 12:53:05 +02:00
parent 9e1c9782ff
commit 0351d7eff1
17 changed files with 195 additions and 38 deletions

View File

@@ -46,6 +46,10 @@ export default class BasicPropertiesWidget extends NoteContextAwareWidget {
this.child(this.noteTypeWidget, this.protectedNoteSwitchWidget, this.editabilitySelectWidget);
}
get name() {
return "basicProperties";
}
isEnabled() {
return this.note && (this.note.type === 'text' || this.note.type === 'code');
}

View File

@@ -42,6 +42,10 @@ const TPL = `
</div>
`;
export default class BookPropertiesWidget extends NoteContextAwareWidget {
get name() {
return "bookProperties";
}
isEnabled() {
return this.note && this.note.type === 'book';
}

View File

@@ -55,6 +55,10 @@ const TPL = `
</div>`;
export default class FilePropertiesWidget extends NoteContextAwareWidget {
get name() {
return "fileProperties";
}
isEnabled() {
return this.note && this.note.type === 'file';
}

View File

@@ -37,6 +37,10 @@ const TPL = `
</div>`;
export default class ImagePropertiesWidget extends NoteContextAwareWidget {
get name() {
return "imageProperties";
}
isEnabled() {
return this.note && this.note.type === 'image';
}

View File

@@ -21,6 +21,10 @@ const TPL = `
</div>`;
export default class InheritedAttributesWidget extends NoteContextAwareWidget {
get name() {
return "inheritedAttributes";
}
constructor() {
super();

View File

@@ -38,6 +38,10 @@ const TPL = `
</div>`;
export default class LinkMapWidget extends NoteContextAwareWidget {
get name() {
return "linkMap";
}
isEnabled() {
return this.note;
}

View File

@@ -62,6 +62,10 @@ const TPL = `
</div>
`;
export default class NoteInfoWidget extends NoteContextAwareWidget {
get name() {
return "noteInfo";
}
isEnabled() {
return this.note;
}

View File

@@ -36,6 +36,10 @@ const TPL = `
</div>`;
export default class NotePathsWidget extends NoteContextAwareWidget {
get name() {
return "notePaths";
}
isEnabled() {
return this.note;
}

View File

@@ -14,6 +14,9 @@ const TPL = `
</div>
</div>`;
/**
* TODO: figure out better name or conceptualize better.
*/
export default class NotePropertiesWidget extends NoteContextAwareWidget {
isEnabled() {
return this.note && !!this.note.getLabelValue('pageUrl');

View File

@@ -22,6 +22,10 @@ const TPL = `
`;
export default class OwnedAttributeListWidget extends NoteContextAwareWidget {
get name() {
return "ownedAttributes";
}
constructor() {
super();

View File

@@ -35,6 +35,10 @@ const TPL = `
`;
export default class PromotedAttributesWidget extends NoteContextAwareWidget {
get name() {
return "promotedAttributes";
}
doRender() {
this.$widget = $(TPL);
this.contentSized();

View File

@@ -23,7 +23,6 @@ import Limit from "../search_options/limit.js";
import DeleteNoteRevisionsSearchAction from "../search_actions/delete_note_revisions.js";
import Debug from "../search_options/debug.js";
import appContext from "../../services/app_context.js";
import toast from "../../services/toast.js";
const TPL = `
<div class="search-definition-widget">

View File

@@ -31,6 +31,10 @@ const TPL = `
`;
export default class SimilarNotesWidget extends NoteContextAwareWidget {
get name() {
return "similarNotes";
}
isEnabled() {
return super.isEnabled()
&& this.note.type !== 'search'