From: Dariusz Murakowski Date: Wed, 25 Apr 2018 20:16:36 +0000 (-0400) Subject: LANL: increase search font size, select clade B/C with keyboard X-Git-Url: http://src.murakowski.org/?a=commitdiff_plain;h=b06ce2c73cf6e2759c038090c8344accc33af7f4;p=userscripts.git LANL: increase search font size, select clade B/C with keyboard --- 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 index 0000000..53e48bd --- /dev/null +++ b/nicer formatting for HIV LANL sequence search.user.js @@ -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