30 use Wikimedia\Minify\CSSMin;
51 return CssContent::class;
69 return new $class(
'/* #REDIRECT */@import ' . CSSMin::buildUrlValue( $url ) .
';' );
81 if ( $shouldCallDeprecatedMethod ) {
88 '@phan-var CssContent $content';
91 $services = MediaWikiServices::getInstance();
92 if ( !$services->getUserOptionsLookup()->getBoolOption( $pstParams->
getUser(),
'pst-cssjs' ) ) {
95 $popts->setPreSaveTransform(
false );
99 $pst = $services->getParserFactory()->getInstance()->preSaveTransform(
107 return new $class( $pst );
118 $textModelsToParse = MediaWikiServices::getInstance()->getMainConfig()
119 ->get( MainConfigNames::TextModelsToParse );
120 '@phan-var CssContent $content';
121 if ( in_array(
$content->getModel(), $textModelsToParse ) ) {
123 $output = MediaWikiServices::getInstance()->getParserFactory()->getInstance()
140 $html = Html::element(
142 [
'class' =>
'mw-code mw-css',
'dir' =>
'ltr' ],
const CONTENT_FORMAT_CSS
For CSS pages.
Content handler for code content such as CSS, JavaScript, JSON, etc.
shouldCallDeprecatedContentTransformMethod(Content $content, $params)
Check if we need to provide content overrides deprecated Content method.
callDeprecatedContentPST(Content $content, PreSaveTransformParams $params)
Provided content overrides deprecated Content::preSaveTransform, call it and return.
Content handler for CSS pages.
fillParserOutput(Content $content, ContentParseParams $cpoParams, ParserOutput &$output)
Fills the provided ParserOutput object with information derived from the content.Unless $generateHtml...
__construct( $modelId=CONTENT_MODEL_CSS)
supportsRedirects()
Returns true if this content model supports redirects.
preSaveTransform(Content $content, PreSaveTransformParams $pstParams)
Returns a $content object with pre-save transformations applied (or the same object if no transformat...
makeRedirectContent(Title $destination, $text='')
Create a redirect that is also valid CSS.
A class containing constants representing the names of configuration variables.
clearWrapperDivClass()
Clears the CSS class to use for the wrapping div, effectively disabling the wrapper div until addWrap...
setText( $text)
Set the text of the ParserOutput.
static makeParserOptionsFromTitleAndModel(PageReference $pageRef, string $contentModel, $context)
Create canonical parser options for a given title and content model.
Base interface for representing page content.