Merge "resourceloader: Update StartUpModule to use file hash instead of mtime"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Mon, 25 Jun 2018 19:51:41 +0000 (19:51 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Mon, 25 Jun 2018 19:51:41 +0000 (19:51 +0000)
Gruntfile.js
RELEASE-NOTES-1.32
includes/DefaultSettings.php
includes/cache/localisation/LCStoreStaticArray.php
includes/skins/Skin.php
resources/Resources.php
resources/src/mediawiki.hidpi/hidpi.js [deleted file]
resources/src/mediawiki.hidpi/skip.js [deleted file]

index 8018212..6be908e 100644 (file)
@@ -33,9 +33,7 @@ module.exports = function ( grunt ) {
                                '!vendor/**',
                                // Explicitly say "**/*.js" here in case of symlinks
                                '!extensions/**/*.js',
-                               '!skins/**/*.js',
-                               // Skip functions aren't even parseable
-                               '!resources/src/mediawiki.hidpi/skip.js'
+                               '!skins/**/*.js'
                        ]
                },
                jsonlint: {
index c4a8fef..3c60124 100644 (file)
@@ -218,6 +218,7 @@ because of Phabricator reports.
 * (T176526) EditPage::getContextTitle() falling back to $wgTitle when the
   context title is unset is now deprecated; anything creating an EditPage
   instance should set the context title via ::setContextTitle().
+* The 'jquery.hidpi' module (polyfill for IMG srcset) is deprecated.
 
 === Other changes in 1.32 ===
 * …
index 2c98283..8b25672 100644 (file)
@@ -1500,10 +1500,6 @@ $wgDirectoryMode = 0777;
  *
  * This means a 320x240 use of an image on the wiki will also generate 480x360 and 640x480
  * thumbnails, output via the srcset attribute.
- *
- * On older browsers, a JavaScript polyfill switches the appropriate images in after loading
- * the original low-resolution versions depending on the reported window.devicePixelRatio.
- * The polyfill can be found in the jquery.hidpi module.
  */
 $wgResponsiveImages = true;
 
index 602c0ac..38700b8 100644 (file)
@@ -47,6 +47,13 @@ class LCStoreStaticArray implements LCStore {
        }
 
        public function startWrite( $code ) {
+               if ( !file_exists( $this->directory ) ) {
+                       if ( !wfMkdirParents( $this->directory, null, __METHOD__ ) ) {
+                               throw new MWException( "Unable to create the localisation store " .
+                                       "directory \"{$this->directory}\"" );
+                       }
+               }
+
                $this->currentLang = $code;
                $this->fname = $this->directory . '/' . $code . '.l10n.php';
                $this->data[$code] = [];
index 8384ca0..51be3b6 100644 (file)
@@ -212,11 +212,6 @@ abstract class Skin extends ContextSource {
                        'syndicate' => [],
                ];
 
-               // 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';
index 1b6eed3..44b028d 100644 (file)
@@ -228,6 +228,7 @@ return [
                'targets' => [ 'desktop', 'mobile' ],
        ],
        'jquery.hidpi' => [
+               'deprecated' => 'Use of the srcset polyfill is deprecated since MediaWiki 1.32.0',
                'scripts' => 'resources/src/jquery/jquery.hidpi.js',
                'targets' => [ 'desktop', 'mobile' ],
        ],
@@ -1051,12 +1052,6 @@ return [
                ],
                'targets' => [ 'desktop', 'mobile' ],
        ],
-       'mediawiki.hidpi' => [
-               'scripts' => 'resources/src/mediawiki.hidpi/hidpi.js',
-               'dependencies' => 'jquery.hidpi',
-               'skipFunction' => 'resources/src/mediawiki.hidpi/skip.js',
-               'targets' => [ 'desktop', 'mobile' ],
-       ],
        'mediawiki.hlist' => [
                'targets' => [ 'desktop', 'mobile' ],
                'styles' => [
diff --git a/resources/src/mediawiki.hidpi/hidpi.js b/resources/src/mediawiki.hidpi/hidpi.js
deleted file mode 100644 (file)
index ecee450..0000000
+++ /dev/null
@@ -1,5 +0,0 @@
-jQuery( function ( $ ) {
-       // Apply hidpi images on DOM-ready
-       // Some may have already partly preloaded at low resolution.
-       $( 'body' ).hidpi();
-} );
diff --git a/resources/src/mediawiki.hidpi/skip.js b/resources/src/mediawiki.hidpi/skip.js
deleted file mode 100644 (file)
index 26b63c7..0000000
+++ /dev/null
@@ -1,4 +0,0 @@
-/*!
- * Skip function for mediawiki.hdpi.js.
- */
-return 'srcset' in new Image();