[Zope-CVS] CVS: Products/PageDesign/www - main.pt:1.4 pagedesign.css.dtml:1.3 scripts.js:1.6

Shane Hathaway shane@cvs.zope.org
Thu, 15 Aug 2002 23:35:07 -0400


Update of /cvs-repository/Products/PageDesign/www
In directory cvs.zope.org:/tmp/cvs-serv5111/www

Modified Files:
	main.pt pagedesign.css.dtml scripts.js 
Log Message:
Look ma, no frames! ;-)


=== Products/PageDesign/www/main.pt 1.3 => 1.4 ===
--- Products/PageDesign/www/main.pt:1.3	Mon Aug 12 22:42:39 2002
+++ Products/PageDesign/www/main.pt	Thu Aug 15 23:35:06 2002
@@ -2,9 +2,9 @@
 <h2 tal:define="manage_tabs_message options/manage_tabs_message | nothing"
     tal:replace="structure here/manage_tabs">Tabs</h2>
 
-<p>
+<!--p>
 <a href="designFrames" target="design">Edit!</a>
-</p>
+</p-->
 
 <form action="manage_changeProperties" method="POST">
 <table>


=== Products/PageDesign/www/pagedesign.css.dtml 1.2 => 1.3 ===
--- Products/PageDesign/www/pagedesign.css.dtml:1.2	Tue Aug 13 14:01:02 2002
+++ Products/PageDesign/www/pagedesign.css.dtml	Thu Aug 15 23:35:06 2002
@@ -43,3 +43,12 @@
   border: 2px solid #eeeeee;
   background-color: #eeeeee;
 }
+
+.design-controls {
+  position: fixed;
+  bottom: 10px;
+  left: 10px;
+  background-color: lightblue;
+  border: 3px outset lightblue;
+  text-align: center;
+}


=== Products/PageDesign/www/scripts.js 1.5 => 1.6 ===
--- Products/PageDesign/www/scripts.js:1.5	Tue Aug 13 14:01:02 2002
+++ Products/PageDesign/www/scripts.js	Thu Aug 15 23:35:06 2002
@@ -43,6 +43,36 @@
 }
 
 
+function controls_drag(node, e) {
+  if (!e)
+    e = event;
+  var dx = parseInt(node.style.left || '0') - e.screenX;
+  var start_y = e.screenY;
+  var node_bottom = parseInt(node.style.bottom || '0');
+
+  function drag(e) {
+    if (!e)
+      e = event;
+    node.style.left = e.screenX + dx;
+    node.style.bottom = start_y - e.screenY + node_bottom;
+  }
+
+  function finish(e) {
+    document.onmousemove = null;
+    document.onmouseup = null;
+    document.onselectstart = null;
+    // Store the new position on the server somehow.
+  }
+
+  document.onmousemove = drag;
+  document.onmouseup = finish;
+  document.onselectstart = ignore;
+
+  if (e.preventDefault)
+    e.preventDefault();  // Mozilla / NS 6: Don't start a selection.
+}
+
+
 function DesignTarget_unhighlight() {
   if (highlighted_target) {
     highlighted_target.style.border = target_normal_border;
@@ -240,6 +270,14 @@
     }
     else {
       all_targets = all_targets.concat([node]);  // IE 5.1
+    }
+  }
+  else if (node.className == "design-controls") {
+    if (!node.onmousedown) {
+      function call_controls_drag(e) {
+        controls_drag(node, e);
+      }
+      node.onmousedown = call_controls_drag;
     }
   }