From: Dariusz Murakowski Date: Wed, 25 Apr 2018 20:16:49 +0000 (-0400) Subject: LANL: HIValign: set e-mail twice, focus on title field X-Git-Url: http://src.murakowski.org/?a=commitdiff_plain;h=9ac38dade6445944cab1bde3676cba05b0cca1ab;p=userscripts.git LANL: HIValign: set e-mail twice, focus on title field --- diff --git a/HIValign- automatic e-mail address.user.js b/HIValign- automatic e-mail address.user.js new file mode 100644 index 0000000..fb4b4c9 --- /dev/null +++ b/HIValign- automatic e-mail address.user.js @@ -0,0 +1,30 @@ +// ==UserScript== +// @name HIValign: automatic e-mail address +// @namespace http://tampermonkey.net/ +// @version 0.1 +// @description also focuses on "(optional) title" input field +// @author You +// @match https://www.hiv.lanl.gov/cgi-bin/VIRALIGN/viralign.cgi +// @grant none +// @run-at document-end +// ==/UserScript== + +(function() { + 'use strict'; + + function get0(s) { + var sel = document.querySelectorAll(s); + if (sel.length == 1) { + var out = sel[0]; + console.log(out); + return out; + } + } + + if (document.title == 'HIValign') { + var address = 'murakdar@mit.edu'; + get0('input[name=EMAIL]').value = address; + get0('input[name=EMAIL2]').value = address; + get0('input[name=titleFromUser]').focus(); + } +})(); \ No newline at end of file