]> matita.cs.unibo.it Git - helm.git/commitdiff
* added embedding test (HTML)
authorLuca Padovani <luca.padovani@unito.it>
Wed, 24 Mar 2004 08:19:28 +0000 (08:19 +0000)
committerLuca Padovani <luca.padovani@unito.it>
Wed, 24 Mar 2004 08:19:28 +0000 (08:19 +0000)
* new things to do

helm/gtkmathview-bonobo/TODO
helm/gtkmathview-bonobo/test/embedding.html [new file with mode: 0644]
helm/gtkmathview-bonobo/test/embedding.xml

index 164380a5ce9aa50dab865489f90ca1c337488147..8f1032a0c58c1878579a0d9afb3baad2b3ad8354 100644 (file)
@@ -9,3 +9,13 @@
 * try to implement size negotiations with the plugin that sends javascript
   to the browser.
 
+* access object's attribute and <PARAM> children. Jean claims he does
+  this already, but the code seems to access GLib properties only,
+  no external params
+
+* implement a size negotiation mechanism from the plugin using 
+  javascript. The plugin understands its ID from the object element,
+  calculates the size and sends a URL with a javascript call to a function
+  that sets width, height attributes of the object element
+
+
diff --git a/helm/gtkmathview-bonobo/test/embedding.html b/helm/gtkmathview-bonobo/test/embedding.html
new file mode 100644 (file)
index 0000000..674012f
--- /dev/null
@@ -0,0 +1,41 @@
+<?xml version="1.0"?>
+<html xmlns="http://www.w3.org/1999/xhtml">
+
+<head>
+  <script language="JavaScript">
+<!--
+    function set_object_size(id, width, height)
+    {
+      document[id].width = width;
+      document[id].height = height;
+    }
+-->
+  </script>
+</head>
+
+<body>
+
+  <h1>GtkMathView-Bonobo test page</h1>
+
+  The embedded object should display a mathematical formula.
+  <br />
+
+  <object name="MATH" data="#math1" width="500" height="100" type="application/mathml+xml">
+    <math id="math1" display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+       <mfrac>
+         <mi href="http://www.google.it">x</mi>
+         <mn>2</mn>
+       </mfrac>
+      <mo>=</mo>
+      <mtext href="javascript:alert('like if I can do that')">click for the answer</mtext>
+    </math>
+  </object>
+
+  <form name="test">
+    <input name="eccolo" type="button" onClick="set_object_size('MATH', 100, 50)" value="Size"/>
+  </form>
+
+</body>
+
+</html>
+
index b0d12e52d0bf20e58002406bfd1cd0d589f3e045..57fe49a87bf27fde705483ebe602058c4b017f13 100644 (file)
@@ -1,7 +1,19 @@
 <?xml version="1.0"?>
 <html xmlns="http://www.w3.org/1999/xhtml">
 
-<head> </head>
+<head>
+  <script language="JavaScript">
+<!--
+    function setSize(id, width, height)
+    {
+      document.elements[id].width = width;
+      document.elements[id].height = height;
+      document.elements['eccolo'].value = 'Ciao';
+      alert('hello!');
+    }
+-->
+  </script>
+</head>
 
 <body>
 
   The embedded object should display a mathematical formula.
   <br />
 
-  <object data="#math1" width="500" height="100" type="application/mathml+xml">
-    No viewer capable of displaying the test document installed.
-    <input type="hidden">
-      <math id="math1" display="block" xmlns="http://www.w3.org/1998/Math/MathML">
-        <mfrac>
-          <mi href="http://www.google.it">x</mi>
-         <mn>2</mn>
-       </mfrac>
-       <mo>=</mo>
-        <mtext href="javascript:alert('like if I can do that')">click for the answer</mtext>
-      </math>
-    </input>
+  <object name="MATH" data="#math1" width="500" height="100" type="application/mathml+xml">
+    <math id="math1" display="block" xmlns="http://www.w3.org/1998/Math/MathML">
+       <mfrac>
+         <mi href="http://www.google.it">x</mi>
+         <mn>2</mn>
+       </mfrac>
+      <mo>=</mo>
+      <mtext href="javascript:alert('like if I can do that')">click for the answer</mtext>
+    </math>
   </object>
 
-  </body>
+  <form name="test">
+    <input name="eccolo" type="button" onClick="alert('hi')">Size</input>
+  </form>
+
+</body>
 
 </html>