Author: jmorliaguet
Date: Sat Jan 14 22:58:36 2006
New Revision: 2211

Modified:
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css
   cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualmenu_test.html
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_navpanel_test.html
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_observer_test.html
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_remote_data.html
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_tooltip.html
   cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel5.html
   cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html
   
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_widgets_test.html
   cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/p3.html
Log:

- replaced <object> with <ins> since explorer filters out the tag (probably
  for security reasons) unless the classid or the type can be handled.

  <object classid="cpsskins:view" data="someurl.html">

  becomes:

  <ins class="view" cite="someurl.html">

- fixed tests / IE fixes



Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css        
(original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.css        Sat Jan 
14 22:58:36 2006
@@ -1,5 +1,13 @@
 
-object {
+ins.view {
+  display: none;
+}
+
+ins.model {
+  display: none;
+}
+
+ins.controller {
   display: none;
 }
 

Modified: cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js (original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/cpsskins.js Sat Jan 14 
22:58:36 2006
@@ -50,16 +50,12 @@
   },
 
   parse: function(node) {
-    var elements = node.getElementsByTagName("object");
+    var elements = node.getElementsByTagName("ins");
     $A(elements).each(function(el, index) {
 
-      var classid = el.getAttribute("classid");
-      if (!classid.match(/^cpsskins\:/)) {
-        el.style.display = "block";
-        return;
-      }
+      var classid = el.className;
 
-      var url = el.getAttribute("data");
+      var url = el.getAttribute("cite");
       if (url) {
          new Ajax.Request(url, {
            onComplete: function(req) {
@@ -78,7 +74,7 @@
 
       switch(classid) {
 
-        case "cpsskins:view": {
+        case "view": {
           var config = CPSSkins.jsonParse(el);
 
           var widget_type = config.widget.type;
@@ -130,9 +126,6 @@
     }
   },
 
-  /* Controller */
-
-
   _resolvePerspective: function(perspective) {
     var path = CPSSkins.CurrentPerspective.split("/");
     var base = perspective;
@@ -296,14 +289,14 @@
 if (!window.Canvas) { var Canvas = new Object(); }
 Object.extend(Canvas, {
 
-  json_regexp: new RegExp(/^\sdata:/),
-
   _getModelNode: function(node) {
     node = $(node);
     while(node = node.previousSibling) {
       if (node.nodeType == 1) {
-        if (node && node.tagName.toLowerCase() == "object"
-                 && node.getAttribute("classid") == "cpsskins:model") {
+        if (node && node.tagName.toLowerCase() == "ins") {
+        }
+        if (node && node.tagName.toLowerCase() == "ins"
+                 && Element.hasClassName(node, "model")) {
           return node;
         } else {
           return null;
@@ -340,13 +333,15 @@
     if (node_id) {
       CPSSkins.Cache[node_id] = data;
     } else {
-      var comment = " data: " + JSON.stringify(data);
-      comment = document.createComment(comment);
+      var str = JSON.stringify(data);
       var old = this._getModelNode(node);
       if (old) {
-        node.parentNode.removeChild(old);
+        old.innerHTML = str;
+      } else {
+        var ins = document.createElement("ins")
+        ins.innerHTML = str;
+        node.parentNode.insertBefore(ins, node);
       }
-      node.parentNode.insertBefore(comment, node);
    }
 
     // Update the views and controllers that are registered as observers

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualmenu_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualmenu_test.html
  (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_contextualmenu_test.html
  Sat Jan 14 22:58:36 2006
@@ -22,7 +22,7 @@
 
     <!-- View: contextual menu widget -->
 
-    <object classid="cpsskins:view">
+    <ins class="view">
     {"widget": {
        "type": "contextmenu",
        "items": [
@@ -95,28 +95,28 @@
        "transition": "fadeout"
      }
     }
-    </object>
+    </ins>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"copyable":true}
-    </object>
+    </ins>
     <div id="area1" class="pad">area1</div>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"formattable":true,
      "formats":[
        {"choice":"style","label":"Style"}
      ]
     }
-    </object>
+    </ins>
     <div id="area2" class="pad">area2</div>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"editable":true}
-    </object>
+    </ins>
     <div id="area3" class="pad">area3</div>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"editable":true,
      "formattable":true,
      "formats":[
@@ -131,12 +131,12 @@
       {"choice":"large","label":"Large"},
       {"choice":"x-large","label":"Extra large"}
      ]}
-    </object>
+    </ins>
     <div id="area4" class="pad">area4
 
-      <object classid="cpsskins:model">
+      <ins class="model">
       {"editable":true}
-      </object>
+      </ins>
       <div id="area5" class="pad">area5</div>
     </div>
   </div>

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_navpanel_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_navpanel_test.html
        (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_navpanel_test.html
        Sat Jan 14 22:58:36 2006
@@ -43,53 +43,53 @@
     href="javascript:CPSSkins.switchPerspective('panels/panel1')">
   PANEL 1</a>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "panel1.html"
    },
    "perspectives": ["panels/panel1"]
   }
-  </object>
+  </ins>
 
   <a class="header"
      href="javascript:CPSSkins.switchPerspective('panels/panel2')">
   PANEL 2</a>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "panel2.html"
    },
    "perspectives": ["panels/panel2"]
   }
-  </object>
+  </ins>
 
   <a class="header"
     href="javascript:CPSSkins.switchPerspective('panels/panel3')">
   PANEL 3</a>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "panel3.html"
    },
    "perspectives": ["panels/panel3"]
   }
-  </object>
+  </ins>
 
   <a class="header"
     href="javascript:CPSSkins.switchPerspective('panels/panel4')">
   PANEL 4</a>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "panel4.html"
    },
    "perspectives": ["panels/panel4"]
   }
-  </object>
+  </ins>
 
 </body>
 

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_observer_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_observer_test.html
        (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_observer_test.html
        Sat Jan 14 22:58:36 2006
@@ -120,16 +120,16 @@
   <p>The views observe the model.
      When the model changes the views gets updated.</p>
 
-  <object classid="cpsskins:model">
+  <ins class="model">
   {"size": 1,
    "sizeinfo": [
      {"choice": "", "label": ""}
    ]
   }
-  </object> 
+  </ins> 
   <div id="data-provider">DATA PROVIDER
     <!-- tooltip view -->
-    <object classid="cpsskins:view">
+    <ins class="view">
     {"widget": {
        "type":"tooltip"
      },
@@ -137,42 +137,42 @@
        "delay": 1500
      }
     }
-    </object>
+    </ins>
 
     <!-- contextual menu view -->
-    <object classid="cpsskins:view">
+    <ins class="view">
     {"widget": {
       "type": "contextmenu",
       "items": [
         {"type": "selection", "choices": "sizeinfo"}
       ]
     }}
-    </object>
+    </ins>
   </div>
 
   <h2>progress bar widget</h2>
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "progressbar"
    },
    "model": "data-provider"
   }
-  </object>
+  </ins>
 
   <h2>counter widget</h2>
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "counter"
    },
    "model": "data-provider"
   }
-  </object>
+  </ins>
 
   <h2>menu widget</h2>
   <div id="info">
     Info
     <!-- menu view observing the data provider -->
-    <object classid="cpsskins:view">
+    <ins class="view">
     {"widget": {
        "type": "contextmenu",
        "items": [
@@ -188,7 +188,7 @@
      },
      "model": "data-provider"
     }
-    </object>
+    </ins>
 
   </div>
 

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html
   (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_panel_test.html
   Sat Jan 14 22:58:36 2006
@@ -40,7 +40,7 @@
     <tr style="vertical-align: top">
       <td colspan="3">
 
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel1.html",
@@ -48,9 +48,9 @@
          },
          "perspectives": ["page-designer", "layout-designer"]
         }
-        </object>
+        </ins>
 
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel2.html",
@@ -58,7 +58,7 @@
          },
          "perspectives": ["site-designer"]
         }
-        </object>
+        </ins>
 
       </td>
     </tr>
@@ -66,72 +66,72 @@
     <tr style="vertical-align: top">
       <td style="width: 20%">
 
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel2.html"
          },
          "perspectives": ["page-designer"]
         }
-        </object>
+        </ins>
 
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel3.html"
          },
          "perspectives": ["site-designer", "layout-designer"]
         }
