[Zope-CVS] CVS: Products/CompositePage/zmi - bottom.pt:1.2
zmi_edit.js:1.3
Shane Hathaway
shane at zope.com
Sat Dec 27 13:40:22 EST 2003
Update of /cvs-repository/Products/CompositePage/zmi
In directory cvs.zope.org:/tmp/cvs-serv4578/zmi
Modified Files:
bottom.pt zmi_edit.js
Log Message:
Added a header to the context menus and began work on inline views.
=== Products/CompositePage/zmi/bottom.pt 1.1 => 1.2 ===
--- Products/CompositePage/zmi/bottom.pt:1.1 Fri Sep 26 17:21:07 2003
+++ Products/CompositePage/zmi/bottom.pt Sat Dec 27 13:40:21 2003
@@ -1,9 +1,14 @@
<!-- zmi/bottom.pt -->
<div id="slot-element-context-menu" class="context-menu">
+<div class="context-menu-header"
+ filter="zmi_prepare_element_menu(pd_filter_object)"></div>
<div class="context-menu-item"
onmouseup="zmi_edit(pd_selected_item)"
filter="pd_selected_item">Edit...</div>
+<div class="context-menu-item"
+ onmouseup="zmi_change_view(pd_selected_items)"
+ filter="pd_selected_items">Change View...</div>
<div class="separator" filter="pd_selected_item"></div>
<div class="context-menu-item"
onmouseup="window.alert('Clipboard functions are not yet implemented.')"
@@ -17,6 +22,8 @@
</div>
<div id="slot-target-context-menu" class="context-menu">
+<div class="context-menu-header"
+ filter="zmi_prepare_target_menu(pd_filter_object)"></div>
<div class="context-menu-item" onmouseup="zmi_add(pd_selected_item)"
filter="pd_selected_item">Add...</div>
<div class="context-menu-item"
=== Products/CompositePage/zmi/zmi_edit.js 1.2 => 1.3 ===
--- Products/CompositePage/zmi/zmi_edit.js:1.2 Thu Oct 9 17:29:16 2003
+++ Products/CompositePage/zmi/zmi_edit.js Sat Dec 27 13:40:21 2003
@@ -14,3 +14,38 @@
document.location = transformer_url + "/showSlot?path=" + path;
}
+function zmi_prepare_element_menu(header) {
+ // Prepares the header of the element context menu.
+ var node;
+ if (!pd_selected_item) {
+ icon = null;
+ text = '' + pd_selected_items.length + ' Elements Selected';
+ }
+ else {
+ icon = pd_selected_item.getAttribute('icon');
+ text = pd_selected_item.getAttribute('title');
+ }
+ while (header.childNodes.length)
+ header.removeChild(header.childNodes[0]);
+ if (icon) {
+ node = document.createElement("img");
+ node.setAttribute("src", icon);
+ node.setAttribute("width", "16");
+ node.setAttribute("height", "16");
+ header.appendChild(node);
+ }
+ node = document.createTextNode(text);
+ header.appendChild(node);
+ return true;
+}
+
+function zmi_prepare_target_menu(header) {
+ // Prepares the header of the target context menu.
+ while (header.childNodes.length)
+ header.removeChild(header.childNodes[0]);
+ text = pd_selected_item.getAttribute('title') || 'Slot';
+ node = document.createTextNode(text);
+ header.appendChild(node);
+ return true;
+}
+
More information about the Zope-CVS
mailing list