# HG changeset patch # User robcast # Date 1298038735 -3600 # Node ID ad5cc0212b663e5a1b1538753ae9ab46bbb55bc2 # Parent 63c1b33e38b1d342eb6f897876f690d4247ada8a# Parent d742bd92b05a03544c3298fccd07962c6d75647e merge with d742bd92b05a03544c3298fccd07962c6d75647e diff -r 63c1b33e38b1 -r ad5cc0212b66 client/digitallibrary/jquery/img/fullscreen/addregion.png Binary file client/digitallibrary/jquery/img/fullscreen/addregion.png has changed diff -r 63c1b33e38b1 -r ad5cc0212b66 client/digitallibrary/jquery/img/fullscreen/delregion.png Binary file client/digitallibrary/jquery/img/fullscreen/delregion.png has changed diff -r 63c1b33e38b1 -r ad5cc0212b66 client/digitallibrary/jquery/img/fullscreen/regioninfo.png Binary file client/digitallibrary/jquery/img/fullscreen/regioninfo.png has changed diff -r 63c1b33e38b1 -r ad5cc0212b66 client/digitallibrary/jquery/img/fullscreen/regions.png Binary file client/digitallibrary/jquery/img/fullscreen/regions.png has changed diff -r 63c1b33e38b1 -r ad5cc0212b66 client/digitallibrary/jquery/jquery-test-full.html --- a/client/digitallibrary/jquery/jquery-test-full.html Fri Feb 18 15:16:30 2011 +0100 +++ b/client/digitallibrary/jquery/jquery-test-full.html Fri Feb 18 15:18:55 2011 +0100 @@ -59,6 +59,7 @@ + diff -r 63c1b33e38b1 -r ad5cc0212b66 client/digitallibrary/jquery/jquery.digilib.css --- a/client/digitallibrary/jquery/jquery.digilib.css Fri Feb 18 15:16:30 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.css Fri Feb 18 15:18:55 2011 +0100 @@ -56,6 +56,11 @@ z-index: 1000; } +div.digilib div.region { + background-color: red; + opacity: 0.5; +} + /* special definitions for fullscreen */ div.digilib.dl_fullscreen div.buttons { position: fixed; diff -r 63c1b33e38b1 -r ad5cc0212b66 client/digitallibrary/jquery/jquery.digilib.js diff -r 63c1b33e38b1 -r ad5cc0212b66 client/digitallibrary/jquery/jquery.digilib.regions.js --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/client/digitallibrary/jquery/jquery.digilib.regions.js Fri Feb 18 15:18:55 2011 +0100 @@ -0,0 +1,201 @@ +/** optional digilib regions plugin + +markup a digilib image with rectangular regions + +TODO: +- store region in params/cookie, regarding zoom, mirror, rotation (like marks) +- set regions programmatically +- read regions from params/cookie and display +- backlink mechanism +- don't write to data.settings? +*/ + +(function($) { + // the data object passed by digilib + var data; + var buttons; + var fn; + var geom; + + var buttons = { + addregion : { + onclick : "setRegion", + tooltip : "set a region", + icon : "addregion.png" + }, + delregion : { + onclick : "removeRegion", + tooltip : "delete the last region", + icon : "delregion.png" + }, + regions : { + onclick : "toggleRegions", + tooltip : "show or hide regions", + icon : "regions.png" + }, + regioninfo : { + onclick : "infoRegions", + tooltip : "information about regions", + icon : "regioninfo.png" + } + }; + var regionSet = ['addregion', 'delregion', 'regions', 'regioninfo', 'lessoptions']; + + var actions = { + // define a region interactively with two clicked points + "setRegion" : function(data) { + $elem = data.$elem; + $scaler = data.$scaler; + var pt1, pt2; + var $regionDiv = $('