r86022 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86021‎ | r86022 | r86023 >
Date:05:08, 14 April 2011
Author:neilk
Status:ok
Tags:
Comment:
nicer text inputs at thank-you step
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /trunk/extensions/UploadWizard/resources/uploadWizard.css (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/uploadWizard.css
@@ -649,6 +649,7 @@
650650
651651 .mwe-readonly {
652652 background-color: #ffffff;
 653+ padding: 0.25em;
653654 }
654655
655656 .mwe-date-display {
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -1207,20 +1207,12 @@
12081208 $j('<p/>').append(
12091209 gM( 'mwe-upwiz-thanks-wikitext' ),
12101210 $j( '<br />' ),
1211 - $j( '<textarea class="mwe-long-textarea" rows="2"/>' )
1212 - .growTextArea()
1213 - .readonly()
1214 - .append( thumbWikiText )
1215 - .trigger('resizeEvent')
 1211+ _this.makeReadOnlyInput( thumbWikiText )
12161212 ),
12171213 $j('<p/>').append(
12181214 gM( 'mwe-upwiz-thanks-url' ),
12191215 $j( '<br />' ),
1220 - $j( '<textarea class="mwe-long-textarea" rows="2"/>' )
1221 - .growTextArea()
1222 - .readonly()
1223 - .append( upload.imageinfo.descriptionurl )
1224 - .trigger('resizeEvent')
 1216+ _this.makeReadOnlyInput( upload.imageinfo.descriptionurl )
12251217 )
12261218 )
12271219 );
@@ -1230,6 +1222,17 @@
12311223 },
12321224
12331225 /**
 1226+ * make a read only text input, which self-selects on gaining focus
 1227+ * @param {String} text it will contain
 1228+ */
 1229+ makeReadOnlyInput: function ( s ) {
 1230+ return $j( '<input/>' ).addClass( 'mwe-title ui-corner-all' )
 1231+ .readonly()
 1232+ .val( s )
 1233+ .focus( function() { this.select(); } );
 1234+ },
 1235+
 1236+ /**
12341237 * Build interface for collecting user feedback on Upload Wizard
12351238 */
12361239 launchFeedback: function() {

Status & tagging log