|
Revision 45, 1.3 kB
(checked in by jf.hovinne, 4 years ago)
|
|
Created Wymeditor object.
|
| Line | |
|---|
| 1 | <!DOCTYPE HTML PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
|---|
| 2 | <html>
|
|---|
| 3 | <head> |
|---|
| 4 | <title>WYMeditor</title>
|
|---|
| 5 | <style type="text/css">
|
|---|
| 6 | .wym_iframe { width: 75%; }
|
|---|
| 7 | .wym_menu ul { padding:0; margin: 0; }
|
|---|
| 8 | .wym_menu li { list-style: none; float: left; margin-right: 0.7em; }
|
|---|
| 9 | .wym_content { clear: both; }
|
|---|
| 10 | </style>
|
|---|
| 11 | <script type="text/javascript" src="wymeditor/jquery.js"></script>
|
|---|
| 12 | <script type="text/javascript" src="wymeditor/wymeditor.js"></script> |
|---|
| 13 | <script type="text/javascript"> |
|---|
| 14 | $(function() { |
|---|
| 15 |
|
|---|
| 16 | //create wymeditor instance(s) |
|---|
| 17 | //we replace each matched element by a Wymeditor instance |
|---|
| 18 | //this code is customizable |
|---|
| 19 |
|
|---|
| 20 | var elements=$(".wymeditor"); |
|---|
| 21 | var options = { |
|---|
| 22 | htmlToInsert: "<div class='wymeditor'></div>", |
|---|
| 23 | pageToLoad: "wymeditor/wymeditor.html", |
|---|
| 24 | iframeClass: ".wym_iframe", |
|---|
| 25 | execClass: ".wym_exec", |
|---|
| 26 | toggleClass: ".wym_toggle" |
|---|
| 27 | } |
|---|
| 28 |
|
|---|
| 29 | $(elements).each(function(i) { |
|---|
| 30 | var wymeditor=new Wymeditor($(this),i,options); |
|---|
| 31 | });
|
|---|
| 32 | |
|---|
| 33 | }); |
|---|
| 34 | </script>
|
|---|
| 35 | </head>
|
|---|
| 36 |
|
|---|
| 37 | <body>
|
|---|
| 38 | <textarea id="txt1" rows="8" cols="40" class="wymeditor"><p>First textarea !</p></textarea><br/>
|
|---|
| 39 | <textarea id="txt2" rows="8" cols="40" class="wymeditor"><p>Second textarea</p></textarea><br /> |
|---|
| 40 | <input type="text" id="txt3" class="wymeditor" value="<p>First input text</p>" />
|
|---|
| 41 | </body>
|
|---|
| 42 |
|
|---|
| 43 | </html>
|
|---|