-
Notifications
You must be signed in to change notification settings - Fork 2
/
example-edit.php
executable file
·63 lines (58 loc) · 2.17 KB
/
example-edit.php
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
<?php
require_once dirname ( __FILE__ ) . '/services/ExampleService.class.php';
$exampleService = new ExampleService();
if(isset($_GET['id'])) {
$id = $_GET['id'];
$example = $exampleService->selectExampleById($id);
file_put_contents("js/user/global_deps.cfg", $example[0]['js_deps']);
copy($example[0]['js_dir'], 'js/user/global.js');
$jsDeps = $example[0]['js_deps'];
} else {
$jsDeps = file_get_contents("js/user/global_deps.cfg");
}
?>
<!DOCTYPE html>
<head>
<title>Phaser小站</title>
<meta charset="utf-8" />
<meta name="Keywords" content="Phaser,Phaser小站,HTML5,游戏,HTML5游戏,游戏引擎,游戏框架,HTML5游戏引擎,HTML5游戏框架" />
<meta name="Description" content="Phaser小站是一个为phaser而生的网站,以宣传和发展Phaser为使命。本站提供一切关于Phaser的案例、源码、教程、教学视频。" />
<link href="css/global.css" rel="stylesheet" />
<link href="css/common.css" rel="stylesheet" />
<link href="css/exampleEdit.css" rel="stylesheet" />
<script src="js/lib/jquery.js"></script>
<script src="js/lib/acelib/lib/ace/ext/emmet.js"></script>
<script src="js/lib/acelib/kitchen-sink/require.js"></script>
<script src="examples/libs/phaser.min.js"></script>
<?php
if(isset($jsDeps) && !empty($jsDeps)) {
$deps = explode(",", $jsDeps);
foreach($deps as $dep) {
echo "<script src=\"" . $dep . "\"></script>";
}
}
?>
<script src="js/user/global.js?now=<?php echo time();?>"></script>
<script src="js/handleLogin.js"></script>
<?php include_once 'partials/statistics.php';?>
</head>
<body>
<?php include_once 'partials/header.php'; ?>
<div class="middleDiv">
<div class="gameWrapper">
<div class="game" id="phaser-example"></div>
<div class="phaser">PHASER</div>
<div class="copyright">Copyright © 2015 phaser-china.com All Rights Reserved</div>
</div>
<div class="buttonDiv">
<button id="runBtn">运行</button>
</div>
<div class="editorWrapper">
<pre class="editor" id="editor"></pre>
</div>
</div>
<div class="h100"></div>
<?php include_once 'partials/footer.php'; ?>
<?php include_once 'partials/bottomFixed.php'; ?>
<script src="js/exampleEdit.js"></script>
</body>