<commit_before><%= javascript_include_tag 'tinymce/jscripts/tiny_mce/tiny_mce.js' %>
<script type="text/javascript">
  var myplugins = "searchreplace,print,table";
  var first_line, second_line;
  var mode = '<%= mode ||= false %>'
  <% if mode %>
    first_line = "fontsizeselect,bold,italic,underline,bullist,numlist,justifyleft,justifycenter,justifyright,link,unlink"
    second_line = ""
  <% else %>
    first_line = "print,separator,copy,paste,separator,undo,redo,separator,search,replace,separator,fontsizeselect,formatselect"
    second_line = "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,link,unlink,image,table,separator,cleanup,code"
  <% end %>

  if (tinymce.isIE) {
    // the paste plugin is only useful in Internet Explorer
    myplugins = "paste," + myplugins;
  }
tinyMCE.init({
        mode : "textareas",
        editor_selector : "mceEditor",
        theme : "advanced",
        relative_urls : false,
        remove_script_host : true,
        plugins: myplugins,
        theme_advanced_toolbar_location : "top",
        theme_advanced_layout_manager: 'SimpleLayout',
        theme_advanced_buttons1 : first_line,
        theme_advanced_buttons2 : second_line,
        theme_advanced_buttons3 : "",
        theme_advanced_blockformats :"p,address,pre,h2,h3,h4,h5,h6",
        paste_auto_cleanup_on_paste : true,
        paste_insert_word_content_callback : "convertWord",
        paste_use_dialog: false,
        apply_source_formatting : true,
        extended_valid_elements : "applet[style|archive|codebase|code|height|width],comment,iframe[src|style|allowtransparency|frameborder|width|height|scrolling]",
        content_css: '/stylesheets/tinymce.css',
        language: <%= tinymce_language.inspect %>,
        entity_encoding: 'raw'
        });

function convertWord(type, content) {
  switch (type) {
    // Gets executed before the built in logic performes it's cleanups
    case "before":
      //content = content.toLowerCase(); // Some dummy logic
      break;

    // Gets executed after the built in logic performes it's cleanups
    case "after":
      content = content.replace(/<!--\s*-->/, '');
      break;
  }

  return content;
}

</script>
<commit_msg>Added contextmenu and forecolor on tinymce<commit_after><%= javascript_include_tag 'tinymce/jscripts/tiny_mce/tiny_mce.js' %>
<script type="text/javascript">
  var myplugins = "searchreplace,print,table,contextmenu";
  var first_line, second_line;
  var mode = '<%= mode ||= false %>'
  <% if mode %>
    first_line = "fontsizeselect,bold,italic,underline,bullist,numlist,justifyleft,justifycenter,justifyright,link,unlink"
    second_line = ""
  <% else %>
    first_line = "print,separator,copy,paste,separator,undo,redo,separator,search,replace,separator,forecolor,fontsizeselect,formatselect"
    second_line = "bold,italic,underline,strikethrough,separator,bullist,numlist,separator,justifyleft,justifycenter,justifyright,justifyfull,separator,link,unlink,image,table,separator,cleanup,code"
  <% end %>

  if (tinymce.isIE) {
    // the paste plugin is only useful in Internet Explorer
    myplugins = "paste," + myplugins;
  }
tinyMCE.init({
        mode : "textareas",
        editor_selector : "mceEditor",
        theme : "advanced",
        relative_urls : false,
        remove_script_host : true,
        plugins: myplugins,
        theme_advanced_toolbar_location : "top",
        theme_advanced_layout_manager: 'SimpleLayout',
        theme_advanced_buttons1 : first_line,
        theme_advanced_buttons2 : second_line,
        theme_advanced_buttons3 : "",
        theme_advanced_blockformats :"p,address,pre,h2,h3,h4,h5,h6",
        paste_auto_cleanup_on_paste : true,
        paste_insert_word_content_callback : "convertWord",
        paste_use_dialog: false,
        apply_source_formatting : true,
        extended_valid_elements : "applet[style|archive|codebase|code|height|width],comment,iframe[src|style|allowtransparency|frameborder|width|height|scrolling]",
        content_css: '/stylesheets/tinymce.css',
        language: <%= tinymce_language.inspect %>,
        entity_encoding: 'raw'
        });

function convertWord(type, content) {
  switch (type) {
    // Gets executed before the built in logic performes it's cleanups
    case "before":
      //content = content.toLowerCase(); // Some dummy logic
      break;

    // Gets executed after the built in logic performes it's cleanups
    case "after":
      content = content.replace(/<!--\s*-->/, '');
      break;
  }

  return content;
}

</script>

{'fraction_non_alphanumeric': 0.11810512654120701, 'fraction_numerical': 0.0034609560891196195, 'mean_word_length': 3.9935205183585314, 'pattern_counts': {'":': 4, '<': 21, '<?xml version=': 0, '>': 21, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '794466', 'n_tokens_mistral': 1506, 'n_tokens_neox': 1413, 'n_words': 247}