Index: trunk/extensions/UploadWizard/resources/jquery/jquery.mwCoolCats.js |
— | — | @@ -63,9 +63,9 @@ |
64 | 64 | _processInput(); |
65 | 65 | }); |
66 | 66 | |
67 | | - function _processInput() { |
| 67 | + function _processInput() { |
68 | 68 | var $input = $container.find( 'input' ); |
69 | | - _insertCat( $input.val().trim() ); |
| 69 | + _insertCat( $j.trim( $input.val() ) ); |
70 | 70 | $input.val(""); |
71 | 71 | } |
72 | 72 | |
Index: trunk/extensions/UploadWizard/resources/combined.js |
— | — | @@ -6360,9 +6360,9 @@ |
6361 | 6361 | _processInput(); |
6362 | 6362 | }); |
6363 | 6363 | |
6364 | | - function _processInput() { |
| 6364 | + function _processInput() { |
6365 | 6365 | var $input = $container.find( 'input' ); |
6366 | | - _insertCat( $input.val().trim() ); |
| 6366 | + _insertCat( $j.trim( $input.val() ) ); |
6367 | 6367 | $input.val(""); |
6368 | 6368 | } |
6369 | 6369 | |
— | — | @@ -11072,13 +11072,13 @@ |
11073 | 11073 | */ |
11074 | 11074 | getWikiText: function() { |
11075 | 11075 | var _this = this; |
11076 | | - var description = $j( _this.input ).val().trim(); |
| 11076 | + var description = $j.trim( $j( _this.input ).val() ); |
11077 | 11077 | // we assume that form validation has caught this problem if this is a required field |
11078 | 11078 | // if not, assume the user is trying to blank a description in another language |
11079 | 11079 | if ( description.length === 0 ) { |
11080 | 11080 | return ''; |
11081 | 11081 | } |
11082 | | - var language = $j( _this.languageMenu ).val().trim(); |
| 11082 | + var language = $j.trim( $j( _this.languageMenu ).val() ); |
11083 | 11083 | var fix = mw.UploadWizard.config[ "languageTemplateFixups" ]; |
11084 | 11084 | if (fix[language]) { |
11085 | 11085 | language = fix[language]; |
— | — | @@ -11583,7 +11583,7 @@ |
11584 | 11584 | $j.each([metadata.datetimeoriginal, metadata.datetimedigitized, metadata.datetime, metadata['date']], |
11585 | 11585 | function( i, imageinfoDate ) { |
11586 | 11586 | if ( ! mw.isEmpty( imageinfoDate ) ) { |
11587 | | - var matches = imageinfoDate.trim().match( yyyyMmDdRegex ); |
| 11587 | + var matches = $j.trim( imageinfoDate ).match( yyyyMmDdRegex ); |
11588 | 11588 | if ( ! mw.isEmpty( matches ) ) { |
11589 | 11589 | dateObj = new Date( parseInt( matches[1], 10 ), |
11590 | 11590 | parseInt( matches[2], 10 ) - 1, |
— | — | @@ -11760,7 +11760,7 @@ |
11761 | 11761 | } ); |
11762 | 11762 | |
11763 | 11763 | // XXX add a sanity check here for good date |
11764 | | - information['date'] = $j( _this.dateInput ).val().trim(); |
| 11764 | + information['date'] = $j.trim( $j( _this.dateInput ).val() ); |
11765 | 11765 | |
11766 | 11766 | var deed = _this.upload.deedChooser.deed; |
11767 | 11767 | |
— | — | @@ -11780,7 +11780,7 @@ |
11781 | 11781 | // add a location template if possible |
11782 | 11782 | |
11783 | 11783 | // add an "anything else" template if needed |
11784 | | - var otherInfoWikiText = $j( _this.otherInformationInput ).val().trim(); |
| 11784 | + var otherInfoWikiText = $j.trim( $j( _this.otherInformationInput ).val() ); |
11785 | 11785 | if ( ! mw.isEmpty( otherInfoWikiText ) ) { |
11786 | 11786 | wikiText += otherInfoWikiText + "\n\n"; |
11787 | 11787 | } |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizard.js |
— | — | @@ -687,13 +687,13 @@ |
688 | 688 | */ |
689 | 689 | getWikiText: function() { |
690 | 690 | var _this = this; |
691 | | - var description = $j( _this.input ).val().trim(); |
| 691 | + var description = $j.trim( $j( _this.input ).val() ); |
692 | 692 | // we assume that form validation has caught this problem if this is a required field |
693 | 693 | // if not, assume the user is trying to blank a description in another language |
694 | 694 | if ( description.length === 0 ) { |
695 | 695 | return ''; |
696 | 696 | } |
697 | | - var language = $j( _this.languageMenu ).val().trim(); |
| 697 | + var language = $j.trim( $j( _this.languageMenu ).val() ); |
698 | 698 | var fix = mw.UploadWizard.config[ "languageTemplateFixups" ]; |
699 | 699 | if (fix[language]) { |
700 | 700 | language = fix[language]; |
— | — | @@ -1198,7 +1198,7 @@ |
1199 | 1199 | $j.each([metadata.datetimeoriginal, metadata.datetimedigitized, metadata.datetime, metadata['date']], |
1200 | 1200 | function( i, imageinfoDate ) { |
1201 | 1201 | if ( ! mw.isEmpty( imageinfoDate ) ) { |
1202 | | - var matches = imageinfoDate.trim().match( yyyyMmDdRegex ); |
| 1202 | + var matches = $j.trim( imageinfoDate ).match( yyyyMmDdRegex ); |
1203 | 1203 | if ( ! mw.isEmpty( matches ) ) { |
1204 | 1204 | dateObj = new Date( parseInt( matches[1], 10 ), |
1205 | 1205 | parseInt( matches[2], 10 ) - 1, |
— | — | @@ -1375,7 +1375,7 @@ |
1376 | 1376 | } ); |
1377 | 1377 | |
1378 | 1378 | // XXX add a sanity check here for good date |
1379 | | - information['date'] = $j( _this.dateInput ).val().trim(); |
| 1379 | + information['date'] = $j.trim( $j( _this.dateInput ).val() ); |
1380 | 1380 | |
1381 | 1381 | var deed = _this.upload.deedChooser.deed; |
1382 | 1382 | |
— | — | @@ -1395,7 +1395,7 @@ |
1396 | 1396 | // add a location template if possible |
1397 | 1397 | |
1398 | 1398 | // add an "anything else" template if needed |
1399 | | - var otherInfoWikiText = $j( _this.otherInformationInput ).val().trim(); |
| 1399 | + var otherInfoWikiText = $j.trim( $j( _this.otherInformationInput ).val() ); |
1400 | 1400 | if ( ! mw.isEmpty( otherInfoWikiText ) ) { |
1401 | 1401 | wikiText += otherInfoWikiText + "\n\n"; |
1402 | 1402 | } |
Index: trunk/extensions/UploadWizard/resources/combined.min.js |
— | — | @@ -6362,7 +6362,7 @@ |
6363 | 6363 | |
6364 | 6364 | function _processInput(){ |
6365 | 6365 | var $input=$container.find('input'); |
6366 | | -_insertCat($input.val().trim()); |
| 6366 | +_insertCat($j.trim($input.val())); |
6367 | 6367 | $input.val(""); |
6368 | 6368 | } |
6369 | 6369 | |
— | — | @@ -11072,13 +11072,13 @@ |
11073 | 11073 | |
11074 | 11074 | getWikiText:function(){ |
11075 | 11075 | var _this=this; |
11076 | | -var description=$j(_this.input).val().trim(); |
| 11076 | +var description=$j.trim($j(_this.input).val()); |
11077 | 11077 | |
11078 | 11078 | |
11079 | 11079 | if(description.length===0){ |
11080 | 11080 | return''; |
11081 | 11081 | } |
11082 | | -var language=$j(_this.languageMenu).val().trim(); |
| 11082 | +var language=$j.trim($j(_this.languageMenu).val()); |
11083 | 11083 | var fix=mw.UploadWizard.config["languageTemplateFixups"]; |
11084 | 11084 | if(fix[language]){ |
11085 | 11085 | language=fix[language]; |
— | — | @@ -11583,7 +11583,7 @@ |
11584 | 11584 | $j.each([metadata.datetimeoriginal,metadata.datetimedigitized,metadata.datetime,metadata['date']], |
11585 | 11585 | function(i,imageinfoDate){ |
11586 | 11586 | if(!mw.isEmpty(imageinfoDate)){ |
11587 | | -var matches=imageinfoDate.trim().match(yyyyMmDdRegex); |
| 11587 | +var matches=$j.trim(imageinfoDate).match(yyyyMmDdRegex); |
11588 | 11588 | if(!mw.isEmpty(matches)){ |
11589 | 11589 | dateObj=new Date(parseInt(matches[1],10), |
11590 | 11590 | parseInt(matches[2],10)-1, |
— | — | @@ -11760,7 +11760,7 @@ |
11761 | 11761 | }); |
11762 | 11762 | |
11763 | 11763 | |
11764 | | -information['date']=$j(_this.dateInput).val().trim(); |
| 11764 | +information['date']=$j.trim($j(_this.dateInput).val()); |
11765 | 11765 | |
11766 | 11766 | var deed=_this.upload.deedChooser.deed; |
11767 | 11767 | |
— | — | @@ -11780,7 +11780,7 @@ |
11781 | 11781 | |
11782 | 11782 | |
11783 | 11783 | |
11784 | | -var otherInfoWikiText=$j(_this.otherInformationInput).val().trim(); |
| 11784 | +var otherInfoWikiText=$j.trim($j(_this.otherInformationInput).val()); |
11785 | 11785 | if(!mw.isEmpty(otherInfoWikiText)){ |
11786 | 11786 | wikiText+=otherInfoWikiText+"\n\n"; |
11787 | 11787 | } |