|
@@ -3200,8 +3200,6 @@
|
|
|
if (sourceFilelist !== ""){
|
|
|
sourceFilelist = JSON.parse(sourceFilelist);
|
|
|
}
|
|
|
- console.log(sourceFilelist);
|
|
|
-
|
|
|
|
|
|
//Drop opererations
|
|
|
if (target.attr("id") == "bgwrapper") {
|
|
@@ -3296,20 +3294,6 @@
|
|
|
title = "Moving "
|
|
|
}
|
|
|
|
|
|
- //Check if any of the files already exists on desktop
|
|
|
- /*
|
|
|
- var duplicateFound = false;
|
|
|
- filelist.forEach(file => {
|
|
|
- var thisFilename = file.filename;
|
|
|
- desktopFileList.forEach(desktopFile => {
|
|
|
- if (desktopFile == thisFilename){
|
|
|
- //Diplicate
|
|
|
- duplicateFound = true;
|
|
|
- }
|
|
|
- });
|
|
|
- });
|
|
|
- */
|
|
|
-
|
|
|
var filepathList = [];
|
|
|
filelist.forEach(file => {
|
|
|
filepathList.push(file.filepath)
|
|
@@ -3397,14 +3381,6 @@
|
|
|
let thisIconObject = getObjectFromPath(filepath);
|
|
|
let caluclatedLocation = [$(sourceObject).offset().left - offset.dx, $(sourceObject).offset().top - offset.dy];
|
|
|
let finalIconLocation = findClosestGrid(caluclatedLocation[0], caluclatedLocation[1]);
|
|
|
- //Check for duplication
|
|
|
- /*
|
|
|
- var duplicateObject = getObjectFromLocation(finalIconLocation[0][0] + iconOffsetXY[0], finalIconLocation[0][1] + iconOffsetXY[1]);
|
|
|
- if (duplicateObject !== undefined) {
|
|
|
- //There are already object there. Relocate this object later
|
|
|
- relocatePendingObjects.push(duplicateObject)
|
|
|
- }
|
|
|
- */
|
|
|
|
|
|
//Move this icon to designed location
|
|
|
$(thisIconObject).css({
|
|
@@ -3500,7 +3476,24 @@
|
|
|
}
|
|
|
} else if (target.attr("type") == "folder") {
|
|
|
//Move this file or folder into the target folder
|
|
|
- //WIP
|
|
|
+ var moveSources = [sourceFilepath];
|
|
|
+ if ($(".launchIconWrapper.selected").length > 1){
|
|
|
+ //Multi move operations
|
|
|
+ moveSources = [];
|
|
|
+ $(".launchIconWrapper.selected").each(function(){
|
|
|
+ var thisFileData = $(this).parent().attr("filedata");
|
|
|
+ thisFileData = JSON.parse(decodeURIComponent(thisFileData));
|
|
|
+ moveSources.push(thisFileData.Filepath);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
+ //Get the move target location
|
|
|
+ var targetFd = $(target).attr("filedata");
|
|
|
+ targetFd = JSON.parse(decodeURIComponent(targetFd));
|
|
|
+
|
|
|
+ //Move it
|
|
|
+ console.log(moveSources, targetFd.Filepath);
|
|
|
+ moveSourceFilesToTarget(moveSources, targetFd.Filepath)
|
|
|
|
|
|
} else if (target.attr("type") == "shortcut") {
|
|
|
//Opening with the shortcut
|
|
@@ -3539,14 +3532,66 @@
|
|
|
openFileWithModule(shortcutModule, openFileList);
|
|
|
} else if (shortcutType == "folder") {
|
|
|
//Move the source file into this folder
|
|
|
-
|
|
|
+ alert("wip");
|
|
|
}
|
|
|
|
|
|
} else {
|
|
|
- console.log("Unknown reaction type: ", target.attr("type"));
|
|
|
+ console.log("Unknown action type: ", target.attr("type"));
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+
|
|
|
+ //Use move if it is folder on desktop, use copy if it is a shortcut
|
|
|
+ function moveSourceFilesToTarget(sourceList, target, opr="move"){
|
|
|
+ var oprConfig = {
|
|
|
+ opr: opr,
|
|
|
+ src: sourceList,
|
|
|
+ dest: target,
|
|
|
+ callbackWindowID: "desktop",
|
|
|
+ callbackFunction: `refresh(undefined, true)`
|
|
|
+ }
|
|
|
+ var configHash = encodeURIComponent(JSON.stringify(oprConfig));
|
|
|
+ var title = "Copying " + sourceList.length;
|
|
|
+ if (sourceList.length > 1){
|
|
|
+ title += " files";
|
|
|
+ }else{
|
|
|
+ title += " file";
|
|
|
+ }
|
|
|
+
|
|
|
+ //Create FloatWindow to handle the file operations
|
|
|
+ newFloatWindow({
|
|
|
+ url: "SystemAO/file_system/file_operation.html#" + configHash,
|
|
|
+ width: 400,
|
|
|
+ height: 220,
|
|
|
+ appicon: "SystemAO/file_system/img/selector.png",
|
|
|
+ title: title
|
|
|
+ });
|
|
|
+
|
|
|
+ //Delete the file location from db
|
|
|
+ sourceList.forEach(file => {
|
|
|
+ let filename = file.split("/").pop();
|
|
|
+ $.ajax({
|
|
|
+ url: "system/desktop/files",
|
|
|
+ data: {del: filename},
|
|
|
+ success: function(data){
|
|
|
+ if (data.error !== undefined){
|
|
|
+ console.log(data.error);
|
|
|
+ }
|
|
|
+ }
|
|
|
+ });
|
|
|
+ });
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function requestCSRFToken(callback){
|
|
|
+ $.ajax({
|
|
|
+ url: "system/csrf/new",
|
|
|
+ success: function(token){
|
|
|
+ callback(token);
|
|
|
+ }
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
function getModuleFromShortcutInfo(shortcutInfo) {
|
|
|
var ShortcutPath = shortcutInfo["ShortcutPath"];
|
|
|
if (ShortcutPath.includes("/") == false) {
|
|
@@ -5161,25 +5206,13 @@
|
|
|
if (data.error == undefined){
|
|
|
let iconSize = 20;
|
|
|
let topOffset = $(imageContainer).height() - iconSize/2 + 2;
|
|
|
- $(imageContainer).parent().append(`<img src="${data.IconPath}" style="position: absolute; right: 0px; top: ${topOffset}px; width: ${iconSize}px; height: ${iconSize}px;"></img>`);
|
|
|
- console.log(filedata.Filename, data);
|
|
|
+ $(imageContainer).parent().append(`<img src="${data.IconPath}" style="position: absolute; right: 0px; top: ${topOffset}px; width: ${iconSize}px; height: ${iconSize}px; pointer-events:none;"></img>`);
|
|
|
}
|
|
|
}
|
|
|
})
|
|
|
}
|
|
|
}
|
|
|
});
|
|
|
-
|
|
|
- /*
|
|
|
- $(".fileObject").each(function(){
|
|
|
- if (thumbData[1].length > 0){
|
|
|
- if ($(this).attr("filename") == thumbData[0]){
|
|
|
- $(this).find("img").attr("src","data:image/jpg;base64," + thumbData[1]);
|
|
|
- }
|
|
|
- }
|
|
|
-
|
|
|
- });
|
|
|
- */
|
|
|
};
|
|
|
|
|
|
thumbRenderWebSocket.onclose = function(event) {
|
|
@@ -5420,7 +5453,7 @@
|
|
|
socket.onopen = function(e) {
|
|
|
if (filesize < uploadFileChunkSize){
|
|
|
//This file is smaller than chunk size, set it to somwhere within 10% - 20% so it doesn't look like it is stuck
|
|
|
-
|
|
|
+ $("." + uploadingIconUUID + ".launchIcon").find(".bar").css("width", "15%");
|
|
|
}
|
|
|
|
|
|
//Send the first chunk
|