Commit d1cb8680 authored by mercury233's avatar mercury233

add konami code to open devtools

parent 11455e59
Pipeline #4151 failed with stages
in 4 minutes and 14 seconds
...@@ -8,6 +8,7 @@ import { SettingsService } from './settings.sevices'; ...@@ -8,6 +8,7 @@ import { SettingsService } from './settings.sevices';
window['Tether'] = Tether; window['Tether'] = Tether;
const autoUpdater: Electron.AutoUpdater = remote.getGlobal('autoUpdater'); const autoUpdater: Electron.AutoUpdater = remote.getGlobal('autoUpdater');
const konami_code_logger: string[] = [];
@Component({ @Component({
moduleId: module.id, moduleId: module.id,
...@@ -48,6 +49,22 @@ export class MyCardComponent implements OnInit { ...@@ -48,6 +49,22 @@ export class MyCardComponent implements OnInit {
'update-available': this.update_available, 'update-available': this.update_available,
'update-downloaded': this.update_downloaded 'update-downloaded': this.update_downloaded
})); }));
$('#settings-modal').on('keyup',(event)=>{
konami_code_logger.unshift(event.key);
if (konami_code_logger[9] == 'ArrowUp'
&& konami_code_logger[8] == 'ArrowUp'
&& konami_code_logger[7] == 'ArrowDown'
&& konami_code_logger[6] == 'ArrowDown'
&& konami_code_logger[5] == 'ArrowLeft'
&& konami_code_logger[4] == 'ArrowRight'
&& konami_code_logger[3] == 'ArrowLeft'
&& konami_code_logger[2] == 'ArrowRight'
&& konami_code_logger[1].toLowerCase() == 'b'
&& konami_code_logger[0].toLowerCase() == 'a'
) {
this.currentWindow.webContents.openDevTools();
}
});
// document.addEventListener('drop', (event)=>{ // document.addEventListener('drop', (event)=>{
// console.log('drop', event); // console.log('drop', event);
// event.preventDefault(); // event.preventDefault();
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment