|
|
@@ -199,7 +199,7 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
<div class="row">
|
|
|
<div class="col-md-6">
|
|
|
<section class="panel">
|
|
|
- <button type="button" onclick="goBack()">回上層</button>
|
|
|
+ <button type="button" onclick="goBack(parent)">回上層</button>
|
|
|
<div class="panel-body" id="video-list">
|
|
|
|
|
|
</div>
|
|
|
@@ -234,6 +234,7 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
|
|
|
var dirList = [];
|
|
|
var count = 0;
|
|
|
+ var parent = ".";
|
|
|
|
|
|
function initList(dir) {
|
|
|
|
|
|
@@ -246,7 +247,12 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
dir: dir,
|
|
|
},
|
|
|
dataType: "json"
|
|
|
- }).done(function(data) {
|
|
|
+ }).done(function(result) {
|
|
|
+ console.log(result);
|
|
|
+ data = result["dir_names"];
|
|
|
+ data2 = result["file_tables"];
|
|
|
+ if (result["parent"] != undefined)
|
|
|
+ parent = result["parent"];
|
|
|
|
|
|
for (j = 0; j < data.length; j++) {
|
|
|
|
|
|
@@ -260,6 +266,25 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
|
|
|
var i = document.createElement("i");
|
|
|
i.setAttribute("class", "fa fa-folder");
|
|
|
+
|
|
|
+ p.appendChild(i);
|
|
|
+
|
|
|
+ p.appendChild(a);
|
|
|
+
|
|
|
+ }
|
|
|
+ for (j = 0; j < data2.length; j++) {
|
|
|
+
|
|
|
+ var p = document.createElement("p");
|
|
|
+ document.getElementById("video-list").appendChild(p);
|
|
|
+
|
|
|
+ var a = document.createElement("a");
|
|
|
+ a.setAttribute("href", "#");
|
|
|
+ //a.setAttribute("onclick", "initList('" + data2[j]["dir_name"] + "');");
|
|
|
+ a.innerText = data2[j]["title"];
|
|
|
+
|
|
|
+ var i = document.createElement("i");
|
|
|
+ i.setAttribute("class", "fa fa-video-camera");
|
|
|
+
|
|
|
p.appendChild(i);
|
|
|
|
|
|
p.appendChild(a);
|
|
|
@@ -282,15 +307,12 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
function removeChild() {
|
|
|
var parent = document.getElementById("video-list");
|
|
|
while (parent.firstChild) {
|
|
|
- if (parent.firstChild.innerText != undefined) {
|
|
|
- //dirList[count++] = [parent.firstChild.innerText];
|
|
|
- }
|
|
|
parent.removeChild(parent.firstChild);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
- function goBack() {
|
|
|
- console.log(dirList, count);
|
|
|
+ function goBack(parent) {
|
|
|
+ initList(parent);
|
|
|
|
|
|
}
|
|
|
</script>
|
|
|
@@ -335,7 +357,6 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
<!-- Main-->
|
|
|
<script src="script/js/main.js"></script>
|
|
|
|
|
|
- <script src='script/js/warning.js'></script>
|
|
|
|
|
|
</section>
|
|
|
</body>
|