changeset 676:d1605eb99d74 jquery

merge with 6c869c851c9a350b3717397879cc13b3a838d7b0
author robcast
date Tue, 25 Jan 2011 22:28:48 +0100
parents ca37fb4b1e72 (current diff) 6c869c851c9a (diff)
children 0233e39305d3
files client/digitallibrary/jquery/jquery.digilib.js
diffstat 2 files changed, 50 insertions(+), 16 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery-test-embedded.html	Tue Jan 25 22:04:27 2011 +0100
+++ b/client/digitallibrary/jquery/jquery-test-embedded.html	Tue Jan 25 22:28:48 2011 +0100
@@ -11,11 +11,16 @@
             div.digilib {
                 float: left;
                 padding: 10px;
+                width: 220px;
             }
 
-            div.scaler, div.buttons {
-                float: left;
+            div.buttons {
+                position: absolute;
+                margin-left: 184px;
+                top: 0px;
+                padding: 2px;
             }
+            
             div.button {
             }
 
@@ -23,6 +28,26 @@
                 background-color: darkred;
             }
 
+            div.birdview {
+                border: 1px solid white;
+                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>
@@ -32,7 +57,11 @@
 
         <script type="text/javascript">
             $(document).ready(function(){
-                 $('div.digilib').digilib({interactionMode : 'embedded'});
+                 $('div.digilib').digilib({
+                    interactionMode : 'embedded',
+                    birdDivWidth : 100, 
+                    birdDivHeight : 100
+                    });
 
                  $('div.digilib').each(function(){
                          console.log($(this).data('digilib').settings);
--- a/client/digitallibrary/jquery/jquery.digilib.js	Tue Jan 25 22:04:27 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Tue Jan 25 22:28:48 2011 +0100
@@ -204,7 +204,8 @@
         // is birdView shown?
         'isBirdDivVisible' : false,
         // dimensions of bird's eye div
-        'birdDivOptions' : {'dw' : 200, 'dh' : 200},
+        'birdDivWidth' : 200, 
+        'birdDivHeight' : 200,
         // style of the zoom area indicator in the bird's eye div 
         'birdIndicatorStyle' : {'border' : '2px solid #ff0000' },
         // style of zoom area "rubber band"
@@ -722,7 +723,11 @@
         var settings = data.settings;
         // use only the relevant parameters
         var keys = ['fn','pn','dw','dh'];
-        var birdSettings = $.extend({}, settings, settings.birdDivOptions);
+        var birdDivOptions = {
+            dw : settings.birdDivWidth,
+            dh : settings.birdDivHeight
+            };
+        var birdSettings = $.extend({}, settings, birdDivOptions);
         var birdUrl = settings.scalerBaseUrl + '?' + getParamString(birdSettings, keys);
         // the bird's eye div
         var $birdDiv = $('<div class="birdview" style="display:none"/>');
@@ -869,7 +874,7 @@
     };
 
     var renderBirdArea = function (data) {
-        var $ind = data.$birdDiv.find('div.birdzoom');
+        var $birdzoom = data.$birdDiv.find('div.birdzoom');
         var zoomArea = data.zoomArea;
         var indRect = data.birdTrafo.transform(zoomArea);
         var coords = {
@@ -881,24 +886,24 @@
         var normalSize = isFullArea(zoomArea);
         if (data.settings.interactionMode === 'fullscreen') {
             // no animation for fullscreen
-            if (normalSize) return $ind.hide(); 
-            $ind.width(coords.width);
-            $ind.height(coords.height);
-            $ind.offset(coords);
-            $ind.show();
+            if (normalSize) return $birdzoom.hide(); 
+            $birdzoom.width(coords.width);
+            $birdzoom.height(coords.height);
+            $birdzoom.offset(coords);
+            $birdzoom.show();
             return;
             };
         // nice animation for embedded mode :-)
-        var makeCompleteFunction = function($ind, normalSize) {
+        var makeCompleteFunction = function($birdzoom, normalSize) {
             return function() { 
-                if (normalSize) $ind.hide(); 
+                if (normalSize) $birdzoom.hide(); 
                 };
             };
         var opts = {
-            'complete' : makeCompleteFunction($ind, normalSize)
+            'complete' : makeCompleteFunction($birdzoom, normalSize)
             };
-        if (!normalSize && $ind.css('display') === 'none') $ind.show();
-        $ind.animate(coords, opts);
+        if (!normalSize && $birdzoom.css('display') === 'none') $birdzoom.show();
+        $birdzoom.animate(coords, opts);
     };
 
     // zooms by the given factor