changeset 661:68bf2f2953d0 jquery

mirroring works now persist bird's eye view in clop=birdview
author robcast
date Sat, 22 Jan 2011 22:03:20 +0100
parents e1103bd09f57
children 6a03dbd30e4f
files client/digitallibrary/jquery/jquery.digilib.js
diffstat 1 files changed, 31 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/jquery/jquery.digilib.js	Sat Jan 22 00:29:06 2011 +0100
+++ b/client/digitallibrary/jquery/jquery.digilib.js	Sat Jan 22 22:03:20 2011 +0100
@@ -85,12 +85,12 @@
             img : "delmark.png"
             },
         hmir : {
-            onclick : "javascript:mirror('h')",
+            onclick : ["mirror", "h"],
             tooltip : "mirror horizontally",
             img : "mirror-horizontal.png"
             },
         vmir : {
-            onclick : "javascript:mirror('v')",
+            onclick : ["mirror", "v"],
             tooltip : "mirror vertically",
             img : "mirror-vertical.png"
             },
@@ -187,7 +187,7 @@
         'buttonsImagePath' : '../greyskin/', 
         // button groups
         //'buttonsStandard' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","back","fwd","page","bird","SEP","help","reset","options"],
-        'buttonsStandard' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","mark","delmark","back","fwd","page","bird","SEP","help","reset","options"],
+        'buttonsStandard' : ["reference","zoomin","zoomout","zoomarea","zoomfull","pagewidth","mark","delmark","hmir","vmir","back","fwd","page","bird","help","options"],
         'buttonsSpecial' : ["mark","delmark","hmir","vmir","rot","brgt","cont","rgb","quality","size","calibrationx","scale","SEP","options"],
         'buttonsCustom' : [],
         // is birdView shown?
@@ -255,7 +255,7 @@
                     setupScalerDiv(data);
                     setupButtons(data, 'buttonsStandard');
                     // bird's eye view creation
-                    if (settings.isBirdDivVisible) {
+                    if (elemSettings.isBirdDivVisible) {
                         setupBirdDiv(data);
                     }
                     // about window creation - TODO: could be deferred? restrict to only one item?
@@ -355,6 +355,25 @@
             removeMark : function (data) {
                 data.marks.pop();
                 redisplay(data);
+            },
+            
+            // mirror the image
+            mirror : function (data, mode) {
+                var flags = data.scalerFlags;
+            	if (mode === 'h') {
+            	    if (flags.hmir) {
+                        delete flags.hmir;
+            	    } else {
+                        flags.hmir = 1;
+            	    }
+            	} else {
+                    if (flags.vmir) {
+                        delete flags.vmir;
+                    } else {
+                        flags.vmir = 1;
+                    }
+                }
+            	redisplay(data);
             }
 
     };
@@ -478,6 +497,10 @@
             }
         }
         data.dlOpts = opts;
+        // birdview option
+        if (opts.birdview) {
+            settings.isBirdDivVisible = 1; 
+        }
     };
 
     // put objects back into parameters
@@ -511,6 +534,10 @@
             }
             settings.mo = mo;
         }
+        // digilib option birdview
+        if (settings.isBirdDivVisible) {
+            data.dlOpts.birdview = 1;
+        }
         // digilib options
         if (data.dlOpts) {
             var clop = '';