putting the cat in the catalogue: a feline-inspired opac theme for koha

Post on 11-Jul-2015

419 Views

Category:

Software

0 Downloads

Preview:

Click to see full reader

TRANSCRIPT

PUTTING THECAT IN THECATALOGUEA FELINE-INSPIRED OPAC

THEME FOR KOHACreated by / Galen Charlton @gmcharlt

Implementation Manager at Equinox Software

PROBLEM STATEMENTCats occupy librarians' lapsBut they are not front-and-center in our catalogs.

THIS IS SAD

Sad Cat Diary by greyloch on (CC-BY-SA)Flickr

BUT WE CAN HAZ HAPPYWe can add animated cats to our catalogAnd also do something just a bit more serious... like exposing unAPI... and supporting the Let's take a look at a

Ada InitiativeKoha catalog

HOW IT'S BUILTjQueryjQuery UI

SIMPLE ANIMATION // it is proper that a cat be above it all $(cat_carrier).zIndex(1);

// actually insert into into the document...

$(this).append(cat_carrier);

// ... and start kitty on her merry way $(cat_carrier).animate({ height: 200, left: '40%', top: '40%' }, 7500);

EXPOSING UNAPI function display_unapi_widget() { // see if we can find an unapi server var servers = $(document).find('link[rel="unapi-server"]'); if (servers.length == 0) return;

// then grab the formats $.get($(servers[0]).attr('href'), function(data) { var formats = new Array; $(data).find('format').each(function() { formats.push($(this).attr('name')); });

// then make widgets $('abbr[class="unapi-id"]').each(function(index) {

NOT JUST FOR KOHA

And any catalog that lets one inject a bit of JavaScriptEvergreen too!

WHERE TO FIND IT

GPL 2+https://github.com/gmcharlt/LibraryCat

ADDING TO KOHAAdd to the opacuserjs system preference:

$(document).ready(function(){ // modern Koha already includes jQuery and jQuery UI $.getScript('/path/to/jquery.librarycat.js').done(function(){ $(document).LibraryCat({ cat_image: '/path/to/default_cat.jpg', cat_perch: '#opacmainuserblock', enable_unapi: true }); }).fail(function() { alert('No cats :('); });});

ADDING TO EVERGREENOverride the opac/parts/js.tt2 template and add:

<script src="//ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script><link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/themes/smoothness/jquery-ui.css"<script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.11.2/jquery-ui.min.js"></script><script src="http://opac.zadi.librarypolice.com/~gmc/LibraryCat/jquery.librarycat.js"></script<script type="text/javascript">

</script>

$(document).LibraryCat({ cat_image: '/path/to/default_cat.jpg', cat_perch: '#homesearch_main_logo', enable_unapi: true });

THANKS!GALEN CHARLTON

top related