mirror of
https://gerrit.wikimedia.org/r/mediawiki/extensions/Interwiki
synced 2024-11-27 15:50:32 +00:00
(bug 36900) Partial cleanup
This commit includes simple minor cleanups for Bug 36900 and a few other issues that I found. A fix for the message escaping will be committed separately. * Little punctuation cleanup in English messages. * Minor CSS cleanup for RTL. * Changed == to ===. * Adding .gitignore. Change-Id: I9d1be93b10173caa54ae56fb1b0733533a3687e2
This commit is contained in:
parent
1789144003
commit
e7a62478da
4
.gitignore
vendored
Normal file
4
.gitignore
vendored
Normal file
|
@ -0,0 +1,4 @@
|
|||
.svn
|
||||
*~
|
||||
*.kate-swp
|
||||
.*.swp
|
|
@ -23,13 +23,13 @@ table.mw-interwikitable.body td.mw-interwikitable-trans,
|
|||
table.mw-interwikitable.body td.mw-interwikitable-modify {
|
||||
text-align: center;
|
||||
}
|
||||
/* @noflip */ .mw-interwikitable-url {
|
||||
text-align: left;
|
||||
}
|
||||
/* @noflip */ input#mw-interwiki-url {
|
||||
|
||||
/* It's safe enough to assume that URLs are usually LTR. */
|
||||
/* @noflip */ .mw-interwikitable-url, input#mw-interwiki-url {
|
||||
text-align: left;
|
||||
direction: ltr;
|
||||
}
|
||||
|
||||
.mw-interwikitable-modify {
|
||||
white-space: nowrap;
|
||||
}
|
||||
|
|
|
@ -39,12 +39,12 @@ $messages['en'] = array(
|
|||
'interwiki_local' => 'Forward',
|
||||
'interwiki-local-label' => 'Forward:',
|
||||
'interwiki_local_intro' => 'An HTTP request to the local wiki with this interwiki prefix in the URL is:',
|
||||
'interwiki_local_0_intro' => 'not honored, usually blocked by "page not found",',
|
||||
'interwiki_local_1_intro' => 'redirected to the target URL given in the interwiki link definitions (i.e. treated like references in local pages)',
|
||||
'interwiki_local_0_intro' => 'not honored, usually blocked by "page not found".',
|
||||
'interwiki_local_1_intro' => 'redirected to the target URL given in the interwiki link definitions (i.e. treated like references in local pages).',
|
||||
'interwiki_trans' => 'Transclude',
|
||||
'interwiki-trans-label' => 'Transclude:',
|
||||
'interwiki_trans_intro' => 'If wikitext syntax <code>{<nowiki />{prefix:<i>pagename</i>}}</code> is used, then:',
|
||||
'interwiki_trans_1_intro' => 'allow transclusion from the foreign wiki, if interwiki transclusions are generally permitted in this wiki,',
|
||||
'interwiki_trans_1_intro' => 'allow transclusion from the foreign wiki, if interwiki transclusions are generally permitted in this wiki.',
|
||||
'interwiki_trans_0_intro' => 'do not allow it, rather look for a page in the template namespace.',
|
||||
'interwiki_intro_footer' => 'See [//www.mediawiki.org/wiki/Manual:Interwiki_table MediaWiki.org] for more information about the interwiki table.
|
||||
There is a [[Special:Log/interwiki|log of changes]] to the interwiki table.',
|
||||
|
|
|
@ -102,13 +102,13 @@ class SpecialInterwiki extends SpecialPage {
|
|||
$label = array( 'class' => 'mw-label' );
|
||||
$input = array( 'class' => 'mw-input' );
|
||||
|
||||
if ( $action == 'delete' ) {
|
||||
if ( $action === 'delete' ) {
|
||||
$topmessage = $this->msg( 'interwiki_delquestion', $prefix )->text();
|
||||
$intromessage = $this->msg( 'interwiki_deleting', $prefix )->text();
|
||||
$wpPrefix = Html::hidden( 'wpInterwikiPrefix', $prefix );
|
||||
$button = 'delete';
|
||||
$formContent = '';
|
||||
} elseif ( $action == 'edit' ) {
|
||||
} elseif ( $action === 'edit' ) {
|
||||
$dbr = wfGetDB( DB_SLAVE );
|
||||
$row = $dbr->selectRow( 'interwiki', '*', array( 'iw_prefix' => $prefix ), __METHOD__ );
|
||||
|
||||
|
@ -125,7 +125,7 @@ class SpecialInterwiki extends SpecialPage {
|
|||
$topmessage = $this->msg( 'interwiki_edittext' )->text();
|
||||
$intromessage = $this->msg( 'interwiki_editintro' )->text();
|
||||
$button = 'edit';
|
||||
} elseif ( $action == 'add' ) {
|
||||
} elseif ( $action === 'add' ) {
|
||||
$prefix = $request->getVal( 'wpInterwikiPrefix', $request->getVal( 'prefix' ) );
|
||||
$prefix = Xml::input( 'wpInterwikiPrefix', 20, $prefix,
|
||||
array( 'tabindex' => 1, 'id' => 'mw-interwiki-prefix', 'maxlength' => 20 ) );
|
||||
|
@ -137,7 +137,7 @@ class SpecialInterwiki extends SpecialPage {
|
|||
$button = 'interwiki_addbutton';
|
||||
}
|
||||
|
||||
if ( $action == 'add' || $action == 'edit' ) {
|
||||
if ( $action === 'add' || $action === 'edit' ) {
|
||||
$formContent = Html::rawElement( 'tr', null,
|
||||
Html::element( 'td', $label, $this->msg( 'interwiki-prefix-label' )->text() ) .
|
||||
Html::rawElement( 'td', null, '<tt>' . $prefix . '</tt>' )
|
||||
|
@ -182,7 +182,7 @@ class SpecialInterwiki extends SpecialPage {
|
|||
$prefix = $request->getVal( 'wpInterwikiPrefix' );
|
||||
$do = $request->getVal( 'wpInterwikiAction' );
|
||||
// show an error if the prefix is invalid (only when adding one)
|
||||
if ( preg_match( '/[\s:&=]/', $prefix ) && $do == 'add' ) {
|
||||
if ( preg_match( '/[\s:&=]/', $prefix ) && $do === 'add' ) {
|
||||
$this->error( 'interwiki-badprefix', htmlspecialchars( $prefix ) );
|
||||
$this->showForm( $do );
|
||||
return;
|
||||
|
@ -194,7 +194,7 @@ class SpecialInterwiki extends SpecialPage {
|
|||
case 'delete':
|
||||
$dbw->delete( 'interwiki', array( 'iw_prefix' => $prefix ), __METHOD__ );
|
||||
|
||||
if ( $dbw->affectedRows() == 0 ) {
|
||||
if ( $dbw->affectedRows() === 0 ) {
|
||||
$this->error( 'interwiki_delfailed', $prefix );
|
||||
$this->showForm( $do );
|
||||
} else {
|
||||
|
@ -217,19 +217,19 @@ class SpecialInterwiki extends SpecialPage {
|
|||
'iw_trans' => $trans
|
||||
);
|
||||
|
||||
if ( $prefix == '' || $theurl == '' ) {
|
||||
if ( $prefix === '' || $theurl === '' ) {
|
||||
$this->error( 'interwiki-submit-empty' );
|
||||
$this->showForm( $do );
|
||||
return;
|
||||
}
|
||||
|
||||
if ( $do == 'add' ) {
|
||||
if ( $do === 'add' ) {
|
||||
$dbw->insert( 'interwiki', $data, __METHOD__, 'IGNORE' );
|
||||
} else {
|
||||
$dbw->update( 'interwiki', $data, array( 'iw_prefix' => $prefix ), __METHOD__, 'IGNORE' );
|
||||
}
|
||||
|
||||
if ( $dbw->affectedRows() == 0 ) {
|
||||
if ( $dbw->affectedRows() === 0 ) {
|
||||
$this->error( "interwiki_{$do}failed", $prefix );
|
||||
$this->showForm( $do );
|
||||
} else {
|
||||
|
@ -273,7 +273,7 @@ class SpecialInterwiki extends SpecialPage {
|
|||
}
|
||||
$iwPrefixes = Interwiki::getAllPrefixes( null );
|
||||
|
||||
if ( !is_array( $iwPrefixes ) || count( $iwPrefixes ) == 0 ) {
|
||||
if ( !is_array( $iwPrefixes ) || count( $iwPrefixes ) === 0 ) {
|
||||
# If the interwiki table is empty, display an error message
|
||||
$this->error( 'interwiki_error' );
|
||||
return;
|
||||
|
|
Loading…
Reference in a new issue