方便的RTE- TinyMCE

tinymce

今天要做編輯器的時候找到的,感覺是很不錯的RTE(Rich Text Editor)。

外掛網址: TinyMCE
Demo | Download

下載後引入js就可以了。
  1. tinyMCE.init({   
  2.   
  3. mode : "textareas"  
  4.   
  5. });  

如果要像Demo那麼漂亮,照範例都引入就可以了。
  1. tinyMCE.init({   
  2.         // General options   
  3.         mode : "textareas",   
  4.         theme : "advanced",   
  5.         plugins : "autolink,lists,spellchecker,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",   
  6.   
  7.         // Theme options   
  8.         theme_advanced_buttons1 : "save,newdocument,|,bold,italic,underline,strikethrough,|,justifyleft,justifycenter,justifyright,justifyfull,|,styleselect,formatselect,fontselect,fontsizeselect",   
  9.         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",   
  10.         theme_advanced_buttons3 : "tablecontrols,|,hr,removeformat,visualaid,|,sub,sup,|,charmap,emotions,iespell,media,advhr,|,print,|,ltr,rtl,|,fullscreen",   
  11.         theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,spellchecker,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,blockquote,pagebreak,|,insertfile,insertimage",   
  12.         theme_advanced_toolbar_location : "top",   
  13.         theme_advanced_toolbar_align : "left",   
  14.         theme_advanced_statusbar_location : "bottom",   
  15.         theme_advanced_resizing : true,   
  16.   
  17.         // Skin options   
  18.         skin : "o2k7",   
  19.         skin_variant : "silver",   
  20.   
  21.         // Example content CSS (should be your site CSS)   
  22.         content_css : "css/example.css",   
  23.   
  24.         // Drop lists for link/image/media/template dialogs   
  25.         template_external_list_url : "js/template_list.js",   
  26.         external_link_list_url : "js/link_list.js",   
  27.         external_image_list_url : "js/image_list.js",   
  28.         media_external_list_url : "js/media_list.js",   
  29.   
  30.         // Replace values for the template plugin   
  31.         template_replace_values : {   
  32.                 username : "Some User",   
  33.                 staffid : "991234"  
  34.         }   
  35. });  

留言