-        </object>
+        </ins>
 
       </td>
       <td syle="width: 60%">
 
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel3.html"
          },
          "perspectives": ["page-designer"]
         }
-        </object>
+        </ins>
 
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel4.html"
          },
          "perspectives": ["page-designer"]
         }
-        </object>
+        </ins>
 
       </td>
       <td style="width: 20%">
 
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url":"panel4.html"
          },
          "perspectives": ["site-designer", "layout-designer"]
         }
-        </object>
+        </ins>
 
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url":"panel2.html"
          },
          "perspectives": ["site-designer"]
         }
-        </object>
+        </ins>
 
       </td>
 
     </tr>
   </table>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "panel5.html",
@@ -139,7 +139,7 @@
    },
    "perspectives": ["element-editor"]
   }
-  </object>
+  </ins>
 
 </body>
 

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_remote_data.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_remote_data.html
  (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_remote_data.html
  Sat Jan 14 22:58:36 2006
@@ -39,24 +39,24 @@
 
   <div id="area1">
 
-    <object classid="cpsskins:model" data="data1.txt">
-    </object>
+    <ins class="model" cite="data1.txt">
+    </ins>
     <a href="#">Open</a>
 
-    <object classid="cpsskins:view" data="data2.txt">
-    </object>
+    <ins class="view" cite="data2.txt">
+    </ins>
 
   </div>
 
 
   <h2>Source:</h2>
   <pre>
-  &lt;object classid="cpsskins:model" data="data1.txt"&gt;
-  &lt;/object&gt;
+  &lt;ins class="model" cite="data1.txt"&gt;
+  &lt;/ins&gt;
   &lt;a href="#"&gt;Open&lt;/a&gt;
 
-  &lt;object classid="cpsskins:view" data="data2.txt"&gt;
-  &lt;/object&gt;
+  &lt;ins class="view" cite="data2.txt"&gt;
+  &lt;/ins&gt;
   </pre>
 
   <h3>data1.txt</h3>

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_tooltip.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_tooltip.html
      (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/cpsskins_tooltip.html
      Sat Jan 14 22:58:36 2006
@@ -55,22 +55,22 @@
 
   <div id="area1">
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"hint":"Click here to open the document."}
-    </object>
+    </ins>
     <a href="#">Open</a>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"hint":"Click here to save the document."}
