# HG changeset patch # User hertzhaft # Date 1296037278 -3600 # Node ID 9a0a28c0c2812ea7d7f03b1b76fa36c8b7648bc8 # Parent 9fd58697ddc6045f6b09192cb65d8b1ccda9ba65# Parent 96a0395d6fb9c5cf663b3678836dc39ef1832c02 added missing mirror icons, enlarged some diff -r 9fd58697ddc6 -r 9a0a28c0c281 client/digitallibrary/jquery/jquery.digilib.js --- a/client/digitallibrary/jquery/jquery.digilib.js Wed Jan 26 11:20:21 2011 +0100 +++ b/client/digitallibrary/jquery/jquery.digilib.js Wed Jan 26 11:21:18 2011 +0100 @@ -191,13 +191,13 @@ //'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","options"], 'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","mark","delmark","hmir","vmir","back","fwd","page","rot","brgt","cont","rgb","quality","size","calibrationx","scale","bird","help","options"], 'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","options"], - 'customSet' : [] + 'buttonSets' : ['standardSet', 'specialSet'] }, 'embedded' : { 'imagePath' : 'img/embedded/16/', 'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","hmir","vmir","back","fwd","page","rot","brgt","cont","rgb","quality","size","scale","bird","help","options"], 'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","options"], - 'customSet' : [] + 'buttonSets' : ['standardSet', 'specialSet'] } }, // button groups @@ -265,9 +265,10 @@ $elem.data('digilib', data); } unpackParams(data); - // create HTML structure + // create HTML structure for scaler setupScalerDiv(data); - setupButtons(data, 'standardSet'); + // HTML for buttons (default is first button set) + setupButtons(data, 0); // bird's eye view creation if (elemSettings.isBirdDivVisible) { setupBirdDiv(data); @@ -671,18 +672,18 @@ }; // creates HTML structure for buttons in elem - var setupButtons = function (data, actionGroup) { + var setupButtons = function (data, buttonSetIdx) { var $elem = data.$elem; var settings = data.settings; - // if (settings.interactionMode === 'fullscreen') { var $buttonsDiv = $('
'); $elem.append($buttonsDiv); var mode = settings.interactionMode; var buttonSettings = settings.buttonSettings[mode]; - var actionNames = buttonSettings[actionGroup]; - for (var i = 0; i < actionNames.length; i++) { - var actionName = actionNames[i]; - var buttonConfig = settings.buttons[actionName]; + var buttonGroup = buttonSettings.buttonSets[buttonSetIdx]; + var buttonNames = buttonSettings[buttonGroup]; + for (var i = 0; i < buttonNames.length; i++) { + var buttonName = buttonNames[i]; + var buttonConfig = settings.buttons[buttonName]; // construct the button html var $button = $('
'); var $a = $(''); @@ -692,7 +693,7 @@ $a.append($img); // add attributes and bindings $button.attr('title', buttonConfig.tooltip); - $button.addClass('button-' + actionName); + $button.addClass('button-' + buttonName); // create handler for the buttons $a.bind('click.digilib', (function () { // we create a new closure to capture the value of action @@ -719,6 +720,12 @@ if ($buttonsDiv.height() > $(window).height() - 10) { $buttonsDiv.css('position', 'absolute'); } + if (data.$buttonSets == null) { + data.$buttonSets = [$buttonsDiv]; + data.visibleButtonSets = 1; + } else { + data.$buttonSets[buttonSetIdx] = $buttonsDiv; + } return $buttonsDiv; };