This repository was archived by the owner on Feb 22, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathindex.html
More file actions
224 lines (184 loc) · 5.66 KB
/
index.html
File metadata and controls
224 lines (184 loc) · 5.66 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
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
<!doctype html>
<html>
<head>
<title>FathomJS + CodeMirror Example Slides</title>
<link rel="stylesheet" type="text/css" href="css/presentation.css" />
<link rel="stylesheet" type="text/css" href="css/codemirror.css" />
<link href="http://fonts.googleapis.com/css?family=Droid Sans&subset=latin" rel="stylesheet" type="text/css"/>
<script src="js/jquery-1.6.2.min.js"></script>
<script src="js/jquery.overlay.js"></script>
<script src="js/fathom.js"></script>
<script src="js/codemirror.js"></script>
<script src="js/prefixfree.js"></script>
<script>
$(document).ready(function(){
$('.slide a').attr('target', '_blank');
$('textarea').each(function(elem) {
var textArea = this;
$(textArea).attr('tabIndex', 0);
var codeMirrorOpts = {
lineNumbers: true
}
if ($(textArea).hasClass('html') || $(textArea).hasClass('script')) {
codeMirrorOpts.mode = {name: 'xml', htmlMode: true}
} else if ($(textArea).hasClass('js')) {
codeMirrorOpts.matchBrackets = true;
}
var editor = CodeMirror.fromTextArea(textArea, codeMirrorOpts);
$(editor.getWrapperElement()).keydown(function(e) {
e.stopPropagation();
});
if ($(textArea).hasClass('runnable')) {
var button = $('<button class="btn run-button">Run!</button>');
button.click(function() {
var code = editor.getValue();
if ($(textArea).hasClass('html')) {
$('#demo').html(code);
} else if ($(textArea).hasClass('script')) {
$('body').append(code);
} else if ($(textArea).hasClass('js')) {
window.eval(code);
}
$("#demo").leanModal();
});
$(this).after(button);
}
});
var fathom = new Fathom('#presentation');
});
</script>
<!-- Presentation specific scripts -->
<script src="js/jsonp.js"></script>
<script src="js/store.js"></script>
<script src="js/lawnchair.js"></script>
<script src="js/lscache.js"></script>
</head>
<body>
<div id="demo" style="display:none"></div>
<button class="notes-button btn" onclick="javascript:$('.notes').toggle();">Show/Hide Notes</button>
<div id="presentation">
<div class="slide">
<br><br><br>
<h1>FathomJS + CodeMirror Example</h1>
<p>
<a href="https://github.com/pamelafox/fathomjs-codemirror-example">https://github.com/pamelafox/fathomjs-codemirror-example</a>
</p>
<p class="footer">
<br><br>
By <a href="http://pamelafox.org">pamelafox</a>, 2012
</p>
<p class="notes">
You can put speaker notes here if you want to share them with people after.
I like to do that since it's often hard to understand slides without knowing what people said.
</p>
</div>
<div class="slide">
<h1>How to Use these Slides</h1>
<p>This is an example deck of FathomJS + CodeMirror.
<br>Use the arrow keys to browse it, and then view source to see how it works.
</p>
</div>
<div class="slide">
<h1>Runnable JS Snippet</h1>
<p>The JS will be evaluated.</p>
<textarea class="runnable js">
var favoriteFruits = ['blackberries', 'blueberries'];
for (var i = 0; i < favoriteFruits.length; i++) {
$('#demo').append('I like to stuff my face with ' + favoriteFruits[i]);
}
</textarea>
</div>
<div class="slide">
<h1>Runnable HTML Snippet</h1>
<p>The HTML will be appended to the #demo DIV.</p>
<textarea class="runnable html">
<img width="550" height="250" src="
http://chart.apis.google.com/chart?
cht=p&
chs=550x250&
chd=t:10,80,10&
chco=FAFAFA,FFFF00,FAFAFA&
chl=Does%20not%20resemble%20Pac-man|Resembles%20Pac-man&
chtt=Percentage%20of%20Google%20Chart%20Which%20Resembles%20Pac-man">
</textarea>
</div>
<div class="slide">
<h1>Runnable Script Snippet</h1>
<p>The SCRIPT tags will be appended to the BODY.</p>
<textarea class="runnable script">
<script src="http://imagine-it.org/api.php?callback=onLoadData">
</script>
<script>
function onLoadData(json) {
$('#demo').html('<h1> YO YO YO ' + json.name + '</h1>');
}
</script>
</textarea>
</div>
<div class="slide">
<h1>Static Script Snippet</h1>
<p>You can also just do non-runnable snippets as well.</p>
<textarea class="script">
<script src="http://apidomain.com/library.js"></script>
<script>
apiNamespace.apiFunction();
</script>
</textarea>
</div>
<div class="slide">
<h1>Slide backgrounds</h1>
<p>I rather like to use these <a href="http://lea.verou.me/css3patterns/">CSS3 patterns</a>
to liven up my slide background. You can try them out here:
</p>
<select name="backgrounds" style="font-size:36px;">
<option>arrows
<option>zigzag
<option>weave
<option>upholstery
<option>starry
<option>marrakesh
<option>rainbow
<option>carbon
<option>carbonfibre
<option>argyle
<option>hearts
<option>steps
<option>waves
<option>cross
<option>yinyang
<option>stars
<option>bradybunch
<option>shippo
<option>silver
<option>seigaiha
<option>japanesecube
<option>polkadot
<option>houndstooth
<option>checkerboard
<option>diagonalcheckerboard
<option>tartan
<option>madras
<option>linedpaper
<option>blueprintgrid
<option>tablecloth
<option>diagonalstripes
<option>cicadastripes
<option>verticalstripes
<option>horizontalstripes
</select>
<p>If you find one you like, you might also change the .slide h1 to the background color
for a nice effect.
</p>
<script>
$('select[name="backgrounds"]').change(function() {
$('body').attr('class', $(this).val());
});
</script>
</div>
<div class="slide">
<h1>Thats it, folks</h1>
<p>Let me know if you do something nifty with them. Thanks!</p>
<img src="http://3.bp.blogspot.com/_S3bjhfYpMg8/SXeMP7E6SYI/AAAAAAAAAs8/9tI506jmFBU/s400/happy+banana.jpg">
</div>
</body>
</html>