-    </object>
+    </ins>
     <a href="#">Save</a>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"hint":"Click here to close the document."}
-    </object>
+    </ins>
     <a href="#">Close</a>
 
-    <object classid="cpsskins:view">
+    <ins class="view">
     {"widget": {
        "type": "tooltip"
      },
@@ -84,7 +84,7 @@
        "transition": "fadeout",
        "delay": 500
     }}
-    </object>
+    </ins>
 
     <p>Show delay: 1s<br/>
        Hide delay: 500ms</p>
@@ -92,22 +92,22 @@
 
   <div id="area2">
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"hint":"Click here to open the file."}
-    </object>
+    </ins>
     <a href="#">Open</a>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"hint":"Click here to save the file."}
-    </object>
+    </ins>
     <a href="#">Save</a>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"hint":"Click here to close the file."}
-    </object>
+    </ins>
     <a href="#">Close</a>
 
-    <object classid="cpsskins:view">
+    <ins class="view">
     {"widget": {
        "type": "tooltip"
      },
@@ -122,7 +122,7 @@
        "delay": 1000
       }
     }
-    </object>
+    </ins>
 
     <p>Show delay: 500ms<br/>
        Hide delay: 1s</p>

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel5.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel5.html    
    (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/functional/panel5.html    
    Sat Jan 14 22:58:36 2006
@@ -20,7 +20,7 @@
   <table style="width: 100%; padding:1em">
     <tr>
       <td>
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel1.html"
@@ -30,10 +30,10 @@
          },
          "perspectives": ["element-editor/1"]
         }}
-        </object>
+        </ins>
       </td>
       <td>
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel2.html"
@@ -43,10 +43,10 @@
          },
          "perspectives": ["element-editor/1"]
         }}
-        </object>
+        </ins>
       </td>
       <td>
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
             "url": "panel3.html"
@@ -56,10 +56,10 @@
          },
          "perspectives": ["element-editor/2"]
         }}
