Merge "Remove support for legacy route #/mediaviewer/File:"

This commit is contained in:
jenkins-bot 2024-10-23 15:39:26 +00:00 committed by Gerrit Code Review
commit 850b558e9f
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

@ -92,7 +92,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;
}
@ -535,7 +534,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

@ -396,14 +396,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';