From a75d272869362767c8c0c7489ece53c98ed8815d Mon Sep 17 00:00:00 2001 From: Dariusz Murakowski Date: Thu, 17 Jan 2019 14:58:19 -0500 Subject: [PATCH] Rename and depersonalize LANL HIV scripts --- HIValign- automatic e-mail address.user.js | 32 -------------- ...rd shortcut to improve download options.user.js | 47 +++++++++++++++++++++ LANL HIV search- set e-mail field.user.js | 30 +++++++++++++ LANL HIV sequence search- nicer formatting.user.js | 49 ++++++++++++++++++++++ LANL HIValign- automatic e-mail address.user.js | 32 ++++++++++++++ ...formatting for HIV LANL sequence search.user.js | 49 ---------------------- ...esults page to improve download options.user.js | 47 --------------------- ...e-mail field to HIVfasta@mailinator.com.user.js | 30 ------------- 8 files changed, 158 insertions(+), 158 deletions(-) delete mode 100644 HIValign- automatic e-mail address.user.js create mode 100644 LANL HIV results page- set alt+S keyboard shortcut to improve download options.user.js create mode 100644 LANL HIV search- set e-mail field.user.js create mode 100644 LANL HIV sequence search- nicer formatting.user.js create mode 100644 LANL HIValign- automatic e-mail address.user.js delete mode 100644 nicer formatting for HIV LANL sequence search.user.js delete mode 100644 set alt+S keyboard shortcut on HIV LANL results page to improve download options.user.js delete mode 100644 set e-mail field to HIVfasta@mailinator.com.user.js diff --git a/HIValign- automatic e-mail address.user.js b/HIValign- automatic e-mail address.user.js deleted file mode 100644 index 9a5f2e7..0000000 --- a/HIValign- automatic e-mail address.user.js +++ /dev/null @@ -1,32 +0,0 @@ -// ==UserScript== -// @name HIValign: automatic e-mail address -// @namespace http://dariusz.murakowski.org -// @version 0.1 -// @description also focuses on "(optional) title" input field -// @author Dariusz Murakowski -// @copyright 2018+, Dariusz Murakowski -// @license AGPL-3.0-or-later -// @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(); - } -})(); diff --git a/LANL HIV results page- set alt+S keyboard shortcut to improve download options.user.js b/LANL HIV results page- set alt+S keyboard shortcut to improve download options.user.js new file mode 100644 index 0000000..704894d --- /dev/null +++ b/LANL HIV results page- set alt+S keyboard shortcut to improve download options.user.js @@ -0,0 +1,47 @@ +// ==UserScript== +// @name LANL HIV results page: set alt+S keyboard shortcut to improve download options +// @namespace http://dariusz.murakowski.org +// @version 0.2 +// @description add alt+S shortcut to include HXB2 seq and label with accession code and patient ID +// @author Dariusz Murakowski +// @copyright 2018+, Dariusz Murakowski +// @license AGPL-3.0-or-later +// @match https://www.hiv.lanl.gov/components/sequence/HIV/search/search.comp +// @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; + } + } + + function doStuff() { + // onclick="showElt('both'); hideElt('tree'); hideElt('down'); showElt('save')" + get0('input[value="Download Sequences"]').click(); + + // simulate clicking the "compose a label" link + Changesaveoutput();showElt('compose'); + + // set options + get0('input[name=INCLUDE_HXB2]').checked = true; + get0('input[name=comp_sa_genbankaccession]').value = 5; + get0('input[name=comp_ssam_pat_id]').value = 6; + } + + // https://superuser.com/questions/496212/shortcut-to-open-specific-bookmark-url-in-chrome/1313997#1313997 + document.addEventListener('keyup', function(event) { + if (!event.ctrlKey && event.altKey && !event.shiftKey) { + if ('S' == String.fromCharCode(event.keyCode)) { + doStuff(); + } + } + }); +})(); diff --git a/LANL HIV search- set e-mail field.user.js b/LANL HIV search- set e-mail field.user.js new file mode 100644 index 0000000..ad7cd49 --- /dev/null +++ b/LANL HIV search- set e-mail field.user.js @@ -0,0 +1,30 @@ +// ==UserScript== +// @name LANL HIV search: set e-mail field +// @namespace http://dariusz.murakowski.org +// @version 0.2 +// @description only sets e-mail field when title matches "Mail-back submission form " +// @author Dariusz Murakowski +// @copyright 2018+, Dariusz Murakowski +// @license AGPL-3.0-or-later +// @match https://www.hiv.lanl.gov/components/sequence/HIV/search/search.comp +// @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.startsWith('Mail-back submission form ')) { + get0('input[name=email]').value = 'you@EDIT_ME_BEFORE_USE@example.com'; + get0('input[name=job_title]').focus(); + } +})(); diff --git a/LANL HIV sequence search- nicer formatting.user.js b/LANL HIV sequence search- nicer formatting.user.js new file mode 100644 index 0000000..9388d55 --- /dev/null +++ b/LANL HIV sequence search- nicer formatting.user.js @@ -0,0 +1,49 @@ +// ==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(); +})(); diff --git a/LANL HIValign- automatic e-mail address.user.js b/LANL HIValign- automatic e-mail address.user.js new file mode 100644 index 0000000..5e61097 --- /dev/null +++ b/LANL HIValign- automatic e-mail address.user.js @@ -0,0 +1,32 @@ +// ==UserScript== +// @name LANL HIValign: automatic e-mail address +// @namespace http://dariusz.murakowski.org +// @version 0.2 +// @description also focuses on "(optional) title" input field +// @author Dariusz Murakowski +// @copyright 2018+, Dariusz Murakowski +// @license AGPL-3.0-or-later +// @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 = 'you@EDIT_ME_BEFORE_USE@example.com'; + get0('input[name=EMAIL]').value = address; + get0('input[name=EMAIL2]').value = address; + get0('input[name=titleFromUser]').focus(); + } +})(); diff --git a/nicer formatting for HIV LANL sequence search.user.js b/nicer formatting for HIV LANL sequence search.user.js deleted file mode 100644 index 8648695..0000000 --- a/nicer formatting for HIV LANL sequence search.user.js +++ /dev/null @@ -1,49 +0,0 @@ -// ==UserScript== -// @name nicer formatting for HIV LANL sequence search -// @namespace http://dariusz.murakowski.org -// @version 0.1 -// @description expand size of "subtype" box -// @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(); -})(); diff --git a/set alt+S keyboard shortcut on HIV LANL results page to improve download options.user.js b/set alt+S keyboard shortcut on HIV LANL results page to improve download options.user.js deleted file mode 100644 index ab44451..0000000 --- a/set alt+S keyboard shortcut on HIV LANL results page to improve download options.user.js +++ /dev/null @@ -1,47 +0,0 @@ -// ==UserScript== -// @name set alt+S keyboard shortcut on HIV LANL results page to improve download options -// @namespace http://dariusz.murakowski.org -// @version 0.1 -// @description add alt+S shortcut to include HXB2 seq and label with accession code and patient ID -// @author Dariusz Murakowski -// @copyright 2018+, Dariusz Murakowski -// @license AGPL-3.0-or-later -// @match https://www.hiv.lanl.gov/components/sequence/HIV/search/search.comp -// @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; - } - } - - function doStuff() { - // onclick="showElt('both'); hideElt('tree'); hideElt('down'); showElt('save')" - get0('input[value="Download Sequences"]').click(); - - // simulate clicking the "compose a label" link - Changesaveoutput();showElt('compose'); - - // set options - get0('input[name=INCLUDE_HXB2]').checked = true; - get0('input[name=comp_sa_genbankaccession]').value = 5; - get0('input[name=comp_ssam_pat_id]').value = 6; - } - - // https://superuser.com/questions/496212/shortcut-to-open-specific-bookmark-url-in-chrome/1313997#1313997 - document.addEventListener('keyup', function(event) { - if (!event.ctrlKey && event.altKey && !event.shiftKey) { - if ('S' == String.fromCharCode(event.keyCode)) { - doStuff(); - } - } - }); -})(); diff --git a/set e-mail field to HIVfasta@mailinator.com.user.js b/set e-mail field to HIVfasta@mailinator.com.user.js deleted file mode 100644 index 37d15de..0000000 --- a/set e-mail field to HIVfasta@mailinator.com.user.js +++ /dev/null @@ -1,30 +0,0 @@ -// ==UserScript== -// @name set e-mail field to HIVfasta@mailinator.com -// @namespace http://dariusz.murakowski.org -// @version 0.1 -// @description only sets e-mail field when title matches "Mail-back submission form " -// @author Dariusz Murakowski -// @copyright 2018+, Dariusz Murakowski -// @license AGPL-3.0-or-later -// @match https://www.hiv.lanl.gov/components/sequence/HIV/search/search.comp -// @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.startsWith('Mail-back submission form ')) { - get0('input[name=email]').value = 'HIVfasta@mailinator.com'; - get0('input[name=job_title]').focus(); - } -})(); -- 2.7.4