User:Kaster/shortcuts.js

var sw = 0; // ************************* function Slusaj (Ereignis) { var alt = Ereignis.which; if (alt==18) { sw = 1000; } } function Taster (Event) { var key = Event.which; if (sw==1000) { if (key == 101) { var button = document.getElementById('killerButton'); if (button) { // Shortcut (ALT + E) za izazivanje onclick-a na elementu sa id 'killerButton' button.onclick; } else { // alert('No button \'killerButton\' found'); }    }     sw = 0; } } var editField = document.getElementById('wpTextbox1'); if (editField) { editField.onkeydown = Slusaj; editField.onkeypress = Taster; } else { // alert('No element \'wpTextbox1\' found'); }