2014-11-12 15:35:41 -05:00
|
|
|
import ctrlOrCmd from 'ghost/utils/ctrl-or-cmd';
|
|
|
|
|
|
|
|
var shortcuts = {};
|
2014-07-30 22:18:00 -05:00
|
|
|
|
2014-10-24 16:09:50 -05:00
|
|
|
// General editor shortcuts
|
2014-07-30 22:18:00 -05:00
|
|
|
shortcuts[ctrlOrCmd + '+alt+p'] = 'publish';
|
|
|
|
shortcuts['alt+shift+z'] = 'toggleZenMode';
|
|
|
|
|
2014-10-24 16:09:50 -05:00
|
|
|
// CodeMirror Markdown Shortcuts
|
2014-07-30 22:18:00 -05:00
|
|
|
|
2014-10-24 16:09:50 -05:00
|
|
|
// Text
|
2014-07-30 22:18:00 -05: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 10:08:10 -05: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-14 15:36:33 -05:00
|
|
|
shortcuts[ctrlOrCmd + '+shift+c'] = {action: 'codeMirrorShortcut', options: {type: 'copyHTML'}};
|
2014-07-31 11:21:48 -05:00
|
|
|
shortcuts[ctrlOrCmd + '+h'] = {action: 'codeMirrorShortcut', options: {type: 'cycleHeaderLevel'}};
|
2014-07-30 22:18:00 -05:00
|
|
|
|
2014-10-24 16:09:50 -05:00
|
|
|
// Formatting
|
2014-07-30 22:18:00 -05:00
|
|
|
shortcuts['ctrl+q'] = {action: 'codeMirrorShortcut', options: {type: 'blockquote'}};
|
|
|
|
shortcuts['ctrl+l'] = {action: 'codeMirrorShortcut', options: {type: 'list'}};
|
|
|
|
|
2014-10-24 16:09:50 -05:00
|
|
|
// Insert content
|
2014-07-30 22:18:00 -05: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 01:40:12 -05:00
|
|
|
shortcuts[ctrlOrCmd + '+shift+k'] = {action: 'codeMirrorShortcut', options: {type: 'code'}};
|
2014-07-30 22:18:00 -05:00
|
|
|
|
|
|
|
export default shortcuts;
|