Merge "Localisation updates from https://translatewiki.net."
authorTranslation updater bot <l10n-bot@translatewiki.net>
Thu, 16 Oct 2014 20:07:04 +0000 (20:07 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 16 Oct 2014 20:07:04 +0000 (20:07 +0000)
24 files changed:
includes/AutoLoader.php
includes/DefaultSettings.php
includes/api/ApiFormatXml.php
includes/api/i18n/en.json
includes/api/i18n/qqq.json
includes/db/Database.php
includes/htmlform/HTMLForm.php
includes/htmlform/HTMLSelectNamespace.php [new file with mode: 0644]
includes/htmlform/HTMLTagFilter.php [new file with mode: 0644]
includes/objectcache/SqlBagOStuff.php
includes/parser/Preprocessor_DOM.php
includes/parser/Preprocessor_Hash.php
includes/specials/SpecialNewpages.php
languages/i18n/en.json
resources/lib/oojs-ui/oojs-ui-apex.css
resources/lib/oojs-ui/oojs-ui-apex.js
resources/lib/oojs-ui/oojs-ui-apex.svg.css
resources/lib/oojs-ui/oojs-ui-mediawiki.css
resources/lib/oojs-ui/oojs-ui-mediawiki.js
resources/lib/oojs-ui/oojs-ui-mediawiki.svg.css
resources/lib/oojs-ui/oojs-ui-minerva.css
resources/lib/oojs-ui/oojs-ui-minerva.js
resources/lib/oojs-ui/oojs-ui-minerva.svg.css
resources/lib/oojs-ui/oojs-ui.js

index cd6a8ca..6909b8f 100644 (file)
@@ -106,6 +106,8 @@ $wgAutoloadLocalClasses = array(
        'HTMLSelectField' => 'includes/htmlform/HTMLSelectField.php',
        'HTMLSelectLimitField' => 'includes/htmlform/HTMLSelectLimitField.php',
        'HTMLSelectOrOtherField' => 'includes/htmlform/HTMLSelectOrOtherField.php',
+       'HTMLSelectNamespace' => 'includes/htmlform/HTMLSelectNamespace.php',
+       'HTMLTagFilter' => 'includes/htmlform/HTMLTagFilter.php',
        'HTMLSubmitField' => 'includes/htmlform/HTMLSubmitField.php',
        'HTMLTextAreaField' => 'includes/htmlform/HTMLTextAreaField.php',
        'HTMLTextField' => 'includes/htmlform/HTMLTextField.php',
index de29f0d..57859ec 100644 (file)
@@ -3797,6 +3797,7 @@ $wgNamespacesWithSubpages = array(
 $wgTrackingCategories = array(
        'index-category',
        'noindex-category',
+       'duplicate-args-category',
        'expensive-parserfunction-category',
        'post-expand-template-argument-category',
        'post-expand-template-inclusion-category',
index 4ed4944..7010dd6 100644 (file)
@@ -238,11 +238,11 @@ class ApiFormatXml extends ApiFormatBase {
        public function getAllowedParams() {
                return array(
                        'xslt' => array(
-                               ApiBase::PARAM_HELP_MSG => 'apihelp-json-param-callback',
+                               ApiBase::PARAM_HELP_MSG => 'apihelp-xml-param-xslt',
                        ),
                        'includexmlnamespace' => array(
                                ApiBase::PARAM_DFLT => false,
-                               ApiBase::PARAM_HELP_MSG => 'apihelp-json-param-callback',
+                               ApiBase::PARAM_HELP_MSG => 'apihelp-xml-param-includexmlnamespace',
                        ),
                );
        }
index 6c45425..c871be0 100644 (file)
@@ -37,7 +37,7 @@
        "apihelp-wddxfm-description": "Output data in WDDX format (pretty-print in HTML).",
        "apihelp-xml-description": "Output data in XML format.",
        "apihelp-xml-param-xslt": "If specified, adds &lt;xslt&gt; as stylesheet. This should be a wiki page in the MediaWiki namespace whose page name ends with \".xsl\".",
-       "apihelp-xml-param-includexmlnamespac": "If specified, adds an XML namespace.",
+       "apihelp-xml-param-includexmlnamespace": "If specified, adds an XML namespace.",
        "apihelp-xmlfm-description": "Output data in XML format (pretty-print in HTML).",
        "apihelp-yaml-description": "Output data in YAML format.",
        "apihelp-yamlfm-description": "Output data in YAML format (pretty-print in HTML).",
index a4dfd7c..0b10779 100644 (file)
@@ -35,7 +35,7 @@
        "apihelp-wddxfm-description": "{{doc-apihelp-description|wddxfm|seealso=* {{msg-mw|apihelp-wddx-description}}}}",
        "apihelp-xml-description": "{{doc-apihelp-description|xml|seealso=* {{msg-mw|apihelp-xmlfm-description}}}}",
        "apihelp-xml-param-xslt": "{{doc-apihelp-param|xml|xslt}}",
-       "apihelp-xml-param-includexmlnamespac": "{{doc-apihelp-param|xml|includexmlnamespac}}",
+       "apihelp-xml-param-includexmlnamespace": "{{doc-apihelp-param|xml|includexmlnamespace}}",
        "apihelp-xmlfm-description": "{{doc-apihelp-description|xmlfm|seealso=* {{msg-mw|apihelp-xml-description}}}}",
        "apihelp-yaml-description": "{{doc-apihelp-description|yaml|seealso=* {{msg-mw|apihelp-yamlfm-description}}}}",
        "apihelp-yamlfm-description": "{{doc-apihelp-description|yamlfm|seealso=* {{msg-mw|apihelp-yaml-description}}}}",
index 29642d0..4bb646e 100644 (file)
@@ -2346,7 +2346,7 @@ abstract class DatabaseBase implements IDatabase, DatabaseType {
                # Split database and table into proper variables.
                # We reverse the explode so that database.table and table both output
                # the correct table.
-               $dbDetails = explode( '.', $name, 2 );
+               $dbDetails = explode( '.', $name, 3 );
                if ( count( $dbDetails ) == 3 ) {
                        list( $database, $schema, $table ) = $dbDetails;
                        # We don't want any prefix added in this case
index 4511046..62345b8 100644 (file)
@@ -115,6 +115,8 @@ class HTMLForm extends ContextSource {
                'info' => 'HTMLInfoField',
                'selectorother' => 'HTMLSelectOrOtherField',
                'selectandother' => 'HTMLSelectAndOtherField',
+               'namespaceselect' => 'HTMLSelectNamespace',
+               'tagfilter' => 'HTMLTagFilter',
                'submit' => 'HTMLSubmitField',
                'hidden' => 'HTMLHiddenField',
                'edittools' => 'HTMLEditTools',
diff --git a/includes/htmlform/HTMLSelectNamespace.php b/includes/htmlform/HTMLSelectNamespace.php
new file mode 100644 (file)
index 0000000..9638106
--- /dev/null
@@ -0,0 +1,18 @@
+<?php
+/**
+ * Wrapper for Html::namespaceSelector to use in HTMLForm
+ */
+class HTMLSelectNamespace extends HTMLFormField {
+       function getInputHTML( $value ) {
+               return Html::namespaceSelector(
+                       array(
+                               'selected' => $value,
+                               'all' => 'all'
+                       ), array(
+                               'name' => $this->mName,
+                               'id' => $this->mID,
+                               'class' => 'namespaceselector',
+                       )
+               );
+       }
+}
diff --git a/includes/htmlform/HTMLTagFilter.php b/includes/htmlform/HTMLTagFilter.php
new file mode 100644 (file)
index 0000000..da5e85c
--- /dev/null
@@ -0,0 +1,15 @@
+<?php
+/**
+ * Wrapper for ChgangeTags::buildTagFilterSelector to use in HTMLForm
+ */
+class HTMLTagFilter extends HTMLFormField {
+       function getInputHTML( $value ) {
+               $tagFilter = ChangeTags::buildTagFilterSelector( $value );
+               if ( $tagFilter ) {
+                       list( $tagFilterLabel, $tagFilterSelector ) = $tagFilter;
+                       // we only need the select field, HTMLForm should handle the label
+                       return $tagFilterSelector;
+               }
+               return;
+       }
+}
index 5872079..3b0f816 100644 (file)
@@ -638,6 +638,11 @@ class SqlBagOStuff extends BagOStuff {
                return true;
        }
 
+       /**
+        * Delete content of shard tables in every server.
+        * Return true if the operation is successful, false otherwise.
+        * @return bool
+        */
        public function deleteAll() {
                for ( $serverIndex = 0; $serverIndex < $this->numServers; $serverIndex++ ) {
                        try {
index 2edb79a..2cce574 100644 (file)
@@ -1043,11 +1043,17 @@ class PPFrame_DOM implements PPFrame {
                                        // Numbered parameter
                                        $index = $nameNodes->item( 0 )->attributes->getNamedItem( 'index' )->textContent;
                                        $index = $index - $indexOffset;
+                                       if ( isset( $namedArgs[$index] ) || isset( $numberedArgs[$index] ) ) {
+                                               $this->parser->addTrackingCategory( 'duplicate-args-category' );
+                                       }
                                        $numberedArgs[$index] = $value->item( 0 );
                                        unset( $namedArgs[$index] );
                                } else {
                                        // Named parameter
                                        $name = trim( $this->expand( $nameNodes->item( 0 ), PPFrame::STRIP_COMMENTS ) );
+                                       if ( isset( $namedArgs[$name] ) || isset( $numberedArgs[$name] ) ) {
+                                               $this->parser->addTrackingCategory( 'duplicate-args-category' );
+                                       }
                                        $namedArgs[$name] = $value->item( 0 );
                                        unset( $numberedArgs[$name] );
                                }
index 6376396..b4b14dc 100644 (file)
@@ -985,11 +985,17 @@ class PPFrame_Hash implements PPFrame {
                                if ( $bits['index'] !== '' ) {
                                        // Numbered parameter
                                        $index = $bits['index'] - $indexOffset;
+                                       if ( isset( $namedArgs[$index] ) || isset( $numberedArgs[$index] ) ) {
+                                               $this->parser->addTrackingCategory( 'duplicate-args-category' );
+                                       }
                                        $numberedArgs[$index] = $bits['value'];
                                        unset( $namedArgs[$index] );
                                } else {
                                        // Named parameter
                                        $name = trim( $this->expand( $bits['name'], PPFrame::STRIP_COMMENTS ) );
+                                       if ( isset( $namedArgs[$name] ) || isset( $numberedArgs[$name] ) ) {
+                                               $this->parser->addTrackingCategory( 'duplicate-args-category' );
+                                       }
                                        $namedArgs[$name] = $bits['value'];
                                        unset( $numberedArgs[$name] );
                                }
index 3a74e7a..5b34297 100644 (file)
@@ -198,6 +198,7 @@ class SpecialNewpages extends IncludableSpecialPage {
        }
 
        protected function form() {
+               $out = $this->getOutput();
                // Consume values
                $this->opts->consumeValue( 'offset' ); // don't carry offset, DWIW
                $namespace = $this->opts->consumeValue( 'namespace' );
@@ -216,77 +217,62 @@ class SpecialNewpages extends IncludableSpecialPage {
                }
                $hidden = implode( "\n", $hidden );
 
-               $tagFilter = ChangeTags::buildTagFilterSelector( $tagFilterVal );
-               if ( $tagFilter ) {
-                       list( $tagFilterLabel, $tagFilterSelector ) = $tagFilter;
-               }
+               $form = array(
+                       'namespace' => array(
+                               'type' => 'namespaceselect',
+                               'name' => 'namespace',
+                               'label-message' => 'namespace',
+                               'default' => $namespace,
+                       ),
+                       'nsinvert' => array(
+                               'type' => 'check',
+                               'name' => 'nsinvert',
+                               'label-message' => 'invert',
+                               'default' => $nsinvert,
+                               'tooltip' => $this->msg( 'tooltip-invert' )->text(),
+                       ),
+                       'tagFilter' => array(
+                               'type' => 'tagfilter',
+                               'name' => 'tagfilter',
+                               'label-raw' => wfMessage( 'tag-filter' )->parse(),
+                               'default' => $tagFilterVal,
+                       ),
+                       'username' => array(
+                               'type' => 'text',
+                               'name' => 'username',
+                               'label-message' => 'newpages-username',
+                               'default' => $userText,
+                               'id' => 'mw-np-username',
+                               'size' => 30,
+                               'cssclass' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
+                       ),
+               );
+
+               $htmlForm = new HTMLForm( $form, $this->getContext() );
+
+               $htmlForm->setSubmitText( $this->msg( 'allpagessubmit' )->text() );
+               $htmlForm->setSubmitProgressive();
+               // The form should be visible on each request (inclusive requests with submitted forms), so
+               // return always false here.
+               $htmlForm->setSubmitCallback(
+                       function() {
+                               return false;
+                       }
+               );
+               $htmlForm->setMethod( 'get' );
+
+               $out->addHtml( Xml::fieldset( $this->msg( 'newpages' )->text() ) );
 
-               $this->getOutput()->addModules( 'mediawiki.userSuggest' );
-
-               $form = Xml::openElement( 'form', array( 'action' => wfScript() ) ) .
-                       Html::hidden( 'title', $this->getPageTitle()->getPrefixedDBkey() ) .
-                       Xml::fieldset( $this->msg( 'newpages' )->text() ) .
-                       Xml::openElement( 'table', array( 'id' => 'mw-newpages-table' ) ) .
-                       '<tr>
-                               <td class="mw-label">' .
-                       Xml::label( $this->msg( 'namespace' )->text(), 'namespace' ) .
-                       '</td>
-                       <td class="mw-input">' .
-                       Html::namespaceSelector(
-                               array(
-                                       'selected' => $namespace,
-                                       'all' => 'all',
-                               ), array(
-                                       'name' => 'namespace',
-                                       'id' => 'namespace',
-                                       'class' => 'namespaceselector',
-                               )
-                       ) . '&#160;' .
-                       Xml::checkLabel(
-                               $this->msg( 'invert' )->text(),
-                               'invert',
-                               'nsinvert',
-                               $nsinvert,
-                               array( 'title' => $this->msg( 'tooltip-invert' )->text() )
+               $htmlForm->show();
+
+               $out->addHtml(
+                       Html::rawElement(
+                               'div',
+                               null,
+                               $this->filterLinks()
                        ) .
-                       '</td>
-                       </tr>' . ( $tagFilter ? (
-                       '<tr>
-                               <td class="mw-label">' .
-                               $tagFilterLabel .
-                               '</td>
-                               <td class="mw-input">' .
-                               $tagFilterSelector .
-                               '</td>
-                       </tr>' ) : '' ) .
-                       '<tr>
-                               <td class="mw-label">' .
-                                       Xml::label( $this->msg( 'newpages-username' )->text(), 'mw-np-username' ) .
-                                       '</td>
-                               <td class="mw-input">' .
-                                       Xml::input( 'username', 30, $userText, array(
-                                               'id' => 'mw-np-username',
-                                               'class' => 'mw-autocomplete-user', // used by mediawiki.userSuggest
-                                       ) ) .
-                                       '</td>
-                       </tr>' .
-                       '<tr> <td></td>
-                               <td class="mw-submit">' .
-                       Xml::submitButton( $this->msg( 'allpagessubmit' )->text() ) .
-                       '</td>
-               </tr>' .
-                       '<tr>
-                               <td></td>
-                               <td class="mw-input">' .
-                       $this->filterLinks() .
-                       '</td>
-                       </tr>' .
-                       Xml::closeElement( 'table' ) .
-                       Xml::closeElement( 'fieldset' ) .
-                       $hidden .
-                       Xml::closeElement( 'form' );
-
-               $this->getOutput()->addHTML( $form );
+                       Xml::closeElement( 'fieldset' )
+               );
        }
 
        /**
index 99554e7..9aa05f3 100644 (file)
        "content-model-text": "plain text",
        "content-model-javascript": "JavaScript",
        "content-model-css": "CSS",
+       "duplicate-args-category": "Pages using duplicate arguments in template calls",
+       "duplicate-args-category-desc": "The page contains template calls that use duplicates of arguments, such as <code><nowiki>{{foo|bar=1|bar=2}}</nowiki></code> or <code><nowiki>{{foo|bar|1=baz}}</nowiki></code>.",
        "expensive-parserfunction-warning": "<strong>Warning:</strong> This page contains too many expensive parser function calls.\n\nIt should have less than $2 {{PLURAL:$2|call|calls}}, there {{PLURAL:$1|is now $1 call|are now $1 calls}}.",
        "expensive-parserfunction-category": "Pages with too many expensive parser function calls",
        "post-expand-template-inclusion-warning": "<strong>Warning:</strong> Template include size is too large.\nSome templates will not be included.",
index 42e6699..08b1d0e 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:50:09Z
  */
 /* @noflip */
 .oo-ui-rtl {
index ba1ef86..11b03f6 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:17Z
+ * Date: 2014-10-15T22:49:59Z
  */
 /* Instantiation */
 
index 06880ff..4805aca 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:50:09Z
  */
 /* @noflip */
 .oo-ui-rtl {
index 7fbd762..27b49c0 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:50:09Z
  */
 /* @noflip */
 .oo-ui-rtl {
index 8fed983..2ca1b48 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:17Z
+ * Date: 2014-10-15T22:49:59Z
  */
 /**
  * @class
index 266d714..6fc365b 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:50:09Z
  */
 /* @noflip */
 .oo-ui-rtl {
index 8feccb9..80bfe8d 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:50:09Z
  */
 /* @noflip */
 .oo-ui-rtl {
index ba1ef86..11b03f6 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:17Z
+ * Date: 2014-10-15T22:49:59Z
  */
 /* Instantiation */
 
index ad1316c..bb793c8 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:28Z
+ * Date: 2014-10-15T22:50:09Z
  */
 /* @noflip */
 .oo-ui-rtl {
index 50f69f3..94ae50e 100644 (file)
@@ -1,12 +1,12 @@
 /*!
- * OOjs UI v0.1.0-pre (d74a46ca6a)
+ * OOjs UI v0.1.0-pre (1829141230)
  * https://www.mediawiki.org/wiki/OOjs_UI
  *
  * Copyright 2011–2014 OOjs Team and other contributors.
  * Released under the MIT license
  * http://oojs.mit-license.org
  *
- * Date: 2014-10-15T00:40:17Z
+ * Date: 2014-10-15T22:49:59Z
  */
 ( function ( OO ) {
 
@@ -11181,7 +11181,9 @@ OO.ui.MenuWidget.prototype.toggle = function ( visible ) {
        visible = ( visible === undefined ? !this.visible : !!visible ) && !!this.items.length;
 
        var i, len,
-               change = visible !== this.isVisible();
+               change = visible !== this.isVisible(),
+               elementDoc = this.getElementDocument(),
+               widgetDoc = this.$widget ? this.$widget[0].ownerDocument : null;
 
        // Parent method
        OO.ui.MenuWidget.super.prototype.toggle.call( this, visible );
@@ -11205,9 +11207,15 @@ OO.ui.MenuWidget.prototype.toggle = function ( visible ) {
 
                        // Auto-hide
                        if ( this.autoHide ) {
-                               this.getElementDocument().addEventListener(
+                               elementDoc.addEventListener(
                                        'mousedown', this.onDocumentMouseDownHandler, true
                                );
+                               // Support $widget being in a different document
+                               if ( widgetDoc && widgetDoc !== elementDoc ) {
+                                       widgetDoc.addEventListener(
+                                               'mousedown', this.onDocumentMouseDownHandler, true
+                                       );
+                               }
                        }
                } else {
                        this.unbindKeyDownListener();
@@ -11215,9 +11223,15 @@ OO.ui.MenuWidget.prototype.toggle = function ( visible ) {
                                this.$previousFocus[0].focus();
                                this.$previousFocus = null;
                        }
-                       this.getElementDocument().removeEventListener(
+                       elementDoc.removeEventListener(
                                'mousedown', this.onDocumentMouseDownHandler, true
                        );
+                       // Support $widget being in a different document
+                       if ( widgetDoc && widgetDoc !== elementDoc ) {
+                               widgetDoc.removeEventListener(
+                                       'mousedown', this.onDocumentMouseDownHandler, true
+                               );
+                       }
                        this.toggleClipping( false );
                }
        }
@@ -11272,7 +11286,7 @@ OO.ui.TextInputMenuWidget.prototype.onWindowResize = function () {
  * @inheritdoc
  */
 OO.ui.TextInputMenuWidget.prototype.toggle = function ( visible ) {
-       visible = !!visible;
+       visible = visible === undefined ? !this.isVisible() : !!visible;
 
        var change = visible !== this.isVisible();