Last active
August 29, 2015 14:27
-
-
Save kxc0re/98f5a923a971e3299b9f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name betterDBTraining | |
// @namespace kxc0re.net | |
// @author kxc0re | |
// @description Submit with Ctrl+Enter | |
// @include http://hsg2u.spdns.org:8085/dbtraining/dbtraining_pwd.jsp | |
// @version 1.11 | |
// @grant none | |
// ==/UserScript== | |
function ctrlEnter(event) { | |
if (event.which == 13 && event.ctrlKey) { | |
document.anfrageformular.getElementsByTagName('input')[1].click(); | |
} | |
} | |
function clearArea() { | |
var textArea = document.anfrageformular.getElementsByTagName('textarea')[0].innerHTML; | |
if (textArea == 'Hier kommt die Anfrage hin.') | |
document.anfrageformular.getElementsByTagName('textarea')[0].innerHTML = ''; | |
} | |
//Add EventListeners | |
document.addEventListener('keypress', ctrlEnter); | |
document.anfrageformular.addEventListener('click', clearArea); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment