|
|
@@ -193,11 +193,9 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
<div class="row">
|
|
|
<div class="col-md-6">
|
|
|
<section class="panel">
|
|
|
- <div class="panel-body">
|
|
|
- <p><a href="#" onclick="getVideo('1','模型基本操作瀏覽');"><i class="fa fa-video-camera"></i>1-模型基本操作瀏覽</a></p>
|
|
|
- <p><a href="#" onclick="getVideo('2','建築模型基礎課程');"><i class="fa fa-video-camera"></i>2-建築模型基礎課程</a></p>
|
|
|
- <p><a href="#" onclick="getVideo('3','建築模型進階課程');"><i class="fa fa-video-camera"></i>3-建築模型進階課程</a></p>
|
|
|
- <p><a href="#" onclick="getVideo('4','建築模型敷地課程');"><i class="fa fa-video-camera"></i>4-建築模型敷地課程</a></p>
|
|
|
+ <button type="button" onclick="goBack()">回上層</button>
|
|
|
+ <div class="panel-body" id="video-list">
|
|
|
+
|
|
|
</div>
|
|
|
</section>
|
|
|
</div>
|
|
|
@@ -213,9 +211,48 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
</div>
|
|
|
<script>
|
|
|
$(document).ready(function() {
|
|
|
-
|
|
|
+ initList(".");
|
|
|
});
|
|
|
|
|
|
+ var dirList = [];
|
|
|
+ var count = 0;
|
|
|
+
|
|
|
+ function initList(dir) {
|
|
|
+
|
|
|
+ removeChild();
|
|
|
+
|
|
|
+ $.ajax({
|
|
|
+ url: "./script/php/video/getDir.php",
|
|
|
+ type: "POST",
|
|
|
+ data: {
|
|
|
+ dir: dir,
|
|
|
+ },
|
|
|
+ dataType: "json"
|
|
|
+ }).done(function(data) {
|
|
|
+
|
|
|
+ for (j = 0; j < data.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('" + data[j]["dir_name"] + "');");
|
|
|
+ a.innerText = data[j]["dir_name"];
|
|
|
+
|
|
|
+ var i = document.createElement("i");
|
|
|
+ i.setAttribute("class", "fa fa-folder");
|
|
|
+ p.appendChild(i);
|
|
|
+
|
|
|
+ p.appendChild(a);
|
|
|
+
|
|
|
+ }
|
|
|
+
|
|
|
+ }).error(function(error) {
|
|
|
+ console.log(error);
|
|
|
+ });
|
|
|
+ }
|
|
|
+
|
|
|
function getVideo(id, name) {
|
|
|
$.redirect('./video-play.php', {
|
|
|
'id': id,
|
|
|
@@ -223,6 +260,21 @@ 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);
|
|
|
+
|
|
|
+ }
|
|
|
</script>
|
|
|
<!-- Vendor -->
|
|
|
<script src="assets/vendor/jquery-browser-mobile/jquery.browser.mobile.js"></script>
|