-        </object>
+        </ins>
       </td>
       <td>
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel4.html"
@@ -69,10 +69,10 @@
          },
          "perspectives": ["element-editor/2"]
         }}
-        </object>
+        </ins>
       </td>
       <td>
-        <object classid="cpsskins:view">
+        <ins class="view">
         {"widget": {
            "type": "panel",
            "url": "panel6.html"
@@ -82,7 +82,7 @@
          },
          "perspectives": ["element-editor/3"]
         }
-        </object>
+        </ins>
       </td>
     </tr>
   </table>

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html   
    (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_test.html   
    Sat Jan 14 22:58:36 2006
@@ -19,30 +19,29 @@
 <h1>CPSSkins Unit test file</h1>
 
 <p>
-  Tests for CPSSkins javascript library.
+  Tests for the CPSSkins AJAX toolkit.
 </p>
 
 <!-- Log output -->
 <div id="testlog"> </div>
 
 <!-- Testing area -->
-
 <div id="e0">
   <div>
     <div id="e1"></div>
     <div>
 
-      <object classid="cpsskins:model">
+      <ins class="model">
       {"a":"1","b":"2"}
-      </object>
+      </ins>
 
       <div id="e2"></div>
       <div id="e3"></div>
       <div id="e4">
 
-        <object classid="cpsskins:model">
+        <ins class="model">
         {"a":"1"}
-        </object>
+        </ins>
         <div></div>
 
         <div id="e5"></div>
@@ -50,69 +49,69 @@
     </div>
     <div></div>
 
-    <object classid="cpsskins:model">
+    <ins class="model">
     {"a":["1","2","3"],
      "b":{"c":1,"d":2},
      "c":[[1],[2],[3]]}
-    </object>
+    </ins>
     <div id="e6"></div>
 
   </div>
 
   <!-- panels -->
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "p1.html"
    },
    "perspectives": ["1"]
   }
-  </object>
+  </ins>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "p2.html"
    },
    "perspectives": ["1", "2"]
   }
-  </object>
+  </ins>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "p3.html"
    },
    "perspectives": ["3"]
   }
-  </object>
+  </ins>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "p1_2.html"
    },
    "perspectives": ["1/2"]
   }
-  </object>
+  </ins>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "p2_3.html"
    },
    "perspectives": ["2/3"]
   }
-  </object>
+  </ins>
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "p2_3_1.html"
    },
    "perspectives": ["2/3/1"]
   }
-  </object>
+  </ins>
 
 </div>
 
@@ -134,6 +133,9 @@
 
   new Test.Unit.Runner({
 
+    setup: function() {
+    },
+
     testIsIdentifiable: function() { with(this) {
       assertEqual(Identifiable.isIdentifiable(e1), true);
       assertEqual(Identifiable.isIdentifiable(e1.parentNode), false);

Modified: 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_widgets_test.html
==============================================================================
--- 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_widgets_test.html
       (original)
+++ 
cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/cpsskins_widgets_test.html
       Sat Jan 14 22:58:36 2006
@@ -29,17 +29,21 @@
 
 <div>
 
-  <object classid="cpsskins:model">
+  <ins class="model">
   {"hint":"Tooltip hint for e0"}
-  </object>
+  </ins>
   <div id="e0"></div>
 
-  <object classid="cpsskins:model">
+  <ins class="model">
   {"hint":"Tooltip hint for e1"}
-  </object>
+  </ins>
   <div id="e1"></div>
 
-  <view widget="tooltip"></view>
+  <ins class="view">
+  {"widget": {
+     "type": "tooltip"
+  }}
+  </ins>
 
 </div>
 

Modified: cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/p3.html
==============================================================================
--- cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/p3.html  
(original)
+++ cpsskins/branches/jmo-perspectives/ui/framework/tests/unit/p3.html  Sat Jan 
14 22:58:36 2006
@@ -1,12 +1,12 @@
 <div id="p3">
 
-  <object classid="cpsskins:view">
+  <ins class="view">
   {"widget": {
      "type": "panel",
      "url": "p4.html"
    },
    "perspectives": ["4"]
   }
-  </object>
+  </ins>
 
 </div>
-- 
http://lists.nuxeo.com/mailman/listinfo/z3lab-checkins

Reply via email to