# HG changeset patch # User robcast # Date 1296487471 -3600 # Node ID 123706249227a635601cfb563b93c9c29fcce2e6 # Parent 3da6db751448343fe8afc23af23e09d801072798 improved bird image handling. still some issues with bird image position in embedded mode. diff -r 3da6db751448 -r 123706249227 client/digitallibrary/jquery/jquery-test-full-rc.html --- a/client/digitallibrary/jquery/jquery-test-full-rc.html Mon Jan 31 10:05:49 2011 +0100 +++ b/client/digitallibrary/jquery/jquery-test-full-rc.html Mon Jan 31 16:24:31 2011 +0100 @@ -51,7 +51,6 @@ position: fixed; bottom: 8px; right: 48px; - display: none; z-index: 1; } @@ -69,8 +68,8 @@ display: none; z-index: 1000; } - - div.bgDrag { + + div.scaler { background-color: grey; z-index: 0; } diff -r 3da6db751448 -r 123706249227 client/digitallibrary/jquery/jquery.digilib.js --- a/client/digitallibrary/jquery/jquery.digilib.js Mon Jan 31 10:05:49 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Mon Jan 31 16:24:31 2011 +0100 @@ -309,6 +309,7 @@ // bird's eye view creation if (elemSettings.isBirdDivVisible) { setupBirdDiv(data); + data.$birdDiv.show(); } // about window creation - TODO: could be deferred? restrict to only one item? setupAboutDiv(data); @@ -339,7 +340,8 @@ setupBirdDiv(data); } data.settings.isBirdDivVisible = showDiv(data.settings.isBirdDivVisible, data.$birdDiv, show); - data.$birdImg.triggerHandler('load'); + storeOptions(data); + // data.$birdImg.triggerHandler('load'); // TODO: we shouldn't do that }, // goto given page nr (+/-: relative) @@ -489,6 +491,8 @@ settings.visibleButtonSets++; } } + // persist setting + storeOptions(data); }, // reset image parameters to defaults @@ -658,7 +662,7 @@ } } data.scalerFlags = flags; - retrieveOptionsCookie(data); + retrieveOptions(data); }; // put objects back into parameters @@ -694,10 +698,10 @@ settings.mo = mo; } // user interface options - storeOptionsCookie(data); + storeOptions(data); }; - var storeOptionsCookie = function (data) { + var storeOptions = function (data) { // save digilib options in cookie // TODO: in embedded mode this is not called /* store in parameter clop @@ -731,7 +735,7 @@ } }; - var retrieveOptionsCookie = function (data) { + var retrieveOptions = function (data) { // clop (digilib options) var opts = {}; var settings = data.settings; @@ -788,7 +792,7 @@ $imgRect = geom.rectangle(data.$img); $imgRect.adjustDiv(data.$scaler); // load new bird img (in case the scalerUrl has changed, like in gotopage) - showBirdDiv(data); + //showBirdDiv(data); //TODO: change url explicitly } }; @@ -913,48 +917,56 @@ return $buttonsDiv; }; + // returns URL for bird's eye view image + var getBirdImgUrl = function (data) { + var settings = data.settings; + var birdDivOptions = { + dw : settings.birdDivWidth, + dh : settings.birdDivHeight + }; + var birdSettings = $.extend({}, settings, birdDivOptions); + // use only the relevant parameters + var birdUrl = settings.scalerBaseUrl + '?' + + getParamString(birdSettings, settings.birdDivParams); + return birdUrl; + }; + // creates HTML structure for the bird's eye view in elem var setupBirdDiv = function (data) { var $elem = data.$elem; // the bird's eye div var $birdDiv = $('