r23669 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23668‎ | r23669 | r23670 >
Date:15:19, 3 July 2007
Author:catrope
Status:old
Tags:
Comment:
apiedit: Merging r23657 into the apiedit branch
Modified paths:
  • /branches/apiedit/phase3 (modified) (history)
  • /branches/apiedit/phase3/RELEASE-NOTES (modified) (history)
  • /branches/apiedit/phase3/docs/hooks.txt (modified) (history)
  • /branches/apiedit/phase3/includes/Article.php (modified) (history)

Diff [purge]

Index: branches/apiedit/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.
Index: branches/apiedit/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: branches/apiedit/phase3/includes/Article.php
@@ -797,12 +797,15 @@
798798 if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) {
799799 $wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) );
800800
801 - // Add classes, give directionality. Do parse it as wikitext
802 - // (bug 10422).
803 - preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
804 - $wgOut->addHtml( "<div class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
805 - $wgOut->addWikiText( $this->mContent );
806 - $wgOut->addHtml( "\n</div>\n" );
 801+ // Give hooks a chance to customise the output
 802+ if( wfRunHooks( 'ShowRawCssJs', array( $this->mContent, $this->mTitle, $wgOut ) ) ) {
 803+ // Wrap the whole lot in a <pre> and don't parse
 804+ preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m );
 805+ $wgOut->addHtml( "<pre class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" );
 806+ $wgOut->addHtml( htmlspecialchars( $this->mContent ) );
 807+ $wgOut->addHtml( "\n</pre>\n" );
 808+ }
 809+
807810 }
808811
809812 elseif ( $rt = Title::newFromRedirect( $text ) ) {
Property changes on: branches/apiedit/phase3
___________________________________________________________________
Modified: svnmerge-integrated
810813 - /trunk/phase3:1-23653
811814 + /trunk/phase3:1-23668

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r23657Revert r23617 per Brionsimetrical23:22, 2 July 2007

Status & tagging log