mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-11-23 15:56:47 +00:00
Merge "Remove support for legacy route #/mediaviewer/File:"
This commit is contained in:
commit
850b558e9f
|
@ -49,15 +49,6 @@ class Config {
|
||||||
return /\/(\d+)$/;
|
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.
|
* Returns true if MediaViewer should handle thumbnail clicks.
|
||||||
*
|
*
|
||||||
|
|
|
@ -92,7 +92,6 @@ class MultimediaViewerBootstrap {
|
||||||
*/
|
*/
|
||||||
setupRouter( router ) {
|
setupRouter( router ) {
|
||||||
router.addRoute( Config.ROUTE_REGEXP, this.route.bind( this ) );
|
router.addRoute( Config.ROUTE_REGEXP, this.route.bind( this ) );
|
||||||
router.addRoute( Config.LEGACY_ROUTE_REGEXP, this.route.bind( this ) );
|
|
||||||
this.router = router;
|
this.router = router;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -535,7 +534,7 @@ class MultimediaViewerBootstrap {
|
||||||
*/
|
*/
|
||||||
isViewerHash() {
|
isViewerHash() {
|
||||||
const path = location.hash.slice( 1 );
|
const path = location.hash.slice( 1 );
|
||||||
return path.match( Config.ROUTE_REGEXP ) || path.match( Config.LEGACY_ROUTE_REGEXP );
|
return path.match( Config.ROUTE_REGEXP );
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -396,14 +396,6 @@ const { asyncMethod, waitForAsync, getMultimediaViewer } = require( './mmv.testh
|
||||||
return hashTest( '/media', bootstrap, assert );
|
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 ) {
|
QUnit.test( 'Overlay is set up on hash change', function ( assert ) {
|
||||||
location.hash = '#/media/foo';
|
location.hash = '#/media/foo';
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue