vectorConfig = \MediaWiki\MediaWikiServices::getInstance()->getConfigFactory() ->makeConfig( 'vector' ); } /** @inheritDoc */ public function getPageClasses( $title ) { $className = parent::getPageClasses( $title ); return $className; } /** * Enables the responsive mode */ public function enableResponsiveMode() { if ( !$this->responsiveMode ) { $out = $this->getOutput(); $out->addMeta( 'viewport', 'width=device-width, initial-scale=1' ); $out->addModuleStyles( 'skins.vector.styles.responsive' ); $this->responsiveMode = true; } } /** * Initializes output page and sets up skin-specific parameters * @param OutputPage $out Object to initialize */ public function initPage( OutputPage $out ) { parent::initPage( $out ); if ( $this->vectorConfig->get( 'VectorResponsive' ) ) { $this->enableResponsiveMode(); } } /** * @inheritDoc * @return array */ public function getDefaultModules() { $modules = parent::getDefaultModules(); // add vector skin styles and vector module $modules['styles']['skin'][] = 'mediawiki.skinning.interface'; $modules['styles']['skin'][] = 'skins.vector.styles'; $modules['core'][] = 'skins.vector.js'; return $modules; } /** * Override to pass our Config instance to it * @param string $classname * @param bool|string $repository * @param bool|string $cache_dir * @return QuickTemplate */ public function setupTemplate( $classname, $repository = false, $cache_dir = false ) { return new $classname( $this->vectorConfig ); } /** * Whether the logo should be preloaded with an HTTP link header or not * @since 1.29 * @return bool */ public function shouldPreloadLogo() { return true; } }