-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.php
More file actions
66 lines (63 loc) · 1.97 KB
/
index.php
File metadata and controls
66 lines (63 loc) · 1.97 KB
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
62
63
64
65
66
<?php
function loadScripts($dirName) {
if ($handle = opendir($dirName)) {
while (false !== ($fileName = readdir($handle))) {
if ($fileName == '.' || $fileName == '..') continue;
$fullPath = $dirName . '/' . $fileName;
if (is_dir($fullPath)) {
loadScripts($fullPath);
}
else if (is_file($fullPath)) {
echo '<script type="text/javascript" src="' . $fullPath . '"></script>' . PHP_EOL;
}
}
closedir($handle);
}
}
function loadScenes($dirName) {
if ($handle = opendir($dirName)) {
while (false !== ($fileName = readdir($handle))) {
if ($fileName == '.' || $fileName == '..') continue;
$fullPath = $dirName . '/' . $fileName;
if (is_dir($fullPath)) {
loadScenes($fullPath);
}
else if (is_file($fullPath)) {
echo '<li><a href="javascript: scene.load(\'' . $fullPath . '\').show()">' . $fileName .'</a></li>' . PHP_EOL;
}
}
closedir($handle);
}
}
?>
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en">
<head>
<title>Scene Graph DEMO</title>
<meta http-equiv="Content-Type" content="application/xhtml+xml; charset=UTF-8" />
<meta http-equiv="Content-Script-Type" content="text/javascript" />
<meta http-equiv="Content-Style-Type" content="text/css" />
<link rel="stylesheet" type="text/css" href="css/demo.css" />
<?php loadScripts('scripts/jquery.js'); ?>
<?php loadScripts('scripts/sceneFX.js'); ?>
<script type="text/javascript">
jQuery.noConflict();
var scene = null;
jQuery(document).ready(function() {
scene = new goosefx.scene.Scene('#scene');
});
</script>
</head>
<body>
<div id="page">
<div id="scene"></div>
<div id="menu">
<h1>SceneFX Demos</h1>
<ul>
<?php loadScenes('scenes'); ?>
</ul>
</div>
</div>
</body>
</html>