mirror of
https://github.com/fusionpbx/fusionpbx.git
synced 2026-02-21 18:36:31 +00:00
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:
@@ -273,28 +273,14 @@ else {
|
||||
document.getElementById('editor').style.fontSize='<?php echo $setting_size;?>';
|
||||
focus_editor();
|
||||
|
||||
//prevent submit (file save) with enter key on file path input
|
||||
$('#current_file').keypress(function(event){
|
||||
if (event.which == 13) { return false; }
|
||||
});
|
||||
//prevent form submit with enter key on file path input
|
||||
<?php key_press('enter', 'down', '#current_file', null, null, 'return false;', false); ?>
|
||||
|
||||
//keyboard shortcut to save file
|
||||
$(window).keypress(function(event) {
|
||||
//save file [Ctrl+S]
|
||||
if ((event.which == 115 && event.ctrlKey) || (event.which == 19)) {
|
||||
$('form#frm_edit').submit();
|
||||
return false;
|
||||
}
|
||||
//open file manager/clip library pane [Ctrl+Q]
|
||||
else if ((event.which == 113 && event.ctrlKey) || (event.which == 19)) {
|
||||
toggle_sidebar();
|
||||
return false;
|
||||
}
|
||||
//otherwise, default action
|
||||
else {
|
||||
return true;
|
||||
}
|
||||
});
|
||||
//save file
|
||||
<?php key_press('ctrl+s', 'down', 'window', null, null, "$('form#frm_edit').submit(); return false;", false); ?>
|
||||
|
||||
//open file manager/clip library pane
|
||||
<?php key_press('ctrl+q', 'down', 'window', null, null, 'toggle_sidebar(); focus_editor(); return false;', false); ?>
|
||||
|
||||
//remove certain keyboard shortcuts
|
||||
editor.commands.bindKey("Ctrl-T", null); //new browser tab
|
||||
|
||||
Reference in New Issue
Block a user