changeset 239:264c55606a4e

new version with false setMark ;-)
author robcast
date Tue, 20 Jul 2004 20:00:27 +0200
parents 1ccda61967b2
children 23ec6d467606
files client/digitallibrary/dllib.js
diffstat 1 files changed, 24 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/client/digitallibrary/dllib.js	Tue Jul 20 15:29:25 2004 +0200
+++ b/client/digitallibrary/dllib.js	Tue Jul 20 20:00:27 2004 +0200
@@ -14,7 +14,7 @@
 along with this program; if not, write to the Free Software
 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA
  
-Authors: ROC 3.5.2004
+Authors: ROC 20.7.2004
   first version by Christian Luginbuehl, 01.05.2003
   Changed for digiLib in Zope by DW 24.03.2004
 
@@ -22,7 +22,7 @@
 
 */
 
-var dlScriptVersion = "0.9a1";
+var dlScriptVersion = "1.0b1";
 
 /*
  * more parameter handling
@@ -125,6 +125,7 @@
 function addFlag(mode) {
     // add a mode flag
     dlFlags[mode] = mode;
+    setParameter("mo", getAllFlags());
     return true;
 }
 
@@ -133,6 +134,7 @@
     if (dlFlags[mode]) {
 	delete dlFlags[mode];
     }
+    setParameter("mo", getAllFlags());
     return true;
 }
 
@@ -143,6 +145,7 @@
     } else {
 	dlFlags[mode] = mode;
     }
+    setParameter("mo", getAllFlags());
     return true;
 }
 
@@ -281,7 +284,7 @@
 }
 
 
-function setMark() {
+function setMark(reload) {
     // add a mark where clicked
     if ( dlMarks.length > 7 ) {
 	alert("Only 8 marks are possible at the moment!");
@@ -293,6 +296,11 @@
 	unregisterMouseDown(elemScaler, markEvent);
 	var p = dlTrafo.invtransform(evtPosition(evt));
 	addMark(p);
+	if (defined(reload)&&(!reload)) {
+	    // don't redisplay
+	    renderMarks();
+	    return;
+	}
 	display();
     }
 
@@ -301,6 +309,18 @@
 }
 
 
+function removeMark(reload) {
+    // remove the last mark
+    deleteMark();
+    if (defined(reload)&&(!reload)) {
+	// don't redisplay
+	renderMarks();
+	return;
+    }
+    display();
+}
+
+
 function zoomArea() {
     var click = 1;
     var pt1, pt2;
@@ -383,7 +403,7 @@
 
 function zoomBy(factor) {
     // zooms by the given factor
-    var newarea = dlArea;
+    var newarea = dlArea.copy();
     newarea.width /= factor;
     newarea.height /= factor;
     newarea.x -= 0.5 * (newarea.width - dlArea.width);
@@ -429,12 +449,6 @@
 }
 
 
-function removeMark() {
-    // remove the last mark
-    deleteMark();
-    renderMarks();
-}
-
 
 function getRef() {
     // returns a reference to the current digilib set