add Go To Folder (#5424)
Signed-off-by: Simon Smith <simonsmith5521@gmail.com>
Simon Smith committed
Oct 21, 2023 at 01:31 UTC
a60b4cbbea1e6d6b57da1120145a10407fcdbf40
1 file changed
+12
views/default.handlebars
+12
@@ -856,6 +856,7 @@
856
<input type=button style="margin-right:2px" disabled="disabled" id=p13ZipButton value="Zip" onclick="p13zipFiles()" />
857
<input type=button style="margin-right:2px" disabled="disabled" id=p13RefreshButton value="Refresh" onclick="p13folderup(9999)" />
858
<input type=button style="margin-right:2px" disabled="disabled" id=p13FindButton value="Find" onclick="p13findfile()" />
859
+ <input type=button style="margin-right:2px" disabled="disabled" id=p13GoToFolderButton value="GoTo" onclick="p13gotofolder()" />
860
</div>
861
</td>
862
</tr>
@@ -10876,6 +10877,15 @@
10877
p13setActions();
10878
}
10879
10880
+ function p13gotofolder() {
10881
+ setDialogMode(2, "Go To Folder", 3, p13gotofolderEx, '<input type=text id=p13folderinput style=width:100% placeholder="'+(isWindowsNode(currentNode) ? 'C:\\' : '/var/www')+'" />');
10882
+ focusTextBox('p13folderinput');
10883
+ }
10884
+ function p13gotofolderEx() {
10885
+ p13targetpath = Q('p13folderinput').value.split('\\').join('/');
10886
+ if (files) { p13storeCurrentPath(p13targetpath); files.sendText({ action: 'ls', reqid: 1, path: p13targetpath }); }
10887
+ }
10888
+
10889
function p13folderset(x) {
10890
p13targetpath = joinPaths(p13filetree.path, p13filetree.dir[x].n).split('\\').join('/');
10891
if (files) { p13storeCurrentPath(p13targetpath); files.sendText({ action: 'ls', reqid: 1, path: p13targetpath }); }
@@ -10960,6 +10970,7 @@
10970
QE('p13CopyButton', false);
10971
QE('p13ZipButton', false);
10972
QE('p13PasteButton', false);
10973
+ QE('p13GoToFolderButton', false);
10974
} else {
10975
var cc = p13getFileSelCount(), tc = p13getFileCount(), sfc = p13getFileSelCount(false); // In order: number of entires selected, number of total entries, number of selected entires that are files (not folders)
10976
var winAgent = ((currentNode.agent.id > 0) && (currentNode.agent.id < 5)) || (currentNode.agent.id == 14)|| (currentNode.agent.id == 34);
@@ -10976,6 +10987,7 @@
10987
QE('p13CopyButton', advancedFeatures && (cc > 0) && (cc == sfc) && ((p13filetreelocation.length > 0) || (winAgent == false)));
10988
QE('p13ZipButton', advancedFeatures && (cc > 0) && ((p13filetreelocation.length > 0) || (winAgent == false)));
10989
QE('p13PasteButton', advancedFeatures && ((p13filetreelocation.length > 0) || (winAgent == false)) && ((p13clipboard != null) && (p13clipboard.length > 0)));
10990
+ QE('p13GoToFolderButton', true);
10991
}
10992
var filesState = ((files != null) && (files.state != 0));
10993
if (((filesState == true) && (files.contype != 2)) || (filesNode.agent == null) || (filesNode.agent.id == 3) || (filesNode.agent.id == 4)) {