;"use strict";
var contented = (function($) {
"use strict";
/**
* contented_SupportsDrop returns whether drag-and-drop is supported by this
* browser.
*
* @return bool
*/
var contented_SupportsDrop = function() {
return ('ondrop' in window && 'FormData' in window && 'FileReader' in window);
}
/**
* contented_EnableDrop enables drag-and-drop upload on a DOM element.
* The class "is-dragover" will be toggled on the target element.
*
* @param DOMElement element Drop target
* @param string baseURL Base URL of the contented server
* @param Function onUploaded Called with a property object for every uploaded file
* @param Function onClose Called when the widget should be destroyed
*/
var contented_EnableDrop = function(element, baseURL, onUploaded, onClose) {
onUploaded = onUploaded || function(){};
onClose = onClose || function(){};
//
// Create a new div for ourselves on top of the existing area
$.get(baseURL + "/about", function(ret) {
$("title").text( ret.AppTitle );
var extraText = "";
if (ret.MaxUploadBytes > 0) {
extraText = " (max " + Math.floor(ret.MaxUploadBytes / (1024*1024)) + " MiB)";
}
$.get(baseURL + "/widget.html", function(widgetHtml) {
var $f = $("