r54289 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r54288‎ | r54289 | r54290 >
Date:16:56, 3 August 2009
Author:tparscal
Status:deferred
Tags:
Comment:
Fixed bug that caused double escaping of cells in tables of booklet pages.
Modified paths:
  • /trunk/extensions/UsabilityInitiative/js/jquery.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/jquery.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/jquery.wikiEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/js/jquery.combined.js
@@ -5144,13 +5144,11 @@
51455145 ) {
51465146 var $headings = $( '<tr></tr>' ).appendTo( $table );
51475147 for ( heading in pages[page].headings ) {
 5148+ var content = msg(
 5149+ pages[page].headings[heading], 'content'
 5150+ );
51485151 $( '<th></th>' )
5149 - .text(
5150 - msg(
5151 - pages[page].headings[heading],
5152 - 'content'
5153 - )
5154 - )
 5152+ .text( content )
51555153 .appendTo( $headings );
51565154 }
51575155 }
@@ -5161,18 +5159,14 @@
51625160 for ( row in pages[page].rows ) {
51635161 var $row = $( '<tr></tr>' ).appendTo( $table );
51645162 for ( cell in pages[page].rows[row] ) {
 5163+ var content = msg(
 5164+ pages[page].rows[row][cell], 'content'
 5165+ );
51655166 $( '<td></td>' )
51665167 .addClass( cell )
51675168 .attr( 'valign', 'top' )
51685169 .append(
5169 - $( '<span></span>' )
5170 - .text(
5171 - msg(
5172 - pages[page]
5173 - .rows[row][cell],
5174 - 'content'
5175 - )
5176 - )
 5170+ $( '<span></span>' ).html( content )
51775171 )
51785172 .appendTo( $row );
51795173 }
Index: trunk/extensions/UsabilityInitiative/js/jquery.combined.min.js
@@ -484,8 +484,8 @@
485485 function addPages($index,$pages,pages,sectionId){var selected=$.cookie(sectionId);if(!(selected in pages)){selected=null;}
486486 for(page in pages){if(!('layout'in pages[page])){continue;}
487487 if(selected==null){selected=page;}
488 -$index.append($('<div></div>').attr('class',page===selected?'current':null).text(msg(pages[page],'label')).data('page',page).data('sectionId',sectionId).click(function(){$(this).parent().parent().find('.page').hide().end().parent().find('div').removeClass('current').end().parent().parent().find('.page-'+$(this).data('page')).show();$(this).addClass('current');$.cookie($(this).data('sectionId'),$(this).data('page'));}));var $page=$('<div></div>').addClass('page').addClass('page-'+page).css('display',page==selected?'block':'none').appendTo($pages);switch(pages[page].layout){case'table':var $table=$('<table></table>').attr({'cellpadding':'0','cellspacing':'0','border':'0','width':'100%'}).appendTo($page);if('headings'in pages[page]&&typeof pages[page].headings=='object'){var $headings=$('<tr></tr>').appendTo($table);for(heading in pages[page].headings){$('<th></th>').text(msg(pages[page].headings[heading],'content')).appendTo($headings);}}
489 -if('rows'in pages[page]&&typeof pages[page].rows=='object'){for(row in pages[page].rows){var $row=$('<tr></tr>').appendTo($table);for(cell in pages[page].rows[row]){$('<td></td>').addClass(cell).attr('valign','top').append($('<span></span>').text(msg(pages[page].rows[row][cell],'content'))).appendTo($row);}}}
 488+$index.append($('<div></div>').attr('class',page===selected?'current':null).text(msg(pages[page],'label')).data('page',page).data('sectionId',sectionId).click(function(){$(this).parent().parent().find('.page').hide().end().parent().find('div').removeClass('current').end().parent().parent().find('.page-'+$(this).data('page')).show();$(this).addClass('current');$.cookie($(this).data('sectionId'),$(this).data('page'));}));var $page=$('<div></div>').addClass('page').addClass('page-'+page).css('display',page==selected?'block':'none').appendTo($pages);switch(pages[page].layout){case'table':var $table=$('<table></table>').attr({'cellpadding':'0','cellspacing':'0','border':'0','width':'100%'}).appendTo($page);if('headings'in pages[page]&&typeof pages[page].headings=='object'){var $headings=$('<tr></tr>').appendTo($table);for(heading in pages[page].headings){var content=msg(pages[page].headings[heading],'content');$('<th></th>').text(content).appendTo($headings);}}
 489+if('rows'in pages[page]&&typeof pages[page].rows=='object'){for(row in pages[page].rows){var $row=$('<tr></tr>').appendTo($table);for(cell in pages[page].rows[row]){var content=msg(pages[page].rows[row][cell],'content');$('<td></td>').addClass(cell).attr('valign','top').append($('<span></span>').html(content)).appendTo($row);}}}
490490 break;case'characters':var $characters=$('<div></div>').attr(pages[page].attributes).css(pages[page].styles).appendTo($page);if('characters'in pages[page]&&typeof pages[page].characters=='object'){for(character in pages[page].characters){var char=pages[page].characters[character];var tool={};if(typeof char=='string'){tool={'type':'link','label':char,'action':{'type':'encapsulate','options':{'pre':char}}};}else if(typeof char=='object'){tool=char;}else{continue;}
491491 if(!('label'in tool)){continue;}
492492 $characters.append($('<a></a>').attr('href','#').text(tool.label).data('tool',tool).click(useTool));}}
Index: trunk/extensions/UsabilityInitiative/js/jquery.wikiEditor.js
@@ -250,13 +250,11 @@
251251 ) {
252252 var $headings = $( '<tr></tr>' ).appendTo( $table );
253253 for ( heading in pages[page].headings ) {
 254+ var content = msg(
 255+ pages[page].headings[heading], 'content'
 256+ );
254257 $( '<th></th>' )
255 - .text(
256 - msg(
257 - pages[page].headings[heading],
258 - 'content'
259 - )
260 - )
 258+ .text( content )
261259 .appendTo( $headings );
262260 }
263261 }
@@ -267,18 +265,14 @@
268266 for ( row in pages[page].rows ) {
269267 var $row = $( '<tr></tr>' ).appendTo( $table );
270268 for ( cell in pages[page].rows[row] ) {
 269+ var content = msg(
 270+ pages[page].rows[row][cell], 'content'
 271+ );
271272 $( '<td></td>' )
272273 .addClass( cell )
273274 .attr( 'valign', 'top' )
274275 .append(
275 - $( '<span></span>' )
276 - .text(
277 - msg(
278 - pages[page]
279 - .rows[row][cell],
280 - 'content'
281 - )
282 - )
 276+ $( '<span></span>' ).html( content )
283277 )
284278 .appendTo( $row );
285279 }

Status & tagging log