trigger flash routine via enter (for dongie)

10.3.x-maintenance
cTn 2014-04-11 21:21:48 +02:00
parent 74e9256e75
commit 1268e0c206
1 changed files with 52 additions and 0 deletions

View File

@ -201,6 +201,58 @@ function tab_initialize_firmware_flasher() {
}).change();
});
/*
chrome.storage.local.get('dev_mode', function(result) {
if (typeof result.dev_mode !== 'undefined') {
if (result.dev_mode) {
GUI.log('Dev mode: <strong>Enabled</strong>');
bind_enter_handler();
}
}
});
var keys_down = {};
$(document).keydown(function(e) {
keys_down[e.which] = true;
// idkfa
if (keys_down[65] && keys_down[68] && keys_down[70] && keys_down[73] && keys_down[75]) {
chrome.storage.local.get('dev_mode', function(result) {
if (typeof result.dev_mode === 'undefined') {
GUI.log('Dev mode: <strong>Enabled</strong>');
bind_enter_handler();
chrome.storage.local.set({'dev_mode': true});
}
});
}
});
$(document).keyup(function(e) {
delete keys_down[e.which];
});
function bind_enter_handler() {
// unbind first (in case there is anything bound here)
$(document).unbind('keypress');
$(document).keypress(function(e) {
if (e.which == 13) { // enter
// Trigger regular Flashing sequence
$('a.flash_firmware').click();
}
});
}
*/
$(document).keypress(function(e) {
if (e.which == 13) { // enter
// Trigger regular Flashing sequence
$('a.flash_firmware').click();
}
});
// back button
$('a.back').click(function() {
if (!GUI.connect_lock) { // button disabled while flashing is in progress
GUI.tab_switch_cleanup(function() {