Changeset 177 for trunk/examples


Ignore:
Timestamp:
05/19/05 15:28:30 (14 years ago)
Author:
gogo
Message:
  • Minor comment changes.
  • Refactor events for form submit, reset and window unload
  • Fix reset handler to properly use the original textarea content
  • Minor changes to setHTML etc
  • Use onload for iframe to determine when to initIframe, instead of a timeout
  • Remove overlooked debugging statement in loadPlugins
  • Change some event registrations to use addDom0Event rather than element.onxxx = something
  • Add HTMLArea.flushEvents() as an implementation of #30 - sadly, doesn't work. This is not enabled in the full_example, use examples/testbed.html to test it out.
  • Added methods HTMLArea.addDom0Event and HTMLArea.prependDom0Event which are to be used instead of element.onxxxxx = something;
Location:
trunk/examples
Files:
3 edited

Legend:

Unmodified
Added
Removed
  • trunk/examples/full_example-body.html

    r166 r177  
    6060       'TableOperations' 
    6161      ]; 
     62 
    6263             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :) 
    6364             if(!HTMLArea.loadPlugins(xinha_plugins, xinha_init)) return; 
     
    132133</head> 
    133134 
    134 <body onload="xinha_init()"> 
     135<body> 
    135136 
    136   <form id="editors_here"> 
     137  <form id="editors_here" onsubmit="alert(this.myTextArea0.value);"> 
    137138    <textarea id="myTextArea" name="myTextArea" rows="10" cols="80" style="width:100%"></textarea> 
    138139    <textarea id="anotherOne" name="anotherOne" rows="10" cols="80" style="width:100%"></textarea> 
  • trunk/examples/full_example-menu.html

    r156 r177  
    8686 
    8787      <label> 
     88                  <input type="checkbox" name="plugins" value="FormOperations" /> FormOperations 
     89      </label> 
     90 
     91      <label> 
     92                  <input type="checkbox" name="plugins" value="HorizontalRule" /> HorizontalRule 
     93      </label> 
     94 
     95      <label> 
    8896        <input type="checkbox" name="plugins" value="LangMarks" /> LangMarks 
    8997      </label> 
  • trunk/examples/testbed.html

    r166 r177  
     1<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"> 
    12<html> 
    23<head> 
     
    5152      xinha_plugins = xinha_plugins ? xinha_plugins : 
    5253      [ 
    53       'FullScreen', 
    54       'TableOperations' 
     54        'FullScreen' 
    5555      ]; 
    5656             // THIS BIT OF JAVASCRIPT LOADS THE PLUGINS, NO TOUCHING  :) 
     
    118118 
    119119      HTMLArea.startEditors(xinha_editors); 
     120      window.onload = null; 
    120121    } 
    121122 
    122     window.onload = xinha_init; 
     123    window.onload   = xinha_init; 
     124    window.onunload = HTMLArea.flushEvents; 
    123125  </script> 
    124126</head> 
     
    127129 
    128130  <form action="javascript:var x = document.getElementById('editors_here');alert(x.myTextArea.value);" id="editors_here" onsubmit="alert(this.myTextArea.value);"> 
    129     <textarea id="myTextArea" name="myTextArea" style="width:100%;height:320"> 
     131    <textarea id="myTextArea" name="myTextArea" style="width:100%;height:320px;"> 
    130132      &lt;p&gt; 
    131133        Lorem ipsum dolor sit amet, consectetuer adipiscing elit. 
     
    148150    </textarea> 
    149151 
    150     <input type="submit" /> 
     152    <input type="submit" /> <input type="reset" /> 
    151153  </form> 
    152  
    153154</body> 
    154155</html> 
Note: See TracChangeset for help on using the changeset viewer.