with formatversion=2.
* Various other output from meta=siteinfo will now always be arrays instead of
sometimes being numerically-indexed objects with formatversion=2.
+* When errors about users being blocked are returned, they now include
+ information about the relevant block.
=== Action API internal changes in 1.26 ===
'HTMLFileCache' => __DIR__ . '/includes/cache/HTMLFileCache.php',
'HTMLFloatField' => __DIR__ . '/includes/htmlform/HTMLFloatField.php',
'HTMLForm' => __DIR__ . '/includes/htmlform/HTMLForm.php',
+ 'HTMLFormFieldWithButton' => __DIR__ . '/includes/htmlform/HTMLFormFieldWithButton.php',
'HTMLFormField' => __DIR__ . '/includes/htmlform/HTMLFormField.php',
'HTMLFormFieldCloner' => __DIR__ . '/includes/htmlform/HTMLFormFieldCloner.php',
'HTMLFormFieldRequiredOptionsException' => __DIR__ . '/includes/htmlform/HTMLFormFieldRequiredOptionsException.php',
'HTMLSelectField' => __DIR__ . '/includes/htmlform/HTMLSelectField.php',
'HTMLSelectLimitField' => __DIR__ . '/includes/htmlform/HTMLSelectLimitField.php',
'HTMLSelectNamespace' => __DIR__ . '/includes/htmlform/HTMLSelectNamespace.php',
+ 'HTMLSelectNamespaceWithButton' => __DIR__ . '/includes/htmlform/HTMLSelectNamespaceWithButton.php',
'HTMLSelectOrOtherField' => __DIR__ . '/includes/htmlform/HTMLSelectOrOtherField.php',
'HTMLSubmitField' => __DIR__ . '/includes/htmlform/HTMLSubmitField.php',
'HTMLTagFilter' => __DIR__ . '/includes/htmlform/HTMLTagFilter.php',
'HTMLTextAreaField' => __DIR__ . '/includes/htmlform/HTMLTextAreaField.php',
'HTMLTextField' => __DIR__ . '/includes/htmlform/HTMLTextField.php',
+ 'HTMLTextFieldWithButton' => __DIR__ . '/includes/htmlform/HTMLTextFieldWithButton.php',
'HWLDFWordAccumulator' => __DIR__ . '/includes/diff/DairikiDiff.php',
'HashBagOStuff' => __DIR__ . '/includes/libs/objectcache/HashBagOStuff.php',
'HashConfig' => __DIR__ . '/includes/config/HashConfig.php',
"leafo/lessphp": "0.5.0",
"liuggio/statsd-php-client": "1.0.12",
"mediawiki/at-ease": "1.0.0",
- "oojs/oojs-ui": "0.11.4",
+ "oojs/oojs-ui": "0.11.5",
"php": ">=5.3.3",
"psr/log": "1.0.0",
"wikimedia/cdb": "1.0.1",
$countKey = 'title_' . $title->getPrefixedText();
$countable = $page->isCountable( $editInfo );
if ( array_key_exists( $countKey, $this->countableCache ) &&
- $countable != $this->countableCache[ $countKey ] ) {
+ $countable != $this->countableCache[$countKey] ) {
DeferredUpdates::addUpdate( SiteStatsUpdate::factory( array(
- 'articles' => ( (int)$countable - (int)$this->countableCache[ $countKey ] )
+ 'articles' => ( (int)$countable - (int)$this->countableCache[$countKey] )
) ) );
}
}
$tag = $this->reader->localName;
if ( $tag == 'namespace' ) {
- $this->foreignNamespaces[ $this->nodeAttribute( 'key' ) ] =
+ $this->foreignNamespaces[$this->nodeAttribute( 'key' )] =
$this->nodeContents();
} elseif ( in_array( $tag, $normalFields ) ) {
$siteInfo[$tag] = $this->nodeContents();
/**
* Guess the MIME type from the file contents.
*
+ * @todo Remove $ext param
+ *
* @param string $file
* @param mixed $ext
* @return bool|string
* @throws MWException
*/
- private function doGuessMimeType( $file, $ext ) { // TODO: remove $ext param
+ private function doGuessMimeType( $file, $ext ) {
// Read a chunk of the file
MediaWiki\suppressWarnings();
$f = fopen( $file, 'rb' );
$module = $resourceLoader->getModule( $val );
if ( $module instanceof ResourceLoaderModule && $module->isPositionDefault() ) {
- $warning = __METHOD__ . ': style module should define its position explicitly: ' . $val . ' ' . get_class( $module );
+ $warning = __METHOD__ . ': style module should define its position explicitly: ' .
+ $val . ' ' . get_class( $module );
wfDebugLog( 'resourceloader', $warning );
wfLogWarning( $warning );
}
// Default value is 2000 or the suhosin limit if it is between 1 and 2000
if ( $wgResourceLoaderMaxQueryLength === false ) {
- $suhosinMaxValueLength = (int) ini_get( 'suhosin.get.max_value_length' );
+ $suhosinMaxValueLength = (int)ini_get( 'suhosin.get.max_value_length' );
if ( $suhosinMaxValueLength > 0 && $suhosinMaxValueLength < 2000 ) {
$wgResourceLoaderMaxQueryLength = $suhosinMaxValueLength;
} else {
if ( $user->isBlocked() ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
- $this->dieUsageMsg( array( $status ) );
+ $msg = $this->parseMsg( $status );
+ $this->dieUsage(
+ $msg['info'],
+ $msg['code'],
+ 0,
+ array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) )
+ );
}
}
);
}
if ( $this->getUser()->isBlockedFromCreateAccount() ) {
- $this->dieUsage( 'You cannot create a new account because you are blocked', 'blocked' );
+ $this->dieUsage(
+ 'You cannot create a new account because you are blocked',
+ 'blocked',
+ 0,
+ array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $this->getUser()->getBlock() ) )
+ );
}
$params = $this->extractRequestParams();
$errors = array_merge( $errors, $titleObj->getUserPermissionsErrors( 'create', $user ) );
}
if ( count( $errors ) ) {
- $this->dieUsageMsg( $errors[0] );
+ if ( is_array( $errors[0] ) ) {
+ switch ( $errors[0][0] ) {
+ case 'blockedtext':
+ $this->dieUsage(
+ 'You have been blocked from editing',
+ 'blocked',
+ 0,
+ array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) )
+ );
+ break;
+ case 'autoblockedtext':
+ $this->dieUsage(
+ 'Your IP address has been blocked automatically, because it was used by a blocked user',
+ 'autoblocked',
+ 0,
+ array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) )
+ );
+ break;
+ default:
+ $this->dieUsageMsg( $errors[0] );
+ }
+ } else {
+ $this->dieUsageMsg( $errors[0] );
+ }
}
$toMD5 = $params['text'];
$this->dieUsageMsg( array( 'spamdetected', $result['spam'] ) );
case EditPage::AS_BLOCKED_PAGE_FOR_USER:
- $this->dieUsageMsg( 'blockedtext' );
+ $this->dieUsage(
+ 'You have been blocked from editing',
+ 'blocked',
+ 0,
+ array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) )
+ );
case EditPage::AS_MAX_ARTICLE_SIZE_EXCEEDED:
case EditPage::AS_CONTENT_TOO_BIG:
'Custom' => function ( &$data, &$metadata ) {
if ( isset( $metadata[ApiResult::META_TYPE] ) ) {
// We want to use non-BC for BCassoc to force outputting of _idx.
- switch( $metadata[ApiResult::META_TYPE] ) {
+ switch ( $metadata[ApiResult::META_TYPE] ) {
case 'BCassoc':
$metadata[ApiResult::META_TYPE] = 'assoc';
break;
case LoginForm::CREATE_BLOCKED:
$result['result'] = 'CreateBlocked';
$result['details'] = 'Your IP address is blocked from account creation';
+ $result = array_merge(
+ $result,
+ ApiQueryUserInfo::getBlockInfo( $context->getUser()->getBlock() )
+ );
break;
case LoginForm::THROTTLED:
case LoginForm::USER_BLOCKED:
$result['result'] = 'Blocked';
+ $result = array_merge(
+ $result,
+ ApiQueryUserInfo::getBlockInfo( User::newFromName( $params['name'] )->getBlock() )
+ );
break;
case LoginForm::ABORTED:
? '' : ( $module->getModulePath() . '+' );
$item['submodules'] = array();
foreach ( $item['type'] as $v ) {
- $item['submodules'][$v] = $prefix.$v;
+ $item['submodules'][$v] = $prefix . $v;
}
}
if ( isset( $settings[ApiBase::PARAM_SUBMODULE_PARAM_PREFIX] ) ) {
$result->addValue( 'query', $this->getModuleName(), $r );
}
- protected function getCurrentUserInfo() {
+ /**
+ * Get basic info about a given block
+ * @param Block $block
+ * @return array Array containing several keys:
+ * - blockid - ID of the block
+ * - blockedby - username of the blocker
+ * - blockedbyid - user ID of the blocker
+ * - blockreason - reason provided for the block
+ * - blockedtimestamp - timestamp for when the block was placed/modified
+ * - blockexpiry - expiry time of the block
+ */
+ public static function getBlockInfo( Block $block ) {
global $wgContLang;
+ $vals = array();
+ $vals['blockid'] = $block->getId();
+ $vals['blockedby'] = $block->getByName();
+ $vals['blockedbyid'] = $block->getBy();
+ $vals['blockreason'] = $block->mReason;
+ $vals['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $block->mTimestamp );
+ $vals['blockexpiry'] = $wgContLang->formatExpiry(
+ $block->getExpiry(), TS_ISO_8601, 'infinite'
+ );
+ return $vals;
+ }
+ protected function getCurrentUserInfo() {
$user = $this->getUser();
$result = $this->getResult();
$vals = array();
$vals['anon'] = true;
}
- if ( isset( $this->prop['blockinfo'] ) ) {
- if ( $user->isBlocked() ) {
- $block = $user->getBlock();
- $vals['blockid'] = $block->getId();
- $vals['blockedby'] = $block->getByName();
- $vals['blockedbyid'] = $block->getBy();
- $vals['blockreason'] = $user->blockedFor();
- $vals['blockedtimestamp'] = wfTimestamp( TS_ISO_8601, $block->mTimestamp );
- $vals['blockexpiry'] = $wgContLang->formatExpiry(
- $block->getExpiry(), TS_ISO_8601, 'infinite'
- );
- }
+ if ( isset( $this->prop['blockinfo'] ) && $user->isBlocked() ) {
+ $vals = array_merge( $vals, self::getBlockInfo( $user->getBlock() ) );
}
if ( isset( $this->prop['hasmsg'] ) ) {
if ( $user->isBlocked() ) {
$status = SpecialBlock::checkUnblockSelf( $params['user'], $user );
if ( $status !== true ) {
- $this->dieUsageMsg( $status );
+ $msg = $this->parseMsg( $status );
+ $this->dieUsage(
+ $msg['info'],
+ $msg['code'],
+ 0,
+ array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $user->getBlock() ) )
+ );
}
}
}
if ( $this->getUser()->isBlocked() ) {
- $this->dieUsageMsg( 'blockedtext' );
+ $this->dieUsage(
+ 'You have been blocked from editing',
+ 'blocked',
+ 0,
+ array( 'blockinfo' => ApiQueryUserInfo::getBlockInfo( $this->getUser()->getBlock() ) )
+ );
}
$titleObj = Title::newFromText( $params['title'] );
public function startWrite( $code ) {
$this->currentLang = $code;
- $this->fname = $this->directory. '/' . $code . '.l10n.php';
+ $this->fname = $this->directory . '/' . $code . '.l10n.php';
$this->data[$code] = array();
if ( file_exists( $this->fname ) ) {
$this->data[$code] = require $this->fname;
public function get( $code, $key ) {
if ( !array_key_exists( $code, $this->data ) ) {
- $fname = $this->directory. '/' . $code . '.l10n.php';
+ $fname = $this->directory . '/' . $code . '.l10n.php';
if ( !file_exists( $fname ) ) {
return null;
}
return Status::newFatal( 'tags-manage-no-permission' );
}
- // non-existing tags cannot be activated
- $tagUsage = self::tagUsageStatistics();
- if ( !isset( $tagUsage[$tag] ) ) {
- return Status::newFatal( 'tags-activate-not-found', $tag );
- }
-
// defined tags cannot be activated (a defined tag is either extension-
// defined, in which case the extension chooses whether or not to active it;
// or user-defined, in which case it is considered active)
return Status::newFatal( 'tags-activate-not-allowed', $tag );
}
+ // non-existing tags cannot be activated
+ $tagUsage = self::tagUsageStatistics();
+ if ( !isset( $tagUsage[$tag] ) ) { // we already know the tag is undefined
+ return Status::newFatal( 'tags-activate-not-found', $tag );
+ }
+
return Status::newGood();
}
// does the tag already exist?
$tagUsage = self::tagUsageStatistics();
- if ( isset( $tagUsage[$tag] ) ) {
+ if ( isset( $tagUsage[$tag] ) || in_array( $tag, self::listDefinedTags() ) ) {
return Status::newFatal( 'tags-create-already-exists', $tag );
}
return Status::newFatal( 'tags-manage-no-permission' );
}
- if ( !isset( $tagUsage[$tag] ) ) {
+ if ( !isset( $tagUsage[$tag] ) && !in_array( $tag, self::listDefinedTags() ) ) {
return Status::newFatal( 'tags-delete-not-found', $tag );
}
- if ( $tagUsage[$tag] > self::MAX_DELETE_USES ) {
+ if ( isset( $tagUsage[$tag] ) && $tagUsage[$tag] > self::MAX_DELETE_USES ) {
return Status::newFatal( 'tags-delete-too-many-uses', $tag, self::MAX_DELETE_USES );
}
// store the tag usage statistics
$tagUsage = self::tagUsageStatistics();
+ $hitcount = isset( $tagUsage[$tag] ) ? $tagUsage[$tag] : 0;
// do it!
$deleteResult = self::deleteTagEverywhere( $tag );
}
// log it
- $logId = self::logTagManagementAction( 'delete', $tag, $reason, $user, $tagUsage[$tag] );
+ $logId = self::logTagManagementAction( 'delete', $tag, $reason, $user, $hitcount );
$deleteResult->value = $logId;
return $deleteResult;
}
* @param string $s
* @return string
*/
- public function strencode( $s ) { # Should not be called by us
+ public function strencode( $s ) {
+ // Should not be called by us
+
return str_replace( "'", "''", $s );
}
return pg_unescape_bytea( $b );
}
- function strencode( $s ) { # Should not be called by us
+ function strencode( $s ) {
+ // Should not be called by us
+
return pg_escape_string( $this->mConn, $s );
}
}
} // end DatabasePostgres class
-class PostgresBlob extends Blob {}
+class PostgresBlob extends Blob {
+}
function getLabel() {
if ( $this->mParent instanceof OOUIHTMLForm ) {
return $this->mLabel;
+ } elseif (
+ $this->mParent instanceof HTMLForm &&
+ $this->mParent->getDisplayFormat() === 'div'
+ ) {
+ return '';
} else {
return ' ';
}
public static $typeMappings = array(
'api' => 'HTMLApiField',
'text' => 'HTMLTextField',
+ 'textwithbutton' => 'HTMLTextFieldWithButton',
'textarea' => 'HTMLTextAreaField',
'select' => 'HTMLSelectField',
'radio' => 'HTMLRadioField',
'selectorother' => 'HTMLSelectOrOtherField',
'selectandother' => 'HTMLSelectAndOtherField',
'namespaceselect' => 'HTMLSelectNamespace',
+ 'namespaceselectwithbutton' => 'HTMLSelectNamespaceWithButton',
'tagfilter' => 'HTMLTagFilter',
'submit' => 'HTMLSubmitField',
'hidden' => 'HTMLHiddenField',
'mw-htmlform-nolabel' => ( $label === '' )
);
- $field = Html::rawElement(
- 'div',
- array( 'class' => $outerDivClass ) + $cellAttributes,
- $inputHtml . "\n$errors"
- );
- $divCssClasses = array( "mw-htmlform-field-$fieldType", $this->mClass, $this->mVFormClass, $errorClass );
+ $horizontalLabel = isset( $this->mParams['horizontal-label'] )
+ ? $this->mParams['horizontal-label'] : false;
+
+ if ( $horizontalLabel ) {
+ $field = ' ' . $inputHtml . "\n$errors";
+ } else {
+ $field = Html::rawElement(
+ 'div',
+ array( 'class' => $outerDivClass ) + $cellAttributes,
+ $inputHtml . "\n$errors"
+ );
+ }
+ $divCssClasses = array( "mw-htmlform-field-$fieldType",
+ $this->mClass, $this->mVFormClass, $errorClass );
$wrapperAttributes = array(
'class' => $divCssClasses,
$displayFormat = $this->mParent->getDisplayFormat();
$html = '';
+ $horizontalLabel = isset( $this->mParams['horizontal-label'] )
+ ? $this->mParams['horizontal-label'] : false;
if ( $displayFormat === 'table' ) {
$html =
array( 'class' => 'mw-label' ) + $cellAttributes,
Html::rawElement( 'label', $for, $labelValue ) );
} elseif ( $hasLabel || $this->mShowEmptyLabels ) {
- if ( $displayFormat === 'div' ) {
+ if ( $displayFormat === 'div' && !$horizontalLabel ) {
$html =
Html::rawElement( 'div',
array( 'class' => 'mw-label' ) + $cellAttributes,
--- /dev/null
+<?php
+/**
+ * Enables HTMLFormField elements to be build with a button.
+ */
+class HTMLFormFieldWithButton extends HTMLFormField {
+ /** @var string $mButtonClass CSS class for the button in this field */
+ protected $mButtonClass = '';
+
+ /** @var string|integer $mButtonId Element ID for the button in this field */
+ protected $mButtonId = '';
+
+ /** @var string $mButtonName Name the button in this field */
+ protected $mButtonName = '';
+
+ /** @var string $mButtonType Type of the button in this field (e.g. button or submit) */
+ protected $mButtonType = 'submit';
+
+ /** @var string $mButtonType Value for the button in this field */
+ protected $mButtonValue;
+
+ public function __construct( $info ) {
+ if ( isset( $info['buttonclass'] ) ) {
+ $this->mButtonClass = $info['buttonclass'];
+ }
+ if ( isset( $info['buttonid'] ) ) {
+ $this->mButtonId = $info['buttonid'];
+ }
+ if ( isset( $info['buttonname'] ) ) {
+ $this->mButtonName = $info['buttonname'];
+ }
+ if ( isset( $info['buttondefault'] ) ) {
+ $this->mButtonValue = $info['buttondefault'];
+ }
+ if ( isset( $info['buttontype'] ) ) {
+ $this->mButtonType = $info['buttontype'];
+ }
+ parent::__construct( $info );
+ }
+
+ public function getInputHTML( $value ) {
+ $attr = array(
+ 'class' => 'mw-htmlform-submit ' . $this->mButtonClass,
+ 'id' => $this->mButtonId,
+ ) + $this->getAttributes( array( 'disabled', 'tabindex' ) );
+
+ return Html::input( $this->mButtonName, $this->mButtonValue, $this->mButtonType, $attr );
+ }
+
+ /**
+ * Combines the passed element with a button.
+ * @param String $element Element to combine the button with.
+ * @return String
+ */
+ public function getElement( $element ) {
+ return $element . ' ' . $this->getInputHTML( '' );
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Creates a Html::namespaceSelector input field with a button assigned to the input field.
+ */
+class HTMLSelectNamespaceWithButton extends HTMLSelectNamespace {
+ /** @var HTMLFormClassWithButton $mClassWithButton */
+ protected $mClassWithButton = null;
+
+ public function __construct( $info ) {
+ $this->mClassWithButton = new HTMLFormFieldWithButton( $info );
+ parent::__construct( $info );
+ }
+
+ public function getInputHTML( $value ) {
+ return $this->mClassWithButton->getElement( parent::getInputHTML( $value ) );
+ }
+}
\ No newline at end of file
--- /dev/null
+<?php
+/**
+ * Creates a text input field with a button assigned to the input field.
+ */
+class HTMLTextFieldWithButton extends HTMLTextField {
+ /** @var HTMLFormClassWithButton $mClassWithButton */
+ protected $mClassWithButton = null;
+
+ public function __construct( $info ) {
+ $this->mClassWithButton = new HTMLFormFieldWithButton( $info );
+ parent::__construct( $info );
+ }
+
+ public function getInputHTML( $value ) {
+ return $this->mClassWithButton->getElement( parent::getInputHTML( $value ) );
+ }
+}
\ No newline at end of file
/**
* @param array $params
*/
- public function __construct( array $params ) {}
+ public function __construct( array $params ) {
+ }
/**
* @param string $channel
*
* @ingroup Exception
*/
-class MediaTransformInvalidParametersException extends MWException {}
+class MediaTransformInvalidParametersException extends MWException {
+}
return $result;
}
-
-
/**
* @param string $key
* @param mixed $value
* @return string|bool String containing article contents, or false if null
* @deprecated since 1.21, use WikiPage::getContent() instead
*/
- function fetchContent() { #BC cruft!
+ function fetchContent() {
+ // BC cruft!
+
ContentHandler::deprecated( __METHOD__, '1.21' );
if ( $this->mContentLoaded && $this->mContent ) {
*
* @param string $name Name of the function to profile
*/
- public function __construct( $name ) {}
+ public function __construct( $name ) {
+ }
}
}
// Kept BC for now, remove when possible
- public function profileIn( $functionname ) {}
- public function profileOut( $functionname ) {}
+ public function profileIn( $functionname ) {
+ }
+
+ public function profileOut( $functionname ) {
+ }
/**
* Mark the start of a custom profiling frame (e.g. DB queries).
if ( !is_array( $info ) ) {
throw new Exception( "$path is not a valid JSON file." );
}
- if ( !isset( $info['manifest_version' ] ) ) {
+ if ( !isset( $info['manifest_version'] ) ) {
// For backwards-compatability, assume a version of 1
$info['manifest_version'] = 1;
}
$module = array(
$name,
$scripts,
- (object) $styles,
- (object) $messages,
- (object) $templates,
+ (object)$styles,
+ (object)$messages,
+ (object)$templates,
);
self::trimArray( $module );
$modules = $request->getVal( 'modules' );
$this->modules = $modules ? self::expandModuleNames( $modules ) : array();
-
// Various parameters
$this->user = $request->getVal( 'user' );
$this->debug = $request->getFuzzyBool(
if ( strpos( $langList, ',' ) !== false ) {
$this->descriptor['lang'] += array_fill_keys(
explode( ',', $langList ),
- $this->descriptor['lang'][ $langList ]
+ $this->descriptor['lang'][$langList]
);
- unset( $this->descriptor['lang'][ $langList ] );
+ unset( $this->descriptor['lang'][$langList] );
}
}
}
$desc = $this->descriptor;
if ( is_string( $desc ) ) {
return $this->basePath . '/' . $desc;
- } elseif ( isset( $desc['lang'][ $context->getLanguage() ] ) ) {
- return $this->basePath . '/' . $desc['lang'][ $context->getLanguage() ];
- } elseif ( isset( $desc[ $context->getDirection() ] ) ) {
- return $this->basePath . '/' . $desc[ $context->getDirection() ];
+ } elseif ( isset( $desc['lang'][$context->getLanguage()] ) ) {
+ return $this->basePath . '/' . $desc['lang'][$context->getLanguage()];
+ } elseif ( isset( $desc[$context->getDirection()] ) ) {
+ return $this->basePath . '/' . $desc[$context->getDirection()];
} else {
return $this->basePath . '/' . $desc['default'];
}
* // List of image files and their options
* 'images' => array(
* [theme name] => array(
- * [file path string],
- * [file path string] => array(
- * 'name' => [image name string, defaults to file name],
+ * [icon name] => array(
+ * 'file' => [file path string or array whose values are file path strings
+ * and whose keys are 'default', 'ltr', 'rtl', a single
+ * language code like 'en', or a list of language codes like
+ * 'en,de,ar'],
* 'variants' => [array of variant name strings, variants
* available for this image],
* ),
$this->loadFromDefinition();
$this->imageObjects = array();
}
- if ( !isset( $this->imageObjects[ $skin ] ) ) {
- $this->imageObjects[ $skin ] = array();
- if ( !isset( $this->images[ $skin ] ) ) {
- $this->images[ $skin ] = isset( $this->images[ 'default' ] ) ?
- $this->images[ 'default' ] :
+ if ( !isset( $this->imageObjects[$skin] ) ) {
+ $this->imageObjects[$skin] = array();
+ if ( !isset( $this->images[$skin] ) ) {
+ $this->images[$skin] = isset( $this->images['default'] ) ?
+ $this->images['default'] :
array();
}
- foreach ( $this->images[ $skin ] as $name => $options ) {
+ foreach ( $this->images[$skin] as $name => $options ) {
$fileDescriptor = is_string( $options ) ? $options : $options['file'];
$allowedVariants = array_merge(
is_array( $options ) && isset( $options['variants'] ) ? $options['variants'] : array(),
$this->getGlobalVariants( $context )
);
- if ( isset( $this->variants[ $skin ] ) ) {
+ if ( isset( $this->variants[$skin] ) ) {
$variantConfig = array_intersect_key(
- $this->variants[ $skin ],
+ $this->variants[$skin],
array_fill_keys( $allowedVariants, true )
);
} else {
$this->localBasePath,
$variantConfig
);
- $this->imageObjects[ $skin ][ $image->getName() ] = $image;
+ $this->imageObjects[$skin][$image->getName()] = $image;
}
}
- return $this->imageObjects[ $skin ];
+ return $this->imageObjects[$skin];
}
/**
$this->loadFromDefinition();
$this->globalVariants = array();
}
- if ( !isset( $this->globalVariants[ $skin ] ) ) {
- $this->globalVariants[ $skin ] = array();
- if ( !isset( $this->variants[ $skin ] ) ) {
- $this->variants[ $skin ] = isset( $this->variants[ 'default' ] ) ?
- $this->variants[ 'default' ] :
+ if ( !isset( $this->globalVariants[$skin] ) ) {
+ $this->globalVariants[$skin] = array();
+ if ( !isset( $this->variants[$skin] ) ) {
+ $this->variants[$skin] = isset( $this->variants['default'] ) ?
+ $this->variants['default'] :
array();
}
- foreach ( $this->variants[ $skin ] as $name => $config ) {
+ foreach ( $this->variants[$skin] as $name => $config ) {
if ( isset( $config['global'] ) && $config['global'] ) {
- $this->globalVariants[ $skin ][] = $name;
+ $this->globalVariants[$skin][] = $name;
}
}
}
- return $this->globalVariants[ $skin ];
+ return $this->globalVariants[$skin];
}
/**
// Cache this expensive operation. This calls builds the scripts, styles, and messages
// content which typically involves filesystem and/or database access.
if ( !array_key_exists( $contextHash, $this->contents ) ) {
- $this->contents[ $contextHash ] = $this->buildContent( $context );
+ $this->contents[$contextHash] = $this->buildContent( $context );
}
- return $this->contents[ $contextHash ];
+ return $this->contents[$contextHash];
}
/**
$str .= strval( $mhash );
}
- $this->versionHash[ $contextHash ] = ResourceLoader::makeHash( $str );
+ $this->versionHash[$contextHash] = ResourceLoader::makeHash( $str );
}
- return $this->versionHash[ $contextHash ];
+ return $this->versionHash[$contextHash];
}
/**
array_walk( $data['images'], function ( &$value ) use ( $fixPath ) {
if ( is_string( $value['file'] ) ) {
$fixPath( $value['file'] );
- } else if ( is_array( $value['file'] ) ) {
+ } elseif ( is_array( $value['file'] ) ) {
array_walk_recursive( $value['file'], $fixPath );
}
} );
'(min-resolution: 1.5dppx), ' .
'(min-resolution: 144dpi)'
][] = '.mw-wiki-logo { background-image: ' .
- CSSMin::buildUrlValue( $logoHD['1.5x'] ) .';' .
+ CSSMin::buildUrlValue( $logoHD['1.5x'] ) . ';' .
'background-size: 135px auto; }';
}
if ( isset( $logoHD['2x'] ) ) {
$styles[
'(-webkit-min-device-pixel-ratio: 2), ' .
- '(min--moz-device-pixel-ratio: 2),'.
+ '(min--moz-device-pixel-ratio: 2),' .
'(min-resolution: 2dppx), ' .
'(min-resolution: 192dpi)'
][] = '.mw-wiki-logo { background-image: ' .
// Pre-populate versionHash with something because the loop over all modules below includes
// the startup module (this module).
// See ResourceLoaderModule::getVersionHash() for usage of this cache.
- $this->versionHash[ $context->getHash() ] = null;
+ $this->versionHash[$context->getHash()] = null;
return $rl->getCombinedVersion( $context, $rl->getModuleNames() );
}
}
return $this->msg( 'retrievedfrom' )
- ->rawParams( '<a dir="ltr" href="' . $url. '">' . $url . '</a>' )
+ ->rawParams( '<a dir="ltr" href="' . $url . '">' . $url . '</a>' )
->parse();
}
if ( file_exists( "$IP/skins/$skin/skin.json" ) ) {
return "wfLoadSkin( '$skin' );";
} else {
- return "require_once \"\$IP/skins/$skin/$skin.php\";";
+ return "require_once \"\$IP/skins/$skin/$skin.php\";";
}
}
$categoryName = '';
}
- $form = Xml::openElement( 'form', array( 'method' => 'post',
- 'action' => $this->getPageTitle()->getLocalURL( 'action=submit' ) ) );
- $form .= Xml::inputLabel(
- $this->msg( 'export-addcattext' )->text(),
- 'catname',
- 'catname',
- 40,
- $categoryName
- ) . ' ';
- $form .= Xml::submitButton(
- $this->msg( 'export-addcat' )->text(),
- array( 'name' => 'addcat' )
- ) . '<br />';
-
+ $formDescriptor = array(
+ 'catname' => array(
+ 'type' => 'textwithbutton',
+ 'name' => 'catname',
+ 'horizontal-label' => true,
+ 'label-message' => 'export-addcattext',
+ 'default' => $categoryName,
+ 'size' => 40,
+ 'buttontype' => 'submit',
+ 'buttonname' => 'addcat',
+ 'buttondefault' => $this->msg( 'export-addcat' )->text(),
+ ),
+ );
if ( $config->get( 'ExportFromNamespaces' ) ) {
- $form .= Html::namespaceSelector(
- array(
- 'selected' => $nsindex,
- 'label' => $this->msg( 'export-addnstext' )->text()
- ), array(
+ $formDescriptor += array(
+ 'nsindex' => array(
+ 'type' => 'namespaceselectwithbutton',
+ 'default' => $nsindex,
+ 'label-message' => 'export-addnstext',
+ 'horizontal-label' => true,
'name' => 'nsindex',
'id' => 'namespace',
- 'class' => 'namespaceselector',
- )
- ) . ' ';
- $form .= Xml::submitButton(
- $this->msg( 'export-addns' )->text(),
- array( 'name' => 'addns' )
- ) . '<br />';
+ 'cssclass' => 'namespaceselector',
+ 'buttontype' => 'submit',
+ 'buttonname' => 'addns',
+ 'buttondefault' => $this->msg( 'export-addns' )->text(),
+ ),
+ );
}
if ( $config->get( 'ExportAllowAll' ) ) {
- $form .= Xml::checkLabel(
- $this->msg( 'exportall' )->text(),
- 'exportall',
- 'exportall',
- $request->wasPosted() ? $request->getCheck( 'exportall' ) : false
- ) . '<br />';
+ $formDescriptor += array(
+ 'exportall' => array(
+ 'type' => 'check',
+ 'label-message' => 'exportall',
+ 'name' => 'exportall',
+ 'id' => 'exportall',
+ 'default' => $request->wasPosted() ? $request->getCheck( 'exportall' ) : false,
+ ),
+ );
}
- $form .= Xml::element(
- 'textarea',
- array( 'name' => 'pages', 'cols' => 40, 'rows' => 10 ),
- $page,
- false
+ $formDescriptor += array(
+ 'textarea' => array(
+ 'class' => 'HTMLTextAreaField',
+ 'name' => 'pages',
+ 'nodata' => true,
+ 'cols' => 40,
+ 'rows' => 10,
+ 'default' => $page,
+ ),
);
- $form .= '<br />';
if ( $config->get( 'ExportAllowHistory' ) ) {
- $form .= Xml::checkLabel(
- $this->msg( 'exportcuronly' )->text(),
- 'curonly',
- 'curonly',
- $request->wasPosted() ? $request->getCheck( 'curonly' ) : true
- ) . '<br />';
+ $formDescriptor += array(
+ 'curonly' => array(
+ 'type' => 'check',
+ 'label-message' => 'exportcuronly',
+ 'name' => 'curonly',
+ 'id' => 'curonly',
+ 'default' => $request->wasPosted() ? $request->getCheck( 'curonly' ) : true,
+ ),
+ );
} else {
$out->addWikiMsg( 'exportnohistory' );
}
- $form .= Xml::checkLabel(
- $this->msg( 'export-templates' )->text(),
- 'templates',
- 'wpExportTemplates',
- $request->wasPosted() ? $request->getCheck( 'templates' ) : false
- ) . '<br />';
+ $formDescriptor += array(
+ 'templates' => array(
+ 'type' => 'check',
+ 'label-message' => 'export-templates',
+ 'name' => 'templates',
+ 'id' => 'wpExportTemplates',
+ 'default' => $request->wasPosted() ? $request->getCheck( 'templates' ) : false,
+ ),
+ );
if ( $config->get( 'ExportMaxLinkDepth' ) || $this->userCanOverrideExportDepth() ) {
- $form .= Xml::inputLabel(
- $this->msg( 'export-pagelinks' )->text(),
- 'pagelink-depth',
- 'pagelink-depth',
- 20,
- 0
- ) . '<br />';
+ $formDescriptor += array(
+ 'pagelink-depth' => array(
+ 'type' => 'text',
+ 'name' => 'pagelink-depth',
+ 'id' => 'pagelink-depth',
+ 'label-message' => 'export-pagelinks',
+ 'default' => '0',
+ 'size' => 20,
+ ),
+ );
}
- /* Enable this when we can do something useful exporting/importing image information.
- $form .= Xml::checkLabel(
- $this->msg( 'export-images' )->text(),
- 'images',
- 'wpExportImages',
- false
- ) . '<br />';
- */
- $form .= Xml::checkLabel(
- $this->msg( 'export-download' )->text(),
- 'wpDownload',
- 'wpDownload',
- $request->wasPosted() ? $request->getCheck( 'wpDownload' ) : true
- ) . '<br />';
+ $formDescriptor += array(
+ /* Enable this when we can do something useful exporting/importing image information.
+ 'images' => array(
+ 'type' => 'check',
+ 'name' => 'images',
+ 'id' => 'wpExportImages',
+ 'default' => false,
+ ),*/
+ 'wpDownload' => array(
+ 'type' => 'check',
+ 'name' =>'wpDownload',
+ 'id' => 'wpDownload',
+ 'default' => $request->wasPosted() ? $request->getCheck( 'wpDownload' ) : true,
+ 'label-message' => 'export-download',
+ ),
+ );
if ( $config->get( 'ExportAllowListContributors' ) ) {
- $form .= Xml::checkLabel(
- $this->msg( 'exportlistauthors' )->text(),
- 'listauthors',
- 'listauthors',
- $request->wasPosted() ? $request->getCheck( 'listauthors' ) : false
- ) . '<br />';
+ $formDescriptor += array(
+ 'listauthors' => array(
+ 'type' => 'check',
+ 'label-message' => 'exportlistauthors',
+ 'default' => $request->wasPosted() ? $request->getCheck( 'listauthors' ) : false,
+ 'name' => 'listauthors',
+ 'id' => 'listauthors',
+ ),
+ );
}
- $form .= Xml::submitButton(
- $this->msg( 'export-submit' )->text(),
- Linker::tooltipAndAccesskeyAttribs( 'export' )
- );
- $form .= Xml::closeElement( 'form' );
-
- $out->addHTML( $form );
+ $htmlForm = HTMLForm::factory( 'div', $formDescriptor, $this->getContext() );
+ $htmlForm->setSubmitTextMsg( 'export-submit' );
+ $htmlForm->prepareForm()->displayForm( false );
$this->addHelpLink( 'Help:Export' );
}
* @return Status
*/
public function addNewAccountInternal() {
- global $wgAuth, $wgMemc, $wgAccountCreationThrottle,
- $wgMinimalPasswordLength, $wgEmailConfirmToEdit;
+ global $wgAuth, $wgMemc, $wgAccountCreationThrottle, $wgEmailConfirmToEdit;
// If the user passes an invalid domain, something is fishy
if ( !$wgAuth->validDomain( $this->mDomain ) ) {
wfDebugLog(
'fileupload',
'Short write ' . $this->nbytes . '/' . strlen( $buffer ) .
- ' bytes, aborting with ' . $this->mFileSize . ' uploaded so far'
+ ' bytes, aborting with ' . $this->mFileSize . ' uploaded so far'
);
fclose( $this->mTmpHandle );
$this->mTmpHandle = false;
"badsig": "Invalid raw signature.\nCheck HTML tags.",
"badsiglength": "Your signature is too long.\nIt must not be more than $1 {{PLURAL:$1|character|characters}} long.",
"yourgender": "How do you prefer to be described?",
- "gender-unknown": "I prefer not to say",
+ "gender-unknown": "When mentioning you, the software will use gender neutral words whenever possible",
"gender-male": "He edits wiki pages",
"gender-female": "She edits wiki pages",
"prefs-help-gender": "Setting this preference is optional.\nThe software uses its value to address you and to mention you to others using the appropriate grammatical gender.\nThis information will be public.",
"badsig": "Error message displayed when entering invalid signature in user preferences",
"badsiglength": "Warning message that is displayed on [[Special:Preferences]] when trying to save a signature that is too long.\n\nParameters\n* $1 - the maximum number of characters that is allowed in a signature (multi-byte characters are counted as one character)",
"yourgender": "Used in [[Special:Preferences]], first tab, in the Internationalisation section.\nThis may be customized for other languages. This should sound like a question, the answer to which can be selected in one of these:\n* {{msg-mw|gender-unknown}}\n* {{msg-mw|gender-male}}\n* {{msg-mw|gender-female}}\nThe idea is that this preference is used for speaking to the user and about the user, and the label and the preference are supposed to demonstrate it.",
- "gender-unknown": "Used in [[Special:Preferences]], first tab, as one of the selectable options of the {{msg-mw|Yourgender}} prompt. Choosing it indicates that the grammatical gender of the user name is not to be made public, cannot be determined, or matches none of the other choices preset in the select.\n\nThis may appropriately customized for your language. It should sound like a reply to {{msg-mw|yourgender}}.",
+ "gender-unknown": "Used in [[Special:Preferences]], first tab, as one of the selectable options of the {{msg-mw|Yourgender}} prompt. Choosing it indicates that the grammatical gender of the user name is gender neutral or unknown.\n\nThis may be appropriately customized for your language. It should sound like a reply to {{msg-mw|yourgender}}.",
"gender-male": "Used in [[Special:Preferences]], first tab, as one of the selectable options of the {{msg-mw|Yourgender}} prompt.\nChoosing it indicates that the grammatical gender of the user name should be \"male\" for those languages having a \"normal\" male grammatical gender.\n\nYou have to customize this example for your language if needed to have a sentence which varies depending on the grammatical gender.\nThe wording must demonstrate the actual usage of the option. It should sound like a reply to {{msg-mw|Yourgender}}.\n\nFor example, if the verb \"I edit\" in your language is different in masculine and feminine, translate \"I edit\" in masculine here.\nIf your language does not make a distinction at all, use sentences like \"he is male/a man\".",
"gender-female": "Used in [[Special:Preferences]], first tab, as one of the selectable options of the {{msg-mw|Yourgender}} prompt.\nChoosing it indicates that the grammatical gender of the user name should be \"female\" for those languages having a \"normal\" female grammatical gender.\n\nYou have to customize this example for your language if needed to have a sentence which varies depending on the grammatical gender.\nThe wording must demonstrate the actual usage of the option. It should sound like a reply to {{msg-mw|Yourgender}}.\n\nFor example, if the verb \"I edit\" in your language is different in masculine and feminine, translate \"I edit\" in feminine here.\nIf your language does not make a distinction at all, use sentences like \"she is female/woman\".",
"prefs-help-gender": "Used as additional description for {{msg-mw|yourgender}} field in [[Special:Preferences]], section {{msg-mw|prefs-i18n}}.",
*
*/
-$fallback = 'gom-deva';
\ No newline at end of file
+$fallback = 'gom-deva';
NS_HELP_TALK => 'मजत_चर्चा',
NS_CATEGORY => 'श्रेणी',
NS_CATEGORY_TALK => 'श्रेणी_चर्चा',
-);
\ No newline at end of file
+);
$defaultDateFormat = 'pnt';
-
-
$dateFormats = array(
'pnt time' => 'H:i',
'pnt date' => 'j xg Y',
public function __construct() {
parent::__construct();
$this->mDescription = 'Converts extension entry points to the new JSON registration format';
- $this->addArg( 'path', 'Location to the PHP entry point you wish to convert', /* $required = */ true );
+ $this->addArg( 'path', 'Location to the PHP entry point you wish to convert',
+ /* $required = */ true );
$this->addOption( 'skin', 'Whether to write to skin.json', false, false );
}
}
if ( isset( $this->custom[$realName] ) ) {
- call_user_func_array( array( $this, $this->custom[$realName] ), array( $realName, $value, $vars ) );
+ call_user_func_array( array( $this, $this->custom[$realName] ),
+ array( $realName, $value, $vars ) );
} elseif ( in_array( $realName, $globalSettings ) ) {
$this->json[$realName] = $value;
} elseif ( array_key_exists( $realName, $this->noLongerSupportedGlobals ) ) {
protected function handleExtensionFunctions( $realName, $value ) {
foreach ( $value as $func ) {
if ( $func instanceof Closure ) {
- $this->error( "Error: Closures cannot be converted to JSON. Please move your extension function somewhere else.", 1 );
+ $this->error( "Error: Closures cannot be converted to JSON. " .
+ "Please move your extension function somewhere else.", 1
+ );
}
}
foreach ( $value as $hookName => $handlers ) {
foreach ( $handlers as $func ) {
if ( $func instanceof Closure ) {
- $this->error( "Error: Closures cannot be converted to JSON. Please move the handler for $hookName somewhere else.", 1 );
+ $this->error( "Error: Closures cannot be converted to JSON. " .
+ "Please move the handler for $hookName somewhere else.", 1
+ );
}
}
}
}
}
-
$this->json[$realName][$name] = $data;
}
if ( $defaults ) {
$handle = fopen( $file, 'w' );
- if ( !$handle ) {
+ if ( !$handle ) {
$this->error( "Failed to open $file for writing.\n", 1 );
}
}
$maintClass = 'ExportSites';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
}
$maintClass = 'ImportSites';
-require_once( RUN_MAINTENANCE_IF_MAIN );
+require_once RUN_MAINTENANCE_IF_MAIN;
$module['selectorWithVariant'] = '.oo-ui-image-{variant} .oo-ui-icon-{name}, .oo-ui-image-{variant}.oo-ui-icon-{name}, .mw-ui-icon-{name}-{variant}:before, .mw-ui-hovericon:hover .mw-ui-icon-{name}-{variant}-hover:before, .mw-ui-hovericon.mw-ui-icon-{name}-{variant}-hover:hover:before';
}
- $modules[ "oojs-ui.styles.$name" ] = $module;
+ $modules["oojs-ui.styles.$name"] = $module;
}
return $modules;
"زكريا",
"مشعل الحربي",
"ترجمان05",
- "Abanima"
+ "Abanima",
+ "محمد أحمد عبد الفتاح"
]
},
"ooui-outline-control-move-down": "انقل العنصر للأسفل",
"ooui-dialog-process-error": "حدث خطأ",
"ooui-dialog-process-dismiss": "أغلق",
"ooui-dialog-process-retry": "حاول مرة أخرى",
- "ooui-dialog-process-continue": "استمر"
+ "ooui-dialog-process-continue": "استمر",
+ "ooui-selectfile-not-supported": "تحديد الملفات غير مدعوم",
+ "ooui-selectfile-placeholder": "لم يختر أي ملف"
}
"ooui-dialog-message-reject": "Mégse",
"ooui-dialog-process-dismiss": "Elrejt",
"ooui-dialog-process-retry": "Próbáld újra",
- "ooui-dialog-process-continue": "Folytatás"
+ "ooui-dialog-process-continue": "Folytatás",
+ "ooui-selectfile-placeholder": "Nincs fájl kiválasztva"
}
"Minerva Titani",
"Raoli",
"Una giornata uggiosa '94",
- "Ontsed"
+ "Ontsed",
+ "Alexmar983"
]
},
"ooui-outline-control-move-down": "Sposta in basso",
"ooui-dialog-process-error": "Qualcosa è andato storto",
"ooui-dialog-process-dismiss": "Nascondi",
"ooui-dialog-process-retry": "Riprova",
- "ooui-dialog-process-continue": "Continua"
+ "ooui-dialog-process-continue": "Continua",
+ "ooui-selectfile-not-supported": "La selezione del file non è supportata",
+ "ooui-selectfile-placeholder": "Nessun file è selezionato"
}
"ooui-dialog-process-error": "Не эсе да табсыз кетди",
"ooui-dialog-process-dismiss": "Джаб",
"ooui-dialog-process-retry": "Энтда сынаб кёр",
- "ooui-dialog-process-continue": "Бардыр"
+ "ooui-dialog-process-continue": "Бардыр",
+ "ooui-selectfile-not-supported": "Файл сайлау тутулмайды",
+ "ooui-selectfile-placeholder": "Бир файл да сайланмагъанды",
+ "ooui-semicolon-separator": ";"
}
"ooui-dialog-process-error": "Er is iets misgegaan",
"ooui-dialog-process-dismiss": "Sluiten",
"ooui-dialog-process-retry": "Opnieuw proberen",
- "ooui-dialog-process-continue": "Doorgaan"
+ "ooui-dialog-process-continue": "Doorgaan",
+ "ooui-selectfile-placeholder": "Er is geen bestand geselecteerd"
}
"Spring Roll Conan",
"Waihorace",
"Cwlin0416",
- "LNDDYL"
+ "LNDDYL",
+ "Shangkuanlc"
]
},
"ooui-outline-control-move-down": "項目下移",
"ooui-dialog-process-error": "發生不明錯誤",
"ooui-dialog-process-dismiss": "關閉",
"ooui-dialog-process-retry": "再試一次",
- "ooui-dialog-process-continue": "繼續"
+ "ooui-dialog-process-continue": "繼續",
+ "ooui-selectfile-not-supported": "無法支援所選擇的檔案",
+ "ooui-selectfile-placeholder": "沒有選擇檔案"
}
/*!
- * OOjs UI v0.11.4
+ * OOjs UI v0.11.5
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2015 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2015-06-09T22:03:21Z
+ * Date: 2015-06-17T00:59:03Z
*/
@-webkit-keyframes oo-ui-progressBarWidget-slide {
from {
.oo-ui-buttonElement-frameless.oo-ui-labelElement > .oo-ui-buttonElement-button > .oo-ui-labelElement-label {
margin-left: 0.25em;
}
+.oo-ui-buttonElement-frameless > input.oo-ui-buttonElement-button {
+ padding-left: 0.25em;
+ color: #333333;
+}
+.oo-ui-buttonElement-frameless > input.oo-ui-buttonElement-button:hover,
+.oo-ui-buttonElement-frameless > input.oo-ui-buttonElement-button:focus {
+ color: #000000;
+}
.oo-ui-buttonElement-frameless.oo-ui-flaggedElement-progressive > .oo-ui-buttonElement-button > .oo-ui-labelElement-label {
color: #087ecc;
}
.oo-ui-fieldLayout > .oo-ui-popupButtonWidget:last-child {
margin-right: 0;
}
-.oo-ui-fieldLayout-disabled .oo-ui-labelElement-label {
+.oo-ui-fieldLayout-disabled > .oo-ui-fieldLayout-body > .oo-ui-labelElement-label {
color: #cccccc;
}
.oo-ui-actionFieldLayout-input,
display: inline-block;
vertical-align: middle;
}
+.oo-ui-buttonInputWidget > button,
+.oo-ui-buttonInputWidget > input {
+ border: 0;
+ padding: 0;
+ background-color: transparent;
+}
.oo-ui-dropdownInputWidget {
position: relative;
vertical-align: middle;
/*!
- * OOjs UI v0.11.4
+ * OOjs UI v0.11.5
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2015 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2015-06-09T22:03:14Z
+ * Date: 2015-06-17T00:58:56Z
*/
/**
* @class
/*!
- * OOjs UI v0.11.4
+ * OOjs UI v0.11.5
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2015 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2015-06-09T22:03:21Z
+ * Date: 2015-06-17T00:59:03Z
*/
@-webkit-keyframes oo-ui-progressBarWidget-slide {
from {
margin-left: 0.25em;
margin-right: 0.25em;
}
+.oo-ui-buttonElement-frameless > input.oo-ui-buttonElement-button {
+ padding-left: 0.25em;
+ padding-right: 0.25em;
+ color: #333333;
+}
+.oo-ui-buttonElement-frameless.oo-ui-widget-enabled > input.oo-ui-buttonElement-button,
.oo-ui-buttonElement-frameless.oo-ui-widget-enabled > .oo-ui-buttonElement-button > .oo-ui-labelElement-label {
color: #555555;
}
+.oo-ui-buttonElement-frameless.oo-ui-widget-enabled.oo-ui-buttonElement-pressed > input.oo-ui-buttonElement-button,
.oo-ui-buttonElement-frameless.oo-ui-widget-enabled.oo-ui-buttonElement-pressed > .oo-ui-buttonElement-button > .oo-ui-labelElement-label {
color: #444444;
}
.oo-ui-fieldLayout > .oo-ui-popupButtonWidget:last-child {
margin-right: 0;
}
-.oo-ui-fieldLayout-disabled .oo-ui-labelElement-label {
+.oo-ui-fieldLayout-disabled > .oo-ui-fieldLayout-body > .oo-ui-labelElement-label {
color: #cccccc;
}
.oo-ui-actionFieldLayout-input,
display: inline-block;
vertical-align: middle;
}
+.oo-ui-buttonInputWidget > button,
+.oo-ui-buttonInputWidget > input {
+ border: 0;
+ padding: 0;
+ background-color: transparent;
+}
.oo-ui-checkboxInputWidget {
position: relative;
line-height: 1.6em;
/*!
- * OOjs UI v0.11.4
+ * OOjs UI v0.11.5
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2015 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2015-06-09T22:03:14Z
+ * Date: 2015-06-17T00:58:56Z
*/
/**
* @class
/*!
- * OOjs UI v0.11.4
+ * OOjs UI v0.11.5
* https://www.mediawiki.org/wiki/OOjs_UI
*
* Copyright 2011–2015 OOjs Team and other contributors.
* Released under the MIT license
* http://oojs.mit-license.org
*
- * Date: 2015-06-09T22:03:14Z
+ * Date: 2015-06-17T00:58:56Z
*/
( function ( OO ) {
this.setOptions( config.options || [] );
this.$element
.addClass( 'oo-ui-radioSelectInputWidget' )
- .empty()
.append( this.radioSelectWidget.$element );
};
return this.menu;
};
+/**
+ * Get the combobox's text input widget.
+ * @return {OO.ui.TextInputWidget} Text input widget
+ */
+OO.ui.ComboBoxWidget.prototype.getInput = function () {
+ return this.input;
+};
+
/**
* Handle input change events.
*
* @cfg {OO.ui.TextInputWidget} [input] Text input used to implement option highlighting for menu items that match
* the text the user types. This config is used by {@link OO.ui.ComboBoxWidget ComboBoxWidget}
* and {@link OO.ui.mixin.LookupElement LookupElement}
- * @cfg {OO.ui.Widget} [widget] Widget associated with the menu’s active state. If the user clicks the mouse
- * anywhere on the page outside of this widget, the menu is hidden.
+ * @cfg {OO.ui.Widget} [widget] Widget associated with the menu's active state. If the user clicks the mouse
+ * anywhere on the page outside of this widget, the menu is hidden. For example, if there is a button
+ * that toggles the menu's visibility on click, the menu will be hidden then re-shown when the user clicks
+ * that button, unless the button (or its parent widget) is passed in here.
* @cfg {boolean} [autoHide=true] Hide the menu when the mouse is pressed outside the menu.
*/
OO.ui.MenuSelectWidget = function OoUiMenuSelectWidget( config ) {
"ltr": "images/icons/lock-ltr.svg",
"rtl": "images/icons/lock-rtl.svg"
}, "variants": [ "destructive" ] },
+ "ongoingConversation": { "file": {
+ "ltr": "images/icons/ongoingConversation-ltr.svg",
+ "rtl": "images/icons/ongoingConversation-rtl.svg"
+ } },
"star": { "file": "images/icons/star.svg" },
"trash": { "file": "images/icons/trash.svg" },
"trashUndo": { "file": {
"advanced": { "file": "images/icons/advanced.svg" },
"alert": { "file": "images/icons/alert.svg", "variants": [ "warning" ] },
"cancel": { "file": "images/icons/cancel.svg" },
- "check": { "file": "images/icons/check.svg", "variants": [ "constructive", "progressive" ] },
+ "check": { "file": "images/icons/check.svg", "variants": [ "constructive", "progressive", "destructive" ] },
"circle": { "file": "images/icons/circle.svg", "variants": [ "constructive" ] },
"close": { "file": {
"ltr": "images/icons/close-ltr.svg",
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<svg xmlns="http://www.w3.org/2000/svg" width="24" height="24" viewBox="0 0 24 24"><style>* { fill: #D11D13 }</style>
+ <g id="check">
+ <path d="M17 7.5L9.5 15 6 11.5 4.5 13l5 5L20 7.5c-.706-.706-2.294-.706-3 0z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>* { fill: #FFFFFF }</style>
+ <g id="ongoing-conversation" fill-rule="evenodd">
+ <path d="M17.8 18.6H2.5l2.7-2.7V6h15.3v9.9c0 1.53-1.17 2.7-2.7 2.7zm-7.542-4.95c0 .405-.135.675-.405.945-.27.27-.607.405-.945.405-.405 0-.675-.135-.945-.405-.27-.27-.405-.607-.405-.945 0-.338.135-.675.405-.945.27-.27.608-.405.945-.405.338 0 .675.135.945.405.27.27.405.607.405.945zm4.05 0c0 .405-.135.675-.405.945-.27.27-.607.405-.945.405-.405 0-.675-.135-.945-.405-.27-.27-.405-.607-.405-.945 0-.338.135-.675.405-.945.27-.27.608-.405.945-.405.338 0 .675.135.945.405.27.27.405.607.405.945zm4.05 0c0 .405-.135.675-.405.945-.27.27-.607.405-.945.405-.405 0-.675-.135-.945-.405-.27-.27-.405-.607-.405-.945 0-.338.135-.675.405-.945.27-.27.608-.405.945-.405.338 0 .675.135.945.405.27.27.405.607.405.945z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <g id="ongoing-conversation" fill-rule="evenodd">
+ <path d="M17.8 18.6H2.5l2.7-2.7V6h15.3v9.9c0 1.53-1.17 2.7-2.7 2.7zm-7.542-4.95c0 .405-.135.675-.405.945-.27.27-.607.405-.945.405-.405 0-.675-.135-.945-.405-.27-.27-.405-.607-.405-.945 0-.338.135-.675.405-.945.27-.27.608-.405.945-.405.338 0 .675.135.945.405.27.27.405.607.405.945zm4.05 0c0 .405-.135.675-.405.945-.27.27-.607.405-.945.405-.405 0-.675-.135-.945-.405-.27-.27-.405-.607-.405-.945 0-.338.135-.675.405-.945.27-.27.608-.405.945-.405.338 0 .675.135.945.405.27.27.405.607.405.945zm4.05 0c0 .405-.135.675-.405.945-.27.27-.607.405-.945.405-.405 0-.675-.135-.945-.405-.27-.27-.405-.607-.405-.945 0-.338.135-.675.405-.945.27-.27.608-.405.945-.405.338 0 .675.135.945.405.27.27.405.607.405.945z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><style>* { fill: #FFFFFF }</style>
+ <g id="ongoing-conversation" fill-rule="evenodd">
+ <path d="M5.2 18.6h15.3l-2.7-2.7V6H2.5v9.9c0 1.53 1.17 2.7 2.7 2.7zm7.542-4.95c0 .405.135.675.405.945.27.27.607.405.945.405.405 0 .675-.135.945-.405.27-.27.405-.607.405-.945 0-.337-.135-.675-.405-.945-.27-.27-.608-.405-.945-.405-.338 0-.675.135-.945.405-.27.27-.405.607-.405.945zm-4.05 0c0 .405.135.675.405.945.27.27.608.405.945.405.405 0 .675-.135.945-.405.27-.27.405-.607.405-.945 0-.337-.135-.675-.405-.945-.27-.27-.608-.405-.945-.405-.338 0-.675.135-.945.405-.27.27-.405.608-.405.945zm-4.05 0c0 .405.135.675.405.945.27.27.608.405.945.405.405 0 .675-.135.945-.405.27-.27.405-.607.405-.945 0-.337-.135-.675-.405-.945-.27-.27-.607-.405-.945-.405-.337 0-.675.135-.945.405-.27.27-.405.608-.405.945z"/>
+ </g>
+</svg>
--- /dev/null
+<?xml version="1.0" encoding="utf-8"?>
+<svg width="24" height="24" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg">
+ <g id="ongoing-conversation" fill-rule="evenodd">
+ <path d="M5.2 18.6h15.3l-2.7-2.7V6H2.5v9.9c0 1.53 1.17 2.7 2.7 2.7zm7.542-4.95c0 .405.135.675.405.945.27.27.607.405.945.405.405 0 .675-.135.945-.405.27-.27.405-.607.405-.945 0-.337-.135-.675-.405-.945-.27-.27-.608-.405-.945-.405-.338 0-.675.135-.945.405-.27.27-.405.607-.405.945zm-4.05 0c0 .405.135.675.405.945.27.27.608.405.945.405.405 0 .675-.135.945-.405.27-.27.405-.607.405-.945 0-.337-.135-.675-.405-.945-.27-.27-.608-.405-.945-.405-.338 0-.675.135-.945.405-.27.27-.405.608-.405.945zm-4.05 0c0 .405.135.675.405.945.27.27.608.405.945.405.405 0 .675-.135.945-.405.27-.27.405-.607.405-.945 0-.337-.135-.675-.405-.945-.27-.27-.607-.405-.945-.405-.337 0-.675.135-.945.405-.27.27-.405.608-.405.945z"/>
+ </g>
+</svg>
data = {},
timer = null;
+ function stashEdit( token ) {
+ data = $form.serializeObject();
+
+ pending = api.post( {
+ action: 'stashedit',
+ token: token,
+ title: mw.config.get( 'wgPageName' ),
+ section: data.wpSection,
+ sectiontitle: '',
+ text: data.wpTextbox1,
+ contentmodel: data.model,
+ contentformat: data.format,
+ baserevid: data.parentRevId
+ } );
+ }
+
/* Has the edit body text changed since the last stashEdit() call? */
function isChanged() {
// Normalize line endings to CRLF, like $.fn.serializeObject does.
pending.abort();
}
- data = $form.serializeObject();
- pending = api.postWithToken( 'edit', {
- action: 'stashedit',
- title: mw.config.get( 'wgPageName' ),
- section: data.wpSection,
- sectiontitle: '',
- text: data.wpTextbox1,
- contentmodel: data.model,
- contentformat: data.format,
- baserevid: data.parentRevId
- } );
+ api.getToken( 'edit' ).then( stashEdit );
}
function onKeyPress( e ) {
$globals = array();
foreach ( self::getSettings() as $key => $value ) {
- $globals[ 'wg' . $key ] = $value;
+ $globals['wg' . $key] = $value;
}
$this->setMwGlobals( $globals );
}
new FauxRequest( array( 'action' => 'query', 'meta' => 'siteinfo' ) )
);
$modules = $api->getModuleManager()->getNamesWithClasses();
- foreach( $modules as $name => $class ) {
+ foreach ( $modules as $name => $class ) {
$this->assertArrayHasKey(
$class,
$classes,
try {
$arr = array();
- ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject(
+ ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject(
new ApiResultTestStringifiableObject()
) );
$this->fail( 'Expected exception not thrown' );
try {
$arr = array();
- ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject( NAN ) );
+ ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject( NAN ) );
$this->fail( 'Expected exception not thrown' );
} catch ( UnexpectedValueException $ex ) {
$this->assertSame(
}
$arr = array();
- ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject(
+ ApiResult::setValue( $arr, 'foo', new ApiResultTestSerializableObject(
array(
'one' => new ApiResultTestStringifiableObject( '1' ),
'two' => new ApiResultTestSerializableObject( 2 ),
);
$queryApi = new ApiQuery( $api, 'query' );
$modules = $queryApi->getModuleManager()->getNamesWithClasses();
- foreach( $modules as $name => $class ) {
+ foreach ( $modules as $name => $class ) {
$this->assertArrayHasKey(
$class,
$classes,
public function testClosureExpansionDisabled() {
$obj = ObjectFactory::getObjectFromSpec( array(
'class' => 'ObjectFactoryTest_Fixture',
- 'args' => array( function (){ return 'unwrapped'; }, ),
+ 'args' => array( function() {
+ return 'unwrapped';
+ }, ),
'closure_expansion' => false,
) );
$this->assertInstanceOf( 'Closure', $obj->args[0] );
public function testClosureExpansionEnabled() {
$obj = ObjectFactory::getObjectFromSpec( array(
'class' => 'ObjectFactoryTest_Fixture',
- 'args' => array( function (){ return 'unwrapped'; }, ),
+ 'args' => array( function() {
+ return 'unwrapped';
+ }, ),
'closure_expansion' => true,
) );
$this->assertInternalType( 'string', $obj->args[0] );
$obj = ObjectFactory::getObjectFromSpec( array(
'class' => 'ObjectFactoryTest_Fixture',
- 'args' => array( function (){ return 'unwrapped'; }, ),
+ 'args' => array( function() {
+ return 'unwrapped';
+ }, ),
) );
$this->assertInternalType( 'string', $obj->args[0] );
$this->assertSame( 'unwrapped', $obj->args[0] );
class ObjectFactoryTest_Fixture {
public $args;
- public function __construct( /*...*/ ) { $this->args = func_get_args(); }
+ public function __construct( /*...*/ ) {
+ $this->args = func_get_args();
+ }
}
public function testSetOver() {
$key = wfRandomString();
- for ( $i=0; $i<3; ++$i ) {
+ for ( $i = 0; $i < 3; ++$i ) {
$value = wfRandomString();
$this->cache->set( $key, $value, 3 );
public function testGetSites() {
$expectedSites = array();
- foreach( TestSites::getSites() as $testSite ) {
+ foreach ( TestSites::getSites() as $testSite ) {
$siteId = $testSite->getGlobalId();
$expectedSites[$siteId] = $testSite;
}
$exporter->exportSites( array( $foo, $acme ) );
fseek( $tmp, 0 );
- $xml = fread( $tmp, 16*1024 );
+ $xml = fread( $tmp, 16 * 1024 );
$this->assertContains( '<sites ', $xml );
$this->assertContains( '<site>', $xml );
$exporter->exportSites( $sites );
fseek( $tmp, 0 );
- $xml = fread( $tmp, 16*1024 );
+ $xml = fread( $tmp, 16 * 1024 );
$actualSites = new SiteList();
$store = $this->newSiteStore( $actualSites );
/**
* @dataProvider provideImportFromXML
*/
- public function testImportFromXML( $xml, array $expectedSites, $errorCount = 0 ) {
+ public function testImportFromXML( $xml, array $expectedSites, $errorCount = 0 ) {
$importer = $this->newSiteImporter( $expectedSites, $errorCount );
$importer->importFromXML( $xml );
}
- public function testImportFromXML_malformed() {
+ public function testImportFromXML_malformed() {
$this->setExpectedException( 'Exception' );
$store = $this->getMock( 'SiteStore' );
$importer->importFromXML( 'THIS IS NOT XML' );
}
- public function testImportFromFile() {
+ public function testImportFromFile() {
$foo = Site::newForType( Site::TYPE_UNKNOWN );
$foo->setGlobalId( 'Foo' );
public static function provideIsPublic() {
return array(
array( false, 'fc00::3' ), # RFC 4193 (local)
- array( false, 'fc00::ff'), # RFC 4193 (local)
- array( false, '127.1.2.3'), # loopback
- array( false, '::1'), # loopback
- array( false, 'fe80::1'), # link-local
- array( false, '169.254.1.1'), # link-local
- array( false, '10.0.0.1'), # RFC 1918 (private)
- array( false, '172.16.0.1'), # RFC 1918 (private)
- array( false, '192.168.0.1'), # RFC 1918 (private)
- array( true, '2001:5c0:1000:a::133'), # public
- array( true, 'fc::3'), # public
- array( true, '00FC::') # public
+ array( false, 'fc00::ff' ), # RFC 4193 (local)
+ array( false, '127.1.2.3' ), # loopback
+ array( false, '::1' ), # loopback
+ array( false, 'fe80::1' ), # link-local
+ array( false, '169.254.1.1' ), # link-local
+ array( false, '10.0.0.1' ), # RFC 1918 (private)
+ array( false, '172.16.0.1' ), # RFC 1918 (private)
+ array( false, '192.168.0.1' ), # RFC 1918 (private)
+ array( true, '2001:5c0:1000:a::133' ), # public
+ array( true, 'fc::3' ), # public
+ array( true, '00FC::' ) # public
);
}
$rights = User::getAllRights();
- foreach( $wgGroupPermissions as $permissions ) {
+ foreach ( $wgGroupPermissions as $permissions ) {
$rights = array_merge( $rights, array_keys( $permissions ) );
}
- foreach( $wgRevokePermissions as $permissions ) {
+ foreach ( $wgRevokePermissions as $permissions ) {
$rights = array_merge( $rights, array_keys( $permissions ) );
}
function wfStreamThumb( array $params ) {
global $wgVaryOnXFP;
-
$headers = array(); // HTTP headers to send
$fileName = isset( $params['f'] ) ? $params['f'] : '';