* Removed most custom CSS classes
* Now uses .even and .odd CSS classes from sortable JS voodoo when the sortable class is present
* Removed .css file - instead force custom definition in MediaWiki:Common.css
This commit is contained in:
Tim Laqua 2008-04-14 17:22:51 +00:00
parent 09904dbc02
commit b003197ddb
3 changed files with 19 additions and 22 deletions

View file

@ -1,7 +0,0 @@
/* ContributionScores.css */
.contributionscores-wrapper { }
.contributionscores-title { background-color: #aaaaaa; margin-bottom: 0px; padding-left: .4em; }
.contributionscores-tableheadings { background-color: #cccccc; border-bottom: 1px solid #999999; }
.contributionscores-altrow { background-color: #eeeeee; }
.contributionscores-headercell { font-weight: bold; padding-left: .2em; padding-right: .2em; }
.contributionscores-contentcell { padding-left: .2em; padding-right: .2em; }

View file

@ -15,7 +15,7 @@ $wgExtensionCredits['specialpage'][] = array(
'author'=>'Tim Laqua',
'description'=>'Polls wiki database for highest user contribution volume',
'descriptionmsg' => 'contributionscores-desc',
'version'=>'1.7.1'
'version'=>'1.8'
);
define( 'CONTRIBUTIONSCORES_PATH', dirname( __FILE__ ) );
@ -43,7 +43,10 @@ function efContributionScores() {
}
}
# Depreciated in v1.8 - manually add CSS via MediaWiki:Common.css
/*
function efContributionScores_addHeadScripts(&$out) {
$out->addScript( '<link rel="stylesheet" type="text/css" href="' . CONTRIBUTIONSCORES_EXTPATH . '/ContributionScores.css" />' . "\n" );
return true;
}
*/

View file

@ -90,20 +90,20 @@ class ContributionScores extends IncludableSpecialPage
$sortable = in_array('nosort', $opts) ? '' : ' sortable';
$output = "<table class=\"wikitable plainlinks{$sortable}\" >\n".
"<tr class='contributionscores-tableheadings'>\n".
"<td class=\"contributionscores-headercell\">" . wfMsgHtml( 'contributionscores-score' ) . "</td>\n" .
"<td class=\"contributionscores-headercell\">" . wfMsgHtml( 'contributionscores-pages' ) . "</td>\n" .
"<td class=\"contributionscores-headercell\">" . wfMsgHtml( 'contributionscores-changes' ) . "</td>\n" .
"<td class=\"contributionscores-headercell\">" . wfMsgHtml( 'contributionscores-username' ) . "</td>\n";
$output = "<table class=\"wikitable contributionscores plainlinks{$sortable}\" >\n".
"<tr class='header'>\n".
"<td>" . wfMsgHtml( 'contributionscores-score' ) . "</td>\n" .
"<td>" . wfMsgHtml( 'contributionscores-pages' ) . "</td>\n" .
"<td>" . wfMsgHtml( 'contributionscores-changes' ) . "</td>\n" .
"<td>" . wfMsgHtml( 'contributionscores-username' ) . "</td>\n";
$skin =& $wgUser->getSkin();
$altrow = '';
while ( $row = $dbr->fetchObject( $res ) ) {
$output .= "</tr><tr class='{$altrow}'>\n<td class='contributionscores-contentcell'>" .
round($row->wiki_rank,0) . "\n</td><td class='contributionscores-contentcell'>" .
$row->page_count . "\n</td><td class='contributionscores-contentcell'>" .
$row->rev_count . "\n</td><td class='contributionscores-contentcell'>" .
$output .= "</tr><tr class='{$altrow}'>\n<td class='content'>" .
round($row->wiki_rank,0) . "\n</td><td class='content'>" .
$row->page_count . "\n</td><td class='content'>" .
$row->rev_count . "\n</td><td class='content'>" .
$skin->userLink( $row->user_id, $row->user_name );
# Option to not display user tools
@ -111,9 +111,9 @@ class ContributionScores extends IncludableSpecialPage
$output .= $skin->userToolLinks( $row->user_id, $row->user_name );
$output .= "</td>\n";
if ($altrow == '')
$altrow = 'contributionscores-altrow ';
if ( $altrow == '' && !empty($sortable) )
$altrow = 'odd ';
else
$altrow = '';
}
@ -136,7 +136,8 @@ class ContributionScores extends IncludableSpecialPage
function execute( $par ) {
global $wgRequest, $wgVersion, $wgOut, $wgHooks;
$wgHooks['BeforePageDisplay'][] = 'efContributionScores_addHeadScripts';
# Depreciated - manually set styles in MediaWiki:Common.css
# $wgHooks['BeforePageDisplay'][] = 'efContributionScores_addHeadScripts';
if( version_compare( $wgVersion, '1.11', '>=' ) )
wfLoadExtensionMessages( 'ContributionScores' );