removed CTRL-ALT-C global shortcut with pasting from clipboard, keeping only CTRL-ALT-P without clipboard

This commit is contained in:
azivner
2018-02-13 19:55:04 -05:00
parent 1efac99828
commit 1cef0ce5f9
2 changed files with 6 additions and 27 deletions

View File

@@ -70,34 +70,16 @@ app.on('activate', () => {
app.on('ready', () => {
mainWindow = createMainWindow();
const date_notes = require('./src/services/date_notes');
const utils = require('./src/services/utils');
globalShortcut.register('CommandOrControl+Alt+P', async () => {
const date_notes = require('./src/services/date_notes');
const utils = require('./src/services/utils');
const parentNoteId = await date_notes.getDateNoteId(utils.nowDate());
// window may be hidden / not in focus
mainWindow.focus();
mainWindow.webContents.send('create-sub-note', JSON.stringify({
parentNoteId: parentNoteId,
content: ''
}));
});
globalShortcut.register('CommandOrControl+Alt+C', async () => {
const parentNoteId = await date_notes.getDateNoteId(utils.nowDate());
// window may be hidden / not in focus
mainWindow.focus();
let content = clipboard.readText();
content = content.replace(/(\r\n|\n)/g, "<p>");
mainWindow.webContents.send('create-sub-note', JSON.stringify({
parentNoteId: parentNoteId,
content: content
}));
mainWindow.webContents.send('create-day-sub-note', parentNoteId);
});
});