Newer
Older
dmpopidor / app / views / notes / archive.js.erb

// remove all tinymce explicitly or re-init will not work later
tinymce.remove(".tinymce");

// render the list of notes and invisible view and edit sections 
<% listlabel = "#comment-question-area-#{@question.id}" %>
$("<%=listlabel%>").html( 
    "<%= escape_javascript( render partial: '/phases/note', locals: {question: @question, answer: @answer, plan: @plan } ) %>"
);

// TODO: this duplicates what is in the .yml file
// DRY it out!
tinymce.init({
  selector: ".tinymce",
  statusbar: false,
  menubar: false,
  toolbar: "bold italic | bullist numlist | link | table",
  plugins: [ "table", "link", "paste" ],
  target_list: false, 
  autoresize_min_height: 130,
  extended_valid_elements: [ "a[href|target=_blank]" ],
  paste_auto_cleanup_on_paste : true,
  paste_remove_styles: true,
  paste_retain_style_properties: "none",
  paste_convert_middot_lists: true,
  paste_remove_styles_if_webkit: true,
  paste_remove_spans: true,
  paste_strip_class_attributes: "all"
});