Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Customizing Hosted Library Services with jQuery

Customizing Hosted Library Services with jQuery

JavaScript can help us make changes to vendor tools that might otherwise be impossible. In this hands-on talk, I will walk through using JavaScript and jQuery to modify Serial Solutions’ 360Link link resolver.

Presented at Code4Lib Midwest, 2011, University of Illinois Chicago.

Matthew Reidsma

July 28, 2011
Tweet

More Decks by Matthew Reidsma

Other Decks in Design

Transcript

  1. STYLESHEETS & STYLESHEETS & STYLESHEETS, OH MY! $(“head link”).remove(); $(“head

    style”).remove(); THUS: $(“head”).append(“<link [...] >”);
  2. CITATION TABLE <table id=”CandyWrapper”> [...] <table class=”SS_CitationTable”> [...] <td id=”CitationJournalTitleValue”>

    <div>Vital Speeches of the Day</div> [...] </table> </table> <a class=”link” href=”[...]”>Refworks</a> [...]
  3. $(“table#CandyWrapper table.SS_Citation”).replaceWith(‘ <div id=”citation”> <span id=”author”>’ + authorName + ‘</span>.

    <span id=”date”>(’ + articleDate + ‘)</span>. <cite id=”article”>’ + articleTitle + ‘</cite>. <span id=”journal”><i>’ + journalTitle + ‘</i></span>. <span id=”volume”>’ + journalVol + ‘</span> <span id=”issue”>(’ + journalIssue + ‘)</span>, <span id=”pages”>p. ‘ + pages + ‘.</span> <a href=”’ + refWorksURL + ‘“>RefWorks</a> </div> ‘); Smith, Joe. (2010). My awesome article. My awesome journal. 1(1), 10-23. THUS:
  4. var metaData = $(“td.description_col2”).text(); var hasMovie = “Moving Image”; if(metaData.indexOf(hasMovie)

    != -1) { $(“#tabs”).prepend(‘ <video controls> <source src=”[...]” type=”video/ogg”> <source src=”[...]” type=”video/mp4”> [...] </video> ‘); }
  5. <div> <img src=”[...]” alt=”Slide One” class=”splash-image” /> <p>Lorem ipsum dolem

    [...] </p> </div> SILDES.HTML: INDEX.HTML: <div class=”slidewrap”> <ul class=”slider”> <li class=”slide”><a href=”[...]”><img src=”[...] alt=”[...]” /></a></li> <li class=”slide”><a href=”[...]”><img src=”[...] alt=”[...]” /></a></li> <li class=”slide”><a href=”[...]”><img src=”[...] alt=”[...]” /></a></li> [...] <!-- etc. --> </ul> </div>