|
|
@@ -199,13 +199,12 @@ 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>
|
|
|
- <img class="thumbnails" id="myImg" src="./assets/videos/教育訓練/108年Revit上課影音檔/1-模型基本操作瀏覽.jpg" />
|
|
|
+ <button type="button" onclick="goBack()">回上層</button>
|
|
|
+ <div class="panel-body" id="video-list">
|
|
|
+
|
|
|
</div>
|
|
|
+
|
|
|
+ <img class="thumbnails" id="myImg" src="./assets/videos/教育訓練/108年Revit上課影音檔/1-模型基本操作瀏覽.jpg" />
|
|
|
</section>
|
|
|
</div>
|
|
|
|
|
|
@@ -220,6 +219,7 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
</div>
|
|
|
<script>
|
|
|
$(document).ready(function() {
|
|
|
+
|
|
|
$("#myImg").hover(
|
|
|
function() {
|
|
|
$(this).attr("src", "./assets/videos/教育訓練/108年Revit上課影音檔/1-模型基本操作瀏覽.gif");
|
|
|
@@ -228,8 +228,49 @@ if (!isset($_SESSION['loggedin'])) {
|
|
|
$(this).attr("src", "./assets/videos/教育訓練/108年Revit上課影音檔/1-模型基本操作瀏覽.jpg");
|
|
|
}
|
|
|
);
|
|
|
+ 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,
|
|
|
@@ -237,6 +278,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>
|