mirror of
https://github.com/TriliumNext/Notes.git
synced 2025-08-09 17:52:32 +08:00
33 lines
678 B
JavaScript
33 lines
678 B
JavaScript
"use strict";
|
|
|
|
const keyboardActions = require('../../services/keyboard_actions');
|
|
const becca = require('../../becca/becca');
|
|
|
|
function getKeyboardActions() {
|
|
return keyboardActions.getKeyboardActions();
|
|
}
|
|
|
|
function getShortcutsForNotes() {
|
|
const attrs = becca.findAttributes('label', 'keyboardShortcut');
|
|
|
|
const map = {};
|
|
|
|
for (const attr of attrs) {
|
|
const note = becca.getNote(attr.noteId);
|
|
|
|
if (note?.type === 'launcher') {
|
|
// launchers have different handling
|
|
continue;
|
|
}
|
|
|
|
map[attr.value] = attr.noteId;
|
|
}
|
|
|
|
return map;
|
|
}
|
|
|
|
module.exports = {
|
|
getKeyboardActions,
|
|
getShortcutsForNotes
|
|
};
|