r23617 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23616‎ | r23617 | r23618 >
Date:19:57, 1 July 2007
Author:simetrical
Status:old
Tags:
Comment:
* (bug 10422) Change <pre> on CSS/JS pages to <div> and allow wikitext
* Remove now-unused ShowRawCssJs hook, unless someone can think of a reason someone would want to use it when wikitext is allowed inside it

Patch to SyntaxHighlight_GeSHi to come in a moment.
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,14 +656,9 @@
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 -
665660 'AjaxAddScript': Called in output page just before the initialisation
666661 of the javascript ajax engine. The hook is only called when ajax
667662 is enabled ( $wgUseAjax = true; ).
668663
669664 More hooks might be available but undocumented, you can execute
670 -./maintenance/findhooks.php to find hidden one.
\ No newline at end of file
 665+./maintenance/findhooks.php to find hidden one.
Index: trunk/phase3/includes/Article.php
@@ -784,15 +784,12 @@
785785 if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) {
786786 $wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) );
787787
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 -
 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" );
797794 }
798795
799796 elseif ( $rt = Title::newFromRedirect( $text ) ) {
Index: trunk/phase3/RELEASE-NOTES
@@ -104,17 +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 -* 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)
 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)
111110 * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over
112111 usergroup assignment.
113112 * Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information
114113 * (bug 10387) Detect and handle '.php5' extension environments at install time
115114 Patch by Edward Z. Yang.
116 -* Introduce 'ShowRawCssJs' hook; see docs/hooks.txt for more information
117 -* (bug 10404) Show rights log fragment for the selected user in Special:Userrights
118 -* New javascript for upload page that will show a warning if a file with the "destination filename" already exists.
 115+* (bug 10404) Show rights log for the selected user in Special:Userrights
 116+* New javascript for upload page that will show a warning if a file with the
 117+ "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.
119120
120121 == Bugfixes since 1.10 ==
121122

Follow-up revisions

RevisionCommit summaryAuthorDate
r23657Revert r23617 per Brionsimetrical23:22, 2 July 2007
r23662Merged revisions 23581-23661 via svnmerge from...david03:01, 3 July 2007

Status & tagging log