<commit_before>if (!RedactorPlugins) var RedactorPlugins = {};

/**
 * Handles drag&drop upload using the attachment system for Redactor.
 * 
 * @author	<NAME>
 * @copyright	2001-2014 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 */
RedactorPlugins.wupload = function() {
	"use strict";
	
	return {
		_boundGlobalUploadEvents: false,
		_dropArea: { },
		_timer: null,
		_isDragging: false,
		_isFile: false,
		
		/**
		 * Initializes the RedactorPlugins.wupload plugin.
		 */
		init: function() {
			var $namespace = '.redactor_' + this.$textarea.wcfIdentify();
			$(document).on('dragover' + $namespace, $.proxy(this.wupload._dragOver, this));
			$(document).on('dragleave' + $namespace, $.proxy(this.wupload._dragLeave, this));
			$(document).on('drop' + $namespace, (function(event) {
				event.preventDefault();
				
				this.wupload._revertDropArea(undefined, this.$textarea.wcfIdentify());
			}).bind(this));
			
			if (!this.wupload._boundGlobalUploadEvents) {
				this.wupload._boundGlobalUploadEvents = true;
				
				$(document).on('dragend', function(event) { event.preventDefault(); });
			}
			
			WCF.System.Event.addListener('com.woltlab.wcf.attachment', 'autoInsert_' + this.$textarea.wcfIdentify(), $.proxy(this.wupload.insertPastedImageAttachment, this));
		},
		
		/**
		 * Handles an actively dragged object.
		 * 
		 * @param	object		event
		 */
		_dragOver: function(event) {
			event = event.originalEvent;
			
			if (!event.dataTransfer || !event.dataTransfer.types) {<commit_msg>Prevent drag&drop of on-page elements<commit_after>if (!RedactorPlugins) var RedactorPlugins = {};

/**
 * Handles drag&drop upload using the attachment system for Redactor.
 * 
 * @author	<NAME>
 * @copyright	2001-2014 WoltLab GmbH
 * @license	GNU Lesser General Public License <http://opensource.org/licenses/lgpl-license.php>
 */
RedactorPlugins.wupload = function() {
	"use strict";
	
	return {
		_boundGlobalUploadEvents: false,
		_dropArea: { },
		_timer: null,
		_isDragging: false,
		_isFile: false,
		
		/**
		 * Initializes the RedactorPlugins.wupload plugin.
		 */
		init: function() {
			var $namespace = '.redactor_' + this.$textarea.wcfIdentify();
			$(document).on('dragstart' + $namespace, function() { return false; });
			$(document).on('dragover' + $namespace, $.proxy(this.wupload._dragOver, this));
			$(document).on('dragleave' + $namespace, $.proxy(this.wupload._dragLeave, this));
			$(document).on('drop' + $namespace, (function(event) {
				event.preventDefault();
				
				this.wupload._revertDropArea(undefined, this.$textarea.wcfIdentify());
			}).bind(this));
			
			if (!this.wupload._boundGlobalUploadEvents) {
				this.wupload._boundGlobalUploadEvents = true;
				
				$(document).on('dragend', function(event) { event.preventDefault(); });
			}
			
			WCF.System.Event.addListener('com.woltlab.wcf.attachment', 'autoInsert_' + this.$textarea.wcfIdentify(), $.proxy(this.wupload.insertPastedImageAttachment, this));
		},
		
		/**
		 * Handles an actively dragged object.
		 * 
		 * @param	object		event
		 */
		_dragOver: function(event) {
			event = event.originalEvent;
			
			if (!event.dataTransfer || !event.dataTransfer.types) {
{'fraction_non_alphanumeric': 0.1561051004636785, 'fraction_numerical': 0.004945904173106646, 'mean_word_length': 3.993827160493827, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, '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': '4554367', 'n_tokens_mistral': 1201, 'n_tokens_neox': 1018, 'n_words': 193}