Author: jmorliaguet
Date: Sat Dec 17 15:20:27 2005
New Revision: 2047

Modified:
   cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js
   cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.js
   cpsskins/branches/jmo-perspectives/ui/editing/portlet_editor.js
   cpsskins/branches/jmo-perspectives/ui/editing/portlet_editor.pt
   cpsskins/branches/jmo-perspectives/ui/framework/pdlib.js
   cpsskins/branches/jmo-perspectives/ui/framework/utils.js
Log:

- document.getElementById() is $() in prototype.js

- rename Element() to Box() to avoid a class name conflict



Modified: cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/authoring/authoring.js        Sat Dec 
17 15:20:27 2005
@@ -22,12 +22,12 @@
 
 function getEngineName() {
   var engine = '';
-  var engine_tag = document.getElementById('engine');
+  var engine_tag = $('engine');
   if (engine_tag) engine = engine_tag.getAttribute('name');
   return engine;
 }
 
-function Element(node) {
+function Box(node) {
   this.node = node;
   this.bg = node.style.background;
   this.container = node.parentNode;
@@ -372,7 +372,7 @@
   // update the view
   var view_id = target.getAttribute("view_id");
   if (view_id) {
-    var view = document.getElementById(view_id);
+    var view = $(view_id);
     if (view) view.setAttribute(name, value);
   }
   // update the model
@@ -391,7 +391,7 @@
     var target = Event.element(e);
     if (!target) return;
     if (target.getAttribute("grip") || mo.getAttribute("grip")) {
-      moved = new Element(mo);
+      moved = new Box(mo);
       set_dragbox_content(mo);
       setCursor("default");
       pd_itemOnMousedown(mo, e);
@@ -421,7 +421,7 @@
 
 function setupFactory(mo) {
   mo.onmousedown = function(e) {
-    factory = new Element(mo);
+    factory = new Box(mo);
     setCursor("crosshair");
     clear_dragbox();
     drag_box.style.border = "1px solid gray";
@@ -530,11 +530,11 @@
                  "getCanvasMode"
                 ]);
 
-    drag_box = document.getElementById("drag-feedback-box");
-    edit_space = document.getElementById("editSpace");
-    context_menu = document.getElementById("choice-context-menu");
-    selection_box = document.getElementById("selection-box");
-    tooltip_box = document.getElementById("tooltip-box");
+    drag_box = $("drag-feedback-box");
+    edit_space = $("editSpace");
+    context_menu = $("choice-context-menu");
+    selection_box = $("selection-box");
+    tooltip_box = $("tooltip-box");
 
     menu_actions = new MenuActions();
 

Modified: 
cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.js 
(original)
+++ cpsskins/branches/jmo-perspectives/ui/default/filters/style/style_editor.js 
Sat Dec 17 15:20:27 2005
@@ -249,19 +249,19 @@
 
 function setupAreas() {
     // <head><script>
-    head_style = document.getElementById("style");
+    head_style = $("style");
 
     // top
-    message_box = document.getElementById("messageBox");
-    widget_selector = document.getElementById("widgetSelector");
+    message_box = $("messageBox");
+    widget_selector = $("widgetSelector");
 
     // left
-    preview_area = document.getElementById("previewArea");
-    widget_area = document.getElementById("widgetArea");
-    tooltip_box = document.getElementById("tooltipBox");
+    preview_area = $("previewArea");
+    widget_area = $("widgetArea");
+    tooltip_box = $("tooltipBox");
 
     // right
-    form_area = document.getElementById("formArea");
+    form_area = $("formArea");
 }
 
 function setupEventHandlers() {

Modified: cpsskins/branches/jmo-perspectives/ui/editing/portlet_editor.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/editing/portlet_editor.js     
(original)
+++ cpsskins/branches/jmo-perspectives/ui/editing/portlet_editor.js     Sat Dec 
17 15:20:27 2005
@@ -8,7 +8,7 @@
         methods=["renderElement"]
         );
 
-    rendering_area = document.getElementById("renderingArea");
+    rendering_area = $("renderingArea");
     portlet = portlet_id;
 }
 

Modified: cpsskins/branches/jmo-perspectives/ui/editing/portlet_editor.pt
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/editing/portlet_editor.pt     
(original)
+++ cpsskins/branches/jmo-perspectives/ui/editing/portlet_editor.pt     Sat Dec 
17 15:20:27 2005
@@ -11,6 +11,8 @@
     </tal:style>
     <tal:script metal:fill-slot="script">
       <script type="text/javascript"
+              src="/++skin++cpsskins/@@/++resource++prototype.js"></script>
+      <script type="text/javascript"
               src="/@@/jsolait/init.js"></script>
       <script type="text/javascript"
               
src="/++skin++cpsskins/@@/++resource++portlet_editor.js"></script>

Modified: cpsskins/branches/jmo-perspectives/ui/framework/pdlib.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/pdlib.js    (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/pdlib.js    Sat Dec 17 
15:20:27 2005
@@ -27,7 +27,7 @@
 function pd_DragEvent(e) {
   this.start_x = Event.pointerX(e);
   this.start_y = Event.pointerY(e);
-  this.feedback_node = document.getElementById("drag-feedback-box");
+  this.feedback_node = $("drag-feedback-box");
   this.began_moving = false;
 }
 
@@ -179,7 +179,7 @@
   pd_clearSelection();
   pd_select(mo);
 
-  var menu = document.getElementById(contextMenuId);
+  var menu = $(contextMenuId);
   if (menu) {
     pd_filterContextMenuItems(menu, mo);
     pd_showContextMenu(menu, e);

Modified: cpsskins/branches/jmo-perspectives/ui/framework/utils.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/utils.js    (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/utils.js    Sat Dec 17 
15:20:27 2005
@@ -15,7 +15,7 @@
 
 /* Visibility (tooltip, ...) */
 function toggleElement(id) {
-  var node = document.getElementById(id);
+  var node = $(id);
   if (!node) return;
   if (node.style.display != 'none') {
     hideElement(id);
@@ -25,14 +25,14 @@
 }
 
 function showElement(id) {
-  var node = document.getElementById(id);
+  var node = $(id);
   if (!node) return;
   node.style.visibility = 'visible';
   node.style.display = 'block';
 }
 
 function hideElement(id) {
-  var node = document.getElementById(id);
+  var node = $(id);
   if (!node) return;
   node.style.visibility = 'hidden';
   node.style.display = 'none';
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to