Merge "API: Generate head items in the context of the given title"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Thu, 7 Jul 2016 22:47:22 +0000 (22:47 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Thu, 7 Jul 2016 22:47:22 +0000 (22:47 +0000)
34 files changed:
RELEASE-NOTES-1.28
autoload.php
composer.json
includes/actions/Action.php
includes/content/CodeContentHandler.php
includes/content/ContentHandler.php
includes/content/TextContentHandler.php
includes/content/WikitextContentHandler.php
includes/gallery/ImageGalleryBase.php
includes/gallery/SliderImageGallery.php [new file with mode: 0644]
includes/search/NullIndexField.php [new file with mode: 0644]
includes/search/SearchEngine.php
includes/search/SearchIndexField.php [new file with mode: 0644]
includes/search/SearchIndexFieldDefinition.php [new file with mode: 0644]
includes/user/User.php
languages/i18n/azb.json
languages/i18n/be-tarask.json
languages/i18n/bs.json
languages/i18n/cs.json
languages/i18n/he.json
languages/i18n/ja.json
languages/i18n/ku-latn.json
languages/i18n/lv.json
languages/i18n/nds-nl.json
languages/i18n/pl.json
languages/i18n/pt.json
languages/i18n/zh-hant.json
maintenance/jsduck/categories.json
resources/Resources.php
resources/src/mediawiki/page/gallery-slider.js [new file with mode: 0644]
resources/src/mediawiki/page/gallery.css
tests/phpunit/includes/content/TextContentHandlerTest.php
tests/phpunit/includes/search/SearchEngineTest.php
tests/phpunit/includes/search/SearchIndexFieldTest.php [new file with mode: 0644]

index 9281a96..6976655 100644 (file)
@@ -19,6 +19,7 @@ production.
 
 === New features in 1.28 ===
 * User::isBot() method for checking if an account is a bot role account.
+* Added a new 'slider' mode for galleries.
 * Added a new hook, 'UserIsBot', to aid in determining if a user is a bot.
 * Added a new hook, 'ApiMakeParserOptions', to allow extensions to better
   interact with API parsing.
index 0211c6d..8e214ce 100644 (file)
@@ -956,6 +956,7 @@ $wgAutoloadLocalClasses = [
        'NukePage' => __DIR__ . '/maintenance/nukePage.php',
        'NullFileJournal' => __DIR__ . '/includes/filebackend/filejournal/FileJournal.php',
        'NullFileOp' => __DIR__ . '/includes/filebackend/FileOp.php',
+       'NullIndexField' => __DIR__ . '/includes/search/NullIndexField.php',
        'NullJob' => __DIR__ . '/includes/jobqueue/jobs/NullJob.php',
        'NullLockManager' => __DIR__ . '/includes/filebackend/lockmanager/LockManager.php',
        'NullRepo' => __DIR__ . '/includes/filerepo/NullRepo.php',
@@ -1209,6 +1210,8 @@ $wgAutoloadLocalClasses = [
        'SearchEngineFactory' => __DIR__ . '/includes/search/SearchEngineFactory.php',
        'SearchExactMatchRescorer' => __DIR__ . '/includes/search/SearchExactMatchRescorer.php',
        'SearchHighlighter' => __DIR__ . '/includes/search/SearchHighlighter.php',
+       'SearchIndexField' => __DIR__ . '/includes/search/SearchIndexField.php',
+       'SearchIndexFieldDefinition' => __DIR__ . '/includes/search/SearchIndexFieldDefinition.php',
        'SearchMssql' => __DIR__ . '/includes/search/SearchMssql.php',
        'SearchMySQL' => __DIR__ . '/includes/search/SearchMySQL.php',
        'SearchNearMatchResultSet' => __DIR__ . '/includes/search/SearchNearMatchResultSet.php',
@@ -1248,6 +1251,7 @@ $wgAutoloadLocalClasses = [
        'SkinFallback' => __DIR__ . '/includes/skins/SkinFallback.php',
        'SkinFallbackTemplate' => __DIR__ . '/includes/skins/SkinFallbackTemplate.php',
        'SkinTemplate' => __DIR__ . '/includes/skins/SkinTemplate.php',
+       'SliderImageGallery' => __DIR__ . '/includes/gallery/SliderImageGallery.php',
        'SpecialActiveUsers' => __DIR__ . '/includes/specials/SpecialActiveusers.php',
        'SpecialAllMessages' => __DIR__ . '/includes/specials/SpecialAllMessages.php',
        'SpecialAllMyUploads' => __DIR__ . '/includes/specials/SpecialMyRedirectPages.php',
index 0e512a6..04a5e85 100644 (file)
@@ -40,7 +40,7 @@
                "wikimedia/relpath": "1.0.3",
                "wikimedia/running-stat": "1.1.0",
                "wikimedia/utfnormal": "1.0.3",
-               "wikimedia/wrappedstring": "2.0.0",
+               "wikimedia/wrappedstring": "2.1.1",
                "zordius/lightncandy": "0.23"
        },
        "require-dev": {
index 84bf16e..f06f828 100644 (file)
@@ -88,7 +88,7 @@ abstract class Action {
         * @since 1.17
         * @param string $action
         * @param Page $page
-        * @param IContextSource $context
+        * @param IContextSource|null $context
         * @return Action|bool|null False if the action is disabled, null
         *     if it is not recognised
         */
@@ -264,7 +264,7 @@ abstract class Action {
         * Only public since 1.21
         *
         * @param Page $page
-        * @param IContextSource $context
+        * @param IContextSource|null $context
         */
        public function __construct( Page $page, IContextSource $context = null ) {
                if ( $context === null ) {
index 694b633..2bbf6ca 100644 (file)
@@ -63,4 +63,12 @@ abstract class CodeContentHandler extends TextContentHandler {
        protected function getContentClass() {
                throw new MWException( 'Subclass must override' );
        }
+
+       /**
+        * @param SearchEngine $engine
+        * @return array
+        */
+       public function getFieldsForSearchIndex( SearchEngine $engine ) {
+               return [];
+       }
 }
index e225fb7..1ecd614 100644 (file)
@@ -1248,4 +1248,26 @@ abstract class ContentHandler {
 
                return $ok;
        }
+
+       /**
+        * Get fields definition for search index
+        * @param SearchEngine $engine
+        * @return SearchIndexField[] List of fields this content handler can provide.
+        * @since 1.28
+        */
+       public function getFieldsForSearchIndex( SearchEngine $engine ) {
+               /* Default fields:
+               /*
+                * namespace
+                * namespace_text
+                * redirect
+                * source_text
+                * suggest
+                * timestamp
+                * title
+                * text
+                * text_bytes
+                */
+               return [];
+       }
 }
index ad40cd9..748c810 100644 (file)
@@ -31,8 +31,7 @@
 class TextContentHandler extends ContentHandler {
 
        // @codingStandardsIgnoreStart bug 57585
-       public function __construct( $modelId = CONTENT_MODEL_TEXT,
-               $formats = [ CONTENT_FORMAT_TEXT ] ) {
+       public function __construct( $modelId = CONTENT_MODEL_TEXT, $formats = [ CONTENT_FORMAT_TEXT ] ) {
                parent::__construct( $modelId, $formats );
        }
        // @codingStandardsIgnoreEnd
@@ -41,7 +40,7 @@ class TextContentHandler extends ContentHandler {
         * Returns the content's text as-is.
         *
         * @param Content $content
-        * @param string $format The serialization format to check
+        * @param string  $format The serialization format to check
         *
         * @return mixed
         */
@@ -143,4 +142,10 @@ class TextContentHandler extends ContentHandler {
                return true;
        }
 
+       public function getFieldsForSearchIndex( SearchEngine $engine ) {
+               $fields = [];
+               $fields['language'] =
+                       $engine->makeSearchFieldMapping( 'language', SearchIndexField::INDEX_TYPE_KEYWORD );
+               return $fields;
+       }
 }
index 0701a0f..86f0d50 100644 (file)
@@ -108,4 +108,40 @@ class WikitextContentHandler extends TextContentHandler {
                return true;
        }
 
+       public function getFieldsForSearchIndex( SearchEngine $engine ) {
+               $fields = [];
+
+               $fields['category'] =
+                       $engine->makeSearchFieldMapping( 'category', SearchIndexField::INDEX_TYPE_TEXT );
+               $fields['category']->setFlag( SearchIndexField::FLAG_CASEFOLD );
+
+               $fields['external_link'] =
+                       $engine->makeSearchFieldMapping( 'external_link', SearchIndexField::INDEX_TYPE_KEYWORD );
+
+               $fields['heading'] =
+                       $engine->makeSearchFieldMapping( 'heading', SearchIndexField::INDEX_TYPE_TEXT );
+               $fields['heading']->setFlag( SearchIndexField::FLAG_SCORING );
+
+               $fields['auxiliary_text'] =
+                       $engine->makeSearchFieldMapping( 'auxiliary_text', SearchIndexField::INDEX_TYPE_TEXT );
+
+               $fields['opening_text'] =
+                       $engine->makeSearchFieldMapping( 'opening_text', SearchIndexField::INDEX_TYPE_TEXT );
+               $fields['opening_text']->setFlag( SearchIndexField::FLAG_SCORING );
+
+               $fields['outgoing_link'] =
+                       $engine->makeSearchFieldMapping( 'outgoing_link', SearchIndexField::INDEX_TYPE_KEYWORD );
+
+               $fields['template'] =
+                       $engine->makeSearchFieldMapping( 'template', SearchIndexField::INDEX_TYPE_KEYWORD );
+               $fields['template']->setFlag( SearchIndexField::FLAG_CASEFOLD );
+
+               // FIXME: this really belongs in separate file handler but files
+               // do not have separate handler. Sadness.
+               $fields['file_text'] =
+                       $engine->makeSearchFieldMapping( 'file_text', SearchIndexField::INDEX_TYPE_TEXT );
+
+               return $fields;
+       }
+
 }
index c8a25f0..73f4b19 100644 (file)
@@ -113,6 +113,7 @@ abstract class ImageGalleryBase extends ContextSource {
                                'packed' => 'PackedImageGallery',
                                'packed-hover' => 'PackedHoverImageGallery',
                                'packed-overlay' => 'PackedOverlayImageGallery',
+                               'slider' => 'SliderImageGallery',
                        ];
                        // Allow extensions to make a new gallery format.
                        Hooks::run( 'GalleryGetModes', [ &self::$modeMapping ] );
diff --git a/includes/gallery/SliderImageGallery.php b/includes/gallery/SliderImageGallery.php
new file mode 100644 (file)
index 0000000..67be9ce
--- /dev/null
@@ -0,0 +1,37 @@
+<?php
+/**
+ * Slider gallery shows one image at a time with controls to move around.
+ *
+ * This program is free software; you can redistribute it and/or modify
+ * it under the terms of the GNU General Public License as published by
+ * the Free Software Foundation; either version 2 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License along
+ * with this program; if not, write to the Free Software Foundation, Inc.,
+ * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
+ * http://www.gnu.org/copyleft/gpl.html
+ *
+ * @file
+ */
+
+class SliderImageGallery extends TraditionalImageGallery {
+       function __construct( $mode = 'traditional', IContextSource $context = null ) {
+               parent::__construct( $mode, $context );
+               // Does not support per row option.
+               $this->mPerRow = 0;
+       }
+
+       /**
+        * Add javascript adds interface elements
+        * @return array
+        */
+       protected function getModules() {
+               return [ 'mediawiki.page.gallery.slider' ];
+       }
+}
diff --git a/includes/search/NullIndexField.php b/includes/search/NullIndexField.php
new file mode 100644 (file)
index 0000000..933e0ad
--- /dev/null
@@ -0,0 +1,45 @@
+<?php
+
+/**
+ * Null index field - means search engine does not implement this field.
+ */
+class NullIndexField implements SearchIndexField {
+
+       /**
+        * Get mapping for specific search engine
+        * @param SearchEngine $engine
+        * @return array|null Null means this field does not map to anything
+        */
+       public function getMapping( SearchEngine $engine ) {
+               return null;
+       }
+
+       /**
+        * Set global flag for this field.
+        *
+        * @param int  $flag Bit flag to set/unset
+        * @param bool $unset True if flag should be unset, false by default
+        * @return $this
+        */
+       public function setFlag( $flag, $unset = false ) {
+       }
+
+       /**
+        * Check if flag is set.
+        * @param $flag
+        * @return int 0 if unset, !=0 if set
+        */
+       public function checkFlag( $flag ) {
+               return 0;
+       }
+
+       /**
+        * Merge two field definitions if possible.
+        *
+        * @param SearchIndexField $that
+        * @return SearchIndexField|false New definition or false if not mergeable.
+        */
+       public function merge( SearchIndexField $that ) {
+               return $that;
+       }
+}
index 0171ed9..9168d64 100644 (file)
@@ -655,6 +655,46 @@ abstract class SearchEngine {
                return null;
        }
 
+       /**
+        * Create a search field definition.
+        * Specific search engines should override this method to create search fields.
+        * @param string $name
+        * @param int    $type
+        * @return SearchIndexField
+        * @since 1.28
+        */
+       public function makeSearchFieldMapping( $name, $type ) {
+               return new NullIndexField();
+       }
+
+       /**
+        * Get fields for search index
+        * @since 1.28
+        * @return SearchIndexField[] Index field definitions for all content handlers
+        */
+       public function getSearchIndexFields() {
+               $models = ContentHandler::getContentModels();
+               $fields = [];
+               foreach ( $models as $model ) {
+                       $handler = ContentHandler::getForModelID( $model );
+                       $handlerFields = $handler->getFieldsForSearchIndex( $this );
+                       foreach ( $handlerFields as $fieldName => $fieldData ) {
+                               if ( empty( $fields[$fieldName] ) ) {
+                                       $fields[$fieldName] = $fieldData;
+                               } else {
+                                       // TODO: do we allow some clashes with the same type or reject all of them?
+                                       $mergeDef = $fields[$fieldName]->merge( $fieldData );
+                                       if ( !$mergeDef ) {
+                                               throw new InvalidArgumentException( "Duplicate field $fieldName for model $model" );
+                                       }
+                                       $fields[$fieldName] = $mergeDef;
+                               }
+                       }
+               }
+               // Hook to allow extensions to produce search mapping fields
+               Hooks::run( 'SearchIndexFields', [ &$fields, $this ] );
+               return $fields;
+       }
 }
 
 /**
diff --git a/includes/search/SearchIndexField.php b/includes/search/SearchIndexField.php
new file mode 100644 (file)
index 0000000..2ea255f
--- /dev/null
@@ -0,0 +1,63 @@
+<?php
+/**
+ * Definition of a mapping for the search index field.
+ * @since 1.28
+ */
+interface SearchIndexField {
+       /**
+        * Field types
+        */
+       const INDEX_TYPE_TEXT = 0;
+       const INDEX_TYPE_KEYWORD = 1;
+       const INDEX_TYPE_INTEGER = 2;
+       const INDEX_TYPE_NUMBER = 3;
+       const INDEX_TYPE_DATETIME = 4;
+       const INDEX_TYPE_NESTED = 5;
+       const INDEX_TYPE_BOOL = 6;
+       /**
+        * Generic field flags.
+        */
+       /**
+        * This field is case-insensitive.
+        */
+       const FLAG_CASEFOLD = 1;
+       /**
+        * This field is for scoring only.
+        */
+       const FLAG_SCORING = 2;
+       /**
+        * This field does not need highlight handling.
+        */
+       const FLAG_NO_HIGHLIGHT = 4;
+       /**
+        * Do not index this field.
+        */
+       const FLAG_NO_INDEX = 8;
+       /**
+        * Get mapping for specific search engine
+        * @param SearchEngine $engine
+        * @return array|null Null means this field does not map to anything
+        */
+       public function getMapping( SearchEngine $engine );
+       /**
+        * Set global flag for this field.
+        *
+        * @param int  $flag Bit flag to set/unset
+        * @param bool $unset True if flag should be unset, false by default
+        * @return $this
+        */
+       public function setFlag( $flag, $unset = false );
+       /**
+        * Check if flag is set.
+        * @param $flag
+        * @return int 0 if unset, !=0 if set
+        */
+       public function checkFlag( $flag );
+       /**
+        * Merge two field definitions if possible.
+        *
+        * @param SearchIndexField $that
+        * @return SearchIndexField|false New definition or false if not mergeable.
+        */
+       public function merge( SearchIndexField $that );
+}
diff --git a/includes/search/SearchIndexFieldDefinition.php b/includes/search/SearchIndexFieldDefinition.php
new file mode 100644 (file)
index 0000000..3a86c82
--- /dev/null
@@ -0,0 +1,118 @@
+<?php
+
+/**
+ * Basic infrastructure of the field definition.
+ * Specific engines will need to override it at least for getMapping,
+ * but can reuse other parts.
+ * @since 1.28
+ */
+abstract class SearchIndexFieldDefinition implements SearchIndexField {
+       /**
+        * Name of the field
+        *
+        * @var string
+        */
+       protected $name;
+       /**
+        * Type of the field, one of the constants above
+        *
+        * @var int
+        */
+       protected $type;
+       /**
+        * Bit flags for the field.
+        *
+        * @var int
+        */
+       protected $flags = 0;
+       /**
+        * Subfields
+        * @var SearchIndexFieldDefinition[]
+        */
+       protected $subfields = [];
+
+       /**
+        * SearchIndexFieldDefinition constructor.
+        * @param string $name Field name
+        * @param int    $type Index type
+        */
+       public function __construct( $name, $type ) {
+               $this->name = $name;
+               $this->type = $type;
+       }
+
+       /**
+        * Get field name
+        * @return string
+        */
+       public function getName() {
+               return $this->name;
+       }
+
+       /**
+        * Get index type
+        * @return int
+        */
+       public function getIndexType() {
+               return $this->type;
+       }
+
+       /**
+        * Set global flag for this field.
+        *
+        * @param int  $flag Bit flag to set/unset
+        * @param bool $unset True if flag should be unset, false by default
+        * @return $this
+        */
+       public function setFlag( $flag, $unset = false ) {
+               if ( $unset ) {
+                       $this->flags &= ~$flag;
+               } else {
+                       $this->flags |= $flag;
+               }
+               return $this;
+       }
+
+       /**
+        * Check if flag is set.
+        * @param $flag
+        * @return int 0 if unset, !=0 if set
+        */
+       public function checkFlag( $flag ) {
+               return $this->flags & $flag;
+       }
+
+       /**
+        * Merge two field definitions if possible.
+        *
+        * @param SearchIndexField $that
+        * @return SearchIndexField|false New definition or false if not mergeable.
+        */
+       public function merge( SearchIndexField $that ) {
+               // TODO: which definitions may be compatible?
+               if ( ( $that instanceof self ) && $this->type === $that->type &&
+                    $this->flags === $that->flags && $this->type !== self::INDEX_TYPE_NESTED
+               ) {
+                       return $that;
+               }
+               return false;
+       }
+
+       /**
+        * Get subfields
+        * @return SearchIndexFieldDefinition[]
+        */
+       public function getSubfields() {
+               return $this->subfields;
+       }
+
+       /**
+        * Set subfields
+        * @param SearchIndexFieldDefinition[] $subfields
+        * @return $this
+        */
+       public function setSubfields( array $subfields ) {
+               $this->subfields = $subfields;
+               return $this;
+       }
+}
index 40b5b40..4a92f65 100644 (file)
@@ -1524,16 +1524,19 @@ class User implements IDBAccessObject {
                global $wgNamespacesToBeSearchedDefault, $wgDefaultUserOptions, $wgContLang, $wgDefaultSkin;
 
                static $defOpt = null;
-               if ( !defined( 'MW_PHPUNIT_TEST' ) && $defOpt !== null ) {
-                       // Disabling this for the unit tests, as they rely on being able to change $wgContLang
-                       // mid-request and see that change reflected in the return value of this function.
-                       // Which is insane and would never happen during normal MW operation
+               static $defOptLang = null;
+
+               if ( $defOpt !== null && $defOptLang === $wgContLang->getCode() ) {
+                       // $wgContLang does not change (and should not change) mid-request,
+                       // but the unit tests change it anyway, and expect this method to
+                       // return values relevant to the current $wgContLang.
                        return $defOpt;
                }
 
                $defOpt = $wgDefaultUserOptions;
                // Default language setting
-               $defOpt['language'] = $wgContLang->getCode();
+               $defOptLang = $wgContLang->getCode();
+               $defOpt['language'] = $defOptLang;
                foreach ( LanguageConverter::$languagesWithVariants as $langCode ) {
                        $defOpt[$langCode == $wgContLang->getCode() ? 'variant' : "variant-$langCode"] = $langCode;
                }
index 2d8a3c9..d8d2dcc 100644 (file)
        "prefs-editwatchlist-edit": "ایزلدیکلرینیزدن گورمک هابئله باشلیق لارین سیلمک",
        "prefs-editwatchlist-raw": "ایزله‌دیگیم خام لیستی دَییشدیر",
        "prefs-editwatchlist-clear": "ایزله دیگیم لیستی سیلمک",
-       "prefs-watchlist-days": "اÛ\8cزÙ\84Ù\87â\80\8cدÛ\8cÚ©â\80\8cÙ\84رÛ\8cÙ\85دÙ\87 Ú¯Ø¤Ø±Ø³Ø¯Û\8cÙ\84Ù\86 Ú¯Û\86Ù\86â\80\8cÙ\84ر",
+       "prefs-watchlist-days": "اÛ\8cزÙ\84Ù\87â\80\8cدÛ\8cÚ©â\80\8cÙ\84رÛ\8cÙ\85دÙ\87 Ú¯Ø¤Ø³ØªØ±Û\8cÙ\84Ù\86 Ú¯Û\86Ù\86Ù\84ر:",
        "prefs-watchlist-days-max": "چوخو {{PLURAL:$1|بیر|$1}} گون",
-       "prefs-watchlist-edits": "گنیشلنمیش ایزله‌ دیک لرده گؤرسدیلن دَییشیک‌لیک‌لرین چوْخو:",
+       "prefs-watchlist-edits": "گئنیشلنمیش ایزله‌‌دیک‌لرده گؤستریلن دَییشیک‌لیک‌لرین ان چوْخو:",
        "prefs-watchlist-edits-max": "چوخ سایی: ۱۰۰۰",
        "prefs-watchlist-token": "ایزله‌دیک‌لر آدرسی:",
        "prefs-misc": "باشقا",
        "stub-threshold": "<a href=\"#\" class=\"stub\">باغلانتی‌سیز لینکی</a> دییشدیرمک اوچون حدود (بایت‌لارلا):",
        "stub-threshold-sample-link": "میثال",
        "stub-threshold-disabled": "چالیشمایان",
-       "recentchangesdays": "سÙ\88Ù\92Ù\86 Ø¯Û\8cÛ\8cØ´Û\8cÚ©â\80\8câ\80\8cÙ\84ردÙ\87 Ú¯Ø¤Ø±Ø³Ø¯Û\8cÙ\84Ù\86 Ú¯Û\86Ù\86â\80\8cلر:",
+       "recentchangesdays": "سÙ\88Ù\92Ù\86 Ø¯Û\8cÛ\8cØ´Û\8cÚ©â\80\8câ\80\8cÙ\84ردÙ\87 Ú¯Ø¤Ø³ØªØ±Û\8cÙ\84Ù\86 Ú¯Û\86Ù\86لر:",
        "recentchangesdays-max": "ماکسیموم $1 {{PLURAL:$1|گون |گون}}",
        "recentchangescount": "سوْن ديَیشیک‌لیک‌لرده باشلیق سايی:",
        "prefs-help-recentchangescount": "بورایا یئنی دییشیک‌لیک‌لر، صحیفه‌لرین و ژورنال‌لارین تاریخچه‌سی داخیل‌دیر.",
index 0765058..568b219 100644 (file)
        "trackingcategories-name": "Назва паведамленьня",
        "trackingcategories-desc": "Крытэр уключэньня ў катэгорыю",
        "restricted-displaytitle-ignored": "Старонкі, дзе ігнаруюцца назвы для адлюстраваньня",
+       "restricted-displaytitle-ignored-desc": "Старонка ігнаруе <code><nowiki>{{DISPLAYTITLE}}</nowiki></code>, бо ён не супадае зь цяперашняй назвай старонкі.",
        "noindex-category-desc": "Гэтая старонка не індэксуецца пошукавымі робатамі, таму што на ёй маецца магічнае слова <code><nowiki>__NOINDEX__</nowiki></code>, а старонка знаходзіцца ў прасторы назваў, дзе дазволны гэты сьцяг.",
        "index-category-desc": "На старонцы знаходзіцца магічнае слова <code><nowiki>__INDEX__</nowiki></code> (пры гэтым старонка знаходзіцца ў прасторы назваў, дзе дазволены гэты сьцяг), таму яна індэксуецца пошукавымі робатамі ў тых выпадках, калі звычайна гэтага не адбываецца.",
        "post-expand-template-inclusion-category-desc": "Памер старонкі перавысіў <code>$wgMaxArticleSize</code> пасьля разгортваньня ўсіх шаблёнаў, таму некаторыя шаблёны не былі паказаныя цалкам.",
index 6c710f1..5a5388e 100644 (file)
        "history-feed-item-nocomment": "$1 u $2",
        "history-feed-empty": "Tražena stranica ne postoji.\nMoguće da je izbrisana sa wikija, ili preimenovana.\nPokušajte [[Special:Search|pretražiti wiki]] za slične stranice.",
        "history-edit-tags": "Uredi oznake izabranih verzija",
-       "rev-deleted-comment": "(uklonjen sažetak izmjene)",
+       "rev-deleted-comment": "(sažetak izmjene uklonjen)",
        "rev-deleted-user": "(korisničko ime uklonjeno)",
        "rev-deleted-event": "(stavka zapisa obrisana)",
        "rev-deleted-user-contribs": "[korisničko ime ili IP adresa uklonjeni - izmjena sakrivena u spisku doprinosa]",
        "rev-suppressed-text-unhide": "Ova revizija stranice je '''uklonjena'''.\nMožete pogledati detalje u [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} zapisu uklanjanja].\nVi je i dalje možete [$1 vidjeti ovu reviziju] ako želite.",
        "rev-deleted-text-view": "Revizija ove stranice je '''obrisana'''.\nVi je možete vidjeti; detalji o tome se mogu vidjeti u [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} zapisu brisanja].",
        "rev-suppressed-text-view": "Ova revizija stranice je '''uklonjena'''.\nVi je možete vidjeti; možete pogledati detalje u [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} zapisu uklanjanja].",
-       "rev-deleted-no-diff": "Ne možete vidjeti ove razlike jer je jedna od revizija '''obrisana'''.\nMožete pregledati detalje u [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} zapisima brisanja].",
+       "rev-deleted-no-diff": "Ne možete vidjeti ovu razliku jer je jedna od izmjena '''obrisana'''.\nDetalji se nalaze u [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} zapisniku brisanja].",
        "rev-suppressed-no-diff": "Ne možete vidjeti ove razlike jer je jedna od revizija '''obrisana'''.",
        "rev-deleted-unhide-diff": "Jedna od revizija u ovom pregledu razlika je '''obrisana'''.\nMožete pregledati detalje u [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} zapisniku brisanja].\nVi još uvijek možete [$1 vidjeti ove razlike] ako želite da nastavite.",
        "rev-suppressed-unhide-diff": "edna od revizija ove razlike je '''uklonjena'''.\nMožete pogledati detalje u [{{fullurl:{{#Special:Log}}/suppress|page={{FULLPAGENAMEE}}}} zapisniku uklanjanja].\nVi i dalje možete [$1 vidjeti ove razlike] ako želite da nastavite.",
        "listusersfrom": "Prikaži korisnike koji počinju sa:",
        "listusers-submit": "Prikaži",
        "listusers-noresult": "Nije pronađen korisnik.",
-       "listusers-blocked": "(blokiran)",
+       "listusers-blocked": "({{GENDER:$1|blokiran|blokirana|blokiran}})",
        "activeusers": "Spisak aktivnih korisnika",
        "activeusers-intro": "Ovo je spisak korisnika koji su imali neku aktivnost u {{PLURAL:$1|posljednji $1 dan|posljednja $1 dana|posljednjih $1 dana}}.",
        "activeusers-count": "$1 {{PLURAL:$1|izmjena|izmjene|izmjena}} u {{PLURAL:$3|posljednji $3 dan|posljednja $3 dana|posljednjih $3 dana}}",
        "logentry-suppress-revision-legacy": "$1 je tajno {{GENDER:$2|promijenio|promijenila}} vidljivost izmjena na stranici $3",
        "revdelete-content-hid": "sadržaj je sakriven",
        "revdelete-summary-hid": "sažetak izmjene je sakriven",
-       "revdelete-uname-hid": "sažetak izmjene je sakriven",
+       "revdelete-uname-hid": "korisničko ime je sakriveno",
        "revdelete-content-unhid": "sadržaj je otkriven",
        "revdelete-summary-unhid": "sažetak izmjene je otkriven",
        "revdelete-uname-unhid": "korisničko ime je otkriveno",
index c09a07f..20b196f 100644 (file)
        "group-suppress-member": "{{GENDER:$1|utajovatel|utajovatelka|utajovatel}}",
        "grouppage-user": "{{ns:project}}:Uživatelé",
        "grouppage-autoconfirmed": "{{ns:project}}:Automaticky schválení uživatelé",
-       "grouppage-bot": "{{ns:project}}:Boti",
+       "grouppage-bot": "{{ns:project}}:Roboti",
        "grouppage-sysop": "{{ns:project}}:Správci",
        "grouppage-bureaucrat": "{{ns:project}}:Byrokraté",
        "grouppage-suppress": "{{ns:project}}:Utajovatelé",
index 5e42b6b..5be8914 100644 (file)
        "mostimages": "הקבצים המקושרים ביותר",
        "mostinterwikis": "הדפים עם המספר הרב ביותר של קישורי בינוויקי",
        "mostrevisions": "הדפים עם מספר העריכות הגבוה ביותר",
-       "prefixindex": "כל דפים עם התחילית",
-       "prefixindex-namespace": "כל דפים עם התחילית (במרחב השם $1)",
+       "prefixindex": "×\9b×\9c ×\94×\93פ×\99×\9d ×¢×\9d ×\94ת×\97×\99×\9c×\99ת",
+       "prefixindex-namespace": "×\9b×\9c ×\94×\93פ×\99×\9d ×¢×\9d ×\94ת×\97×\99×\9c×\99ת (×\91×\9eר×\97×\91 ×\94ש×\9d $1)",
        "prefixindex-submit": "הצגה",
        "prefixindex-strip": "הסתרת התחילית ברשימה",
        "shortpages": "דפים קצרים",
        "tooltip-pt-anontalk": "דיון על העריכות שנעשו מכתובת ה־IP הזאת",
        "tooltip-pt-preferences": "ההעדפות שלך",
        "tooltip-pt-watchlist": "רשימת הדפים ש{{GENDER:|אתה עוקב|את עוקבת}} אחרי השינויים בהם",
-       "tooltip-pt-mycontris": "רש×\99×\9eת ×\94תר×\95×\9e×\95ת ×©×\9c×\9a",
+       "tooltip-pt-mycontris": "רש×\99×\9eת ×\94ער×\99×\9b×\95ת ×©×\91×\99צעת",
        "tooltip-pt-anoncontribs": "רשימת העריכות שנעשו מכתובת ה־IP הזאת",
        "tooltip-pt-login": "מומלץ להיכנס לחשבון, אך אין חובה לעשות זאת",
        "tooltip-pt-logout": "יציאה מהחשבון",
index f76e11d..bdcf4ff 100644 (file)
        "passwordreset-emailerror-capture2": "{{GENDER:$2|利用者}}へのメール送信に失敗しました: $1{{PLURAL:$3|利用者名とパスワード|利用者名とパスワードの一覧}}は以下のとおりです。",
        "passwordreset-ignored": "パスワードのリセットが処理されませんでした。プロバイダーが設定されていない可能性があります。",
        "passwordreset-invalideamil": "無効なメールアドレスです",
-       "changeemail": "ã\83¡ã\83¼ã\83«ã\82¢ã\83\89ã\83¬ã\82¹ã\82\92変更または除去",
+       "changeemail": "ã\83¡ã\83¼ã\83«ã\82¢ã\83\89ã\83¬ã\82¹ã\81®変更または除去",
        "changeemail-header": "あなたのメールアドレスを変更するには、このフォームを完成させます。もし、あなたのアカウントから任意のメールアドレスの関連付けを削除したい場合は、フォームの送信時に、新しいメールアドレスを空白のままにします。",
        "changeemail-passwordrequired": "この変更を確認するためにパスワードを入力する必要があります。",
        "changeemail-no-info": "このページに直接アクセスするためにはログインしている必要があります。",
index 4ac8813..f8eb4f9 100644 (file)
        "minoredit": "Ev guhertineke biçûk e",
        "watchthis": "Vê gotarê bişopîne",
        "savearticle": "Rûpelê tomar bike",
+       "savechanges": "Guherandinan tomar bike",
        "preview": "Pêşdîtin",
        "showpreview": "Pêşdîtinê nîşan bide",
        "showdiff": "Guherandinan nîşan bide",
index 3301f8a..6a310c4 100644 (file)
        "createacct-reason-ph": "Kāpēc jūs veidojat citu kontu",
        "createacct-submit": "Izveidot savu kontu",
        "createacct-another-submit": "Izveidot citu dalībnieka kontu",
+       "createacct-continue-submit": "Turpināt konta izveidi",
+       "createacct-another-continue-submit": "Turpināt konta izveidi",
        "createacct-benefit-heading": "{{SITENAME}} darbojas ar tādu cilvēku kā Tu ieguldījumu.",
        "createacct-benefit-body1": "{{PLURAL:$1|labojumi|labojums|labojumi}}",
        "createacct-benefit-body2": "{{PLURAL:$1|lapas|lapa|lapas}}",
        "newpassword": "Jaunā parole",
        "retypenew": "Atkārto jauno paroli",
        "resetpass_submit": "Uzstādīt paroli un ieiet",
-       "changepassword-success": "Jūsu parole tika nomainīta veiksmīgi!",
+       "changepassword-success": "Tava parole tika nomainīta!",
        "botpasswords": "Botu paroles",
+       "botpasswords-existing": "Esošās botu paroles",
        "botpasswords-createnew": "Izveidot jaunu bota paroli",
        "botpasswords-editexisting": "Rediģētu esošu bota paroli",
        "botpasswords-label-appid": "Bota nosaukums:",
        "passwordreset-emailsentemail": "Paroles atiestatīšanas e-pasts ir nosūtīts.",
        "passwordreset-emailsent-capture": "Atgādinājuma e-pasta ziņojums ir nosūtīts, tas parādīts zemāk.",
        "passwordreset-emailerror-capture": "Atgādinājuma e-pasta ziņojums tika izveidots, tas parādīts zemāk, bet nosūtīšana lietotājam neizdevās: $1",
+       "passwordreset-nosuchcaller": "Izsaucējs nepastāv: $1",
+       "passwordreset-invalideamil": "Nederīga e-pasta adrese",
        "changeemail": "Mainīt e-pasta adresi",
        "changeemail-header": "Mainīt konta e-pasta adresi",
        "changeemail-oldemail": "Pašreizējā e-pasta adrese:",
        "history-feed-empty": "Pieprasītā lapa nepastāv.\nIespējams, tā ir izdzēsta vai pārdēvēta.\nMēģiniet [[Special:Search|meklēt]], lai atrastu saistītas lapas!",
        "rev-deleted-comment": "(labojuma kopsavilkums dzēsts)",
        "rev-deleted-user": "(lietotāja vārds nodzēsts)",
-       "rev-deleted-event": "(reģistra ieraksts nodzēsts)",
+       "rev-deleted-event": "(reģistra detaļas noņemtas)",
        "rev-deleted-user-contribs": "[lietotājvārds vai IP adrese ir dzēsta — izmaiņa slēpta no devuma]",
        "rev-deleted-text-permission": "Šī lapas versija ir '''dzēsta'''.\nSīkāku informāciju var atrast [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} dzēšanas reģistrā].",
        "rev-deleted-text-view": "Šī lapas versija ir '''dzēsta'''.\nTo varat apskatīt, jo esat administrators. Sīkāku informāciju var atrast [{{fullurl:{{#Special:Log}}/delete|page={{FULLPAGENAMEE}}}} dzēšanas reģistrā].",
        "rightslogtext": "Šis ir dalībnieku tiesību izmaiņu reģistrs.",
        "action-read": "lasīt šo lapu",
        "action-edit": "labot šo lapu",
-       "action-createpage": "izveidot lapas",
+       "action-createpage": "izveidot šo lapu",
        "action-createtalk": "izveidot diskusiju lapas",
        "action-createaccount": "izveidot šo dalībnieka kontu",
        "action-history": "apskatīt šīs lapas vēsturi",
        "boteditletter": "b",
        "number_of_watching_users_pageview": "[šo lapu uzrauga $1 {{PLURAL:$1|dalībnieki|dalībnieks|dalībnieki}}]",
        "rc_categories": "Ierobežot uz kategorijām (atdalīt ar \"|\"):",
-       "rc_categories_any": "Jebkas",
+       "rc_categories_any": "Jebkas no izvēlētā",
        "rc-change-size-new": "$1 {{PLURAL:$1|baiti|baits|baiti}} pēc izmaiņām",
        "newsectionsummary": "/* $1 */ jauna sadaļa",
        "rc-enhanced-expand": "Skatīt detaļas",
        "recentchangeslinked-summary": "Šiet ir nesen izdarītās izmaiņas lapās, uz kurām ir saites no norādītās lapas (vai norādītajā kategorijā ietilpstošās lapas).\nLapas, kas ir tavā [[Special:Watchlist|uzraugāmo rakstu sarakstā]] ir '''treknas'''.",
        "recentchangeslinked-page": "Lapas nosaukums:",
        "recentchangeslinked-to": "Rādīt izmaiņas lapās, kurās ir saites uz šo lapu (nevis lapās uz kurām ir saites no šīs lapas)",
+       "autochange-username": "MediaWiki automātiskā izmaiņa",
        "upload": "Augšupielādēt failu",
        "uploadbtn": "Augšupielādēt",
        "reuploaddesc": "Atcelt augšupielādi un atgriezties pie augšupielādes veidnes.",
        "uploaderror": "Augšupielādes kļūda",
        "upload-recreate-warning": "<strong>Brīdinājums: Fails ar šādu nosaukumu ir dzēsts vai pārvietots.</strong>\n\nDzēšanas un pārvietošanas reģistri šai lapai ir pieejami šeit:",
        "uploadtext": "Pirms tu kaut ko augšupielādē, noteikti izlasi un ievēro [[Project:Attēlu izmantošanas noteikumi|attēlu izmantošanas noteikumus]].\n\nLai aplūkotu vai meklētu agrāk augšupielādētus attēlus,\ndodies uz [[Special:FileList|augšupielādēto attēlu sarakstu]].\nAugšupielādes un dzēšanas tiek reģistrētas [[Special:Log/upload|augšupielādes reģistrā]] un [[Special:Log/delete|dzēšanas reģistrā]].\n\nIzmanto šo veidni, lai augšupielādētu jaunus attēlu failus, ar kuriem ilustrēt tevis izmainītās lapas.\nGandrīz visos pārlūkos tev vajadzētu redzēt pogu '''\"Choose...\",''' kuru spiežot parādīsies faila atvēršanas dialogs.\nIzvēloties kādu failu, tā adrese parādīsies ailītē blakus šai pogai.\nTev ir arī jāatzīmē ailīte, kas apstiprina, ka tu nepārkāp nekādas autortiesības, augšupielādējot šo failu.\nSpied pogu '''Augšupielādēt''', lai pabeigtu augšupielādi.\nTas var ieilgt, ja tavs interneta pieslēgums ir lēns.\n\nIeteicamie formāti ir:\n* JPEG - ja tā ir fotogrāfija,\n* PNG - ja tas ir zīmējums vai kāda ikona, un\n* OGG - ja tas ir skaņas fails.\n\nLūdzu, pārliecinies, ka faila nosaukums ir pietiekami aprakstošs, lai izvairītos no neskaidrībām. Lai attēlu pēc tam ievietotu kādā lapā, izmanto šādi noformētu linkus:\n* '''<nowiki>[[</nowiki>{{ns:file}}<nowiki>:Fails.jpg|paskaidrojošs teksts]]</nowiki>'''\n* '''<nowiki>[[</nowiki>{{ns:file}}<nowiki>:Fails.png|paskaidrojošs teksts]]</nowiki>'''\nvai skaņām\n* '''<nowiki>[[</nowiki>{{ns:media}}<nowiki>:Fails.ogg]]</nowiki>'''\n\nLūdzu, ņem vērā, ka tāpat kā citas wiki lapas arī tevis augšupielādētos failus citi var mainīt vai dzēst, ja uzskata, ka tas nāktu par labu šim projektam, kā arī atceries, ka tev var tikt liegta augšupielādes iespēja, ja tu šo sistēmu.",
-       "upload-permitted": "Atļautie failu tipi: $1.",
-       "upload-preferred": "Ieteicamie failu tipi: $1.",
-       "upload-prohibited": "Aizliegtie failu tipi: $1.",
+       "upload-permitted": "Atļautie failu {{PLURAL:$2|tipi|tips|tipi}}: $1.",
+       "upload-preferred": "Ieteicamie failu {{PLURAL:$2|tipi|tips|tipi}}: $1.",
+       "upload-prohibited": "Aizliegtie failu {{PLURAL:$2|tipi|tips|tipi}}: $1.",
        "uploadlogpage": "Augšupielādes reģistrs",
        "uploadlogpagetext": "Zemāk ir redzams jaunāko augšuplādēto failu saraksts.\nPārskatāmāka versija ir pieejama [[Special:NewFiles|jauno attēlu galerijā]].",
        "filename": "Faila nosaukums",
        "listfiles_thumb": "Sīktēls",
        "listfiles_date": "Datums",
        "listfiles_name": "Nosaukums",
-       "listfiles_user": "Lietotājs",
+       "listfiles_user": "Dalībnieks",
        "listfiles_size": "Izmērs",
        "listfiles_description": "Apraksts",
        "listfiles_count": "Versijas",
        "filehist-thumb": "Attēls",
        "filehist-thumbtext": "$1 versijas sīktēls",
        "filehist-nothumb": "Nav sīktēla",
-       "filehist-user": "Lietotājs",
+       "filehist-user": "Dalībnieks",
        "filehist-dimensions": "Izmēri",
        "filehist-filesize": "Faila izmērs",
        "filehist-comment": "Komentārs",
        "wantedtemplates": "Vajadzīgās veidnes",
        "mostlinked": "Lapas, uz kurām ir visvairāk norāžu",
        "mostlinkedcategories": "Kategorijas, uz kurām ir visvairāk saišu",
-       "mostlinkedtemplates": "Visvairāk izmantotās veidnes",
+       "mostlinkedtemplates": "Visvairāk iekļautās lapas",
        "mostcategories": "Raksti ar visvairāk kategorijām",
        "mostimages": "Attēli, uz kuriem ir visvairāk saišu",
        "mostinterwikis": "Lapas ar visvairāk starpviki saitēm",
        "protectedpages-indef": "Tikai bezgalīgas aizsardzības",
        "protectedpages-cascade": "Tikai kaskādes aizsardzības",
        "protectedpages-noredirect": "Paslēpt pāradresācijas",
+       "protectedpages-timestamp": "Laika zīmogs",
        "protectedpages-page": "Lapa",
        "protectedpages-reason": "Iemesls",
        "protectedpages-unknown-timestamp": "Nav zināms",
        "usercreated": "{{GENDER:$3|Izveidoja}} $1 plkst. $2",
        "newpages": "Jaunas lapas",
        "newpages-submit": "Rādīt",
-       "newpages-username": "Lietotājs:",
+       "newpages-username": "Dalībnieks:",
        "ancientpages": "Vecākās lapas",
        "move": "Pārvietot",
        "movethispage": "Pārvietot šo lapu",
        "apisandbox-api-disabled": "API ir atspējots šajā tīmekļa vietnē.",
        "apisandbox-reset": "Notīrīt",
        "apisandbox-retry": "Mēģināt vēlreiz",
+       "apisandbox-no-parameters": "Šo API modulim nav parametru.",
+       "apisandbox-helpurls": "Palīdzības saites",
        "apisandbox-examples": "Piemēri",
+       "apisandbox-dynamic-parameters": "Papildu parametri",
+       "apisandbox-dynamic-parameters-add-label": "Pievienot parametru:",
+       "apisandbox-dynamic-parameters-add-placeholder": "Parametra nosaukums",
        "apisandbox-results": "Rezultāti",
        "apisandbox-request-url-label": "Pieprasījuma URL:",
-       "apisandbox-request-time": "Pieprasījuma izpildes laiks: $1",
+       "apisandbox-request-time": "Pieprasījuma izpildes laiks: {{PLURAL:$1|$1 ms}}",
        "booksources": "Grāmatu avoti",
        "booksources-search-legend": "Meklēt grāmatu avotus",
        "booksources-search": "Meklēt",
        "listgrouprights-removegroup-self-all": "Noņemt visas grupas no sava konta",
        "listgrouprights-namespaceprotection-header": "Vārdtelpas ierobežojumi",
        "listgrouprights-namespaceprotection-namespace": "Vārdtelpa",
+       "listgrants-rights": "Tiesības",
        "trackingcategories-nodesc": "Apraksts nav pieejams.",
        "trackingcategories-disabled": "Kategorija ir atslēgta",
        "mailnologin": "Nav adreses, uz kuru sūtīt",
        "wlheader-enotif": "E-pasta paziņojumi ir ieslēgti.",
        "wlheader-showupdated": "Lapas, kuras ir tikušas izmainītas, kopš tu tās pēdējoreiz apskatījies, te rādās ar '''pustrekniem''' burtiem",
        "wlshowlast": "Parādīt izmaiņas pēdējo $1 stundu laikā vai $2 dienu laikā, vai arī .",
+       "wlshowhidebots": "boti",
+       "wlshowhideliu": "reģistrēti lietotāji",
+       "wlshowhideanons": "anonīmi lietotāji",
+       "wlshowhidepatr": "pārbaudīti labojumi",
+       "wlshowhidemine": "mani labojumi",
+       "wlshowhidecategorization": "lapu kategorizēšana",
        "watchlist-options": "Uzraugāmo rakstu saraksta opcijas",
        "watching": "Uzrauga...",
        "unwatching": "Neuzrauga...",
        "contributions-title": "Dalībnieka $1 devums",
        "mycontris": "Devums",
        "anoncontribs": "Devums",
-       "contribsub2": "Lietotājs: $1 ($2)",
+       "contribsub2": "{{GENDER:$3|Dalībnieks|Dalībniece}}: $1 ($2)",
        "nocontribs": "Netika atrastas izmaiņas, kas atbilstu šiem kritērijiem.",
        "uctop": "(pēdējā izmaiņa)",
        "month": "No mēneša (un senāki):",
        "whatlinkshere-next": "{{PLURAL:$1|nākamos $1|nākamo|nākamos $1}}",
        "whatlinkshere-links": "← saites",
        "whatlinkshere-hideredirs": "$1 pāradresācijas",
-       "whatlinkshere-hidetrans": "$1 lapas, kurās šī lapa izmantota kā veidne",
+       "whatlinkshere-hidetrans": "$1 iekļāvumi",
        "whatlinkshere-hidelinks": "$1 saites",
        "whatlinkshere-hideimages": "$1 failu saites",
        "whatlinkshere-filters": "Filtri",
index 5910f85..28e007f 100644 (file)
        "minoredit": "kleine wieziging",
        "watchthis": "volg disse zied",
        "savearticle": "Zied opslaon",
+       "savechanges": "Wiezigingen opslaon",
+       "publishpage": "Zied uutbrengen",
+       "publishchanges": "Wiezigingen uutbrengen",
        "preview": "Naokieken",
        "showpreview": "Bewarking naokieken",
        "showdiff": "Verschil bekieken",
        "content-model-text": "tekste zonder opmaak",
        "content-model-javascript": "JavaScript",
        "content-model-css": "CSS",
+       "content-json-empty-object": "Leeg objekt",
+       "content-json-empty-array": "Lege reeks",
        "expensive-parserfunction-warning": "Waorschuwing: disse zied gebruukt te veule kostbaore parserfunksies.\n\nNoen {{PLURAL:$1|is|bin}} t der $1, terwiel t der minder as $2 {{PLURAL:$2|mut|mutten}} ween.",
        "expensive-parserfunction-category": "Ziejen die te veule kostbaore parserfunksies gebruken",
        "post-expand-template-inclusion-warning": "Waorschuwing: de grootte van de in-evoegden mal is te groot.\nSommigen mallen wörden niet in-evoegd.",
        "history-feed-empty": "De op-evreugen zied besteet niet. t Kan ween dat disse zied vortedaon is of dat t herneumd is. Probeer te [[Special:Search|zeuken]] naor soortgelieke nieje ziejen.",
        "rev-deleted-comment": "(bewarkingsopmarking vortedaon)",
        "rev-deleted-user": "(gebrukersnaam vortedaon)",
-       "rev-deleted-event": "(antekening vortedaon)",
+       "rev-deleted-event": "(logboekregel vortedaon)",
        "rev-deleted-user-contribs": "[gebrukersnaam of IP-adres vortedaon - bewarking verbörgen in biedragen]",
        "rev-deleted-text-permission": "Disse bewarking is '''vortedaon'''.\nAs der meer informasie is, ku'j t vienen in t [{{fullurl:{{#Special:Log}}/delete|page={{PAGENAMEE}}}} vortdologboek].",
        "rev-deleted-text-unhide": "Disse bewarking is '''vortedaon'''.\nAs der meer informasie is, ku'j t vienen in t [{{fullurl:{{#Special:Log}}/delete|page={{PAGENAMEE}}}} vortdologboek].\nJe kunnen [$1 disse versie bekieken] a'j willen.",
        "revdelete-legend": "Stel versiebeparkingen in:",
        "revdelete-hide-text": "Versietekste",
        "revdelete-hide-image": "Verbarg bestaandsinhoud",
-       "revdelete-hide-name": "Verbarg logboekaksie",
+       "revdelete-hide-name": "Verbarg haandeling en doel",
        "revdelete-hide-comment": "Bewarkingssamenvatting",
        "revdelete-hide-user": "Gebrukersnaam/IP-adres van disse gebruker",
        "revdelete-hide-restricted": "Gegevens veur beheerders en aander volk onderdrokken",
        "revdelete-unsuppress": "Beparkingen veur weerummezetten versies vortdoon",
        "revdelete-log": "Reden:",
        "revdelete-submit": "Toepassen op de ekeuzen {{PLURAL:$1|bewarking|bewarkingen}}",
-       "revdelete-success": "'''De zichtbaorheid van de wieziging is bie-ewörken.'''",
+       "revdelete-success": "De zichtbaorheid van de wieziging is bie-ewörken.",
        "revdelete-failure": "'''De zichtbaorheid veur de wieziging kon niet bie-ewörken wörden:'''\n$1",
-       "logdelete-success": "'''Zichtbaorheid van de gebeurtenisse is suksesvol in-esteld.'''",
+       "logdelete-success": "Zichtbaorheid van de gebeurtenisse is in-esteld.",
        "logdelete-failure": "'''De zichtbaorheid van de logboekregel kon niet in-esteld wörden:'''\n$1",
        "revdel-restore": "Zichtbaorheid wiezigen",
        "pagehist": "Ziedgeschiedenisse",
        "mergehistory-go": "Bekiek bewarkingen die bie mekaar edaon kunnen wörden",
        "mergehistory-submit": "Versies bie mekaar doon",
        "mergehistory-empty": "Der bin gien versies die samenevoegd kunnen wörden.",
-       "mergehistory-done": "$3 {{PLURAL:$3|versie|versies}} van $1 bin suksesvol samenevoegd naor [[:$2]].",
+       "mergehistory-done": "$3 {{PLURAL:$3|versie|versies}} van $1 {{PLURAL:$3|is|bin}} suksesvol samenevoegd naor [[:$2]].",
        "mergehistory-fail": "Kan gien geschiedenisse samenvoegen, kiek opniej de zied- en tiedparameters nao.",
        "mergehistory-no-source": "Bronzied $1 besteet niet.",
        "mergehistory-no-destination": "Bestemmingszied $1 besteet niet.",
        "badsig": "Ongeldige haandtekening; HTML naokieken.",
        "badsiglength": "Joew haandtekening is te lang.\nt Mut minder as {{PLURAL:$1|letter|letters}} hebben.",
        "yourgender": "Geslacht:",
-       "gender-unknown": "Geet joe niks an",
+       "gender-unknown": "De programmatuur gebruukt zoveul meugelik geslachtsneutrale woorden as t over joe geet.",
        "gender-male": "Keerl",
        "gender-female": "Deerne",
        "prefs-help-gender": "Disse instelling is opsioneel.\n\nDe programmatuur gebruukt disse weerde um joe op de juuste maniere an te spreken en veur aandere gebrukers um joew geslacht an te geven.\nDisse informasie is zichtbaor veur aandere gebrukers.",
        "email": "Privéberichten",
-       "prefs-help-realname": "* Echte naam (niet verplicht): a'j disse opsie invullen zu'w joew echte naam gebruken um erkenning te geven veur joew warkzaamheen.",
+       "prefs-help-realname": "Echte naam is keuzevrie.\nA'j disse opsie invullen zu'w joew echte naam gebruken um erkenning te geven veur joew wark.",
        "prefs-help-email": "n Netpostadres is niet verplicht, mer zo ku'w wel joew wachtwoord toesturen veur a'j t vergeten bin.",
        "prefs-help-email-others": "Je kunnen oek aandere meensen de meugelikheid geven um kontakt mit joe op te nemen mit n verwiezing op joew gebrukers- en overlegzied zonder da'j de identiteit pries hoeven te geven.",
        "prefs-help-email-required": "Hier he'w n netpostadres veur neudig.",
        "userrights": "Gebrukersrechtenbeheer",
        "userrights-lookup-user": "Beheer gebrukersgroepen",
        "userrights-user-editname": "Vul n gebrukersnaam in:",
-       "editusergroup": "Bewark gebrukersgroepen",
+       "editusergroup": "Bewark {{GENDER:$1|gebrukersgroepen}}",
        "editinguser": "Doonde mit t wiezigen van de gebrukersrechten van '''[[User:$1|$1]]''' $2",
        "userrights-editusergroup": "Bewark gebrukersgroep",
        "saveusergroups": "Gebrukergroepen opslaon",
        "rightslogtext": "Dit is n logboek mit veraanderingen van gebrukersrechten",
        "action-read": "disse zied lezen",
        "action-edit": "disse zied bewarken",
-       "action-createpage": "ziejen schrieven",
-       "action-createtalk": "overlegziejen anmaken",
+       "action-createpage": "disse zied anmaken",
+       "action-createtalk": "disse overlegzied anmaken",
        "action-createaccount": "disse gebrukerskonto anmaken",
        "action-minoredit": "disse bewarking as klein markeren",
        "action-move": "disse zied herneumen",
        "nopagetext": "De zied die'j herneumen willen besteet niet.",
        "pager-newer-n": "{{PLURAL:$1|1 niejere|$1 niejere}}",
        "pager-older-n": "{{PLURAL:$1|1 ouwere|$1 ouwere}}",
-       "suppress": "Toezichte",
+       "suppress": "Toezicht",
        "querypage-disabled": "Disse spesiale zied is uutezet um prestasieredens.",
        "apisandbox": "API-zaandkule",
        "booksources": "Boekinformasie",
        "duplicate-defaultsort": "Waorschuwing: de standardsortering \"$2\" krig veurrang veur de sortering \"$1\".",
        "version": "Versie",
        "version-extensions": "Uutbreidingen die installeerd bin",
-       "version-skins": "Vormgevingen",
+       "version-skins": "Geïnstalleerden vormgevingen",
        "version-specialpages": "Spesiale ziejen",
        "version-parserhooks": "Parserhoeken",
        "version-variables": "Variabels",
        "version-entrypoints": "Webadressen veur ingangen",
        "version-entrypoints-header-entrypoint": "Ingang",
        "version-entrypoints-header-url": "Webadres",
-       "redirect": "Deurverwiezen op bestaandsnaam, gebrukersnummer, ziednummer of versienummer",
+       "redirect": "Deurverwiezen op bestaandsnaam, gebrukers-, zied-, versie- of logboekregelnummer",
        "redirect-summary": "Disse spesiale zied verwis deur naor n bestaand (as de bestaandsnaam op-egeven wördt), n zied (as n zied- of versienummer op-egeven wördt) of n gebrukerszied (as t gebrukersnummer op-egeven wördt). Gebruuk: [[{{#Special:Redirect}}/file/Example.jpg]], [[{{#Special:Redirect}}/page/64308]], [[{{#Special:Redirect}}/revision/328429]], of [[{{#Special:Redirect}}/user/101]].",
        "redirect-submit": "Zeuk",
        "redirect-lookup": "Opzeuken:",
index 05cd4f1..1da711c 100644 (file)
        "size-megabytes": "$1&nbsp;MB",
        "size-gigabytes": "$1&nbsp;GB",
        "lag-warn-normal": "Zmiany nowsze niż $1 {{PLURAL:$1|sekunda|sekundy|sekund}} mogą nie być widoczne na tej liście.",
-       "lag-warn-high": "Z powodu dużego obciążenia serwerów bazy danych, zmiany nowsze niż $1 {{PLURAL:$1|sekunda|sekundy|sekund}} mogą nie być widoczne na tej liście.",
+       "lag-warn-high": "Z powodu dużego obciążenia serwerów bazy danych zmiany nowsze niż $1 {{PLURAL:$1|sekunda|sekundy|sekund}} mogą nie być widoczne na tej liście.",
        "watchlistedit-normal-title": "Edytuj listę obserwowanych stron",
        "watchlistedit-normal-legend": "Usuń strony z listy obserwowanych",
        "watchlistedit-normal-explain": "Poniżej znajduje się lista obserwowanych przez Ciebie stron.\nAby usunąć stronę z listy zaznacz znajdujące się obok niej pole i naciśnij „{{int:Watchlistedit-normal-submit}}”.\nMożesz także skorzystać z [[Special:EditWatchlist/raw|tekstowego edytora listy obserwowanych]].",
index 90829e5..7c3c87b 100644 (file)
        "tooltip-ca-nstab-category": "Ver a página de categoria",
        "tooltip-minoredit": "Marcar como edição menor",
        "tooltip-save": "Gravar as alterações",
+       "tooltip-publish": "Publicar as suas alterações",
        "tooltip-preview": "Antever as suas alterações. Use antes de gravar, por favor!",
        "tooltip-diff": "Mostrar alterações que fez a este texto.",
        "tooltip-compareselectedversions": "Ver as diferenças entre as duas versões selecionadas desta página.",
        "log-action-filter-suppress-event": "Supressão de registo",
        "log-action-filter-suppress-delete": "Supressão de página",
        "log-action-filter-upload-upload": "Novo carregamento",
-       "log-action-filter-upload-overwrite": "Recarregar"
+       "log-action-filter-upload-overwrite": "Recarregar",
+       "authmanager-create-disabled": "A criação de contas está desativada.",
+       "authmanager-create-from-login": "Para criar a sua conta, por favor, preencha os campos abaixo.",
+       "authmanager-authplugin-setpass-bad-domain": "Domínio inválido.",
+       "authmanager-userdoesnotexist": "A conta de utilizador(a) \"$1\" não está registada.",
+       "authmanager-username-help": "Nome de utilizador(a) para autenticação.",
+       "authmanager-password-help": "Palavra-passe para autenticação.",
+       "authmanager-domain-help": "Domínio para a autenticação externa.",
+       "authmanager-retype-help": "A palavra-passe novamente para confirmação.",
+       "authmanager-email-label": "Correio eletrónico",
+       "authmanager-email-help": "Endereço de correio eletrónico",
+       "authmanager-realname-label": "Nome verdadeiro",
+       "authmanager-realname-help": "Nome verdadeiro do(a) utilizador(a)",
+       "authprovider-resetpass-skip-label": "Ignorar",
+       "changecredentials": "Alterar credenciais",
+       "changecredentials-submit": "Alterar credenciais",
+       "changecredentials-invalidsubpage": "$1 não é um tipo de credencial válido.",
+       "changecredentials-success": "As suas credenciais foram alteradas.",
+       "removecredentials": "Remover credenciais",
+       "removecredentials-submit": "Remover credenciais",
+       "removecredentials-invalidsubpage": "$1 não é um tipo de credencial válido.",
+       "credentialsform-provider": "Tipo de credenciais:",
+       "credentialsform-account": "Nome da conta:",
+       "cannotlink-no-provider-title": "Não existem contas vinculáveis",
+       "cannotlink-no-provider": "Não existem contas vinculáveis",
+       "linkaccounts": "Associar contas",
+       "linkaccounts-success-text": "A conta foi associada.",
+       "linkaccounts-submit": "Associar contas",
+       "unlinkaccounts": "Desassociar contas",
+       "unlinkaccounts-success": "A conta foi desassociada."
 }
index bf80abe..6255bf7 100644 (file)
        "limitreport-cputime-value": "$1 秒",
        "limitreport-walltime": "實際使用時間",
        "limitreport-walltime-value": "$1 秒",
-       "limitreport-ppvisitednodes": "預處理器已訪問節點計數",
+       "limitreport-ppvisitednodes": "前置處理器造訪節點計數",
        "limitreport-ppgeneratednodes": "預處理器產生節點次數",
        "limitreport-postexpandincludesize": "展開後的引用大小",
        "limitreport-postexpandincludesize-value": "$1/$2 個{{PLURAL:$2|位元組}}",
index d9e2c50..631d2a7 100644 (file)
@@ -64,7 +64,8 @@
                                        "mw.Feedback*",
                                        "mw.Upload*",
                                        "mw.ForeignUpload",
-                                       "mw.ForeignStructuredUpload*"
+                                       "mw.ForeignStructuredUpload*",
+                                       "mw.GallerySlider"
                                ]
                        },
                        {
index 8526ec6..1805c84 100644 (file)
@@ -1656,6 +1656,18 @@ return [
                'position' => 'top',
                'targets' => [ 'desktop', 'mobile' ],
        ],
+       'mediawiki.page.gallery.slider' => [
+               'scripts' => 'resources/src/mediawiki/page/gallery-slider.js',
+               'position' => 'top',
+               'dependencies' => [
+                       'mediawiki.api',
+                       'mediawiki.Title',
+                       'oojs',
+                       'oojs-ui-core',
+                       'oojs-ui-widgets',
+                       'oojs-ui.styles.icons-media'
+               ]
+       ],
        'mediawiki.page.ready' => [
                'scripts' => 'resources/src/mediawiki/page/ready.js',
                'dependencies' => [
diff --git a/resources/src/mediawiki/page/gallery-slider.js b/resources/src/mediawiki/page/gallery-slider.js
new file mode 100644 (file)
index 0000000..82b22e8
--- /dev/null
@@ -0,0 +1,453 @@
+/*!
+ * mw.GallerySlider: Interface controls for the slider gallery
+ */
+( function ( mw, $, OO ) {
+       /**
+        * mw.GallerySlider encapsulates the user interface of the slider
+        * galleries. An object is instantiated for each `.mw-gallery-slider`
+        * element.
+        *
+        * @class mw.GallerySlider
+        * @uses mw.Title
+        * @uses mw.Api
+        * @param {jQuery} gallery The `<ul>` element of the gallery.
+        */
+       mw.GallerySlider = function ( gallery ) {
+               // Properties
+               this.$gallery = $( gallery );
+               this.$galleryCaption = this.$gallery.find( '.gallerycaption' );
+               this.$galleryBox = this.$gallery.find( '.gallerybox' );
+               this.$currentImage = null;
+               this.imageInfoCache = {};
+               if ( this.$gallery.parent().attr( 'id' ) !== 'mw-content-text' ) {
+                       this.$container = this.$gallery.parent();
+               }
+
+               // Initialize
+               this.drawCarousel();
+               this.setSizeRequirement();
+               this.toggleThumbnails( false );
+               this.showCurrentImage();
+
+               // Events
+               $( window ).on(
+                       'resize',
+                       OO.ui.debounce(
+                               this.setSizeRequirement.bind( this ),
+                               100
+                       )
+               );
+
+               // Disable thumbnails' link, instead show the image in the carousel
+               this.$galleryBox.on( 'click', function ( e ) {
+                       this.$currentImage = $( e.currentTarget );
+                       this.showCurrentImage();
+                       return false;
+               }.bind( this ) );
+       };
+
+       /* Properties */
+       /**
+        * @property {jQuery} $gallery The `<ul>` element of the gallery.
+        */
+
+       /**
+        * @property {jQuery} $galleryCaption The `<li>` that has the gallery caption.
+        */
+
+       /**
+        * @property {jQuery} $galleryBox Selection of `<li>` elements that have thumbnails.
+        */
+
+       /**
+        * @property {jQuery} $carousel The `<li>` elements that contains the carousel.
+        */
+
+       /**
+        * @property {jQuery} $interface The `<div>` elements that contains the interface buttons.
+        */
+
+       /**
+        * @property {jQuery} $img The `<img>` element that'll display the current image.
+        */
+
+       /**
+        * @property {jQuery} $imgLink The `<a>` element that links to the image's File page.
+        */
+
+       /**
+        * @property {jQuery} $imgCaption The `<p>` element that holds the image caption.
+        */
+
+       /**
+        * @property {jQuery} $imgContainer The `<div>` element that contains the image.
+        */
+
+       /**
+        * @property {jQuery} $currentImage The `<li>` element of the current image.
+        */
+
+       /**
+        * @property {jQuery} $container If the gallery contained in an element that is
+        *      not the main content element, then it stores that element.
+        */
+
+       /**
+        * @property {Object} imageInfoCache A key value pair of thumbnail URLs and image info.
+        */
+
+       /**
+        * @property {number} imageWidth Width of the image based on viewport size
+        */
+
+       /**
+        * @property {number} imageHeight Height of the image based on viewport size
+        *      the URLs in the required size.
+        */
+
+       /* Setup */
+       OO.initClass( mw.GallerySlider );
+
+       /* Methods */
+       /**
+        * Draws the carousel and the interface around it.
+        */
+       mw.GallerySlider.prototype.drawCarousel = function () {
+               var next, prev, toggle, interfaceElements, carouselStack;
+
+               this.$carousel = $( '<li>' ).addClass( 'gallerycarousel' );
+
+               // Buttons for the interface
+               prev = new OO.ui.ButtonWidget( {
+                       framed: false,
+                       icon: 'previous'
+               } ).on( 'click', this.prevImage.bind( this ) );
+
+               next = new OO.ui.ButtonWidget( {
+                       framed: false,
+                       icon: 'next'
+               } ).on( 'click', this.nextImage.bind( this ) );
+
+               toggle = new OO.ui.ButtonWidget( {
+                       framed: false,
+                       icon: 'imageGallery'
+               } ).on( 'click', this.toggleThumbnails.bind( this ) );
+
+               interfaceElements = new OO.ui.PanelLayout( {
+                       expanded: false,
+                       classes: [ 'mw-gallery-slider-buttons' ],
+                       $content: $( '<div>' ).append(
+                               prev.$element,
+                               toggle.$element,
+                               next.$element
+                       )
+               } );
+               this.$interface = interfaceElements.$element;
+
+               // Containers for the current image, caption etc.
+               this.$img = $( '<img>' );
+               this.$imgLink = $( '<a>' ).append( this.$img );
+               this.$imgCaption = $( '<p>' ).attr( 'class', 'mw-gallery-slider-caption' );
+               this.$imgContainer = $( '<div>' )
+                       .attr( 'class', 'mw-gallery-slider-img-container' )
+                       .append( this.$imgLink );
+
+               carouselStack = new OO.ui.StackLayout( {
+                       continuous: true,
+                       expanded: false,
+                       items: [
+                               interfaceElements,
+                               new OO.ui.PanelLayout( {
+                                       expanded: false,
+                                       $content: this.$imgContainer
+                               } ),
+                               new OO.ui.PanelLayout( {
+                                       expanded: false,
+                                       $content: this.$imgCaption
+                               } )
+                       ]
+               } );
+               this.$carousel.append( carouselStack.$element );
+
+               // Append below the caption or as the first element in the gallery
+               if ( this.$galleryCaption.length !== 0 ) {
+                       this.$galleryCaption.after( this.$carousel );
+               } else {
+                       this.$gallery.prepend( this.$carousel );
+               }
+       };
+
+       /**
+        * Sets the {@link #imageWidth} and {@link #imageHeight} properties
+        * based on the size of the window. Also flushes the
+        * {@link #imageInfoCache} as we'll now need URLs for a different
+        * size.
+        */
+       mw.GallerySlider.prototype.setSizeRequirement = function () {
+               var w, h;
+
+               if ( this.$container !== undefined ) {
+                       w = this.$container.width() * 0.9;
+                       h = ( this.$container.height() - this.getChromeHeight() ) * 0.9;
+               } else {
+                       w = this.$imgContainer.width();
+                       h = Math.min( $( window ).height() * ( 3 / 4 ), this.$imgContainer.width() ) - this.getChromeHeight();
+               }
+
+               // Only update and flush the cache if the size changed
+               if ( w !== this.imageWidth || h !== this.imageHeight ) {
+                       this.imageWidth = w;
+                       this.imageHeight = h;
+                       this.imageInfoCache = {};
+                       this.setImageSize();
+               }
+       };
+
+       /**
+        * Gets the height of the interface elements and the
+        * gallery's caption.
+        */
+       mw.GallerySlider.prototype.getChromeHeight = function () {
+               return this.$interface.outerHeight() + this.$galleryCaption.outerHeight();
+       };
+
+       /**
+        * Sets the height and width of {@link #$img} based on the
+        * proportion of the image and the values generated by
+        * {@link #setSizeRequirement}.
+        *
+        * @return {boolean} Whether or not the image was sized.
+        */
+       mw.GallerySlider.prototype.setImageSize = function () {
+               if ( this.$img === undefined || this.$thumbnail === undefined ) {
+                       return false;
+               }
+
+               // Reset height and width
+               this.$img
+                       .removeAttr( 'width' )
+                       .removeAttr( 'height' );
+
+               // Stretch image to take up the required size
+               if ( this.$thumbnail.width() > this.$thumbnail.height() ) {
+                       this.$img.attr( 'width', this.imageWidth + 'px' );
+               } else {
+                       this.$img.attr( 'height', this.imageHeight + 'px' );
+               }
+
+               // Make the image smaller in case the current image
+               // size is larger than the original file size.
+               this.getImageInfo( this.$thumbnail ).done( function ( info ) {
+                       // NOTE: There will be a jump when resizing the window
+                       // because the cache is cleared and this a new network request.
+                       if (
+                               info.thumbwidth < this.$img.width() ||
+                               info.thumbheight < this.$img.height()
+                       ) {
+                               this.$img.attr( 'width', info.thumbwidth + 'px' );
+                               this.$img.attr( 'height', info.thumbheight + 'px' );
+                       }
+               }.bind( this ) );
+
+               return true;
+       };
+
+       /**
+        * Displays the image set as {@link #$currentImage} in the carousel.
+        */
+       mw.GallerySlider.prototype.showCurrentImage = function () {
+               var imageLi = this.getCurrentImage(),
+                       caption = imageLi.find( '.gallerytext' );
+
+               // Highlight current thumbnail
+               this.$gallery
+                       .find( '.gallerybox.slider-current' )
+                       .removeClass( 'slider-current' );
+               imageLi.addClass( 'slider-current' );
+
+               // Show thumbnail stretched to the right size while the image loads
+               this.$thumbnail = imageLi.find( 'img' );
+               this.$img.attr( 'src', this.$thumbnail.attr( 'src' ) );
+               this.$imgLink.attr( 'href', imageLi.find( 'a' ).eq( 0 ).attr( 'href' ) );
+               this.setImageSize();
+
+               // Copy caption
+               this.$imgCaption
+                       .empty()
+                       .append( caption.clone() );
+
+               // Load image at the required size
+               this.loadImage( this.$thumbnail ).done( function ( info, $img ) {
+                       // Show this image to the user only if its still the current one
+                       if ( this.$thumbnail.attr( 'src' ) === $img.attr( 'src' ) ) {
+                               this.$img.attr( 'src', info.thumburl );
+                               this.setImageSize();
+
+                               // Keep the next image ready
+                               this.loadImage( this.getNextImage().find( 'img' ) );
+                       }
+               }.bind( this ) );
+       };
+
+       /**
+        * Loads the full image given the `<img>` element of the thumbnail.
+        *
+        * @param {Object} $img
+        * @return {jQuery.Promise} Resolves with the images URL and original
+        *      element once the image has loaded.
+        */
+       mw.GallerySlider.prototype.loadImage = function ( $img ) {
+               var img, d = $.Deferred();
+
+               this.getImageInfo( $img ).done( function ( info ) {
+                       img = new Image();
+                       img.src = info.thumburl;
+                       img.onload = function () {
+                               d.resolve( info, $img );
+                       };
+                       img.onerror = function () {
+                               d.reject();
+                       };
+               } ).fail( function () {
+                       d.reject();
+               } );
+
+               return d.promise();
+       };
+
+       /**
+        * Gets the image's info given an `<img>` element.
+        *
+        * @param {Object} $img
+        * @return {jQuery.Promise} Resolves with the image's info.
+        */
+       mw.GallerySlider.prototype.getImageInfo = function ( $img ) {
+               var api, title, params,
+                       imageSrc = $img.attr( 'src' );
+
+               if ( this.imageInfoCache[ imageSrc ] === undefined ) {
+                       api = new mw.Api();
+                       // TODO: This supports only gallery of images
+                       title = new mw.Title.newFromImg( $img );
+                       params = {
+                               action: 'query',
+                               formatversion: 2,
+                               titles: title.toString(),
+                               prop: 'imageinfo',
+                               iiprop: 'url'
+                       };
+
+                       // Check which dimension we need to request, based on
+                       // image and container proportions.
+                       if ( this.getDimensionToRequest( $img ) === 'height' ) {
+                               params.iiurlheight = this.imageHeight;
+                       } else {
+                               params.iiurlwidth = this.imageWidth;
+                       }
+
+                       this.imageInfoCache[ imageSrc ] = api.get( params ).then( function ( data ) {
+                               if ( OO.getProp( data, 'query', 'pages', 0, 'imageinfo', 0, 'thumburl' ) !== undefined ) {
+                                       return data.query.pages[ 0 ].imageinfo[ 0 ];
+                               } else {
+                                       return $.Deferred().reject();
+                               }
+                       } );
+               }
+
+               return this.imageInfoCache[ imageSrc ];
+       };
+
+       /**
+        * Given an image, the method checks whether to use the height
+        * or the width to request the larger image.
+        *
+        * @param {jQuery} $img
+        * @return {string}
+        */
+       mw.GallerySlider.prototype.getDimensionToRequest = function ( $img ) {
+               var ratio = $img.width() / $img.height();
+
+               if ( this.imageHeight * ratio <= this.imageWidth ) {
+                       return 'height';
+               } else {
+                       return 'width';
+               }
+       };
+
+       /**
+        * Toggles visibility of the thumbnails.
+        *
+        * @param {boolean} show Optional argument to control the state
+        */
+       mw.GallerySlider.prototype.toggleThumbnails = function ( show ) {
+               this.$galleryBox.toggle( show );
+               this.$carousel.toggleClass( 'mw-gallery-slider-thumbnails-toggled', show );
+       };
+
+       /**
+        * Getter method for {@link #$currentImage}
+        *
+        * @return {jQuery}
+        */
+       mw.GallerySlider.prototype.getCurrentImage = function () {
+               this.$currentImage = this.$currentImage || this.$galleryBox.eq( 0 );
+               return this.$currentImage;
+       };
+
+       /**
+        * Gets the image after the current one. Returns the first image if
+        * the current one is the last.
+        *
+        * @return {jQuery}
+        */
+       mw.GallerySlider.prototype.getNextImage = function () {
+               // Not the last image in the gallery
+               if ( this.$currentImage.next( '.gallerybox' )[ 0 ] !== undefined ) {
+                       return this.$currentImage.next( '.gallerybox' );
+               } else {
+                       return this.$galleryBox.eq( 0 );
+               }
+       };
+
+       /**
+        * Gets the image before the current one. Returns the last image if
+        * the current one is the first.
+        *
+        * @return {jQuery}
+        */
+       mw.GallerySlider.prototype.getPrevImage = function () {
+               // Not the first image in the gallery
+               if ( this.$currentImage.prev( '.gallerybox' )[ 0 ] !== undefined ) {
+                       return this.$currentImage.prev( '.gallerybox' );
+               } else {
+                       return this.$galleryBox.last();
+               }
+       };
+
+       /**
+        * Sets the {@link #$currentImage} to the next one and shows
+        * it in the carousel
+        */
+       mw.GallerySlider.prototype.nextImage = function () {
+               this.$currentImage = this.getNextImage();
+               this.showCurrentImage();
+       };
+
+       /**
+        * Sets the {@link #$currentImage} to the previous one and shows
+        * it in the carousel
+        */
+       mw.GallerySlider.prototype.prevImage = function () {
+               this.$currentImage = this.getPrevImage();
+               this.showCurrentImage();
+       };
+
+       // Bootstrap all slider galleries
+       $( function () {
+               $( '.mw-gallery-slider' ).each( function () {
+                       /*jshint -W031 */
+                       new mw.GallerySlider( this );
+                       /*jshint +W031 */
+               } );
+       } );
+}( mediaWiki, jQuery, OO ) );
index 3ed4870..7bf0f81 100644 (file)
@@ -124,3 +124,49 @@ ul.mw-gallery-packed-overlay,
 ul.mw-gallery-packed {
        text-align: center;
 }
+
+/* Slider */
+ul.gallery.mw-gallery-slider {
+       display: block;
+       margin: 4em 0;
+}
+
+ul.gallery.mw-gallery-slider .gallerycaption {
+       font-size: 1.3em;
+       margin: 0;
+}
+
+ul.gallery.mw-gallery-slider .gallerycarousel.mw-gallery-slider-thumbnails-toggled {
+       margin-bottom: 1.3em;
+}
+
+ul.gallery.mw-gallery-slider .mw-gallery-slider-buttons {
+       opacity: 0.5;
+       padding: 1.3em 0;
+}
+
+ul.gallery.mw-gallery-slider .mw-gallery-slider-buttons .oo-ui-buttonElement {
+       margin: 0 2em;
+}
+
+.mw-gallery-slider li.gallerybox.slider-current {
+       background: #efefef;
+}
+
+.mw-gallery-slider .gallerybox > div {
+       max-width: 120px;
+}
+
+ul.mw-gallery-slider li.gallerybox div.thumb {
+       border: none;
+       background: transparent;
+}
+
+ul.mw-gallery-slider li.gallerycarousel {
+       display: block;
+       text-align: center;
+}
+
+.mw-gallery-slider-img-container a {
+       display: block;
+}
\ No newline at end of file
index 492fec6..e8681c7 100644 (file)
@@ -9,4 +9,45 @@ class TextContentHandlerTest extends MediaWikiLangTestCase {
                $this->assertTrue( $handler->supportsDirectEditing(), 'direct editing is supported' );
        }
 
+       /**
+        * @covers SearchEngine::makeSearchFieldMapping
+        * @covers ContentHandler::getFieldsForSearchIndex
+        */
+       public function testFieldsForIndex() {
+               $handler = new TextContentHandler();
+
+               $mockEngine = $this->getMock( 'SearchEngine' );
+
+               $mockEngine->expects( $this->atLeastOnce() )
+                       ->method( 'makeSearchFieldMapping' )
+                       ->willReturnCallback( function ( $name, $type ) {
+                               $mockField =
+                                       $this->getMockBuilder( 'SearchIndexFieldDefinition' )
+                                               ->setConstructorArgs( [ $name, $type ] )
+                                               ->getMock();
+                               $mockField->expects( $this->atLeastOnce() )->method( 'getMapping' )->willReturn( [
+                                               'testData' => 'test',
+                                               'name' => $name,
+                                               'type' => $type,
+                                       ] );
+                               return $mockField;
+                       } );
+
+               /**
+                * @var $mockEngine SearchEngine
+                */
+               $fields = $handler->getFieldsForSearchIndex( $mockEngine );
+               $mappedFields = [];
+               foreach ( $fields as $name => $field ) {
+                       $this->assertInstanceOf( 'SearchIndexField', $field );
+                       /**
+                        * @var $field SearchIndexField
+                        */
+                       $mappedFields[$name] = $field->getMapping( $mockEngine );
+               }
+               $this->assertArrayHasKey( 'language', $mappedFields );
+               $this->assertEquals( 'test', $mappedFields['language']['testData'] );
+               $this->assertEquals( 'language', $mappedFields['language']['name'] );
+       }
+
 }
index 40a33d9..f084c64 100644 (file)
@@ -157,4 +157,49 @@ class SearchEngineTest extends MediaWikiLangTestCase {
                        "Title power search failed" );
        }
 
+       /**
+        * @covers SearchEngine::getSearchIndexFields
+        */
+       public function testSearchIndexFields() {
+               /**
+                * @var $mockEngine SearchEngine
+                */
+               $mockEngine = $this->getMock( 'SearchEngine', [ 'makeSearchFieldMapping' ] );
+
+               $mockFieldBuilder = function ( $name, $type ) {
+                       $mockField =
+                               $this->getMockBuilder( 'SearchIndexFieldDefinition' )->setConstructorArgs( [
+                                       $name,
+                                       $type
+                               ] )->getMock();
+                       $mockField->expects( $this->any() )->method( 'getMapping' )->willReturn( [
+                               'testData' => 'test',
+                               'name' => $name,
+                               'type' => $type,
+                       ] );
+                       return $mockField;
+               };
+
+               $mockEngine->expects( $this->atLeastOnce() )
+                       ->method( 'makeSearchFieldMapping' )
+                       ->willReturnCallback( $mockFieldBuilder );
+
+               // Not using mock since PHPUnit mocks do not work properly with references in params
+               $this->mergeMwGlobalArrayValue( 'wgHooks',
+                       [ 'SearchIndexFields' => [ [ $this, 'hookSearchIndexFields', $mockFieldBuilder ] ] ] );
+
+               $fields = $mockEngine->getSearchIndexFields();
+               $this->assertArrayHasKey( 'language', $fields );
+               $this->assertArrayHasKey( 'category', $fields );
+               $this->assertInstanceOf( 'SearchIndexField', $fields['testField'] );
+
+               $mapping = $fields['testField']->getMapping( $mockEngine );
+               $this->assertArrayHasKey( 'testData', $mapping );
+               $this->assertEquals( 'test', $mapping['testData'] );
+       }
+
+       public function hookSearchIndexFields( $mockFieldBuilder, &$fields, SearchEngine $engine ) {
+               $fields['testField'] = $mockFieldBuilder( "testField", SearchIndexField::INDEX_TYPE_TEXT );
+               return true;
+       }
 }
diff --git a/tests/phpunit/includes/search/SearchIndexFieldTest.php b/tests/phpunit/includes/search/SearchIndexFieldTest.php
new file mode 100644 (file)
index 0000000..ec046a7
--- /dev/null
@@ -0,0 +1,39 @@
+<?php
+
+/**
+ * @group Search
+ * @covers SearchIndexFieldDefinition
+ */
+class SearchIndexFieldTest extends MediaWikiTestCase {
+
+       public function getMergeCases() {
+               return [
+                       [ 0, 'test', 0, 'test', true ],
+                       [ SearchIndexField::INDEX_TYPE_NESTED, 'test',
+                         SearchIndexField::INDEX_TYPE_NESTED, 'test', false ],
+                       [ 0, 'test', 0, 'test2', true ],
+                       [ 0, 'test', 1, 'test', false ],
+               ];
+       }
+
+       /**
+        * @dataProvider getMergeCases
+        */
+       public function testMerge( $t1, $n1, $t2, $n2, $result ) {
+               $field1 = $this->getMockBuilder( 'SearchIndexFieldDefinition' )
+                       ->setMethods( [ 'getMapping' ] )
+                       ->setConstructorArgs( [ $n1, $t1 ] )->getMock();
+               $field2 = $this->getMockBuilder( 'SearchIndexFieldDefinition' )
+                       ->setMethods( [ 'getMapping' ] )
+                       ->setConstructorArgs( [ $n2, $t2 ] )->getMock();
+
+               if ( $result ) {
+                       $this->assertNotFalse( $field1->merge( $field2 ) );
+               } else {
+                       $this->assertFalse( $field1->merge( $field2 ) );
+               }
+
+               $field1->setFlag( 0xFF );
+               $this->assertFalse( $field1->merge( $field2 ) );
+       }
+}