Index: branches/apiedit/phase3/RELEASE-NOTES |
— | — | @@ -104,18 +104,18 @@ |
105 | 105 | * (bug 9250) Remove hardcoded minimum image name length of three characters |
106 | 106 | * Fixed DISPLAYTITLE behaviour to reject titles which don't normalise to the |
107 | 107 | 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) |
110 | 111 | * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over |
111 | 112 | usergroup assignment. |
112 | 113 | * Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information |
113 | 114 | * (bug 10387) Detect and handle '.php5' extension environments at install time |
114 | 115 | Patch by Edward Z. Yang. |
| 116 | +* Introduce 'ShowRawCssJs' hook; see docs/hooks.txt for more information |
115 | 117 | * (bug 10404) Show rights log for the selected user in Special:Userrights |
116 | 118 | * New javascript for upload page that will show a warning if a file with the |
117 | 119 | "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. |
120 | 120 | * Add 'editsection-brackets' message to allow localization (or removal) of the |
121 | 121 | brackets in the "[edit]" link for sections. |
122 | 122 | * (bug 10437) Move texvc styling to shared.css. |
Index: branches/apiedit/phase3/docs/hooks.txt |
— | — | @@ -656,9 +656,14 @@ |
657 | 657 | Can be used to set custom CSS/JS |
658 | 658 | $out: OutputPage object |
659 | 659 | |
| 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 | + |
660 | 665 | 'AjaxAddScript': Called in output page just before the initialisation |
661 | 666 | of the javascript ajax engine. The hook is only called when ajax |
662 | 667 | is enabled ( $wgUseAjax = true; ). |
663 | 668 | |
664 | 669 | 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 @@ |
798 | 798 | if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) { |
799 | 799 | $wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) ); |
800 | 800 | |
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 | + |
807 | 810 | } |
808 | 811 | |
809 | 812 | elseif ( $rt = Title::newFromRedirect( $text ) ) { |
Property changes on: branches/apiedit/phase3 |
___________________________________________________________________ |
Modified: svnmerge-integrated |
810 | 813 | - /trunk/phase3:1-23653 |
811 | 814 | + /trunk/phase3:1-23668 |