Skip to content

Instantly share code, notes, and snippets.

@mreidsma
Created February 27, 2014 18:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mreidsma/9256242 to your computer and use it in GitHub Desktop.
Save mreidsma/9256242 to your computer and use it in GitHub Desktop.
Add extra Peer-review facet to Content Type box in Summon

Add Extra Peer-review Facet to Content Type Box in Summon

We get a lot of folks who can't see the first set of limiters in Summon (1.0 OR 2.0). A large group of folks scroll right to "Content Type" and start looking for peer-review filters. (They aren't there.) Today in a usability test, we saw all of our testees do this in Summon 2.0. One of our librarians thought we should just add a Peer-review facet to the Content Type section, so that's what this does.

Caveats

  • It doesn't give the nice "updating" screen while it reloads
  • I haven't tested it like crazy so it might not save all limiters in all situations
  • This is a rough draft. I'll probably work on a fancier version soon.
  • This version works in Summon 1.0 only.
// Add the link
$('div[label="Content Type"]').find('table.xbody tbody.facets').prepend('<tr><td class="input"><input type="checkbox" id="pr" applied="true" value="' + window.location.search + '&s.fvf%5B%5D=IsScholarly,true,f" data-filtertype="s.fvf[]" data-field="IsScholarly" data-value="true"></td><td class="facetLabel"><label for="pr">Peer-reviewed Articles</label></td></tr>');
// Set a click handler for it
$("#pr").change(function() {
return window.location.href = $(this).val();
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment