Your IP : 216.73.217.68


Current Path : /home/w/u/e/wuectly/www/03cbe/
Upload File :
Current File : /home/w/u/e/wuectly/www/03cbe/dragdrop.zip

PK�#]Z\
���
plugin.min.jsnu&1i�tinymce.PluginManager.add("jdragdrop",function(e){function t(t){var r=new FormData;r.append("Filedata",t),r.append("folder",tinyMCE.activeEditor.settings.mediaUploadPath);var n=new XMLHttpRequest;n.upload.onprogress=function(e){var t=e.loaded/e.total*100;document.querySelector(".bar").style.width=t+"%"},removeProgessBar=function(){setTimeout(function(){var t=document.querySelector("#jloader");t.parentNode.removeChild(t),e.contentAreaContainer.style.borderWidth="1px 0 0 0"},200)},n.onload=function(){var t=JSON.parse(n.responseText);if(200==n.status){if("0"==t.status&&(removeProgessBar(),e.windowManager.alert(t.message+": "+tinyMCE.activeEditor.settings.setCustomDir+t.location)),"1"==t.status){removeProgessBar();var r=tinyMCE.activeEditor.getDoc().createElement("img");r.src=tinyMCE.activeEditor.settings.setCustomDir+t.location,tinyMCE.activeEditor.execCommand("mceInsertContent",!1,r.outerHTML)}}else removeProgessBar()},n.onerror=function(){removeProgessBar()},n.open("POST",tinyMCE.activeEditor.settings.uploadUri,!0),n.send(r)}tinyMCE.DOM.bind(document,"dragleave",function(e){return e.stopPropagation(),e.preventDefault(),tinyMCE.activeEditor.contentAreaContainer.style.borderWidth="1px 0 0",!1}),"undefined"!=typeof FormData?(e.on("dragenter",function(e){return e.stopPropagation(),!1}),e.on("dragover",function(t){return t.preventDefault(),e.contentAreaContainer.style.borderStyle="dashed",e.contentAreaContainer.style.borderWidth="5px",!1}),e.on("drop",function(r){if(r.dataTransfer&&r.dataTransfer.files&&r.dataTransfer.files.length>0)for(var n,a=0;n=r.dataTransfer.files[a];a++){if(n.name.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)){var o,i,s="";(o=document.createElement("div")).id="jloader",(i=document.createElement("div")).classList.add("progress"),i.classList.add("progress-success"),i.classList.add("progress-striped"),i.classList.add("active"),i.style.width="100%",i.style.height="30px",(s=document.createElement("div")).classList.add("bar"),s.style.width="0",i.appendChild(s),o.appendChild(i),document.querySelector(".mce-toolbar-grp").appendChild(o),t(n)}r.preventDefault()}e.contentAreaContainer.style.borderWidth="1px 0 0"})):(Joomla.renderMessages({error:[Joomla.JText._("PLG_TINY_ERR_UNSUPPORTEDBROWSER")]}),e.on("drop",function(e){return e.preventDefault(),!1}))});PK�#]����	plugin.jsnu&1i�tinymce.PluginManager.add('jdragdrop', function(editor) {

	// Reset the drop area border
	tinyMCE.DOM.bind(document, 'dragleave', function(e) {
		e.stopPropagation();
		e.preventDefault();
		tinyMCE.activeEditor.contentAreaContainer.style.borderWidth = '1px 0 0';

		return false;
	});

	// The upload logic
	function UploadFile(file) {
		var fd = new FormData();
		fd.append('Filedata', file);
		fd.append('folder', tinyMCE.activeEditor.settings.mediaUploadPath);

		var xhr = new XMLHttpRequest();

		xhr.upload.onprogress = function(e) {
			var percentComplete = (e.loaded / e.total) * 100;
			document.querySelector('.bar').style.width = percentComplete + '%';
		};

		removeProgessBar = function(){
			setTimeout(function(){
				var loader = document.querySelector('#jloader');
				loader.parentNode.removeChild(loader);
				editor.contentAreaContainer.style.borderWidth = '1px 0 0 0';
			}, 200);
		};

		xhr.onload = function() {
			var resp = JSON.parse(xhr.responseText);

			if (xhr.status == 200) {
				if (resp.status == '0') {
					removeProgessBar();

					editor.windowManager.alert(resp.message + ': ' + tinyMCE.activeEditor.settings.setCustomDir + resp.location);

				}

				if (resp.status == '1') {
					removeProgessBar();

					// Create the image tag
					var newNode = tinyMCE.activeEditor.getDoc().createElement ('img');
					newNode.src= tinyMCE.activeEditor.settings.setCustomDir + resp.location;
					tinyMCE.activeEditor.execCommand('mceInsertContent', false, newNode.outerHTML);
				}
			} else {
				removeProgessBar();
			}
		};

		xhr.onerror = function() {
			removeProgessBar();
		};

		xhr.open("POST", tinyMCE.activeEditor.settings.uploadUri, true);
		xhr.send(fd);

	}

	// Listers for drag and drop
	if (typeof FormData != 'undefined'){

		// Fix for Chrome
		editor.on('dragenter', function(e) {
			e.stopPropagation();

			return false;
		});


		// Notify user when file is over the drop area
		editor.on('dragover', function(e) {
			e.preventDefault();
			editor.contentAreaContainer.style.borderStyle = 'dashed';
			editor.contentAreaContainer.style.borderWidth = '5px';

			return false;
		});

		// Logic for the dropped file
		editor.on('drop', function(e) {

			// We override only for files
			if (e.dataTransfer && e.dataTransfer.files && e.dataTransfer.files.length > 0) {
				for (var i = 0, f; f = e.dataTransfer.files[i]; i++) {

					// Only images allowed
					if (f.name.toLowerCase().match(/\.(jpg|jpeg|png|gif)$/)) {

						// Create and display the progress bar
						var container, innerDiv, progressBar = '';
						container = document.createElement('div');
						container.id = 'jloader';
						innerDiv = document.createElement('div');
						innerDiv.classList.add('progress');
						innerDiv.classList.add('progress-success');
						innerDiv.classList.add('progress-striped');
						innerDiv.classList.add('active');
						innerDiv.style.width = '100%';
						innerDiv.style.height = '30px';
						progressBar = document.createElement('div');
						progressBar.classList.add('bar');
						progressBar.style.width = '0';
						innerDiv.appendChild(progressBar);
						container.appendChild(innerDiv);
						document.querySelector('.mce-toolbar-grp').appendChild(container);

						// Upload the file(s)
						UploadFile(f);
					}

					e.preventDefault();
				}
			}
			editor.contentAreaContainer.style.borderWidth = '1px 0 0';
		});
	} else {
		Joomla.renderMessages({'error': [Joomla.JText._("PLG_TINY_ERR_UNSUPPORTEDBROWSER")]});
		editor.on('drop', function(e) {
			e.preventDefault();

			return false;
		});
	}
});
PK�#]Z\
���
plugin.min.jsnu&1i�PK�#]����	9	plugin.jsnu&1i�PK�v