*/
function sendFileToServer(fd, status)
{
-
+ // Send one (or more) images to the server. Normally only one image here for now.
var jqXHR=$.ajax({
xhr: function() {
var xhrobj = $.ajaxSettings.xhr();
if (xhrobj.upload) {
xhrobj.upload.addEventListener('progress', function(event) {
+
+ // calculate progress periodically and set the progress bar
var percent = 0;
var position = event.loaded || event.position;
var total = event.total;
});
return jqXHR;
-// status.setAbort(jqXHR);
+
}
+ /*
+ * This function is used to start handling of various things and
+ * to restart handling when an image has been added. I neede to
+ * do this because .on() didn't cover this situation.
+ */
function setupExpandedImageEvents() {
// Handle expanded images on hover for image gallery
id = $(this).attr("data-id");
$('#glm-galleryImageLarger_' + id).dialog("close");
});
+
+ // Make images sortable and store the list of IDs in a hidden input field when order has changed.
$('.glm-galleryImages').sortable({
update: function(event, ui) {
var sortedIDs = $(this).sortable('toArray');