-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
61 lines (51 loc) · 2.82 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
<!doctype html>
<html lang="en">
<head>
<title>File Tree Browser Demo</title>
<meta name="description" content="Retrieves directories and files recursively with Ajax from a main directory and displays the tree structure. Programmed in pure Javascript / CSS without any dependency. PHP connector is provided, you can write your own in any server language (NodeJS, ASP, ...)">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no">
<!-- Bootstrap CSS -->
<link rel="stylesheet" href="https://stackpath.bootstrapcdn.com/bootstrap/4.3.1/css/bootstrap.min.css" integrity="sha384-ggOyR0iXCbMQv3Xipma34MD+dH/1fQ784/j6cY/iJTQUOhcWr7x9JvoRxT2MZw1T" crossorigin="anonymous">
</head>
<body>
<h1 class="pt-5 text-center">File Tree Browser Demo</h1>
<div class="d-flex mx-auto justify-content-center my-3" role="group">
<a href="#" class="btn btn-secondary mr-4 disabled">Demo 1</a>
<a href="demo-2.html" class="btn btn-primary">Demo 2</a>
</div>
<div class="container py-2 mb-4 text-center">
<p class="lead">This script scans a directory recursively and allows to navigate inside it like a file explorer.<br> It normally allows to drag and drop files from one directory to another.<br> This feature is disabled in the demo.</p>
<p class="text-center">Documentation & Download: <a href="https://github.com/migliori/file-tree-browser" title="File Tree Browser">https://github.com/migliori/file-tree-browser</a></p>
</div>
<div class="py-2 mb-4 text-center text-muted border">
<p id="ft-output" class="small mb-0"> <br> </p>
</div>
<div class="container" id="file-tree-browser-wrapper">
<div class="row">
<div class="col-sm-3 ft-tree"></div>
<div class="col-sm-9 ft-explorer"></div>
</div>
</div>
<p class="text-center"><a href="https://www.miglisoft.com/">@miglisoft</a></p>
<script src="dist/js/file-tree-browser.js"></script>
<script>
document.addEventListener("DOMContentLoaded", function(event) {
const options = {
mainDir: 'demo-files',
dragAndDrop: false,
elementClick: function (filePath, fileName) {
document.getElementById('ft-output').innerHTML = '<strong>filePath</strong>: ' + filePath + ',<br><strong>fileName</strong>: ' + fileName;
},
cancelBtnClick: function (filePath, fileName) {
alert('Cancelled');
},
okBtnClick: function (filePath, fileName) {
alert('filePath: ' + filePath + ' - fileName: ' + fileName);
}
};
const ft = new FileTreeBrowser('file-tree-browser-wrapper', options);
});
</script>
</body>
</html>