<commit_before><% content_for :script do %>
  <%= javascript_include_tag "tinymce/jquery.tinymce" %>
  <script>
    function load_tinymce(){
      $("textarea[data-simple!=true]").tinymce({
        script_url: "/javascripts/tinymce/tiny_mce.js",
        theme: "advanced",
        skin: "cirkuit",
        mode: "textareas",
        theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,formatselect,|,link,unlink,image,code",
        theme_advanced_buttons2 : "",
        theme_advanced_buttons3 : "",
        theme_advanced_toolbar_location: "top",
        theme_advanced_toolbar_align: "left",
        // theme_advanced_statusbar_location : "bottom",
        theme_advanced_resizing: true
      });
    }
  </script>
<% end %>

<%= text_area resource_name, field.name, :rows=>(field.rows || 20), :"data-simple"=>field.simple %>
<script type="text/javascript">
   $(function(){
      load_tinymce(); 
    })
</script><commit_msg>support multiple textareas with tinymce<commit_after><% if @textarea_component_include_tinymce_once.nil? %>
  <% @textarea_component_include_tinymce_once = "done" %>
  <% content_for :script do %>
    <%= javascript_include_tag "tinymce/jquery.tinymce" %>
    <script>
      function load_tinymce(){
        $("textarea[data-simple!=true]").tinymce({
          script_url: "/javascripts/tinymce/tiny_mce.js",
          theme: "advanced",
          skin: "cirkuit",
          mode: "textareas",
          theme_advanced_buttons1 : "bold,italic,underline,|,justifyleft,justifycenter,justifyright,|,formatselect,|,link,unlink,image,code",
          theme_advanced_buttons2 : "",
          theme_advanced_buttons3 : "",
          theme_advanced_toolbar_location: "top",
          theme_advanced_toolbar_align: "left",
          // theme_advanced_statusbar_location : "bottom",
          theme_advanced_resizing: true
        });
      }
     $(document).ready(
       $(function(){
          load_tinymce();
        })
     )
    </script>
  <% end %>
<% end %>

<%= text_area resource_name, field.name, :rows=>(field.rows || 20), :"data-simple"=>field.simple %>
{'fraction_non_alphanumeric': 0.15044663845792194, 'fraction_numerical': 0.004701457451810061, 'mean_word_length': 3.3340122199592668, 'pattern_counts': {'":': 0, '<': 20, '<?xml version=': 0, '>': 24, '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': '3826071', 'n_tokens_mistral': 739, 'n_tokens_neox': 673, 'n_words': 92}