editor tinymce multiple instances


/ Published in: JavaScript
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <script language="javascript" type="text/javascript">
  2. tinyMCE.init({
  3. editor_selector : "mceEditor1",
  4. mode : "textareas"
  5. });
  6.  
  7. tinyMCE.init({
  8. editor_selector : "mceEditor2",
  9. mode : "textareas",
  10. theme : "advanced",
  11. plugins : "devkit,style,layer,table,save,advhr,advimage,advlink,emotions,iespell,insertdatetime,preview,media,searchreplace,print,contextmenu,paste,directionality,fullscreen,noneditable,visualchars,nonbreaking,xhtmlxtras,template",
  12. theme_advanced_buttons1_add_before : "save,newdocument,separator",
  13. theme_advanced_buttons1_add : "fontselect,fontsizeselect",
  14. theme_advanced_buttons2_add : "separator,insertdate,inserttime,preview,separator,forecolor,backcolor",
  15. theme_advanced_buttons2_add_before: "cut,copy,paste,pastetext,pasteword,separator,search,replace,separator",
  16. theme_advanced_buttons3_add_before : "tablecontrols,separator",
  17. theme_advanced_buttons3_add : "emotions,iespell,media,advhr,separator,print,separator,ltr,rtl,separator,fullscreen",
  18. theme_advanced_buttons4 : "insertlayer,moveforward,movebackward,absolute,|,styleprops,|,cite,abbr,acronym,del,ins,attribs,|,visualchars,nonbreaking,template,|,code",
  19. theme_advanced_toolbar_location : "top",
  20. theme_advanced_toolbar_align : "left",
  21. theme_advanced_path_location : "bottom",
  22. content_css : "example_full.css",
  23. plugin_insertdate_dateFormat : "%Y-%m-%d",
  24. plugin_insertdate_timeFormat : "%H:%M:%S",
  25. extended_valid_elements : "hr[class|width|size|noshade],font[face|size|color|style],span[class|align|style]",
  26. external_link_list_url : "example_link_list.js",
  27. external_image_list_url : "example_image_list.js",
  28. flash_external_list_url : "example_flash_list.js",
  29. media_external_list_url : "example_media_list.js",
  30. template_external_list_url : "example_template_list.js",
  31. file_browser_callback : "fileBrowserCallBack",
  32. theme_advanced_resize_horizontal : false,
  33. theme_advanced_resizing : true,
  34. nonbreaking_force_tab : true,
  35. apply_source_formatting : true
  36. });
  37.  
  38. function fileBrowserCallBack(field_name, url, type, win) {
  39. // This is where you insert your custom filebrowser logic
  40. alert("Example of filebrowser callback: field_name: " + field_name + ", url: " + url + ", type: " + type);
  41.  
  42. // Insert new URL, this would normaly be done in a popup
  43. win.document.forms[0].elements[field_name].value = "someurl.htm";
  44. }
  45. </script>

URL: http://tinymce.moxiecode.com/punbb/viewtopic.php?id=10853

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.