LANL: increase search font size, select clade B/C with keyboard
authorDariusz Murakowski <murakdar@gmail.com>
Wed, 25 Apr 2018 20:16:36 +0000 (16:16 -0400)
committerDariusz Murakowski <murakdar@gmail.com>
Wed, 25 Apr 2018 20:16:36 +0000 (16:16 -0400)
nicer formatting for HIV LANL sequence search.user.js [new file with mode: 0644]

diff --git a/nicer formatting for HIV LANL sequence search.user.js b/nicer formatting for HIV LANL sequence search.user.js
new file mode 100644 (file)
index 0000000..53e48bd
--- /dev/null
@@ -0,0 +1,47 @@
+// ==UserScript==
+// @name         nicer formatting for HIV LANL sequence search
+// @namespace    http://tampermonkey.net/
+// @version      0.1
+// @description  expand size of "subtype" box
+// @author       You
+// @match        https://www.hiv.lanl.gov/components/sequence/HIV/search/search.html
+// @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;
+        }
+    }
+
+    var subtype_box = get0('select.si_pulldown[name=slave]');
+    subtype_box.setAttribute("size","10");  // default size=6
+
+    // https://superuser.com/questions/496212/shortcut-to-open-specific-bookmark-url-in-chrome/1313997#1313997
+    var kb = {}, option;
+    kb['B'] = "B* or Bstar";
+    kb['C'] = "C* or Cstar";
+    document.addEventListener('keyup', function(event) {
+        if (!event.ctrlKey && !event.altKey && event.shiftKey) {
+            if (option = kb[String.fromCharCode(event.keyCode)]) {
+                console.log(subtype_box);
+                subtype_box.value = option;
+            }
+        }
+    });
+
+    var region_box = get0('select.si_pulldown[name="Genomic Region"]');
+    region_box.setAttribute("size","10");  // default size=7
+
+    // click the "More sequence information" button
+//    var more = document.getElementById('extra_sequence_information_img');
+//    console.log(more);
+//    more.click();
+})();
\ No newline at end of file