<commit_before>var m = require('mithril');
var $osf = require('js/osfHelpers');
var waterbutler =  require('js/waterbutler');

require('css/quick-project-search-plugin.css');
require('loaders.css/loaders.min.css');

var Dropzone = require('dropzone');

// Don't show dropped content if user drags outside dropzone
window.ondragover = function(e) { e.preventDefault(); };
window.ondrop = function(e) { e.preventDefault(); };


var xhrconfig = function(xhr) {
    xhr.withCredentials = true;

};

var ShareWindowDropzone = {

  controller: function() {
    var shareWindowId;
    var url = $osf.apiV2Url('users/me/nodes/', { query : { 'filter[category]' : 'share window'}});
    var promise = m.request({method: 'GET', url : url, config : xhrconfig, background: true});
    promise.then(function(result) {
        shareWindowId = result.data[0].id;
    });

    Dropzone.options.shareWindowDropzone = {
            clickable: '#shareWindowDropzone',

            accept: function(file, done) {
                this.options.url = waterbutler.buildUploadUrl(false,'osfstorage',shareWindowId, file,{});
                done();
            },

            sending: function(file, xhr) {
             //Hack to remove webkitheaders
             var _send = xhr.send;
             xhr.send = function() {
                 _send.call(xhr, file);
             };
         }

    };

    $('#shareWindowDropzone').dropzone({
                               withCredentials: true,
                               url:'placeholder',
                               method:'put',
                               previewTemplate: '<div class="text-center dz-filename"><span data-dz-name></span> has been uploaded to your Share Window</div>'
                               });

  },
  view: function(ctrl, args) {
          return m('div.p-v-xl.text-center .pointer .panel #shareWindowDropzone',m('p',m('h1',  'Drag and drop files to upload them')), "Having trouble click anywhere in this box to manually upload a file");
  }
};

module.exports = ShareWindowDropzone;
<commit_msg>Typos<commit_after>var m = require('mithril');
var $osf = require('js/osfHelpers');
var waterbutler =  require('js/waterbutler');

require('css/quick-project-search-plugin.css');
require('loaders.css/loaders.min.css');

var Dropzone = require('dropzone');

// Don't show dropped content if user drags outside dropzone
window.ondragover = function(e) { e.preventDefault(); };
window.ondrop = function(e) { e.preventDefault(); };


var xhrconfig = function(xhr) {
    xhr.withCredentials = true;

};

var ShareWindowDropzone = {

  controller: function() {
    var shareWindowId;
    var url = $osf.apiV2Url('users/me/nodes/', { query : { 'filter[category]' : 'share window'}});
    var promise = m.request({method: 'GET', url : url, config : xhrconfig, background: true});
    promise.then(function(result) {
        shareWindowId = result.data[0].id;
    });

    Dropzone.options.shareWindowDropzone = {
            clickable: '#shareWindowDropzone',

            accept: function(file, done) {
                this.options.url = waterbutler.buildUploadUrl(false,'osfstorage',shareWindowId, file,{});
                done();
            },

            sending: function(file, xhr) {
             //Hack to remove webkitheaders
             var _send = xhr.send;
             xhr.send = function() {
                 _send.call(xhr, file);
             };
         }

    };

    $('#shareWindowDropzone').dropzone({
                               withCredentials: true,
                               url:'placeholder',
                               method:'put',
                               previewTemplate: '<div class="text-center dz-filename"><span data-dz-name></span> has been uploaded to your Share Window</div>'
                               });

  },
  view: function(ctrl, args) {
          return m('div.p-v-xl.text-center .pointer .panel #shareWindowDropzone', m('p', m('h1',  'Drag and drop files here'), 'Having trouble? Click anywhere in this box to manually upload a file.'));
  }
};

module.exports = ShareWindowDropzone;

{'fraction_non_alphanumeric': 0.14028251339503167, 'fraction_numerical': 0.0014612761811982464, 'mean_word_length': 2.3067632850241546, 'pattern_counts': {'":': 0, '<': 11, '<?xml version=': 0, '>': 11, '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': '7268', 'n_tokens_mistral': 1185, 'n_tokens_neox': 1168, 'n_words': 260}