Created
July 28, 2016 14:47
-
-
Save atbradley/41c228b3fe4e13624b340f1c9f69adc2 to your computer and use it in GitHub Desktop.
Add an "Add to Course Reserves" link to Josiah (Brown University Library's discovery tool)
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name Ocrify | |
// @namespace http://library.brown.edu/ | |
// @version 0.1 | |
// @description Try to reserve an item on Josiah. | |
// @author Adam Bradley <[email protected]> | |
// @match https://search.library.brown.edu/catalog/* | |
// @grant none | |
// ==/UserScript== | |
(function() { | |
'use strict'; | |
//var url_base = "https://worfdev.services.brown.edu/ocra_dev/"; | |
var url_base = "https://library.brown.edu/ocra_dev/"; | |
var bib = /b[0-9]{7}/.exec(window.location.href); | |
var bibnum = bib[0]; | |
var url = "cr/ocrify?bibnum="+bibnum; | |
var lnk = "<a href='"+url+"'>Place this item on reserve</a>"; | |
var lilnk = '<li class="ocrify">'+lnk+'</li>'; | |
var toolbox = document.getElementsByClassName('show-tools'); | |
toolbox = toolbox[0]; | |
var toollist = toolbox.getElementsByTagName('ul')[0]; | |
toollist.innerHTML += lilnk; | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment