changeset 699:09f61af0a6dd jquery

re-created toggle for morebuttons (more = null)
author robcast
date Thu, 27 Jan 2011 17:29:41 +0100
parents 215ef40435c8
children df8017bb4708
files client/digitallibrary/jquery/jquery-test-full-rc.html client/digitallibrary/jquery/jquery.digilib.js
diffstat 2 files changed, 119 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/client/digitallibrary/jquery/jquery-test-full-rc.html	Thu Jan 27 17:29:41 2011 +0100
@@ -0,0 +1,101 @@
+<?xml version="1.0" ?>
+<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
+<html xmlns="http://www.w3.org/1999/xhtml">
+    <head>
+        <title>Digilib jQuery Test: fullscreen</title>
+
+        <style type="text/css">
+            body {
+                 background: silver;
+            }
+
+            div.digilib {
+                float: left;
+                padding: 10px;
+            }
+
+            div.buttons {
+                position: fixed;
+                right: 5px;
+                top: 5px;
+                padding: 3px;
+                background-color: silver;
+            }
+
+            img.button:hover {
+                background-image: url('../greyskin/corona.png');
+            }
+
+            div.digilib div.mark {
+              position: absolute;
+              color: white;
+              background: url('../greyskin/mark-bg-16.png');
+              font-family: Verdana, Arial, Helvetica, sans-serif;
+              font-weight: bold;
+              font-size:11px;
+              height: 15px;
+              width: 16px;
+              padding-top: 1px;
+              text-align: center;
+              z-index: 10;
+            }
+
+            div.digilib div.zoomrect {
+              position: absolute;
+              /* border: 2px solid #ffa060; */
+              border: 2px solid #ff0000;
+              z-index: 200;
+              }
+
+            div.birdview {
+                border: 1px solid white;
+                position: fixed;
+                bottom: 8px;
+                right:  48px;
+                display: none;
+                z-index: 1;
+                }
+
+            div.about {
+                position: absolute;
+                width: 200px;
+                top: 100px;
+                left: 350px;
+                height: 200px;
+                padding: 0px 2px;
+                font-family: Verdana, Arial, Helvetica, sans-serif;
+                border: 2px solid lightcyan;
+                background-color: lightgrey;
+                text-align: center;
+                display: none;
+                z-index: 1000;
+                }
+
+        </style>
+
+        <script type="text/javascript" src="jquery-1.4.4.js"></script>
+        <script type="text/javascript" src="dlGeometry.js"></script>
+        <script type="text/javascript" src="jquery.cookie.js"></script>
+        <script type="text/javascript" src="jquery.digilib.js"></script>
+
+
+        <script type="text/javascript">
+            $(document).ready(function(){
+                var opts = {
+                    interactionMode : 'fullscreen',
+                    scalerBaseUrl : 'http://localhost:18080/digitallibrary/servlet/Scaler'
+                    };
+                 $('div.digilib').digilib(opts);
+            });
+
+        </script>
+    </head>
+
+    <body>
+
+        <div id="digilib-1" class="digilib single">
+            <img src="http://digilib.biblhertz.it/digilib04/servlet/Scaler?dw=200&amp;dh=200&amp;fn=/digisprint/jquery/FransHals-WillemVanHeythuysen" />
+        </div>
+    </body>
+</html>
+
--- a/client/digitallibrary/jquery/jquery.digilib.js	Thu Jan 27 16:59:10 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Thu Jan 27 17:29:41 2011 +0100
@@ -135,6 +135,11 @@
             tooltip : "change image scale",
             img : "original-size.png"
             },
+        toggleoptions : {
+            onclick : "morebuttons",
+            tooltip : "more options",
+            img : "options.png"
+            },
         moreoptions : {
             onclick : ["morebuttons", "+1"],
             tooltip : "more options",
@@ -194,14 +199,14 @@
             'fullscreen' : {
                 // path to button images (must end with a slash)
                 'imagePath' : 'img/fullscreen/',
-                'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","moreoptions"],
-                'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","lessoptions"],
+                'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","toggleoptions"],
+                'specialSet' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","toggleoptions"],
                 'buttonSets' : ['standardSet', 'specialSet']
                 },
             'embedded' : {
                 'imagePath' : 'img/embedded/16/',
-                'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","back","fwd","page","bird","SEP","help","reset","moreoptions"],
-                'specialSet' : ["hmir","vmir","rot","brgt","cont","rgb","quality","size","SEP","lessoptions"],
+                'standardSet' : ["reference","zoomin","zoomout","zoomarea","zoomfull","back","fwd","page","bird","SEP","help","reset","toggleoptions"],
+                'specialSet' : ["hmir","vmir","rot","brgt","cont","rgb","quality","size","SEP","toggleoptions"],
                 'buttonSets' : ['standardSet', 'specialSet']
                 }
         },
@@ -435,6 +440,15 @@
         // display more (or less) button sets
         morebuttons : function (data, more) {
             var settings = data.settings;
+            if (more == null) {
+                // toggle more or less
+                var maxbtns = settings.buttonSettings[settings.interactionMode].buttonSets.length;
+                if (settings.visibleButtonSets >= maxbtns) {
+                    more = '-1';
+                } else {
+                    more = '+1';
+                }
+            }
             if (more === '-1') {
                 // remove set
                 var setIdx = settings.visibleButtonSets - 1;