X-Git-Url: https://git.heureux-cyclage.org/?a=blobdiff_plain;f=includes%2Fresourceloader%2FResourceLoaderClientHtml.php;h=84477ca86830b50f1b8c3e6db26f0d3f56684e5f;hb=962b690e92a258bd53100e976dc5575180696bf0;hp=5c072bfdec6fb195a9ce7ef94d57af158bd0163c;hpb=0770f85a0a293e6c7af6f1d3d3a1dbd2d13c1e09;p=lhc%2Fweb%2Fwiklou.git diff --git a/includes/resourceloader/ResourceLoaderClientHtml.php b/includes/resourceloader/ResourceLoaderClientHtml.php index 5c072bfdec..84477ca868 100644 --- a/includes/resourceloader/ResourceLoaderClientHtml.php +++ b/includes/resourceloader/ResourceLoaderClientHtml.php @@ -22,7 +22,7 @@ use Wikimedia\WrappedString; use Wikimedia\WrappedStringList; /** - * Bootstrap a ResourceLoader client on an HTML page. + * Load and configure a ResourceLoader client on an HTML page. * * @since 1.28 */ @@ -46,9 +46,6 @@ class ResourceLoaderClientHtml { /** @var array */ private $moduleStyles = []; - /** @var array */ - private $moduleScripts = []; - /** @var array */ private $exemptStates = []; @@ -101,16 +98,6 @@ class ResourceLoaderClientHtml { $this->moduleStyles = $modules; } - /** - * Ensure the scripts of one or more modules are loaded. - * - * @deprecated since 1.28 - * @param array $modules Array of module names - */ - public function setModuleScripts( array $modules ) { - $this->moduleScripts = $modules; - } - /** * Set state of special modules that are handled by the caller manually. * @@ -139,7 +126,6 @@ class ResourceLoaderClientHtml { ], 'general' => [], 'styles' => [], - 'scripts' => [], // Embedding for private modules 'embed' => [ 'styles' => [], @@ -217,26 +203,6 @@ class ResourceLoaderClientHtml { } } - foreach ( $this->moduleScripts as $name ) { - $module = $rl->getModule( $name ); - if ( !$module ) { - continue; - } - - $group = $module->getGroup(); - $context = $this->getContext( $group, ResourceLoaderModule::TYPE_SCRIPTS ); - if ( $module->isKnownEmpty( $context ) ) { - // Avoid needless request for empty module - $data['states'][$name] = 'ready'; - } else { - // Load from load.php?only=scripts via - $data['scripts'][] = $name; - - // Avoid duplicate request from mw.loader - $data['states'][$name] = 'loading'; - } - } - return $data; } @@ -312,15 +278,6 @@ class ResourceLoaderClientHtml { ); } - // Inline RLQ: Load only=scripts - if ( $data['scripts'] ) { - $chunks[] = $this->getLoad( - $data['scripts'], - ResourceLoaderModule::TYPE_SCRIPTS, - $nonce - ); - } - // External stylesheets (only=styles) if ( $data['styles'] ) { $chunks[] = $this->getLoad(