mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/MultimediaViewer
synced 2024-09-23 18:30:11 +00:00
Load MMV scripts for everyone; handle hashes
The latter was already built in but impossible with how our config was set up until now. Change-Id: Ic1718968790e2247cba509635a4e9b1eab5fd948
This commit is contained in:
parent
91c4fcbca4
commit
3a87587fe3
|
@ -33,7 +33,7 @@ class MultimediaViewerHooks {
|
|||
* @param User $user
|
||||
* @return bool
|
||||
*/
|
||||
protected static function shouldLoad( $user ) {
|
||||
protected static function shouldHandleClicks( $user ) {
|
||||
global $wgMediaViewerIsInBeta, $wgEnableMediaViewerForLoggedInUsersOnly;
|
||||
|
||||
if ( $wgMediaViewerIsInBeta && class_exists( 'BetaFeatures' ) ) {
|
||||
|
@ -53,10 +53,6 @@ class MultimediaViewerHooks {
|
|||
* @return bool
|
||||
*/
|
||||
protected static function getModules( &$out ) {
|
||||
if ( !self::shouldLoad( $out->getUser() ) ) {
|
||||
return true;
|
||||
}
|
||||
|
||||
$out->addModules( array( 'mmv.bootstrap.autostart' ) );
|
||||
|
||||
return true;
|
||||
|
@ -125,7 +121,7 @@ class MultimediaViewerHooks {
|
|||
'globalUsageAvailable' => isset( $wgAPIPropModules['globalusage'] ),
|
||||
);
|
||||
$vars['wgNetworkPerformanceSamplingFactor'] = $wgNetworkPerformanceSamplingFactor;
|
||||
$vars['wgMediaViewerOnClick'] = self::shouldLoad( User::newFromSession() );
|
||||
$vars['wgMediaViewerOnClick'] = self::shouldHandleClicks( User::newFromSession() );
|
||||
$vars['wgMediaViewer'] = true;
|
||||
|
||||
return true;
|
||||
|
|
Loading…
Reference in a new issue