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

Shane Hathaway shane@cvs.zope.org
Mon, 12 Aug 2002 22:42:40 -0400


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

Modified Files:
	main.pt scripts.js 
Added Files:
	pagedesign.css.dtml 
Removed Files:
	pagedesign.css 
Log Message:
Now the windows are initially not visible except for a blue dashed border.
You just click to make the window appear.  You can still drag and drop without
expanding the windows, though.

Also added an option to pre-expand the windows so that older browsers can cope.


=== Added File Products/PageDesign/www/pagedesign.css.dtml ===

#design-move-box {
  border: 1px dotted black;
  position: absolute;
  display: none;
  z-index: 1000;
}

.design-element {
<dtml-if pre_expand>
  border: 1px outset darkblue;
<dtml-else>
  border: 1px dashed darkblue;
</dtml-if>
}

.design-element-titlebar {
  background-color: darkblue;
  color: #ffffff;
  font-family: sans-serif;
  text-align: left;
  border: 1px outset darkblue;
  border-spacing: 0px;
<dtml-unless pre_expand>
  display: none;
</dtml-unless>
}

.design-element-body {
<dtml-if pre_expand>
  border: 1px inset darkblue;
<dtml-else>
  border: 0px;
</dtml-if>
}

.design-target {
  border: 2px solid #eeeeee;
  background-color: #eeeeee;
}


=== Products/PageDesign/www/main.pt 1.2 => 1.3 ===
--- Products/PageDesign/www/main.pt:1.2	Mon Aug 12 10:39:29 2002
+++ Products/PageDesign/www/main.pt	Mon Aug 12 22:42:39 2002
@@ -10,7 +10,7 @@
 <table>
 
 <tr>
-<th>
+<th align="right">
 Title
 </th>
 <td>
@@ -20,12 +20,24 @@
 </tr>
 
 <tr>
-<th>
+<th align="right">
 Template ID
 </th>
 <td>
 <input type="text" name="template_id" size="30"
        tal:attributes="value here/template_id" />
+</td>
+</tr>
+
+<tr>
+<th align="right">
+Pre-expanded DHTML controls<br />
+(for older browsers)
+</th>
+<td>
+<input type="hidden" name="pre_expand:default" value="" />
+<input type="checkbox" name="pre_expand"
+       tal:attributes="checked here/pre_expand" />
 </td>
 </tr>
 


=== Products/PageDesign/www/scripts.js 1.3 => 1.4 ===
--- Products/PageDesign/www/scripts.js:1.3	Mon Aug 12 10:39:29 2002
+++ Products/PageDesign/www/scripts.js	Mon Aug 12 22:42:39 2002
@@ -1,3 +1,4 @@
+
 //
 // Copyright (c) 2002 Zope Corporation and Contributors.
 // All Rights Reserved.
@@ -20,6 +21,10 @@
 var target_normal_border = "2px solid #eeeeee";
 var target_highlighted_border = "2px dotted red"
 var target_loading_border = "2px solid green";
+var element_visible_border = "1px outset darkblue";
+var element_hidden_border = "1px dashed darkblue";
+var elementbody_visible_border = "1px inset darkblue";
+var elementbody_hidden_border = "0px";
 
 
 function hasAncestor(node, ancestor) {
@@ -132,10 +137,52 @@
 }
 
 
+function toggleElement(e, node) {
+  var i, child, parent;
+  var hide = false;
+
+  parent = node.parentNode;
+  for (i = 0; i < parent.childNodes.length; i++) {
+    child = parent.childNodes[i];
+    if (child.className == "design-element-titlebar") {
+      if (child.style.display && child.style.display != "none") {
+        hide = true;
+        child.style.display = "none";
+      }
+      else if (child.tagName == "table" || child.tagName == "TABLE") {
+        child.style.display = "table";
+      }
+      else {
+        child.style.display = "block";
+      }
+      break;
+    }
+  }
+  if (hide) {
+    parent.style.border = element_hidden_border;
+    node.style.border = elementbody_hidden_border;
+  }
+  else {
+    parent.style.border = element_visible_border;
+    node.style.border = elementbody_visible_border;
+  }
+}
+
+
 function initDesignNodes(node) {
   if (node.className == "design-element-body") {
     if (!node.onclick) {
-      node.onclick = ignore;
+      function callToggleElement(e) {
+        toggleElement(e, node);
+        return false;
+      }
+      node.onclick = callToggleElement;
+    }
+    if (!node.onmousedown) {
+      function callDragElement(e) {
+        dragElement(e, node.parentNode);
+      }
+      node.onmousedown = callDragElement;
     }
   }
   else if (node.className == "design-element-titlebar") {
@@ -175,3 +222,4 @@
   var url = design_url + '/addElementDialog?target_path=' + target_path;
   window.open(url, '', 'width=640, height=480, resizable, scrollbars, status');
 }
+

=== Removed File Products/PageDesign/www/pagedesign.css ===