Index: trunk/extensions/UsabilityInitiative/UsabilityInitiative.hooks.php |
— | — | @@ -22,18 +22,18 @@ |
23 | 23 | array( 'src' => 'css/vector.collapsibleNav.css', 'version' => 7 ), |
24 | 24 | array( 'src' => 'css/vector.footerCleanup.css', 'version' => 1 ), |
25 | 25 | array( 'src' => 'css/wikiEditor.css', 'version' => 12 ), |
26 | | - array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 23 ), |
| 26 | + array( 'src' => 'css/wikiEditor.dialogs.css', 'version' => 24 ), |
27 | 27 | array( 'src' => 'css/wikiEditor.preview.css', 'version' => 1 ), |
28 | 28 | array( 'src' => 'css/wikiEditor.toc.css', 'version' => 28 ), |
29 | 29 | array( 'src' => 'css/wikiEditor.toolbar.css', 'version' => 11 ), |
30 | 30 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
31 | 31 | ), |
32 | 32 | 'combined' => array( |
33 | | - array( 'src' => 'css/combined.css', 'version' => 71 ), |
| 33 | + array( 'src' => 'css/combined.css', 'version' => 72 ), |
34 | 34 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
35 | 35 | ), |
36 | 36 | 'minified' => array( |
37 | | - array( 'src' => 'css/combined.min.css', 'version' => 71 ), |
| 37 | + array( 'src' => 'css/combined.min.css', 'version' => 72 ), |
38 | 38 | array( 'src' => 'css/vector/jquery-ui-1.7.2.css', 'version' => '1.7.2y' ), |
39 | 39 | ), |
40 | 40 | ) |
— | — | @@ -78,14 +78,14 @@ |
79 | 79 | array( 'src' => 'js/plugins/jquery.wikiEditor.dialogs.js', 'version' => 19 ), |
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' => 38 ), |
| 82 | + array( 'src' => 'js/plugins/jquery.wikiEditor.templateEditor.js', 'version' => 39 ), |
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' => 307 ), |
| 86 | + array( 'src' => 'js/plugins.combined.js', 'version' => 308 ), |
87 | 87 | ), |
88 | 88 | 'minified' => array( |
89 | | - array( 'src' => 'js/plugins.combined.min.js', 'version' => 307 ), |
| 89 | + array( 'src' => 'js/plugins.combined.min.js', 'version' => 308 ), |
90 | 90 | ), |
91 | 91 | ), |
92 | 92 | ); |
Index: trunk/extensions/UsabilityInitiative/css/wikiEditor.dialogs.css |
— | — | @@ -227,16 +227,23 @@ |
228 | 228 | /* Template Editor Dialogs */ |
229 | 229 | .wikiEditor-template-dialog-fields label { |
230 | 230 | text-transform: capitalize; |
| 231 | + float: left; |
| 232 | + width: 25%; |
| 233 | + line-height: 1.5em; |
231 | 234 | } |
| 235 | +.wikiEditor-template-dialog-fields textarea { |
| 236 | + float: right; |
| 237 | + width: 70%; |
| 238 | + line-height: 1.5em; |
| 239 | + height: 1.5em; |
| 240 | +} |
232 | 241 | .wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper { |
233 | | - padding: 0 0 25px 0; |
| 242 | + padding: 0.75em 0.33em; |
| 243 | + border-bottom: dashed 1px silver; |
| 244 | + clear: both; |
234 | 245 | } |
235 | | -.wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper label { |
236 | | - display: block; |
237 | | -} |
238 | | -.wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper input { |
239 | | - width: 100%; |
240 | | -} |
| 246 | + |
| 247 | + |
241 | 248 | /* Self Clearing Floats */ |
242 | 249 | .wikieditor-toolbar-table-dimension-fields:after, |
243 | 250 | .wikieditor-toolbar-dialog-wrapper:after { |
Index: trunk/extensions/UsabilityInitiative/css/combined.css |
— | — | @@ -474,16 +474,23 @@ |
475 | 475 | /* Template Editor Dialogs */ |
476 | 476 | .wikiEditor-template-dialog-fields label { |
477 | 477 | text-transform: capitalize; |
| 478 | + float: left; |
| 479 | + width: 25%; |
| 480 | + line-height: 1.5em; |
478 | 481 | } |
| 482 | +.wikiEditor-template-dialog-fields textarea { |
| 483 | + float: right; |
| 484 | + width: 70%; |
| 485 | + line-height: 1.5em; |
| 486 | + height: 1.5em; |
| 487 | +} |
479 | 488 | .wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper { |
480 | | - padding: 0 0 25px 0; |
| 489 | + padding: 0.75em 0.33em; |
| 490 | + border-bottom: dashed 1px silver; |
| 491 | + clear: both; |
481 | 492 | } |
482 | | -.wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper label { |
483 | | - display: block; |
484 | | -} |
485 | | -.wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper input { |
486 | | - width: 100%; |
487 | | -} |
| 493 | + |
| 494 | + |
488 | 495 | /* Self Clearing Floats */ |
489 | 496 | .wikieditor-toolbar-table-dimension-fields:after, |
490 | 497 | .wikieditor-toolbar-dialog-wrapper:after { |
Index: trunk/extensions/UsabilityInitiative/css/combined.min.css |
— | — | @@ -451,16 +451,21 @@ |
452 | 452 | } |
453 | 453 | .wikiEditor-template-dialog-fields label{ |
454 | 454 | text-transform:capitalize; |
| 455 | +float:left; |
| 456 | +width:25%; |
| 457 | +line-height:1.5em; |
455 | 458 | } |
| 459 | +.wikiEditor-template-dialog-fields textarea{ |
| 460 | +float:right; |
| 461 | +width:70%; |
| 462 | +line-height:1.5em; |
| 463 | +height:1.5em; |
| 464 | +} |
456 | 465 | .wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper{ |
457 | | -padding:0 0 25px 0; |
| 466 | +padding:0.75em 0.33em; |
| 467 | +border-bottom:dashed 1px silver; |
| 468 | +clear:both; |
458 | 469 | } |
459 | | -.wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper label{ |
460 | | -display:block; |
461 | | -} |
462 | | -.wikiEditor-template-dialog-fields .wikiEditor-template-dialog-field-wrapper input{ |
463 | | -width:100%; |
464 | | -} |
465 | 470 | .wikieditor-toolbar-table-dimension-fields:after, |
466 | 471 | .wikieditor-toolbar-dialog-wrapper:after{ |
467 | 472 | visibility:hidden; |
Index: trunk/extensions/UsabilityInitiative/js/plugins/jquery.wikiEditor.templateEditor.js |
— | — | @@ -210,7 +210,7 @@ |
211 | 211 | |
212 | 212 | var $templateText = $templateDiv.children( '.wikiEditor-template-text' ); |
213 | 213 | var templateModel = $templateText.data( 'model' ); |
214 | | - $( this ).find( '.wikiEditor-template-dialog-field-wrapper input' ).each( function() { |
| 214 | + $( this ).find( '.wikiEditor-template-dialog-field-wrapper textarea' ).each( function() { |
215 | 215 | templateModel.setValue( $( this ).data( 'name' ), $( this ).val() ); |
216 | 216 | }); |
217 | 217 | //keep text consistent |
— | — | @@ -258,10 +258,29 @@ |
259 | 259 | $( '<label />' ) |
260 | 260 | .text( paramText ) |
261 | 261 | .appendTo( $paramRow ); |
262 | | - $( '<input />' ) |
| 262 | + $( '<textarea />' ) |
263 | 263 | .data( 'name', param.name ) |
264 | 264 | .val( paramVal ) |
| 265 | + .bind( 'cut paste keypress click', function() { |
| 266 | + $this = $(this); |
| 267 | + setTimeout( function() { |
| 268 | + var expanded = $this.data( 'expanded' ); |
| 269 | + if ( $this.val().length > 24 ) { |
| 270 | + if ( !expanded ) { |
| 271 | + $this.animate( { 'height': '4.5em' }, 'fast' ); |
| 272 | + $this.data( 'expanded', true ); |
| 273 | + } |
| 274 | + } else { |
| 275 | + if ( expanded ) { |
| 276 | + $this.animate( { 'height': '1.5em' }, 'fast' ); |
| 277 | + $this.data( 'expanded', false ); |
| 278 | + } |
| 279 | + } |
| 280 | + }, 0 ); |
| 281 | + } ) |
265 | 282 | .appendTo( $paramRow ); |
| 283 | + $( '<div style="clear:both"></div>' ) |
| 284 | + .appendTo( $paramRow ); |
266 | 285 | $fields.append( $paramRow ); |
267 | 286 | } |
268 | 287 | // Remove any leftover rows |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.js |
— | — | @@ -9312,7 +9312,7 @@ |
9313 | 9313 | |
9314 | 9314 | var $templateText = $templateDiv.children( '.wikiEditor-template-text' ); |
9315 | 9315 | var templateModel = $templateText.data( 'model' ); |
9316 | | - $( this ).find( '.wikiEditor-template-dialog-field-wrapper input' ).each( function() { |
| 9316 | + $( this ).find( '.wikiEditor-template-dialog-field-wrapper textarea' ).each( function() { |
9317 | 9317 | templateModel.setValue( $( this ).data( 'name' ), $( this ).val() ); |
9318 | 9318 | }); |
9319 | 9319 | //keep text consistent |
— | — | @@ -9360,10 +9360,29 @@ |
9361 | 9361 | $( '<label />' ) |
9362 | 9362 | .text( paramText ) |
9363 | 9363 | .appendTo( $paramRow ); |
9364 | | - $( '<input />' ) |
| 9364 | + $( '<textarea />' ) |
9365 | 9365 | .data( 'name', param.name ) |
9366 | 9366 | .val( paramVal ) |
| 9367 | + .bind( 'cut paste keypress click', function() { |
| 9368 | + $this = $(this); |
| 9369 | + setTimeout( function() { |
| 9370 | + var expanded = $this.data( 'expanded' ); |
| 9371 | + if ( $this.val().length > 24 ) { |
| 9372 | + if ( !expanded ) { |
| 9373 | + $this.animate( { 'height': '4.5em' }, 'fast' ); |
| 9374 | + $this.data( 'expanded', true ); |
| 9375 | + } |
| 9376 | + } else { |
| 9377 | + if ( expanded ) { |
| 9378 | + $this.animate( { 'height': '1.5em' }, 'fast' ); |
| 9379 | + $this.data( 'expanded', false ); |
| 9380 | + } |
| 9381 | + } |
| 9382 | + }, 0 ); |
| 9383 | + } ) |
9367 | 9384 | .appendTo( $paramRow ); |
| 9385 | + $( '<div style="clear:both"></div>' ) |
| 9386 | + .appendTo( $paramRow ); |
9368 | 9387 | $fields.append( $paramRow ); |
9369 | 9388 | } |
9370 | 9389 | // Remove any leftover rows |
Index: trunk/extensions/UsabilityInitiative/js/plugins.combined.min.js |
— | — | @@ -644,9 +644,9 @@ |
645 | 645 | <fieldset>\ |
646 | 646 | <div class="wikiEditor-template-dialog-title" />\ |
647 | 647 | <div class="wikiEditor-template-dialog-fields" />\ |
648 | | - </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 input').each(function(){templateModel.setValue($(this).data('name'),$(this).val());});$.wikiEditor.modules.templateEditor.fn.updateModel($templateText,templateModel);$(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);} |
| 648 | + </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');}},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);} |
649 | 649 | var params=templateModel.getAllInitialParams();var $fields=$(this).find('.wikiEditor-template-dialog-fields').empty();var $rows=$fields.find('.wikiEditor-template-dialog-field-wrapper');for(var paramIndex in params){var param=params[paramIndex];if(typeof param.name=='undefined'){continue;} |
650 | | -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('input').val(paramVal);$rows=$rows.not($row);}else{var $paramRow=$('<div />').addClass('wikiEditor-template-dialog-field-wrapper');$('<label />').text(paramText).appendTo($paramRow);$('<input />').data('name',param.name).val(paramVal).appendTo($paramRow);$fields.append($paramRow);} |
| 650 | +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('input').val(paramVal);$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).bind('cut paste keypress click',function(){$this=$(this);setTimeout(function(){var expanded=$this.data('expanded');if($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);$('<div style="clear:both"></div>').appendTo($paramRow);$fields.append($paramRow);} |
651 | 651 | $rows.remove();} |
652 | 652 | $(this).parent('.ui-dialog').find('.ui-dialog-titlebar-close').removeClass('ui-state-focus');}}};function createDialog($templateDiv){context.$textarea.wikiEditor('addDialog',{'templateEditor':dialog});$('#'+dialog.id).data('templateDiv',$templateDiv).dialog('open');}},unwrapTemplate:function($wrapper){$wrapper.parent().replaceWith($wrapper);},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();} |
653 | 653 | $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);} |