|
@@ -26,39 +26,39 @@ function listFolders(folder = ""){
|
|
$('#CurFolder').text("");
|
|
$('#CurFolder').text("");
|
|
toggleRemoveLinks(true);
|
|
toggleRemoveLinks(true);
|
|
getAllFolders();
|
|
getAllFolders();
|
|
-
|
|
|
|
|
|
+
|
|
if(folder != "" && folder != "." && folder != ".."){
|
|
if(folder != "" && folder != "." && folder != ".."){
|
|
$("#selectfolders").val(folder);
|
|
$("#selectfolders").val(folder);
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
$("#selectfolders").val(".");
|
|
$("#selectfolders").val(".");
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
$.ajax({
|
|
$.ajax({
|
|
type: "GET",
|
|
type: "GET",
|
|
url: "../server/folders/" + folder,
|
|
url: "../server/folders/" + folder,
|
|
dataType: "json",
|
|
dataType: "json",
|
|
success: function(data) {
|
|
success: function(data) {
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
if(folder != "" && folder != "." && folder != ".."){
|
|
if(folder != "" && folder != "." && folder != ".."){
|
|
var clone = document.importNode(document.querySelector('#cpyFolder').content,true);
|
|
var clone = document.importNode(document.querySelector('#cpyFolder').content,true);
|
|
$('[data-class=text]',clone).text("..");
|
|
$('[data-class=text]',clone).text("..");
|
|
- $('[data-class=link]',clone).attr('onclick','listFolders("' + folder.substr(0, folder.lastIndexOf("/")) + '")');
|
|
|
|
|
|
+ $('[data-class=link]',clone).attr('onclick','listFolders("' + folder.substr(0, folder.lastIndexOf("/")) + '")');
|
|
// dont show remove link on .. folder
|
|
// dont show remove link on .. folder
|
|
$('[data-class=removefolder]',clone).remove()
|
|
$('[data-class=removefolder]',clone).remove()
|
|
$('#Folders').append(clone);
|
|
$('#Folders').append(clone);
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
$.each( data, function( key, value ) {
|
|
$.each( data, function( key, value ) {
|
|
var clone = document.importNode(document.querySelector('#cpyFolder').content,true);
|
|
var clone = document.importNode(document.querySelector('#cpyFolder').content,true);
|
|
-
|
|
|
|
|
|
+
|
|
//remove /
|
|
//remove /
|
|
value = value.slice(0,-1)
|
|
value = value.slice(0,-1)
|
|
$('[data-class=text]',clone).text(value);
|
|
$('[data-class=text]',clone).text(value);
|
|
-
|
|
|
|
|
|
+
|
|
if(folder == ""){
|
|
if(folder == ""){
|
|
$('[data-class=link]',clone).attr('onclick','listFolders("' + value + '")');
|
|
$('[data-class=link]',clone).attr('onclick','listFolders("' + value + '")');
|
|
$('[data-class=removefolder]',clone).attr('onclick','deleteFolder("' + value + '")');
|
|
$('[data-class=removefolder]',clone).attr('onclick','deleteFolder("' + value + '")');
|
|
@@ -69,7 +69,7 @@ function listFolders(folder = ""){
|
|
}
|
|
}
|
|
$('#Folders').append(clone);
|
|
$('#Folders').append(clone);
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
//new Folder
|
|
//new Folder
|
|
var clone = document.importNode(document.querySelector('#cpyFolderNew').content,true);
|
|
var clone = document.importNode(document.querySelector('#cpyFolderNew').content,true);
|
|
$('[data-class=text]',clone).text("+");
|
|
$('[data-class=text]',clone).text("+");
|
|
@@ -77,7 +77,7 @@ function listFolders(folder = ""){
|
|
$('#Folders').append(clone);
|
|
$('#Folders').append(clone);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
listData(folder)
|
|
listData(folder)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -92,7 +92,7 @@ function createFolder(folder = ""){
|
|
listFolders(folder)
|
|
listFolders(folder)
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function deleteFolder(datalink) {
|
|
function deleteFolder(datalink) {
|
|
@@ -102,7 +102,7 @@ function deleteFolder(datalink) {
|
|
url: "../server/folders/" + datalink,
|
|
url: "../server/folders/" + datalink,
|
|
success: function(res) {
|
|
success: function(res) {
|
|
listFolders(datalink.substr(0, datalink.lastIndexOf("/")))
|
|
listFolders(datalink.substr(0, datalink.lastIndexOf("/")))
|
|
- }
|
|
|
|
|
|
+ }
|
|
});
|
|
});
|
|
}
|
|
}
|
|
}
|
|
}
|
|
@@ -113,14 +113,14 @@ function listData(folder = "", anzahl = 100){
|
|
const imageext = ["png", "jpg", "svg", "JPG", "PNG", "SVG"]
|
|
const imageext = ["png", "jpg", "svg", "JPG", "PNG", "SVG"]
|
|
const movieext = ["mp4"]
|
|
const movieext = ["mp4"]
|
|
$('#imgUpload').attr("action", "../server/data/" + folder);
|
|
$('#imgUpload').attr("action", "../server/data/" + folder);
|
|
-
|
|
|
|
|
|
+
|
|
$.ajax({
|
|
$.ajax({
|
|
type: "GET",
|
|
type: "GET",
|
|
url: "../server/images/" + folder + "?anzahl=" + anzahl,
|
|
url: "../server/images/" + folder + "?anzahl=" + anzahl,
|
|
dataType: "json",
|
|
dataType: "json",
|
|
success: function(data) {
|
|
success: function(data) {
|
|
$.each( data, function( key, value ) {
|
|
$.each( data, function( key, value ) {
|
|
-
|
|
|
|
|
|
+
|
|
var ext = value.substr(value.lastIndexOf('.') + 1);
|
|
var ext = value.substr(value.lastIndexOf('.') + 1);
|
|
if(folder == ""){
|
|
if(folder == ""){
|
|
fullfolder = value
|
|
fullfolder = value
|
|
@@ -128,11 +128,11 @@ function listData(folder = "", anzahl = 100){
|
|
else{
|
|
else{
|
|
fullfolder = folder + "/" + value;
|
|
fullfolder = folder + "/" + value;
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
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);
|
|
$('[data-class=name]',clone).attr('title', value);
|
|
-
|
|
|
|
|
|
+
|
|
//Image
|
|
//Image
|
|
if(imageext.includes(ext)){
|
|
if(imageext.includes(ext)){
|
|
$('[data-class=image]',clone).append("<img src='./../storage/"+ fullfolder + "' alt=''>")
|
|
$('[data-class=image]',clone).append("<img src='./../storage/"+ fullfolder + "' alt=''>")
|
|
@@ -143,36 +143,36 @@ function listData(folder = "", anzahl = 100){
|
|
else{
|
|
else{
|
|
$('[data-class=image]',clone).append("<div class='imageAlternative'>🗎</div>")
|
|
$('[data-class=image]',clone).append("<div class='imageAlternative'>🗎</div>")
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
$('[data-class=image]',clone).attr('onclick',"overlayOn('" + fullfolder + "')");
|
|
$('[data-class=image]',clone).attr('onclick',"overlayOn('" + fullfolder + "')");
|
|
-
|
|
|
|
|
|
+
|
|
$('[data-class=inspect]',clone).attr('href','../storage/' + fullfolder + '');
|
|
$('[data-class=inspect]',clone).attr('href','../storage/' + fullfolder + '');
|
|
$('[data-class=delete]',clone).attr('href','javascript:deleteData("' + fullfolder + '");');
|
|
$('[data-class=delete]',clone).attr('href','javascript:deleteData("' + fullfolder + '");');
|
|
$('[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=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);
|
|
-
|
|
|
|
|
|
+
|
|
if(urlParams.has('iframe')){
|
|
if(urlParams.has('iframe')){
|
|
$('[data-class=eventTrigger]',clone).css("visibility", "visible")
|
|
$('[data-class=eventTrigger]',clone).css("visibility", "visible")
|
|
$('[data-class=eventTrigger]',clone).attr('href','javascript:triggerEvent("' + fullfolder + '");');
|
|
$('[data-class=eventTrigger]',clone).attr('href','javascript:triggerEvent("' + fullfolder + '");');
|
|
-
|
|
|
|
|
|
+
|
|
console.log("I am an Iframe")
|
|
console.log("I am an Iframe")
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
$('#Data').append(clone);
|
|
$('#Data').append(clone);
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
if(folder != "" && folder != "." && folder != ".."){
|
|
if(folder != "" && folder != "." && folder != ".."){
|
|
$('#RemoveFolder').css("display", "block")
|
|
$('#RemoveFolder').css("display", "block")
|
|
$('#removeFolderLink').attr('href','javascript:deleteFolder("' + folder + '");');
|
|
$('#removeFolderLink').attr('href','javascript:deleteFolder("' + folder + '");');
|
|
@@ -184,7 +184,7 @@ function listData(folder = "", anzahl = 100){
|
|
function triggerEvent(data) {
|
|
function triggerEvent(data) {
|
|
//get url
|
|
//get url
|
|
var datalink = new URL("../storage/" + data, document.baseURI).href;
|
|
var datalink = new URL("../storage/" + data, document.baseURI).href;
|
|
-
|
|
|
|
|
|
+
|
|
ref = $(test);
|
|
ref = $(test);
|
|
setTimeout(function(){
|
|
setTimeout(function(){
|
|
ref.triggerHandler('getUrl', {"url": datalink});
|
|
ref.triggerHandler('getUrl', {"url": datalink});
|
|
@@ -197,9 +197,9 @@ function overlayOn(data) {
|
|
const imageext = ["png", "jpg", "svg", "PNG", "JPG", "SVG"]
|
|
const imageext = ["png", "jpg", "svg", "PNG", "JPG", "SVG"]
|
|
const movieext = ["mp4"]
|
|
const movieext = ["mp4"]
|
|
var ext = url.substr(url.lastIndexOf('.') + 1);
|
|
var ext = url.substr(url.lastIndexOf('.') + 1);
|
|
-
|
|
|
|
|
|
+
|
|
if(imageext.includes(ext)){
|
|
if(imageext.includes(ext)){
|
|
- $('#overlaycontentsize').append("<img id='overlaycontent' src=" + url + "></img>");
|
|
|
|
|
|
+ $('#overlaycontentsize').append("<img id='overlaycontent' src=" + url + "></img>");
|
|
}
|
|
}
|
|
else if(movieext.includes(ext)){
|
|
else if(movieext.includes(ext)){
|
|
$('#overlaycontentsize').append("<video id='overlaycontent' controls> <source src=" + url + " type=\"video/mp4\">Your browser does not support the video tag.</video>");
|
|
$('#overlaycontentsize').append("<video id='overlaycontent' controls> <source src=" + url + " type=\"video/mp4\">Your browser does not support the video tag.</video>");
|
|
@@ -227,7 +227,7 @@ function toggleRemoveLinks(setoff = false) {
|
|
|
|
|
|
|
|
|
|
function selectRemoveItems() {
|
|
function selectRemoveItems() {
|
|
- toggleRemoveLinks()
|
|
|
|
|
|
+ toggleRemoveLinks()
|
|
}
|
|
}
|
|
|
|
|
|
function unselectAll(){
|
|
function unselectAll(){
|
|
@@ -252,13 +252,13 @@ function removeSelectedItems(){
|
|
$("#Data input[type=checkbox]:checked").each(function(index, data){
|
|
$("#Data input[type=checkbox]:checked").each(function(index, data){
|
|
removedItems.push($(data).attr("name"));
|
|
removedItems.push($(data).attr("name"));
|
|
});
|
|
});
|
|
-
|
|
|
|
|
|
+
|
|
if (confirm('Deleting: ' + removedItems)) {
|
|
if (confirm('Deleting: ' + removedItems)) {
|
|
$("#Data input[type=checkbox]:checked").each(function(index, data){
|
|
$("#Data input[type=checkbox]:checked").each(function(index, data){
|
|
//only refresh item list when last item is removed
|
|
//only refresh item list when last item is removed
|
|
deleteDataItem($(data).attr("name"), index === ($("#Data input[type=checkbox]:checked").length -1))
|
|
deleteDataItem($(data).attr("name"), index === ($("#Data input[type=checkbox]:checked").length -1))
|
|
});
|
|
});
|
|
- toggleRemoveLinks()
|
|
|
|
|
|
+ toggleRemoveLinks()
|
|
}
|
|
}
|
|
}
|
|
}
|
|
|
|
|
|
@@ -275,7 +275,7 @@ function deleteDataItem(datalink, refresh = true) {
|
|
success: function(res) {
|
|
success: function(res) {
|
|
if(refresh)
|
|
if(refresh)
|
|
listFolders(datalink.substr(0, datalink.lastIndexOf("/")))
|
|
listFolders(datalink.substr(0, datalink.lastIndexOf("/")))
|
|
- }
|
|
|
|
|
|
+ }
|
|
});
|
|
});
|
|
}
|
|
}
|
|
|
|
|
|
@@ -294,11 +294,11 @@ function copy2Clipboard(datalink) {
|
|
function createSymlink(datalink, oldfilename) {
|
|
function createSymlink(datalink, oldfilename) {
|
|
|
|
|
|
var filename = prompt("Please enter symlink filename");
|
|
var filename = prompt("Please enter symlink filename");
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
if (filename != null && filename != "") {
|
|
if (filename != null && filename != "") {
|
|
- var sendfilename = {"filename": filename, "oldfilename": oldfilename}
|
|
|
|
|
|
+ var sendfilename = {"filename": filename, "oldfilename": oldfilename}
|
|
$.ajax({
|
|
$.ajax({
|
|
type: "POST",
|
|
type: "POST",
|
|
data: JSON.stringify(sendfilename),
|
|
data: JSON.stringify(sendfilename),
|
|
@@ -312,13 +312,13 @@ function createSymlink(datalink, oldfilename) {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
function rename(datalink, oldfilename) {
|
|
function rename(datalink, oldfilename) {
|
|
var filename = prompt("Please enter new filename, without file extension.", oldfilename);
|
|
var filename = prompt("Please enter new filename, without file extension.", oldfilename);
|
|
-
|
|
|
|
|
|
+
|
|
if (filename != null && filename != "") {
|
|
if (filename != null && filename != "") {
|
|
var sendfilename = {"link": datalink, "oldfilename": oldfilename, "newfilename": filename}
|
|
var sendfilename = {"link": datalink, "oldfilename": oldfilename, "newfilename": filename}
|
|
$.ajax({
|
|
$.ajax({
|
|
@@ -335,8 +335,8 @@ function rename(datalink, oldfilename) {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
}
|
|
}
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
}
|
|
}
|
|
|
|
|
|
|
|
|
|
@@ -351,7 +351,7 @@ function getAllFolders(folder = ""){ //Get DB 2 HTML //has to be synchronus in o
|
|
success: function(data) {
|
|
success: function(data) {
|
|
$.each( data, function( key, value ) {
|
|
$.each( data, function( key, value ) {
|
|
$('#selectfolders').append("<option>" + value.slice(0,-1) +"</option>")
|
|
$('#selectfolders').append("<option>" + value.slice(0,-1) +"</option>")
|
|
-
|
|
|
|
|
|
+
|
|
});
|
|
});
|
|
}
|
|
}
|
|
});
|
|
});
|
|
@@ -371,7 +371,7 @@ function saveexternalfolder(folder = ""){
|
|
success: function(res) {
|
|
success: function(res) {
|
|
}
|
|
}
|
|
});
|
|
});
|
|
- }
|
|
|
|
|
|
+ }
|
|
}
|
|
}
|
|
|
|
|
|
function listExternalFolders(folder = ""){
|
|
function listExternalFolders(folder = ""){
|
|
@@ -381,10 +381,10 @@ function listExternalFolders(folder = ""){
|
|
type: "GET",
|
|
type: "GET",
|
|
url: "../server/externalFolder",
|
|
url: "../server/externalFolder",
|
|
dataType: "json",
|
|
dataType: "json",
|
|
- success: function(data) {
|
|
|
|
- $.each( data, function( key, value ) {
|
|
|
|
|
|
+ success: function(data) {
|
|
|
|
+ $.each( data, function( key, value ) {
|
|
var clone = document.importNode(document.querySelector('#cpyFolder').content,true);
|
|
var clone = document.importNode(document.querySelector('#cpyFolder').content,true);
|
|
-
|
|
|
|
|
|
+
|
|
//remove /
|
|
//remove /
|
|
value = value.slice(0,-1)
|
|
value = value.slice(0,-1)
|
|
$('[data-class=text]',clone).text(value);
|
|
$('[data-class=text]',clone).text(value);
|
|
@@ -396,24 +396,24 @@ function listExternalFolders(folder = ""){
|
|
}
|
|
}
|
|
else{
|
|
else{
|
|
$('#Folders').text("");
|
|
$('#Folders').text("");
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
|
|
+
|
|
|
|
+
|
|
|
|
+
|
|
//alert($.get(folder));
|
|
//alert($.get(folder));
|
|
-
|
|
|
|
|
|
+
|
|
/*
|
|
/*
|
|
$.ajax({
|
|
$.ajax({
|
|
type: "GET",
|
|
type: "GET",
|
|
url: folder,
|
|
url: folder,
|
|
crossDomain: true,
|
|
crossDomain: true,
|
|
- success: function(data) {
|
|
|
|
|
|
+ success: function(data) {
|
|
alert(data);
|
|
alert(data);
|
|
}
|
|
}
|
|
});
|
|
});
|
|
*/
|
|
*/
|
|
-
|
|
|
|
|
|
+
|
|
}
|
|
}
|
|
-
|
|
|
|
|
|
+
|
|
//listData(folder)
|
|
//listData(folder)
|
|
}
|
|
}
|
|
|
|
|
|
@@ -437,14 +437,9 @@ var getUrlParameter = function getUrlParameter(sParam) {
|
|
$(document).ready(function() {
|
|
$(document).ready(function() {
|
|
var path = getUrlParameter('path');
|
|
var path = getUrlParameter('path');
|
|
if(!path){
|
|
if(!path){
|
|
- path = "";
|
|
|
|
|
|
+ path = "";
|
|
}
|
|
}
|
|
listFolders(path);
|
|
listFolders(path);
|
|
//listExternalFolders();
|
|
//listExternalFolders();
|
|
getAllFolders(path);
|
|
getAllFolders(path);
|
|
});
|
|
});
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|
|
-
|
|
|