|
@@ -128,6 +128,7 @@ function listData(folder = ""){
|
|
|
|
|
|
var clone = document.importNode(document.querySelector('#DataItem').content,true);
|
|
var clone = document.importNode(document.querySelector('#DataItem').content,true);
|
|
$('[data-class=name]',clone).text(value);
|
|
$('[data-class=name]',clone).text(value);
|
|
|
|
+ $('[data-class=name]',clone).attr('title', value);
|
|
|
|
|
|
//Image
|
|
//Image
|
|
if(imageext.includes(ext)){
|
|
if(imageext.includes(ext)){
|
|
@@ -147,9 +148,13 @@ function listData(folder = ""){
|
|
$('[data-class=multiRemovelink]',clone).attr('name', fullfolder );
|
|
$('[data-class=multiRemovelink]',clone).attr('name', fullfolder );
|
|
|
|
|
|
$('[data-class=getLink]',clone).attr('href','javascript:copy2Clipboard("' + fullfolder + '");');
|
|
$('[data-class=getLink]',clone).attr('href','javascript:copy2Clipboard("' + fullfolder + '");');
|
|
|
|
+
|
|
|
|
+ $('[data-class=rename]',clone).attr('href','javascript:rename("' + fullfolder + '", "' + value.slice(0, - (ext.length +1)) +'");');
|
|
|
|
+
|
|
$('[data-class=createSymlink]',clone).attr('href','javascript:createSymlink("' + fullfolder + '", "' + value.slice(0, - (ext.length +1)) +'");');
|
|
$('[data-class=createSymlink]',clone).attr('href','javascript:createSymlink("' + fullfolder + '", "' + value.slice(0, - (ext.length +1)) +'");');
|
|
|
|
|
|
|
|
|
|
|
|
+
|
|
var queryString = window.location.search;
|
|
var queryString = window.location.search;
|
|
var urlParams = new URLSearchParams(queryString);
|
|
var urlParams = new URLSearchParams(queryString);
|
|
|
|
|
|
@@ -306,6 +311,29 @@ function createSymlink(datalink, oldfilename) {
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+function rename(datalink, oldfilename) {
|
|
|
|
+ var filename = prompt("Please enter new filename, without file extension.", oldfilename);
|
|
|
|
+
|
|
|
|
+ if (filename != null && filename != "") {
|
|
|
|
+ var sendfilename = {"link": datalink, "oldfilename": oldfilename, "newfilename": filename}
|
|
|
|
+ $.ajax({
|
|
|
|
+ type: "PUT",
|
|
|
|
+ data: JSON.stringify(sendfilename),
|
|
|
|
+ headers: {"content-id": "list"},
|
|
|
|
+ contentType: "application/json",
|
|
|
|
+ url: "../server/data/" + datalink,
|
|
|
|
+ success: function(res) {
|
|
|
|
+ listFolders(datalink.substr(0, datalink.lastIndexOf("/")))
|
|
|
|
+ },
|
|
|
|
+ error: function (request, status, error) {
|
|
|
|
+ alert(request.responseText + status + error);
|
|
|
|
+ }
|
|
|
|
+ });
|
|
|
|
+ }
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|