r86033 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r86032‎ | r86033 | r86034 >
Date:07:26, 14 April 2011
Author:neilk
Status:ok
Tags:
Comment:
followup to r85953; title treated as string and object. Also making sure this link opens in new window.
Modified paths:
  • /trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js (modified) (history)

Diff [purge]

Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js
@@ -328,19 +328,19 @@
329329 $j( _this.titleInput ).data( 'valid', false );
330330
331331 // result is NOT unique
332 - var title;
 332+ var titleString;
333333 try {
334 - title = new mw.Title( result.title ).setNamespace( 'file' );
 334+ titleString = new mw.Title( result.title ).setNamespace( 'file' ).toString();
335335 } catch ( e ) {
336336 // unparseable result from unique test?
337 - title = '[unparseable name]';
 337+ titleString = '[unparseable name]';
338338 }
339339
340340 var errHtml;
341341 if ( result.href ) {
342 - errHtml = gM( 'mwe-upwiz-fileexists-replace-on-page', title.toString(), result.href );
 342+ errHtml = gM( 'mwe-upwiz-fileexists-replace-on-page', titleString, $j( '<a />' ).attr( { href: result.href, target: '_blank' } ) );
343343 } else {
344 - errHtml = gM( 'mwe-upwiz-fileexists-replace-no-link', title.getNameText() );
 344+ errHtml = gM( 'mwe-upwiz-fileexists-replace-no-link', titleString );
345345 }
346346
347347 _this.$form.find( 'label[for=' + _this.titleId + ']' )

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r85953better error for same-name problem, direct users to page if they wanted to re...neilk15:44, 13 April 2011

Status & tagging log