trigger flash routine via enter (for dongie)

pull/3/head
cTn 11 years ago
parent 74e9256e75
commit 1268e0c206

@ -201,6 +201,58 @@ function tab_initialize_firmware_flasher() {
}).change(); }).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() { $('a.back').click(function() {
if (!GUI.connect_lock) { // button disabled while flashing is in progress if (!GUI.connect_lock) { // button disabled while flashing is in progress
GUI.tab_switch_cleanup(function() { GUI.tab_switch_cleanup(function() {

Loading…
Cancel
Save