Remove support for legacy route #/mediaviewer/File:

This route has been declared legacy in 2015 via I0936ada35141ddd85e0aa232b833d315e3246ce3.

On English Wikipedia for a given day there was no usage of this
route.

Change-Id: I41b33697669500670bea6506dc45c5c6a613c502
This commit is contained in:
Simon Legner 2024-10-13 09:18:33 +02:00 committed by Jdlrobson
parent d882ec8a93
commit dbe57993a4
3 changed files with 1 additions and 19 deletions

View file

@ -49,15 +49,6 @@ class Config {
return /\/(\d+)$/;
}
/**
* Regular expression representing the legacy media route
*
* @return {RegExp}
*/
static get LEGACY_ROUTE_REGEXP() {
return /^mediaviewer\/(.+)$/;
}
/**
* Returns true if MediaViewer should handle thumbnail clicks.
*

View file

@ -93,7 +93,6 @@ class MultimediaViewerBootstrap {
*/
setupRouter( router ) {
router.addRoute( Config.ROUTE_REGEXP, this.route.bind( this ) );
router.addRoute( Config.LEGACY_ROUTE_REGEXP, this.route.bind( this ) );
this.router = router;
}
@ -549,7 +548,7 @@ class MultimediaViewerBootstrap {
*/
isViewerHash() {
const path = location.hash.slice( 1 );
return path.match( Config.ROUTE_REGEXP ) || path.match( Config.LEGACY_ROUTE_REGEXP );
return path.match( Config.ROUTE_REGEXP );
}
/**

View file

@ -399,14 +399,6 @@ const { asyncMethod, waitForAsync, getMultimediaViewer } = require( './mmv.testh
return hashTest( '/media', bootstrap, assert );
} );
QUnit.test( 'Load the viewer on a legacy hash', ( assert ) => {
location.hash = '';
const bootstrap = createBootstrap();
return hashTest( 'mediaviewer', bootstrap, assert );
} );
QUnit.test( 'Overlay is set up on hash change', function ( assert ) {
location.hash = '#/media/foo';