From: Ori Livneh Date: Fri, 11 Oct 2013 08:31:00 +0000 (-0700) Subject: Add an explicit targets declaration for mediawiki.inspect & $.byteLength X-Git-Tag: 1.31.0-rc.0~18543^2 X-Git-Url: https://git.heureux-cyclage.org/?p=lhc%2Fweb%2Fwiklou.git;a=commitdiff_plain;h=007acdc32b0d753c5ca957346fc5ac1c539586ed Add an explicit targets declaration for mediawiki.inspect & $.byteLength Jon Robson said[1] he'd be interested in making mediawiki.inspect usable on the mobile site by specifying both mobile & desktop targets explicitly in the resource declaration. That's what this patch does. The cost to this is very minimal because the module is never loaded by default. mw.loader.inspect() wraps the call to the inspector with an mw.loader.using() call that causes the module to be retrieved. It is not retrieved otherwise. [1]: http://lists.wikimedia.org/pipermail/wikitech-l/2013-October/072381.html Change-Id: I7cf292d3b8fb554bd1fc2143ca45399efccb70aa --- diff --git a/resources/Resources.php b/resources/Resources.php index 050e933f1b..6f4b9f717b 100644 --- a/resources/Resources.php +++ b/resources/Resources.php @@ -160,6 +160,7 @@ return array( ), 'jquery.byteLength' => array( 'scripts' => 'resources/jquery/jquery.byteLength.js', + 'targets' => array( 'desktop', 'mobile' ), ), 'jquery.byteLimit' => array( 'scripts' => 'resources/jquery/jquery.byteLimit.js', @@ -649,6 +650,7 @@ return array( 'mediawiki.inspect' => array( 'scripts' => 'resources/mediawiki/mediawiki.inspect.js', 'dependencies' => 'jquery.byteLength', + 'targets' => array( 'desktop', 'mobile' ), ), 'mediawiki.feedback' => array( 'scripts' => 'resources/mediawiki/mediawiki.feedback.js',