r63773 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r63772‎ | r63773 | r63774 >
Date:16:10, 15 March 2010
Author:catrope
Status:deferred
Tags:
Comment:
UsabilityInitiative: (bug 22841) Opera ignores header checkbox in create table dialog. Turns out $( '#foo:checked' ) doesn't work in Opera if the checkbox is checked by default and wasn't unchecked and checked again
Modified paths:
  • /trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php
@@ -16,14 +16,14 @@
1717 array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ),
1818 array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ),
1919 array( 'src' => 'Modules/Toc/Toc.js', 'version' => 7 ),
20 - array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 54 ),
 20+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 55 ),
2121 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'WikiEditor.combined.js', 'version' => 58 ),
 24+ array( 'src' => 'WikiEditor.combined.js', 'version' => 59 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 58 ),
 27+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 59 ),
2828 ),
2929 );
3030 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1544,7 +1544,8 @@
15451545 var colsVal = $j( '#wikieditor-toolbar-table-dimensions-columns' ).val();
15461546 var rows = parseInt( rowsVal, 10 );
15471547 var cols = parseInt( colsVal, 10 );
1548 - var header = Math.min( 1, $j( '#wikieditor-toolbar-table-dimensions-header:checked' ).size() );
 1548+ var header = $j( '#wikieditor-toolbar-table-dimensions-header:checked' ).is( ':checked' ) ?
 1549+ 1 : 0;
