r64464 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r64463‎ | r64464 | r64465 >
Date:00:05, 1 April 2010
Author:nimishg
Status:ok
Tags:
Comment:
merged fixes in r64461 into deployment
Modified paths:
  • /branches/wmf-deployment/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.hooks.php (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.min.js (modified) (history)
  • /branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js (modified) (history)

Diff [purge]

Index: branches/wmf-deployment/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' => 367 ),
 86+ array( 'src' => 'js/plugins.combined.js', 'version' => 374 ),
8787 ),
8888 'minified' => array(
89 - array( 'src' => 'js/plugins.combined.min.js', 'version' => 367 ),
 89+ array( 'src' => 'js/plugins.combined.min.js', 'version' => 374 ),
9090 ),
9191 ),
9292 );
Index: branches/wmf-deployment/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' => 68 ),
 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' => 72 ),
 24+ array( 'src' => 'WikiEditor.combined.js', 'version' => 85 ),
2525 ),
2626 'minified' => array(
27 - array( 'src' => 'WikiEditor.combined.min.js', 'version' => 72 ),
 27+ array( 'src' => 'WikiEditor.combined.min.js', 'version' => 85 ),
2828 ),
2929 );
3030 static $messages = array(
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.js
@@ -1499,7 +1499,7 @@
15001500 // Set tabindexes on form fields
15011501 $j.wikiEditor.modules.dialogs.fn.setTabindexes( $j(this).find( 'input' ).not( '[tabindex]' ) );
15021502
1503 - $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 4 );
 1503+ $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 3 );
15041504 $j( '#wikieditor-toolbar-table-dimensions-columns' ).val( 3 );
15051505 $j( '#wikieditor-toolbar-table-wikitable' ).click( function() {
15061506 $j( '.wikieditor-toolbar-table-preview' ).toggleClass( 'wikitable' );
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/WikiEditor.combined.min.js
@@ -130,7 +130,7 @@
131131 </tr>\
132132 </table>\
133133 </div>\
134 - </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')
 134+ </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')
135135 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')
136136 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;}
137137 if(rows+header==0||cols==0){alert(u.getMsg('wikieditor-toolbar-tool-table-zero'));return;}
Index: branches/wmf-deployment/extensions/UsabilityInitiative/WikiEditor/Modules/Toolbar/Toolbar.js
@@ -1450,7 +1450,7 @@
14511451 // Set tabindexes on form fields
14521452 $j.wikiEditor.modules.dialogs.fn.setTabindexes( $j(this).find( 'input' ).not( '[tabindex]' ) );
14531453
1454 - $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 4 );
 1454+ $j( '#wikieditor-toolbar-table-dimensions-rows' ).val( 3 );
14551455 $j( '#wikieditor-toolbar-table-dimensions-columns' ).val( 3 );
14561456 $j( '#wikieditor-toolbar-table-wikitable' ).click( function() {
14571457 $j( '.wikieditor-toolbar-table-preview' ).toggleClass( 'wikitable' );
Index: branches/wmf-deployment/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: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.js
@@ -9778,12 +9778,12 @@
97799779 */
97809780 getTemplateDisplayName: function ( model ) {
97819781 var tName = model.getName();
9782 - if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) {
9783 - return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] );
9784 - } else if( model.getValue( 'name' ) != '' ) {
 9782+ if( model.getValue( 'name' ) != '' ) {
97859783 return tName + ': ' + model.getValue( 'name' );
97869784 } else if( model.getValue( 'Name' ) != '' ) {
97879785 return tName + ': ' + model.getValue( 'Name' );
 9786+ } else if( tName.toLowerCase() in $.wikiEditor.modules.templateEditor.nameMappings ) {
 9787+ return tName + ': ' + model.getValue( $.wikiEditor.modules.templateEditor.nameMappings[tName.toLowerCase()] );
97889788 }
97899789 return tName;
97909790 },
Index: branches/wmf-deployment/extensions/UsabilityInitiative/js/plugins.combined.min.js
@@ -665,7 +665,7 @@
666666 $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);}}
667667 $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();}
668668 $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);}
669 -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');}
 669+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()]);}
670670 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;}
671671 function Range(begin,end){this.begin=begin;this.end=end;}
672672 function getSetValue(name,value,original){var valueRange;var rangeIndex;var retVal;if(isNaN(name)){if(typeof paramsByName[name]=='undefined'){return"";}

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r64461fixes template with param 'name' showing up before predefined names, fixes ta...nimishg23:46, 31 March 2010

Status & tagging log