Notes/src/routes/api/keys.js

21 lines
515 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() {
2022-12-01 16:22:04 +01:00
const labels = becca.findAttributes('label', 'keyboardShortcut');
2021-12-19 10:50:38 +01:00
2022-12-01 13:07:23 +01:00
// launchers have different handling
2022-12-01 16:22:04 +01:00
return labels.filter(attr => becca.getNote(attr.noteId)?.type !== 'launcher');
}
2019-11-19 20:53:04 +01:00
module.exports = {
getKeyboardActions,
getShortcutsForNotes
2020-06-20 12:31:38 +02:00
};