Index: trunk/parsers/wikidom/demos/synth/es.js |
— | — | @@ -1,8 +1,10 @@ |
2 | 2 | $(document).ready( function() { |
3 | | - var doc = es.DocumentModel.newFromPlainObject( { 'blocks': [ |
| 3 | + var doc = es.DocumentModel.newFromPlainObject( { |
| 4 | + 'type': 'document', |
| 5 | + 'children': [ |
4 | 6 | { |
5 | 7 | 'type': 'heading', |
6 | | - 'level': 1, |
| 8 | + 'attributes': { 'level': 1 }, |
7 | 9 | 'content': { |
8 | 10 | 'text': 'This is a heading (level 1)', |
9 | 11 | 'annotations': [ |
— | — | @@ -19,7 +21,7 @@ |
20 | 22 | }, |
21 | 23 | { |
22 | 24 | 'type': 'heading', |
23 | | - 'level': 2, |
| 25 | + 'attributes': { 'level': 2 }, |
24 | 26 | 'content': { |
25 | 27 | 'text': 'This is a heading (level 2)', |
26 | 28 | 'annotations': [ |
— | — | @@ -36,7 +38,7 @@ |
37 | 39 | }, |
38 | 40 | { |
39 | 41 | 'type': 'heading', |
40 | | - 'level': 3, |
| 42 | + 'attributes': { 'level': 3 }, |
41 | 43 | 'content': { |
42 | 44 | 'text': 'This is a heading (level 3)', |
43 | 45 | 'annotations': [ |
— | — | @@ -53,7 +55,7 @@ |
54 | 56 | }, |
55 | 57 | { |
56 | 58 | 'type': 'heading', |
57 | | - 'level': 4, |
| 59 | + 'attributes': { 'level': 4 }, |
58 | 60 | 'content': { |
59 | 61 | 'text': 'This is a heading (level 4)', |
60 | 62 | 'annotations': [ |
— | — | @@ -70,7 +72,7 @@ |
71 | 73 | }, |
72 | 74 | { |
73 | 75 | 'type': 'heading', |
74 | | - 'level': 5, |
| 76 | + 'attributes': { 'level': 5 }, |
75 | 77 | 'content': { |
76 | 78 | 'text': 'This is a heading (level 5)', |
77 | 79 | 'annotations': [ |
— | — | @@ -87,7 +89,7 @@ |
88 | 90 | }, |
89 | 91 | { |
90 | 92 | 'type': 'heading', |
91 | | - 'level': 6, |
| 93 | + 'attributes': { 'level': 6 }, |
92 | 94 | 'content': { |
93 | 95 | 'text': 'This is a heading (level 6)', |
94 | 96 | 'annotations': [ |
— | — | @@ -142,13 +144,15 @@ |
143 | 145 | }, |
144 | 146 | { |
145 | 147 | 'type': 'table', |
146 | | - 'attributes': { 'style': 'width: 600px; border: solid 1px;' }, |
147 | | - 'rows': [ |
| 148 | + 'attributes': { 'html/style': 'width: 600px; border: solid 1px;' }, |
| 149 | + 'children': [ |
148 | 150 | { |
149 | | - 'cells': [ |
| 151 | + 'type': 'tableRow', |
| 152 | + 'children': [ |
150 | 153 | { |
151 | | - 'attributes': { 'style': 'border: solid 1px;' }, |
152 | | - 'blocks': [ |
| 154 | + 'type': 'tableCell', |
| 155 | + 'attributes': { 'html/style': 'border: solid 1px;' }, |
| 156 | + 'children': [ |
153 | 157 | { |
154 | 158 | 'type': 'paragraph', |
155 | 159 | 'content': { 'text': 'row 1 & cell 1' } |
— | — | @@ -156,8 +160,9 @@ |
157 | 161 | ] |
158 | 162 | }, |
159 | 163 | { |
160 | | - 'attributes': { 'style': 'border: solid 1px;' }, |
161 | | - 'blocks': [ |
| 164 | + 'type': 'tableCell', |
| 165 | + 'attributes': { 'html/style': 'border: solid 1px;' }, |
| 166 | + 'children': [ |
162 | 167 | { |
163 | 168 | 'type': 'paragraph', |
164 | 169 | 'content': { 'text': 'row 1 & cell 2' } |
— | — | @@ -167,10 +172,12 @@ |
168 | 173 | ] |
169 | 174 | }, |
170 | 175 | { |
171 | | - 'cells': [ |
| 176 | + 'type': 'tableRow', |
| 177 | + 'children': [ |
172 | 178 | { |
173 | | - 'attributes': { 'style': 'border: solid 1px;' }, |
174 | | - 'blocks': [ |
| 179 | + 'type': 'tableCell', |
| 180 | + 'attributes': { 'html/style': 'border: solid 1px;' }, |
| 181 | + 'children': [ |
175 | 182 | { |
176 | 183 | 'type': 'paragraph', |
177 | 184 | 'content': { 'text': 'row 2 & cell 1' } |
— | — | @@ -178,21 +185,24 @@ |
179 | 186 | ] |
180 | 187 | }, |
181 | 188 | { |
182 | | - 'attributes': { 'style': 'border: solid 1px;' }, |
183 | | - 'blocks': [ |
| 189 | + 'type': 'tableCell', |
| 190 | + 'attributes': { 'html/style': 'border: solid 1px;' }, |
| 191 | + 'children': [ |
184 | 192 | { |
185 | 193 | 'type': 'paragraph', |
186 | 194 | 'content': { 'text': 'row 2 & cell 2' } |
187 | 195 | }, |
188 | 196 | { |
189 | 197 | 'type': 'table', |
190 | | - 'attributes': { 'style': 'width: 150px; border: solid 1px;' }, |
191 | | - 'rows': [ |
| 198 | + 'attributes': { 'html/style': 'width: 150px; border: solid 1px;' }, |
| 199 | + 'children': [ |
192 | 200 | { |
193 | | - 'cells': [ |
| 201 | + 'type': 'tableRow', |
| 202 | + 'children': [ |
194 | 203 | { |
195 | | - 'attributes': { 'style': 'border: solid 1px;' }, |
196 | | - 'blocks': [ |
| 204 | + 'type': 'tableCell', |
| 205 | + 'attributes': { 'html/style': 'border: solid 1px;' }, |
| 206 | + 'children': [ |
197 | 207 | { |
198 | 208 | 'type': 'paragraph', |
199 | 209 | 'content': { 'text': '#1 #1 #1' } |
— | — | @@ -200,8 +210,9 @@ |
201 | 211 | ] |
202 | 212 | }, |
203 | 213 | { |
204 | | - 'attributes': { 'style': 'border: solid 1px;' }, |
205 | | - 'blocks': [ |
| 214 | + 'type': 'tableCell', |
| 215 | + 'attributes': { 'html/style': 'border: solid 1px;' }, |
| 216 | + 'children': [ |
206 | 217 | { |
207 | 218 | 'type': 'paragraph', |
208 | 219 | 'content': { 'text': '#2 #2 #2' } |
— | — | @@ -211,10 +222,12 @@ |
212 | 223 | ] |
213 | 224 | }, |
214 | 225 | { |
215 | | - 'cells': [ |
| 226 | + 'type': 'tableRow', |
| 227 | + 'children': [ |
216 | 228 | { |
217 | | - 'attributes': { 'style': 'border: solid 1px;' }, |
218 | | - 'blocks': [ |
| 229 | + 'type': 'tableCell', |
| 230 | + 'attributes': { 'html/style': 'border: solid 1px;' }, |
| 231 | + 'children': [ |
219 | 232 | { |
220 | 233 | 'type': 'paragraph', |
221 | 234 | 'content': { 'text': '#3 #3 #3' } |
— | — | @@ -222,8 +235,9 @@ |
223 | 236 | ] |
224 | 237 | }, |
225 | 238 | { |
226 | | - 'attributes': { 'style': 'border: solid 1px;' }, |
227 | | - 'blocks': [ |
| 239 | + 'type': 'tableCell', |
| 240 | + 'attributes': { 'html/style': 'border: solid 1px;' }, |
| 241 | + 'children': [ |
228 | 242 | { |
229 | 243 | 'type': 'paragraph', |
230 | 244 | 'content': { 'text': '#4 #4 #4' } |
— | — | @@ -236,11 +250,12 @@ |
237 | 251 | }, |
238 | 252 | { |
239 | 253 | 'type': 'list', |
240 | | - 'style': 'number', |
241 | | - 'items': [ |
| 254 | + 'attributes': { 'style': 'number' }, |
| 255 | + 'children': [ |
242 | 256 | { |
| 257 | + 'type': 'listItem', |
243 | 258 | 'content': { 'text': 'First item' }, |
244 | | - 'lists': [ |
| 259 | + 'children': [ // FIXME?!? |
245 | 260 | { |
246 | 261 | 'style': 'bullet', |
247 | 262 | 'items': [ |
— | — | @@ -251,6 +266,7 @@ |
252 | 267 | ] |
253 | 268 | }, |
254 | 269 | { |
| 270 | + 'type': 'listItem', |
255 | 271 | 'content': { |
256 | 272 | 'text': 'Second item', |
257 | 273 | 'annotations': [ |
— | — | @@ -265,6 +281,7 @@ |
266 | 282 | } |
267 | 283 | }, |
268 | 284 | { |
| 285 | + 'type': 'listItem', |
269 | 286 | 'content': { |
270 | 287 | 'text': 'Third item', |
271 | 288 | 'annotations': [ |
— | — | @@ -279,6 +296,7 @@ |
280 | 297 | } |
281 | 298 | }, |
282 | 299 | { |
| 300 | + 'type': 'listItem', |
283 | 301 | 'content': { |
284 | 302 | 'text': 'Fourth item', |
285 | 303 | 'annotations': [ |
— | — | @@ -294,7 +312,7 @@ |
295 | 313 | } |
296 | 314 | } |
297 | 315 | ] |
298 | | - } |
| 316 | + } |
299 | 317 | ] |
300 | 318 | } |
301 | 319 | ] |
— | — | @@ -303,27 +321,31 @@ |
304 | 322 | }, |
305 | 323 | { |
306 | 324 | 'type': 'list', |
307 | | - 'style': 'number', |
308 | | - 'items': [ |
| 325 | + 'attributes': { 'style': 'number' }, |
| 326 | + 'children': [ |
309 | 327 | { |
| 328 | + 'type': 'listItem'. |
310 | 329 | 'content': { 'text': 'Operating Systems' }, |
311 | | - 'lists': [ |
| 330 | + 'children': [ // FIXME?!? |
312 | 331 | { |
313 | | - 'style': 'bullet', |
314 | | - 'items': [ |
| 332 | + 'attributes': { 'style': 'bullet' }, |
| 333 | + 'children': [ |
315 | 334 | { |
| 335 | + 'type': 'listItem', |
316 | 336 | 'content': { 'text': 'Linux' }, |
317 | | - 'lists': [ |
| 337 | + 'children': [ // FIXME?!? |
318 | 338 | { |
319 | | - 'style': 'bullet', |
320 | | - 'items': [ |
| 339 | + 'attributes': { 'style': 'bullet' }, |
| 340 | + 'children': [ |
321 | 341 | { |
| 342 | + 'type': 'listItem', |
322 | 343 | 'content': { 'text': 'Ubuntu' }, |
323 | | - 'lists': [ |
| 344 | + 'children': [ //FIXME?!? |
324 | 345 | { |
325 | | - 'style': 'bullet', |
326 | | - 'items': [ |
| 346 | + 'attributes': { 'style': 'bullet' }, |
| 347 | + 'children': [ |
327 | 348 | { |
| 349 | + 'type': 'listItem', |
328 | 350 | 'content': { |
329 | 351 | 'text': 'Desktop: Intuitive office apps, safe and fast web browsing, and seamless integration. Ubuntu brings the very best technologies straight to the desktop.', |
330 | 352 | 'annotations': [ |
— | — | @@ -338,25 +360,26 @@ |
339 | 361 | ] |
340 | 362 | } |
341 | 363 | }, |
342 | | - { 'content': { 'text': 'Server: Secure, fast and powerful, Ubuntu Server is transforming IT environments worldwide. Realise the full potential of your infrastructure with a reliable, easy-to-integrate technology platform. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. ' } }, |
343 | | - { 'content': { 'text': 'Cloud: Ubuntu cloud computing puts you in control of your IT infrastructure. It helps you access computing power as and when you need it so you can meet user demand more effectively.' } } |
| 364 | + { 'type': 'listItem', 'content': { 'text': 'Server: Secure, fast and powerful, Ubuntu Server is transforming IT environments worldwide. Realise the full potential of your infrastructure with a reliable, easy-to-integrate technology platform. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. Lorem ipsum.. ' } }, |
| 365 | + { 'type': 'listItem', 'content': { 'text': 'Cloud: Ubuntu cloud computing puts you in control of your IT infrastructure. It helps you access computing power as and when you need it so you can meet user demand more effectively.' } } |
344 | 366 | ] |
345 | 367 | } |
346 | 368 | ] |
347 | 369 | }, |
348 | | - { 'content': { 'text': 'Fedora' } }, |
349 | | - { 'content': { 'text': 'Gentoo' } } |
| 370 | + { 'type': 'listItem', 'content': { 'text': 'Fedora' } }, |
| 371 | + { 'type': 'listItem', 'content': { 'text': 'Gentoo' } } |
350 | 372 | ] |
351 | 373 | } |
352 | 374 | ] |
353 | 375 | }, |
354 | | - { 'content': { 'text': 'Windows' } }, |
355 | | - { 'content': { 'text': 'Mac' } } |
| 376 | + { 'type': 'listItem', 'content': { 'text': 'Windows' } }, |
| 377 | + { 'type': 'listItem', 'content': { 'text': 'Mac' } } |
356 | 378 | ] |
357 | 379 | } |
358 | 380 | ] |
359 | 381 | }, |
360 | 382 | { |
| 383 | + 'type': 'listItem', |
361 | 384 | 'content': { |
362 | 385 | 'text': 'Second item', |
363 | 386 | 'annotations': [ |
— | — | @@ -371,6 +394,7 @@ |
372 | 395 | } |
373 | 396 | }, |
374 | 397 | { |
| 398 | + 'type': 'listItem', |
375 | 399 | 'content': { |
376 | 400 | 'text': 'Third item', |
377 | 401 | 'annotations': [ |
— | — | @@ -385,6 +409,7 @@ |
386 | 410 | } |
387 | 411 | }, |
388 | 412 | { |
| 413 | + 'type': 'listItem', |
389 | 414 | 'content': { |
390 | 415 | 'text': 'Fourth item', |
391 | 416 | 'annotations': [ |