r64461 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64460‎ | r64461 | r64462 >
Date:23:46, 31 March 2010
Author:nimishg
Status:ok
Tags:
Comment:
fixes template with param 'name' showing up before predefined names, fixes table dialog to default to 3x3 instead of 4x3
Modified paths:
  • /trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /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)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php
@@ -78,14 +78,14 @@
7979 array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 23 ),
8080 array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 98 ),
8181 array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ),
82 - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 74 ),
 82+ array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 75 ),
8383 array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 5 ),
8484 ),
8585 'combined' => array(
86 - array( 'src' => 'js/plugins.combined.js', 'version' => 373 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 374 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 373 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 374 ),
9090 ),
9191 ),
9292 );
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' => 80 ),
 20+ array( 'src' => 'Modules/Toolbar/Toolbar.js', 'version' => 81 ),
2121 array( 'src' => 'Modules/TemplateEditor/TemplateEditor.js', 'version' => 6 ),
2222 ),
2323 'combined' => array(
24 - array( 'src' => 'WikiEditor.combined.js', 'version' => 84 ),
 24+ array( 'src' => 'WikiEditor.combined.js', 'version' => 85 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 84 ),
 27+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 85 ),
2828 ),
2929 );
3030 static $messages = array(
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1684,7 +1684,7 @@
16851685 // Set tabindexes on form fields
16861686 $j.wikiEditor.modules.dialogs.fn.setTabindexes( $j(this).find( 'input' ).not( '[tabindex]' ) );
16871687
1688 - $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 4 );
 1688+ $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 3 );
16891689 $j( '#wikieditor-toolbar-table-dimensions-columns' ).val( 3 );
16901690 $j( '#wikieditor-toolbar-table-wikitable' ).click( function() {
16911691 $j( '.wikieditor-toolbar-table-preview' ).toggleClass( 'wikitable' );
Index: trunk/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -141,7 +141,7 @@
142142 </tr>\
143143 </table>\
144144 </div>\
145 - </div></div>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(mw.usability.getMsg($j(this).attr('rel')));});$j.wikiEditor.modules.dialogs.fn.setTabindexes($j(this).find('input').not('[tabindex]'));$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')
 145+ </div></div>',init:function(){$j(this).find('[rel]').each(function(){$j(this).text(mw.usability.getMsg($j(this).attr('rel')));});$j.wikiEditor.modules.dialogs.fn.setTabindexes($j(this).find('input').not('[tabindex]'));$j('#wikieditor-toolbar-table-dimensions-rows').val(3);$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')
146146 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')
147147 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').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;}
148148 if(rows+header==0||cols==0){alert(u.getMsg('wikieditor-toolbar-tool-table-zero'));return;}
Index: trunk/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1635,7 +1635,7 @@
16361636 // Set tabindexes on form fields
16371637 $j.wikiEditor.modules.dialogs.fn.setTabindexes( $j(this).find( 'input' ).not( '[tabindex]' ) );
16381638
1639 - $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 4 );
 1639+ $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 3 );
16401640 $j( '#wikieditor-toolbar-table-dimensions-columns' ).val( 3 );
16411641 $j( '#wikieditor-toolbar-table-wikitable' ).click( function() {
16421642 $j( '.wikieditor-toolbar-table-preview' ).toggleClass( 'wikitable' );
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js
@@ -455,12 +455,12 @@
456456 */
457457 getTemplateDisplayName: function ( model ) {
458458 var tName = model.getName();
459 - if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) {
460 - return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] );
461 - } else if( model.getValue( 'name' ) != '' ) {
 459+ if( model.getValue( 'name' ) != '' ) {
462460 return tName + ': ' + model.getValue( 'name' );
463461 } else if( model.getValue( 'Name' ) != '' ) {
464462 return tName + ': ' + model.getValue( 'Name' );
 463+ } else if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) {
 464+ return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] );
