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:
Mark Holmquist 2014-03-24 17:09:07 -07:00
parent 91c4fcbca4
commit 3a87587fe3

View file

@ -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;