r23657 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23656‎ | r23657 | r23658 >
Date:23:22, 2 July 2007
Author:simetrical
Status:old
Tags:
Comment:
Revert r23617 per Brion
Modified paths:
  • /trunk/phase3/RELEASE-NOTES (modified) (history)
  • /trunk/phase3/docs/hooks.txt (modified) (history)
  • /trunk/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: trunk/phase3/docs/hooks.txt
@@ -656,9 +656,14 @@
657657 Can be used to set custom CSS/JS
658658 $out: OutputPage object
659659
 660+'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views
 661+$text: Text being shown
 662+$title: Title of the custom script/stylesheet page
 663+$output: Current OutputPage object
 664+
660665 'AjaxAddScript': Called in output page just before the initialisation
661666 of the javascript ajax engine. The hook is only called when ajax
662667 is enabled ( $wgUseAjax = true; ).
663668
664669 More hooks might be available but undocumented, you can execute
665 -./maintenance/findhooks.php to find hidden one.
 670+./maintenance/findhooks.php to find hidden one.
\ No newline at end of file
Index: trunk/phase3/includes/Article.php
@@ -784,12 +784,15 @@
785785 if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) {
786786 $wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) );
787787
788 - // Add classes, give directionality. Do parse it as wikitext
789 - // (bug 10422).
790 - preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
791 - $wgOut->addHtml( "<div class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
792 - $wgOut->addWikiText( $this->mContent );
793 - $wgOut->addHtml( "\n</div>\n" );
 788+ // Give hooks a chance to customise the output
 789+ if( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->mTitle, $wgOut ) ) ) {
 790+ // Wrap the whole lot in a <pre> and don't parse
 791+ preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
 792+ $wgOut->addHtml( "<pre class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
 793+ $wgOut->addHtml( htmlspecialchars( $this->mContent ) );
 794+ $wgOut->addHtml( "\n</pre>\n" );
 795+ }
 796+
794797 }
795798
796799 elseif ( $rt = Title::newFromRedirect( $text ) ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -104,18 +104,18 @@
105105 * (bug 9250) Remove hardcoded minimum image name length of three characters
106106 * Fixed DISPLAYTITLE behaviour to reject titles which don't normalise to the
107107 same title as the current page, and enabled per default
108 -* (bug 10196) Add classes and dir="ltr" to <div>s wrapping CSS and JS pages
109 - (new classes: mw-code, mw-css, mw-js)
 108+* Wrap site CSS and JavaScript in a <pre> tag, like user JS/CSS
 109+* (bug 10196) Add classes and dir="ltr" to the <pre>s on CSS and JS pages (new
 110+ classes: mw-code, mw-css, mw-js)
110111 * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over
111112 usergroup assignment.
112113 * Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information
113114 * (bug 10387) Detect and handle '.php5' extension environments at install time
114115 Patch by Edward Z. Yang.
 116+* Introduce 'ShowRawCssJs' hook; see docs/hooks.txt for more information
115117 * (bug 10404) Show rights log for the selected user in Special:Userrights
116118 * New javascript for upload page that will show a warning if a file with the
117119 "destination filename" already exists.
118 -* (bug 10422) Do not wrap user JS/CSS in <pre>; allow it to render as wikitext.
119 - like site CSS/JS.
120120 * Add 'editsection-brackets' message to allow localization (or removal) of the
121121 brackets in the "[edit]" link for sections.
122122 * (bug 10437) Move texvc styling to shared.css.

Follow-up revisions

RevisionCommit summaryAuthorDate
r23662Merged revisions 23581-23661 via svnmerge from...david03:01, 3 July 2007
r23669apiedit: Merging r23657 into the apiedit branchcatrope15:19, 3 July 2007

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r23617* (bug 10422) Change <pre> on CSS/JS pages to <div> and allow wikitext...simetrical19:57, 1 July 2007

Status & tagging log