<commit_before>{textarea} = React.DOM

modulejs.define 'components/itsi_authoring/rich_text_editor',
[],
->

  React.createClass
    shouldComponentUpdate: ->
      false

    onChange: (editor) ->
      @props.onChange editor.getContent()

    componentDidMount: ->
      @node = $(React.findDOMNode(@refs.textarea))
      @node.tinymce
        menubar: false
        statusbar: false
        toolbar_items_size: 'small'
        toolbar: "undo redo | bold italic strikethrough underline | aligncenter alignjustify alignleft alignright indent outdent | subscript superscript | numlist bullist | link unlink | hr image table pastetext | code"
        plugins: 'paste link hr image table code'
        paste_as_text: true
        setup: (editor) =>
          # both events are needed as the 'change' event is only sent when the input loses focus (which handles menu choices like formatting)
          editor.on 'keyup', (e) =>
            @onChange editor
          editor.on 'change', (e) =>
            @onChange editor

    render: ->
      (textarea {ref: 'textarea', name: @props.name, cols: 100, rows: 5, defaultValue: @props.text})
<commit_msg>Removed paste as text and code icons<commit_after>{textarea} = React.DOM

modulejs.define 'components/itsi_authoring/rich_text_editor',
[],
->

  React.createClass
    shouldComponentUpdate: ->
      false

    onChange: (editor) ->
      @props.onChange editor.getContent()

    componentDidMount: ->
      @node = $(React.findDOMNode(@refs.textarea))
      @node.tinymce
        menubar: false
        statusbar: false
        toolbar_items_size: 'small'
        toolbar: "undo redo | bold italic strikethrough underline | aligncenter alignjustify alignleft alignright indent outdent | subscript superscript | numlist bullist | link unlink | hr image table"
        plugins: 'paste link hr image table'
        paste_as_text: true
        setup: (editor) =>
          # both events are needed as the 'change' event is only sent when the input loses focus (which handles menu choices like formatting)
          editor.on 'keyup', (e) =>
            @onChange editor
          editor.on 'change', (e) =>
            @onChange editor

    render: ->
      (textarea {ref: 'textarea', name: @props.name, cols: 100, rows: 5, defaultValue: @props.text})
{'fraction_non_alphanumeric': 0.10052219321148825, 'fraction_numerical': 0.0034812880765883376, 'mean_word_length': 2.806291390728477, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 19, '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': '4942401', 'n_tokens_mistral': 682, 'n_tokens_neox': 648, 'n_words': 203}