<commit_before>define([
    "pat-registry",
    "raptor",
    "pat-modal",
    "pat-upload"
], function(registry, Raptor, Modal) {
    'use strict';

    var Image = new Raptor.Button({
      name: 'pat-raptor-image',
      action: function() {
        this.raptor.pause();
        this.$modal = $(
          '<div class="pat-modal">' +
          '  <h3>Upload Image<h3>' +
          '  <div class="pat-upload" data-pat-upload="url: https://example.org/upload; label: Drop files here to upload or click to browse.; trigger: button" />' +
          '</div>'
        ).appendTo('body');
        registry.scan(this.$modal);
      }
    });

    Raptor.registerUi(Image);
<commit_msg>insert (currently inline) image that is being uploaded<commit_after>define([
    "pat-registry",
    "raptor",
    "pat-modal",
    "pat-upload"
], function(registry, Raptor, Modal) {
    'use strict';

    var Image = new Raptor.Button({
      name: 'pat-raptor-image',
      action: function() {
        this.raptor.pause();
        this.$modal = $(
          '<div class="pat-modal">' +
          '  <h3>Upload Image<h3>' +
          '  <div class="pat-upload" data-pat-upload="url: https://example.org/upload; label: Drop files here to upload or click to browse.; trigger: button" />' +
          '</div>'
        ).appendTo('body');

        registry.scan(this.$modal);

        var raptor = this.raptor;
        $('.pat-upload', this.$modal)
            .data('pattern-upload')
            .dropzone.on('complete', function(file) {
                var image = $('img', file.previewElement).first().attr('src');
                raptor.actionApply(function() {
                    Raptor.selectionReplace($('<img src="' + image + '"/>')[0])
                }.bind(this));
                $(this.element).parents('.pat-modal').data('pattern-modal').destroy()
            });

      }
    });

    Raptor.registerUi(Image);

{'fraction_non_alphanumeric': 0.17995802728226654, 'fraction_numerical': 0.0026232948583420775, 'mean_word_length': 2.121112929623568, 'pattern_counts': {'":': 0, '<': 14, '<?xml version=': 0, '>': 14, 'https://': 2, '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': '6402780', 'n_tokens_mistral': 599, 'n_tokens_neox': 585, 'n_words': 114}