Commit 7026934b authored by mercury233's avatar mercury233

Merge branch 'patch-konami-code' into 'v3'

add konami code to open devtools

See merge request mycard/mycard!15
parents 4e052d45 d1cb8680
......@@ -8,6 +8,7 @@ import { SettingsService } from './settings.sevices';
window['Tether'] = Tether;
const autoUpdater: Electron.AutoUpdater = remote.getGlobal('autoUpdater');
const konami_code_logger: string[] = [];
@Component({
moduleId: module.id,
......@@ -48,6 +49,22 @@ export class MyCardComponent implements OnInit {
'update-available': this.update_available,
'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)=>{
// console.log('drop', event);
// 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