changeset 684:9a0a28c0c281 jquery

added missing mirror icons, enlarged some
author hertzhaft
date Wed, 26 Jan 2011 11:21:18 +0100
parents 9fd58697ddc6 (current diff) 96a0395d6fb9 (diff)
children 6ec8c8ae02c7
files
diffstat 1 files changed, 18 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- 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 = $('<div class="buttons"></div>');
         $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 = $('<div class="button"></div>');
             var $a = $('<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;
     };