-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathempty.html
More file actions
68 lines (54 loc) · 2.16 KB
/
empty.html
File metadata and controls
68 lines (54 loc) · 2.16 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
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>empty</title>
<script src="./lib/jquery.js"></script>
<script src="./lib/jqconsole.js"></script>
<script src="./lib/sugar.js"></script>
<script src="./lib/peg.js"></script>
<script src="./lib/plt.js"></script>
<script src="./lib/canvas-toBlob.js"></script>
<script src="./lib/FileSaver.min.js"></script>
<script src="./ComicStripScript.js"></script>
<link rel ="stylesheet" href="./css/style.css" type="text/css">
</head>
<body>
<!-- DON'T NEED TO TOUCH*************************************************************************************************************** -->
<grammar>
start = title cast panels+ {ComicStripScript.run(ComicStripScript.tree)}
title = sp '---TITLE' sp t:titleString sp {ComicStripScript.tree.title = t;}
titleString = s:[^\n]* sp {return s.join("")}
cast = sp '---CAST' starring
starring = sp c:casts* sp {ComicStripScript.addToCasts(c);}
casts = sp 'Starring' space path:string space 'as' space name:string sp {return {name:name, path:path}}
panels = sp '---' sp contents:(left/right)+ sp { ComicStripScript.addToPanels(contents);}
left = sp name:string sp ':' sp emoticon:emoticon space '<(' caption:caption ')' {return {name:name, caption:caption, emoticon:emoticon, direction:"left"} }
right = sp name:string sp ':' sp '(' caption:caption ')>' space emoticon:emoticon {return {name:name, caption:caption, emoticon:emoticon, direction:"right"} }
caption = '"' s:[^"]* '"' {return s.join("")}
emoticon = s:[^ \n]+ {return s.join("")}
sp = [ \n\t]*
space = ' '
string = s:[a-zA-Z0-9'"]* {return s.join("")}
number = d:[0-9\.-]+ sp {return parseFloat(d.join(""));}
</grammar>
<!-- *************************************************************************************************************** -->
<div id="comic"></div>
<code id="comicsource" style="display:none;">
---TITLE
Empty
---CAST
Starring mickey as M
---
M : ('-') <("I fell empty")
</code>
<script>
//---call it after plt.js's onload function is called
setTimeout(function(){
//---parse the source code
var source = $('#comicsource').text();
ComicStripScript.draw(source);
},50);
</script>
</body>
</html>