diff --git a/app/assets/javascripts/discourse/lib/Markdown.Editor.js b/app/assets/javascripts/discourse/lib/Markdown.Editor.js index c72465724..41679bb8d 100644 --- a/app/assets/javascripts/discourse/lib/Markdown.Editor.js +++ b/app/assets/javascripts/discourse/lib/Markdown.Editor.js @@ -1214,6 +1214,17 @@ makeSpritedButtonRow(); var keyEvent = "keydown"; + + var extendedEvents = []; + + if(window.PagedownCustom){ + window.PagedownCustom.appendButtons.concat(window.PagedownCustom.insertButtons).forEach(function(button){ + if(button.shortcut){ + extendedEvents.push([button.shortcut, button.execute]); + } + }); + } + util.addEvent(inputBox, keyEvent, function (key) { // Check to see if we have a button key and, if so execute the callback. @@ -1222,6 +1233,12 @@ var keyCode = key.charCode || key.keyCode; var keyCodeStr = String.fromCharCode(keyCode).toLowerCase(); + for(var i=0; i