* (bug 9250) Remove hardcoded minimum image name length of three characters
* Fixed DISPLAYTITLE behaviour to reject titles which don't normalise to the
same title as the current page, and enabled per default
-* (bug 10196) Add classes and dir="ltr" to <div>s wrapping CSS and JS pages
- (new classes: mw-code, mw-css, mw-js)
+* Wrap site CSS and JavaScript in a <pre> tag, like user JS/CSS
+* (bug 10196) Add classes and dir="ltr" to the <pre>s on CSS and JS pages (new
+ classes: mw-code, mw-css, mw-js)
* (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over
usergroup assignment.
* Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information
* (bug 10387) Detect and handle '.php5' extension environments at install time
Patch by Edward Z. Yang.
+* Introduce 'ShowRawCssJs' hook; see docs/hooks.txt for more information
* (bug 10404) Show rights log for the selected user in Special:Userrights
* New javascript for upload page that will show a warning if a file with the
"destination filename" already exists.
-* (bug 10422) Do not wrap user JS/CSS in <pre>; allow it to render as wikitext.
- like site CSS/JS.
* Add 'editsection-brackets' message to allow localization (or removal) of the
brackets in the "[edit]" link for sections.
* (bug 10437) Move texvc styling to shared.css.
Can be used to set custom CSS/JS
$out: OutputPage object
+'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
+$text: Text being shown
+$title: Title of the custom script/stylesheet page
+$output: Current OutputPage object
+
'AjaxAddScript': Called in output page just before the initialisation
of the javascript ajax engine. The hook is only called when ajax
is enabled ( $wgUseAjax = true; ).
More hooks might be available but undocumented, you can execute
-./maintenance/findhooks.php to find hidden one.
+./maintenance/findhooks.php to find hidden one.
\ No newline at end of file
if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) {
$wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) );
- // Add classes, give directionality. Do parse it as wikitext
- // (bug 10422).
- preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
- $wgOut->addHtml( "<div class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
- $wgOut->addWikiText( $this->mContent );
- $wgOut->addHtml( "\n</div>\n" );
+ // Give hooks a chance to customise the output
+ if( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->mTitle, $wgOut ) ) ) {
+ // Wrap the whole lot in a <pre> and don't parse
+ preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
+ $wgOut->addHtml( "<pre class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
+ $wgOut->addHtml( htmlspecialchars( $this->mContent ) );
+ $wgOut->addHtml( "\n</pre>\n" );
+ }
+
}
elseif ( $rt = Title::newFromRedirect( $text ) ) {