-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.html
255 lines (234 loc) · 8.54 KB
/
index.html
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
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
<!DOCTYPE html>
<html>
<head>
<!-- META -->
<title>MameBlock.js - Javascript library for visual code editing.</title>
<meta charset="UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1.0"/>
<meta name="description" content="" />
<!-- CSS -->
<link rel="stylesheet" type="text/css" href="css/mameblock.min.css" media="all" />
<link rel="stylesheet" type="text/css" href="css/highlight_default.css" media="all" />
</head>
<body>
<nav class="navbar">
<a class="hide-phone" id="logo" href="http://www.catch.jp/"><i class="fa fa-hand-o-right"></i> <span>catch.jp</span></a>
<ul>
<li><a href="#"><span>MameBlock.js</span></a></li>
<li><a href="#">[English]</a></li>
<li><a href="index.ja.html">日本語</a></li>
</ul>
</nav>
<div class="grid">
<div class="col_4" style="margin-top:60px;">
<h1>MameBlock.js</h1>
<p>Simple visual code editor library.</p>
<p><a class="button red" href="https://github.com/ycatch/mameblock.js/archive/Beta_Ver0.2.2.zip"><i class="fa fa-download"></i> Download (Beta ver 0.2.2)</a></p>
<p><a href="https://github.com/ycatch/mameblock.js">source code on Github</a></p>
</div>
<div class="col_8 center" style="margin-top:60px;">
<img class="caption" src="docs/screenshot.png" />
</div>
<hr />
<div class="col_4 center">
<h4 style="color:gray;"><i class="fa fa-circle-o fa-3x"></i><br />Simple</h4>
<div>Just only 100 lines Javascript code with some library.</div>
</div>
<div class="col_4 center">
<h4 style="color:gray;"><i class="fa fa-wrench fa-3x"></i><br />Embedded</h4>
<div>You can use your own visual code editor with Web page and apps.</div>
</div>
<div class="col_4 center">
<h4 style="color:gray;"><i class="fa fa-share-alt fa-3x"></i><br />Open source</h4>
<div>Released under the MIT License.</div>
</div>
<hr />
<div class="col_12">
<h3>Demo</h3>
<p>Click Run button to execute code.</p>
<p>Drag & drop block, Click expression for edit code.</p>
<ul class="button-bar">
<li><a id="mameRun" href="javascript:void(0)"><i class="fa fa-play"></i> Run</a></li>
</ul>
<p></p>
<!-- Tabs Left -->
<ul class="tabs left">
<li><a href="#tabr1">Block</a></li>
<li id="code_tab"><a href="#tabr2">Code</a></li>
</ul>
<div id="tabr1" class="tab-content">
<div id="loading_area">Edit Area:</div>
</div>
<div id="tabr2" class="tab-content">
<pre id="exampleArea"></pre>
</div>
<hr />
<h3 id="example">Example</h3>
<ul>
<li><a href='example/simple/index.html'>Basic Example</a></li>
<li><a href='example/simple/fizzbuzz.html'>FizzBuzz Question</a></li>
<li><a href='example/p5.js/index.html'>p5.js - Processing</a></li>
<li><a href='example/p5.turtle.block/index.html'>p5.turtle.js - Processing</a></li>
</ul>
</div>
<hr />
<div class="col_12">
<h3>Try It</h3>
<h4>1.Download</h4>
<p>Download and extract.</p>
<a class="button red" href="https://github.com/ycatch/mameblock.js/archive/Beta_Ver0.2.2.zip"><i class="fa fa-download"></i> Download</a>
<h4>2.Open files</h4>
<p>Open index.html to same this page.</p>
<p>Editor load mameBlock_template.html.</p>
</div>
<hr />
<div class="col_12">
<h3>Setting</h3>
<p>Copy some files and folders and set these css, HTML and Javascript on your HTML file.</p>
<h4>1.Files</h4>
<p>Copy these files</p>
<ul>
<li>css/mameblock.min.css</li>
<li>js/jquery-1.11.2.min.js</li>
<li>js/mameblock.min.js</li>
<li>mameBlock_template.html</li>
</ul>
<h4>2.CSS</h4>
<p>Make html file and set css</p>
<pre><link rel="stylesheet" type="text/css" href="css/mameblock.min.css" media="all" /></pre>
<h4>3.HTML tags</h4>
<p>set Run button with block area in html</p>
<pre><a id="mameRun" href="javascript:void(0)">Run</a>
<a id="mameCode" href="javascript:void(0)">View Code</a>
<div id="loading_area">Edit Area:</div></pre>
<p>set frame of dialog in html.</p>
<pre><!-- express dialog -->
<div id="modal-express">
<div class="modal-body">
<label for="expModalText">Edit expression</label><br />
<input id="expModalText" type="text" />
</div>
<a class="modal_close" href="#">[OK]</a>
</div></pre>
<h4>4.Javascript</h4>
<p>Load jquery and library in index.html.</p>
<pre><!-- Javascript -->
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="js/mameblock.min.js"></script>
</pre>
<p>Load control script in index.html.</p>
<pre><script type="text/javascript">
$(function() {
<!-- # Init -->
var codeArea = $("#exampleArea");
var codeText = MAME_BLOCK.init("#loading_area", "mameBlock_template.html");
/* wait for DOM building */
var wait0 = setTimeout(function() {
setCode(MAME_BLOCK.getCodeBlock(), codeArea);
}, 500);
<!-- # Run -->
$("#mameRun").click(function() {
<!-- get code -->
var codeText = MAME_BLOCK.getCodeBlock();
setCode(codeText, codeArea);
var mameExec = new Function(codeText);
mameExec();
});
<!-- # View code -->
$("#mameCode").click(function() {
alert(MAME_BLOCK.getCodeBlock());
});
});
</script>
</pre>
<h4>5.Misc</h4>
<p>You can use your favarite librarly for code-highlighter and excutting code. I use highlight.js and Function class.</p>
</div>
<hr />
<div class="col_12">
<h3>Development Guide</h3>
<ul>
<li><a href='docs/development_guide.en.txt'>English Edition</a></li>
<li><a href='docs/development_guide.ja.txt'>日本語版</a></li>
</ul>
<hr />
<h3>Environment</h3>
<p>MameBlock.js tested and working in these browsers.</p>
<ul>
<li>Firefox</li>
<li>Internet Explorer</li>
<li>Google Chrome</li>
<li>Safari</li>
</ul>
<hr />
<h3>News</h3>
<ul>
<li>2016.12.07 : Update example: p5.turtle.block with splite.</li>
<li>2016.12.05 : Beta release ver.0.2.2: Fix bug</li>
<li>2015.12.28 : Beta release ver.0.2.1: add example of p5.turtle.js</li>
<li>2015.11.12 : Beta release ver.0.2.0: replace dailog to tabs</li>
<li>2015.08.16 : Beta release ver.0.1.4: add example of p5.js - Processing</li>
<li>2015.07.08 : Beta release ver.0.1.3</li>
<li>2015.07.07 : Beta release ver.0.1.2</li>
<li>2015.07.07 : Beta release ver.0.1.1</li>
<li>2015.07.03 : Beta release ver.0.1</li>
</ul>
<hr />
<h3>Constraints</h3>
<ul>
<li>I will chahge some API.</li>
</ul>
<hr />
<h3>Relational Projects</h3>
<ul>
<li><a href="https://github.com/ycatch/SoraMame.Block/">SoraMame.Block</a></li>
<li><a href="http://johnny.github.io/jquery-sortable/">jquery-sortablek</a></li>
</ul>
</div>
<div class="col_12" id="footer">
Copyright 2015-2016 Yutaka Kachi All Rights Reserved.
</div>
</div> <!-- End Grid -->
<div id="modal-express">
<div class="modal-body">
<label for="expModalText">Edit expression</label><br />
<input id="expModalText" type="text" />
</div>
<a class="modal_close" href="#">[OK]</a>
</div>
<!-- Javascript -->
<script type="text/javascript" src="js/jquery-1.11.2.min.js"></script>
<script type="text/javascript" src="js/mameblock.min.js"></script>
<script type="text/javascript" src="js/highlight.pack.js"></script>
<script type="text/javascript">
$(function() {
<!-- # Init -->
var codeArea = $("#exampleArea");
var codeText = MAME_BLOCK.init("#loading_area", "mameBlock_template.html");
/* wait for DOM building */
var wait0 = setTimeout(function() {
setCode(MAME_BLOCK.getCodeBlock(), codeArea);
}, 500);
<!-- # Run -->
$("#mameRun").click(function() {
<!-- get code -->
var codeText = MAME_BLOCK.getCodeBlock();
setCode(codeText, codeArea);
var mameExec = new Function(codeText);
mameExec();
});
<!-- # reload to Code tab -->
$("#code_tab").click(function() {
setCode(MAME_BLOCK.getCodeBlock(), codeArea);
});
<!-- ## set code and syntax highlight -->
function setCode(code, codeArea) {
codeArea.text(code);
codeArea.each(function(i, block) {
hljs.highlightBlock(block);
});
};
});
</script>
</body>
</html>