<commit_before>define(['jquery', 'underscore', 'backbone', 'text!templates/imageUploader/uploaderview.html', 
  'utility/s3upload'],
  function($, _, Backbone, Template, S3Upload) {

  var UploaderView = Backbone.View.extend({
    tagName: 'div',
    template: _.template( Template ),

    events: {
      'change #files' : 'uploadFileToS3'
    },

    initialize:function () {
      this.render();
    },

    render: function() {
      this.$el.html(this.template());
      return this;
    },

    uploadFileToS3 : function (){
      var s3upload = new S3Upload({
        file_dom_selector: this.$el.find('#files'),
        s3_sign_put_url: '/api/sign_s3',
        this.check = url;
        onProgress: function(percent, message) {
            this.$el.find('#status').html('Upload progress: ' + percent + '% ' + message);
        },
        onFinishS3Put: function(public_url) {
            this.$el.find('#status').html('Upload completed. Uploaded to: '+ public_url);
            this.$el.find('#avatar_url').val(public_url);
            this.$el.find('#preview').html('<img src="'+public_url+'" style="width:300px;" />');
        },
        onError: function(status) {
            $this.$el.find('#status').html('Upload error: ' + status);
        }
      });
      console.log('this.check');
    }
  });
  return UploaderView;
});<commit_msg>new uploader<commit_after>define(['jquery', 'underscore', 'backbone', 'text!templates/imageUploader/uploaderview.html', 
  'utility/s3upload'],
  function($, _, Backbone, Template, S3Upload) {

  var UploaderView = Backbone.View.extend({
    tagName: 'div',
    template: _.template( Template ),

    events: {
      'change #files' : 'uploadFileToS3'
    },

    initialize:function () {
      this.render();
    },

    render: function() {
      this.$el.html(this.template());
      return this;
    },

    uploadFileToS3 : function (){
      var s3upload = new S3Upload({
        file_dom_selector: this.$el.find('#files'),
        s3_sign_put_url: '/api/sign_s3',
        this.check = 'url',
        onProgress: function(percent, message) {
            this.$el.find('#status').html('Upload progress: ' + percent + '% ' + message);
        },
        onFinishS3Put: function(public_url) {
            this.$el.find('#status').html('Upload completed. Uploaded to: '+ public_url);
            this.$el.find('#avatar_url').val(public_url);
            this.$el.find('#preview').html('<img src="'+public_url+'" style="width:300px;" />');
        },
        onError: function(status) {
            $this.$el.find('#status').html('Upload error: ' + status);
        }
      });
      console.log('this.check');
    }
  });
  return UploaderView;
});
{'fraction_non_alphanumeric': 0.18006669136717302, 'fraction_numerical': 0.00889218228973694, 'mean_word_length': 2.678474114441417, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, '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': '665863', 'n_tokens_mistral': 862, 'n_tokens_neox': 839, 'n_words': 133}