Remove hardcoded lime colour and reimplement colour-coding with class

This way it can be overridden by skins and stuff. Also, not lime.

Change-Id: I4f788a4c1c70928b9afb55598ebad031b4466e31
This commit is contained in:
isarra 2014-07-18 21:29:23 +00:00
parent fc9b8ce5fd
commit 6fa8bf15df
2 changed files with 14 additions and 10 deletions

4
Interwiki.css Normal file → Executable file
View file

@ -24,6 +24,10 @@ table.mw-interwikitable.body td.mw-interwikitable-modify {
text-align: center;
}
table.mw-interwikitable.body td.mw-interwikitable-local-yes {
background: #afc;
}
/* It's safe enough to assume that URLs are usually LTR. */
/* @noflip */
.mw-interwikitable-url,

20
Interwiki_body.php Normal file → Executable file
View file

@ -49,7 +49,7 @@ class SpecialInterwiki extends SpecialPage {
break;
case 'submit':
if ( !$this->canModify( $out ) ) {
# Error msg added by canModify()
// Error msg added by canModify()
} elseif ( !$request->wasPosted() ||
!$this->getUser()->matchEditToken( $request->getVal( 'wpEditToken' ) )
) {
@ -75,21 +75,21 @@ class SpecialInterwiki extends SpecialPage {
public function canModify( $out = false ) {
global $wgInterwikiCache;
if ( !$this->getUser()->isAllowed( 'interwiki' ) ) {
# Check permissions
// Check permissions
if ( $out ) {
throw new PermissionsError( 'interwiki' );
}
return false;
} elseif ( $wgInterwikiCache ) {
# Editing the interwiki cache is not supported
// Editing the interwiki cache is not supported
if ( $out ) {
$out->addWikiMsg( 'interwiki-cached' );
}
return false;
} elseif ( wfReadOnly() ) {
# Is the database in read-only mode?
// Is the database in read-only mode?
if ( $out ) {
$out->readOnlyPage();
}
@ -330,19 +330,19 @@ class SpecialInterwiki extends SpecialPage {
}
if ( !method_exists( 'Interwiki', 'getAllPrefixes' ) ) {
# version 2.0 is not backwards compatible (but still display nice error)
// version 2.0 is not backwards compatible (but still display nice error)
$this->error( 'interwiki_error' );
return;
}
$iwPrefixes = Interwiki::getAllPrefixes( null );
if ( !is_array( $iwPrefixes ) || count( $iwPrefixes ) === 0 ) {
# If the interwiki table is empty, display an error message
// If the interwiki table is empty, display an error message
$this->error( 'interwiki_error' );
return;
}
# Output the existing Interwiki prefixes table header
// Output the existing Interwiki prefixes table header
$out = '';
$out .= Html::openElement(
'table',
@ -365,7 +365,7 @@ class SpecialInterwiki extends SpecialPage {
$selfTitle = $this->getPageTitle();
# Output the existing Interwiki prefixes table rows
// Output the existing Interwiki prefixes table rows
foreach ( $iwPrefixes as $iwPrefix ) {
$out .= Html::openElement( 'tr', array( 'class' => 'mw-interwikitable-row' ) );
$out .= Html::element( 'td', array( 'class' => 'mw-interwikitable-prefix' ),
@ -378,7 +378,7 @@ class SpecialInterwiki extends SpecialPage {
$attribs = array( 'class' => 'mw-interwikitable-local' );
// Green background for cells with "yes".
if( $iwPrefix['iw_local'] ) {
$attribs['style'] = 'background: lime;';
$attribs['class'] .= ' mw-interwikitable-local-yes';
}
// The messages interwiki_0 and interwiki_1 are used here.
$contents = isset( $iwPrefix['iw_local'] ) ?
@ -388,7 +388,7 @@ class SpecialInterwiki extends SpecialPage {
$attribs = array( 'class' => 'mw-interwikitable-trans' );
// Green background for cells with "yes".
if( $iwPrefix['iw_trans'] ) {
$attribs['style'] = 'background: lime;';
$attribs['class'] .= ' mw-interwikitable-trans-yes';
}
// The messages interwiki_0 and interwiki_1 are used here.
$contents = isset( $iwPrefix['iw_trans'] ) ?