skins: Avoid deprecated wfMemcKey()
[lhc/web/wiklou.git] / includes / skins / Skin.php
index 52678d4..ccb202e 100644 (file)
@@ -158,14 +158,21 @@ abstract class Skin extends ContextSource {
                global $wgUseAjax, $wgEnableAPI, $wgEnableWriteAPI;
 
                $out = $this->getOutput();
+               $config = $this->getConfig();
                $user = $out->getUser();
                $modules = [
+                       // modules not specific to any specific skin or page
+                       'core' => [
+                               // Enforce various default modules for all pages and all skins
+                               // Keep this list as small as possible
+                               'site',
+                               'mediawiki.page.startup',
+                               'mediawiki.user',
+                       ],
                        // modules that enhance the page content in some way
                        'content' => [
                                'mediawiki.page.ready',
                        ],
-                       // modules that exist for legacy reasons
-                       'legacy' => ResourceLoaderStartUpModule::getLegacyModules(),
                        // modules relating to search functionality
                        'search' => [],
                        // modules relating to functionality relating to watching an article
@@ -174,6 +181,11 @@ abstract class Skin extends ContextSource {
                        'user' => [],
                ];
 
+               // Support for high-density display images if enabled
+               if ( $config->get( 'ResponsiveImages' ) ) {
+                       $modules['core'][] = 'mediawiki.hidpi';
+               }
+
                // Preload jquery.tablesorter for mediawiki.page.ready
                if ( strpos( $out->getHTML(), 'sortable' ) !== false ) {
                        $modules['content'][] = 'jquery.tablesorter';
@@ -184,6 +196,10 @@ abstract class Skin extends ContextSource {
                        $modules['content'][] = 'jquery.makeCollapsible';
                }
 
+               if ( $out->isTOCEnabled() ) {
+                       $modules['content'][] = 'mediawiki.toc';
+               }
+
                // Add various resources if required
                if ( $wgUseAjax && $wgEnableAPI ) {
                        if ( $wgEnableWriteAPI && $user->isLoggedIn()
@@ -446,6 +462,15 @@ abstract class Skin extends ContextSource {
                return $wgLogo;
        }
 
+       /**
+        * Whether the logo should be preloaded with an HTTP link header or not
+        * @since 1.29
+        * @return bool
+        */
+       public function shouldPreloadLogo() {
+               return false;
+       }
+
        /**
         * @return string HTML
         */
@@ -1482,7 +1507,7 @@ abstract class Skin extends ContextSource {
                }
 
                // Use the extra hash appender to let eg SSL variants separately cache.
-               $key = wfMemcKey( $name . $wgRenderHashAppend );
+               $key = $parserMemc->makeKey( $name . $wgRenderHashAppend );
                $cachedNotice = $parserMemc->get( $key );
                if ( is_array( $cachedNotice ) ) {
                        if ( md5( $notice ) == $cachedNotice['hash'] ) {