<commit_before># What is dropfile.js
dropfile.js is a shim/polyfill for adding support for dragging files from the desktop to IE browsers prior to IE10 and FF prior to 3.6 browsers

# How to use dropfile.js

1, Save *dropfile.js* and *dropfile.xap* into the same directory on your site.
2. Add to the bottom of you page the dropfile.js script
	<script src="somepath/dropfile.js"></script>
3. Add HTML5 code for handling the action on an element, here i'm attaching event handling to my #holder element.
    window.onload = function () {
        var holder = document.getElementById('holder');
        holder.ondragover = function () { return false; };
        holder.ondragenter = function () { return false; };
        holder.ondrop = function (e) {
            e = e || window.event;

            // Read from e.files, as well as e.dataTransfer
            var files = (e.files || e.dataTransfer.files);

            var s = "";
            for (var i = 0; i < files.length; i++) {
                (function (i) {
                    var reader = new FileReader();
                    reader.onload = function (event) {
                        holder.innerHTML = "<li><img src='" + event.target.result + "' /> " + (files[i].name) + "</li>" + holder.innerHTML;
                    };
                    reader.readAsDataURL(files[i]);
                })(i);
            }

            return false;
        };
    }


# dropfile.js on GitHub

1. MIT license, so anyone can use it, modify it, and add it to their own application.
2. "source" folder contains the Visual Studiio Solution files if you fancy modifying the code


# To Do

Shim up <input type="file" onchange="handleFiles(this.files)" >. Aka.. add file references to the file object + trigger te onchange event.<commit_msg>README update<commit_after># What is dropfile.js
dropfile.js is a shim/polyfill for adding support for dragging files from the desktop to IE browsers prior to IE10 and FF prior to 3.6 browsers

# How to use dropfile.js

1. Save *dropfile.js* and *dropfile.xap* into the same directory on your site.

2. Add to the bottom of you page the dropfile.js script `<script src="somepath/dropfile.js"></script>`

3. Add HTML5 code for handling the action on an element, here i'm attaching event handling to my #holder element.

		window.onload = function () {
		    var holder = document.getElementById('holder');
		    holder.ondragover = function () { return false; };
		    holder.ondragenter = function () { return false; };
		    holder.ondrop = function (e) {
		        e = e || window.event;
		
		        // Read from e.files, as well as e.dataTransfer
		        var files = (e.files || e.dataTransfer.files);
		
		        var s = "";
		        for (var i = 0; i < files.length; i++) {
		            (function (i) {
		                var reader = new FileReader();
		                reader.onload = function (event) {
		                    holder.innerHTML = "<li><img src='" + event.target.result + "' /> " + (files[i].name) + "</li>" + holder.innerHTML;
		                };
		                reader.readAsDataURL(files[i]);
		            })(i);
		        }
		
		        return false;
		    };
		}


# Contribute

1. MIT license, so anyone can use it, modify it, and add it to their own application.
2. "source" folder contains the Visual Studiio Solution files if you fancy modifying the code


## To Do

Shim up `<input type="file" onchange="handleFiles(this.files)" >`. Aka.. add file references to the file object + trigger te onchange event.
{'fraction_non_alphanumeric': 0.10985277463193659, 'fraction_numerical': 0.00622876557191393, 'mean_word_length': 2.2353479853479854, 'pattern_counts': {'":': 0, '<': 17, '<?xml version=': 0, '>': 15, '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': '7008282', 'n_tokens_mistral': 1053, 'n_tokens_neox': 962, 'n_words': 380}