Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js |
— | — | @@ -258,21 +258,20 @@ |
259 | 259 | break; |
260 | 260 | case 'specialchar': |
261 | 261 | // Appends special character adders |
262 | | - var chars = section.pages[page].chars; |
263 | | - for ( char in chars ) { |
264 | | - switch( chars[char].type ) { |
| 262 | + for ( character in section.pages[page].characters ) { |
| 263 | + switch( section.pages[page].characters[character].type ) { |
265 | 264 | case 'break': |
266 | 265 | pageDiv.append( $( '<br />' ) ); |
267 | 266 | break; |
268 | 267 | case 'link': |
269 | 268 | var context = { |
270 | | - 'tool' : chars[char], |
| 269 | + 'tool' : section.pages[page].characters[character], |
271 | 270 | 'textbox': textbox |
272 | 271 | }; |
273 | 272 | pageDiv.append( $( '<a />' ) |
274 | | - .attr( chars[char].attrs ) |
| 273 | + .attr( section.pages[page].characters[character].attrs ) |
275 | 274 | .attr( { 'href': '#' } ) |
276 | | - .text( chars[char].text ) |
| 275 | + .text( section.pages[page].characters[character].text ) |
277 | 276 | .data( 'context', context) |
278 | 277 | .click( action ) |
279 | 278 | .click( function() { return false; } ) |
— | — | @@ -334,7 +333,7 @@ |
335 | 334 | parseCharinsert: function( charinsert ) { |
336 | 335 | var retval = {}; |
337 | 336 | for( page in charinsert ) { |
338 | | - var chars = [], attrs = {}; |
| 337 | + var characters = [], attrs = {}; |
339 | 338 | var i = 0; |
340 | 339 | for( line in charinsert[page] ) { |
341 | 340 | if( !( charinsert[page][line] instanceof Array ) ) { |
— | — | @@ -363,14 +362,14 @@ |
364 | 363 | //tool.text = charinsert[page][line][chr]; |
365 | 364 | } |
366 | 365 | tool.text = tool.action.options.pre + tool.action.options.post; |
367 | | - chars[i++] = tool; |
| 366 | + characters[i++] = tool; |
368 | 367 | } |
369 | | - chars[i++] = { type: 'break' }; |
| 368 | + characters[i++] = { type: 'break' }; |
370 | 369 | } |
371 | 370 | retval[page] = { |
372 | 371 | label: page, |
373 | 372 | layout: 'specialchar', |
374 | | - chars: chars |
| 373 | + characters: characters |
375 | 374 | }; |
376 | 375 | } |
377 | 376 | return retval; |
— | — | @@ -495,7 +494,7 @@ |
496 | 495 | } |
497 | 496 | } |
498 | 497 | } |
499 | | - }, |
| 498 | + } |
500 | 499 | } |
501 | 500 | } |
502 | 501 | }, |
— | — | @@ -681,7 +680,7 @@ |
682 | 681 | options: { |
683 | 682 | pre: "<gallery>\n", |
684 | 683 | periMsg: 'edittoolbar-tool-insert-gallery-example', |
685 | | - post: "\n</gallery>", |
| 684 | + post: "\n</gallery>" |
686 | 685 | } |
687 | 686 | } |
688 | 687 | } |
— | — | @@ -696,7 +695,7 @@ |
697 | 696 | action: { |
698 | 697 | type: 'encapsulate', |
699 | 698 | options: { |
700 | | - pre: "<br />\n", |
| 699 | + pre: "<br />\n" |
701 | 700 | } |
702 | 701 | } |
703 | 702 | } |
— | — | @@ -704,6 +703,11 @@ |
705 | 704 | } |
706 | 705 | } |
707 | 706 | }, |
| 707 | + 'characters': { |
| 708 | + labelMsg: 'edittoolbar-section-characters', |
| 709 | + type: 'booklet', |
| 710 | + pages: {} // Set by the document.ready handler |
| 711 | + }, |
708 | 712 | 'help': { |
709 | 713 | labelMsg: 'edittoolbar-section-help', |
710 | 714 | type: 'booklet', |
— | — | @@ -881,11 +885,5 @@ |
882 | 886 | ] |
883 | 887 | } |
884 | 888 | } |
885 | | - }, |
886 | | - 'specialchars': { |
887 | | - label: 'Special characters', |
888 | | - labelMsg: 'edittoolbar-section-specialchars', |
889 | | - type: 'booklet', |
890 | | - pages: {} // Set by the document.ready handler |
891 | 889 | } |
892 | 890 | }; |
\ No newline at end of file |