|
@@ -682,6 +682,34 @@
|
|
|
background-color:#f5f5f5 !important;
|
|
|
}
|
|
|
|
|
|
+ .fileShareIndicator.small{
|
|
|
+ position: absolute;
|
|
|
+ top: calc(50% - 8px);
|
|
|
+ left: 8px;
|
|
|
+ height: 10px;
|
|
|
+ width: 10px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .fileShareIndicator.medium{
|
|
|
+ position: absolute;
|
|
|
+ top: calc(50% - 8px);
|
|
|
+ left: 10px;
|
|
|
+ height: 16px;
|
|
|
+ width: 16px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .fileShareIndicator.big{
|
|
|
+ position: absolute;
|
|
|
+ top: calc(50% - 8px);
|
|
|
+ left: 12px;
|
|
|
+ height: 18px;
|
|
|
+ width: 18px;
|
|
|
+ }
|
|
|
+
|
|
|
+ .fileShareIndicator img{
|
|
|
+ width: 100%;
|
|
|
+ }
|
|
|
+
|
|
|
/* Offline blinking warning css */
|
|
|
@-moz-keyframes blink {
|
|
|
0% {
|
|
@@ -2850,6 +2878,7 @@
|
|
|
var filepath = JSON.parse(JSON.stringify(filedata.Filepath));
|
|
|
var isDir = JSON.parse(JSON.stringify(filedata.IsDir));
|
|
|
var isEmptyDir = JSON.parse(JSON.stringify(filedata.IsEmptyDir));
|
|
|
+ var isShared = JSON.parse(JSON.stringify(filedata.IsShared));
|
|
|
var maxlength = 12;
|
|
|
var type = "file";
|
|
|
let shortenedName = filename;
|
|
@@ -2933,6 +2962,7 @@
|
|
|
size: size,
|
|
|
imagePath: imagePath,
|
|
|
shortenedName: shortenedName,
|
|
|
+ isShared: isShared,
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -2950,6 +2980,7 @@
|
|
|
size: size,
|
|
|
imagePath: imagePath,
|
|
|
shortenedName: shortenedName,
|
|
|
+ isShared: isShared,
|
|
|
});
|
|
|
}
|
|
|
|
|
@@ -2981,6 +3012,7 @@
|
|
|
if (properties.type == "file" && isChrome){
|
|
|
htmlType = "a";
|
|
|
}
|
|
|
+
|
|
|
var thisIcon = $(`<${htmlType} href="javascript:void(0);" class="launchIcon"
|
|
|
type="${properties.type}"
|
|
|
draggable="true"
|
|
@@ -2994,11 +3026,18 @@
|
|
|
filepath="${properties.filepath}"
|
|
|
filedata="${properties.compressedFiledata}"
|
|
|
style="width:${properties.iwidth}px; height:${properties.iheight}px;left:${properties.screenX}px; top:${properties.screenY}px;">
|
|
|
- <span class="launchIconWrapper"><img class="launchIconImage ${properties.size}" src="${properties.imagePath}" draggable="false"></img>
|
|
|
- <p class="launchIconText ${properties.size} ">${properties.shortenedName}</p></span>
|
|
|
+ <span class="launchIconWrapper">
|
|
|
+ <img class="launchIconImage ${properties.size}" src="${properties.imagePath}" draggable="false"></img>
|
|
|
+ <p class="launchIconText ${properties.size} ">${properties.shortenedName}</p>
|
|
|
+ </span>
|
|
|
</${htmlType}>`);
|
|
|
|
|
|
$(target).append(thisIcon);
|
|
|
+
|
|
|
+ //Updates 20 May 2021: Check if this file is shared. If yes, append the share icon
|
|
|
+ if (typeof(properties.isShared) != "undefined" && properties.isShared == true){
|
|
|
+ setFileShareIndicator(properties.filename);
|
|
|
+ }
|
|
|
|
|
|
if (properties.type == "file" && isChrome){
|
|
|
console.log(isChrome);
|
|
@@ -3024,6 +3063,50 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+ /*
|
|
|
+ Share indicator settings
|
|
|
+ This append or remove share from a particular file
|
|
|
+
|
|
|
+ Only require filename as all files here are on desktop
|
|
|
+ */
|
|
|
+
|
|
|
+ function getFileObjectByFilename(filename){
|
|
|
+ var result = null;
|
|
|
+ $(".launchIcon").each(function(){
|
|
|
+ var thisFilename = $(this).attr("filename");
|
|
|
+ if (thisFilename == filename){
|
|
|
+ result = $(this);
|
|
|
+ }
|
|
|
+ });
|
|
|
+
|
|
|
+ return result;
|
|
|
+ }
|
|
|
+
|
|
|
+ function setFileShareIndicator(filename){
|
|
|
+ var targetFileObject = getFileObjectByFilename(filename);
|
|
|
+ if (targetFileObject == null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+ var sharedIcon = `<div class="fileShareIndicator ${desktopIconSize}">
|
|
|
+ <img src="img/desktop/system_icon/shared.png">
|
|
|
+ </div>`;
|
|
|
+
|
|
|
+ $(targetFileObject).find(".launchIconWrapper").append(sharedIcon);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ function removeFileShareIndicator(filename){
|
|
|
+ var targetFileObject = getFileObjectByFilename(filename);
|
|
|
+ if (targetFileObject == null){
|
|
|
+ return;
|
|
|
+ }
|
|
|
+
|
|
|
+ var indicator = $(targetFileObject).find(".fileShareIndicator");
|
|
|
+ if (indicator.length > 0){
|
|
|
+ indicator.remove();
|
|
|
+ }
|
|
|
+ }
|
|
|
+
|
|
|
// ========================== LAUNCH ICON OPERATIONS ================
|
|
|
|
|
|
//This function start all the launchicon related events
|
|
@@ -4268,7 +4351,6 @@
|
|
|
}else{
|
|
|
addContextMenuTitle($("#subcontextmenu"), `<i class="share alternate icon"></i> Share this File`);
|
|
|
}
|
|
|
- console.log(data);
|
|
|
|
|
|
var checkmarkStyle = `style="color: #71ba68;"`;
|
|
|
var anyoneClass = "";
|