15491550 var u = mw.usability;
15501551 if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) {
15511552 alert( u.getMsg( 'wikieditor-toolbar-tool-table-invalidnumber' ) );
@@ -1564,7 +1565,7 @@
15651566 for ( var r = 0; r < rows + header; r++ ) {
15661567 table += "|-\n";
15671568 for ( var c = 0; c < cols; c++ ) {
1568 - var isHeader = ( r + 1 == header );
 1569+ var isHeader = ( header && r == 0 );
15691570 var delim = isHeader ? '!' : '|';
15701571 if ( c > 0 ) {
15711572 delim += delim;
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -131,10 +131,10 @@
132132 </div>\
133133 </div></div>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(mw.usability.getMsg($j(this).attr('rel')));});$j('#wikieditor-toolbar-table-dimensions-rows').val(4);$j('#wikieditor-toolbar-table-dimensions-columns').val(3);$j('#wikieditor-toolbar-table-wikitable').click(function(){$j('.wikieditor-toolbar-table-preview').toggleClass('wikitable');});$j('#wikieditor-toolbar-table-preview').clone().attr('id','wikieditor-toolbar-table-preview2').addClass('sortable').insertAfter($j('#wikieditor-toolbar-table-preview')).hide();if(typeof ts_makeSortable=='function')
134134 ts_makeSortable($j('#wikieditor-toolbar-table-preview2').get(0));$j('#wikieditor-toolbar-table-sortable').click(function(){$j('#wikieditor-toolbar-table-preview').hide().attr('id','wikieditor-toolbar-table-preview3');$j('#wikieditor-toolbar-table-preview2').attr('id','wikieditor-toolbar-table-preview').show();$j('#wikieditor-toolbar-table-preview3').attr('id','wikieditor-toolbar-table-preview2');});$j('#wikieditor-toolbar-table-dimensions-header').click(function(){var headerHTML=$j('.wikieditor-toolbar-table-preview-header').html();var hiddenHTML=$j('.wikieditor-toolbar-table-preview-hidden').html();$j('.wikieditor-toolbar-table-preview-header').html(hiddenHTML);$j('.wikieditor-toolbar-table-preview-hidden').html(headerHTML);if(typeof ts_makeSortable=='function')
135 -ts_makeSortable($j('#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2').filter('.sortable').get(0));});},dialog:{resizable:false,dialogClass:'wikiEditor-toolbar-dialog',width:590,buttons:{'wikieditor-toolbar-tool-table-insert':function(){var rowsVal=$j('#wikieditor-toolbar-table-dimensions-rows').val();var colsVal=$j('#wikieditor-toolbar-table-dimensions-columns').val();var rows=parseInt(rowsVal,10);var cols=parseInt(colsVal,10);var header=Math.min(1,$j('#wikieditor-toolbar-table-dimensions-header:checked').size());var u=mw.usability;if(isNaN(rows)||isNaN(cols)||rows!=rowsVal||cols!=colsVal){alert(u.getMsg('wikieditor-toolbar-tool-table-invalidnumber'));return;}
 135+ts_makeSortable($j('#wikieditor-toolbar-table-preview, #wikieditor-toolbar-table-preview2').filter('.sortable').get(0));});},dialog:{resizable:false,dialogClass:'wikiEditor-toolbar-dialog',width:590,buttons:{'wikieditor-toolbar-tool-table-insert':function(){var rowsVal=$j('#wikieditor-toolbar-table-dimensions-rows').val();var colsVal=$j('#wikieditor-toolbar-table-dimensions-columns').val();var rows=parseInt(rowsVal,10);var cols=parseInt(colsVal,10);var header=$j('#wikieditor-toolbar-table-dimensions-header:checked').is(':checked')?1:0;var u=mw.usability;if(isNaN(rows)||isNaN(cols)||rows!=rowsVal||cols!=colsVal){alert(u.getMsg('wikieditor-toolbar-tool-table-invalidnumber'));return;}
136136 if(rows+header==0||cols==0){alert(u.getMsg('wikieditor-toolbar-tool-table-zero'));return;}
137137 if(rows*cols>1000){alert(u.getMsg('wikieditor-toolbar-tool-table-toomany',1000));return;}
138 -var headerText=u.getMsg('wikieditor-toolbar-tool-table-example-header');var normalText=u.getMsg('wikieditor-toolbar-tool-table-example');var table="";for(var r=0;r<rows+header;r++){table+="|-\n";for(var c=0;c<cols;c++){var isHeader=(r+1==header);var delim=isHeader?'!':'|';if(c>0){delim+=delim;}
 138+var headerText=u.getMsg('wikieditor-toolbar-tool-table-example-header');var normalText=u.getMsg('wikieditor-toolbar-tool-table-example');var table="";for(var r=0;r<rows+header;r++){table+="|-\n";for(var c=0;c<cols;c++){var isHeader=(header&&r==0);var delim=isHeader?'!':'|';if(c>0){delim+=delim;}
139139 table+=delim+' '+(isHeader?headerText:normalText)+' ';}
140140 table=table.substr(0,table.length-1)+"\n";}
141141 var classes=[];if($j('#wikieditor-toolbar-table-wikitable').is(':checked'))
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1495,7 +1495,8 @@
14961496 var colsVal = $j( '#wikieditor-toolbar-table-dimensions-columns' ).val();
14971497 var rows = parseInt( rowsVal, 10 );
14981498 var cols = parseInt( colsVal, 10 );
1499 - var header = Math.min( 1, $j( '#wikieditor-toolbar-table-dimensions-header:checked' ).size() );
 1499+ var header = $j( '#wikieditor-toolbar-table-dimensions-header:checked' ).is( ':checked' ) ?
 1500+ 1 : 0;
15001501 var u = mw.usability;
15011502 if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) {
15021503 alert( u.getMsg( 'wikieditor-toolbar-tool-table-invalidnumber' ) );
@@ -1515,7 +1516,7 @@
15161517 for ( var r = 0; r < rows + header; r++ ) {
15171518 table += "|-\n";
15181519 for ( var c = 0; c < cols; c++ ) {
1519 - var isHeader = ( r + 1 == header );
 1520+ var isHeader = ( header && r == 0 );
15201521 var delim = isHeader ? '!' : '|';
15211522 if ( c > 0 ) {
15221523 delim += delim;

Follow-up revisions

RevisionCommit summaryAuthorDate
r63819Insert Table Dialog: Fix for bug 22841adam16:06, 16 March 2010

Status & tagging log