465465 }
466466 return tName;
467467 },
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -9777,12 +9777,12 @@
97789778 */
97799779 getTemplateDisplayName: function ( model ) {
97809780 var tName = model.getName();
9781 - if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) {
9782 - return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] );
9783 - } else if( model.getValue( 'name' ) != '' ) {
 9781+ if( model.getValue( 'name' ) != '' ) {
97849782 return tName + ': ' + model.getValue( 'name' );
97859783 } else if( model.getValue( 'Name' ) != '' ) {
97869784 return tName + ': ' + model.getValue( 'Name' );
 9785+ } else if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) {
 9786+ return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] );
97879787 }
97889788 return tName;
97899789 },
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -669,7 +669,7 @@
670670 $rows=$rows.not($row);}else{var $paramRow=$('<div />').addClass('wikiEditor-template-dialog-field-wrapper');$('<label />').text(paramText).appendTo($paramRow);$('<textarea />').data('name',param.name).val(paramVal).each(function(){$(this).css('height',$(this).val().length>24?'4.5em':'1.5em');}).data('expanded',false).bind('cut paste keypress click change',function(e){if(e.keyCode=='9')return true;var $this=$(this);setTimeout(function(){var expanded=$this.data('expanded');if($this.val().indexOf('\n')!=-1||$this.val().length>24){if(!expanded){$this.animate({'height':'4.5em'},'fast');$this.data('expanded',true);}}else{if(expanded){$this.animate({'height':'1.5em'},'fast');$this.data('expanded',false);}}},0);}).appendTo($paramRow);$paramRow.append('<div style="clear:both"></div>').appendTo($fields);}}
671671 $rows.remove();$fields.find('label').autoEllipsis();$(this).parent('.ui-dialog').find('.ui-dialog-titlebar-close').removeClass('ui-state-focus');var $needTabindex=$(this).closest('.ui-dialog').find('button, textarea');if($needTabindex.not('[tabindex]').length){$needTabindex.removeAttr('tabindex');$.wikiEditor.modules.dialogs.fn.setTabindexes($needTabindex);}}}};context.$textarea.wikiEditor('addDialog',{'templateEditor':dialog});$('#'+dialog.id).data('templateDiv',$template).dialog('open');},updateModel:function($templateText,model){var context=$templateText.data('marker').context;var text;if(typeof model=='undefined'){text=context.fn.htmlToText($templateText.html());}else{text=model.getText();}
672672 $templateText.text(text);$templateText.html($templateText.html().replace(/\n/g,'<br />'));$templateText.data('oldHTML',$templateText.html());if(typeof model=='undefined'){model=new $.wikiEditor.modules.templateEditor.fn.model(text);$templateText.data('model',model);}
673 -return model;},getTemplateDisplayName:function(model){var tName=model.getName();if(tName.toLowerCase()in $.wikiEditor.modules.templateEditor.nameMappings){return tName+': '+model.getValue($.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()]);}else if(model.getValue('name')!=''){return tName+': '+model.getValue('name');}else if(model.getValue('Name')!=''){return tName+': '+model.getValue('Name');}
 673+return model;},getTemplateDisplayName:function(model){var tName=model.getName();if(model.getValue('name')!=''){return tName+': '+model.getValue('name');}else if(model.getValue('Name')!=''){return tName+': '+model.getValue('Name');}else if(tName.toLowerCase()in $.wikiEditor.modules.templateEditor.nameMappings){return tName+': '+model.getValue($.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()]);}
674674 return tName;},model:function(wikitext){var collapsible=true;function Param(name,value,number,nameIndex,equalsIndex,valueIndex){this.name=name;this.value=value;this.number=number;this.nameIndex=nameIndex;this.equalsIndex=equalsIndex;this.valueIndex=valueIndex;}
675675 function Range(begin,end){this.begin=begin;this.end=end;}
676676 function getSetValue(name,value,original){var valueRange;var rangeIndex;var retVal;if(isNaN(name)){if(typeof paramsByName[name]=='undefined'){return"";}

Follow-up revisions

RevisionCommit summaryAuthorDate
r64464merged fixes in r64461 into deploymentnimishg00:05, 1 April 2010

Status & tagging log