Function: Created key_press function to dynamically generate key detection javascript.

Voicemail: Ctrl+A checks all checkboxes, pressing Delete deletes the checked Voicemails.
Editor: Integrated key_press function.
Command: Integrated key_press function.
This commit is contained in:
reliberate
2016-03-31 17:11:37 -06:00
parent db122a3da6
commit 2ca72bd99d
7 changed files with 196 additions and 167 deletions

View File

@@ -425,18 +425,9 @@ else {
document.getElementById('editor').style.fontSize='<?php echo $setting_size;?>';
focus_editor();
//keyboard shortcuts
$(window).keypress(function(event) {
//execute command [Ctrl+Enter]
if (((event.which == 13 || event.which == 10) && event.ctrlKey) || (event.which == 19)) {
$('form#frm').submit();
return false;
}
//otherwise, default action
else {
return true;
}
});
//keyboard shortcut to execute command
<?php key_press('ctrl+enter', 'down', 'window', null, null, "$('form#frm').submit();", false); ?>
//remove certain keyboard shortcuts
editor.commands.bindKey("Ctrl-T", null); //new browser tab
</script>