blog.js 1.3 KB

123456789101112131415161718192021222324252627282930313233
  1. (function() {
  2. var origInit = SN.Init.NoticeFormSetup;
  3. SN.Init.NoticeFormSetup = function(form) {
  4. origInit(form);
  5. var content = form.find("#blog-entry-content");
  6. if (content.length > 0) {
  7. content.tinymce({
  8. script_url : window._tinymce_path,
  9. // General options
  10. theme : "advanced",
  11. plugins : "paste,fullscreen,autoresize,autolink,inlinepopups,tabfocus",
  12. theme_advanced_buttons1 : "bold,italic,strikethrough,|,undo,redo,|,link,unlink,image",
  13. theme_advanced_buttons2 : "",
  14. theme_advanced_buttons3 : "",
  15. add_form_submit_trigger : false,
  16. theme_advanced_resizing : true,
  17. tabfocus_elements: ":prev,:next",
  18. setup: function(ed) {
  19. form.find('.submit:first').click(function() {
  20. tinymce.triggerSave();
  21. });
  22. form.find('input[type=file]').change(function() {
  23. var img = '<img src="'+window._tinymce_placeholder+'" class="placeholder" width="320" height="240">';
  24. var html = tinyMCE.activeEditor.getContent();
  25. ed.setContent(html + img);
  26. });
  27. }
  28. });
  29. }
  30. };
  31. })();