Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -656,14 +656,9 @@ |
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 | | - |
665 | 660 | 'AjaxAddScript': Called in output page just before the initialisation |
666 | 661 | of the javascript ajax engine. The hook is only called when ajax |
667 | 662 | is enabled ( $wgUseAjax = true; ). |
668 | 663 | |
669 | 664 | 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 @@ |
785 | 785 | if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) { |
786 | 786 | $wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) ); |
787 | 787 | |
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" ); |
797 | 794 | } |
798 | 795 | |
799 | 796 | elseif ( $rt = Title::newFromRedirect( $text ) ) { |
Index: trunk/phase3/RELEASE-NOTES |
— | — | @@ -104,17 +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 | | -* 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) |
111 | 110 | * (bug 6711) Add $wgAddGroups and $wgRemoveGroups to allow finer control over |
112 | 111 | usergroup assignment. |
113 | 112 | * Introduce 'UserEffectiveGroups' hook; see docs/hooks.txt for more information |
114 | 113 | * (bug 10387) Detect and handle '.php5' extension environments at install time |
115 | 114 | 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. |
119 | 120 | |
120 | 121 | == Bugfixes since 1.10 == |
121 | 122 | |