<commit_before>(function() {
  var htmlEscape = require('str/htmlEscape');
  CKEDITOR.plugins.add('instructure_image', {
    icons: 'instructure_image',
    hidpi: true,
    init: function(editor) {
      editor.addCommand('instructureImage', {
        exec: function(api) {
          var selectedNode = null;
          if (api.getSelection() && api.getSelection().getSelectedElement()) {
            selectedNode = $(api.getSelection().getSelectedElement().$);
          }
          require(['compiled/views/ckeditor/InsertUpdateImageView'], function(InsertUpdateImageView){
            new InsertUpdateImageView(api, selectedNode);
          });
        }
      });
      editor.ui.addButton('instructure_image', {
        label: 'Embed Image',
        command: 'instructureImage',
        toolbar: 'insert'
      });
      editor.on('doubleclick', function(evt) {
        var element = evt.data.element;
        if (element.is('img') && !element.data('cke-realelement') && !element.isReadOnly()) {
          editor.execCommand('instructureImage');
        }
      });
    }
  });
})();

<commit_msg>CNS-663: Implement CKEditor WYSIWYG<commit_after>(function() {
  var htmlEscape = require('str/htmlEscape');
  CKEDITOR.plugins.add('instructure_image', {
    icons: 'instructure_image',
    hidpi: true,
    init: function(editor) {
      editor.addCommand('instructureImage', {
        exec: function(api) {
          var selectedNode = null;
          if (api.getSelection() && api.getSelection().getSelectedElement()) {
            selectedNode = $(api.getSelection().getSelectedElement().$);
          }
          require(['compiled/views/ckeditor/InsertUpdateImageView'], function(InsertUpdateImageView){
            new InsertUpdateImageView(api, selectedNode);
          });
        }
      });
      editor.ui.addButton('instructure_image', {
        label: 'Embed Image',
        command: 'instructureImage',
        toolbar: 'insert'
      });
      editor.on('doubleclick', function(evt) {
        var element = evt.data.element;
        if (element.is('img') && !element.data('cke-realelement') && !element.isReadOnly()) {
          editor.execCommand('instructureImage');
        }
        evt.cancel();
      });
    }
  });
})();


{'fraction_non_alphanumeric': 0.15302491103202848, 'fraction_numerical': 0.0013345195729537367, 'mean_word_length': 2.6450567260940034, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, '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': '5935436', 'n_tokens_mistral': 645, 'n_tokens_neox': 636, 'n_words': 94}