* @param string $errorCode Brief, arbitrary, stable string to allow easy
* automated identification of the error, e.g., 'unknown_action'
* @param int $httpRespCode HTTP response code
- * @param array $extradata Data to add to the "<error>" element; array in ApiResult format
- * @throws UsageException
+ * @param array|null $extradata Data to add to the "<error>" element; array in ApiResult format
+ * @throws UsageException always
*/
public function dieUsage( $description, $errorCode, $httpRespCode = 0, $extradata = null ) {
throw new UsageException(
*
* @since 1.22
* @param Status $status
- * @throws MWException
+ * @throws UsageException always
*/
public function dieStatus( $status ) {
-
list( $code, $msg ) = $this->getErrorFromStatus( $status );
$this->dieUsage( $msg, $code );
}
/**
* Helper function for readonly errors
+ *
+ * @throws UsageException always
*/
public function dieReadOnly() {
$parsed = $this->parseMsg( array( 'readonlytext' ) );
/**
* Output the error message related to a certain array
* @param array|string $error Element of a getUserPermissionsErrors()-style array
+ * @throws UsageException always
*/
public function dieUsageMsg( $error ) {
# most of the time we send a 1 element, so we might as well send it as
* Will only set a warning instead of failing if the global $wgDebugAPI
* is set to true. Otherwise behaves exactly as dieUsageMsg().
* @param array|string $error Element of a getUserPermissionsErrors()-style array
+ * @throws UsageException
* @since 1.21
*/
public function dieUsageMsgOrDebug( $error ) {
* Die with the $prefix.'badcontinue' error. This call is common enough to
* make it into the base method.
* @param bool $condition Will only die if this value is true
+ * @throws UsageException
* @since 1.21
*/
protected function dieContinueUsageIf( $condition ) {
* Internal code errors should be reported with this method
* @param string $method Method or function name
* @param string $message Error message
- * @throws MWException
+ * @throws MWException always
*/
protected static function dieDebug( $method, $message ) {
throw new MWException( "Internal error in $method: $message" );
"mergehistory-go": "Show mergeable edits",
"mergehistory-submit": "Merge revisions",
"mergehistory-empty": "No revisions can be merged.",
- "mergehistory-done": "$3 {{PLURAL:$3|revision|revisions}} of $1 were merged into [[:$2]].",
+ "mergehistory-done": "$3 {{PLURAL:$3|revision|revisions}} of $1 {{PLURAL:$3|was|were}} merged into [[:$2]].",
"mergehistory-fail": "Unable to perform history merge, please recheck the page and time parameters.",
"mergehistory-fail-toobig" : "Unable to perform history merge as more than the limit of $1 {{PLURAL:$1|revision|revisions}} would be moved.",
"mergehistory-no-source": "Source page $1 does not exist.",
this.$label.attr( 'href', config.url );
this.$element.addClass( 'mw-widget-titleOptionWidget' );
+ // Allow opening the link in new tab, but not regular navigation.
+ this.$label.on( 'click', function ( e ) {
+ // Do not interfere with non-left clicks or if modifier keys are pressed (e.g. ctrl-click).
+ if ( !( e.which !== 1 || e.altKey || e.ctrlKey || e.shiftKey || e.metaKey ) ) {
+ e.preventDefault();
+ }
+ } );
+
// Highlight matching parts of link suggestion
this.$label.autoEllipsis( { hasSpan: false, tooltip: true, matchText: config.query } );