squiffy-compiler 6.0.0-alpha.0 → 6.0.0-alpha.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/compiler.d.ts +2 -1
- package/dist/compiler.js +11 -9
- package/package.json +7 -17
- package/dist/compiler.test.d.ts +0 -1
- package/dist/compiler.test.js +0 -73
- package/dist/external-files.d.ts +0 -5
- package/dist/external-files.js +0 -21
- package/dist/index.template.html +0 -39
- package/dist/packager.d.ts +0 -1
- package/dist/packager.js +0 -78
- package/dist/server.d.ts +0 -1
- package/dist/server.js +0 -15
- package/dist/squiffy.d.ts +0 -1
- package/dist/squiffy.js +0 -29
- package/dist/squiffy.runtime.d.ts +0 -34
- package/dist/squiffy.template.d.ts +0 -29
- package/dist/squiffy.template.js +0 -598
- package/dist/style.template.css +0 -52
- package/dist/version.d.ts +0 -1
- package/dist/version.js +0 -1
- package/examples/attributes/attributes.squiffy +0 -81
- package/examples/clearscreen/clearscreen.squiffy +0 -15
- package/examples/continue/continue.squiffy +0 -18
- package/examples/helloworld/helloworld.squiffy +0 -1
- package/examples/import/file2.squiffy +0 -8
- package/examples/import/test.js +0 -3
- package/examples/import/test.squiffy +0 -5
- package/examples/input/input.squiffy +0 -22
- package/examples/last/last.squiffy +0 -32
- package/examples/master/master.squiffy +0 -35
- package/examples/replace/replace.squiffy +0 -27
- package/examples/rotate/rotate.squiffy +0 -25
- package/examples/sectiontrack/sectiontrack.squiffy +0 -16
- package/examples/start/start.squiffy +0 -7
- package/examples/test/example.squiffy +0 -52
- package/examples/textprocessor/textprocessor.squiffy +0 -21
- package/examples/transitions/transitions.squiffy +0 -53
- package/examples/turncount/turncount.squiffy +0 -41
- package/examples/warnings/warnings.squiffy +0 -23
- package/examples/warnings/warnings2.squiffy +0 -3
- package/src/__snapshots__/compiler.test.ts.snap +0 -716
- package/src/compiler.test.ts +0 -86
- package/src/compiler.ts +0 -546
- package/src/external-files.ts +0 -22
- package/src/index.template.html +0 -39
- package/src/packager.ts +0 -97
- package/src/server.ts +0 -19
- package/src/squiffy.runtime.ts +0 -670
- package/src/squiffy.ts +0 -36
- package/src/style.template.css +0 -52
- package/src/version.ts +0 -1
- package/tsconfig.json +0 -22
- package/tsconfig.runtime.json +0 -12
|
@@ -1,716 +0,0 @@
|
|
|
1
|
-
// Vitest Snapshot v1, https://vitest.dev/guide/snapshot.html
|
|
2
|
-
|
|
3
|
-
exports[`attributes/attributes.squiffy 1`] = `
|
|
4
|
-
{
|
|
5
|
-
"js": [
|
|
6
|
-
[
|
|
7
|
-
"alert("my_attribute " + get("my_attribute"));",
|
|
8
|
-
],
|
|
9
|
-
],
|
|
10
|
-
"story": {
|
|
11
|
-
"id": "attributes.squiffy",
|
|
12
|
-
"sections": {
|
|
13
|
-
"_default": {
|
|
14
|
-
"attributes": [
|
|
15
|
-
"my_string = some text",
|
|
16
|
-
],
|
|
17
|
-
"text": "<p>Set a start value: <a class="squiffy-link link-section" data-section="one" role="link" tabindex="0">1</a> or <a class="squiffy-link link-section" data-section="two" role="link" tabindex="0">2</a>.</p>",
|
|
18
|
-
},
|
|
19
|
-
"done": {
|
|
20
|
-
"passages": {
|
|
21
|
-
"dec": {
|
|
22
|
-
"attributes": [
|
|
23
|
-
"count-=1",
|
|
24
|
-
],
|
|
25
|
-
"text": "<p>Now count is {count}. You can also <a class="squiffy-link link-passage" data-passage="increase" role="link" tabindex="0">increase</a> or <a class="squiffy-link link-passage" data-passage="decrease" role="link" tabindex="0">decrease</a> by values other than 1.</p>",
|
|
26
|
-
},
|
|
27
|
-
"decrease": {
|
|
28
|
-
"attributes": [
|
|
29
|
-
"count-=5",
|
|
30
|
-
],
|
|
31
|
-
"text": "<p>Now count is {count}.</p>",
|
|
32
|
-
},
|
|
33
|
-
"increase": {
|
|
34
|
-
"attributes": [
|
|
35
|
-
"count+=10",
|
|
36
|
-
],
|
|
37
|
-
"text": "<p>Now count is {count}.</p>",
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
"text": "<p>You clicked {count} links. What about calling <a class="squiffy-link link-passage" data-passage="dec" role="link" tabindex="0">dec</a>?</p>",
|
|
41
|
-
},
|
|
42
|
-
"next": {
|
|
43
|
-
"passages": {
|
|
44
|
-
"a": {
|
|
45
|
-
"attributes": [
|
|
46
|
-
"count+=1",
|
|
47
|
-
],
|
|
48
|
-
"text": "<p>OK...</p>",
|
|
49
|
-
},
|
|
50
|
-
"b": {
|
|
51
|
-
"attributes": [
|
|
52
|
-
"count+=1",
|
|
53
|
-
],
|
|
54
|
-
"text": "<p>OK...</p>",
|
|
55
|
-
},
|
|
56
|
-
"c": {
|
|
57
|
-
"attributes": [
|
|
58
|
-
"count+=1",
|
|
59
|
-
],
|
|
60
|
-
"text": "<p>OK...</p>",
|
|
61
|
-
},
|
|
62
|
-
"d": {
|
|
63
|
-
"attributes": [
|
|
64
|
-
"count+=1",
|
|
65
|
-
],
|
|
66
|
-
"text": "<p>OK...</p>",
|
|
67
|
-
},
|
|
68
|
-
"e": {
|
|
69
|
-
"attributes": [
|
|
70
|
-
"count+=1",
|
|
71
|
-
],
|
|
72
|
-
"text": "<p>OK...</p>",
|
|
73
|
-
},
|
|
74
|
-
"unset": {
|
|
75
|
-
"attributes": [
|
|
76
|
-
"not chose_passage",
|
|
77
|
-
],
|
|
78
|
-
"text": "<p>Now the value is: {if chose_passage:yes}{else:no}</p>",
|
|
79
|
-
},
|
|
80
|
-
},
|
|
81
|
-
"text": "<p>my_attribute = {my_attribute}</p>
|
|
82
|
-
<p>Also, my_string = "{my_string}"</p>
|
|
83
|
-
<p>Did you choose a passage link? {if chose_passage:yes}{else:no} <a class="squiffy-link link-passage" data-passage="unset" role="link" tabindex="0">unset</a></p>
|
|
84
|
-
<p>Click some more links: <a class="squiffy-link link-passage" data-passage="a" role="link" tabindex="0">a</a>, <a class="squiffy-link link-passage" data-passage="b" role="link" tabindex="0">b</a>, <a class="squiffy-link link-passage" data-passage="c" role="link" tabindex="0">c</a>, <a class="squiffy-link link-passage" data-passage="d" role="link" tabindex="0">d</a>, <a class="squiffy-link link-passage" data-passage="e" role="link" tabindex="0">e</a> and then click <a class="squiffy-link link-section" data-section="done" role="link" tabindex="0">done</a>.</p>",
|
|
85
|
-
},
|
|
86
|
-
"one": {
|
|
87
|
-
"attributes": [
|
|
88
|
-
"my_attribute = 1",
|
|
89
|
-
],
|
|
90
|
-
"passages": {
|
|
91
|
-
"three": {
|
|
92
|
-
"attributes": [
|
|
93
|
-
"my_attribute = 3",
|
|
94
|
-
"chose_passage",
|
|
95
|
-
],
|
|
96
|
-
"text": "<p>OK. Three it is.</p>",
|
|
97
|
-
},
|
|
98
|
-
},
|
|
99
|
-
"text": "<p>Maybe you'd like it to be <a class="squiffy-link link-passage" data-passage="three" role="link" tabindex="0">3</a> instead? Or you could just <a class="squiffy-link link-section" data-section="next" role="link" tabindex="0">continue...</a></p>",
|
|
100
|
-
},
|
|
101
|
-
"two": {
|
|
102
|
-
"attributes": [
|
|
103
|
-
"my_attribute = 2",
|
|
104
|
-
],
|
|
105
|
-
"passages": {
|
|
106
|
-
"four": {
|
|
107
|
-
"attributes": [
|
|
108
|
-
"my_attribute = 4",
|
|
109
|
-
"chose_passage",
|
|
110
|
-
],
|
|
111
|
-
"text": "<p>OK. Four it is.</p>",
|
|
112
|
-
},
|
|
113
|
-
"javascript": {
|
|
114
|
-
"jsIndex": 0,
|
|
115
|
-
"text": "",
|
|
116
|
-
},
|
|
117
|
-
},
|
|
118
|
-
"text": "<p>Maybe you'd like it to be <a class="squiffy-link link-passage" data-passage="four" role="link" tabindex="0">4</a> instead? You could try <a class="squiffy-link link-passage" data-passage="javascript" role="link" tabindex="0">javascript</a>. Or you could just <a class="squiffy-link link-section" data-section="next" role="link" tabindex="0">continue...</a></p>",
|
|
119
|
-
},
|
|
120
|
-
},
|
|
121
|
-
"start": "_default",
|
|
122
|
-
},
|
|
123
|
-
}
|
|
124
|
-
`;
|
|
125
|
-
|
|
126
|
-
exports[`clearscreen/clearscreen.squiffy 1`] = `
|
|
127
|
-
{
|
|
128
|
-
"js": [],
|
|
129
|
-
"story": {
|
|
130
|
-
"id": "clearscreen.squiffy",
|
|
131
|
-
"sections": {
|
|
132
|
-
"_default": {
|
|
133
|
-
"passages": {
|
|
134
|
-
"one": {
|
|
135
|
-
"text": "<p>This text is on the same screen.</p>",
|
|
136
|
-
},
|
|
137
|
-
"two": {
|
|
138
|
-
"clear": true,
|
|
139
|
-
"text": "<p>This text is on a new screen. This <a class="squiffy-link link-section" data-section="same page" role="link" tabindex="0">section</a> will be on the same screen, and this <a class="squiffy-link link-section" data-section="clear section" role="link" tabindex="0">section</a> clears the screen.</p>",
|
|
140
|
-
},
|
|
141
|
-
},
|
|
142
|
-
"text": "<p><a class="squiffy-link link-passage" data-passage="one" role="link" tabindex="0">This link</a> doesn't clear the screen. But <a class="squiffy-link link-passage" data-passage="two" role="link" tabindex="0">this link</a> does.</p>",
|
|
143
|
-
},
|
|
144
|
-
"clear section": {
|
|
145
|
-
"clear": true,
|
|
146
|
-
"text": "<p>Another new page.</p>",
|
|
147
|
-
},
|
|
148
|
-
"same page": {
|
|
149
|
-
"text": "<p>This section is on the same screen.</p>",
|
|
150
|
-
},
|
|
151
|
-
},
|
|
152
|
-
"start": "_default",
|
|
153
|
-
},
|
|
154
|
-
}
|
|
155
|
-
`;
|
|
156
|
-
|
|
157
|
-
exports[`continue/continue.squiffy 1`] = `
|
|
158
|
-
{
|
|
159
|
-
"js": [
|
|
160
|
-
[
|
|
161
|
-
"alert("BOO!")",
|
|
162
|
-
],
|
|
163
|
-
],
|
|
164
|
-
"story": {
|
|
165
|
-
"id": "continue.squiffy",
|
|
166
|
-
"sections": {
|
|
167
|
-
"_continue1": {
|
|
168
|
-
"text": "<p>More text.</p>
|
|
169
|
-
<p><a class="squiffy-link link-section" data-section="_continue2" role="link" tabindex="0">Carry on further...</a></p>",
|
|
170
|
-
},
|
|
171
|
-
"_continue2": {
|
|
172
|
-
"text": "<p>There's some more text now.</p>
|
|
173
|
-
<p><a class="squiffy-link link-section" data-section="_continue3" role="link" tabindex="0">Keep walking!</a></p>",
|
|
174
|
-
},
|
|
175
|
-
"_continue3": {
|
|
176
|
-
"text": "<p>Oh, even more text appeared!</p>
|
|
177
|
-
<p><a class="squiffy-link link-section" data-section="_continue4" role="link" tabindex="0">A little closer...</a></p>",
|
|
178
|
-
},
|
|
179
|
-
"_continue4": {
|
|
180
|
-
"jsIndex": 0,
|
|
181
|
-
"text": "<p>Pretty scary.</p>",
|
|
182
|
-
},
|
|
183
|
-
"_default": {
|
|
184
|
-
"text": "<p>Here is some text.</p>
|
|
185
|
-
<p><a class="squiffy-link link-section" data-section="_continue1" role="link" tabindex="0">Continue...</a></p>",
|
|
186
|
-
},
|
|
187
|
-
},
|
|
188
|
-
"start": "_default",
|
|
189
|
-
},
|
|
190
|
-
}
|
|
191
|
-
`;
|
|
192
|
-
|
|
193
|
-
exports[`helloworld/helloworld.squiffy 1`] = `
|
|
194
|
-
{
|
|
195
|
-
"js": [],
|
|
196
|
-
"story": {
|
|
197
|
-
"id": "helloworld.squiffy",
|
|
198
|
-
"sections": {
|
|
199
|
-
"_default": {
|
|
200
|
-
"text": "<p>Hello, world!</p>",
|
|
201
|
-
},
|
|
202
|
-
},
|
|
203
|
-
"start": "_default",
|
|
204
|
-
},
|
|
205
|
-
}
|
|
206
|
-
`;
|
|
207
|
-
|
|
208
|
-
exports[`import/test.squiffy 1`] = `
|
|
209
|
-
{
|
|
210
|
-
"js": [
|
|
211
|
-
[
|
|
212
|
-
"test();",
|
|
213
|
-
],
|
|
214
|
-
],
|
|
215
|
-
"story": {
|
|
216
|
-
"id": "test.squiffy",
|
|
217
|
-
"sections": {
|
|
218
|
-
"_default": {
|
|
219
|
-
"text": "<p>Text from file 1.</p>
|
|
220
|
-
<p><a class="squiffy-link link-section" data-section="file2" role="link" tabindex="0">Go to file 2</a></p>",
|
|
221
|
-
},
|
|
222
|
-
"file2": {
|
|
223
|
-
"passages": {
|
|
224
|
-
"test": {
|
|
225
|
-
"jsIndex": 0,
|
|
226
|
-
"text": "",
|
|
227
|
-
},
|
|
228
|
-
},
|
|
229
|
-
"text": "<p>Text from file 2. Run the <a class="squiffy-link link-passage" data-passage="test" role="link" tabindex="0">test</a> function.</p>",
|
|
230
|
-
},
|
|
231
|
-
},
|
|
232
|
-
"start": "_default",
|
|
233
|
-
},
|
|
234
|
-
}
|
|
235
|
-
`;
|
|
236
|
-
|
|
237
|
-
exports[`last/last.squiffy 1`] = `
|
|
238
|
-
{
|
|
239
|
-
"js": [],
|
|
240
|
-
"story": {
|
|
241
|
-
"id": "last.squiffy",
|
|
242
|
-
"sections": {
|
|
243
|
-
"_default": {
|
|
244
|
-
"passageCount": 3,
|
|
245
|
-
"passages": {
|
|
246
|
-
"@last": {
|
|
247
|
-
"text": "<p>You saw all passages! Now go to the <a class="squiffy-link link-section" data-section="section2" role="link" tabindex="0">next section</a>.</p>",
|
|
248
|
-
},
|
|
249
|
-
"a": {
|
|
250
|
-
"text": "<p>Passage A.</p>",
|
|
251
|
-
},
|
|
252
|
-
"b": {
|
|
253
|
-
"text": "<p>Passage B.</p>",
|
|
254
|
-
},
|
|
255
|
-
"c": {
|
|
256
|
-
"text": "<p>Passage C.</p>",
|
|
257
|
-
},
|
|
258
|
-
},
|
|
259
|
-
"text": "<p>Test section with some passages. <a class="squiffy-link link-passage" data-passage="a" role="link" tabindex="0">a</a>, <a class="squiffy-link link-passage" data-passage="b" role="link" tabindex="0">b</a>, <a class="squiffy-link link-passage" data-passage="c" role="link" tabindex="0">c</a>.</p>",
|
|
260
|
-
},
|
|
261
|
-
"section2": {
|
|
262
|
-
"passageCount": 3,
|
|
263
|
-
"passages": {
|
|
264
|
-
"": {
|
|
265
|
-
"text": "<p>Master passage.</p>",
|
|
266
|
-
},
|
|
267
|
-
"@last": {
|
|
268
|
-
"text": "<p>You saw all passages!</p>",
|
|
269
|
-
},
|
|
270
|
-
"a": {
|
|
271
|
-
"text": "<p>Passage A.</p>",
|
|
272
|
-
},
|
|
273
|
-
"b": {
|
|
274
|
-
"text": "<p>Passage B.</p>",
|
|
275
|
-
},
|
|
276
|
-
"c": {
|
|
277
|
-
"text": "<p>Passage C.</p>",
|
|
278
|
-
},
|
|
279
|
-
},
|
|
280
|
-
"text": "<p>Second test. <a class="squiffy-link link-passage" data-passage="a" role="link" tabindex="0">a</a>, <a class="squiffy-link link-passage" data-passage="b" role="link" tabindex="0">b</a>, <a class="squiffy-link link-passage" data-passage="c" role="link" tabindex="0">c</a>.</p>",
|
|
281
|
-
},
|
|
282
|
-
},
|
|
283
|
-
"start": "_default",
|
|
284
|
-
},
|
|
285
|
-
}
|
|
286
|
-
`;
|
|
287
|
-
|
|
288
|
-
exports[`master/master.squiffy 1`] = `
|
|
289
|
-
{
|
|
290
|
-
"js": [
|
|
291
|
-
[
|
|
292
|
-
"console.log("This JS runs for each passage in the entire game.")",
|
|
293
|
-
],
|
|
294
|
-
[
|
|
295
|
-
"console.log("This JS runs for each passage in the second section.");",
|
|
296
|
-
],
|
|
297
|
-
],
|
|
298
|
-
"story": {
|
|
299
|
-
"id": "master.squiffy",
|
|
300
|
-
"sections": {
|
|
301
|
-
"": {
|
|
302
|
-
"passages": {
|
|
303
|
-
"": {
|
|
304
|
-
"jsIndex": 0,
|
|
305
|
-
"text": "",
|
|
306
|
-
},
|
|
307
|
-
},
|
|
308
|
-
"text": "<p>This text appears before each section in the game.</p>",
|
|
309
|
-
},
|
|
310
|
-
"Next!": {
|
|
311
|
-
"passages": {
|
|
312
|
-
"See": {
|
|
313
|
-
"text": "<p>The end...</p>",
|
|
314
|
-
},
|
|
315
|
-
},
|
|
316
|
-
"text": "<p>Final section, no master passages here. <a class="squiffy-link link-passage" data-passage="See" role="link" tabindex="0">See</a>.</p>",
|
|
317
|
-
},
|
|
318
|
-
"_continue1": {
|
|
319
|
-
"passages": {
|
|
320
|
-
"": {
|
|
321
|
-
"jsIndex": 1,
|
|
322
|
-
"text": "<p>This text appears before each passage in this section.</p>",
|
|
323
|
-
},
|
|
324
|
-
"One": {
|
|
325
|
-
"text": "<p>1...</p>",
|
|
326
|
-
},
|
|
327
|
-
"three": {
|
|
328
|
-
"text": "<p>3...</p>",
|
|
329
|
-
},
|
|
330
|
-
"two": {
|
|
331
|
-
"text": "<p>2...</p>",
|
|
332
|
-
},
|
|
333
|
-
},
|
|
334
|
-
"text": "<p>This is the second section. <a class="squiffy-link link-passage" data-passage="One" role="link" tabindex="0">One</a>, <a class="squiffy-link link-passage" data-passage="two" role="link" tabindex="0">two</a>, <a class="squiffy-link link-passage" data-passage="three" role="link" tabindex="0">three</a>. <a class="squiffy-link link-section" data-section="Next!" role="link" tabindex="0">Next!</a></p>",
|
|
335
|
-
},
|
|
336
|
-
"intro": {
|
|
337
|
-
"text": "<p>This is the first section.</p>
|
|
338
|
-
<p><a class="squiffy-link link-section" data-section="_continue1" role="link" tabindex="0">Continue...</a></p>",
|
|
339
|
-
},
|
|
340
|
-
},
|
|
341
|
-
"start": "intro",
|
|
342
|
-
},
|
|
343
|
-
}
|
|
344
|
-
`;
|
|
345
|
-
|
|
346
|
-
exports[`replace/replace.squiffy 1`] = `
|
|
347
|
-
{
|
|
348
|
-
"js": [],
|
|
349
|
-
"story": {
|
|
350
|
-
"id": "replace.squiffy",
|
|
351
|
-
"sections": {
|
|
352
|
-
"_default": {
|
|
353
|
-
"passages": {
|
|
354
|
-
"beer": {
|
|
355
|
-
"text": "<p>a <a class="squiffy-link link-passage" data-passage="crate of beer" role="link" tabindex="0">crate of beer</a></p>",
|
|
356
|
-
},
|
|
357
|
-
"crate of beer": {
|
|
358
|
-
"text": "<p>Yes, beer.</p>",
|
|
359
|
-
},
|
|
360
|
-
"love teleporting": {
|
|
361
|
-
"text": "<p>love teleporting, so much I might <a class="squiffy-link link-section" data-section="section2" role="link" tabindex="0">embark on a wild and crazy adventure</a></p>",
|
|
362
|
-
},
|
|
363
|
-
"next": {
|
|
364
|
-
"text": "<p>And then I thought, hang on, I {label:3=<a class="squiffy-link link-passage" data-passage="@replace 1=teleported, @replace 3=love teleporting" role="link" tabindex="0">hate walking</a>}.</p>",
|
|
365
|
-
},
|
|
366
|
-
},
|
|
367
|
-
"text": "<p>I {label:1=walked} to the shops and I bought {label:2=a pint of milk}.</p>
|
|
368
|
-
<p>But then I thought, hang on, I <a class="squiffy-link link-passage" data-passage="next, @replace 2=beer" role="link" tabindex="0">don't really like milk</a>.</p>",
|
|
369
|
-
},
|
|
370
|
-
"section2": {
|
|
371
|
-
"text": "<p>And so it {label:4=began...}</p>
|
|
372
|
-
<p><a class="squiffy-link link-section" data-section="section3" role="link" tabindex="0">Or did it?</a></p>",
|
|
373
|
-
},
|
|
374
|
-
"section3": {
|
|
375
|
-
"attributes": [
|
|
376
|
-
"@replace 4=<p>ended <a class="squiffy-link link-passage" data-passage="abruptly" role="link" tabindex="0">abruptly</a>.</p>",
|
|
377
|
-
],
|
|
378
|
-
"passages": {
|
|
379
|
-
"abruptly": {
|
|
380
|
-
"text": "<p>That is all.</p>",
|
|
381
|
-
},
|
|
382
|
-
},
|
|
383
|
-
"text": "<p>Oh well.</p>",
|
|
384
|
-
},
|
|
385
|
-
},
|
|
386
|
-
"start": "_default",
|
|
387
|
-
},
|
|
388
|
-
}
|
|
389
|
-
`;
|
|
390
|
-
|
|
391
|
-
exports[`rotate/rotate.squiffy 1`] = `
|
|
392
|
-
{
|
|
393
|
-
"js": [],
|
|
394
|
-
"story": {
|
|
395
|
-
"id": "rotate.squiffy",
|
|
396
|
-
"sections": {
|
|
397
|
-
"Go!": {
|
|
398
|
-
"text": "<p>That's all folks!</p>",
|
|
399
|
-
},
|
|
400
|
-
"_continue1": {
|
|
401
|
-
"text": "<p>Now {rotate result:four:five:six}</p>
|
|
402
|
-
<p><a class="squiffy-link link-section" data-section="_continue2" role="link" tabindex="0">OK...</a></p>",
|
|
403
|
-
},
|
|
404
|
-
"_continue2": {
|
|
405
|
-
"text": "<p>You chose {result}.</p>
|
|
406
|
-
<p>Now for a sequence: {sequence:one:two:three:four:five}.</p>
|
|
407
|
-
<p><a class="squiffy-link link-section" data-section="_continue3" role="link" tabindex="0">And another...</a></p>",
|
|
408
|
-
},
|
|
409
|
-
"_continue3": {
|
|
410
|
-
"text": "<p>Another sequence: {sequence seqresult:a:b:c:d:e:f:g}.</p>
|
|
411
|
-
<p><a class="squiffy-link link-section" data-section="_continue4" role="link" tabindex="0">Finally...</a></p>",
|
|
412
|
-
},
|
|
413
|
-
"_continue4": {
|
|
414
|
-
"text": "<p>You chose {seqresult}.</p>
|
|
415
|
-
<p>Here's a sequence that links to another section. {sequence:Ready...:Steady...:<a class="squiffy-link link-section" data-section="Go!" role="link" tabindex="0">Go!</a>}</p>",
|
|
416
|
-
},
|
|
417
|
-
"_default": {
|
|
418
|
-
"text": "<p>Choose a number: {rotate:one:two:three}</p>
|
|
419
|
-
<p><a class="squiffy-link link-section" data-section="_continue1" role="link" tabindex="0">OK...</a></p>",
|
|
420
|
-
},
|
|
421
|
-
},
|
|
422
|
-
"start": "_default",
|
|
423
|
-
},
|
|
424
|
-
}
|
|
425
|
-
`;
|
|
426
|
-
|
|
427
|
-
exports[`sectiontrack/sectiontrack.squiffy 1`] = `
|
|
428
|
-
{
|
|
429
|
-
"js": [],
|
|
430
|
-
"story": {
|
|
431
|
-
"id": "sectiontrack.squiffy",
|
|
432
|
-
"sections": {
|
|
433
|
-
"_default": {
|
|
434
|
-
"passages": {
|
|
435
|
-
"note": {
|
|
436
|
-
"text": "<p>This is a passage.</p>",
|
|
437
|
-
},
|
|
438
|
-
},
|
|
439
|
-
"text": "<p>Choose: <a class="squiffy-link link-section" data-section="a" role="link" tabindex="0">a</a>, <a class="squiffy-link link-section" data-section="b" role="link" tabindex="0">b</a>, <a class="squiffy-link link-section" data-section="c" role="link" tabindex="0">c</a>. Or read this <a class="squiffy-link link-passage" data-passage="note" role="link" tabindex="0">note</a>.</p>",
|
|
440
|
-
},
|
|
441
|
-
"a": {
|
|
442
|
-
"text": "<p>Now choose <a class="squiffy-link link-section" data-section="b" role="link" tabindex="0">b</a> or <a class="squiffy-link link-section" data-section="c" role="link" tabindex="0">c</a>.</p>",
|
|
443
|
-
},
|
|
444
|
-
"b": {
|
|
445
|
-
"text": "<p>Now go to <a class="squiffy-link link-section" data-section="c" role="link" tabindex="0">c</a>.</p>",
|
|
446
|
-
},
|
|
447
|
-
"c": {
|
|
448
|
-
"text": "<p>{if seen a:You saw A.}{else:You didn't see A.}
|
|
449
|
-
{if not seen b:You didn't see B.}{else:You saw B.}</p>
|
|
450
|
-
<p>{if seen note:You looked at the note.}{else:You didn't look at the note.}</p>",
|
|
451
|
-
},
|
|
452
|
-
},
|
|
453
|
-
"start": "_default",
|
|
454
|
-
},
|
|
455
|
-
}
|
|
456
|
-
`;
|
|
457
|
-
|
|
458
|
-
exports[`start/start.squiffy 1`] = `
|
|
459
|
-
{
|
|
460
|
-
"js": [],
|
|
461
|
-
"story": {
|
|
462
|
-
"id": "start.squiffy",
|
|
463
|
-
"sections": {
|
|
464
|
-
"not the start section": {
|
|
465
|
-
"text": "<p>This is page 2, although it was defined first.</p>",
|
|
466
|
-
},
|
|
467
|
-
"the start section": {
|
|
468
|
-
"text": "<p>This is the start section. We also defined a section called <a class="squiffy-link link-section" data-section="not the start section" role="link" tabindex="0">not the start section</a>.</p>",
|
|
469
|
-
},
|
|
470
|
-
},
|
|
471
|
-
"start": "the start section",
|
|
472
|
-
},
|
|
473
|
-
}
|
|
474
|
-
`;
|
|
475
|
-
|
|
476
|
-
exports[`test/example.squiffy 1`] = `
|
|
477
|
-
{
|
|
478
|
-
"js": [
|
|
479
|
-
[
|
|
480
|
-
"alert ("This passage has some JavaScript");",
|
|
481
|
-
],
|
|
482
|
-
[
|
|
483
|
-
"alert ("This section has some JavaScript");",
|
|
484
|
-
],
|
|
485
|
-
],
|
|
486
|
-
"story": {
|
|
487
|
-
"id": "example.squiffy",
|
|
488
|
-
"sections": {
|
|
489
|
-
"Introduction": {
|
|
490
|
-
"passages": {
|
|
491
|
-
"it's a passage with an apostrophe": {
|
|
492
|
-
"text": "<p>Nothing to worry about.</p>",
|
|
493
|
-
},
|
|
494
|
-
"link": {
|
|
495
|
-
"text": "<p>Here is the text for the simple link.</p>",
|
|
496
|
-
},
|
|
497
|
-
"passage": {
|
|
498
|
-
"text": "<p>Here's some text for the passage.</p>",
|
|
499
|
-
},
|
|
500
|
-
"passage 3": {
|
|
501
|
-
"text": "<p>Another passage.</p>",
|
|
502
|
-
},
|
|
503
|
-
"passage four": {
|
|
504
|
-
"text": "<p>Yet another passage.</p>",
|
|
505
|
-
},
|
|
506
|
-
"passage2": {
|
|
507
|
-
"jsIndex": 0,
|
|
508
|
-
"text": "<p>This is the text for the second passage.</p>",
|
|
509
|
-
},
|
|
510
|
-
},
|
|
511
|
-
"text": "<h1>Squiffy Test</h1>
|
|
512
|
-
<p>This is <a href="http://textadventures.co.uk">a website link</a>.</p>
|
|
513
|
-
<p>This should be <a class="squiffy-link link-passage" data-passage="passage" role="link" tabindex="0">a link to a passage</a>. Here's <a class="squiffy-link link-passage" data-passage="passage2" role="link" tabindex="0">another one</a>.</p>
|
|
514
|
-
<p>You don't need to specify a name - for example, this <a class="squiffy-link link-passage" data-passage="link" role="link" tabindex="0">link</a> and this <a class="squiffy-link link-section" data-section="section" role="link" tabindex="0">section</a>.</p>
|
|
515
|
-
<p>And this goes to the <a class="squiffy-link link-section" data-section="section2" role="link" tabindex="0">next section</a>.</p>
|
|
516
|
-
<p>This line has links to <a class="squiffy-link link-section" data-section="section 3" role="link" tabindex="0">section 3</a> and <a class="squiffy-link link-section" data-section="section four" role="link" tabindex="0">section 4</a>.</p>
|
|
517
|
-
<p>This line has links to <a class="squiffy-link link-passage" data-passage="passage 3" role="link" tabindex="0">passage 3</a> and <a class="squiffy-link link-passage" data-passage="passage four" role="link" tabindex="0">passage 4</a>.</p>
|
|
518
|
-
<p>Oh look - <a class="squiffy-link link-passage" data-passage="it's a passage with an apostrophe" role="link" tabindex="0">it's a passage with an apostrophe</a>.</p>",
|
|
519
|
-
},
|
|
520
|
-
"section": {
|
|
521
|
-
"text": "<p>This is another section.</p>",
|
|
522
|
-
},
|
|
523
|
-
"section 3": {
|
|
524
|
-
"text": "<p>Another section is here.</p>",
|
|
525
|
-
},
|
|
526
|
-
"section four": {
|
|
527
|
-
"text": "<p>Some other section.</p>",
|
|
528
|
-
},
|
|
529
|
-
"section2": {
|
|
530
|
-
"jsIndex": 1,
|
|
531
|
-
"text": "<p>This is the next section.</p>",
|
|
532
|
-
},
|
|
533
|
-
},
|
|
534
|
-
"start": "Introduction",
|
|
535
|
-
},
|
|
536
|
-
}
|
|
537
|
-
`;
|
|
538
|
-
|
|
539
|
-
exports[`textprocessor/textprocessor.squiffy 1`] = `
|
|
540
|
-
{
|
|
541
|
-
"js": [],
|
|
542
|
-
"story": {
|
|
543
|
-
"id": "textprocessor.squiffy",
|
|
544
|
-
"sections": {
|
|
545
|
-
"_default": {
|
|
546
|
-
"text": "<p>Choose a gender:</p>
|
|
547
|
-
<ul>
|
|
548
|
-
<li><a class="squiffy-link link-section" data-section="start, gender=male" role="link" tabindex="0">Male</a></li>
|
|
549
|
-
<li><a class="squiffy-link link-section" data-section="start, gender=female" role="link" tabindex="0">Female</a></li>
|
|
550
|
-
</ul>",
|
|
551
|
-
},
|
|
552
|
-
"section": {
|
|
553
|
-
"text": "<p>Text from section.</p>",
|
|
554
|
-
},
|
|
555
|
-
"start": {
|
|
556
|
-
"passages": {
|
|
557
|
-
"Next": {
|
|
558
|
-
"text": "<p>This is a test. {passage} {section}</p>",
|
|
559
|
-
},
|
|
560
|
-
"passage": {
|
|
561
|
-
"text": "<p>Text from passage.</p>",
|
|
562
|
-
},
|
|
563
|
-
},
|
|
564
|
-
"text": "<p>You chose {gender}.</p>
|
|
565
|
-
<p>{if gender=male:You are a man.}
|
|
566
|
-
{else:You are a woman.}</p>
|
|
567
|
-
<p><a class="squiffy-link link-passage" data-passage="Next" role="link" tabindex="0">Next</a></p>",
|
|
568
|
-
},
|
|
569
|
-
},
|
|
570
|
-
"start": "_default",
|
|
571
|
-
},
|
|
572
|
-
}
|
|
573
|
-
`;
|
|
574
|
-
|
|
575
|
-
exports[`transitions/transitions.squiffy 1`] = `
|
|
576
|
-
{
|
|
577
|
-
"js": [
|
|
578
|
-
[
|
|
579
|
-
"squiffy.ui.transition(function(){",
|
|
580
|
-
" // Create a blackout <div>...",
|
|
581
|
-
" $("<div/>", {",
|
|
582
|
-
" id: "blackout"",
|
|
583
|
-
" }).css({",
|
|
584
|
-
" position: "fixed",",
|
|
585
|
-
" top: 0,",
|
|
586
|
-
" left: 0,",
|
|
587
|
-
" width: "100%",",
|
|
588
|
-
" height: "100%",",
|
|
589
|
-
" background: "black",",
|
|
590
|
-
" display: "none"",
|
|
591
|
-
" }).appendTo("body");",
|
|
592
|
-
" // Fade it in over 6 seconds...",
|
|
593
|
-
" $("#blackout").fadeIn({",
|
|
594
|
-
" duration: 6000,",
|
|
595
|
-
" easing: "easeInQuad",",
|
|
596
|
-
" });",
|
|
597
|
-
" // After fading it in...",
|
|
598
|
-
" setTimeout(function () {",
|
|
599
|
-
" // Move to the next section...",
|
|
600
|
-
" squiffy.story.go("wake up");",
|
|
601
|
-
" // Fade out the blackout and remove the <div>...",
|
|
602
|
-
" $("#blackout").fadeOut({",
|
|
603
|
-
" duration: 6000,",
|
|
604
|
-
" easing: "easeInQuad",",
|
|
605
|
-
" complete: function() {",
|
|
606
|
-
" $(this).remove();",
|
|
607
|
-
" }",
|
|
608
|
-
" });",
|
|
609
|
-
" }, 9000);",
|
|
610
|
-
"});",
|
|
611
|
-
"",
|
|
612
|
-
],
|
|
613
|
-
],
|
|
614
|
-
"story": {
|
|
615
|
-
"id": "transitions.squiffy",
|
|
616
|
-
"sections": {
|
|
617
|
-
"_default": {
|
|
618
|
-
"passages": {
|
|
619
|
-
"hammer": {
|
|
620
|
-
"text": "<p>It's nice and weighty. Perhaps you want to <a class="squiffy-link link-section" data-section="hit" role="link" tabindex="0">hit yourself in the face with it</a>?</p>",
|
|
621
|
-
},
|
|
622
|
-
},
|
|
623
|
-
"text": "<p>You are standing in a room. You can see a <a class="squiffy-link link-passage" data-passage="hammer" role="link" tabindex="0">hammer</a>.</p>",
|
|
624
|
-
},
|
|
625
|
-
"hit": {
|
|
626
|
-
"jsIndex": 0,
|
|
627
|
-
"text": "<p>Bang.</p>",
|
|
628
|
-
},
|
|
629
|
-
"wake up": {
|
|
630
|
-
"clear": true,
|
|
631
|
-
"text": "<p>Slowly your eyes open.</p>
|
|
632
|
-
<p>That was a rather stupid thing to do.</p>",
|
|
633
|
-
},
|
|
634
|
-
},
|
|
635
|
-
"start": "_default",
|
|
636
|
-
},
|
|
637
|
-
}
|
|
638
|
-
`;
|
|
639
|
-
|
|
640
|
-
exports[`turncount/turncount.squiffy 1`] = `
|
|
641
|
-
{
|
|
642
|
-
"js": [
|
|
643
|
-
[
|
|
644
|
-
"squiffy.story.go("final section");",
|
|
645
|
-
],
|
|
646
|
-
],
|
|
647
|
-
"story": {
|
|
648
|
-
"id": "turncount.squiffy",
|
|
649
|
-
"sections": {
|
|
650
|
-
"_default": {
|
|
651
|
-
"passages": {
|
|
652
|
-
"@2": {
|
|
653
|
-
"text": "<p>This is some extra text to appear after the second click. The <a class="squiffy-link link-section" data-section="next section" role="link" tabindex="0">next section</a> is also good.</p>",
|
|
654
|
-
},
|
|
655
|
-
"One": {
|
|
656
|
-
"text": "<p>First passage.</p>",
|
|
657
|
-
},
|
|
658
|
-
"four": {
|
|
659
|
-
"text": "<p>Fourth passage.</p>",
|
|
660
|
-
},
|
|
661
|
-
"three": {
|
|
662
|
-
"text": "<p>Third passage.</p>",
|
|
663
|
-
},
|
|
664
|
-
"two": {
|
|
665
|
-
"text": "<p>Second passage.</p>",
|
|
666
|
-
},
|
|
667
|
-
},
|
|
668
|
-
"text": "<p>After clicking two links in this section, an additional passage will be displayed.</p>
|
|
669
|
-
<p><a class="squiffy-link link-passage" data-passage="One" role="link" tabindex="0">One</a>, <a class="squiffy-link link-passage" data-passage="two" role="link" tabindex="0">two</a>, <a class="squiffy-link link-passage" data-passage="three" role="link" tabindex="0">three</a>, <a class="squiffy-link link-passage" data-passage="four" role="link" tabindex="0">four</a>.</p>",
|
|
670
|
-
},
|
|
671
|
-
"final section": {
|
|
672
|
-
"text": "<p><strong>THE END</strong></p>",
|
|
673
|
-
},
|
|
674
|
-
"next section": {
|
|
675
|
-
"passages": {
|
|
676
|
-
"@1": {
|
|
677
|
-
"jsIndex": 0,
|
|
678
|
-
"text": "",
|
|
679
|
-
},
|
|
680
|
-
"One": {
|
|
681
|
-
"text": "<p>First passage.</p>",
|
|
682
|
-
},
|
|
683
|
-
"four": {
|
|
684
|
-
"text": "<p>Fourth passage.</p>",
|
|
685
|
-
},
|
|
686
|
-
"three": {
|
|
687
|
-
"text": "<p>Third passage.</p>",
|
|
688
|
-
},
|
|
689
|
-
"two": {
|
|
690
|
-
"text": "<p>Second passage.</p>",
|
|
691
|
-
},
|
|
692
|
-
},
|
|
693
|
-
"text": "<p>In this section, you can only click one link, and then you'll be taken to the final section.</p>
|
|
694
|
-
<p><a class="squiffy-link link-passage" data-passage="One" role="link" tabindex="0">One</a>, <a class="squiffy-link link-passage" data-passage="two" role="link" tabindex="0">two</a>, <a class="squiffy-link link-passage" data-passage="three" role="link" tabindex="0">three</a>, <a class="squiffy-link link-passage" data-passage="four" role="link" tabindex="0">four</a>.</p>",
|
|
695
|
-
},
|
|
696
|
-
},
|
|
697
|
-
"start": "_default",
|
|
698
|
-
},
|
|
699
|
-
}
|
|
700
|
-
`;
|
|
701
|
-
|
|
702
|
-
exports[`warnings/warnings.squiffy 1`] = `
|
|
703
|
-
[
|
|
704
|
-
"WARNING: warnings.squiffy line 1: In section '_default' there is a link to a section called [[badsection2]], which doesn't exist",
|
|
705
|
-
"WARNING: warnings.squiffy line 1: In section '_default' there is a link to a section called [[badsection]], which doesn't exist",
|
|
706
|
-
"WARNING: warnings.squiffy line 9: In section 'section' there is a link to a passage called [badpassage2], which doesn't exist",
|
|
707
|
-
"WARNING: warnings.squiffy line 9: In section 'section' there is a link to a passage called [badpassage], which doesn't exist",
|
|
708
|
-
"WARNING: warnings.squiffy line 19: In section 'section', passage 'passage' there is a link to a passage called [non-existent passage], which doesn't exist",
|
|
709
|
-
]
|
|
710
|
-
`;
|
|
711
|
-
|
|
712
|
-
exports[`warnings/warnings2.squiffy 1`] = `
|
|
713
|
-
[
|
|
714
|
-
"WARNING: warnings2.squiffy line 1: In section 'test' there is a link to a passage called [doesn't exist], which doesn't exist",
|
|
715
|
-
]
|
|
716
|
-
`;
|