mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-16 20:35:09 +00:00
Fix link to media viewer with proper namespace
Use the canonical English namespace instead of a localized one. Change-Id: I9fa1a2af1210c5a4a47792c3dc4616cb628cd806 Mingle: https://wikimedia.mingle.thoughtworks.com/projects/multimedia/cards/826 Bug: 69956
This commit is contained in:
parent
845e28e28e
commit
62bdbd57a6
|
@ -70,7 +70,7 @@
|
|||
RP.createHash = function ( route ) {
|
||||
if ( route instanceof mw.mmv.routing.ThumbnailRoute ) {
|
||||
return this.applicationPrefix + '/' +
|
||||
this.encodeRouteComponent( route.fileTitle.getPrefixedDb() );
|
||||
this.encodeRouteComponent( 'File:' + route.fileTitle.getMain() );
|
||||
} else if ( route instanceof mw.mmv.routing.MainFileRoute ) {
|
||||
return this.applicationPrefix;
|
||||
} else if ( route instanceof mw.mmv.routing.Route ) {
|
||||
|
|
|
@ -173,20 +173,20 @@
|
|||
// mw.Title does not accept % in page names
|
||||
this.sandbox.stub( mw, 'Title', function( name ) { return {
|
||||
name: name,
|
||||
getPrefixedDb: function() { return name; }
|
||||
getMain: function() { return name.replace( /^File:/, '' ); }
|
||||
}; } );
|
||||
title = new mw.Title( 'File:%40.png' );
|
||||
hash = router.createHash( new mw.mmv.routing.ThumbnailRoute( title ) );
|
||||
|
||||
window.location.hash = hash;
|
||||
route = router.parseLocation( window.location );
|
||||
assert.strictEqual( route.fileTitle.getPrefixedDb(), 'File:%40.png',
|
||||
assert.strictEqual( route.fileTitle.getMain(), '%40.png',
|
||||
'Reading location set via location.hash works' );
|
||||
|
||||
if ( window.history ) {
|
||||
window.history.pushState( null, null, '#' + hash );
|
||||
route = router.parseLocation( window.location );
|
||||
assert.strictEqual( route.fileTitle.getPrefixedDb(), 'File:%40.png',
|
||||
assert.strictEqual( route.fileTitle.getMain(), '%40.png',
|
||||
'Reading location set via pushState() works' );
|
||||
} else {
|
||||
assert.ok( true, 'Skipped pushState() test, not supported on this browser' );
|
||||
|
|
Loading…
Reference in a new issue