r43991 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r43990‎ | r43991 | r43992 >
Date:07:53, 27 November 2008
Author:aaron
Status:reverted (Comments)
Tags:
Comment:
(bug 16049) Editable stylesheet location for CodeReview
Modified paths:
  • /trunk/extensions/CodeReview/CodeReview.php (modified) (history)
  • /trunk/extensions/CodeReview/CodeRevisionView.php (modified) (history)
  • /trunk/extensions/CodeReview/SpecialCode.php (modified) (history)

Diff [purge]

Index: trunk/extensions/CodeReview/SpecialCode.php
@@ -7,12 +7,17 @@
88 }
99
1010 function execute( $subpage ) {
11 - global $wgOut, $wgRequest, $wgUser, $wgScriptPath, $wgCodeReviewStyleVersion;
 11+ global $wgOut, $wgRequest, $wgUser, $wgScriptPath;
1212
1313 wfLoadExtensionMessages( 'CodeReview' );
1414
1515 $this->setHeaders();
16 - $wgOut->addStyle( "$wgScriptPath/extensions/CodeReview/codereview.css?$wgCodeReviewStyleVersion" );
 16+ global $wgCodeReviewStylePath, $wgCodeReviewStyleVersion;
 17+ $stylePath = str_replace( '$wgScriptPath', $wgScriptPath, $wgCodeReviewStylePath );
 18+ $encCssFile = htmlspecialchars( "$stylePath/codereview.css?$wgCodeReviewStyleVersion" );
 19+ $encJsFile = htmlspecialchars( "$stylePath/codereview.js?$wgCodeReviewStyleVersion" );
 20+ $wgOut->addExtensionStyle( $encCssFile );
 21+ $wgOut->addScriptFile( "$wgScriptPath/extensions/CodeReview/codereview.js" );
1722
1823 if( $subpage == '' ) {
1924 $view = new CodeRepoListView();
Index: trunk/extensions/CodeReview/CodeRevisionView.php
@@ -296,7 +296,6 @@
297297 global $wgOut, $wgScriptPath;
298298 $encRepo = Xml::encodeJsVar( $this->mRepo->getName() );
299299 $encRev = Xml::encodeJsVar( $this->mRev->getId() );
300 - $wgOut->addScriptFile( "$wgScriptPath/extensions/CodeReview/codereview.js" );
301300 $wgOut->addInlineScript(
302301 "addOnloadHook(
303302 function() {
Index: trunk/extensions/CodeReview/CodeReview.php
@@ -96,6 +96,8 @@
9797 $wgSubversionProxy = false;
9898 $wgSubversionProxyTimeout = 30; // default 3 secs is too short :)
9999
 100+# Use a literal $wgScriptPath as a placeholder for the runtime value of $wgScriptPath
 101+$wgCodeReviewStylePath = '$wgScriptPath/extensions/CodeReview';
100102
101103 $wgCodeReviewStyleVersion = 3;
102104 // The name of a repo which represents the code running on this wiki, used to highlight active revisions

Follow-up revisions

RevisionCommit summaryAuthorDate
r44459Revert r43991 "(bug 16049) Editable stylesheet location for CodeReview"...brion19:03, 11 December 2008

Comments

#Comment by Brion VIBBER (talk | contribs)   19:04, 11 December 2008

This doesn't seem to do what was requested in the bug -- the bug asked for an on-wiki editable CSS page, like the GeSHI syntax highlighting extension has.

This is providing a LocalSettings.php-level override for the location of the extensions directory where the CSS and JS files are to be loaded... which shouldn't be needed, and if it were it should be a general system for all extensions to be able to use (eg to pull extension styles from a static server, the way we can override the wiki's core style path)

Reverted in r44459.

Status & tagging log