r23618 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r23617‎ | r23618 | r23619 >
Date:19:58, 1 July 2007
Author:simetrical
Status:old
Tags:
Comment:
Remove function that hooks into ShowRawCssJs, which no longer exists (<source> tags can be added manually, and anyway people were complaining that it caused Firefox to hang on very long JS pages)
Modified paths:
  • /trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php (modified) (history)
  • /trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php (modified) (history)

Diff [purge]

Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.php
@@ -49,7 +49,6 @@
5050 );
5151
5252 $wgAutoloadClasses['SyntaxHighlight_GeSHi'] = dirname( __FILE__ ) . '/SyntaxHighlight_GeSHi.class.php';
53 -$wgHooks['ShowRawCssJs'][] = 'SyntaxHighlight_GeSHi::viewHook';
5453 $wgExtensionFunctions[] = 'efSyntaxHighlight_GeSHiSetup';
5554
5655 /**
@@ -58,4 +57,4 @@
5958 function efSyntaxHighlight_GeSHiSetup() {
6059 global $wgParser;
6160 $wgParser->setHook( 'source', array( 'SyntaxHighlight_GeSHi', 'parserHook' ) );
62 -}
\ No newline at end of file
 61+}
Index: trunk/extensions/SyntaxHighlight_GeSHi/SyntaxHighlight_GeSHi.class.php
@@ -69,34 +69,6 @@
7070 }
7171
7272 /**
73 - * Hook into Article::view() to provide syntax highlighting for
74 - * custom CSS and JavaScript pages
75 - *
76 - * @param string $text
77 - * @param Title $title
78 - * @param OutputPage $output
79 - * @return bool
80 - */
81 - public static function viewHook( $text, $title, $output ) {
82 - // Determine the language
83 - preg_match( '!\.(css|js)$!u', $title->getText(), $matches );
84 - $lang = $matches[1] == 'css' ? 'css' : 'javascript';
85 - // Attempt to format
86 - $geshi = self::prepare( $text, $lang );
87 - if( $geshi instanceof GeSHi ) {
88 - $out = $geshi->parse_code();
89 - if( !$geshi->error() ) {
90 - // Done
91 - $output->addHeadItem( "source-$lang", self::buildHeadItem( $geshi ) );
92 - $output->addHtml( "<div dir=\"ltr\">{$out}</div>" );
93 - return false;
94 - }
95 - }
96 - // Bottle out
97 - return true;
98 - }
99 -
100 - /**
10173 * Initialise a GeSHi object to format some code, performing
10274 * common setup for all our uses of it
10375 *
@@ -205,4 +177,4 @@
206178 }
207179 }
208180
209 -}
\ No newline at end of file
 181+}

Follow-up revisions

RevisionCommit summaryAuthorDate
r23658Revert r23618 per Brion. Now, to get phase3 and extensions in the same repo ...simetrical23:24, 2 July 2007

Status & tagging log