Repository navigation
Expand file tree
/
Copy pathexample_mini.html
More file actions
110 lines (94 loc) · 3.73 KB
/
Copy pathexample_mini.html
File metadata and controls
110 lines (94 loc) · 3.73 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
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
<!DOCTYPE htm<!DOCTYPE html>
<html>
<head>
<title>entryjs example page</title>
<meta charset="utf-8">
<link rel='stylesheet' href='../dist/entry.css'>
<style>
* {
box-sizing: border-box;
}
body {
margin: 0;
}
</style>
</head>
<body>
<section class="wrapper">
<div id="workspace">
</div>
</section>
<!--Jquery -->
<script src="http://play-entry.com/lib/jquery/jquery.min.js"></script>
<script src="http://play-entry.com/lib/jquery-ui/ui/minified/jquery-ui.min.js"></script>
<!--underscore -->
<script src="http://play-entry.com/lib/underscore/underscore.js"></script>
<!--canvas input-->
<script src="http://play-entry.com/lib/entryjs/extern/util/CanvasInput.js"></script>
<!--Blockly-->
<script src="http://play-entry.com/lib/entryjs/extern/blockly/blockly_compressed.js"></script>
<script src="http://play-entry.com/lib/entryjs/extern/blockly/msg/js/ko.js"></script>
<!--createjs-->
<script src="http://play-entry.com/lib/PreloadJS/lib/preloadjs-0.6.0.min.js"></script>
<script src="http://play-entry.com/lib/EaselJS/lib/easeljs-0.8.0.min.js"></script>
<script src="http://play-entry.com/lib/SoundJS/lib/soundjs-0.6.0.min.js"></script>
<script src="http://play-entry.com/lib/SoundJS/lib/flashaudioplugin-0.6.0.min.js"></script>
<script src="http://play-entry.com/lib/entryjs/extern/util/ndgmr.Collision.js"></script>
<script src="http://play-entry.com/lib/entryjs/extern/util/handle.js"></script>
<!--language-->
<script src="../extern/lang/ko.js"></script>
<!--bignumber-->
<script src="http://play-entry.com/lib/entryjs/extern/util/bignumber.min.js"></script>
<!--socket.io-->
<script src="https://cdn.socket.io/socket.io-1.4.5.js"></script>
<!--entryjs-->
<script src="http://play-entry.com/lib/components-webfontloader/webfont.js"></script>
<script src="../extern/util/static_mini.js"></script>
<script src="../dist/entry.js"></script>
<!--main script-->
<script>
$(document).ready(function(){
var isMiniMode = true;
var lastHwConnected = false;
var hwCategoryList = EntryStatic.hwCategoryList;
var initOption = {
type: 'workspace',
}
initOption = $.extend(initOption, EntryStatic.initOptions);
Entry.init(
document.getElementById('workspace'),
initOption
);
Entry.enableArduino();
Entry.loadProject();
Entry.addEventListener('hwChanged', function() {
if ((Entry.hw.connected && Entry.hw.hwModule && lastHwConnected) || !isMiniMode) {
return;
}
if (Entry.hw.connected && Entry.hw.hwModule) {
if(EntryStatic.hwMiniSupportList.indexOf(Entry.hw.hwModule.name) > -1) {
hwCategoryList.forEach(function(categoryName) {
Entry.playground.blockMenu.unbanCategory(categoryName);
});
Entry.playground.blockMenu.banCategory('arduino');
Entry.playground.blockMenu.banCategory('hw_robot');
} else {
hwCategoryList.forEach(function(categoryName) {
Entry.playground.blockMenu.banCategory(categoryName);
});
Entry.playground.blockMenu.banCategory('hw_robot');
Entry.playground.blockMenu.unbanCategory('arduino');
}
lastHwConnected = true;
} else {
hwCategoryList.forEach(function(categoryName) {
Entry.playground.blockMenu.banCategory(categoryName);
});
Entry.playground.blockMenu.banCategory('arduino');
Entry.playground.blockMenu.unbanCategory('hw_robot');
lastHwConnected = false;
}
});
});
</script>
</body>