$resourceLoader->makeModuleResponse( $context, $grpModules )
);
} else {
- $links['html'] .= Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript(
- $resourceLoader->makeModuleResponse( $context, $grpModules )
- )
+ $links['html'] .= ResourceLoader::makeInlineScript(
+ $resourceLoader->makeModuleResponse( $context, $grpModules )
);
}
$links['html'] .= "\n";
if ( $only === ResourceLoaderModule::TYPE_STYLES ) {
$link = Html::linkedStyle( $url );
} elseif ( $loadCall ) {
- $link = Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript(
- Xml::encodeJsCall( 'mw.loader.load', array( $url, 'text/javascript', true ) )
- )
+ $link = ResourceLoader::makeInlineScript(
+ Xml::encodeJsCall( 'mw.loader.load', array( $url, 'text/javascript', true ) )
);
} else {
$link = Html::linkedScript( $url );
// browsers not supported by the startup module would unconditionally
// execute this module. Otherwise users will get "ReferenceError: mw is
// undefined" or "jQuery is undefined" from e.g. a "site" module.
- $link = Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript(
- Xml::encodeJsCall( 'document.write', array( $link ) )
- )
+ $link = ResourceLoader::makeInlineScript(
+ Xml::encodeJsCall( 'document.write', array( $link ) )
);
}
}
if ( count( $states ) ) {
- $html = Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript(
- ResourceLoader::makeLoaderStateScript( $states )
- )
+ $html = ResourceLoader::makeInlineScript(
+ ResourceLoader::makeLoaderStateScript( $states )
) . "\n" . $html;
}
$links[] = $this->makeResourceLoaderLink( 'startup', ResourceLoaderModule::TYPE_SCRIPTS, true );
// Load config before anything else
- $links[] = Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript(
- ResourceLoader::makeConfigSetScript( $this->getJSVars() )
- )
+ $links[] = ResourceLoader::makeInlineScript(
+ ResourceLoader::makeConfigSetScript( $this->getJSVars() )
);
// Load embeddable private modules before any loader links
// Only load modules that have marked themselves for loading at the top
$modules = $this->getModules( true, 'top' );
if ( $modules ) {
- $links[] = Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript(
- Xml::encodeJsCall( 'mw.loader.load', array( $modules ) )
- )
+ $links[] = ResourceLoader::makeInlineScript(
+ Xml::encodeJsCall( 'mw.loader.load', array( $modules ) )
);
}
// Only load modules that have marked themselves for loading at the bottom
$modules = $this->getModules( true, 'bottom' );
if ( $modules ) {
- $links[] = Html::inlineScript(
- ResourceLoader::makeLoaderConditionalScript(
- Xml::encodeJsCall( 'mw.loader.load', array( $modules, null, true ) )
- )
+ $links[] = ResourceLoader::makeInlineScript(
+ Xml::encodeJsCall( 'mw.loader.load', array( $modules, null, true ) )
);
}
if ( !$this->getTitle()->isJsSubpage() && !$this->getTitle()->isCssSubpage() ) {
return false;
}
+ if ( !$this->getTitle()->isSubpageOf( $this->getUser()->getUserPage() ) ) {
+ // Don't execute another user's CSS or JS on preview (T85855)
+ return false;
+ }
return !count( $this->getTitle()->getUserPermissionsErrors( 'edit', $this->getUser() ) );
}