Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php |
— | — | @@ -16,14 +16,14 @@ |
17 | 17 | array( 'src' => 'Modules/Preview/Preview.js', 'version' => 6 ), |
18 | 18 | array( 'src' => 'Modules/Publish/Publish.js', 'version' => 6 ), |
19 | 19 | 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 ), |
21 | 21 | array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ), |
22 | 22 | ), |
23 | 23 | 'combined' => array( |
24 | | - array( 'src' => 'WikiEditor.combined.js', 'version' => 58 ), |
| 24 | + array( 'src' => 'WikiEditor.combined.js', 'version' => 59 ), |
25 | 25 | ), |
26 | 26 | 'minified' => array( |
27 | | - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 58 ), |
| 27 | + array( 'src' => 'WikiEditor.combined.min.js', 'version' => 59 ), |
28 | 28 | ), |
29 | 29 | ); |
30 | 30 | static $messages = array( |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js |
— | — | @@ -1544,7 +1544,8 @@ |
1545 | 1545 | var colsVal = $j( '#wikieditor-toolbar-table-dimensions-columns' ).val(); |
1546 | 1546 | var rows = parseInt( rowsVal, 10 ); |
1547 | 1547 | 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; |
1549 | 1550 | var u = mw.usability; |
1550 | 1551 | if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) { |
1551 | 1552 | alert( u.getMsg( 'wikieditor-toolbar-tool-table-invalidnumber' ) ); |
— | — | @@ -1564,7 +1565,7 @@ |
1565 | 1566 | for ( var r = 0; r < rows + header; r++ ) { |
1566 | 1567 | table += "|-\n"; |
1567 | 1568 | for ( var c = 0; c < cols; c++ ) { |
1568 | | - var isHeader = ( r + 1 == header ); |
| 1569 | + var isHeader = ( header && r == 0 ); |
1569 | 1570 | var delim = isHeader ? '!' : '|'; |
1570 | 1571 | if ( c > 0 ) { |
1571 | 1572 | delim += delim; |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js |
— | — | @@ -131,10 +131,10 @@ |
132 | 132 | </div>\ |
133 | 133 | </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') |
134 | 134 | 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;} |
136 | 136 | if(rows+header==0||cols==0){alert(u.getMsg('wikieditor-toolbar-tool-table-zero'));return;} |
137 | 137 | 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;} |
139 | 139 | table+=delim+' '+(isHeader?headerText:normalText)+' ';} |
140 | 140 | table=table.substr(0,table.length-1)+"\n";} |
141 | 141 | var classes=[];if($j('#wikieditor-toolbar-table-wikitable').is(':checked')) |
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js |
— | — | @@ -1495,7 +1495,8 @@ |
1496 | 1496 | var colsVal = $j( '#wikieditor-toolbar-table-dimensions-columns' ).val(); |
1497 | 1497 | var rows = parseInt( rowsVal, 10 ); |
1498 | 1498 | 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; |
1500 | 1501 | var u = mw.usability; |
1501 | 1502 | if ( isNaN( rows ) || isNaN( cols ) || rows != rowsVal || cols != colsVal ) { |
1502 | 1503 | alert( u.getMsg( 'wikieditor-toolbar-tool-table-invalidnumber' ) ); |
— | — | @@ -1515,7 +1516,7 @@ |
1516 | 1517 | for ( var r = 0; r < rows + header; r++ ) { |
1517 | 1518 | table += "|-\n"; |
1518 | 1519 | for ( var c = 0; c < cols; c++ ) { |
1519 | | - var isHeader = ( r + 1 == header ); |
| 1520 | + var isHeader = ( header && r == 0 ); |
1520 | 1521 | var delim = isHeader ? '!' : '|'; |
1521 | 1522 | if ( c > 0 ) { |
1522 | 1523 | delim += delim; |