Switch shortcut keycode to work for Firefox
This commit is contained in:
@ -9,9 +9,9 @@ var CodeOceanEditor = {
|
|||||||
SUCCESSFULL_PERCENTAGE: 90,
|
SUCCESSFULL_PERCENTAGE: 90,
|
||||||
|
|
||||||
//Key-Codes (for Hotkeys)
|
//Key-Codes (for Hotkeys)
|
||||||
ALT_R_KEY_CODE: 174,
|
R_KEY_CODE: 82,
|
||||||
ALT_S_KEY_CODE: 8218,
|
S_KEY_CODE: 83,
|
||||||
ALT_T_KEY_CODE: 8224,
|
T_KEY_CODE: 84,
|
||||||
ENTER_KEY_CODE: 13,
|
ENTER_KEY_CODE: 13,
|
||||||
|
|
||||||
//Request-For-Comments-Configuration
|
//Request-For-Comments-Configuration
|
||||||
@ -167,11 +167,11 @@ var CodeOceanEditor = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
handleKeyPress: function (event) {
|
handleKeyPress: function (event) {
|
||||||
if (event.which === this.ALT_R_KEY_CODE) {
|
if (event.altKey && event.which === this.R_KEY_CODE) {
|
||||||
$('#run').trigger('click');
|
$('#run').trigger('click');
|
||||||
} else if (event.which === this.ALT_S_KEY_CODE) {
|
} else if (event.altKey && event.which === this.S_KEY_CODE) {
|
||||||
$('#assess').trigger('click');
|
$('#assess').trigger('click');
|
||||||
} else if (event.which === this.ALT_T_KEY_CODE) {
|
} else if (event.altKey && event.which === this.T_KEY_CODE) {
|
||||||
$('#test').trigger('click');
|
$('#test').trigger('click');
|
||||||
} else {
|
} else {
|
||||||
return;
|
return;
|
||||||
@ -302,7 +302,7 @@ var CodeOceanEditor = {
|
|||||||
|
|
||||||
initializeEventHandlers: function () {
|
initializeEventHandlers: function () {
|
||||||
$(document).on('click', '#results a', this.showOutput.bind(this));
|
$(document).on('click', '#results a', this.showOutput.bind(this));
|
||||||
$(document).on('keypress', this.handleKeyPress.bind(this));
|
$(document).on('keydown', this.handleKeyPress.bind(this));
|
||||||
this.initializeFileTreeButtons();
|
this.initializeFileTreeButtons();
|
||||||
this.initializeWorkspaceButtons();
|
this.initializeWorkspaceButtons();
|
||||||
this.initializeRequestForComments()
|
this.initializeRequestForComments()
|
||||||
|
Reference in New Issue
Block a user