LANL: HIValign: set e-mail twice, focus on title field
authorDariusz Murakowski <murakdar@gmail.com>
Wed, 25 Apr 2018 20:16:49 +0000 (16:16 -0400)
committerDariusz Murakowski <murakdar@gmail.com>
Wed, 25 Apr 2018 20:16:49 +0000 (16:16 -0400)
HIValign- automatic e-mail address.user.js [new file with mode: 0644]

diff --git a/HIValign- automatic e-mail address.user.js b/HIValign- automatic e-mail address.user.js
new file mode 100644 (file)
index 0000000..fb4b4c9
--- /dev/null
@@ -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