# HG changeset patch # User robcast # Date 1331053094 -3600 # Node ID 8e3462a753f00bf28bd94f6e39cac0e8c4aad0fb # Parent a1bb909dfd38ef21adc4b04c5f4d779714b1acfd small clean ups. honor hasRegionContent from options. diff -r a1bb909dfd38 -r 8e3462a753f0 webapp/src/main/webapp/jquery/jquery.digilib.regions.js --- a/webapp/src/main/webapp/jquery/jquery.digilib.regions.js Sun Mar 04 18:11:39 2012 +0100 +++ b/webapp/src/main/webapp/jquery/jquery.digilib.regions.js Tue Mar 06 17:58:14 2012 +0100 @@ -1,9 +1,16 @@ /** optional digilib regions plugin -markup a digilib image with rectangular regions +Mark up a digilib image with rectangular regions. + +If hasRegionInfo=true reads regions from page HTML. +Element with regions has to be in digilib element, e.g. -TODO: - how to display regions correctly in embedded mode? +
+ MPI fuer Wissenschaftsgeschichte + Bibliotheca Hertziana + +
+ */ (function($) { @@ -43,7 +50,7 @@ // are regions shown? 'isRegionVisible' : true, // are region numbers shown? - 'showRegionNumbers' : false, + 'showRegionNumbers' : true, // is window with region HTML shown? 'showRegionInfo' : false, // is there region content in the page? @@ -51,7 +58,7 @@ // turn any region into a clickable link to its detail view 'autoRegionLinks' : false, // class name for content divs (must additionally be marked with class "keep") - 'regionContentSelector' : 'div.regioncontent', + 'regionContentSelector' : 'div.dl-regioncontent', // buttonset of this plugin 'regionSet' : ['regions', 'addregion', 'delregion', 'regionhtml', 'lessoptions'], // url param for regions @@ -278,7 +285,7 @@ if (attributes) { delete attributes.href; $regionDiv.attr(attributes); - }; + } $regionDiv.on('click.dlRegion', function() { window.location = url; }); @@ -488,7 +495,7 @@ $data.on('update', handleUpdate); var settings = data.settings; var selector = settings.regionContentSelector; - settings.hasRegionContent = $elem.has(selector).length > 0; + //settings.hasRegionContent = $elem.has(selector).length > 0; // neither URL-defined regions nor buttons when regions are predefined in HTML if (!settings.hasRegionContent) { var mode = settings.interactionMode;