Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -78,14 +78,14 @@ |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 21 ), |
80 | 80 | array( 'src' => 'js/plugins/jquery.wikiEditor.toc.js', 'version' => 97 ), |
81 | 81 | array( 'src' => 'js/plugins/jquery.wikiEditor.preview.js', 'version' => 11 ), |
82 | | - array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 49 ), |
| 82 | + array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 50 ), |
83 | 83 | array( 'src' => 'js/plugins/jquery.wikiEditor.publish.js', 'version' => 3 ), |
84 | 84 | ), |
85 | 85 | 'combined' => array( |
86 | | - array( 'src' => 'js/plugins.combined.js', 'version' => 324 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 325 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 324 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 325 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -280,7 +280,9 @@ |
281 | 281 | $row.children( 'textarea' ) |
282 | 282 | .data( 'name', param.name ) |
283 | 283 | .val( paramVal ) |
284 | | - .change(); |
| 284 | + .each( function() { |
| 285 | + $(this).css( 'height', $(this).val().length > 24 ? '4.5em' : '1.5em' ); |
| 286 | + } ) |
285 | 287 | $rows = $rows.not( $row ); |
286 | 288 | } else { |
287 | 289 | // Create a new row |
— | — | @@ -292,7 +294,9 @@ |
293 | 295 | $( '<textarea />' ) |
294 | 296 | .data( 'name', param.name ) |
295 | 297 | .val( paramVal ) |
296 | | - .css( 'height', $(this).val().length > 24 ? '4.5em' : '1.5em' ) |
| 298 | + .each( function() { |
| 299 | + $(this).css( 'height', $(this).val().length > 24 ? '4.5em' : '1.5em' ); |
| 300 | + } ) |
297 | 301 | .data( 'expanded', false ) |
298 | 302 | .bind( 'cut paste keypress click change', function( e ) { |
299 | 303 | // If this was fired by a tab keypress, let it go |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -9523,7 +9523,9 @@ |
9524 | 9524 | $row.children( 'textarea' ) |
9525 | 9525 | .data( 'name', param.name ) |
9526 | 9526 | .val( paramVal ) |
9527 | | - .change(); |
| 9527 | + .each( function() { |
| 9528 | + $(this).css( 'height', $(this).val().length > 24 ? '4.5em' : '1.5em' ); |
| 9529 | + } ) |
9528 | 9530 | $rows = $rows.not( $row ); |
9529 | 9531 | } else { |
9530 | 9532 | // Create a new row |
— | — | @@ -9535,7 +9537,9 @@ |
9536 | 9538 | $( '<textarea />' ) |
9537 | 9539 | .data( 'name', param.name ) |
9538 | 9540 | .val( paramVal ) |
9539 | | - .css( 'height', $(this).val().length > 24 ? '4.5em' : '1.5em' ) |
| 9541 | + .each( function() { |
| 9542 | + $(this).css( 'height', $(this).val().length > 24 ? '4.5em' : '1.5em' ); |
| 9543 | + } ) |
9540 | 9544 | .data( 'expanded', false ) |
9541 | 9545 | .bind( 'cut paste keypress click change', function( e ) { |
9542 | 9546 | // If this was fired by a tab keypress, let it go |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -653,7 +653,8 @@ |
654 | 654 | <div class="wikiEditor-template-dialog-fields" />\ |
655 | 655 | </fieldset>',init:function(){$(this).find('[rel]').each(function(){$(this).text(mw.usability.getMsg($(this).attr('rel')));});},dialog:{width:600,height:400,dialogClass:'wikiEditor-toolbar-dialog',buttons:{'wikieditor-template-editor-dialog-submit':function(){var $templateDiv=$(this).data('templateDiv');context.fn.highlightLine($templateDiv);var $templateText=$templateDiv.children('.wikiEditor-template-text');var templateModel=$templateText.data('model');$(this).find('.wikiEditor-template-dialog-field-wrapper textarea').each(function(){templateModel.setValue($(this).data('name'),$(this).val());});$.wikiEditor.modules.templateEditor.fn.updateModel($templateText,templateModel);$(this).dialog('close');},'wikieditor-template-editor-dialog-cancel':function(){$(this).dialog('close');}},open:function(){var $templateDiv=$(this).data('templateDiv');var $templateText=$templateDiv.children('.wikiEditor-template-text');var templateModel=$templateText.data('model');if($templateText.html()!=$templateText.data('oldHTML')){templateModel=$.wikiEditor.modules.templateEditor.fn.updateModel($templateText);} |
656 | 656 | var params=templateModel.getAllInitialParams();var $fields=$(this).find('.wikiEditor-template-dialog-fields');var $rows=$fields.find('.wikiEditor-template-dialog-field-wrapper');for(var paramIndex in params){var param=params[paramIndex];if(typeof param.name=='undefined'){continue;} |
657 | | -var paramText=typeof param=='string'?param.name.replace(/[\_\-]/g,' '):param.name;var paramVal=templateModel.getValue(param.name);if($rows.length>0){var $row=$rows.eq(0);$row.children('label').text(paramText);$row.children('textarea').data('name',param.name).val(paramVal).change();$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).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);}} |
| 657 | +var paramText=typeof param=='string'?param.name.replace(/[\_\-]/g,' '):param.name;var paramVal=templateModel.getValue(param.name);if($rows.length>0){var $row=$rows.eq(0);$row.children('label').text(paramText);$row.children('textarea').data('name',param.name).val(paramVal).each(function(){$(this).css('height',$(this).val().length>24?'4.5em':'1.5em');}) |
| 658 | +$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);}} |
658 | 659 | $rows.remove();$fields.find('label').autoEllipsis();$(this).parent('.ui-dialog').find('.ui-dialog-titlebar-close').removeClass('ui-state-focus');}}};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();} |
659 | 660 | $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);} |
660 | 661 | return model;},getTemplateInfo:function(templateName){var templateInfo='';return $(templateInfo);},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;} |