changeset 514:e91d6050f27d

zoom and pan marks in red prettier js
author robcast
date Thu, 03 Sep 2009 15:39:18 +0200
parents a53693fd7a17
children cc1bdbe30684
files client/digitallibrary/greyskin/diginew.css client/digitallibrary/greyskin/diginew.jsp client/digitallibrary/greyskin/dllib.js
diffstat 3 files changed, 27 insertions(+), 24 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/greyskin/diginew.css	Thu Sep 03 13:10:00 2009 +0200
+++ b/client/digitallibrary/greyskin/diginew.css	Thu Sep 03 15:39:18 2009 +0200
@@ -25,7 +25,7 @@
 	display: block;
 	position: absolute;
 	border: none;
-	z-index: 150;
+	z-index: 50;
 	background-repeat: no-repeat;
 	background-position: center;
 	}
@@ -62,7 +62,7 @@
 	
 img#bird-image {
 	border: none;
-	position: absolute;
+	position: fixed;
 	bottom: 10px;
 	right:  10px;
 	visibility: hidden;
@@ -105,9 +105,9 @@
 	}
 
 div#overlay {
-	position: absolute;
+	position: fixed;
 	background-color: transparent;
-	border: 1px dotted lightcyan;
+	border: 1px solid lightgrey;
 	z-index: 100;
 	visibility: hidden;
 	/* box-sizing: border-box;
@@ -135,7 +135,8 @@
 
 div#zoom {
 	position: absolute;
-	border: 2px solid #ffa060;
+	/* border: 2px solid #ffa060; */
+	border: 2px solid #ff0000;
 	visibility: hidden;
 	z-index: 200;
 	/* box-sizing: border-box;
@@ -143,8 +144,9 @@
 	}
 
 div#bird-area {
-	position: absolute;
-	border: 2px solid #ffa060;
+	position: fixed;
+	/* border: 2px solid #ffa060; */
+	border: 2px solid #ff0000;
 	visibility: hidden;
 	background-color: transparent;
 	/* box-sizing: border-box;
--- a/client/digitallibrary/greyskin/diginew.jsp	Thu Sep 03 13:10:00 2009 +0200
+++ b/client/digitallibrary/greyskin/diginew.jsp	Thu Sep 03 15:39:18 2009 +0200
@@ -34,9 +34,9 @@
 	
 	<link rel="stylesheet" type="text/css" href="diginew.css" />
 	
-	<script type="text/javascript" src="fixed.js"></script>
+<!-- <script type="text/javascript" src="fixed.js"></script> -->
 
-	<script type="text/javascript" src="debug.js"></script>
+<!-- <script type="text/javascript" src="debug.js"></script> -->
 
 	<script type="text/javascript" src="baselib.js"></script>
 	
@@ -44,7 +44,7 @@
 
 	<script language="JavaScript">
 
-	var jspVersion = "diginew.jsp 1.020";
+	var jspVersion = "diginew.jsp 1.021";
 	var cookie = new Cookie();
 	// alert(strObject(cookie));
 
--- a/client/digitallibrary/greyskin/dllib.js	Thu Sep 03 13:10:00 2009 +0200
+++ b/client/digitallibrary/greyskin/dllib.js	Thu Sep 03 15:39:18 2009 +0200
@@ -399,11 +399,12 @@
     // add a mark where clicked
     window.focus();
     this.moveCenter(false);
+    
     // start event capturing
     registerEvent("mousedown", this.scalerDiv, markEvent);
 
-	// our own reference to this for the local function
-	var digilib = this;
+    // our own reference to this for the local function
+    var digilib = this;
 	
     function markEvent(evt) {
     // event handler adding a new mark
@@ -437,14 +438,14 @@
     registerEvent("mousedown", this.scalerImg, zoomStart);
     window.focus();
 
-	// our own reference to "this" for the local functions
-	var _this = this;
+    // our own reference to "this" for the local functions
+    var digilib = this;
 	
-	// mousedown handler: start moving
+    // mousedown handler: start moving
     function zoomStart(evt) {
         pt1 = evtPosition(evt);
         unregisterEvent("mousedown", overlay, zoomStart);
-        unregisterEvent("mousedown", _this.scalerImg, zoomStart);
+        unregisterEvent("mousedown", digilib.scalerImg, zoomStart);
         // setup and show zoom div
         moveElement(zoomdiv, Rectangle(pt1.x, pt1.y, 0, 0));
         showElement(zoomdiv, true);
@@ -454,30 +455,30 @@
         return stopEvent(evt);
     }
     
-	// mouseup handler: end moving
+    // mouseup handler: end moving
     function zoomEnd(evt) {
         pt2 = evtPosition(evt);
         // assume a click if the area is too small (up to 3 x 3 pixel)
         var clickRect = new Rectangle(pt1, pt2);
         clickRect.normalize();
-        if (clickRect.getArea() <= _this.MIN_AREA_SIZE) return stopEvent(evt);
+        if (clickRect.getArea() <= digilib.MIN_AREA_SIZE) return stopEvent(evt);
         // hide zoom div
         showElement(zoomdiv, false);
         showElement(overlay, false);
         // unregister events
         unregisterEvent("mousemove", document, zoomMove);
-        unregisterEvent("mouseup", document, zoomMove);
+        unregisterEvent("mouseup", document, zoomEnd);
         // clip and transform
         clickRect.clipTo(picRect);
-        var area = _this.trafo.invtransform(clickRect);
-        _this.setParamFromArea(area);
+        var area = digilib.trafo.invtransform(clickRect);
+        digilib.setParamFromArea(area);
         // zoomed is always fit
-        _this.params.set("ws", 1);
-        _this.display();
+        digilib.params.set("ws", 1);
+        digilib.display();
         return stopEvent(evt);
     }
     
-	// mouse move handler
+    // mouse move handler
     function zoomMove(evt) {
         pt2 = evtPosition(evt);
         var rect = new Rectangle(pt1, pt2);