2014-11-12 23:35:41 +03:00
|
|
|
import ctrlOrCmd from 'ghost/utils/ctrl-or-cmd';
|
|
|
|
|
|
|
|
var shortcuts = {};
|
2014-07-31 07:18:00 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
// General editor shortcuts
|
2014-07-31 07:18:00 +04:00
|
|
|
shortcuts[ctrlOrCmd + '+s'] = 'save';
|
|
|
|
shortcuts[ctrlOrCmd + '+alt+p'] = 'publish';
|
|
|
|
shortcuts['alt+shift+z'] = 'toggleZenMode';
|
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
// CodeMirror Markdown Shortcuts
|
2014-07-31 07:18:00 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
// Text
|
2014-07-31 07:18:00 +04:00
|
|
|
shortcuts['ctrl+alt+u'] = {action: 'codeMirrorShortcut', options: {type: 'strike'}};
|
|
|
|
shortcuts[ctrlOrCmd + '+b'] = {action: 'codeMirrorShortcut', options: {type: 'bold'}};
|
|
|
|
shortcuts[ctrlOrCmd + '+i'] = {action: 'codeMirrorShortcut', options: {type: 'italic'}};
|
|
|
|
|
2014-09-24 19:08:10 +04:00
|
|
|
shortcuts['ctrl+u'] = {action: 'codeMirrorShortcut', options: {type: 'uppercase'}};
|
|
|
|
shortcuts['ctrl+shift+u'] = {action: 'codeMirrorShortcut', options: {type: 'lowercase'}};
|
|
|
|
shortcuts['ctrl+alt+shift+u'] = {action: 'codeMirrorShortcut', options: {type: 'titlecase'}};
|
2014-08-15 00:36:33 +04:00
|
|
|
shortcuts[ctrlOrCmd + '+shift+c'] = {action: 'codeMirrorShortcut', options: {type: 'copyHTML'}};
|
2014-07-31 20:21:48 +04:00
|
|
|
shortcuts[ctrlOrCmd + '+h'] = {action: 'codeMirrorShortcut', options: {type: 'cycleHeaderLevel'}};
|
2014-07-31 07:18:00 +04:00
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
// Formatting
|
2014-07-31 07:18:00 +04:00
|
|
|
shortcuts['ctrl+q'] = {action: 'codeMirrorShortcut', options: {type: 'blockquote'}};
|
|
|
|
shortcuts['ctrl+l'] = {action: 'codeMirrorShortcut', options: {type: 'list'}};
|
|
|
|
|
2014-10-25 01:09:50 +04:00
|
|
|
// Insert content
|
2014-07-31 07:18:00 +04:00
|
|
|
shortcuts['ctrl+shift+1'] = {action: 'codeMirrorShortcut', options: {type: 'currentDate'}};
|
|
|
|
shortcuts[ctrlOrCmd + '+k'] = {action: 'codeMirrorShortcut', options: {type: 'link'}};
|
|
|
|
shortcuts[ctrlOrCmd + '+shift+i'] = {action: 'codeMirrorShortcut', options: {type: 'image'}};
|
2014-08-03 10:40:12 +04:00
|
|
|
shortcuts[ctrlOrCmd + '+shift+k'] = {action: 'codeMirrorShortcut', options: {type: 'code'}};
|
2014-07-31 07:18:00 +04:00
|
|
|
|
|
|
|
export default shortcuts;
|