Top Banner
PUTTING THE CAT IN THE CATALOGUE A FELINE-INSPIRED OPAC THEME FOR KOHA Created by / Galen Charlton @gmcharlt Implementation Manager at Equinox Software
12

Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

Jul 11, 2015

Download

Software

Galen Charlton
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

PUTTING THECAT IN THECATALOGUEA FELINE-INSPIRED OPAC

THEME FOR KOHACreated by / Galen Charlton @gmcharlt

Implementation Manager at Equinox Software

Page 2: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

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

Page 3: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

THIS IS SAD

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

Page 4: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

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

Page 5: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

HOW IT'S BUILTjQueryjQuery UI

Page 6: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

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);

Page 7: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

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) {

Page 8: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

NOT JUST FOR KOHA

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

Page 9: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

WHERE TO FIND IT

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

Page 10: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

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 :('); });});

Page 11: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

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 });

Page 12: Putting the Cat in the Catalogue: A Feline-Inspired OPAC Theme For Koha

THANKS!GALEN CHARLTON