Subversion Repositories wimsdev

Rev

Rev 3653 | Go to most recent revision | Blame | Compare with Previous | Last modification | View Log | RSS feed

  1. <html>
  2.     <body bgcolor=#0000ff onload="javascript:setTimeout('SetSize(\'TexApp\')',2000);">
  3.         <script type="text/javascript">                                                
  4.         function remove(t){
  5.             document.getElementById(t).width = 1;
  6.             document.getElementById(t).height = 1;     
  7.         }
  8.                                                                
  9.         function SetSize(t){                        
  10.             var xsize,ysize;
  11.             try{
  12.                 xsize = document.getElementById(t).getPrefferedWidth();
  13.                 ysize = document.getElementById(t).getPrefferedHeight();
  14.                 document.getElementById(t).width = xsize;
  15.                 document.getElementById(t).height = ysize;
  16.                 document.getElementById('showme').innerHTML='<hr><font color=red><b>preffered height = '+xsize+'<br>preffered width = '+ysize+'</b></font>';
  17.             }
  18.             catch(e){
  19.                 document.getElementById('showme').innerHTML='<hr><font color=red><b>Your browser does not support automatic resizing...</b></font>';
  20.             }    
  21.        
  22.         }
  23.         function ReadApplet(t){                        
  24.             var reply = document.getElementById(t).ReadApplet();
  25.             document.getElementById('showme').innerHTML='<hr><font color=red><b>'+reply+'</b></font>';
  26.         }
  27.         </script>
  28.         <div id="showme"></div>
  29.         <table ><tr valign=middle ><th>
  30.         <font color=red>
  31.         this is some text...
  32.         </font>
  33.         </th>
  34.         <th>
  35.         <applet id="TexApp" codebase="dist" archive="TexApp.jar" code="TexApp.class" width="1" height="1"><!-- automatic resizing -->
  36.             <param name="latex0" value="#ffffff,\frac{4}{7} \cdot,#a0c0f0, \frac{3}{4} \: =\:,input,\:\approx\:,input">
  37.             <param name="latex1" value="vspace"><!-- a blanc line : 50% of inputheight -->
  38.             <param name="latex2" value="#00ccff"><!-- change latex fgcolor -->
  39.             <param name="latex3" value="\left[ \begin{array}{l} x = \frac{3}{4} \\ y = \frac{5}{6}\end{array}\right. \rightarrow \frac{x}{y} = ,input">
  40.             <param name="latex4" value="#00af0f">
  41.             <param name="latex5" value="#ff00ff,\left\{ \begin{array}{l} x = \frac{3}{4} \\ y = \frac{5}{6} \\ z = \frac{\pi}{\sqrt{2}}\end{array}\right \rightarrow \frac{x}{y} = ,input,\rightarrow,#ffffff, z \cdot \frac{x}{y} = ,input">
  42.             <!-- optional -->
  43.             <param name="status" value="waiting"><!-- string : wims variable $status  done/waiting -->
  44.             <param name="latex_bgcolor" value="0,0,255"><!-- rgb or #ffffff default white -->
  45.             <param name="latex_fgcolor" value="255,0,0"><!-- rgb or #ffffff  default black -->
  46.             <param name="latex_fontsize" value="18"><!-- rgb  or #ffffff  default black -->
  47.             <param name="inputfield_width" value="120"><!-- int : default 10 : width in px of inputfield-->
  48.             <param name="inputfield_height" value="40"><!-- optional int : default fontsize in px : height in px of inputfield-->
  49.             <param name="inputfield_fontsize" value ="16"><!-- int : default 10 -->
  50.             <param name="inputfield_bgcolor" value="0,0,255"><!-- rgb or #ffffff  default white -->
  51.             <param name="inputfield_fgcolor" value="255,0,0"><!-- rgb or #ffffff  default black -->
  52.             <param name="inputfield_editable" value="1,0,1"><!-- field 1 is editable, field 2 is not_editable... default all editable -->
  53.             <param name="inputfield_values" value="12,44,"><!--  optional for correct answers: field 1 = "12", field 2 = "44" field3= "" field4 = "22" -->
  54.             NO JAVA
  55.         </applet>
  56.         </th>
  57.         <th>
  58.         <font color=red>
  59.         and this is the rest...</font>
  60.         </th></tr>
  61.         </table>
  62.         <p>
  63.         <font color=white>
  64.         For applet autoscaling, the applet_tag "width" should be less than 10 : width="1"<br>
  65.         The autoscaling SetSize() javascript_function could be called from the htmlpage "body onload".<br>
  66.         Or in WIMS:<br>
  67.         !set wims_html_onload=javascript:SetSize('TexApp');
  68.         <br>
  69.         This will probably not work for Opera browsers...
  70.         <br>
  71.         Safari on Windows will incorrectly scale the applet...
  72.         <br>
  73.         If the applet has a width &gt; 10 , no autoscaling is performed.
  74.         </font>
  75.         <br>
  76.         <input type="button" name="ReadApplet()" value="ReadApplet()" onclick="javascript:ReadApplet('TexApp');">
  77.         <input type="button" name="SetSize()" value="SetSize()" onclick="javascript:SetSize('TexApp');">
  78.         <input type="button" name="remove()" value="remove()" onclick="javascript:remove('TexApp');">
  79.     </body>
  80. </html>
  81.  
  82.