r98383 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98382‎ | r98383 | r98384 >
Date:23:12, 28 September 2011
Author:catrope
Status:deferred
Tags:
Comment:
Change the example to conform to the new WikiDOM structure that Trevor and I worked out on IRC
Modified paths:
  • /trunk/parsers/wikidom/demos/synth/es.js (modified) (history)

Diff [purge]

Index: trunk/parsers/wikidom/demos/synth/es.js
@@ -1,8 +1,10 @@
22 $(document).ready( function() {
3 - var doc = es.DocumentModel.newFromPlainObject( { 'blocks': [
 3+ var doc = es.DocumentModel.newFromPlainObject( {
 4+ 'type': 'document',
 5+ 'children': [
46 {
57 'type': 'heading',
6 - 'level': 1,
 8+ 'attributes': { 'level': 1 },
79 'content': {
810 'text': 'This is a heading (level 1)',
911 'annotations': [
@@ -19,7 +21,7 @@
2022 },
2123 {
2224 'type': 'heading',
23 - 'level': 2,
 25+ 'attributes': { 'level': 2 },
2426 'content': {
2527 'text': 'This is a heading (level 2)',
2628 'annotations': [
@@ -36,7 +38,7 @@
3739 },
3840 {
3941 'type': 'heading',
40 - 'level': 3,
 42+ 'attributes': { 'level': 3 },
4143 'content': {
4244 'text': 'This is a heading (level 3)',
4345 'annotations': [
@@ -53,7 +55,7 @@
5456 },
5557 {
5658 'type': 'heading',
57 - 'level': 4,
 59+ 'attributes': { 'level': 4 },
5860 'content': {
5961 'text': 'This is a heading (level 4)',
6062 'annotations': [
@@ -70,7 +72,7 @@
7173 },
7274 {
7375 'type': 'heading',
74 - 'level': 5,
 76+ 'attributes': { 'level': 5 },
7577 'content': {
7678 'text': 'This is a heading (level 5)',
7779 'annotations': [
@@ -87,7 +89,7 @@
8890 },
8991 {
9092 'type': 'heading',
91 - 'level': 6,
 93+ 'attributes': { 'level': 6 },
9294 'content': {
9395 'text': 'This is a heading (level 6)',
9496 'annotations': [
@@ -142,13 +144,15 @@
143145 },
144146 {
145147 'type': 'table',
146 - 'attributes': { 'style': 'width: 600px; border: solid 1px;' },
147 - 'rows': [
 148+ 'attributes': { 'html/style': 'width: 600px; border: solid 1px;' },
 149+ 'children': [
148150 {
149 - 'cells': [
 151+ 'type': 'tableRow',
 152+ 'children': [
150153 {
151 - 'attributes': { 'style': 'border: solid 1px;' },
152 - 'blocks': [
 154+ 'type': 'tableCell',
 155+ 'attributes': { 'html/style': 'border: solid 1px;' },
 156+ 'children': [
153157 {
154158 'type': 'paragraph',
155159 'content': { 'text': 'row 1 & cell 1' }
@@ -156,8 +160,9 @@
157161 ]
158162 },
159163 {
160 - 'attributes': { 'style': 'border: solid 1px;' },
161 - 'blocks': [
 164+ 'type': 'tableCell',
 165+ 'attributes': { 'html/style': 'border: solid 1px;' },
 166+ 'children': [
162167 {
163168 'type': 'paragraph',
164169 'content': { 'text': 'row 1 & cell 2' }
@@ -167,10 +172,12 @@
168173 ]
169174 },
170175 {
171 - 'cells': [
 176+ 'type': 'tableRow',
 177+ 'children': [
172178 {
173 - 'attributes': { 'style': 'border: solid 1px;' },
174 - 'blocks': [
 179+ 'type': 'tableCell',
 180+ 'attributes': { 'html/style': 'border: solid 1px;' },
 181+ 'children': [
175182 {
176183 'type': 'paragraph',
177184 'content': { 'text': 'row 2 & cell 1' }
@@ -178,21 +185,24 @@
179186 ]
180187 },
181188 {
182 - 'attributes': { 'style': 'border: solid 1px;' },
183 - 'blocks': [
 189+ 'type': 'tableCell',
 190+ 'attributes': { 'html/style': 'border: solid 1px;' },
 191+ 'children': [
184192 {
185193 'type': 'paragraph',
186194 'content': { 'text': 'row 2 & cell 2' }
187195 },
188196 {
189197 'type': 'table',
190 - 'attributes': { 'style': 'width: 150px; border: solid 1px;' },
191 - 'rows': [
 198+ 'attributes': { 'html/style': 'width: 150px; border: solid 1px;' },
 199+ 'children': [
192200 {
193 - 'cells': [
 201+ 'type': 'tableRow',
 202+ 'children': [
194203 {
195 - 'attributes': { 'style': 'border: solid 1px;' },
196 - 'blocks': [
 204+ 'type': 'tableCell',
 205+ 'attributes': { 'html/style': 'border: solid 1px;' },
 206+ 'children': [
197207 {
198208 'type': 'paragraph',
199209 'content': { 'text': '#1 #1 #1' }
@@ -200,8 +210,9 @@
201211 ]
202212 },
203213 {
204 - 'attributes': { 'style': 'border: solid 1px;' },
205 - 'blocks': [
 214+ 'type': 'tableCell',
 215+ 'attributes': { 'html/style': 'border: solid 1px;' },
 216+ 'children': [
206217 {
207218 'type': 'paragraph',
208219 'content': { 'text': '#2 #2 #2' }
@@ -211,10 +222,12 @@
212223 ]
213224 },
214225 {
215 - 'cells': [
 226+ 'type': 'tableRow',
 227+ 'children': [
216228 {
217 - 'attributes': { 'style': 'border: solid 1px;' },
218 - 'blocks': [
 229+ 'type': 'tableCell',
 230+ 'attributes': { 'html/style': 'border: solid 1px;' },
 231+ 'children': [
219232 {
220233 'type': 'paragraph',
221234 'content': { 'text': '#3 #3 #3' }
@@ -222,8 +235,9 @@
223236 ]
224237 },
225238 {
226 - 'attributes': { 'style': 'border: solid 1px;' },
227 - 'blocks': [
 239+ 'type': 'tableCell',
 240+ 'attributes': { 'html/style': 'border: solid 1px;' },
 241+ 'children': [
228242 {
229243 'type': 'paragraph',
230244 'content': { 'text': '#4 #4 #4' }
@@ -236,11 +250,12 @@
237251 },
238252 {
239253 'type': 'list',
240 - 'style': 'number',
241 - 'items': [
 254+ 'attributes': { 'style': 'number' },
 255+ 'children': [
242256 {
 257+ 'type': 'listItem',
243258 'content': { 'text': 'First item' },
244 - 'lists': [
 259+ 'children': [ // FIXME?!?
245260 {
246261 'style': 'bullet',
247262 'items': [
@@ -251,6 +266,7 @@
252267 ]
253268 },
254269 {
 270+ 'type': 'listItem',
255271 'content': {
256272 'text': 'Second item',
257273 'annotations': [
@@ -265,6 +281,7 @@
266282 }
267283 },
268284 {
 285+ 'type': 'listItem',
269286 'content': {
270287 'text': 'Third item',
271288 'annotations': [
@@ -279,6 +296,7 @@
280297 }
281298 },
282299 {
 300+ 'type': 'listItem',
283301 'content': {
284302 'text': 'Fourth item',
285303 'annotations': [
@@ -294,7 +312,7 @@
295313 }
296314 }
297315 ]
298 - }
 316+ }
299317 ]
300318 }
301319 ]
@@ -303,27 +321,31 @@
304322 },
305323 {
306324 'type': 'list',
307 - 'style': 'number',
308 - 'items': [
 325+ 'attributes': { 'style': 'number' },
 326+ 'children': [
309327 {
 328+ 'type': 'listItem'.
310329 'content': { 'text': 'Operating Systems' },
311 - 'lists': [
 330+ 'children': [ // FIXME?!?
312331 {
313 - 'style': 'bullet',
314 - 'items': [
 332+ 'attributes': { 'style': 'bullet' },
 333+ 'children': [
315334 {
 335+ 'type': 'listItem',
316336 'content': { 'text': 'Linux' },
317 - 'lists': [
 337+ 'children': [ // FIXME?!?
318338 {
319 - 'style': 'bullet',
320 - 'items': [
 339+ 'attributes': { 'style': 'bullet' },
 340+ 'children': [
321341 {
 342+ 'type': 'listItem',
322343 'content': { 'text': 'Ubuntu' },
323 - 'lists': [
 344+ 'children': [ //FIXME?!?
324345 {
325 - 'style': 'bullet',
326 - 'items': [
 346+ 'attributes': { 'style': 'bullet' },
 347+ 'children': [
327348 {
 349+ 'type': 'listItem',
328350 'content': {
329351 'text': 'Desktop: Intuitive office apps, safe and fast web browsing, and seamless integration. Ubuntu brings the very best technologies straight to the desktop.',
330352 'annotations': [
@@ -338,25 +360,26 @@
339361 ]
340362 }
341363 },
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.' } }
344366 ]
345367 }
346368 ]
347369 },
348 - { 'content': { 'text': 'Fedora' } },
349 - { 'content': { 'text': 'Gentoo' } }
 370+ { 'type': 'listItem', 'content': { 'text': 'Fedora' } },
 371+ { 'type': 'listItem', 'content': { 'text': 'Gentoo' } }
350372 ]
351373 }
352374 ]
353375 },
354 - { 'content': { 'text': 'Windows' } },
355 - { 'content': { 'text': 'Mac' } }
 376+ { 'type': 'listItem', 'content': { 'text': 'Windows' } },
 377+ { 'type': 'listItem', 'content': { 'text': 'Mac' } }
356378 ]
357379 }
358380 ]
359381 },
360382 {
 383+ 'type': 'listItem',
361384 'content': {
362385 'text': 'Second item',
363386 'annotations': [
@@ -371,6 +394,7 @@
372395 }
373396 },
374397 {
 398+ 'type': 'listItem',
375399 'content': {
376400 'text': 'Third item',
377401 'annotations': [
@@ -385,6 +409,7 @@
386410 }
387411 },
388412 {
 413+ 'type': 'listItem',
389414 'content': {
390415 'text': 'Fourth item',
391416 'annotations': [

Status & tagging log