formeditor.js 1.1 KB

123456789101112131415161718192021222324252627
  1. (function($) {
  2. "use strict";
  3. if($("#elm1").length > 0){
  4. tinymce.init({
  5. selector: "textarea#elm1",
  6. theme: "modern",
  7. height:300,
  8. plugins: [
  9. "advlist autolink link image lists charmap print preview hr anchor pagebreak spellchecker",
  10. "searchreplace wordcount visualblocks visualchars code fullscreen insertdatetime media nonbreaking",
  11. "save table contextmenu directionality emoticons template paste textcolor"
  12. ],
  13. toolbar: "insertfile undo redo | styleselect | bold italic | alignleft aligncenter alignright alignjustify | bullist numlist outdent indent | l ink image | print preview media fullpage | forecolor backcolor emoticons",
  14. style_formats: [
  15. {title: 'Bold text', inline: 'b'},
  16. {title: 'Red text', inline: 'span', styles: {color: '#ff0000'}},
  17. {title: 'Red header', block: 'h1', styles: {color: '#ff0000'}},
  18. {title: 'Example 1', inline: 'span', classes: 'example1'},
  19. {title: 'Example 2', inline: 'span', classes: 'example2'},
  20. {title: 'Table styles'},
  21. {title: 'Table row 1', selector: 'tr', classes: 'tablerow1'}
  22. ]
  23. });
  24. }
  25. })(jQuery);