+// ==UserScript==
+// @name LANL HIV sequence search: nicer formatting
+// @namespace http://dariusz.murakowski.org
+// @version 0.2
+// @description expand size of "subtype" box; add B and C keyboard shortcuts to select those clades
+// @author Dariusz Murakowski
+// @copyright 2018+, Dariusz Murakowski
+// @license AGPL-3.0-or-later
+// @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();
+})();