Last active
February 28, 2018 22:00
-
-
Save mreidsma/4033221 to your computer and use it in GitHub Desktop.
Add link to MeLCat (consortial book-sharing service) in Summon results for books and videos
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
| $(".thumbnail").find("a").each(function(){ | |
| availabilityText = $(this).find('div.format').attr("class"); | |
| var availability = availabilityText.split(" "); | |
| if((availability[2]== "format_book_lg") || (availability[2] == "format_video_recording_lg")) { | |
| var searchTitle = $(this).closest(".document").find(".title").find("h3").text(); | |
| searchTitle = encodeURIComponent(searchTitle); | |
| $(this).closest("table").find(".metadata").find(".Availability").append('<br /><p>Not available? <a href="http://elibrary.mel.org/search/a?searchtype=t&searcharg=' + searchTitle + '&SORT=D" target="_blank">Find this at another Michigan library</a></p>'); | |
| } | |
| }); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment