r51719 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r51718‎ | r51719 | r51720 >
Date:23:11, 10 June 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Adjusted a few names to avoid conflicts and errors in javascript implementations. Tweaked some other configs.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/EditToolbar/EditToolbar.js
@@ -258,21 +258,20 @@
259259 break;
260260 case 'specialchar':
261261 // 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 ) {
265264 case 'break':
266265 pageDiv.append( $( '<br />' ) );
267266 break;
268267 case 'link':
269268 var context = {
270 - 'tool' : chars[char],
 269+ 'tool' : section.pages[page].characters[character],
271270 'textbox': textbox
272271 };
273272 pageDiv.append( $( '<a />' )
274 - .attr( chars[char].attrs )
 273+ .attr( section.pages[page].characters[character].attrs )
275274 .attr( { 'href': '#' } )
276 - .text( chars[char].text )
 275+ .text( section.pages[page].characters[character].text )
277276 .data( 'context', context)
278277 .click( action )
279278 .click( function() { return false; } )
@@ -334,7 +333,7 @@
335334 parseCharinsert: function( charinsert ) {
336335 var retval = {};
337336 for( page in charinsert ) {
338 - var chars = [], attrs = {};
 337+ var characters = [], attrs = {};
339338 var i = 0;
340339 for( line in charinsert[page] ) {
341340 if( !( charinsert[page][line] instanceof Array ) ) {
@@ -363,14 +362,14 @@
364363 //tool.text = charinsert[page][line][chr];
365364 }
366365 tool.text = tool.action.options.pre + tool.action.options.post;
367 - chars[i++] = tool;
 366+ characters[i++] = tool;
368367 }
369 - chars[i++] = { type: 'break' };
 368+ characters[i++] = { type: 'break' };
370369 }
371370 retval[page] = {
372371 label: page,
373372 layout: 'specialchar',
374 - chars: chars
 373+ characters: characters
375374 };
376375 }
377376 return retval;
@@ -495,7 +494,7 @@
496495 }
497496 }
498497 }
499 - },
 498+ }
500499 }
501500 }
502501 },
@@ -681,7 +680,7 @@
682681 options: {
683682 pre: "<gallery>\n",
684683 periMsg: 'edittoolbar-tool-insert-gallery-example',
685 - post: "\n</gallery>",
 684+ post: "\n</gallery>"
686685 }
687686 }
688687 }
@@ -696,7 +695,7 @@
697696 action: {
698697 type: 'encapsulate',
699698 options: {
700 - pre: "<br />\n",
 699+ pre: "<br />\n"
701700 }
702701 }
703702 }
@@ -704,6 +703,11 @@
705704 }
706705 }
707706 },
 707+ 'characters': {
 708+ labelMsg: 'edittoolbar-section-characters',
 709+ type: 'booklet',
 710+ pages: {} // Set by the document.ready handler
 711+ },
708712 'help': {
709713 labelMsg: 'edittoolbar-section-help',
710714 type: 'booklet',
@@ -881,11 +885,5 @@
882886 ]
883887 }
884888 }
885 - },
886 - 'specialchars': {
887 - label: 'Special characters',
888 - labelMsg: 'edittoolbar-section-specialchars',
889 - type: 'booklet',
890 - pages: {} // Set by the document.ready handler
891889 }
892890 };
\ No newline at end of file

Status & tagging log