Skip to content
This repository was archived by the owner on May 20, 2018. It is now read-only.

Commit 5984d3f

Browse files
author
Lev Lazinskiy
committed
[feature] added hotkeys for todo item and timestamp
1 parent e2b463d commit 5984d3f

File tree

1 file changed

+19
-0
lines changed

1 file changed

+19
-0
lines changed

app/static/js/braindump.js

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,3 +15,22 @@ editor.getSession().on('change', function(){
1515
textarea_html.val(marked(editor.getSession().getValue()));
1616
textarea.val(editor.getSession().getValue());
1717
});
18+
19+
// Hot Keys
20+
editor.commands.addCommand({
21+
name: 'insert text',
22+
bindKey: {win: 'Ctrl-1', mac: 'Ctrl-1'},
23+
exec: function(editor) {
24+
editor.insert("*TODO ")
25+
},
26+
readOnly: true // false if this command should not apply in readOnly mode
27+
});
28+
29+
editor.commands.addCommand({
30+
name: 'Insert TimeStamp',
31+
bindKey: {win: 'Ctrl-d', mac: 'Ctrl-d'},
32+
exec: function(editor) {
33+
editor.insert(moment().format('MMMM Do YYYY, h:mm:ss a') + "\n");
34+
},
35+
readOnly: true // false if this command should not apply in readOnly mode
36+
});

0 commit comments

Comments
 (0)