Full featured example
1 <%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%> 2 <% 3 String path = request.getContextPath(); 4 String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/"; 5 %> 6 7 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> 8 <html> 9 <head> 10 <script type="text/javascript" src="<%=path %>/tinymce/jscripts/tiny_mce/tiny_mce.js"></script> 11 <script type="text/javascript"> 12 tinyMCE.init({ 13 // General options 14 mode : "textareas", 15 theme : "advanced", 16 plugins : "autolink,lists,pagebreak,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,inlinepopups,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template,wordcount,advlist,autosave,visualblocks", 17 18 // Theme options 19 theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,styleselect,formatselect,fontselect,fontsizeselect", 20 theme_advanced_buttons2 : "cut,copy,paste,pastetext,pasteword,|,search,replace,|,bullist,numlist,|,outdent,indent,blockquote,|,undo,redo,|,link,unlink,anchor,image,cleanup,help,code,|,insertdate,inserttime,preview,|,forecolor,backcolor", 21 theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen", 22 theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,pagebreak,restoredraft,visualblocks", 23 theme_advanced_toolbar_location : "top", 24 theme_advanced_toolbar_align : "left", 25 theme_advanced_statusbar_location : "bottom", 26 theme_advanced_resizing : true, 27 28 // Example content CSS (should be your site CSS) 29 content_css : "css/content.css", 30 31 // Drop lists for link/image/media/template dialogs 32 template_external_list_url : "lists/template_list.js", 33 external_link_list_url : "lists/link_list.js", 34 external_image_list_url : "lists/image_list.js", 35 media_external_list_url : "lists/media_list.js", 36 37 // Style formats 38 style_formats : [ 39 {title : ‘Bold text‘, inline : ‘b‘}, 40 {title : ‘Red text‘, inline : ‘span‘, styles : {color : ‘#ff0000‘}}, 41 {title : ‘Red header‘, block : ‘h1‘, styles : {color : ‘#ff0000‘}}, 42 {title : ‘Example 1‘, inline : ‘span‘, classes : ‘example1‘}, 43 {title : ‘Example 2‘, inline : ‘span‘, classes : ‘example2‘}, 44 {title : ‘Table styles‘}, 45 {title : ‘Table row 1‘, selector : ‘tr‘, classes : ‘tablerow1‘} 46 ], 47 48 // Replace values for the template plugin 49 template_replace_values : { 50 username : "Some User", 51 staffid : "991234" 52 } 53 }); 54 </script> 55 </head> 56 <body> 57 <form method="post" action="${pageContext.request.contextPath }/DemoServlet"> 58 <h3>Full featured example</h3> 59 <!-- Gets replaced with TinyMCE, remember HTML in a textarea should be encoded --> 60 <textarea id="elm1" name="elm1" rows="15" cols="80" style="width: 80%"> 61 This is some example text that you can edit inside the <strong>TinyMCE editor</strong>. 62 </textarea> 63 <br /> 64 <input type="submit" name="save" value="Submit" /> 65 <input type="reset" name="reset" value="Reset" /> 66 </form> 67 </body> 68 </html>
时间: 2024-11-09 00:52:07