mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-27 09:30:02 +00:00
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:
parent
d882ec8a93
commit
dbe57993a4
|
@ -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.
|
||||
*
|
||||
|
|
|
@ -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 );
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
@ -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';
|
||||
|
||||
|
|
Loading…
Reference in a new issue