Index: trunk/phase3/docs/hooks.txt |
— | — | @@ -656,8 +656,8 @@ |
657 | 657 | Can be used to set custom CSS/JS |
658 | 658 | $out: OutputPage object |
659 | 659 | |
660 | | -'ShowRawCssJs': When presenting raw CSS and JavaScript during page views |
661 | | -&$text: Text being shown |
| 660 | +'ShowRawCssJs': Customise the output of raw CSS and JavaScript in page views |
| 661 | +$text: Text being shown |
662 | 662 | $title: Title of the custom script/stylesheet page |
663 | 663 | $output: Current OutputPage object |
664 | 664 | |
Index: trunk/phase3/includes/Article.php |
— | — | @@ -783,18 +783,14 @@ |
784 | 784 | // Pages containing custom CSS or JavaScript get special treatment |
785 | 785 | if( $this->mTitle->isCssOrJsPage() || $this->mTitle->isCssJsSubpage() ) { |
786 | 786 | $wgOut->addHtml( wfMsgExt( 'clearyourcache', 'parse' ) ); |
787 | | - $text = $this->mContent; |
788 | 787 | |
789 | | - // Give hooks a chance to do formatting... |
790 | | - if( wfRunHooks( 'ShowRawCssJs', array( &$text, $this->mTitle, $wgOut ) ) ) { |
| 788 | + // Give hooks a chance to customise the output |
| 789 | + if( wfRunHooks( 'ShowRawCssJs', array( $text, $this->mTitle, $wgOut ) ) ) { |
791 | 790 | // Wrap the whole lot in a <pre> and don't parse |
792 | 791 | preg_match( '!\.(css|js)$!u', $this->mTitle->getText(), $m ); |
793 | 792 | $wgOut->addHtml( "<pre class=\"mw-code mw-{$m[1]}\" dir=\"ltr\">\n" ); |
794 | | - $wgOut->addHtml( htmlspecialchars( $text ) ); |
| 793 | + $wgOut->addHtml( htmlspecialchars( $this->mContent ) ); |
795 | 794 | $wgOut->addHtml( "\n</pre>\n" ); |
796 | | - } else { |
797 | | - // Wrap hook output in a <div> with the right direction attribute |
798 | | - $wgOut->addHtml( "<div dir=\"ltr\">\n{$text}\n</div>" ); |
799 | 795 | } |
800 | 796 | |
801 | 797 | } |