Index: trunk/extensions/UploadWizard/UploadWizardHooks.php |
— | — | @@ -217,6 +217,8 @@ |
218 | 218 | 'mwe-upwiz-change', |
219 | 219 | 'mwe-upwiz-fileexists-replace', |
220 | 220 | 'mwe-upwiz-fileexists', |
| 221 | + 'mwe-upwiz-fileexists-replace-on-page', |
| 222 | + 'mwe-upwiz-fileexists-replace-no-link', |
221 | 223 | 'mwe-upwiz-thumbnail-more', |
222 | 224 | 'mwe-upwiz-overwrite', |
223 | 225 | 'mwe-copyright-macro', |
Index: trunk/extensions/UploadWizard/UploadWizard.i18n.php |
— | — | @@ -151,6 +151,8 @@ |
152 | 152 | 'mwe-upwiz-fileexists-replace' => 'A file with the title "$1" exists already. Please change your title to something unique.', |
153 | 153 | 'mwe-upwiz-fileexists' => 'A file with this name exists already. |
154 | 154 | Please check <b><tt>$1</tt></b> if you are not sure if you want to replace it.', |
| 155 | + 'mwe-upwiz-fileexists-replace-on-page' => 'A file with this name exists already. If you want to replace it, go to the page for [$2 $1] and replace it there.', |
| 156 | + 'mwe-upwiz-fileexists-replace-no-link' => 'A file with this name exists already.', |
155 | 157 | 'mwe-upwiz-thumbnail-more' => 'Enlarge', |
156 | 158 | 'mwe-upwiz-overwrite' => 'Replace the file', |
157 | 159 | 'mwe-copyright-macro' => 'As above', |
Property changes on: trunk/extensions/UploadWizard/resources/mw.LanguageUpWiz.js |
___________________________________________________________________ |
Modified: svn:mergeinfo |
158 | 160 | Merged /trunk/phase3/extensions/UploadWizard/resources/mw.LanguageUpWiz.js:r85939 |
Index: trunk/extensions/UploadWizard/resources/mw.UploadWizardDetails.js |
— | — | @@ -330,97 +330,22 @@ |
331 | 331 | // result is NOT unique |
332 | 332 | var title; |
333 | 333 | try { |
334 | | - title = new mw.Title( result.title ).setNamespace( 'file' ).getNameText(); |
| 334 | + title = new mw.Title( result.title ).setNamespace( 'file' ); |
335 | 335 | } catch ( e ) { |
336 | 336 | // unparseable result from unique test? |
337 | 337 | title = '[unparseable name]'; |
338 | 338 | } |
339 | | - |
340 | | - /* var img = result.img; |
341 | | - var href = result.href; */ |
342 | | - |
| 339 | + |
| 340 | + var errHtml; |
| 341 | + if ( result.href ) { |
| 342 | + errHtml = gM( 'mwe-upwiz-fileexists-replace-on-page', title.toString(), result.href ); |
| 343 | + } else { |
| 344 | + errHtml = gM( 'mwe-upwiz-fileexists-replace-no-link', title.getNameText() ); |
| 345 | + } |
| 346 | + |
343 | 347 | _this.$form.find( 'label[for=' + _this.titleId + ']' ) |
344 | | - .html( gM( 'mwe-upwiz-fileexists-replace', title ) ) |
| 348 | + .html( errHtml ) |
345 | 349 | .show(); |
346 | | - |
347 | | - /* temporarily commenting out the full thumbnail etc. thing. For now, we just want the user to change |
348 | | - to a different name |
349 | | - _this.ignoreWarningsInput = $j("<input />").attr( { type: 'checkbox', name: 'ignorewarnings' } ); |
350 | | - var $fileAlreadyExists = $j('<div />') |
351 | | - .append( |
352 | | - gM( 'mwe-upwiz-fileexists', |
353 | | - $j('<a />') |
354 | | - .attr( { target: '_new', href: href } ) |
355 | | - .text( title ) |
356 | | - ), |
357 | | - $j('<br />'), |
358 | | - _this.ignoreWarningsInput, |
359 | | - gM('mwe-upwiz-overwrite') |
360 | | - ); |
361 | | - |
362 | | - var $imageLink = $j('<a />') |
363 | | - .addClass( 'image' ) |
364 | | - .attr( { target: '_new', href: href } ) |
365 | | - .append( |
366 | | - $j( '<img />') |
367 | | - .addClass( 'thumbimage' ) |
368 | | - .attr( { |
369 | | - 'width' : img.thumbwidth, |
370 | | - 'height' : img.thumbheight, |
371 | | - 'border' : 0, |
372 | | - 'src' : img.thumburl, |
373 | | - 'alt' : title |
374 | | - } ) |
375 | | - ); |
376 | | - |
377 | | - var $imageCaption = $j( '<div />' ) |
378 | | - .addClass( 'thumbcaption' ) |
379 | | - .append( |
380 | | - $j('<div />') |
381 | | - .addClass( "magnify" ) |
382 | | - .append( |
383 | | - $j('<a />' ) |
384 | | - .addClass( 'internal' ) |
385 | | - .attr( { |
386 | | - 'title' : gM('mwe-upwiz-thumbnail-more'), |
387 | | - 'href' : href |
388 | | - } ), |
389 | | - |
390 | | - $j( '<img />' ) |
391 | | - .attr( { |
392 | | - 'border' : 0, |
393 | | - 'width' : 15, |
394 | | - 'height' : 11, |
395 | | - 'src' : mw.UploadWizard.config[ 'images_path' ] + 'magnify-clip.png' |
396 | | - } ), |
397 | | - |
398 | | - $j('<span />') |
399 | | - .html( gM( 'mwe-fileexists-thumb' ) ) |
400 | | - ) |
401 | | - ); |
402 | | - |
403 | | - $j( _this.titleErrorDiv ).html( |
404 | | - $j('<span />') // dummy argument since .html() only takes one arg |
405 | | - .append( |
406 | | - $fileAlreadyExists, |
407 | | - $j( '<div />' ) |
408 | | - .addClass( 'thumb tright' ) |
409 | | - .append( |
410 | | - $j( '<div />' ) |
411 | | - .addClass( 'thumbinner' ) |
412 | | - .css({ |
413 | | - 'width' : ( parseInt( img.thumbwidth ) + 2 ) + 'px;' |
414 | | - }) |
415 | | - .append( |
416 | | - $imageLink, |
417 | | - $imageCaption |
418 | | - ) |
419 | | - ) |
420 | | - ) |
421 | | - ).show(); |
422 | | - */ |
423 | | - |
424 | | - |
425 | 350 | }, |
426 | 351 | |
427 | 352 | /** |
Property changes on: trunk/extensions/UploadWizard |
___________________________________________________________________ |
Modified: svn:mergeinfo |
428 | 353 | Merged /trunk/phase3/extensions/UploadWizard:r85939 |