Notes/src/routes/api/keys.js

26 lines
505 B
JavaScript
Raw Normal View History

2019-11-19 20:53:04 +01:00
"use strict";
const keyboardActions = require('../../services/keyboard_actions');
2021-12-19 10:50:38 +01:00
const becca = require('../../becca/becca');
2019-11-19 20:53:04 +01:00
2020-06-20 12:31:38 +02:00
function getKeyboardActions() {
return keyboardActions.getKeyboardActions();
2019-11-19 20:53:04 +01:00
}
2020-06-20 12:31:38 +02:00
function getShortcutsForNotes() {
2021-12-19 10:50:38 +01:00
const attrs = becca.findAttributes('label', 'keyboardShortcut');
const map = {};
for (const attr of attrs) {
map[attr.value] = attr.noteId;
}
return map;
}
2019-11-19 20:53:04 +01:00
module.exports = {
getKeyboardActions,
getShortcutsForNotes
2020-06-20 12:31:38 +02:00
};