28 use Wikimedia\Minify\CSSMin;
46 return CssContent::class;
64 return new $class(
'/* #REDIRECT */@import ' . CSSMin::buildUrlValue( $url ) .
';' );
76 if ( $shouldCallDeprecatedMethod ) {
83 '@phan-var CssContent $content';
86 $services = MediaWikiServices::getInstance();
87 if ( !$services->getUserOptionsLookup()->getBoolOption( $pstParams->
getUser(),
'pst-cssjs' ) ) {
90 $popts->setPreSaveTransform(
false );
94 $pst = $services->getParser()->preSaveTransform(
102 return new $class( $pst );
113 $textModelsToParse = MediaWikiServices::getInstance()->getMainConfig()
114 ->get( MainConfigNames::TextModelsToParse );
115 '@phan-var CssContent $content';
116 if ( in_array(
$content->getModel(), $textModelsToParse ) ) {
118 $output = MediaWikiServices::getInstance()->getParser()
133 [
'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.
static element( $element, $attribs=[], $contents='')
Identical to rawElement(), but HTML-escapes $contents (like Xml::element()).
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.
Represents a title within MediaWiki.
getFullURL( $query='', $query2=false, $proto=PROTO_RELATIVE)
Get a real URL referring to this title, with interwiki link and fragment.
Base interface for content objects.