| Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDeed.js |
| — | — | @@ -103,7 +103,13 @@ |
| 104 | 104 | // XXX do we need to escape authorInput, or is wikitext a feature here? |
| 105 | 105 | // what about scripts? |
| 106 | 106 | getAuthorWikiText: function() { |
| 107 | | - return "[[User:" + mw.config.get( 'wgUserName' ) + '|' + $j( _this.authorInput ).val() + ']]'; |
| | 107 | + var author = $j( _this.authorInput ).val(); |
| | 108 | + |
| | 109 | + if ( author === '' ) { |
| | 110 | + author = _this.$authorInput2.val(); |
| | 111 | + } |
| | 112 | + |
| | 113 | + return "[[User:" + mw.config.get( 'wgUserName' ) + '|' + author + ']]'; |
| 108 | 114 | }, |
| 109 | 115 | |
| 110 | 116 | |
| — | — | @@ -112,12 +118,12 @@ |
| 113 | 119 | |
| 114 | 120 | _this.$form = $j( '<form />' ); |
| 115 | 121 | |
| 116 | | - var $authorInput2 = $j( '<input type="text" />' ).attr( { name: "author2" } ).addClass( 'mwe-upwiz-sign' ); |
| | 122 | + _this.$authorInput2 = $j( '<input type="text" />' ).attr( { name: "author2" } ).addClass( 'mwe-upwiz-sign' ); |
| 117 | 123 | var $standardDiv = $j( '<div />' ).append( |
| 118 | 124 | $j( '<label for="author2" generated="true" class="mwe-validator-error" style="display:block;" />' ), |
| 119 | 125 | $j( '<p></p>' ).msg( 'mwe-upwiz-source-ownwork-assert', |
| 120 | 126 | uploadCount, |
| 121 | | - $authorInput2 ), |
| | 127 | + _this.$authorInput2 ), |
| 122 | 128 | $j( '<p class="mwe-small-print"></p>' ).msg( |
| 123 | 129 | 'mwe-upwiz-source-ownwork-assert-note', |
| 124 | 130 | gM( 'mwe-upwiz-license-' + mw.UploadWizard.config.licensesOwnWork.defaults[0] ) |