Add custom shortcut in the notes editor (tinyMCE) [tuto]


To add a shortcut to remove format and for upperscript:


Go to C:\Program Files (x86)\Zotero
backup zotero.jar
Copy past zotero.jar on desktop
Open it (with 7zip)
edit zotero\resource\tinymce\note.html


Find the line setup: function (ed) { **

( just beneath setLocale(ed); add this:

//***shortcut remove format (ctrl+space)

ed.shortcuts.add('ctrl+32', 'remove formatter', function(){

tinymce.activeEditor.execCommand('RemoveFormat');

});



//***shortcut upperscript () :

ed.shortcuts.add('ctrl+;', 'upper script', function(){

tinymce.activeEditor.execCommand('superscript');

});

ps: it might not be "function (ed)" but "function (editor)". So just replace "ed.shortcuts.add" by "editor.shortcuts.add"

ps2: For the syntax of shortcut (eg. 32 = space) use: cf http://keycode.info . You can test it: https://goo.gl/9D9Zpa )
Sign In or Register to comment.