Merge "Remove blue border from DateInputWidget calendar"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Tue, 29 Sep 2015 12:24:00 +0000 (12:24 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Tue, 29 Sep 2015 12:24:00 +0000 (12:24 +0000)
104 files changed:
CREDITS
HISTORY
RELEASE-NOTES-1.26
RELEASE-NOTES-1.27 [new file with mode: 0644]
includes/DefaultSettings.php
includes/PHPVersionCheck.php
includes/User.php
includes/actions/Action.php
includes/actions/FormAction.php
includes/actions/PurgeAction.php
includes/actions/WatchAction.php
includes/api/ApiOptions.php
includes/api/i18n/de.json
includes/api/i18n/fr.json
includes/api/i18n/he.json
includes/api/i18n/ja.json
includes/api/i18n/lb.json
includes/api/i18n/pt.json
includes/api/i18n/zh-hans.json
includes/deferred/SquidUpdate.php
includes/filerepo/LocalRepo.php
includes/filerepo/file/LocalFile.php
includes/installer/WebInstallerOutput.php
includes/jobqueue/jobs/HTMLCacheUpdateJob.php
includes/libs/objectcache/WANObjectCache.php
includes/parser/Preprocessor_DOM.php
includes/resourceloader/ResourceLoader.php
includes/resourceloader/ResourceLoaderEditToolbarModule.php
includes/resourceloader/ResourceLoaderFileModule.php
includes/resourceloader/ResourceLoaderModule.php
includes/skins/SkinTemplate.php
includes/specials/SpecialMergeHistory.php
includes/specials/SpecialSearch.php
includes/specials/SpecialUnwatchedpages.php
jsduck.json
languages/LanguageConverter.php
languages/i18n/aln.json
languages/i18n/be-tarask.json
languages/i18n/de.json
languages/i18n/el.json
languages/i18n/en.json
languages/i18n/es.json
languages/i18n/et.json
languages/i18n/ext.json
languages/i18n/fi.json
languages/i18n/fr.json
languages/i18n/he.json
languages/i18n/it.json
languages/i18n/ja.json
languages/i18n/kk-cyrl.json
languages/i18n/ko.json
languages/i18n/lt.json
languages/i18n/pl.json
languages/i18n/ps.json
languages/i18n/pt.json
languages/i18n/qqq.json
languages/i18n/ro.json
languages/i18n/roa-tara.json
languages/i18n/sl.json
languages/i18n/sq.json
languages/i18n/wo.json
languages/i18n/zh-hans.json
languages/messages/MessagesAst.php
package.json
resources/Resources.php
resources/src/mediawiki.api/mediawiki.ForeignApi.js [deleted file]
resources/src/mediawiki.api/mediawiki.api.category.js [deleted file]
resources/src/mediawiki.api/mediawiki.api.edit.js [deleted file]
resources/src/mediawiki.api/mediawiki.api.js [deleted file]
resources/src/mediawiki.api/mediawiki.api.login.js [deleted file]
resources/src/mediawiki.api/mediawiki.api.options.js [deleted file]
resources/src/mediawiki.api/mediawiki.api.parse.js [deleted file]
resources/src/mediawiki.api/mediawiki.api.upload.js [deleted file]
resources/src/mediawiki.api/mediawiki.api.watch.js [deleted file]
resources/src/mediawiki.page/mediawiki.page.gallery.css [deleted file]
resources/src/mediawiki.page/mediawiki.page.gallery.js [deleted file]
resources/src/mediawiki.page/mediawiki.page.gallery.print.css [deleted file]
resources/src/mediawiki.page/mediawiki.page.image.pagination.js [deleted file]
resources/src/mediawiki.page/mediawiki.page.patrol.ajax.js [deleted file]
resources/src/mediawiki.page/mediawiki.page.ready.js [deleted file]
resources/src/mediawiki.page/mediawiki.page.startup.js [deleted file]
resources/src/mediawiki.page/mediawiki.page.watch.ajax.js [deleted file]
resources/src/mediawiki.widgets/mw.widgets.TitleOptionWidget.js
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.js
resources/src/mediawiki.widgets/mw.widgets.TitleWidget.less
resources/src/mediawiki/ForeignApi.js [new file with mode: 0644]
resources/src/mediawiki/api.js [new file with mode: 0644]
resources/src/mediawiki/api/category.js [new file with mode: 0644]
resources/src/mediawiki/api/edit.js [new file with mode: 0644]
resources/src/mediawiki/api/login.js [new file with mode: 0644]
resources/src/mediawiki/api/options.js [new file with mode: 0644]
resources/src/mediawiki/api/parse.js [new file with mode: 0644]
resources/src/mediawiki/api/upload.js [new file with mode: 0644]
resources/src/mediawiki/api/watch.js [new file with mode: 0644]
resources/src/mediawiki/page/gallery-print.css [new file with mode: 0644]
resources/src/mediawiki/page/gallery.css [new file with mode: 0644]
resources/src/mediawiki/page/gallery.js [new file with mode: 0644]
resources/src/mediawiki/page/image-pagination.js [new file with mode: 0644]
resources/src/mediawiki/page/patrol.js [new file with mode: 0644]
resources/src/mediawiki/page/ready.js [new file with mode: 0644]
resources/src/mediawiki/page/startup.js [new file with mode: 0644]
resources/src/mediawiki/page/watch.js [new file with mode: 0644]
tests/phpunit/LessFileCompilationTest.php
tests/phpunit/structure/ResourcesTest.php

diff --git a/CREDITS b/CREDITS
index 44adc4f..76d2107 100644 (file)
--- a/CREDITS
+++ b/CREDITS
@@ -1,6 +1,6 @@
 {{int:version-credits-summary}}
 <!--
-MediaWiki 1.26 is a collaborative project released under the
+MediaWiki 1.27 is a collaborative project released under the
 GNU General Public License v2. We would like to recognize the
 following names for their contribution to the product.
 -->
diff --git a/HISTORY b/HISTORY
index 07f0fac..0c2b8ac 100644 (file)
--- a/HISTORY
+++ b/HISTORY
@@ -1,4 +1,4 @@
-Change notes from older releases. For current info see RELEASE-NOTES-1.26.
+Change notes from older releases. For current info see RELEASE-NOTES-1.27.
 
 == MediaWiki 1.25 ==
 
index 3ba55e3..efca318 100644 (file)
@@ -151,6 +151,7 @@ production.
 * API responses to GET requests may now include ETag and Last-Modified headers,
   and will honor corresponding If-None-Match and If-Modified-Since on such
   requests.
+* (T47988) The protect log event details now use new-style formatting.
 
 === Action API internal changes in 1.26 ===
 * New metadata item ApiResult::META_KVP_MERGE to allow for merging the KVP key
@@ -237,6 +238,10 @@ changes to languages because of Phabricator reports.
   by &nbsp; and HTML entity encodings of &nbsp, <, and >.
 * DatabaseBase::resultObject() is now protected (use outside Database classes
   not necessary since 1.11).
+* Calling ResourceLoaderFileModule::readStyleFiles() without a
+  ResourceLoaderContext instance is deprecated.
+* ResourceLoader::getLessCompiler() now takes an optional parameter of
+  additional LESS variables to set for the compiler.
 
 == Compatibility ==
 
diff --git a/RELEASE-NOTES-1.27 b/RELEASE-NOTES-1.27
new file mode 100644 (file)
index 0000000..71c3dcd
--- /dev/null
@@ -0,0 +1,97 @@
+Security reminder: If you have PHP's register_globals option set, you must
+turn it off. MediaWiki will not work with it enabled.
+
+== MediaWiki 1.27 ==
+
+THIS IS NOT A RELEASE YET
+
+MediaWiki 1.27 is an alpha-quality branch and is not recommended for use in
+production.
+
+=== Configuration changes in 1.27 ===
+
+=== New features in 1.27 ===
+
+==== External libraries ====
+
+=== Bug fixes in 1.27 ===
+
+=== Action API changes in 1.27 ===
+
+=== Action API internal changes in 1.27 ===
+
+=== Languages updated in 1.27 ===
+
+MediaWiki supports over 350 languages. Many localisations are updated
+regularly. Below only new and removed languages are listed, as well as
+changes to languages because of Bugzilla reports.
+
+
+=== Other changes in 1.27 ===
+
+
+== Compatibility ==
+
+MediaWiki 1.27 requires PHP 5.3.3 or later. There is experimental support for
+HHVM 3.3.0.
+
+MySQL is the recommended DBMS. PostgreSQL or SQLite can also be used, but
+support for them is somewhat less mature. There is experimental support for
+Oracle and Microsoft SQL Server.
+
+The supported versions are:
+
+* MySQL 5.0.3 or later
+* PostgreSQL 8.3 or later
+* SQLite 3.3.7 or later
+* Oracle 9.0.1 or later
+* Microsoft SQL Server 2005 (9.00.1399)
+
+== Upgrading ==
+
+1.27 has several database changes since 1.26, and will not work without schema
+updates. Note that due to changes to some very large tables like the revision
+table, the schema update may take quite long (minutes on a medium sized site,
+many hours on a large site).
+
+If upgrading from before 1.11, and you are using a wiki as a commons
+repository, make sure that it is updated as well. Otherwise, errors may arise
+due to database schema changes.
+
+If upgrading from before 1.7, you may want to run refreshLinks.php to ensure
+new database fields are filled with data.
+
+If you are upgrading from MediaWiki 1.4.x or earlier, you should upgrade to
+1.5 first. The upgrade script maintenance/upgrade1_5.php has been removed
+with MediaWiki 1.21.
+
+Don't forget to always back up your database before upgrading!
+
+See the file UPGRADE for more detailed upgrade instructions.
+
+For notes on 1.26.x and older releases, see HISTORY.
+
+== Online documentation ==
+
+Documentation for both end-users and site administrators is available on
+MediaWiki.org, and is covered under the GNU Free Documentation License (except
+for pages that explicitly state that their contents are in the public domain):
+
+       https://www.mediawiki.org/wiki/Documentation
+
+== Mailing list ==
+
+A mailing list is available for MediaWiki user support and discussion:
+
+       https://lists.wikimedia.org/mailman/listinfo/mediawiki-l
+
+A low-traffic announcements-only list is also available:
+
+       https://lists.wikimedia.org/mailman/listinfo/mediawiki-announce
+
+It's highly recommended that you sign up for one of these lists if you're
+going to run a public MediaWiki, so you can be notified of security fixes.
+
+== IRC help ==
+
+There's usually someone online in #mediawiki on irc.freenode.net.
index 802229e..5fd8574 100644 (file)
@@ -75,7 +75,7 @@ $wgConfigRegistry = array(
  * MediaWiki version number
  * @since 1.2
  */
-$wgVersion = '1.26alpha';
+$wgVersion = '1.27alpha';
 
 /**
  * Name of the site. It must be changed in LocalSettings.php
index 9dec950..4b2ff8c 100644 (file)
@@ -30,7 +30,7 @@
  * version are hardcoded here
  */
 function wfEntryPointCheck( $entryPoint ) {
-       $mwVersion = '1.26';
+       $mwVersion = '1.27';
        $minimumVersionPHP = '5.3.3';
        $phpVersion = PHP_VERSION;
 
index faf1bdc..029f5cf 100644 (file)
@@ -458,7 +458,8 @@ class User implements IDBAccessObject {
                $data['mVersion'] = self::VERSION;
                $key = wfMemcKey( 'user', 'id', $this->mId );
 
-               ObjectCache::getMainWANInstance()->set( $key, $data, 3600 );
+               $opts = array( 'since' => wfGetDB( DB_SLAVE )->trxTimestamp() );
+               ObjectCache::getMainWANInstance()->set( $key, $data, 3600, $opts );
        }
 
        /** @name newFrom*() static factory methods */
@@ -1203,18 +1204,15 @@ class User implements IDBAccessObject {
                        return false;
                }
 
-               $db = ( $flags & self::READ_LATEST )
-                       ? wfGetDB( DB_MASTER )
-                       : wfGetDB( DB_SLAVE );
+               list( $index, $options ) = DBAccessObjectUtils::getDBOptions( $flags );
+               $db = wfGetDB( $index );
 
                $s = $db->selectRow(
                        'user',
                        self::selectFields(),
                        array( 'user_id' => $this->mId ),
                        __METHOD__,
-                       ( ( $flags & self::READ_LOCKING ) == self::READ_LOCKING )
-                               ? array( 'LOCK IN SHARE MODE' )
-                               : array()
+                       $options
                );
 
                $this->queryFlagsUsed = $flags;
@@ -1484,11 +1482,12 @@ class User implements IDBAccessObject {
 
                if ( $success ) {
                        $this->mTouched = $newTouched;
+                       $this->clearSharedCache();
+               } else {
+                       // Clears on failure too since that is desired if the cache is stale
+                       $this->clearSharedCache( 'refresh' );
                }
 
-               // Clears on failure too since that is desired if the cache is stale
-               $this->clearSharedCache();
-
                return $success;
        }
 
@@ -2282,22 +2281,29 @@ class User implements IDBAccessObject {
        }
 
        /**
-        * Clear user data from memcached.
-        * Use after applying fun updates to the database; caller's
+        * Clear user data from memcached
+        *
+        * Use after applying updates to the database; caller's
         * responsibility to update user_touched if appropriate.
         *
         * Called implicitly from invalidateCache() and saveSettings().
+        *
+        * @param string $mode Use 'refresh' to clear now; otherwise before DB commit
         */
-       public function clearSharedCache() {
+       public function clearSharedCache( $mode = 'changed' ) {
                $id = $this->getId();
                if ( !$id ) {
                        return;
                }
 
                $key = wfMemcKey( 'user', 'id', $id );
-               wfGetDB( DB_MASTER )->onTransactionPreCommitOrIdle( function() use ( $key ) {
-                       ObjectCache::getMainWANInstance()->delete( $key );
-               } );
+               if ( $mode === 'refresh' ) {
+                       ObjectCache::getMainWANInstance()->delete( $key, 1 );
+               } else {
+                       wfGetDB( DB_MASTER )->onTransactionPreCommitOrIdle( function() use ( $key ) {
+                               ObjectCache::getMainWANInstance()->delete( $key );
+                       } );
+               }
        }
 
        /**
@@ -3702,7 +3708,7 @@ class User implements IDBAccessObject {
 
                if ( !$dbw->affectedRows() ) {
                        // Maybe the problem was a missed cache update; clear it to be safe
-                       $this->clearSharedCache();
+                       $this->clearSharedCache( 'refresh' );
                        // User was changed in the meantime or loaded with stale data
                        $from = ( $this->queryFlagsUsed & self::READ_LATEST ) ? 'master' : 'slave';
                        throw new MWException(
index 43f03c3..6ddc596 100644 (file)
@@ -370,7 +370,7 @@ abstract class Action {
         * Returns the description that goes below the \<h1\> tag
         * @since 1.17
         *
-        * @return string
+        * @return string HTML
         */
        protected function getDescription() {
                return $this->msg( strtolower( $this->getName() ) )->escaped();
index 26f43cb..aa201d7 100644 (file)
@@ -31,7 +31,10 @@ abstract class FormAction extends Action {
         * Get an HTMLForm descriptor array
         * @return array
         */
-       abstract protected function getFormFields();
+       protected function getFormFields() {
+               // Default to an empty form with just a submit button
+               return array();
+       }
 
        /**
         * Add pre- or post-text to the form
@@ -68,13 +71,16 @@ abstract class FormAction extends Action {
                $form = new HTMLForm( $this->fields, $this->getContext(), $this->getName() );
                $form->setSubmitCallback( array( $this, 'onSubmit' ) );
 
+               $title = $this->getTitle();
+               $form->setAction( $title->getLocalURL( array( 'action' => $this->getName() ) ) );
                // Retain query parameters (uselang etc)
-               $form->addHiddenField( 'action', $this->getName() ); // Might not be the same as the query string
                $params = array_diff_key(
                        $this->getRequest()->getQueryValues(),
                        array( 'action' => null, 'title' => null )
                );
-               $form->addHiddenField( 'redirectparams', wfArrayToCgi( $params ) );
+               if ( $params ) {
+                       $form->addHiddenField( 'redirectparams', wfArrayToCgi( $params ) );
+               }
 
                $form->addPreText( $this->preText() );
                $form->addPostText( $this->postText() );
@@ -87,9 +93,10 @@ abstract class FormAction extends Action {
        }
 
        /**
-        * Process the form on POST submission.  If you return false from getFormFields(),
-        * this will obviously never be reached.  If you don't want to do anything with the
-        * form, just return false here
+        * Process the form on POST submission.
+        *
+        * If you don't want to do anything with the form, just return false here.
+        *
         * @param array $data
         * @return bool|array True for success, false for didn't-try, array of errors on failure
         */
index ed0bff7..e5da172 100644 (file)
@@ -44,14 +44,6 @@ class PurgeAction extends FormAction {
                return '';
        }
 
-       /**
-        * Just get an empty form with a single submit button
-        * @return array
-        */
-       protected function getFormFields() {
-               return array();
-       }
-
        public function onSubmit( $data ) {
                return $this->page->doPurge();
        }
index 8b6e329..30b83d7 100644 (file)
@@ -35,16 +35,11 @@ class WatchAction extends FormAction {
                return false;
        }
 
-       protected function getDescription() {
-               return $this->msg( 'addwatch' )->escaped();
-       }
-
        /**
-        * Just get an empty form with a single submit button
-        * @return array
+        * @return string HTML
         */
-       protected function getFormFields() {
-               return array();
+       protected function getDescription() {
+               return $this->msg( 'addwatch' )->escaped();
        }
 
        public function onSubmit( $data ) {
@@ -53,30 +48,6 @@ class WatchAction extends FormAction {
                return true;
        }
 
-       /**
-        * This can be either formed or formless depending on the session token given
-        */
-       public function show() {
-               $this->setHeaders();
-
-               $user = $this->getUser();
-               // This will throw exceptions if there's a problem
-               $this->checkCanExecute( $user );
-
-               // Must have valid token for this action/title
-               $salt = array( $this->getName(), $this->getTitle()->getPrefixedDBkey() );
-
-               if ( $user->matchEditToken( $this->getRequest()->getVal( 'token' ), $salt ) ) {
-                       $this->onSubmit( array() );
-                       $this->onSuccess();
-               } else {
-                       $form = $this->getForm();
-                       if ( $form->show() ) {
-                               $this->onSuccess();
-                       }
-               }
-       }
-
        protected function checkCanExecute( User $user ) {
                // Must be logged in
                if ( $user->isAnon() ) {
@@ -86,6 +57,21 @@ class WatchAction extends FormAction {
                parent::checkCanExecute( $user );
        }
 
+       protected function alterForm( HTMLForm $form ) {
+               $form->setSubmitTextMsg( 'confirm-watch-button' );
+               $form->setTokenSalt( 'watch' );
+       }
+
+       protected function preText() {
+               return $this->msg( 'confirm-watch-top' )->parse();
+       }
+
+       public function onSuccess() {
+               $this->getOutput()->addWikiMsg( 'addedwatchtext', $this->getTitle()->getPrefixedText() );
+       }
+
+       /* Static utility methods */
+
        /**
         * Watch or unwatch a page
         * @since 1.22
@@ -176,11 +162,8 @@ class WatchAction extends FormAction {
                if ( $action != 'unwatch' ) {
                        $action = 'watch';
                }
-               $salt = array( $action, $title->getPrefixedDBkey() );
-
-               // This token stronger salted and not compatible with ApiWatch
-               // It's title/action specific because index.php is GET and API is POST
-               return $user->getEditToken( $salt );
+               // Match ApiWatch and ResourceLoaderUserTokensModule
+               return $user->getEditToken( $action );
        }
 
        /**
@@ -195,16 +178,4 @@ class WatchAction extends FormAction {
        public static function getUnwatchToken( Title $title, User $user, $action = 'unwatch' ) {
                return self::getWatchToken( $title, $user, $action );
        }
-
-       protected function alterForm( HTMLForm $form ) {
-               $form->setSubmitTextMsg( 'confirm-watch-button' );
-       }
-
-       protected function preText() {
-               return $this->msg( 'confirm-watch-top' )->parse();
-       }
-
-       public function onSuccess() {
-               $this->getOutput()->addWikiMsg( 'addedwatchtext', $this->getTitle()->getPrefixedText() );
-       }
 }
index a62bcb6..74ce053 100644 (file)
@@ -55,7 +55,7 @@ class ApiOptions extends ApiBase {
                // Load the user from the master to reduce CAS errors on double post (T95839)
                if ( wfGetLB()->getServerCount() > 1 ) {
                        $user = User::newFromId( $user->getId() );
-                       if ( !$user->loadFromId( User::READ_LATEST ) ) {
+                       if ( !$user->loadFromId( User::READ_EXCLUSIVE ) ) {
                                $this->dieUsage( 'Anonymous users cannot change preferences', 'notloggedin' );
                        }
                }
index 8737f7f..da328a6 100644 (file)
        "apihelp-parse-paramvalue-prop-externallinks": "Gibt die externen Links im geparsten Wikitext zurück.",
        "apihelp-parse-paramvalue-prop-revid": "Ergänzt die Versionskennung der geparsten Seite.",
        "apihelp-parse-paramvalue-prop-displaytitle": "Ergänzt den Titel des geparsten Wikitextes.",
-       "apihelp-parse-param-section": "Gibt nur den Inhalt dieses Abschnittes zurück oder erstellt einen neuen Abschnitt, wenn <kbd>new</kbd> angegeben wird.\n\n<kbd>new</kbd> wird nur ausgewertet, wenn auch <var>text</var> angegeben wurde.",
+       "apihelp-parse-param-section": "Parst nur den Inhalt dieser Abschnittsnummer.\n\nFalls <kbd>new</kbd>, parst <var>$1text</var> und <var>$1sectiontitle</var>, als ob ein neuer Abschnitt der Seite hinzugefügt wird.\n\n<kbd>new</kbd> ist nur erlaubt mit der Angabe <var>text</var>.",
        "apihelp-parse-param-sectiontitle": "Überschrift des neuen Abschnittes, wenn <var>section</var> = <kbd>new</kbd> ist.\n\nAnders als beim Bearbeiten der Seite wird der Parameter nicht durch die <var>summary</var> ersetzt, wenn er weggelassen oder leer ist.",
        "apihelp-parse-param-disableeditsection": "Lässt Abschnittsbearbeitungslinks in der Parserausgabe weg.",
        "apihelp-parse-param-preview": "Im Vorschaumodus parsen.",
index a830edc..c26705e 100644 (file)
        "apihelp-query+backlinks-param-filterredir": "Comment filtrer les redirections. Si positionné à <kbd>nonredirects</kbd> quand <var>$1redirect</var> est activé, cela ne s’applique qu’au second niveau.",
        "apihelp-query+backlinks-param-limit": "Combien de pages renvoyer au total. Si $1redirect est activé, la limite s’applique à chaque niveau séparément (ce qui signifie jusqu’à 2 * limite résultats peut être retourné).",
        "apihelp-query+backlinks-param-redirect": "Si le lien vers une page est une redirection, trouver toutes les pages qui ont un lien vers cette redirection aussi. La limite maximale est divisée par deux.",
-       "apihelp-query+backlinks-example-simple": "Afficher les liens vers <kbd>Main page<kbd>.",
-       "apihelp-query+backlinks-example-generator": "Obtenir des informations sur les pages ayant un lien vers <kbd>Main page<kbd>.",
+       "apihelp-query+backlinks-example-simple": "Afficher les liens vers <kbd>Main page</kbd>.",
+       "apihelp-query+backlinks-example-generator": "Obtenir des informations sur les pages ayant un lien vers <kbd>Main page</kbd>.",
        "apihelp-query+blocks-description": "Lister tous les utilisateurs et les adresses IP bloqués.",
        "apihelp-query+blocks-param-start": "L’horodatage auquel démarrer l’énumération.",
        "apihelp-query+blocks-param-end": "L’horodatage auquel arrêter l’énumération.",
        "apihelp-query+extlinks-param-protocol": "Protocole de l’URL. Si vide et <var>$1query</var> est positionné, le protocole est <kbd>http</kbd>. Laisser à la fois ceci et <var>$1query</var> vide pour lister tous les liens externes.",
        "apihelp-query+extlinks-param-query": "Rechercher une chaîne sans protocole. Utile pour vérifier si une certaine page contient une certaine URL externe.",
        "apihelp-query+extlinks-param-expandurl": "Étendre les URLs relatives au protocole avec le protocole canonique.",
-       "apihelp-query+extlinks-example-simple": "Obtenir une liste des liens externes de <kbd>Main Page<kbd>.",
+       "apihelp-query+extlinks-example-simple": "Obtenir une liste des liens externes de <kbd>Main Page</kbd>.",
        "apihelp-query+exturlusage-description": "Énumérer les pages contenant une URL donnée.",
        "apihelp-query+exturlusage-param-prop": "Quelles informations inclure :",
        "apihelp-query+exturlusage-paramvalue-prop-ids": "Ajoute l’ID de la page.",
index 1a9a22b..23ef669 100644 (file)
        "apihelp-query+alldeletedrevisions-param-namespace": "לרשום רק דפים במרחב השם הזה.",
        "apihelp-query+alldeletedrevisions-param-miser-user-namespace": "<strong>לתשומת לבך:</strong> בשל [[mw:Manual:$wgMiserMode|מצב חיסכון]], שימוש ב־<var>$1user</var> וב־<var>$1namespace</var> ביחד עלול להניב החזרה של פחות מ־<var>$1limit</var> תוצאות לפני המשך; במצבים קיצוניים יכולות להיות מוחזרות אפס תוצאות.",
        "apihelp-query+alldeletedrevisions-param-generatetitles": "בעת שימוש בתור מחולל, לחולל כותרת במקום מזהי גרסה.",
-       "apihelp-query+alldeletedrevisions-example-user": "לרשום את 50 התרומות המחוקות האחרונות של משתמש <kbd>Example<kbd>.",
+       "apihelp-query+alldeletedrevisions-example-user": "לרשום את 50 התרומות המחוקות האחרונות של משתמש <kbd>Example</kbd>.",
        "apihelp-query+alldeletedrevisions-example-ns-main": "רשימת 50 הגרסאות המחוקות הראשונות במרחב הראשי.",
        "apihelp-query+allfileusages-description": "לרשום את כל שימושי הקובץ, כולל בלתי־קיימים.",
        "apihelp-query+allfileusages-param-from": "מאיזה שם קובץ להתחיל למנות.",
        "apihelp-query+backlinks-param-limit": "כמה דפים להחזיר בסך הכול. אם <var>$1redirect</var> מופעל, ההגבלה חלה על כל רמה בנפרד (כלומר יכולות להיות מוחזרות עד <span dir=\"ltr\">2 * <var>$1limit</var></span> תוצאות).",
        "apihelp-query+backlinks-param-redirect": "אם הדף המקשר הוא הפניה, למצוא גם את כל הדפים שמקשרים לאותה ההפניה. ההגבלה המרבית מוקטנת בחצי.",
        "apihelp-query+backlinks-example-simple": "הצגת קישורים ל־<kbd>Main Page</kbd>.",
-       "apihelp-query+backlinks-example-generator": "קבל מידע על דפים שמקשרים ל־<kbd>Main page<kbd>.",
+       "apihelp-query+backlinks-example-generator": "קבל מידע על דפים שמקשרים ל־<kbd>Main page</kbd>.",
        "apihelp-query+blocks-description": "לרשום את כל המשתמשים וכתובות ה־IP שנחסמו.",
        "apihelp-query+blocks-param-start": "מאיזה חותם‏־זמן להתחיל למנות.",
        "apihelp-query+blocks-param-end": "באיזה חותם זמן להפסיק למנות.",
        "apihelp-query+extlinks-param-protocol": "הפרוטוקול של ה־URL. אם זה ריק, ו־<var>$1query</var> מוגדר, הפרוטוקול הוא <kbd>http</kbd>. יש להשאיר את זה ואת <var>$1query</var> ריק כדי לרשום את כל הקישורים החיצוניים.",
        "apihelp-query+extlinks-param-query": "מחרוזת חיפוש ללא פרוטוקול. שימושי לבדיקה האם דף מסוים מכיל url חיצוני מסוים.",
        "apihelp-query+extlinks-param-expandurl": "הרחבת URL־ים בעלי פרוטוקול יחסי בפרוטוקול קנוני.",
-       "apihelp-query+extlinks-example-simple": "קבלת רשימת קישורים חיצוניים ב־<kbd>Main Page<kbd>.",
+       "apihelp-query+extlinks-example-simple": "קבלת רשימת קישורים חיצוניים ב־<kbd>Main Page</kbd>.",
        "apihelp-query+exturlusage-description": "למנות דפים שמכילים URL נתון.",
        "apihelp-query+exturlusage-param-prop": "אילו חלקי מידע לכלול:",
        "apihelp-query+exturlusage-paramvalue-prop-ids": "הוספת מזהה הדף.",
index 676fd59..31bcd96 100644 (file)
        "apihelp-query+backlinks-description": "与えられたページにリンクしているすべてのページを検索します。",
        "apihelp-query+backlinks-param-title": "検索するページ名。<var>$1pageid</var> とは同時に使用できません。",
        "apihelp-query+backlinks-param-pageid": "検索するページID。<var>$1title</var>とは同時に使用できません。",
-       "apihelp-query+backlinks-example-simple": "<kbd>Main page<kbd> へのリンクを表示する。",
-       "apihelp-query+backlinks-example-generator": "<kbd>Main page<kbd> にリンクしているページの情報を取得する。",
+       "apihelp-query+backlinks-example-simple": "<kbd>Main page</kbd> へのリンクを表示する。",
+       "apihelp-query+backlinks-example-generator": "<kbd>Main page</kbd> にリンクしているページの情報を取得する。",
        "apihelp-query+blocks-description": "ブロックされた利用者とIPアドレスを一覧表示します。",
        "apihelp-query+blocks-param-start": "列挙の始点となるタイムスタンプ。",
        "apihelp-query+blocks-param-end": "列挙の終点となるタイムスタンプ。",
        "apihelp-query+extlinks-description": "与えられたページにあるすべての外部URL (インターウィキを除く) を返します。",
        "apihelp-query+extlinks-param-limit": "返すリンクの数。",
        "apihelp-query+extlinks-param-protocol": "URLのプロトコル。このパラメータが空であり、かつ<var>$1query</var> が設定されている場合, protocol は <kbd>http</kbd> となります。すべての外部リンクを一覧表示するためにはこのパラメータと <var>$1query</var> の両方を空にしてください。",
-       "apihelp-query+extlinks-example-simple": "<kbd>Main Page<kbd> の外部リンクの一覧を取得する。",
+       "apihelp-query+extlinks-example-simple": "<kbd>Main Page</kbd> の外部リンクの一覧を取得する。",
        "apihelp-query+exturlusage-description": "与えられたURLを含むページを一覧表示します。",
        "apihelp-query+exturlusage-example-simple": "<kbd>http://www.mediawiki.org</kbd> にリンクしているページを一覧表示する。",
        "apihelp-query+filearchive-example-simple": "削除されたファイルの一覧を表示する。",
        "apihelp-query+querypage-param-limit": "返す結果の数。",
        "apihelp-query+querypage-example-ancientpages": "[[Special:Ancientpages]] の結果を返す。",
        "apihelp-query+random-param-namespace": "この名前空間にあるページのみを返します。",
-       "apihelp-query+random-param-filterredir": "どうやってリダイレクトのためのフィルターをするのか",
+       "apihelp-query+random-param-redirect": "代わりに <kbd>$1filterredir=redirects</kbd> を使用してください。",
+       "apihelp-query+random-param-filterredir": "転送ページを絞り込む方法。",
        "apihelp-query+random-example-simple": "標準名前空間から2つのページを無作為に返す。",
        "apihelp-query+random-example-generator": "標準名前空間から無作為に選ばれた2つのページのページ情報を返す。",
        "apihelp-query+recentchanges-description": "最近の更新を一覧表示します。",
        "api-help-parameters": "{{PLURAL:$1|パラメーター}}:",
        "api-help-param-deprecated": "廃止予定です。",
        "api-help-param-required": "このパラメーターは必須です。",
+       "api-help-datatypes-header": "データ型",
        "api-help-param-list": "{{PLURAL:$1|1=値 (次の値のいずれか1つ)|2=値 (<kbd>{{!}}</kbd>で区切る)}}: $2",
        "api-help-param-list-can-be-empty": "{{PLURAL:$1|0=空欄にしてください|空欄にするか、または $2}}",
        "api-help-param-integer-min": "{{PLURAL:$1|値}}は $2 以上にしてください。",
index 89bed36..72ffefb 100644 (file)
@@ -67,6 +67,7 @@
        "apihelp-query+allusers-description": "All registréiert Benotzer opzielen.",
        "apihelp-query+allusers-paramvalue-prop-implicitgroups": "Lëscht vun alle Gruppen an deenen de Benotzer automatesch dran ass.",
        "apihelp-query+allusers-param-activeusers": "Nëmme Benotzer opzielen déi an de leschten $1 {{PLURAL:$1|Dag|Deeg}} aktiv waren.",
+       "apihelp-query+backlinks-example-simple": "Linken op d'<kbd>Haaptsäit</kbd> weisen.",
        "apihelp-query+blocks-description": "Lëscht vun de gespaarte Benotzer an IP-Adressen.",
        "apihelp-query+blocks-paramvalue-prop-range": "Setzt de Beräich vun den IP-Adressen derbäi déi vun der Spär betraff sinn.",
        "apihelp-query+blocks-example-simple": "Lëscht vun de Spären",
index dcf3c9e..95e776a 100644 (file)
        "apihelp-patrol-example-revid": "Patrulhar uma edição",
        "apihelp-protect-example-protect": "Proteger uma página",
        "apihelp-query+allcategories-description": "Enumerar todas as categorias.",
+       "apihelp-query+alldeletedrevisions-example-user": "Lista das últimas 50 contribuições eliminadas pelo usuário <kbd>Exemplo</kbd>.",
        "apihelp-query+allpages-param-prefix": "Pesquisa para todos os títulos de páginas que comecem com este valor.",
        "apihelp-query+allpages-example-generator": "Mostrar informação sobre 4 páginas que comecem com a letra <kbd>T</kbd>.",
        "apihelp-query+allusers-example-Y": "Lista de utilizadores que comecem com <kbd>Y</kbd>.",
+       "apihelp-query+backlinks-example-simple": "Mostrar links para <kbd>Página Principal</kbd>.",
+       "apihelp-query+backlinks-example-generator": "Obtenha informações sobre as páginas de ligação para <kbd>Página Principal</kbd>.",
        "apihelp-query+blocks-param-limit": "O número máximo de bloqueios a listar.",
        "apihelp-query+categorymembers-description": "Lista de todas as páginas numa categoria fornecida.",
        "apihelp-query+deletedrevs-paraminfo-modes": "{{PLURAL:$1|Modo|Modos}}: $2",
        "apihelp-query+deletedrevs-param-excludeuser": "Não listar edições deste utilizador.",
        "apihelp-query+deletedrevs-param-namespace": "Listar apenas as páginas neste domínio.",
+       "apihelp-query+extlinks-example-simple": "Obtenha uma lista de links externos na <kbd>Página Principal</kbd>.",
        "apihelp-query+filearchive-example-simple": "Mostrar lista de todos os ficheiros eliminados",
        "apihelp-query+info-description": "Obter informação básica da página.",
        "apihelp-query+recentchanges-example-simple": "Lista de mudanças recentes",
index ab3a7af..e890540 100644 (file)
@@ -86,7 +86,7 @@
        "apihelp-edit-param-title": "您希望编辑的页面标题。不能与<var>$1pageid</var>一起使用。",
        "apihelp-edit-param-pageid": "要编辑的页面的页面 ID。不能与<var>$1title</var>一起使用。",
        "apihelp-edit-param-section": "段落数。<kbd>0</kbd>用于首段,<kbd>new</kbd>用于新的段落。",
-       "apihelp-edit-param-sectiontitle": "新小节的标题。",
+       "apihelp-edit-param-sectiontitle": "新段落的标题。",
        "apihelp-edit-param-text": "页面内容。",
        "apihelp-edit-param-summary": "编辑摘要。当$1section=new且未设置$1sectiontitle时,还包括小节标题。",
        "apihelp-edit-param-tags": "更改标签以应用修订。",
        "apihelp-parse-param-disabletidy": "不要在解析器输出中运行HTML清理(例如tidy)。",
        "apihelp-parse-param-generatexml": "生成XML解析树(需要内容模型<code>$1</code>;被<kbd>$2prop=parsetree</kbd>所取代)。",
        "apihelp-parse-param-preview": "在预览模式下解析。",
-       "apihelp-parse-param-sectionpreview": "在小节预览模式下解析 (同时要启用预览模式)。",
+       "apihelp-parse-param-sectionpreview": "在段落预览模式下解析(同时要启用预览模式)。",
        "apihelp-parse-param-disabletoc": "在输出中省略目录。",
        "apihelp-parse-param-contentformat": "用于输入文本的内容序列化格式。只当与$1text一起使用时有效。",
        "apihelp-parse-example-page": "解析一个页面。",
        "apihelp-query+alldeletedrevisions-param-namespace": "只列出此名字空间的页面。",
        "apihelp-query+alldeletedrevisions-param-miser-user-namespace": "<strong>注意:</strong>由于[[mw:Manual:$wgMiserMode|miser模式]],同时使用<var>$1user</var>和<var>$1namespace</var>将导致继续前返回少于<var>$1limit</var>个结果,在极端条件下可能不返回任何结果。",
        "apihelp-query+alldeletedrevisions-param-generatetitles": "当作为生成器使用时,生成标题而不是修订ID。",
-       "apihelp-query+alldeletedrevisions-example-user": "列出由<kbd>Example<kbd>作出的最近50次已删除贡献。",
+       "apihelp-query+alldeletedrevisions-example-user": "列出由<kbd>Example</kbd>作出的最近50次已删除贡献。",
        "apihelp-query+alldeletedrevisions-example-ns-main": "列出前50次已删除的主名字空间修订。",
        "apihelp-query+allfileusages-description": "列出所有文件用途,包括不存在的。",
        "apihelp-query+allfileusages-param-from": "要列举的起始文件标题。",
        "apihelp-query+backlinks-param-filterredir": "如何过滤重定向。当<var>$1redirect</var>被启用时如果设置为<kbd>nonredirects</kbd>,这只会应用到第二级。",
        "apihelp-query+backlinks-param-limit": "返回总计页面数。如果<var>$1redirect</var>被启用,则限定分别适用于每一等级(这意味着将返回多达2 * <var>$1limit</var>个结果)。",
        "apihelp-query+backlinks-param-redirect": "如果链入页面是一个重定向,则寻找所有链接至此重定向的页面。最大限制减半。",
-       "apihelp-query+backlinks-example-simple": "显示至<kbd>Main page<kbd>的链接。",
-       "apihelp-query+backlinks-example-generator": "获取关于链接至<kbd>Main page<kbd>的页面的信息。",
+       "apihelp-query+backlinks-example-simple": "显示至<kbd>Main page</kbd>的链接。",
+       "apihelp-query+backlinks-example-generator": "获取关于链接至<kbd>Main page</kbd>的页面的信息。",
        "apihelp-query+blocks-description": "列出所有被封禁的用户和IP地址。",
        "apihelp-query+blocks-param-start": "枚举的起始时间戳。",
        "apihelp-query+blocks-param-end": "枚举的结束时间戳。",
        "apihelp-query+categorymembers-param-prop": "要包含的信息束:",
        "apihelp-query+categorymembers-paramvalue-prop-ids": "添加页面ID。",
        "apihelp-query+categorymembers-paramvalue-prop-title": "添加页面标题和名字空间ID。",
-       "apihelp-query+categorymembers-paramvalue-prop-sortkey": "Adds the sortkey used for sorting in the category (hexadecimal string).",
-       "apihelp-query+categorymembers-paramvalue-prop-sortkeyprefix": "Adds the sortkey prefix used for sorting in the category (human-readable part of the sortkey).",
-       "apihelp-query+categorymembers-paramvalue-prop-type": "Adds the type that the page has been categorised as (page, subcat or file).",
-       "apihelp-query+categorymembers-paramvalue-prop-timestamp": "Adds the timestamp of when the page was included.",
+       "apihelp-query+categorymembers-paramvalue-prop-sortkey": "添加用于分类中排序的关键字(十六进制字符串)。",
+       "apihelp-query+categorymembers-paramvalue-prop-sortkeyprefix": "添加用于分类中排序的关键字前缀(关键字的人类可读部分)。",
+       "apihelp-query+categorymembers-paramvalue-prop-type": "添加页面被分类的类型(页面、子分类或文件)。",
+       "apihelp-query+categorymembers-paramvalue-prop-timestamp": "添加页面被包括时的时间戳。",
        "apihelp-query+categorymembers-param-namespace": "仅包含这些名字空间的页面。注意<kbd>$1type=subcat</kbd>或<kbd>$1type=file</kbd>可能被使用,而不是<kbd>$1namespace=14</kbd>或<kbd>6</kbd>。",
        "apihelp-query+categorymembers-param-type": "包含的分类成员类型。当<kbd>$1sort=timestamp</kbd>被设置时会忽略。",
        "apihelp-query+categorymembers-param-limit": "返回页面的最大数量。",
        "apihelp-query+categorymembers-param-start": "开始列举的时间戳。只能与<kbd>$1sort=timestamp</kbd>一起使用。",
        "apihelp-query+categorymembers-param-end": "列举的结尾时间戳。只能与<kbd>$1sort=timestamp</kbd>一起使用。",
        "apihelp-query+categorymembers-param-starthexsortkey": "开始列举的关键词,由<kbd>$1prop=sortkey</kbd>返回。不能与<kbd>$1sort=sortkey</kbd>一起使用。",
-       "apihelp-query+categorymembers-param-endhexsortkey": "结束列举的关键词,由<kbd>$1prop=sortkey</kbd>返回。不能与<kbd>$1sort=sortkey</kbd>一起使用。",
+       "apihelp-query+categorymembers-param-endhexsortkey": "结束列举的关键字,由<kbd>$1prop=sortkey</kbd>返回。只能与<kbd>$1sort=sortkey</kbd>一起使用。",
        "apihelp-query+categorymembers-param-startsortkeyprefix": "要开始列举的排序关键词前缀。只能与<kbd>$1sort=sortkey</kbd>一起使用。覆盖<var>$1starthexsortkey</var>。",
+       "apihelp-query+categorymembers-param-endsortkeyprefix": "要结束列举<strong>before</strong>的关键字前缀(而不是<strong>at</strong>;如果此值出现,它将不被包括!)只能与$1sort=sortkey一起使用。覆盖$1endhexsortkey。",
        "apihelp-query+categorymembers-param-startsortkey": "请改用$1starthexsortkey。",
        "apihelp-query+categorymembers-param-endsortkey": "请改用$1endhexsortkey。",
        "apihelp-query+categorymembers-example-simple": "获取<kbd>Category:Physics</kbd>中的前10个页面。",
        "apihelp-query+extlinks-param-protocol": "URL协议。如果为空并且<var>$1query</var>被设置,协议为<kbd>http</kbd>。将此和<var>$1query</var>都留空以列举所有外部链接。",
        "apihelp-query+extlinks-param-query": "不使用协议搜索字符串。对于检查某一页面是否包含某一外部URL很有用。",
        "apihelp-query+extlinks-param-expandurl": "扩展协议相对URL与规范协议。",
-       "apihelp-query+extlinks-example-simple": "获取<kbd>Main Page<kbd>的外部链接列表。",
+       "apihelp-query+extlinks-example-simple": "获取<kbd>Main Page</kbd>的外部链接列表。",
        "apihelp-query+exturlusage-description": "列举包含一个指定URL的页面。",
        "apihelp-query+exturlusage-param-prop": "要包含的信息束:",
        "apihelp-query+exturlusage-paramvalue-prop-ids": "添加页面ID。",
index 950a264..e148f56 100644 (file)
@@ -54,7 +54,7 @@ class SquidUpdate {
        /**
         * Create a SquidUpdate from an array of Title objects, or a TitleArray object
         *
-        * @param array $titles
+        * @param Traversable|array $titles
         * @param array $urlArr
         * @return SquidUpdate
         */
index 7aa7919..6e3fb51 100644 (file)
@@ -203,6 +203,7 @@ class LocalRepo extends FileRepo {
                } else {
                        $expiry = 86400; // has invalidation, 1 day
                }
+
                $cachedValue = $cache->get( $memcKey );
                if ( $cachedValue === ' ' || $cachedValue === '' ) {
                        // Does not exist
@@ -211,9 +212,11 @@ class LocalRepo extends FileRepo {
                        return Title::newFromText( $cachedValue, NS_FILE );
                } // else $cachedValue is false or null: cache miss
 
+               $opts = array( 'since' => $this->getSlaveDB()->trxTimestamp() );
+
                $id = $this->getArticleID( $title );
                if ( !$id ) {
-                       $cache->set( $memcKey, " ", $expiry );
+                       $cache->set( $memcKey, " ", $expiry, $opts );
 
                        return false;
                }
@@ -227,11 +230,11 @@ class LocalRepo extends FileRepo {
 
                if ( $row && $row->rd_namespace == NS_FILE ) {
                        $targetTitle = Title::makeTitle( $row->rd_namespace, $row->rd_title );
-                       $cache->set( $memcKey, $targetTitle->getDBkey(), $expiry );
+                       $cache->set( $memcKey, $targetTitle->getDBkey(), $expiry, $opts );
 
                        return $targetTitle;
                } else {
-                       $cache->set( $memcKey, '', $expiry );
+                       $cache->set( $memcKey, '', $expiry, $opts );
 
                        return false;
                }
index 6745f18..d146708 100644 (file)
@@ -308,8 +308,9 @@ class LocalFile extends File {
                }
 
                // Cache presence for 1 week and negatives for 1 day
-               $cache = ObjectCache::getMainWANInstance();
-               $cache->set( $key, $cacheVal, $this->fileExists ? 86400 * 7 : 86400 );
+               $ttl = $this->fileExists ? 86400 * 7 : 86400;
+               $opts = array( 'since' => wfGetDB( DB_SLAVE )->trxTimestamp() );
+               ObjectCache::getMainWANInstance()->set( $key, $cacheVal, $ttl, $opts );
        }
 
        /**
index 0ccdb11..211bad1 100644 (file)
@@ -170,7 +170,8 @@ class WebInstallerOutput {
                        $styles = array_merge( $styles, ResourceLoader::makeCombinedStyles(
                                $module->readStyleFiles(
                                        $module->getStyleFiles( $rlContext ),
-                                       $module->getFlip( $rlContext )
+                                       $module->getFlip( $rlContext ),
+                                       $rlContext
                        ) ) );
                }
 
index a9010c2..ef9fec0 100644 (file)
@@ -85,8 +85,6 @@ class HTMLCacheUpdateJob extends Job {
                        return;
                }
 
-               $dbw = wfGetDB( DB_MASTER );
-
                // The page_touched field will need to be bumped for these pages.
                // Only bump it to the present time if no "rootJobTimestamp" was known.
                // If it is known, it can be used instead, which avoids invalidating output
@@ -100,9 +98,12 @@ class HTMLCacheUpdateJob extends Job {
                        $touchTimestamp = wfTimestampNow();
                }
 
+               $dbw = wfGetDB( DB_MASTER );
                // Update page_touched (skipping pages already touched since the root job).
                // Check $wgUpdateRowsPerQuery for sanity; batch jobs are sized by that already.
                foreach ( array_chunk( $pageIds, $wgUpdateRowsPerQuery ) as $batch ) {
+                       $dbw->commit( __METHOD__, 'flush' );
+
                        $dbw->update( 'page',
                                array( 'page_touched' => $dbw->timestamp( $touchTimestamp ) ),
                                array( 'page_id' => $batch,
index c78b299..e8d1e5e 100644 (file)
@@ -24,7 +24,7 @@
  * Multi-datacenter aware caching interface
  *
  * All operations go to the local datacenter cache, except for delete(),
- * touchCheckKey(), and resetCheckKey(), which broadcast to all clusters.
+ * touchCheckKey(), and resetCheckKey(), which broadcast to all datacenters.
  *
  * This class is intended for caching data from primary stores.
  * If the get() method does not return a value, then the caller
@@ -41,9 +41,9 @@
  * that subscribe to the endpoint and update the caches.
  *
  * Broadcasted operations like delete() and touchCheckKey() are done
- * synchronously in the local cluster, but are relayed asynchronously.
+ * synchronously in the local datacenter, but are relayed asynchronously.
  * This means that callers in other datacenters will see older values
- * for however many milliseconds the datacenters are apart. As with
+ * for however many milliseconds the datacenters are apart. As with
  * any cache, this should not be relied on for cases where reads are
  * used to determine writes to source (e.g. non-cache) data stores.
  *
@@ -58,7 +58,7 @@
  * @since 1.26
  */
 class WANObjectCache {
-       /** @var BagOStuff The local cluster cache */
+       /** @var BagOStuff The local datacenter cache */
        protected $cache;
        /** @var string Cache pool name */
        protected $pool;
@@ -68,8 +68,15 @@ class WANObjectCache {
        /** @var int */
        protected $lastRelayError = self::ERR_NONE;
 
+       /** Max time expected to pass between delete() and DB commit finishing */
+       const MAX_COMMIT_DELAY = 1;
+       /** Max expected replication lag for a reasonable storage setup */
+       const MAX_REPLICA_LAG = 7;
+       /** Max time since snapshot transaction start to avoid no-op of set() */
+       const MAX_SNAPSHOT_LAG = 6;
        /** Seconds to tombstone keys on delete() */
-       const HOLDOFF_TTL = 10;
+       const HOLDOFF_TTL = 14; // MAX_COMMIT_DELAY + MAX_REPLICA_LAG + MAX_SNAPSHOT_LAG
+
        /** Seconds to keep dependency purge keys around */
        const CHECK_KEY_TTL = 31536000; // 1 year
        /** Seconds to keep lock keys around */
@@ -158,7 +165,8 @@ class WANObjectCache {
         * isolation can largely be maintained by doing the following:
         *   - a) Calling delete() on entity change *and* creation, before DB commit
         *   - b) Keeping transaction duration shorter than delete() hold-off TTL
-        * However, pre-snapshot values might still be seen due to delete() relay lag.
+        * However, pre-snapshot values might still be seen if an update was made
+        * in a remote datacenter but the purge from delete() didn't relay yet.
         *
         * Consider using getWithSetCallback() instead of get()/set() cycles.
         * That method has cache slam avoiding features for hot/expensive keys.
@@ -250,13 +258,53 @@ class WANObjectCache {
         * the changes do not replicate to the other WAN sites. In that case, delete()
         * should be used instead. This method is intended for use on cache misses.
         *
+        * If the data was read from a snapshot-isolated transactions (e.g. the default
+        * REPEATABLE-READ in innoDB), use 'since' to avoid the following race condition:
+        *   - a) T1 starts
+        *   - b) T2 updates a row, calls delete(), and commits
+        *   - c) The HOLDOFF_TTL passes, expiring the delete() tombstone
+        *   - d) T1 reads the row and calls set() due to a cache miss
+        *   - e) Stale value is stuck in cache
+        *
+        * Example usage:
+        * @code
+        *     $dbr = wfGetDB( DB_SLAVE );
+        *     // Fetch the row from the DB
+        *     $row = $dbr->selectRow( ... );
+        *     $key = wfMemcKey( 'building', $buildingId );
+        *     // Give the age of the transaction snapshot the data came from
+        *     $opts = array( 'since' => $dbr->trxTimestamp() );
+        *     $cache->set( $key, $row, 86400, $opts );
+        * @endcode
+        *
         * @param string $key Cache key
         * @param mixed $value
         * @param integer $ttl Seconds to live [0=forever]
+        * @param array $opts Options map:
+        *   - since   : UNIX timestamp of the data in $value. Typically, this is either
+        *               the current time the data was read or (if applicable) the time when
+        *               the snapshot-isolated transaction the data was read from started.
+        *               [Default: 0 seconds]
+        *   - lockTSE : if excessive possible snapshot lag is detected,
+        *               then stash the value into a temporary location
+        *               with this TTL. This is only useful if the reads
+        *               use getWithSetCallback() with "lockTSE" set.
+        *               [Default: WANObjectCache::TSE_NONE]
         * @return bool Success
         */
-       final public function set( $key, $value, $ttl = 0 ) {
-               $key = self::VALUE_KEY_PREFIX . $key;
+       final public function set( $key, $value, $ttl = 0, array $opts = array() ) {
+               $lockTSE = isset( $opts['lockTSE'] ) ? $opts['lockTSE'] : self::TSE_NONE;
+               $age = isset( $opts['since'] ) ? max( 0, microtime( true ) - $opts['since'] ) : 0;
+
+               if ( $age > self::MAX_SNAPSHOT_LAG ) {
+                       if ( $lockTSE >= 0 ) {
+                               $tempTTL = max( 1, (int)$lockTSE ); // set() expects seconds
+                               $this->cache->set( self::STASH_KEY_PREFIX . $key, $value, $tempTTL );
+                       }
+
+                       return true; // no-op the write for being unsafe
+               }
+
                $wrapped = $this->wrap( $value, $ttl );
 
                $func = function ( $cache, $key, $cWrapped ) use ( $wrapped ) {
@@ -265,11 +313,11 @@ class WANObjectCache {
                                : $wrapped;
                };
 
-               return $this->cache->merge( $key, $func, $ttl, 1 );
+               return $this->cache->merge( self::VALUE_KEY_PREFIX . $key, $func, $ttl, 1 );
        }
 
        /**
-        * Purge a key from all clusters
+        * Purge a key from all datacenters
         *
         * This should only be called when the underlying data (being cached)
         * changes in a significant way. This deletes the key and starts a hold-off
@@ -324,9 +372,9 @@ class WANObjectCache {
                $key = self::VALUE_KEY_PREFIX . $key;
                // Avoid indefinite key salting for sanity
                $ttl = max( $ttl, 1 );
-               // Update the local cluster immediately
+               // Update the local datacenter immediately
                $ok = $this->cache->set( $key, self::PURGE_VAL_PREFIX . microtime( true ), $ttl );
-               // Publish the purge to all clusters
+               // Publish the purge to all datacenters
                return $this->relayPurge( $key, $ttl ) && $ok;
        }
 
@@ -364,7 +412,7 @@ class WANObjectCache {
        }
 
        /**
-        * Purge a "check" key from all clusters, invalidating keys that use it
+        * Purge a "check" key from all datacenters, invalidating keys that use it
         *
         * This should only be called when the underlying data (being cached)
         * changes in a significant way, and it is impractical to call delete()
@@ -392,15 +440,15 @@ class WANObjectCache {
         */
        final public function touchCheckKey( $key ) {
                $key = self::TIME_KEY_PREFIX . $key;
-               // Update the local cluster immediately
+               // Update the local datacenter immediately
                $ok = $this->cache->set( $key,
                        self::PURGE_VAL_PREFIX . microtime( true ), self::CHECK_KEY_TTL );
-               // Publish the purge to all clusters
+               // Publish the purge to all datacenters
                return $this->relayPurge( $key, self::CHECK_KEY_TTL ) && $ok;
        }
 
        /**
-        * Delete a "check" key from all clusters, invalidating keys that use it
+        * Delete a "check" key from all datacenters, invalidating keys that use it
         *
         * This is similar to touchCheckKey() in that keys using it via
         * getWithSetCallback() will be invalidated. The differences are:
@@ -426,22 +474,24 @@ class WANObjectCache {
         */
        final public function resetCheckKey( $key ) {
                $key = self::TIME_KEY_PREFIX . $key;
-               // Update the local cluster immediately
+               // Update the local datacenter immediately
                $ok = $this->cache->delete( $key );
-               // Publish the purge to all clusters
+               // Publish the purge to all datacenters
                return $this->relayDelete( $key ) && $ok;
        }
 
        /**
         * Method to fetch/regenerate cache keys
         *
-        * On cache miss, the key will be set to the callback result,
-        * unless the callback returns false. The arguments supplied are:
-        *     (current value or false, &$ttl)
+        * On cache miss, the key will be set to the callback result via set()
+        * unless the callback returns false. The arguments supplied to it are:
+        *     (current value or false, &$ttl, &$setOpts)
         * The callback function returns the new value given the current
         * value (false if not present). Preemptive re-caching and $checkKeys
         * can result in a non-false current value. The TTL of the new value
         * can be set dynamically by altering $ttl in the callback (by reference).
+        * The $setOpts array can be altered and is given to set() when called;
+        * it is recommended to set the 'since' field to avoid race conditions.
         *
         * Usually, callbacks ignore the current value, but it can be used
         * to maintain "most recent X" values that come from time or sequence
@@ -464,9 +514,16 @@ class WANObjectCache {
         * @code
         *     $key = wfMemcKey( 'cat-recent-actions', $catId );
         *     // Function that derives the new key value given the old value
-        *     $callback = function( $cValue, &$ttl ) { ... };
+        *     $callback = function( $cValue, &$ttl, array &$setOpts ) {
+        *         $dbr = wfGetDB( DB_SLAVE );
+        *         // Fetch the row from the DB
+        *         $row = $dbr->selectRow( ... );
+        *         // Give the age of the transaction snapshot the data came from
+        *         $setOpts = array( 'since' => $dbr->trxTimestamp() );
+        *         return $row;
+        *     };
         *     // Get the key value from cache or from source on cache miss;
-        *     // try to only let one cluster thread manage doing cache updates
+        *     // try to only let one datacenter thread manage doing cache updates
         *     $opts = array( 'lockTSE' => 5, 'lowTTL' => 10 );
         *     $value = $cache->getWithSetCallback( $key, $callback, 60, array(), $opts );
         * @endcode
@@ -484,12 +541,13 @@ class WANObjectCache {
         *     // Function that derives the new key value
         *     $callback = function() { ... };
         *     // Get the key value from cache or from source on cache miss;
-        *     // try to only let one cluster thread manage doing cache updates
+        *     // try to only let one datacenter thread manage doing cache updates
         *     $opts = array( 'lockTSE' => 5, 'lowTTL' => 10 );
         *     $value = $cache->getWithSetCallback( $key, $callback, 60, $checkKeys, $opts );
         * @endcode
         *
         * @see WANObjectCache::get()
+        * @see WANObjectCache::set()
         *
         * @param string $key Cache key
         * @param callable $callback Value generation function
@@ -542,7 +600,7 @@ class WANObjectCache {
 
                $lockAcquired = false;
                if ( $useMutex ) {
-                       // Acquire a cluster-local non-blocking lock
+                       // Acquire a datacenter-local non-blocking lock
                        if ( $this->cache->lock( $key, 0, self::LOCK_TTL ) ) {
                                // Lock acquired; this thread should update the key
                                $lockAcquired = true;
@@ -565,7 +623,8 @@ class WANObjectCache {
                }
 
                // Generate the new value from the callback...
-               $value = call_user_func_array( $callback, array( $cValue, &$ttl ) );
+               $setOpts = array();
+               $value = call_user_func_array( $callback, array( $cValue, &$ttl, &$setOpts ) );
                // When delete() is called, writes are write-holed by the tombstone,
                // so use a special stash key to pass the new value around threads.
                if ( $useMutex && $value !== false && $ttl >= 0 ) {
@@ -579,7 +638,8 @@ class WANObjectCache {
 
                if ( $value !== false && $ttl >= 0 ) {
                        // Update the cache; this will fail if the key is tombstoned
-                       $this->set( $key, $value, $ttl );
+                       $setOpts['lockTSE'] = $lockTSE;
+                       $this->set( $key, $value, $ttl, $setOpts );
                }
 
                return $value;
index 562062f..4e359a6 100644 (file)
@@ -848,12 +848,31 @@ class PPDStack {
  * @ingroup Parser
  */
 class PPDStackElement {
-       public $open,              // Opening character (\n for heading)
-               $close,             // Matching closing character
-               $count,             // Number of opening characters found (number of "=" for heading)
-               $parts,             // Array of PPDPart objects describing pipe-separated parts.
-               $lineStart;         // True if the open char appeared at the start of the input line.
-                                   // Not set for headings.
+       /**
+        * @var string Opening character (\n for heading)
+        */
+       public $open;
+
+       /**
+        * @var string Matching closing character
+        */
+       public $close;
+
+       /**
+        * @var int Number of opening characters found (number of "=" for heading)
+        */
+       public $count;
+
+       /**
+        * @var PPDPart[] Array of PPDPart objects describing pipe-separated parts.
+        */
+       public $parts;
+
+       /**
+        * @var bool True if the open char appeared at the start of the input line.
+        *  Not set for headings.
+        */
+       public $lineStart;
 
        public $partClass = 'PPDPart';
 
@@ -924,7 +943,10 @@ class PPDStackElement {
  * @ingroup Parser
  */
 class PPDPart {
-       public $out; // Output accumulator string
+       /**
+        * @var string Output accumulator string
+        */
+       public $out;
 
        // Optional member variables:
        //   eqpos        Position of equals sign in output accumulator
index c20d386..dacf013 100644 (file)
@@ -956,8 +956,8 @@ class ResourceLoader implements LoggerAwareInterface {
         * Generate code for a response.
         *
         * @param ResourceLoaderContext $context Context in which to generate a response
-        * @param array $modules List of module objects keyed by module name
-        * @param array $missing List of requested module names that are unregistered (optional)
+        * @param ResourceLoaderModule[] $modules List of module objects keyed by module name
+        * @param string[] $missing List of requested module names that are unregistered (optional)
         * @return string Response data
         */
        public function makeModuleResponse( ResourceLoaderContext $context,
@@ -1246,7 +1246,7 @@ MESSAGE;
        }
 
        private static function isEmptyObject( stdClass $obj ) {
-               foreach ( $obj as $key => &$value ) {
+               foreach ( $obj as $key => $value ) {
                        return false;
                }
                return true;
@@ -1611,12 +1611,15 @@ MESSAGE;
        /**
         * Returns LESS compiler set up for use with MediaWiki
         *
+        * @since 1.22
+        * @since 1.26 added $extraVars parameter
         * @param Config $config
+        * @param array $extraVars Associative array of extra (i.e., other than the
+        *   globally-configured ones) that should be used for compilation.
         * @throws MWException
-        * @since 1.22
         * @return Less_Parser
         */
-       public static function getLessCompiler( Config $config ) {
+       public static function getLessCompiler( Config $config, $extraVars = array() ) {
                // When called from the installer, it is possible that a required PHP extension
                // is missing (at least for now; see bug 47564). If this is the case, throw an
                // exception (caught by the installer) to prevent a fatal error later on.
@@ -1625,7 +1628,7 @@ MESSAGE;
                }
 
                $parser = new Less_Parser;
-               $parser->ModifyVars( self::getLessVars( $config ) );
+               $parser->ModifyVars( array_merge( self::getLessVars( $config ), $extraVars ) );
                $parser->SetImportDirs( array_fill_keys( $config->get( 'ResourceLoaderLESSImportPaths' ), '' ) );
                $parser->SetOption( 'relativeUrls', false );
                $parser->SetCacheDir( $config->get( 'CacheDirectory' ) ?: wfTempDir() );
@@ -1644,8 +1647,6 @@ MESSAGE;
                if ( !self::$lessVars ) {
                        $lessVars = $config->get( 'ResourceLoaderLESSVars' );
                        Hooks::run( 'ResourceLoaderGetLessVars', array( &$lessVars ) );
-                       // Sort by key to ensure consistent hashing for cache lookups.
-                       ksort( $lessVars );
                        self::$lessVars = $lessVars;
                }
                return self::$lessVars;
index ef51e0c..fca7961 100644 (file)
  * @since 1.24
  */
 class ResourceLoaderEditToolbarModule extends ResourceLoaderFileModule {
-
        /**
         * Get language-specific LESS variables for this module.
         *
+        * @since 1.26
+        * @param ResourceLoaderContext $context
         * @return array
         */
-       private function getLessVars( ResourceLoaderContext $context ) {
+       protected function getLessVars( ResourceLoaderContext $context ) {
+               $vars = parent::getLessVars( $context );
                $language = Language::factory( $context->getLanguage() );
-
-               // This is very conveniently formatted and we can pass it right through
-               $vars = $language->getImageFiles();
-
-               // less.php tries to be helpful and parse our variables as LESS source code
-               foreach ( $vars as $key => &$value ) {
-                       $value = CSSMin::serializeStringValue( $value );
+               foreach ( $language->getImageFiles() as $key => $value ) {
+                       $vars[ $key ] = CSSMin::serializeStringValue( $value );
                }
-
                return $vars;
        }
-
-       /**
-        * @return bool
-        */
-       public function enableModuleContentVersion() {
-               return true;
-       }
-
-       /**
-        * Get a LESS compiler instance for this module.
-        *
-        * Set our variables in it.
-        *
-        * @throws MWException
-        * @param ResourceLoaderContext $context
-        * @return Less_Parser
-        */
-       protected function getLessCompiler( ResourceLoaderContext $context = null ) {
-               $parser = parent::getLessCompiler();
-               $parser->ModifyVars( $this->getLessVars( $context ) );
-               return $parser;
-       }
 }
index ca10ab7..0df2892 100644 (file)
@@ -854,13 +854,21 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * @param array $styles List of media type/list of file paths pairs, to read, remap and
         * concetenate
         * @param bool $flip
-        * @param ResourceLoaderContext $context (optional)
+        * @param ResourceLoaderContext $context
         *
         * @throws MWException
         * @return array List of concatenated and remapped CSS data from $styles,
         *     keyed by media type
+        *
+        * @since 1.26 Calling this method without a ResourceLoaderContext instance
+        *   is deprecated.
         */
        public function readStyleFiles( array $styles, $flip, $context = null ) {
+               if ( $context === null ) {
+                       wfDeprecated( __METHOD__ . ' without a ResourceLoader context', '1.26' );
+                       $context = ResourceLoaderContext::newDummyContext();
+               }
+
                if ( empty( $styles ) ) {
                        return array();
                }
@@ -882,12 +890,12 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         *
         * @param string $path File path of style file to read
         * @param bool $flip
-        * @param ResourceLoaderContext $context (optional)
+        * @param ResourceLoaderContext $context
         *
         * @return string CSS data in script file
         * @throws MWException If the file doesn't exist
         */
-       protected function readStyleFile( $path, $flip, $context = null ) {
+       protected function readStyleFile( $path, $flip, $context ) {
                $localPath = $this->getLocalPath( $path );
                $remotePath = $this->getRemotePath( $path );
                if ( !file_exists( $localPath ) ) {
@@ -897,8 +905,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                }
 
                if ( $this->getStyleSheetLang( $localPath ) === 'less' ) {
-                       $compiler = $this->getLessCompiler( $context );
-                       $style = $this->compileLessFile( $localPath, $compiler );
+                       $style = $this->compileLessFile( $localPath, $context );
                        $this->hasGeneratedStyles = true;
                } else {
                        $style = file_get_contents( $localPath );
@@ -947,12 +954,13 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
         * Keeps track of all used files and adds them to localFileRefs.
         *
         * @since 1.22
+        * @since 1.26 Added $context paramter.
         * @throws Exception If less.php encounters a parse error
         * @param string $fileName File path of LESS source
-        * @param Less_Parser $parser Compiler to use, if not default
+        * @param ResourceLoaderContext $context Context in which to generate script
         * @return string CSS source
         */
-       protected function compileLessFile( $fileName, $compiler = null ) {
+       protected function compileLessFile( $fileName, ResourceLoaderContext $context ) {
                static $cache;
 
                if ( !$cache ) {
@@ -961,7 +969,9 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
 
                // Construct a cache key from the LESS file name and a hash digest
                // of the LESS variables used for compilation.
-               $varsHash = hash( 'md4', serialize( ResourceLoader::getLessVars( $this->getConfig() ) ) );
+               $vars = $this->getLessVars( $context );
+               ksort( $vars );
+               $varsHash = hash( 'md4', serialize( $vars ) );
                $cacheKey = wfGlobalCacheKey( 'LESS', $fileName, $varsHash );
                $cachedCompile = $cache->get( $cacheKey );
 
@@ -976,10 +986,7 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                        }
                }
 
-               if ( !$compiler ) {
-                       $compiler = $this->getLessCompiler();
-               }
-
+               $compiler = ResourceLoader::getLessCompiler( $this->getConfig(), $vars );
                $css = $compiler->parseFile( $fileName )->getCss();
                $files = $compiler->AllParsedFiles();
                $this->localFileRefs = array_merge( $this->localFileRefs, $files );
@@ -993,20 +1000,6 @@ class ResourceLoaderFileModule extends ResourceLoaderModule {
                return $css;
        }
 
-       /**
-        * Get a LESS compiler instance for this module in given context.
-        *
-        * Just calls ResourceLoader::getLessCompiler() by default to get a global compiler.
-        *
-        * @param ResourceLoaderContext $context
-        * @throws MWException
-        * @since 1.24
-        * @return Less_Parser
-        */
-       protected function getLessCompiler( ResourceLoaderContext $context = null ) {
-               return ResourceLoader::getLessCompiler( $this->getConfig() );
-       }
-
        /**
         * Takes named templates by the module and returns an array mapping.
         * @return array of templates mapping template alias to content
index 80c8220..1551ae3 100644 (file)
@@ -485,6 +485,17 @@ abstract class ResourceLoaderModule {
                $this->msgBlobMtime[$lang] = $mtime;
        }
 
+       /**
+        * Get module-specific LESS variables, if any.
+        *
+        * @since 1.26
+        * @param ResourceLoaderContext $context
+        * @return array Module-specific LESS variables.
+        */
+       protected function getLessVars( ResourceLoaderContext $context ) {
+               return array();
+       }
+
        /**
         * Get an array of this module's resources. Ready for serving to the web.
         *
index ae69934..4d7c03a 100644 (file)
@@ -1019,12 +1019,11 @@ class SkinTemplate extends Skin {
                                         * the global versions.
                                         */
                                        $mode = $user->isWatched( $title ) ? 'unwatch' : 'watch';
-                                       $token = WatchAction::getWatchToken( $title, $user, $mode );
                                        $content_navigation['actions'][$mode] = array(
                                                'class' => $onPage && ( $action == 'watch' || $action == 'unwatch' ) ? 'selected' : false,
                                                // uses 'watch' or 'unwatch' message
                                                'text' => $this->msg( $mode )->text(),
-                                               'href' => $title->getLocalURL( array( 'action' => $mode, 'token' => $token ) )
+                                               'href' => $title->getLocalURL( array( 'action' => $mode ) )
                                        );
                                }
                        }
index 7edf961..145a12a 100644 (file)
@@ -61,6 +61,9 @@ class SpecialMergeHistory extends SpecialPage {
        /** @var Title */
        protected $mDestObj;
 
+       /** @var int[] */
+       public $prevId;
+
        public function __construct() {
                parent::__construct( 'MergeHistory', 'mergehistory' );
        }
@@ -94,18 +97,6 @@ class SpecialMergeHistory extends SpecialPage {
                        $this->mTargetObj = null;
                        $this->mDestObj = null;
                }
-               $this->preCacheMessages();
-       }
-
-       /**
-        * As we use the same small set of messages in various methods and that
-        * they are called often, we call them once and save them in $this->message
-        */
-       function preCacheMessages() {
-               // Precache various messages
-               if ( !isset( $this->message ) ) {
-                       $this->message['last'] = $this->msg( 'last' )->escaped();
-               }
        }
 
        public function execute( $par ) {
@@ -283,7 +274,7 @@ class SpecialMergeHistory extends SpecialPage {
                $rev = new Revision( $row );
 
                $stxt = '';
-               $last = $this->message['last'];
+               $last = $this->msg( 'last' )->escaped();
 
                $ts = wfTimestamp( TS_MW, $row->rev_timestamp );
                $checkBox = Xml::radio( 'mergepoint', $ts, ( $this->mTimestamp === $ts ) );
@@ -302,11 +293,11 @@ class SpecialMergeHistory extends SpecialPage {
 
                # Last link
                if ( !$rev->userCan( Revision::DELETED_TEXT, $user ) ) {
-                       $last = $this->message['last'];
+                       $last = $this->msg( 'last' )->escaped();
                } elseif ( isset( $this->prevId[$row->rev_id] ) ) {
                        $last = Linker::linkKnown(
                                $rev->getTitle(),
-                               $this->message['last'],
+                               $this->msg( 'last' )->escaped(),
                                array(),
                                array(
                                        'diff' => $row->rev_id,
@@ -501,13 +492,13 @@ class SpecialMergeHistory extends SpecialPage {
 }
 
 class MergeHistoryPager extends ReverseChronologicalPager {
-       /** @var IContextSource */
+       /** @var SpecialMergeHistory */
        public $mForm;
 
        /** @var array */
        public $mConds;
 
-       function __construct( $form, $conds, $source, $dest ) {
+       function __construct( SpecialMergeHistory $form, $conds, Title $source, Title $dest ) {
                $this->mForm = $form;
                $this->mConds = $conds;
                $this->title = $source;
index d741b60..91e84e4 100644 (file)
@@ -115,6 +115,7 @@ class SpecialSearch extends SpecialPage {
                        return;
                }
 
+               $out->addJsConfigVars( array( 'searchTerm' => $search ) );
                $this->searchEngineType = $request->getVal( 'srbackend' );
 
                if ( $request->getVal( 'fulltext' )
@@ -437,7 +438,7 @@ class SpecialSearch extends SpecialPage {
                        $stParams
                );
 
-               # html of did you mean... search suggestion link
+               # HTML of did you mean... search suggestion link
                return Html::rawElement(
                        'div',
                        array( 'class' => 'searchdidyoumean' ),
@@ -645,8 +646,9 @@ class SpecialSearch extends SpecialPage {
 
                $out = "<ul class='mw-search-results'>\n";
                $result = $matches->next();
+               $pos = $this->offset;
                while ( $result ) {
-                       $out .= $this->showHit( $result, $terms );
+                       $out .= $this->showHit( $result, $terms, ++$pos );
                        $result = $matches->next();
                }
                $out .= "</ul>\n";
@@ -662,10 +664,11 @@ class SpecialSearch extends SpecialPage {
         *
         * @param SearchResult $result
         * @param array $terms Terms to highlight
+        * @param int $position Position within the search results, including offset.
         *
         * @return string
         */
-       protected function showHit( $result, $terms ) {
+       protected function showHit( $result, $terms, $position ) {
 
                if ( $result->isBrokenTitle() ) {
                        return '';
@@ -686,7 +689,8 @@ class SpecialSearch extends SpecialPage {
 
                $link = Linker::linkKnown(
                        $link_t,
-                       $titleSnippet
+                       $titleSnippet,
+                       array( 'data-serp-pos' => $position ) // HTML attributes
                );
 
                // If page content is not readable, just return the title.
index b3ca006..4ad6ac0 100644 (file)
@@ -96,12 +96,11 @@ class UnwatchedpagesPage extends QueryPage {
                $text = $wgContLang->convert( $nt->getPrefixedText() );
 
                $plink = Linker::linkKnown( $nt, htmlspecialchars( $text ) );
-               $token = WatchAction::getWatchToken( $nt, $this->getUser() );
                $wlink = Linker::linkKnown(
                        $nt,
                        $this->msg( 'watch' )->escaped(),
                        array( 'class' => 'mw-watch-link' ),
-                       array( 'action' => 'watch', 'token' => $token )
+                       array( 'action' => 'watch' )
                );
 
                return $this->getLanguage()->specialList( $plink, $wlink );
index 5dd4977..aac76c5 100644 (file)
                "maintenance/jsduck/external.js",
                "resources/src/mediawiki",
                "resources/src/mediawiki.action",
-               "resources/src/mediawiki.api",
                "resources/src/mediawiki.language",
                "resources/src/mediawiki.messagePoster",
-               "resources/src/mediawiki.page",
                "resources/src/mediawiki.special",
                "resources/src/mediawiki.toolbar",
                "resources/src/mediawiki.widgets",
index 41d282b..78b3572 100644 (file)
@@ -539,27 +539,45 @@ class LanguageConverter {
         * @return string Namespace name for display
         */
        public function convertNamespace( $index, $variant = null ) {
+               if ( $index === NS_MAIN ) {
+                       return '';
+               }
+
                if ( $variant === null ) {
                        $variant = $this->getPreferredVariant();
                }
-               if ( $index === NS_MAIN ) {
-                       return '';
-               } else {
-                       // First check if a message gives a converted name in the target variant.
-                       $nsConvMsg = wfMessage( 'conversion-ns' . $index )->inLanguage( $variant );
-                       if ( $nsConvMsg->exists() ) {
-                               return $nsConvMsg->plain();
-                       }
-                       // Then check if a message gives a converted name in content language
-                       // which needs extra translation to the target variant.
+
+               $cache = ObjectCache::newAccelerator( CACHE_NONE );
+               $key = wfMemcKey( 'languageconverter', 'namespace-text', $index, $variant );
+               $nsVariantText = $cache->get( $key );
+               if ( $nsVariantText !== false ) {
+                       return $nsVariantText;
+               }
+
+               // First check if a message gives a converted name in the target variant.
+               $nsConvMsg = wfMessage( 'conversion-ns' . $index )->inLanguage( $variant );
+               if ( $nsConvMsg->exists() ) {
+                       $nsVariantText = $nsConvMsg->plain();
+               }
+
+               // Then check if a message gives a converted name in content language
+               // which needs extra translation to the target variant.
+               if ( $nsVariantText === false ) {
                        $nsConvMsg = wfMessage( 'conversion-ns' . $index )->inContentLanguage();
                        if ( $nsConvMsg->exists() ) {
-                               return $this->translate( $nsConvMsg->plain(), $variant );
+                               $nsVariantText = $this->translate( $nsConvMsg->plain(), $variant );
                        }
+               }
+
+               if ( $nsVariantText === false ) {
                        // No message exists, retrieve it from the target variant's namespace names.
                        $langObj = $this->mLangObj->factory( $variant );
-                       return $langObj->getFormattedNsText( $index );
+                       $nsVariantText = $langObj->getFormattedNsText( $index );
                }
+
+               $cache->set( $key, $nsVariantText, 60 );
+
+               return $nsVariantText;
        }
 
        /**
index 3b8eee3..57cf274 100644 (file)
@@ -7,7 +7,8 @@
                        "Mdupont",
                        "아라",
                        "Ammartivari",
-                       "Olsi"
+                       "Olsi",
+                       "Kosovastar"
                ]
        },
        "tog-underline": "Nënvizoji vegzat",
        "nohistory": "Nuk ka histori redaktimesh për këtë faqe.",
        "currentrev": "Versioni i tanishëm",
        "currentrev-asof": "Redaktimi aktual i datës $1",
-       "revisionasof": "Versioni i $1",
+       "revisionasof": "Versioni i datës $1",
        "revision-info": "Versioni me $1 nga $2",
        "previousrevision": "← Verzion ma i vjetër",
        "nextrevision": "Redaktimi mâ i ri →",
index d72c0da..a30e9b1 100644 (file)
        "deletepage": "Выдаліць старонку",
        "confirm": "Пацьвердзіць",
        "excontent": "колішні зьмест: «$1»",
-       "excontentauthor": "зьмест быў: «$1» (і адзіным аўтарам быў '[[Special:Contributions/$2|$2]]')",
+       "excontentauthor": "зьмест быў: «$1», адзіным аўтарам быў «[[Special:Contributions/$2|$2]]» ([[User talk:$2|гутаркі]])",
        "exbeforeblank": "зьмест да ачысткі: «$1»",
        "delete-confirm": "Выдаліць «$1»",
        "delete-legend": "Выдаліць",
index 0e03756..5acb6a4 100644 (file)
        "deletepage": "Seite löschen",
        "confirm": "Bestätigen",
        "excontent": "Inhalt war: „$1“",
-       "excontentauthor": "Inhalt war: „$1“ (einziger Bearbeiter: [[Special:Contributions/$2|$2]])",
+       "excontentauthor": "Inhalt war: „$1“. Einziger Bearbeiter: [[Special:Contributions/$2|$2]] ([[User talk:$2|Diskussion]])",
        "exbeforeblank": "Inhalt vor dem Leeren der Seite: „$1“",
        "delete-confirm": "Löschen von „$1“",
        "delete-legend": "Löschen",
index 829e363..76c46c3 100644 (file)
@@ -42,7 +42,8 @@
                        "Milicevic01",
                        "Ah3kal",
                        "Macofe",
-                       "Stam.nikos"
+                       "Stam.nikos",
+                       "Giorgos456"
                ]
        },
        "tog-underline": "Υπογράμμιση συνδέσμων:",
        "nstab-template": "Πρότυπο",
        "nstab-help": "Σελίδα βοήθειας",
        "nstab-category": "Κατηγορία",
+       "mainpage-nstab": "Αρχική σελίδα",
        "nosuchaction": "Δεν υπάρχει τέτοια ενέργεια.",
        "nosuchactiontext": "Η ενέργεια που καθορίστηκε από την διεύθυνση URL δεν είναι έγκυρη.\nΕνδέχεται να πληκτρολογήσατε λανθασμένα την διεύθυνση URL ή να ακολουθήσατε έναν μη έγκυρο σύνδεσμο.\nΜπορεί επίσης να είναι σημάδι κάποιου σφάλματος του λογισμικού που χρησιμοποιεί ο ιστότοπος {{SITENAME}}.",
        "nosuchspecialpage": "Δεν υπάρχει τέτοια ειδική σελίδα",
index 0b17c78..dc06b10 100644 (file)
        "passwordreset-emailerror-capture": "A password reset email was generated, which is shown below, but sending it to the {{GENDER:$2|user}} failed: $1",
        "changeemail": "Change email address",
        "changeemail-summary": "",
-       "changeemail-text": "Complete this form to change your email address. You will need to enter your password to confirm this change.",
+       "changeemail-text": "Complete this form to change your email address. You will need to enter your password to confirm this change. If you would like to remove the association of any email address from your account, leave the email address blank when submitting the form.",
        "changeemail-no-info": "You must be logged in to access this page directly.",
        "changeemail-oldemail": "Current email address:",
        "changeemail-newemail": "New email address:",
index a8d8e14..283af64 100644 (file)
        "deletepage": "Borrar esta página",
        "confirm": "Confirmar",
        "excontent": "el contenido era: «$1»",
-       "excontentauthor": "el contenido era: «$1» (y el único autor fue «[[Special:Contributions/$2|$2]]»)",
+       "excontentauthor": "el contenido era: «$1», y el único autor fue «[[Special:Contributions/$2|$2]]» ([[User talk:$2|discusión]])",
        "exbeforeblank": "El contenido antes de blanquear era: «$1»",
        "delete-confirm": "Borrar «$1»",
        "delete-legend": "Borrar",
index df7dc42..2bd637b 100644 (file)
        "deletepage": "Kustuta lehekülg",
        "confirm": "Kinnita",
        "excontent": "sisu oli: '$1'",
-       "excontentauthor": "sisu oli: '$1' (ja ainuke kirjutaja oli '[[Special:Contributions/$2|$2]]')",
+       "excontentauthor": "sisu oli: \"$1\"; ainuke kirjutaja oli \"[[Special:Contributions/$2|$2]]\" ([[User talk:$2|arutelu]])",
        "exbeforeblank": "sisu enne lehekülje tühjendamist: '$1'",
        "delete-confirm": "Lehekülje \"$1\" kustutamine",
        "delete-legend": "Kustutamine",
index 3529566..4bb6b81 100644 (file)
        "protectedpage": "Página protegia",
        "jumpto": "Sartal a:",
        "jumptonavigation": "Güiquipeandu",
-       "jumptosearch": "Landeal",
+       "jumptosearch": "landeal",
        "aboutsite": "Al tentu {{SITENAME}}",
        "aboutpage": "Project:Enjolmación",
        "copyright": "Continiu disponibri bahu $1.",
        "nstab-template": "Prantilla",
        "nstab-help": "Páhina d'ayua",
        "nstab-category": "Categoria",
+       "mainpage-nstab": "Página prencipal",
        "nosuchaction": "Nu desisti tal ación",
        "nosuchactiontext": "La URL nu es vália.\nEs possibri que aigas marrau escribiendu la direción, u aigas siguiu un atiju encorretu.\nTamién es possibri que se trati dun marru entelnu de {{SITENAME}}.\nespecificá ena URL",
        "nosuchspecialpage": "Nu desisti tal páhina especial",
        "group-sysop": "Çahorilis",
        "group-bureaucrat": "Alministraoris",
        "group-all": "(tó)",
-       "group-user-member": "{{GENDER:$1|Usuáriu}}",
-       "group-autoconfirmed-member": "Usuáriu autuconfirmau",
+       "group-user-member": "{{GENDER:$1|usuáriu|usuária}}",
+       "group-autoconfirmed-member": "{{GENDER:$1|usuáriu autuconfirmau|usuária autoconfirmada}}",
        "group-bot-member": "Bot",
        "group-sysop-member": "Çahoril",
        "group-bureaucrat-member": "Alministraol",
        "namespace": "Espáciu de nombris:",
        "invert": "Invertil seleción",
        "blanknamespace": "(Prencipal)",
-       "contributions": "Endirguis el usuáriu",
+       "contributions": "Endirguis {{GENDER:$1|el usuáriu|la usuária}}",
        "contributions-title": "Contribucionis del usuáriu a $1",
        "mycontris": "Los mis endirguis",
        "contribsub2": "Pa $1 ($2)",
        "iranian-calendar-m10": "10 mes Jalāli",
        "iranian-calendar-m11": "11 mes Jalāli",
        "iranian-calendar-m12": "12 mes Jalāli",
+       "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|caraba]])",
        "version": "Velsión",
        "version-extensions": "Estensionis istalás",
        "version-specialpages": "Páhinas especialis",
index f242172..3ffffd6 100644 (file)
        "createacct-captcha": "Turvatarkastus",
        "createacct-imgcaptcha-ph": "Kirjoita teksti, jonka näet edellä",
        "createacct-submit": "Luo tunnus",
-       "createacct-another-submit": "Luo toinen käyttäjätunnus",
+       "createacct-another-submit": "Luo käyttäjätunnus",
        "createacct-benefit-heading": "{{SITENAME}} on sinun kaltaistesi ihmisten tekemä.",
        "createacct-benefit-body1": "{{PLURAL:$1|muokkaus|muokkausta}}",
        "createacct-benefit-body2": "{{PLURAL:$1|sivu|sivua}}",
        "emailccsubject": "Kopio lähettämästäsi viestistä osoitteeseen $1: $2",
        "emailsent": "Sähköposti lähetetty",
        "emailsenttext": "Sähköpostiviestisi on lähetetty.",
-       "emailuserfooter": "Tämän sähköpostin lähetti $1 vastaanottajalle $2 käyttämällä ”{{int:emailuser}}” -toimintoa {{GRAMMAR:inessive|{{SITENAME}}}}.",
+       "emailuserfooter": "Tämän sähköpostin {{GENDER:$1|lähetti}} $1 vastaanottajalle {{GENDER:$2|$2}} käyttämällä ”{{int:emailuser}}” -toimintoa {{GRAMMAR:inessive|{{SITENAME}}}}.",
        "usermessage-summary": "Jätetään järjestelmäviesti.",
        "usermessage-editor": "Järjestelmäviestittäjä",
        "watchlist": "Tarkkailulista",
        "deletepage": "Poista sivu",
        "confirm": "Toteuta",
        "excontent": "sisälsi: ”$1”",
-       "excontentauthor": "sisälsi: ”$1” (ainoa muokkaaja oli $2)",
+       "excontentauthor": "sisältö oli: \"$1\", ja ainoa muokkaaja oli \"[[Special:Contributions/$2|$2]]\" ([[User talk:$2|keskustelu]])",
        "exbeforeblank": "ennen tyhjentämistä sisälsi: ”$1”",
        "delete-confirm": "Poista ”$1”",
        "delete-legend": "Sivun poisto",
        "logentry-newusers-byemail": "$1 {{GENDER:$2|loi}} käyttäjätunnuksen $3 ja salasana lähetettiin sähköpostitse",
        "logentry-newusers-autocreate": "Käyttäjätunnus $1 {{GENDER:$2|luotiin}} automaattisesti",
        "logentry-protect-move_prot": "$1 {{GENDER:$2|siirsi}} suojauksen asetukset sivulta $4 sivulle $3",
+       "logentry-protect-unprotect": "$1 {{GENDER:$2|otti pois}} suojauksen kohteesta $3",
+       "logentry-protect-protect": "$1 {{GENDER:$2|suojasi}} kohteen $3 $4",
+       "logentry-protect-protect-cascade": "$1 {{GENDER:$2|suojasi}} kohteen $3 $4 [tarttuvasti]",
+       "logentry-protect-modify": "$1 {{GENDER:$2|muutti}} suojauksen tasoa kohteessa $3 $4",
+       "logentry-protect-modify-cascade": "$1 {{GENDER:$2|muutti}} suojauksen tasoa kohteessa $3 $4 [tarttuvasti]",
        "logentry-rights-rights": "$1 {{GENDER:$2|muutti}} käyttäjän $3 oikeudet ryhmistä $4 ryhmiin $5",
        "logentry-rights-rights-legacy": "$1 {{GENDER:$2|muutti}} käyttäjän $3 jäsenyyttä ryhmässä",
        "logentry-rights-autopromote": "Käyttäjän $1 oikeudet {{GENDER:$2|muuttuivat}} automaattisesti ryhmistä $4 ryhmiin $5",
index 4e6326d..5a9ebd3 100644 (file)
        "deletepage": "Supprimer la page",
        "confirm": "Confirmer",
        "excontent": "contenait « $1 »",
-       "excontentauthor": "contenait « $1 » (et son seul contributeur était [[Special:Contributions/$2|$2]])",
+       "excontentauthor": "contenait « $1 » et son seul contributeur était [[Special:Contributions/$2|$2]] ([[User talk:$2|discussion]])",
        "exbeforeblank": "contenait avant blanchiment « $1 »",
        "delete-confirm": "Supprimer « $1 »",
        "delete-legend": "Supprimer",
index 93f656d..ac6e0f2 100644 (file)
        "deletepage": "מחיקה",
        "confirm": "אישור",
        "excontent": "התוכן היה: \"$1\"",
-       "excontentauthor": "התוכן היה: \"$1\" ({{GENDER:$2|והתורם היחיד היה|והתורמת היחידה הייתה}} \"[[Special:Contributions/$2|$2]]\")",
+       "excontentauthor": "התוכן היה: \"$1\", {{GENDER:$2|והתורם היחיד היה|והתורמת היחידה הייתה}} \"[[Special:Contributions/$2|$2]]\" ([[User talk:$2|שיחה]])",
        "exbeforeblank": "התוכן לפני שרוקן היה: \"$1\"",
        "delete-confirm": "מחיקת \"$1\"",
        "delete-legend": "מחיקה",
index be41378..3eb3d2e 100644 (file)
        "deletepage": "Cancella pagina",
        "confirm": "Conferma",
        "excontent": "il contenuto era: '$1'",
-       "excontentauthor": "il contenuto era: '$1' (e l'unico contributore era '[[Special:Contributions/$2|$2]]')",
+       "excontentauthor": "il contenuto era: '$1', e l'unico contributore era \"[[Special:Contributions/$2|$2]]\" ([[User talk:$2|msg]])",
        "exbeforeblank": "Il contenuto prima dello svuotamento era: '$1'",
        "delete-confirm": "Cancella \"$1\"",
        "delete-legend": "Cancella",
        "logentry-newusers-byemail": "L'utenza $3 è stata {{GENDER:$2|creata}} da $1 e la password è stata inviata via email",
        "logentry-newusers-autocreate": "L'utenza $1 è stata {{GENDER:$2|creata}} automaticamente",
        "logentry-protect-move_prot": "$1 {{GENDER:$2|ha spostato}} le impostazioni di protezione da $4 a $3",
+       "logentry-protect-unprotect": "$1 {{GENDER:$2|ha rimosso}} la protezione da $3",
+       "logentry-protect-protect": "$1 {{GENDER:$2|ha protetto}} $3 $4",
+       "logentry-protect-protect-cascade": "$1 {{GENDER:$2|ha protetto}} $3 $4 [ricorsiva]",
+       "logentry-protect-modify": "$1 {{GENDER:$2|ha modificato}} il livello di protezione per $3 $4",
+       "logentry-protect-modify-cascade": "$1 {{GENDER:$2|ha modificato}} il livello di protezione per $3 $4 [ricorsiva]",
        "logentry-rights-rights": "$1 {{GENDER:$2|ha modificato}} l'appartenenza di $3 dal gruppo $4 al gruppo $5",
        "logentry-rights-rights-legacy": "$1 {{GENDER:$2|ha modificato}} l'appartenenza a gruppi di $3",
        "logentry-rights-autopromote": "$1 è {{GENDER:$2|stato promosso|stata promossa|stato/a promosso/a}} automaticamente da $4 a $5",
index 841a37f..e37ea90 100644 (file)
        "grouppage-bot": "{{ns:project}}:ボット",
        "grouppage-sysop": "{{ns:project}}:管理者",
        "grouppage-bureaucrat": "{{ns:project}}:ビューロクラット",
-       "grouppage-suppress": "{{ns:project}}:秘匿",
+       "grouppage-suppress": "{{ns:project}}:秘匿",
        "right-read": "ページを閲覧",
        "right-edit": "ページを編集",
        "right-createpage": "ページ (議論ページ以外) を作成",
        "deletepage": "ページを削除",
        "confirm": "確認",
        "excontent": "内容:「$1」",
-       "excontentauthor": "内容:「$1」(投稿者は「[[Special:Contributions/$2|$2]]」のみ)",
+       "excontentauthor": "内容:「$1」、投稿者は「[[Special:Contributions/$2|$2]]」のみ ([[User talk:$2|talk]])",
        "exbeforeblank": "白紙化前の内容:「$1」",
        "delete-confirm": "「$1」の削除",
        "delete-legend": "削除",
index a595f86..68d2c87 100644 (file)
        "logentry-suppress-revision": "$1 $3 бетіндегі {{PLURAL:$5|нұсқаның|$5 нұсқаның}} көрінулігін құпия түрде {{GENDER:$2|өзгертті}}",
        "logentry-suppress-event-legacy": "$1 $3 бетіндегі журнал оқиғаларының көрінулігін құпия түрде {{GENDER:$2|өзгертті}}",
        "logentry-suppress-revision-legacy": "$1 $3 бетіндегі нұсқалардың көрінулігін құпия түрде {{GENDER:$2|өзгертті}}",
-       "revdelete-content-hid": "мағлұматын жасырыды",
+       "revdelete-content-hid": "мағлұматын жасырды",
        "revdelete-summary-hid": "өңдеу түйіндемесін жасырды",
        "revdelete-uname-hid": "қатысушы есімін жасырды",
        "revdelete-content-unhid": "мағлұматы жасырылмаған",
index e070a9f..a68415a 100644 (file)
        "sessionfailure-title": "세션 실패",
        "sessionfailure": "로그인 세션에 문제가 발생한 것 같습니다.\n세션 하이재킹을 막기 위해 동작이 취소되었습니다.\n브라우저의 뒤로 버튼을 누르고 문서를 새로 고침한 후에 다시 시도해 주세요.",
        "changecontentmodel-title-label": "문서 제목",
+       "changecontentmodel-model-label": "새 콘텐츠 모델",
        "changecontentmodel-reason-label": "이유:",
+       "changecontentmodel-success-title": "콘텐츠 모델이 변경되었습니다",
+       "changecontentmodel-success-text": "[[:$1]]의 콘텐츠 종류가 변경되었습니다.",
+       "changecontentmodel-cannot-convert": "[[:$1]]의 콘텐츠 모델이 $2의 모델로 전환될 수 없습니다.",
+       "changecontentmodel-nodirectediting": "$1 콘텐츠 모델은 직접 편집을 지원하지 않습니다",
+       "log-name-contentmodel": "콘텐츠 모델 변경 기록",
+       "log-description-contentmodel": "페이지의 콘텐츠 모델과 관련된 행위",
+       "logentry-contentmodel-change": "$1 사용자가 $3 의 콘텐츠 모델을 \"$4\"에서 \"$5\"로 {{GENDER:$2|변경하였습니다}}.",
        "logentry-contentmodel-change-revertlink": "되돌리기",
        "logentry-contentmodel-change-revert": "되돌리기",
        "protectlogpage": "문서 보호 기록",
        "import-interwiki-history": "이 문서의 모든 역사를 가져오기",
        "import-interwiki-templates": "모든 틀을 포함하기",
        "import-interwiki-submit": "가져오기",
+       "import-mapping-default": "기본 위치로 들여오기",
+       "import-mapping-namespace": "이름공간으로 들여오기:",
+       "import-mapping-subpage": "이 문서의 하위문서로 들여오기:",
        "import-upload-filename": "파일 이름:",
        "import-comment": "요약:",
        "importtext": "원본 위키에서 [[Special:Export|내보내기]] 기능을 사용해 파일을 내려받으세요.\n그리고 당신의 컴퓨터에 저장해 둔 후 여기에 올려주세요.",
index c876e7b..4152c6a 100644 (file)
        "logentry-newusers-byemail": "Vartotojo paskyra $3 buvo {{GENDER:$2|sukurta}} $1 ir slaptažodis išsiųstas el. paštu",
        "logentry-newusers-autocreate": "Vartotojo paskyra $1 buvo {{GENDER:$2|sukurta}} automatiškai",
        "logentry-protect-move_prot": "$1 {{GENDER:$2|perkėlė}} apsaugos nustatymus iš $4 į $3",
+       "logentry-protect-unprotect": "$1 {{GENDER:$2|pašalino}} apsaugą nuo $3",
+       "logentry-protect-protect": "$1 {{GENDER:$2|apsaugojo}} $3 $4",
+       "logentry-protect-protect-cascade": "$1 {{GENDER:$2|apsaugojo}} $3 $4 [pakopinė]",
+       "logentry-protect-modify": "$1 {{GENDER:$2|pakeitė}} apsaugos lygį $3 $4",
+       "logentry-protect-modify-cascade": "$1 {{GENDER:$2|pakeitė}} apsaugos lygį $3 $4 [pakopinė]",
        "logentry-rights-rights": "$1 {{GENDER:$2|pakeitė}} grupės narystę $3 iš $4 į $5",
        "logentry-rights-rights-legacy": "$1 {{GENDER:$2|pakeista}} narystė grupėje $3",
        "logentry-rights-autopromote": "$1 buvo automatiškai {{GENDER:$2|pervestas}} iš $4 į $5",
index 3044422..5bf37b9 100644 (file)
        "personaltools": "Narzędzia osobiste",
        "articlepage": "Pokaż zawartość strony",
        "talk": "Dyskusja",
-       "views": "Wyświetleń",
+       "views": "Widok",
        "toolbox": "Narzędzia",
        "userpage": "Pokaż stronę użytkownika",
        "projectpage": "Pokaż stronę projektu",
index c6dced9..27e4889 100644 (file)
        "welcomecreation-msg": "گڼون مو جوړ شو.\nد [[Special:Preferences|{{SITENAME}} غوره توبونه]] بدلول مو مه هېروۍ.",
        "yourname": "کارن-نوم:",
        "userlogin-yourname": "کارن-نوم",
-       "userlogin-yourname-ph": "کارن-نوم مو وليکۍ",
+       "userlogin-yourname-ph": "کارن-نوم مو وليکئ",
        "createacct-another-username-ph": "كارن نوم مو وركړۍ",
        "yourpassword": "پټنوم:",
        "userlogin-yourpassword": "پټنوم",
-       "userlogin-yourpassword-ph": "پټنوم مو وليکۍ",
+       "userlogin-yourpassword-ph": "پټنوم مو وليکئ",
        "createacct-yourpassword-ph": "پټنوم مو وټاپئ",
        "yourpasswordagain": "پټنوم بيا وليکه",
        "createacct-yourpasswordagain": "پټنوم مو تاييد کړۍ",
        "nosuchusershort": "د \"$1\" په نوم هېڅ کوم گڼون نشته. لطفاً خپل د نوم ليکلې بڼې ته ځير شی چې پکې تېروتنه نه وي.",
        "nouserspecified": "تاسې ځان ته کوم کارن نوم نه دی ځانگړی کړی.",
        "login-userblocked": "په دې کارن بنديز لگېدلی. غونډال کې ننوتلو ته پرې نه ښودلی شو.",
-       "wrongpassword": "ناسم پټنوم مو ليکلی. لطفاً يو ځل بيا يې وليکۍ.",
+       "wrongpassword": "ناسم پټنوم مو ليکلی. لطفاً يو ځل بيا يې وليکئ.",
        "wrongpasswordempty": "تاسې پټنوم نه دی ليکلی. لطفاً سر له نوي يې وليکۍ.",
        "passwordtooshort": "بايد چې پټنوم مو لږ تر لږه {{PLURAL:$1|1 توری|$1 توري}} وي.",
        "passwordtoolong": "پټنوم مو بايد له {{PLURAL:$1|1 توري|$1 تورو}} څخه اوږد نه وي.",
        "expiringblock": "په $1 نېټه، $2 بجو پای ته رسېږي",
        "anononlyblock": "يواځې ورکنومی",
        "createaccountblock": "په گڼون جوړولو بنديز لگېدلی",
-       "emailblock": "پر Ø¨Ø±Û\90Ú\9aÙ\84Ù\8aÚ© Ø¨Ù\86دÙ\8aز Ù\88Ù\84Ú«ېد",
+       "emailblock": "پر Ø¨Ø±Û\90Ú\9aÙ\84Ù\8aÚ© Ø¨Ù\86دÙ\8aز Ù\88Ù\84Ú¯ېد",
        "blocklist-nousertalk": "د خبرواترو خپل مخ نه شی سمولای",
        "ipblocklist-empty": "د بنديز لړليک تش دی",
        "blocklink": "بنديز لگول",
index add462d..bfc64eb 100644 (file)
        "deletepage": "Eliminar página",
        "confirm": "Confirmar",
        "excontent": "o conteúdo era: \"$1\"",
-       "excontentauthor": "o conteúdo era: \"$1\" (e o único editor era [[Special:Contributions/$2|$2]]\")",
+       "excontentauthor": "o conteúdo era: \"$1\", e o único editor foi \"[[Special:Contributions/$2|$2]]\" ([[User talk:$2|talk]])",
        "exbeforeblank": "o conteúdo antes de esvaziar era: \"$1\"",
        "delete-confirm": "Eliminar \"$1\"",
        "delete-legend": "Eliminar",
index 848e709..5657549 100644 (file)
        "deletepage": "Used as Submit button text.\n{{Identical|Delete page}}",
        "confirm": "Submit button text for protection confirmation\n\n{{Identical|Confirm}}",
        "excontent": "Automated deletion reason when deleting a page for admins. Parameters:\n* $1 - content before deletion",
-       "excontentauthor": "Automated deletion reason when deleting a page for admins providing that the page has one author only.\n\nParameters:\n* $1 - content before deletion\n* $2 - username",
+       "excontentauthor": "Automated deletion reason when deleting a page for admins providing that the page has one author only.\n\nParameters:\n* $1 - content before deletion\n* $2 - username\n\nThe label of the link to the talk page should be consistent with {{msg-mw|Talkpagelinktext}}.",
        "exbeforeblank": "Automated deletion reason when deleting a page for admins providing that the page was blanked before deletion.\n\nParameters:\n* $1 - content before blanking",
        "delete-confirm": "Used as page title. Parameters:\n* $1 - the page title\n{{Identical|Delete}}",
        "delete-legend": "{{Identical|Delete}}",
index a3e80ff..5892565 100644 (file)
        "deletepage": "Șterge pagina",
        "confirm": "Confirmă",
        "excontent": "conținutul era: '$1'",
-       "excontentauthor": "conținutul era: „$1” (unicul contribuitor: [[Special:Contributions/$2|$2]])",
+       "excontentauthor": "conținutul era: „$1”, iar unicul contribuitor a fost „[[Special:Contributions/$2|$2]]” ([[User talk:$2|discuție]])",
        "exbeforeblank": "conținutul înainte de golire era: '$1'",
        "delete-confirm": "Şterge \"$1\"",
        "delete-legend": "Şterge",
index 21e37ba..dc73d20 100644 (file)
        "nstab-template": "Template",
        "nstab-help": "Pàgene d'ajute",
        "nstab-category": "Categorije",
+       "mainpage-nstab": "Pàgena Prengepàle",
        "nosuchaction": "Non ge stonne otre azione",
        "nosuchactiontext": "L'aziona specifichete da l'URL non g'è canusciute da Uicchi.\nTu puè avè scritte male 'a URL, o quidde ca è scritte jè 'nu collegamende sbagliete.\nPò essere pure ca quiste jè 'nu bochere jndr'à 'u software de {{SITENAME}}.",
        "nosuchspecialpage": "Non ge stonne pàggene speciele",
        "createacct-captcha": "Verifiche de securezze",
        "createacct-imgcaptcha-ph": "Mitte 'u teste tune aqquà sus",
        "createacct-submit": "Ccreje 'u cunde utende tune",
-       "createacct-another-submit": "Ccreje 'n'otre cunde",
+       "createacct-another-submit": "Ccreje 'nu cunde utende",
        "createacct-benefit-heading": "{{SITENAME}} jè fatte da crestiane cumme a te.",
        "createacct-benefit-body1": "{{PLURAL:$1|cangiamende|cangiaminde}}",
        "createacct-benefit-body2": "{{PLURAL:$1|pàgene|pàggene}}",
        "createacct-benefit-body3": "{{PLURAL:$1|condrebbutore}} recende",
        "badretype": "Le passuord ca è scritte non ge sonde uguale.",
+       "usernameinprogress": "'Na ccrejazzione de 'nu cunde pe stu nome utende ste già in esecuzione.\nPe piacere, aspitte.",
        "userexists": "'U nome de l'utende ca è scritte jè già ausate.\nPe piacere scacchiane n'otre.",
        "loginerror": "Errore de collegamende",
        "createacct-error": "Errore sus 'a ccrejazione d'u cunde",
        "group-bot": "Bot",
        "group-sysop": "Sysop",
        "group-bureaucrat": "Burocrate",
-       "group-suppress": "Supervisionature",
+       "group-suppress": "Suppressore",
        "group-all": "(tutte)",
        "group-user-member": "{{GENDER:$1|utende}}",
        "group-autoconfirmed-member": "{{GENDER:$1|utende autoconfermate}}",
        "group-bot-member": "{{GENDER:$1|bot}}",
        "group-sysop-member": "{{GENDER:$1|amministratore}}",
        "group-bureaucrat-member": "{{GENDER:$1|burocrate}}",
-       "group-suppress-member": "{{GENDER:$1|supervisionatore}}",
+       "group-suppress-member": "{{GENDER:$1|soppressore}}",
        "grouppage-user": "{{ns:project}}:Utinde",
        "grouppage-autoconfirmed": "{{ns:project}}:Utinde Autoconfermete",
        "grouppage-bot": "{{ns:project}}:Bot",
        "grouppage-sysop": "{{ns:project}}:Amministratore",
        "grouppage-bureaucrat": "{{ns:project}}:Burocrate",
-       "grouppage-suppress": "{{ns:project}}:Supervisionatore",
+       "grouppage-suppress": "{{ns:project}}:Soppresse",
        "right-read": "Ligge le pàggene",
        "right-edit": "Cange le pàggene",
        "right-createpage": "Ccreje le pàggene (ca non ge tènene le pàggene de le 'ngazzaminde)",
        "filerevert-legend": "'Nvirte 'u file",
        "filerevert-intro": "Tu ste converte 'u file '''[[Media:$1|$1]]''' jndr'à [$4 versione cumme $3, $2].",
        "filerevert-comment": "Mutive:",
-       "filerevert-defaultcomment": "Convertite a 'a versione a le $2 d'u $1",
+       "filerevert-defaultcomment": "Repristinate a 'a versione a le $2 d'u $1 ($3)",
        "filerevert-submit": "'Nvirte",
        "filerevert-success": "'''[[Media:$1|$1]]''' ha state convertite a 'a versiona [$4 de le $3 d'u $2].",
        "filerevert-badversion": "Non ge stè 'na versiona locale precedende de stu file cu l'orarie richieste.",
        "nopagetext": "'A pàgene de destinazione ca tu è specificate non g'esiste.",
        "pager-newer-n": "{{PLURAL:$1|cchiù nueve 1|cchiù nueve $1}}",
        "pager-older-n": "{{PLURAL:$1|cchiù vecchie 1|cchiù vicchie $1}}",
-       "suppress": "Supervisione",
+       "suppress": "Sopprime",
        "querypage-disabled": "Sta pàgena speciale jè desabbilitate pe mutive de prestaziune.",
        "apihelp": "Aijute de l'API",
        "apihelp-no-such-module": "Module \"$1\" none acchiate.",
        "emailccsubject": "Copie de le messàgge tue a $1: $2",
        "emailsent": "E-mail mannete",
        "emailsenttext": "'U messagge email tue ha state mannete.",
-       "emailuserfooter": "Sta e-mail ha state mannate da $1 a $2 da 'a funziona \"{{int:emailuser}}\" de {{SITENAME}}.",
+       "emailuserfooter": "Sta e-mail ha state {{GENDER:$1|mannate}} da $1 a {{GENDER:$2|$2}} da 'a funziona \"{{int:emailuser}}\" de {{SITENAME}}.",
        "usermessage-summary": "Lassanne 'nu messagge de sisteme.",
        "usermessage-editor": "Messaggiatore de sisteme",
        "usermessage-template": "MediaWiki:UserMessage",
        "api-error-badaccess-groups": "Tu non ge puè carecà file sus a sta Uicchi.",
        "api-error-badtoken": "Errore inderne: Gettone errate.",
        "api-error-copyuploaddisabled": "'U carecamende da URL jè disabbilitate sus a stu server.",
-       "api-error-duplicate": "{{PLURAL:$1|Stè [$2 'n'otre file]|Stonne [$2 otre file]}} sus a 'u site cu 'u stesse condenute.",
+       "api-error-duplicate": "{{PLURAL:$1|Stè 'n'otre file|Stonne otre file}} sus a 'u site cu 'u stesse condenute.",
        "api-error-duplicate-archive": "{{PLURAL:$1|Stave 'n'otre file|Stavane otre file}} già sus a 'u site cu 'u stesse condenute, ma {{PLURAL:$1|ha state|onne state}} scangellate.",
        "api-error-empty-file": "'U file ca tu è confermate ere vacande.",
        "api-error-emptypage": "Quanne se ne ccreje une, le pàggene vacande non ge sò permesse.",
index d6ff010..4f8042b 100644 (file)
        "deletepage": "Briši stran",
        "confirm": "Potrdi",
        "excontent": "vsebina: '$1'",
-       "excontentauthor": "vsebina: '$1' (edini urejevalec pa '$2')",
+       "excontentauthor": "vsebina je bila: »$1«, edini urejevalec pa »[[Special:Contributions/$2|$2]]« ([[User talk:$2|pogovor]])",
        "exbeforeblank": "vsebina pred brisanjem: '$1'",
        "delete-confirm": "Brisanje »$1«",
        "delete-legend": "Izbriši",
index 207cc36..639f6b5 100644 (file)
        "talk": "Diskutimet",
        "views": "Shikime",
        "toolbox": "Mjete",
-       "userpage": "Shiko faqen e përdoruesit",
-       "projectpage": "Shiko projekt-faqen",
-       "imagepage": "Shikoni faqen e skedës",
+       "userpage": "Shfaq faqen e përdoruesit",
+       "projectpage": "Shfaq faqen e projektit",
+       "imagepage": "Shfaq faqen e skedës",
        "mediawikipage": "Shiko faqen e mesazhit",
        "templatepage": "Shiko faqen e shabllonit",
        "viewhelppage": "Shiko faqen për ndihmë",
-       "categorypage": "Shiko faqen e kategorive",
+       "categorypage": "Shfaq faqen e kategorisë",
        "viewtalkpage": "Shiko diskutimet",
        "otherlanguages": "Në gjuhë të tjera",
        "redirectedfrom": "(Përcjellë nga $1)",
        "policy-url": "Project:Politika e rregullave",
        "portal": "Portali i komunitetit",
        "portal-url": "Project:Portali i komunitetit",
-       "privacy": "Politika e anonimitetit",
-       "privacypage": "Project:Politika e anonimitetit",
+       "privacy": "Mbrojtja e privatësisë",
+       "privacypage": "Project: Mbrojtja e privatësisë",
        "badaccess": "Leje: gabim",
        "badaccess-group0": "Nuk ju lejohet veprimi i kërkuar",
        "badaccess-groups": "Veprimi që kërkuat lejohet vetëm nga përdorues të {{PLURAL:$2|grupit|grupeve}}: $1.",
        "protectedinterface": "Kjo faqe përmban tekstin e dritares së programit, për këtë arsye mbrohet për të shmangur abuzimet.",
        "editinginterface": "'''Kujdes:''' Po redaktoni një faqe që përdoret për tekstin dritares së programit. \nNdryshimet në këtë faqe do të ndikojnë pamjen e dritares për përdoruesit e tjerë.\nPër përkthime, ju lutem konsideroni përdorimin e [//translatewiki.net/wiki/Main_Page?setlang=en translatewiki.net], projektin e lokalizimit MediaWiki.",
        "translateinterface": "Të shtoni ose të ndryshojë përkthime për të gjitha wikis, ju lutem përdorimin e [//translatewiki.net/ translatewiki.net], MediaWiki lokalizimin e projektit.",
-       "cascadeprotected": "Kjo faqe është mbrojtur nga redaktimi pasi është përfshirë në {{PLURAL:$1|faqen|faqet}} e mëposhtme që {{PLURAL:$1|është|janë}} mbrojtur sipas metodës \"cascading\":\n$2",
+       "cascadeprotected": "Kjo faqe është mbrojtur nga redaktimi pasi që është përfshirë në {{PLURAL:$1|faqen|faqet}} e mëposhtme që {{PLURAL:$1|është|janë}} mbrojtur sipas metodës \"cascading\":\n$2",
        "namespaceprotected": "Nuk ju lejohet redaktimi i faqeve në hapsirën '''$1'''.",
        "customcssprotected": "Ju nuk keni leje për të redaktuar këtë faqe CSS, sepse ai përmban cilësimet personale tjetër user's.",
        "customjsprotected": "Ju nuk keni leje për të redaktuar këtë faqe JavaScript, sepse ai përmban cilësimet personale tjetër user's.",
        "mycustomcssprotected": "Ju nuk keni leje për të redaktuar këtë faqe CSS.",
        "mycustomjsprotected": "Ju nuk keni leje për të redaktuar këtë   faqe JavaScript .",
-       "myprivateinfoprotected": "Ju nuk keni leje për të redaktuar të dhënat tuaja private.",
-       "mypreferencesprotected": "Ju nuk keni leje për të ndryshuar preferencat tuaja.",
+       "myprivateinfoprotected": "Ti nuk ke leje për të redaktuar të dhënat e tua private.",
+       "mypreferencesprotected": "Ti nuk ke leje për të ndryshuar preferencat e tua.",
        "ns-specialprotected": "Faqet speciale nuk mund të redaktohen.",
        "titleprotected": "Ky titull është mbrojtur nga [[User:$1|$1]] dhe nuk mund të krijohet.\nArsyeja e dhënë është ''$2''.",
        "filereadonlyerror": "Nuk është në gjendje që të ndryshojë skedarin \"$1\" sepse depoja e skedarit \"$2\" është në formën vetëm-lexim.\n\nAdministratori i cili e mbylli atë e dha këtë shpjegim: \"$3\".",
        "virus-unknownscanner": "antivirus i pa njohur:",
        "logouttext": "'''Ju keni dalë jashtë.''' \n \n Kini parasysh që disa faqe mund të shfaqen sikur të ishit i identifikuar derisa të fshini ''cache''-in e shfletuesit tuaj.",
        "welcomeuser": "Mirë se vini, $1!",
-       "welcomecreation-msg": "Llogaria juaj u krijua. \nMos harroni të ndryshoni [[Special:Preferences|{{SITENAME}} preferencat]] tuaja.",
+       "welcomecreation-msg": "Llogaria e jote u krijua. \nMos harro të ndryshosh [[Special:Preferences|{{SITENAME}} parapëlqimet]] e tua.",
        "yourname": "Fusni nofkën tuaj",
        "userlogin-yourname": "Emri i përdoruesit",
-       "userlogin-yourname-ph": "Shtypni emrin tuaj të përdoruesit",
+       "userlogin-yourname-ph": "Fut emrin tënd të përdoruesit",
        "createacct-another-username-ph": "Shtypni emrin e përdoruesit",
        "yourpassword": "Fusni fjalëkalimin tuaj",
        "userlogin-yourpassword": "Fjalëkalimi",
        "createaccount": "Hap një llogari",
        "gotaccount": "Keni një llogari? '''$1'''.",
        "gotaccountlink": "Identifikohuni",
-       "userlogin-resetlink": "Keni harruar të dhënat tuaja të identifikimit?",
+       "userlogin-resetlink": "Ke harruar të dhënat e tua të identifikimit?",
        "userlogin-resetpassword-link": "Keni harruar fjalëkalimin?",
        "userlogin-helplink2": "Ndihmë rreth identifikimit",
        "userlogin-loggedin": "Ju tashmë janë të regjistruar si <span class=\"notranslate\" translate=\"asnjë\">{{GJINIA:$1|</span><span class=\"notranslate\" translate=\"asnjë\">$1</span>}}.\nPërdorim formularin më poshtë që të hyni në si një përdorues tjetër.",
        "createacct-benefit-body2": "{{PLURAL:$1|faqe|faqe}}",
        "createacct-benefit-body3": "{{PLURAL:$1|kontribuesi i|kontribuesit e}} fundit",
        "badretype": "Fjalëkalimet nuk janë njësoj.",
+       "usernameinprogress": "Një krijim i llogarisë me këtë emër përdoruesi tashmë është në progres.\nTë lutem prit.",
        "userexists": "Emri i përdoruesit që kërkuat është në përdorim. \nZgjidhni një emër tjetër.",
        "loginerror": "Gabim gjatë identifikimit",
        "createacct-error": "krijim gabim llogarie",
        "createaccounterror": "I pamundur krijimi i llogarisë: $1",
-       "nocookiesnew": "Llogaria e përdoruesit u krijua por ju nuk jeni identifikuar ende.\n{{SITENAME}} shfrytëzon \"cookies\" për të identifikuar përdoruesit.\nJu nuk mundësoni lejimin e \"cookies\".\nJu lutemi, mundësojini ato, pastaj identifikohuni me anë të të dhënave tuaja të reja: emri i përdoruesit dhe fjalëkalimi.",
+       "nocookiesnew": "Llogaria e përdoruesit u krijua por ti nuk je identifikuar akoma.\n{{SITENAME}} shfrytëzon \"cookies\" për të identifikuar përdoruesit.\nTi ke çaktivizuar e \"cookies\".\nTë lutem, avktizo ato, pastaj identifikohu emrin e ri të përdoruesit dhe fjalëkalimin.",
        "nocookieslogin": "{{SITENAME}} shfrytëzon \"cookies\" për identifikimin e përdoruesve.\nYou nuk lejoni shfrytëzimin e \"cookies\".\nJu lutemi, lejoni shfrytëzimin e \"cookies\" dhe provojeni përsëri.",
        "nocookiesfornew": "Llogaria e përdoruesit nuk u krijua, pasi ne nuk mund të konfirmojmë burimin e tij.\nSigurohuni që ju lejoni shfrytëzimin e \"cookies\", rifreskoni këtë faqe dhe provojen përsëri.",
        "noname": "Nuk keni dhënë një emër përdoruesi të pranueshëm.",
        "changeemail-password": "Fjalëkalimi juaj i {{SITENAME}}:",
        "changeemail-submit": "Ndrysho postën elektronike",
        "changeemail-throttled": "Ju keni bërë shumë tentativa hyrjeje.\nJu lutemi prisni $1 përpara se të provoni sërish.",
+       "changeemail-nochange": "Të lutem shkruaj një tjetër adresë emaili.",
+       "resettokens": "Rivendos tokens",
        "resettokens-token-label": "$1 (vlera aktuale: $2)",
        "bold_sample": "Stil i theksuar i tekstit",
        "bold_tip": "Stil i theksuar i tekstit",
        "accmailtitle": "Fjalëkalimi u dërgua.",
        "accmailtext": "Një fjalëkalim i krijuar në mënyrë të rastësishme për [[User talk:$1|$1]] u dërgua në $2.\n\nFjalëkalimi për këtë llogari mund të ndryshohet në faqen ''[[Special:ChangePassword|ndrysho fjalëkalimin]]'' pasi të jeni identifikuar.",
        "newarticle": "(I ri)",
-       "newarticletext": "Ju keni ndjekur nje lidhje drejt një faqeje që nuk ekziston.\nPër ta krijuar këtë faqe ju mund të shkruani në kutinë e mëposhtme (shih [$1 faqen e ndihmës] për më shumë informacion).\nNëse ju keni mbërritur këtu gabimisht, atëherë klikoni butonin '''pas''' të shfletuesit tuaj.",
+       "newarticletext": "Ti ke ndjekur nje lidhje drejt një faqeje që nuk ekziston.\nPër ta krijuar këtë faqe, fillo të shkruash në kutinë e mëposhtme (shih [$1 faqen e ndihmës] për më shumë informacion).\nNëse ti ke mbërritur këtu gabimisht, atëherë kliko butonin '''pas''' të shfletuesit tënd.",
        "anontalkpagetext": "----'' Kjo është një faqe diskutimi për një përdorues anonim i cili nuk ka krijuar akoma një llogari, ose qe nuk e përdor atë. \n Prandaj, ne duhet të përdorim adresën IP numerike për identifikimin e tij. \nKjo adresë IP mund të përdoret nga disa përdorues.\n Në qoftë se jeni një përdorues anonim dhe mendoni se ndaj jush janë bërë komente të parëndësishme, ju lutem [[Special:UserLogin/signup|krijoni një llogari]] ose [[Special:UserLogin|identifikohuni]] për të shmangur konfuzionin në të ardhmen me përdorues të tjerë anonim .''",
        "noarticletext": "Momentalisht nuk ka tekst në këtë faqe.\nJu mund [[Special:Search/{{PAGENAME}}|ta kërkoni këtë titull]] në faqe tjera,\n<span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} të kërkoni ngjarjet e ngjashme në regjistër],\nose [{{fullurl:{{FULLPAGENAME}}|action=edit}} të redaktoni këtë faqe]</span>.",
        "noarticletext-nopermission": "Për momentin faqja e kërkuar është bosh.\nJu mund të [[Special:Search/{{PAGENAME}}|kërkoni këtë titiull]] në faqet e tjera, ose të <span class=\"plainlinks\">[{{fullurl:{{#Special:Log}}|page={{FULLPAGENAMEE}}}} këtkoni regjistrat e ngjashëm]</span>, por ju nuk mundeni ta krijoni këtë faqe.",
        "userinvalidcssjstitle": "'''Kujdes:''' Nuk ka pamje të quajtur \"$1\". Vini re se faqet .css dhe .js përdorin titull me gërma të vogla, p.sh. {{ns:user}}:Foo/vector.css, jo {{ns:user}}:Foo/Vector.css.",
        "updated": "(E ndryshuar)",
        "note": "'''Shënim:'''",
-       "previewnote": "'''Vini re! Kjo faqe është vetëm për shqyrtim.'''\nNdryshimet tuaja nuk janë ruajtur ende!",
+       "previewnote": "'''Mos harro që kjo është vetëm një parapamje.'''\nNdryshimet e tua nuk janë ruajtur ende!",
        "continue-editing": "Shko në pjesën për redaktim",
        "previewconflict": "Kjo parapamje reflekton tekstin sipër kutisë së redaktimit siç do të duket kur të kryeni ndryshimin.",
        "session_fail_preview": "'''Ju kërkojmë ndjesë! Redaktimi juaj nuk mund të perpunohej për shkak të humbjes së të dhënave të seancës.'''\nJu lutemi, provojeni përsëri.\nNëse përsëri nuk punon, provoni të [[Special:UserLogout|dilni nga faqja]] dhe të identifikoheni serish.",
        "copyrightwarning": "Ju lutemi, vini re! Të gjitha kontributet në {{SITENAME}} jepen për publikim sipas $2 (shiko $1 për më shumë detaje).\nNëse ju nuk dëshironi që shkrimet tuaja të redaktohen pa mëshirë dhe të shpërndahen sipas dëshirës, atëherë mos i vendosni këtu.<br />\nGjithashtu, ju po na premtoni ne që gjithçka e keni shkruar vetë, ose e keni kopjuar nga një domain publik ose nga burime të tjera  te hapura.\n'''Mos vendosni material të mbrojtur nga e drejta e autorit pa leje!'''",
        "copyrightwarning2": "Ju lutemi, vini re! Të gjitha kontributet në {{SITENAME}} mund të redaktohen, ndryshohen ose hiqen nga përdorues të tjerë  (shiko $1 për më shumë detaje). \nNëse ju nuk dëshironi që shkrimet tuaja të redaktohen pa mëshirë dhe të shpërndahen sipas dëshirës, atëherë mos i vendosni këtu<br />\nGjithashtu, ju po na premtoni ne që gjithçka e keni shkruar vetë, ose e keni kopjuar nga një domain publik ose nga burime të tjera  te hapura.\n'''Mos vendosni material të mbrojtur nga e drejta e autorit pa leje!'''",
        "longpageerror": "'''Gabim: Teksti që shkruat është  {{PLURAL:$1|një kilobajt|$1 kilobajt}} i gjatë, që është mëtepër se maksimumi i lejuar prej  {{PLURAL:$2|një kilobajt|$2 kilobajtësh}} .'''\nNuk mund të ruhet.",
-       "readonlywarning": "'''Kujdes: Baza e të dhënave është mbyllur për mirëmbajtje, prandaj ju nuk do të mund të ruani redaktimin tuaj për momentin.'''\nJu mund të kopjoni tekstin dhe ta ruani për më vonë në një dokument tjetër.'''\n\nAdministruesi që e bllokoi ka dhënë këtë sqarim: $1.",
+       "readonlywarning": "<strong>Kujdes: Baza e të dhënave është mbyllur për mirëmbajtje, prandaj për momentin nuk do të mund të ruash redaktimin tënd.</strong>\nTi mund ta kopjosh/ngjitësh tekstin dhe ta ruash në një dokument tjetër për ta përdorur më vonë .\n\nAdministratori që e bllokoi ka dhënë këtë sqarim: $1.",
        "protectedpagewarning": "'''KUJDES: Kjo faqe është e mbrotjur dhe mund të redaktohet nga përdorues me të drejta administratori.'''\nShënimi i fundit në regjistër është paraqitur më poshtë për reference:",
        "semiprotectedpagewarning": "'''Shënim:''' Kjo faqe është e mbrojtur dhe mund të redaktohet vetëm nga përdorues të regjistruar.\nShënimi i fundit në regjistër është paraqitur më poshtë për reference:",
        "cascadeprotectedwarning": "'''Vini re:''' Kjo faqe është e mbrojtur dhe vetëm përdoruesit me privilegje administrative mund ta redaktojnë pasi është përfshirë në mbrotjen \"ujëvarë\" të {{PLURAL:$1|faqes së|faqeve të}} mëposhtme:",
        "editwarning-warning": "Duke e lënë këtë faqe mund të shkaktojë ju për të humbur të gjitha ndryshimet që keni bërë ju.\nNëse ju jeni regjistruar, ju mund të çaktivizoni këtë paralajmërim në \"{{int:prefs-editing}}\" seksionin e preferencave tuaja.",
        "content-model-text": "tekst i thejshtë",
        "content-model-javascript": "JavaScript",
+       "content-json-empty-object": "Objekt bosh",
+       "content-json-empty-array": "Fushë boshe",
        "expensive-parserfunction-warning": "Kujdes: Kjo faqe ka shumë kërkesa që kërkojnë analizë gramatikore të kushtueshme për sistemin.\n\nDuhet të ketë më pakë se $2, {{PLURAL:$2|kërkesë|kërkesa}}, kurse tani {{PLURAL:$1|është $1 kërkesë|janë $1 kërkesa}}.",
        "expensive-parserfunction-category": "Faqe me shumë shprehje të kushtueshmë për analizë gramatikore",
        "post-expand-template-inclusion-warning": "'''Kujdes''': Numri i shablloneve që perfshihen është shumë i madh.\nDisa shabllone nuk do të përfshihen.",
        "viewpagelogs": "Shiko regjistrat për këtë faqe",
        "nohistory": "Nuk ka histori redaktimesh për këtë faqe.",
        "currentrev": "Versioni i tanishëm",
-       "currentrev-asof": "Versioni momental që nga $1",
-       "revisionasof": "Versioni i $1",
+       "currentrev-asof": "Versioni aktual i datës $1",
+       "revisionasof": "Versioni i datës $1",
        "revision-info": "Versioni i datës $1 nga {{GENDER:$6|$2}}$7",
        "previousrevision": "← Version më i vjetër",
        "nextrevision": "Version më i ri →",
        "prefs-rc": "Ndryshimet e fundit",
        "prefs-watchlist": "Lista mbikqyrëse",
        "prefs-editwatchlist": "Redakto listën mbikqyrëse",
+       "prefs-editwatchlist-clear": "Boshatis listën tënde mbikqyrëse",
        "prefs-watchlist-days": "Numri i ditëve të treguara tek lista mbikqyrëse:",
        "prefs-watchlist-days-max": "Maksimumi $1 ditë",
        "prefs-watchlist-edits": "Numri i redaktimeve të treguara tek lista mbikqyrëse e zgjeruar:",
        "recentchangesdays-max": "(maksimum $1 {{PLURAL:$1|dit|ditë}})",
        "recentchangescount": "Numri i redaktimeve për të treguar:",
        "prefs-help-recentchangescount": "Kjo përfshin ndryshimet e freskëta, historikun e faqes dhe regjistrat.",
-       "savedprefs": "Parapëlqimet tuaja janë ruajtur.",
+       "savedprefs": "Parapëlqimet e tua janë ruajtur.",
        "timezonelegend": "Zona kohore:",
        "localtime": "Ora lokale:",
        "timezoneuseserverdefault": "wiki default Përdorimi ( $1 )",
        "userrights-notallowed": "Ju nuk keni leje për të shtuar ose hequr privilegjet e përdoruesve.",
        "userrights-changeable-col": "Grupe që mund të ndryshoni",
        "userrights-unchangeable-col": "Grupe që s'mund të ndryshoni",
-       "userrights-conflict": "Konflikt në ndryshimin e të drejtave të përdoruesit! Ju lutemi të rishikoni dhe konfirmomi ndryshimet tuaja.",
+       "userrights-conflict": "Konflikt në ndryshimin e të drejtave të përdoruesit! Të lutem të rishiko dhe konfirmo ndryshimet e tua.",
        "group": "Grupi:",
        "group-user": "Përdorues",
        "group-autoconfirmed": "Përdorues të vërtetuar automatikisht",
        "right-unblockself": "Zhblloko veten",
        "right-protect": "Ndrysho nivelin mbrojtës dhe redakto faqet e mbrojtura",
        "right-editprotected": "Redakto faqet e mbrojtura (pa ndryshuar mbrojtjen)",
+       "right-editsemiprotected": "Redakto faqet e mbrojtura, si \"{{int:protect-level-autoconfirmed}}\"",
+       "right-editcontentmodel": "Redakto modelin e përmbajtjes së një faqeje",
        "right-editinterface": "Ndrysho parapamjen e përdoruesit",
        "right-editusercssjs": "Redakto skedat CSS dhe JS të përdoruesve tjerë",
        "right-editusercss": "Redakto skedat CSS të përdoruesve tjerë",
        "right-edituserjs": "Redakto skedat JS të përdoruesve tjerë",
+       "right-editmyusercss": "Redakto CSS - skedat e tua të përdoruesit",
+       "right-editmyuserjs": "Redakto JavaScript - skedat e tua të përdoruesit",
+       "right-viewmywatchlist": "Shfaq listën time mbikqyrëse",
+       "right-editmyoptions": "Redakto parapëlqimet e tua",
        "right-rollback": "Rikthen shpejt redaktimet  e pedaktuesit të fundit",
        "right-markbotedits": "Shëno rikthimet si redaktime robotësh",
        "right-noratelimit": "Mos u prek nga kufizimet e vlerësimit",
        "action-import": "importo faqe nga një wiki tjetër",
        "action-importupload": "Importo faqe nga një ngarkim skede",
        "action-patrol": "shëno redaktimin e tjerëve si të patrulluar",
-       "action-autopatrol": "shëno redaktimet tua si të patrulluara",
+       "action-autopatrol": "shëno redaktimet tua si të patrulluara",
        "action-unwatchedpages": "shiko listën e faqeve të pa vrojtuara",
        "action-mergehistory": "bashko historikun e kësaj faqeje",
        "action-userrights": "ndrysho të gjitha të drejtat e përdoruesit",
        "upload-too-many-redirects": "Adresa URL përmbante shumë përcjellime.",
        "upload-http-error": "Ndodhi një gabim HTTP: $1",
        "upload-copy-upload-invalid-domain": "Ngarkesat e kopjimit nuk janë në dispozicion nga ky domein.",
+       "upload-dialog-title": "Ngarko skedën",
+       "upload-dialog-button-cancel": "Anulo",
+       "upload-dialog-button-done": "Mbyll",
+       "upload-dialog-button-save": "Ruaj",
+       "upload-dialog-button-upload": "Ngarko",
+       "upload-process-error": "Një gabim ka ndodhur",
        "backend-fail-stream": "Nuk mund të kalojë skedën $1.",
        "backend-fail-backup": "Nuk mund të rezervojë skedën $1.",
        "backend-fail-notexists": "Skeda $1 nuk ekziston.",
        "uploadstash-summary": "Kjo faqe ofron qasje tek skedat të cilat janë ngarkuar (ose janë në proçes ngarkimi) por që nuk janë publikuat akoma në wiki. Këto skeda nuk janë të dukshme për këdo përveç për përdoruesin që i ka ngarkuar ato.",
        "uploadstash-clear": "Spastro skedat e fshehura",
        "uploadstash-nofiles": "Ju nuk keni skeda të fshehura.",
-       "uploadstash-badtoken": "Kryerja e këtij veprimi ishte e pasuksesshme, ndoshta sepse kredencialet redaktuese tuaja kanë skaduar. Provoni përsëri.",
+       "uploadstash-badtoken": "Kryerja e këtij veprimi ishte e pasuksesshme, ndoshta sepse kredencialet e tua redaktuese kanë skaduar. Provo përsëri.",
        "uploadstash-errclear": "Spastrimi i skedave ishte i pasuksesshëm.",
        "uploadstash-refresh": "Rifreskoni listën e skedave",
        "invalid-chunk-offset": "Kompensim cope i pavlefshëm",
        "img-auth-nologinnWL": "Ju nuk jeni i regjistruar dhe \"$1\" nuk është në listën e bardhë.",
        "img-auth-nofile": "Skeda \"$1\" nuk ekziston.",
        "img-auth-isdir": "Ju po përpiqeni të hyni në një drejtori \"$1\".\nVetëm  qasja e skedës është e lejuar.",
-       "img-auth-streaming": "Duke rrejdhur \"$1\"",
+       "img-auth-streaming": "Duke ngarkuar \"$1\"",
        "img-auth-public": "Funksioni i img_auth.php është për të larguar skedat nga një wiki privat.\nKy wiki është i konfiguruar si një wiki publik.\nPër siguri optimale, img_auth.php është çaktivizuar.",
        "img-auth-noread": "Përdoruesi nuk ka qasje për të lexuar \"$1\".",
        "http-invalid-url": "Adresë URL e pavlefshme: $1",
        "listfiles_size": "Madhësia (bytes)",
        "listfiles_description": "Përshkrimi",
        "listfiles_count": "Versionet",
+       "listfiles-latestversion": "Versioni aktual",
+       "listfiles-latestversion-yes": "Po",
+       "listfiles-latestversion-no": "Jo",
        "file-anchor-link": "Figura",
        "filehist": "Historiku i dosjes",
        "filehist-help": "Shtypni një datë/kohë për ta parë skedën ashtu si dukej në atë kohë.",
        "filerevert-legend": "Rikthe skedën",
        "filerevert-intro": "Po ktheni '''[[Media:$1|$1]]''' tek [versioni $4 i $3, $2].",
        "filerevert-comment": "Arsyeja:",
-       "filerevert-defaultcomment": "U rikthye tek versioni i $2, $1",
+       "filerevert-defaultcomment": "Rikthyer në versionin e datës $2, ora $1 ($3)",
        "filerevert-submit": "Riktheje",
        "filerevert-success": "'''[[Media:$1|$1]]''' është kthyer tek [versioni $4 i $3, $2].",
        "filerevert-badversion": "Nuk ka version vendor tjetër të kësaj skede në kohën e dhënë.",
        "filedelete-comment": "Arsyeja:",
        "filedelete-submit": "Grise",
        "filedelete-success": "'''$1''' është grisur.",
-       "filedelete-success-old": "Versioni i '''[[Media:$1|$1]]''' që nga $3, $2 është grisur.",
+       "filedelete-success-old": "Versioni i '''[[Media:$1|$1]]''' i datës $3, ora $2 është fshirë.",
        "filedelete-nofile": "'''$1''' nuk ekziston.",
        "filedelete-nofile-old": "Nuk ka version të arkivuar të '''$1''' me të dhënat e kërkuara.",
        "filedelete-otherreason": "Arsye tjetër / shtesë:",
        "mailnologin": "S'ka adresë dërgimi",
        "mailnologintext": "Duhet të keni [[Special:UserLogin|hyrë brenda]] dhe të keni një adresë të saktë në [[Special:Preferences|parapëlqimet]] tuaja për tu dërguar email përdoruesve të tjerë.",
        "emailuser": "Email {{GENDER:{{PAGENAME}}|përdoruesit|përdorueses}}",
+       "emailuser-title-notarget": "Email për përdoruesin",
        "emailpagetext": "Mund të përdorni formularin e mëposhtëm për të dërguar e-mail tek ky përdorues.\nAdresa e email-it që shkruat tek [[Special:Preferences|preferencat tuaja]] do të duket si \"Nga\" adresa e email-it, pra marrësi do të ketë mundësinë t'ju përgjigjet direkt.",
        "defemailsubject": "{{SITENAME}} posta elektronike nga përdoruesi \"$1\"",
        "usermaildisabled": "Email-i i përdoruesit çaktivizua",
        "wlshowlast": "Trego $1 orët $2 ditët",
        "watchlist-options": "Mundësitë e listës mbikqyrëse",
        "watching": "Duke mbikqyrur...",
-       "unwatching": "Duke çmbikqyrur...",
+       "unwatching": "Mos e mbikqyr më...",
        "watcherrortext": "Është paraqitur një gabim përderisa ndryshuat parametrat e listës suaj mbikqyrëse për \"$1\".",
        "enotif_reset": "Shëno të gjitha faqet e vizituara",
        "enotif_impersonal_salutation": "Përdorues i {{SITENAME}}",
        "rollback-success": "Ndryshimet e $1 u kthyen mbrapsh; artikulli ndodhet tek verzioni i $2.",
        "sessionfailure-title": "Dështim sesioni",
        "sessionfailure": "Duket se ka një problem me seancën tuaj hyrëse; ky veprim është anuluar për tu mbrojtur nga ndonjë veprim dashakeq kundrejt shfletimit tuaj. Ju lutemi kthehuni mbrapsh, rifreskoni faqen prej nga erdhët dhe provojeni përsëri veprimin.",
+       "changecontentmodel-title-label": "Titulli i faqes",
        "changecontentmodel-reason-label": "Arsyeja:",
        "protectlogpage": "Regjistri i mbrojtjeve",
        "protectlogtext": "Më poshtë është lista e kyçjeve dhe çkyçjeve të faqes.\nShih listën e [[Special:ProtectedPages|faqeve të mbrojtura]] nga lista e mbrojtjeve të faqeve tani në veprim.",
        "sorbsreason": "Adresa IP e juaj është radhitur si ndërmjetëse e hapur tek lista DNSBL.",
        "sorbs_create_account_reason": "Adresa IP e juaj është radhitur si ndërmjetëse e hapur tek lista DNSBL që përdoret nga {{SITENAME}}. Nuk ju lejohet të hapni një llogari.",
        "cant-see-hidden-user": "Përdoruesi që po përpiqeni të bllokoni është i bllokuar dhe i fshehur.\nPërderisa ju nuk keni të drejtën e fshehjes së përdoruesve, ju nuk mund të shikoni ose redaktoni bllokimet e përdoruesit.",
-       "ipbblocked": "Ju nuk mund të bllokoni ose zhbllokoni përdoruesit e tjerë, sepse jeni për vete i bllokuar",
+       "ipbblocked": "Ti nuk mund t'i bllokosh ose zhbllokosh përdoruesit e tjerë, sepse je vet i bllokuar",
        "ipbnounblockself": "Ju nuk mund të zhbllokoni veten tuaj",
        "lockdb": "Blloko regjistrin",
        "unlockdb": "Çblloko regjistrin",
        "revertmove": "ktheje",
        "delete_and_move": "Grise dhe zhvendose",
        "delete_and_move_text": "==Nevojitet grisje==\n\nFaqja \"[[:$1]]\" ekziston, dëshironi ta grisni për të mundësuar zhvendosjen?",
-       "delete_and_move_confirm": "Po, grise faqen",
+       "delete_and_move_confirm": "Po, fshi këtë faqe",
        "delete_and_move_reason": "U gris për të liruar vendin për përcjellim të \"[[$1]]\"",
        "selfmove": "Nuk munda ta zhvendos faqen sepse titulli i ri është i njëjtë me të vjetrin.",
        "immobile-source-namespace": "Nuk mund të lëvizet faqja tek \"$1\"",
        "allmessages-prefix": "Filtroni nga parashtesat:",
        "allmessages-language": "Gjuha:",
        "allmessages-filter-submit": "Shko",
+       "allmessages-filter-translate": "Përkthe",
        "thumbnail-more": "Zmadho",
        "filemissing": "Mungon skeda",
        "thumbnail_error": "Gabim gjatë krijimit të figurës përmbledhëse: $1",
+       "thumbnail_error_remote": "Mesazh gabimi nga $1:\n$2",
        "djvu_page_error": "Faqja DjVu jashtë renditjes",
        "djvu_no_xml": "Nuk mund të gjendet XML për skedën DjVu",
        "thumbnail-temp-create": "Nuk mund të krijohej parapamja e përkohshme e skedës",
        "import": "Importoni faqe",
        "importinterwiki": "Import ndër-wiki",
        "import-interwiki-text": "Zgjidhni një wiki dhe titull faqeje për të importuar.\nDatat e versioneve dhe emrat e redaktuesve do të ruhen.\nTë gjitha veprimet e importit transwiki janë të regjistruara tek [[Special:Log/import|registri i importimeve]].",
+       "import-interwiki-sourcewiki": "Burimi wiki:",
+       "import-interwiki-sourcepage": "Burimi i faqes:",
        "import-interwiki-history": "Kopjo të gjitha versionet e historisë për këtë faqe",
        "import-interwiki-templates": "Përfshini të gjitha stampat",
        "import-interwiki-submit": "Importo",
        "tooltip-pt-anonuserpage": "Faqja e përdoruesve anonim nga kjo adresë IP",
        "tooltip-pt-mytalk": "Faqja jote e diskutimeve",
        "tooltip-pt-anontalk": "Faqja e diskutimeve të përdoruesve anonim për këtë adresë IP",
-       "tooltip-pt-preferences": "Parapëlqimet tuaja",
+       "tooltip-pt-preferences": "Parapëlqimet e tua",
        "tooltip-pt-watchlist": "Lista e faqeve nën mbikqyrjen tuaj.",
-       "tooltip-pt-mycontris": "Lista e kontributeve tuaja",
+       "tooltip-pt-mycontris": "Lista e kontributeve tua",
        "tooltip-pt-login": "Identifikimi nuk është i detyrueshëm, megjithatë ne jua rekomandojmë.",
        "tooltip-pt-logout": "Dalje",
        "tooltip-pt-createaccount": "Ju rekomandojmë të krijoni një llogari dhe të kyqeni; megjithatë,  nuk është e detyrueshme",
        "tooltip-search-go": "Shko tek faqja me këtë emër nëse ekziston",
        "tooltip-search-fulltext": "Kërko faqet për këtë tekst",
        "tooltip-p-logo": "Vizito faqen kryesore",
-       "tooltip-n-mainpage": "Vizitoni Faqen kryesore",
+       "tooltip-n-mainpage": "Vizito faqen kryesore",
        "tooltip-n-mainpage-description": "Vizito faqen kryesore",
        "tooltip-n-portal": "Rreth projektit, çfarë mund të bëni dhe ku gjenden gjërat",
        "tooltip-n-currentevents": "Kërko informacion të mëparshëm për ngjarjet aktuale.",
        "tooltip-t-permalink": "Lidhja e përhershme tek ky version i faqes",
        "tooltip-ca-nstab-main": "Shikoni përmbajtjen e atikullit.",
        "tooltip-ca-nstab-user": "Shfaq faqen e përdoruesit",
-       "tooltip-ca-nstab-media": "Shikoni faqen e skedës",
+       "tooltip-ca-nstab-media": "Shfaq faqen e medias",
        "tooltip-ca-nstab-special": "Kjo është një faqe speciale. Ju nuk mundeni ta redaktoni këtë faqe",
-       "tooltip-ca-nstab-project": "Shikoni faqen e projektit",
+       "tooltip-ca-nstab-project": "Shfaq faqen e projektit",
        "tooltip-ca-nstab-image": "Shikoni faqen e figurës",
        "tooltip-ca-nstab-mediawiki": "Shikoni mesazhet e sistemit",
        "tooltip-ca-nstab-template": "Shikoni stampën",
        "spam_deleting": "Të gjitha inspektimet përmbanin lidhje në $1, duke fshirë",
        "simpleantispam-label": "Kontrolli anti-spam.\n<strong>Mos</strong> e plotëso këtë!",
        "pageinfo-title": "Informacion për \" $1 \"",
+       "pageinfo-header-basic": "Informatat bazike",
        "pageinfo-header-edits": "Historiku i redaktimeve",
+       "pageinfo-header-restrictions": "Mbrojtja e faqes",
+       "pageinfo-header-properties": "Tiparet e faqes",
+       "pageinfo-display-title": "Shfaq titullin",
+       "pageinfo-length": "Gjatësia e faqes (në bajt)",
+       "pageinfo-article-id": "ID-ja e faqes",
+       "pageinfo-language": "Gjuha e përmbajtjes së faqes",
        "pageinfo-watchers": "Numri i mbikqyrësve të faqes",
+       "pageinfo-firstuser": "Krijuesi i faqes",
+       "pageinfo-firsttime": "Data e krijimit të faqes",
+       "pageinfo-lastuser": "Redaktori i fundit",
+       "pageinfo-lasttime": "Data e redaktimit të fundit",
        "pageinfo-edits": "Numri total i redaktimeve",
        "pageinfo-authors": "Numri i përgjithshëm i autorëve të veçantë",
+       "pageinfo-recent-edits": "Numri i redaktimeve më të fundit (gjatë $1 ditëve të kaluara)",
        "pageinfo-toolboxlink": "Informacioni i faqes",
+       "pageinfo-redirectsto-info": "info",
+       "pageinfo-contentpage": "Llogaritet si një përmbajtje e faqes",
+       "pageinfo-contentpage-yes": "Po",
+       "pageinfo-protect-cascading-yes": "Po",
+       "pageinfo-category-info": "Informacioni i kategorisë",
        "pageinfo-category-total": "Numri i përgjithshëm i anëtarëve",
+       "pageinfo-category-pages": "Numri i faqeve",
+       "pageinfo-category-subcats": "Numri i nënkategorive",
+       "pageinfo-category-files": "Numri i skedave",
        "markaspatrolleddiff": "Shënoje si të patrulluar",
        "markaspatrolledtext": "Shënoje këtë artikull të patrulluar",
        "markedaspatrolled": "Shënoje të patrulluar",
        "filedeleteerror-short": "Gabim gjatë grisjes së skedës: $1",
        "filedeleteerror-long": "U hasën gabime gjatë grisjes së skedës:\n\n$1",
        "filedelete-missing": "Skeda \"$1\" nuk mund të griset pasi nuk ekziston.",
-       "filedelete-old-unregistered": "Versioni i skedës që keni zgjedhur \"$1\" nuk ndodhet në regjistër.",
+       "filedelete-old-unregistered": "Versioni i skedës së zgjedhur \"$1\" nuk ndodhet në bazën e të dhënave.",
        "filedelete-current-unregistered": "Skeda e zgjedhur \"$1\" nuk ndodhet në regjistër.",
        "filedelete-archive-read-only": "Skedari i arkivimit \"$1\" nuk mund të ndryshohet nga shëbyesi.",
        "previousdiff": "← Ndryshimi më para",
        "hours": "{{PLURAL:$1|$1 orë|$1 orë}}",
        "days": "{{PLURAL:$1|$1 ditë|$1 ditë}}",
        "ago": "$1 më parë",
+       "just-now": "mu tani",
+       "hours-ago": "$1 {{PLURAL:$1|orë|orë}} më parë",
+       "minutes-ago": "$1 {{PLURAL:$1|minutë|minuta}} më parë",
+       "seconds-ago": "$1 {{PLURAL:$1|sekond|sekonda}} më parë",
        "monday-at": "Të hënën në $1",
        "tuesday-at": "Të martën në $1",
        "wednesday-at": "Të mërkurën në $1",
        "exif-gpslongitude-w": "Gjatësi perëndimore",
        "exif-gpsaltitude-above-sealevel": "$1 {{PLURAL:$1|metër|metra}} mbi nivelin detar",
        "exif-gpsaltitude-below-sealevel": "$1 {{PLURAL:$1|metër|metra}} nën nivelin detar",
-       "exif-gpsstatus-a": "Duke bërë matje",
+       "exif-gpsstatus-a": "Matja është në progres",
        "exif-gpsstatus-v": "Matja e nderveprimit",
        "exif-gpsmeasuremode-2": "matje në 2 madhësi",
        "exif-gpsmeasuremode-3": "matje në 3 madhësi",
        "confirm-watch-top": "Shto këtë faqe në listën mbikqyrëse tuajen?",
        "confirm-unwatch-button": "Në rregull",
        "confirm-unwatch-top": "Largo këtë faqe nga lista juaj mbikqyrëse ?",
+       "quotation-marks": "\"$1\"",
        "imgmultipageprev": "← faqja e mëparshme",
        "imgmultipagenext": "faqja tjetër →",
        "imgmultigo": "Shko!",
        "imgmultigoto": "Shko tek faqja $1",
+       "img-lang-default": "(gjuha e parazgjedhur)",
        "ascending_abbrev": "ngritje",
        "descending_abbrev": "zbritje",
        "table_pager_next": "Faqja tjetër",
        "dberr-usegoogle": "Ju mund të provoni të kërkoni përmes Googles në ndërkohë.",
        "dberr-outofdate": "Vini re se indekset e tyre të përmbajtjes tona mund të jetë e vjetëruar.",
        "dberr-cachederror": "Kjo është një kopje e faqes së kërkuar dhe mund të jetë e vjetëruar.",
-       "htmlform-invalid-input": "Ka probleme me disa kontribute tuaja",
+       "htmlform-invalid-input": "Ka probleme me disa nga kontributet e tua",
        "htmlform-select-badoption": "Vlera që ju e specifikuat nuk është një alternativë e vlefshme.",
        "htmlform-int-invalid": "Vlera që ju e specifikuat nuk është numër i plotë.",
        "htmlform-float-invalid": "Vlera që ju e specifikuat nuk është numër.",
index b200503..8a93629 100644 (file)
        "disclaimers": "Ay aartu",
        "disclaimerpage": "Project:Aartu yu daj",
        "edithelp": "Ndimbal",
-       "mainpage": "Xëtu Njëlbéen",
+       "mainpage": "Xët wu njëkk",
        "mainpage-description": "Xët wu njëkk",
        "policy-url": "Project:àtte",
        "portal": "Buntub askan",
        "nstab-template": "Royuwaay",
        "nstab-help": "Xëtu ndimbal",
        "nstab-category": "Wàll",
+       "mainpage-nstab": "Xët wu njëkk",
        "nosuchaction": "Jëf ji xameesu ko",
        "nosuchactiontext": "Jëf ji nga def ci URL bi xameesu  ko.\nXéj-na dangaa juum ci bind URL bi, walla nga topp lëkkalekaay bu baaxul.\nLii man naa doon it ag njuumte ci tëriin bi ñuy jëfandikoo ci {{SITENAME}}.",
        "nosuchspecialpage": "Xëtu jagleel wu amul",
        "currentrev": "Sumb bi teew",
        "currentrev-asof": "Sumb bi teew bu $1",
        "revisionasof": "Sumb bu $1",
-       "revision-info": "Sumb bu $1, bu: $2",
+       "revision-info": "Sumbu $1, bu: {{GENDER:$6|$2}}$7",
        "previousrevision": "← Sumb bi jiitu",
        "nextrevision": "Sumb bi toftal →",
        "currentrevisionlink": "Sumb bi teew",
        "mergelog": "Yéenekaayu boole yi",
        "revertmerge": "Neenal boole yi",
        "mergelogpagetext": "Lii ci suuf ab lim la ci boole yu mujj yu jaar-jaaru aw xët ak weneen .",
-       "history-title": "Jaar-jaaru sumbi « $1 »",
+       "history-title": "Jaar-jaaru sumbi \"$1\"",
        "difference-title": "$1 wuute gi ci sumb yi",
        "lineno": "Rëdd $1 :",
        "compareselectedversions": "Méngale sumb yi nga fal",
        "rcnotefrom": "Yii ñooy coppite yi dalee '''$2''' (ba '''$1''').",
        "rclistfrom": "Wone coppite yi mujj yi dooree $3 $2",
        "rcshowhideminor": "$1 Coppite yu néewal",
+       "rcshowhideminor-show": "Wone",
        "rcshowhideminor-hide": "Nëbb",
        "rcshowhidebots": "$1 bot yi",
        "rcshowhidebots-show": "Wone",
+       "rcshowhidebots-hide": "Nëbb",
        "rcshowhideliu": "$1 jëfandikukat yi bindu",
        "rcshowhideliu-hide": "Nëbb",
        "rcshowhideanons": "$1 jëfandikukat yu binduwul",
        "rcshowhideanons-hide": "Nëbb",
        "rcshowhidepatr": "$1 coppite bees fuglu",
        "rcshowhidemine": "$1 samay cëru",
+       "rcshowhidemine-show": "Wone",
        "rcshowhidemine-hide": "Nëbb",
        "rclinks": "Wone $1 coppite yi mujj ci $2  fan yi mujj <br />$3.",
        "diff": "wuute",
        "delete-warning-toobig": "Xët wii dafa am jaar-jaar bu bari, bu weesu $1 {{PLURAL:$1|sumb|sumb}}. Seenug farte man naa jur ag jaxasoo ci dáttub njoxeeb {{SITENAME}} ; def ko ak teey.",
        "rollback": "Loppanti coppite yi",
        "rollbacklink": "delloowaat",
+       "rollbacklinkcount": "Delloo $1 {{PLURAL:$1|coppite}}",
        "rollbackfailed": "Loppanti gi antuwul",
        "cantrollback": "Neenal coppite gi manula nekk;\nKi def coppite gi mooy Kenn ki masa cëru ci xët wii.",
        "alreadyrolled": "Loppantig coppite gu mujj gu xët wii di « [[:$1]] » manula nekk, ki ko def di [[User:$2|$2]] ([[User talk:$2|Waxtaan]]{{int:pipe-separator}}[[Special:Contributions/$2|{{int:contribslink}}]]);\nam na keneen ku jota soppi walla loppanti xët wi.\n\nKi mujje soppi xët wi mooy [[User:$3|$3]] ([[User talk:$3|Waxtaan]]{{int:pipe-separator}}[[Special:Contributions/$3|{{int:contribslink}}]]).",
        "svg-long-desc": "Dencukaay SVG, kem bu jaadu  $1 × $2 pixel, dayoo dencukaay bi: $3",
        "show-big-image": "Dencukaay bi mu bàyyikoo",
        "show-big-image-preview": "Dayoob bii wonendi: $1.",
+       "show-big-image-other": "Yeneen {{PLURAL:$2|ñawaay}}: $1.",
        "show-big-image-size": "$1 × $2 pixel",
        "ilsubmit": "Seet",
        "bydate": "ci diir",
        "signature": "[[{{ns:user}}:$1|$2]] ([[{{ns:user_talk}}:$1|waxtaan]])",
        "specialpages": "Xëti jagleel",
        "tag-filter": "Seggee ak [[Special:Tags|Tafaan]]:",
-       "tag-list-wrapper": "([[Special:Tags|{{PLURAL:$1|Tag|Tag}}]]: $2)",
+       "tag-list-wrapper": "([[Special:Tags|{{PLURAL:$1|Tafaan}}]]: $2)",
        "logentry-delete-delete": "$1 {{GENDER:$2|moo far}} xët wi $3",
        "revdelete-restricted": "doxalub digal ngir yorkat yi",
        "revdelete-unrestricted": "digal ngir yorkat yi deñ na",
        "logentry-move-move": "$1 {{GENDER:$2|moo toppale}} xët wii di $3 jëmale ko ci $4",
        "logentry-newusers-create": "Sàqum jëfandikukat $1 sos nañu ko",
+       "logentry-upload-upload": "$1 {{GENDER:$2|moo yeb}} $3",
        "rightsnone": "(menn)",
        "revdelete-summary": "soppi tënk gi",
        "searchsuggest-search": "Seet"
index 1ab9574..4ead3f7 100644 (file)
        "deletepage": "删除页面",
        "confirm": "确认",
        "excontent": "内容:“$1”",
-       "excontentauthor": "内容:“$1”(唯一贡献者为“[[Special:Contributions/$2|$2]]”)",
+       "excontentauthor": "内容为:“$1”,唯一贡献者是“[[Special:Contributions/$2|$2]]”([[User talk:$2|讨论]])",
        "exbeforeblank": "被清空前的内容为:“$1”",
        "delete-confirm": "删除“$1”",
        "delete-legend": "删除",
index 7f48c9a..506aa3e 100644 (file)
@@ -8,6 +8,8 @@
  *
  */
 
+$fallback = 'es';
+
 $namespaceNames = array(
        NS_MEDIA            => 'Medios',
        NS_SPECIAL          => 'Especial',
@@ -46,6 +48,11 @@ $namespaceAliases = array(
        'Categoría_discusión' => NS_CATEGORY_TALK,
 );
 
+$namespaceGenderAliases = array(
+       NS_USER => array( 'male' => 'Usuariu', 'female' => 'Usuaria' ),
+       NS_USER_TALK => array( 'male' => 'Usuariu_alderique', 'female' => 'Usuaria_alderique' ),
+);
+
 $specialPageAliases = array(
        'Block'                     => array( 'Bloquiar', 'BloquiarIP', 'BloquiarUsuariu' ),
        'Log'                       => array( 'Rexistru', 'Rexistros' ),
index c00dbed..d48a5e0 100644 (file)
@@ -1,6 +1,5 @@
 {
-  "name": "mediawiki",
-  "version": "0.0.0",
+  "private": true,
   "scripts": {
     "test": "grunt test",
     "doc": "jsduck",
     "grunt": "0.4.5",
     "grunt-cli": "0.1.13",
     "grunt-banana-checker": "0.3.0",
-    "grunt-contrib-copy": "0.8.0",
+    "grunt-contrib-copy": "0.8.1",
     "grunt-contrib-jshint": "0.11.3",
     "grunt-contrib-watch": "0.6.1",
     "grunt-jscs": "2.1.0",
     "grunt-jsonlint": "1.0.4",
-    "grunt-karma": "0.11.0",
-    "karma": "0.12.36",
-    "karma-chrome-launcher": "0.1.12",
+    "grunt-karma": "0.12.1",
+    "karma": "0.13.10",
+    "karma-chrome-launcher": "0.2.0",
     "karma-firefox-launcher": "0.1.6",
-    "karma-qunit": "0.1.4",
+    "karma-qunit": "0.1.5",
     "qunitjs": "1.18.0"
   }
 }
index 335775f..d6e13ed 100644 (file)
@@ -860,7 +860,7 @@ return array(
                'position' => 'top',
        ),
        'mediawiki.api' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.api.js',
+               'scripts' => 'resources/src/mediawiki/api.js',
                'dependencies' => array(
                        'mediawiki.util',
                        'user.tokens',
@@ -868,14 +868,14 @@ return array(
                'targets' => array( 'desktop', 'mobile' ),
        ),
        'mediawiki.api.category' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.api.category.js',
+               'scripts' => 'resources/src/mediawiki/api/category.js',
                'dependencies' => array(
                        'mediawiki.api',
                        'mediawiki.Title',
                ),
        ),
        'mediawiki.api.edit' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.api.edit.js',
+               'scripts' => 'resources/src/mediawiki/api/edit.js',
                'dependencies' => array(
                        'mediawiki.api',
                        'mediawiki.Title',
@@ -883,21 +883,21 @@ return array(
                'targets' => array( 'desktop', 'mobile' ),
        ),
        'mediawiki.api.login' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.api.login.js',
+               'scripts' => 'resources/src/mediawiki/api/login.js',
                'dependencies' => 'mediawiki.api',
        ),
        'mediawiki.api.options' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.api.options.js',
+               'scripts' => 'resources/src/mediawiki/api/options.js',
                'dependencies' => 'mediawiki.api',
                'targets' => array( 'desktop', 'mobile' ),
        ),
        'mediawiki.api.parse' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.api.parse.js',
+               'scripts' => 'resources/src/mediawiki/api/parse.js',
                'dependencies' => 'mediawiki.api',
                'targets' => array( 'desktop', 'mobile' ),
        ),
        'mediawiki.api.upload' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.api.upload.js',
+               'scripts' => 'resources/src/mediawiki/api/upload.js',
                'dependencies' => array(
                        'dom-level2-shim',
                        'mediawiki.api',
@@ -906,7 +906,7 @@ return array(
                ),
        ),
        'mediawiki.api.watch' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.api.watch.js',
+               'scripts' => 'resources/src/mediawiki/api/watch.js',
                'dependencies' => array(
                        'mediawiki.api',
                ),
@@ -993,7 +993,7 @@ return array(
                'dependencies' => 'mediawiki.ForeignApi.core',
        ),
        'mediawiki.ForeignApi.core' => array(
-               'scripts' => 'resources/src/mediawiki.api/mediawiki.ForeignApi.js',
+               'scripts' => 'resources/src/mediawiki/ForeignApi.js',
                'dependencies' => array(
                        'mediawiki.api',
                        'oojs',
@@ -1479,7 +1479,7 @@ return array(
        /* MediaWiki Page */
 
        'mediawiki.page.gallery' => array(
-               'scripts' => 'resources/src/mediawiki.page/mediawiki.page.gallery.js',
+               'scripts' => 'resources/src/mediawiki/page/gallery.js',
                'dependencies' => array(
                        'mediawiki.page.gallery.styles',
                        'jquery.throttle-debounce',
@@ -1487,14 +1487,14 @@ return array(
        ),
        'mediawiki.page.gallery.styles' => array(
                'styles' => array(
-                       'resources/src/mediawiki.page/mediawiki.page.gallery.print.css' => array( 'media' => 'print' ),
-                       'resources/src/mediawiki.page/mediawiki.page.gallery.css',
+                       'resources/src/mediawiki/page/gallery-print.css' => array( 'media' => 'print' ),
+                       'resources/src/mediawiki/page/gallery.css',
                ),
                'position' => 'top',
                'targets' => array( 'desktop', 'mobile' ),
        ),
        'mediawiki.page.ready' => array(
-               'scripts' => 'resources/src/mediawiki.page/mediawiki.page.ready.js',
+               'scripts' => 'resources/src/mediawiki/page/ready.js',
                'dependencies' => array(
                        'jquery.accessKeyLabel',
                        'jquery.checkboxShiftClick',
@@ -1505,13 +1505,13 @@ return array(
                'targets' => array( 'desktop', 'mobile' ),
        ),
        'mediawiki.page.startup' => array(
-               'scripts' => 'resources/src/mediawiki.page/mediawiki.page.startup.js',
+               'scripts' => 'resources/src/mediawiki/page/startup.js',
                'dependencies' => 'mediawiki.util',
                'position' => 'top',
                'targets' => array( 'desktop', 'mobile' ),
        ),
        'mediawiki.page.patrol.ajax' => array(
-               'scripts' => 'resources/src/mediawiki.page/mediawiki.page.patrol.ajax.js',
+               'scripts' => 'resources/src/mediawiki/page/patrol.js',
                'dependencies' => array(
                        'mediawiki.page.startup',
                        'mediawiki.api',
@@ -1528,11 +1528,10 @@ return array(
                ),
        ),
        'mediawiki.page.watch.ajax' => array(
-               'scripts' => 'resources/src/mediawiki.page/mediawiki.page.watch.ajax.js',
+               'scripts' => 'resources/src/mediawiki/page/watch.js',
                'dependencies' => array(
                        'mediawiki.api.watch',
                        'mediawiki.notify',
-                       'mediawiki.page.startup',
                        'mediawiki.util',
                        'jquery.accessKeyLabel',
                        'mediawiki.RegExp',
@@ -1548,7 +1547,7 @@ return array(
                ),
        ),
        'mediawiki.page.image.pagination' => array(
-               'scripts' => 'resources/src/mediawiki.page/mediawiki.page.image.pagination.js',
+               'scripts' => 'resources/src/mediawiki/page/image-pagination.js',
                'dependencies' => array(
                        'mediawiki.Uri',
                        'mediawiki.util',
@@ -1773,7 +1772,7 @@ return array(
                'position' => 'top',
                'styles' => array(
                        // @todo: Remove mediawiki.page.gallery when cache has cleared
-                       'resources/src/mediawiki.page/mediawiki.page.gallery.print.css' => array( 'media' => 'print' ),
+                       'resources/src/mediawiki/page/gallery-print.css' => array( 'media' => 'print' ),
                        // @todo: Remove mediawiki.action.view.filepage.print.css when cache has cleared
                        'resources/src/mediawiki.action/mediawiki.action.view.filepage.print.css' =>
                                array( 'media' => 'print' ),
@@ -1790,7 +1789,7 @@ return array(
                'position' => 'top',
                'styles' => array(
                        // @todo: Remove when mediawiki.page.gallery in cached html.
-                       'resources/src/mediawiki.page/mediawiki.page.gallery.css',
+                       'resources/src/mediawiki/page/gallery.css',
                        // @todo: Remove mediawiki.action.view.filepage.css
                        // and mediawiki.legacy/images/checker.png when cache has cleared
                        'resources/src/mediawiki.action/mediawiki.action.view.filepage.css',
diff --git a/resources/src/mediawiki.api/mediawiki.ForeignApi.js b/resources/src/mediawiki.api/mediawiki.ForeignApi.js
deleted file mode 100644 (file)
index b8cc059..0000000
+++ /dev/null
@@ -1,109 +0,0 @@
-( function ( mw, $ ) {
-
-       /**
-        * Create an object like mw.Api, but automatically handling everything required to communicate
-        * with another MediaWiki wiki via cross-origin requests (CORS).
-        *
-        * The foreign wiki must be configured to accept requests from the current wiki. See
-        * <https://www.mediawiki.org/wiki/Manual:$wgCrossSiteAJAXdomains> for details.
-        *
-        *     var api = new mw.ForeignApi( 'https://commons.wikimedia.org/w/api.php' );
-        *     api.get( {
-        *         action: 'query',
-        *         meta: 'userinfo'
-        *     } ).done( function ( data ) {
-        *         console.log( data );
-        *     } );
-        *
-        * To ensure that the user at the foreign wiki is logged in, pass the `assert: 'user'` parameter
-        * to #get/#post (since MW 1.23): if they are not, the API request will fail. (Note that this
-        * doesn't guarantee that it's the same user.)
-        *
-        * Authentication-related MediaWiki extensions may extend this class to ensure that the user
-        * authenticated on the current wiki will be automatically authenticated on the foreign one. These
-        * extension modules should be registered using the ResourceLoaderForeignApiModules hook. See
-        * CentralAuth for a practical example. The general pattern to extend and override the name is:
-        *
-        *     function MyForeignApi() {};
-        *     OO.inheritClass( MyForeignApi, mw.ForeignApi );
-        *     mw.ForeignApi = MyForeignApi;
-        *
-        * @class mw.ForeignApi
-        * @extends mw.Api
-        * @since 1.26
-        *
-        * @constructor
-        * @param {string|mw.Uri} url URL pointing to another wiki's `api.php` endpoint.
-        * @param {Object} [options] See mw.Api.
-        *
-        * @author Bartosz Dziewoński
-        * @author Jon Robson
-        */
-       function CoreForeignApi( url, options ) {
-               if ( !url || $.isPlainObject( url ) ) {
-                       throw new Error( 'mw.ForeignApi() requires a `url` parameter' );
-               }
-
-               this.apiUrl = String( url );
-
-               options = $.extend( /*deep=*/ true,
-                       {
-                               ajax: {
-                                       url: this.apiUrl,
-                                       xhrFields: {
-                                               withCredentials: true
-                                       }
-                               },
-                               parameters: {
-                                       // Add 'origin' query parameter to all requests.
-                                       origin: this.getOrigin()
-                               }
-                       },
-                       options
-               );
-
-               // Call parent constructor
-               CoreForeignApi.parent.call( this, options );
-       }
-
-       OO.inheritClass( CoreForeignApi, mw.Api );
-
-       /**
-        * Return the origin to use for API requests, in the required format (protocol, host and port, if
-        * any).
-        *
-        * @protected
-        * @return {string}
-        */
-       CoreForeignApi.prototype.getOrigin = function () {
-               var origin = location.protocol + '//' + location.hostname;
-               if ( location.port ) {
-                       origin += ':' + location.port;
-               }
-               return origin;
-       };
-
-       /**
-        * @inheritdoc
-        */
-       CoreForeignApi.prototype.ajax = function ( parameters, ajaxOptions ) {
-               var url, origin, newAjaxOptions;
-
-               // 'origin' query parameter must be part of the request URI, and not just POST request body
-               if ( ajaxOptions.type === 'POST' ) {
-                       url = ( ajaxOptions && ajaxOptions.url ) || this.defaults.ajax.url;
-                       origin = ( parameters && parameters.origin ) || this.defaults.parameters.origin;
-                       url += ( url.indexOf( '?' ) !== -1 ? '&' : '?' ) +
-                               'origin=' + encodeURIComponent( origin );
-                       newAjaxOptions = $.extend( {}, ajaxOptions, { url: url } );
-               } else {
-                       newAjaxOptions = ajaxOptions;
-               }
-
-               return CoreForeignApi.parent.prototype.ajax.call( this, parameters, newAjaxOptions );
-       };
-
-       // Expose
-       mw.ForeignApi = CoreForeignApi;
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.api/mediawiki.api.category.js b/resources/src/mediawiki.api/mediawiki.api.category.js
deleted file mode 100644 (file)
index 14077e0..0000000
+++ /dev/null
@@ -1,108 +0,0 @@
-/**
- * @class mw.Api.plugin.category
- */
-( function ( mw, $ ) {
-
-       $.extend( mw.Api.prototype, {
-               /**
-                * Determine if a category exists.
-                *
-                * @param {mw.Title|string} title
-                * @return {jQuery.Promise}
-                * @return {Function} return.done
-                * @return {boolean} return.done.isCategory Whether the category exists.
-                */
-               isCategory: function ( title ) {
-                       var apiPromise = this.get( {
-                               prop: 'categoryinfo',
-                               titles: String( title )
-                       } );
-
-                       return apiPromise
-                               .then( function ( data ) {
-                                       var exists = false;
-                                       if ( data.query && data.query.pages ) {
-                                               $.each( data.query.pages, function ( id, page ) {
-                                                       if ( page.categoryinfo ) {
-                                                               exists = true;
-                                                       }
-                                               } );
-                                       }
-                                       return exists;
-                               } )
-                               .promise( { abort: apiPromise.abort } );
-               },
-
-               /**
-                * Get a list of categories that match a certain prefix.
-                *
-                * E.g. given "Foo", return "Food", "Foolish people", "Foosball tables"...
-                *
-                * @param {string} prefix Prefix to match.
-                * @return {jQuery.Promise}
-                * @return {Function} return.done
-                * @return {string[]} return.done.categories Matched categories
-                */
-               getCategoriesByPrefix: function ( prefix ) {
-                       // Fetch with allpages to only get categories that have a corresponding description page.
-                       var apiPromise = this.get( {
-                               list: 'allpages',
-                               apprefix: prefix,
-                               apnamespace: mw.config.get( 'wgNamespaceIds' ).category
-                       } );
-
-                       return apiPromise
-                               .then( function ( data ) {
-                                       var texts = [];
-                                       if ( data.query && data.query.allpages ) {
-                                               $.each( data.query.allpages, function ( i, category ) {
-                                                       texts.push( new mw.Title( category.title ).getMainText() );
-                                               } );
-                                       }
-                                       return texts;
-                               } )
-                               .promise( { abort: apiPromise.abort } );
-               },
-
-               /**
-                * Get the categories that a particular page on the wiki belongs to.
-                *
-                * @param {mw.Title|string} title
-                * @return {jQuery.Promise}
-                * @return {Function} return.done
-                * @return {boolean|mw.Title[]} return.done.categories List of category titles or false
-                *  if title was not found.
-                */
-               getCategories: function ( title ) {
-                       var apiPromise = this.get( {
-                               prop: 'categories',
-                               titles: String( title )
-                       } );
-
-                       return apiPromise
-                               .then( function ( data ) {
-                                       var titles = false;
-                                       if ( data.query && data.query.pages ) {
-                                               $.each( data.query.pages, function ( id, page ) {
-                                                       if ( page.categories ) {
-                                                               if ( titles === false ) {
-                                                                       titles = [];
-                                                               }
-                                                               $.each( page.categories, function ( i, cat ) {
-                                                                       titles.push( new mw.Title( cat.title ) );
-                                                               } );
-                                                       }
-                                               } );
-                                       }
-                                       return titles;
-                               } )
-                               .promise( { abort: apiPromise.abort } );
-               }
-       } );
-
-       /**
-        * @class mw.Api
-        * @mixins mw.Api.plugin.category
-        */
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.api/mediawiki.api.edit.js b/resources/src/mediawiki.api/mediawiki.api.edit.js
deleted file mode 100644 (file)
index e43285f..0000000
+++ /dev/null
@@ -1,58 +0,0 @@
-/**
- * @class mw.Api.plugin.edit
- */
-( function ( mw, $ ) {
-
-       $.extend( mw.Api.prototype, {
-
-               /**
-                * Post to API with edit token. If we have no token, get one and try to post.
-                * If we have a cached token try using that, and if it fails, blank out the
-                * cached token and start over.
-                *
-                * @param {Object} params API parameters
-                * @param {Object} [ajaxOptions]
-                * @return {jQuery.Promise} See #post
-                */
-               postWithEditToken: function ( params, ajaxOptions ) {
-                       return this.postWithToken( 'edit', params, ajaxOptions );
-               },
-
-               /**
-                * API helper to grab an edit token.
-                *
-                * @return {jQuery.Promise}
-                * @return {Function} return.done
-                * @return {string} return.done.token Received token.
-                */
-               getEditToken: function () {
-                       return this.getToken( 'edit' );
-               },
-
-               /**
-                * Post a new section to the page.
-                *
-                * @see #postWithEditToken
-                * @param {mw.Title|String} title Target page
-                * @param {string} header
-                * @param {string} message wikitext message
-                * @param {Object} [additionalParams] Additional API parameters, e.g. `{ redirect: true }`
-                * @return {jQuery.Promise}
-                */
-               newSection: function ( title, header, message, additionalParams ) {
-                       return this.postWithEditToken( $.extend( {
-                               action: 'edit',
-                               section: 'new',
-                               title: String( title ),
-                               summary: header,
-                               text: message
-                       }, additionalParams ) );
-               }
-       } );
-
-       /**
-        * @class mw.Api
-        * @mixins mw.Api.plugin.edit
-        */
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.api/mediawiki.api.js b/resources/src/mediawiki.api/mediawiki.api.js
deleted file mode 100644 (file)
index 43b20b8..0000000
+++ /dev/null
@@ -1,416 +0,0 @@
-( function ( mw, $ ) {
-
-       /**
-        * @class mw.Api
-        */
-
-       /**
-        * @property {Object} defaultOptions Default options for #ajax calls. Can be overridden by passing
-        *     `options` to mw.Api constructor.
-        * @property {Object} defaultOptions.parameters Default query parameters for API requests.
-        * @property {Object} defaultOptions.ajax Default options for jQuery#ajax.
-        * @private
-        */
-       var defaultOptions = {
-                       parameters: {
-                               action: 'query',
-                               format: 'json'
-                       },
-                       ajax: {
-                               url: mw.util.wikiScript( 'api' ),
-                               timeout: 30 * 1000, // 30 seconds
-                               dataType: 'json'
-                       }
-               },
-
-               // Keyed by ajax url and symbolic name for the individual request
-               promises = {};
-
-       // Pre-populate with fake ajax promises to save http requests for tokens
-       // we already have on the page via the user.tokens module (bug 34733).
-       promises[ defaultOptions.ajax.url ] = {};
-       $.each( mw.user.tokens.get(), function ( key, value ) {
-               // This requires #getToken to use the same key as user.tokens.
-               // Format: token-type + "Token" (eg. editToken, patrolToken, watchToken).
-               promises[ defaultOptions.ajax.url ][ key ] = $.Deferred()
-                       .resolve( value )
-                       .promise( { abort: function () {} } );
-       } );
-
-       /**
-        * Constructor to create an object to interact with the API of a particular MediaWiki server.
-        * mw.Api objects represent the API of a particular MediaWiki server.
-        *
-        *     var api = new mw.Api();
-        *     api.get( {
-        *         action: 'query',
-        *         meta: 'userinfo'
-        *     } ).done( function ( data ) {
-        *         console.log( data );
-        *     } );
-        *
-        * Since MW 1.25, multiple values for a parameter can be specified using an array:
-        *
-        *     var api = new mw.Api();
-        *     api.get( {
-        *         action: 'query',
-        *         meta: [ 'userinfo', 'siteinfo' ] // same effect as 'userinfo|siteinfo'
-        *     } ).done( function ( data ) {
-        *         console.log( data );
-        *     } );
-        *
-        * Since MW 1.26, boolean values for a parameter can be specified directly. If the value is
-        * `false` or `undefined`, the parameter will be omitted from the request, as required by the API.
-        *
-        * @constructor
-        * @param {Object} [options] See #defaultOptions documentation above. Can also be overridden for
-        *  each individual request by passing them to #get or #post (or directly #ajax) later on.
-        */
-       mw.Api = function ( options ) {
-               // TODO: Share API objects with exact same config.
-               options = options || {};
-
-               // Force a string if we got a mw.Uri object
-               if ( options.ajax && options.ajax.url !== undefined ) {
-                       options.ajax.url = String( options.ajax.url );
-               }
-
-               options.parameters = $.extend( {}, defaultOptions.parameters, options.parameters );
-               options.ajax = $.extend( {}, defaultOptions.ajax, options.ajax );
-
-               this.defaults = options;
-       };
-
-       mw.Api.prototype = {
-
-               /**
-                * Perform API get request
-                *
-                * @param {Object} parameters
-                * @param {Object} [ajaxOptions]
-                * @return {jQuery.Promise}
-                */
-               get: function ( parameters, ajaxOptions ) {
-                       ajaxOptions = ajaxOptions || {};
-                       ajaxOptions.type = 'GET';
-                       return this.ajax( parameters, ajaxOptions );
-               },
-
-               /**
-                * Perform API post request
-                *
-                * TODO: Post actions for non-local hostnames will need proxy.
-                *
-                * @param {Object} parameters
-                * @param {Object} [ajaxOptions]
-                * @return {jQuery.Promise}
-                */
-               post: function ( parameters, ajaxOptions ) {
-                       ajaxOptions = ajaxOptions || {};
-                       ajaxOptions.type = 'POST';
-                       return this.ajax( parameters, ajaxOptions );
-               },
-
-               /**
-                * Massage parameters from the nice format we accept into a format suitable for the API.
-                *
-                * @private
-                * @param {Object} parameters (modified in-place)
-                */
-               preprocessParameters: function ( parameters ) {
-                       var key;
-                       // Handle common MediaWiki API idioms for passing parameters
-                       for ( key in parameters ) {
-                               // Multiple values are pipe-separated
-                               if ( $.isArray( parameters[ key ] ) ) {
-                                       parameters[ key ] = parameters[ key ].join( '|' );
-                               }
-                               // Boolean values are only false when not given at all
-                               if ( parameters[ key ] === false || parameters[ key ] === undefined ) {
-                                       delete parameters[ key ];
-                               }
-                       }
-               },
-
-               /**
-                * Perform the API call.
-                *
-                * @param {Object} parameters
-                * @param {Object} [ajaxOptions]
-                * @return {jQuery.Promise} Done: API response data and the jqXHR object.
-                *  Fail: Error code
-                */
-               ajax: function ( parameters, ajaxOptions ) {
-                       var token,
-                               apiDeferred = $.Deferred(),
-                               xhr, key, formData;
-
-                       parameters = $.extend( {}, this.defaults.parameters, parameters );
-                       ajaxOptions = $.extend( {}, this.defaults.ajax, ajaxOptions );
-
-                       // Ensure that token parameter is last (per [[mw:API:Edit#Token]]).
-                       if ( parameters.token ) {
-                               token = parameters.token;
-                               delete parameters.token;
-                       }
-
-                       this.preprocessParameters( parameters );
-
-                       // If multipart/form-data has been requested and emulation is possible, emulate it
-                       if (
-                               ajaxOptions.type === 'POST' &&
-                               window.FormData &&
-                               ajaxOptions.contentType === 'multipart/form-data'
-                       ) {
-
-                               formData = new FormData();
-
-                               for ( key in parameters ) {
-                                       formData.append( key, parameters[ key ] );
-                               }
-                               // If we extracted a token parameter, add it back in.
-                               if ( token ) {
-                                       formData.append( 'token', token );
-                               }
-
-                               ajaxOptions.data = formData;
-
-                               // Prevent jQuery from mangling our FormData object
-                               ajaxOptions.processData = false;
-                               // Prevent jQuery from overriding the Content-Type header
-                               ajaxOptions.contentType = false;
-                       } else {
-                               // Some deployed MediaWiki >= 1.17 forbid periods in URLs, due to an IE XSS bug
-                               // So let's escape them here. See bug #28235
-                               // This works because jQuery accepts data as a query string or as an Object
-                               ajaxOptions.data = $.param( parameters ).replace( /\./g, '%2E' );
-
-                               // If we extracted a token parameter, add it back in.
-                               if ( token ) {
-                                       ajaxOptions.data += '&token=' + encodeURIComponent( token );
-                               }
-
-                               if ( ajaxOptions.contentType === 'multipart/form-data' ) {
-                                       // We were asked to emulate but can't, so drop the Content-Type header, otherwise
-                                       // it'll be wrong and the server will fail to decode the POST body
-                                       delete ajaxOptions.contentType;
-                               }
-                       }
-
-                       // Make the AJAX request
-                       xhr = $.ajax( ajaxOptions )
-                               // If AJAX fails, reject API call with error code 'http'
-                               // and details in second argument.
-                               .fail( function ( xhr, textStatus, exception ) {
-                                       apiDeferred.reject( 'http', {
-                                               xhr: xhr,
-                                               textStatus: textStatus,
-                                               exception: exception
-                                       } );
-                               } )
-                               // AJAX success just means "200 OK" response, also check API error codes
-                               .done( function ( result, textStatus, jqXHR ) {
-                                       if ( result === undefined || result === null || result === '' ) {
-                                               apiDeferred.reject( 'ok-but-empty',
-                                                       'OK response but empty result (check HTTP headers?)'
-                                               );
-                                       } else if ( result.error ) {
-                                               var code = result.error.code === undefined ? 'unknown' : result.error.code;
-                                               apiDeferred.reject( code, result );
-                                       } else {
-                                               apiDeferred.resolve( result, jqXHR );
-                                       }
-                               } );
-
-                       // Return the Promise
-                       return apiDeferred.promise( { abort: xhr.abort } ).fail( function ( code, details ) {
-                               if ( !( code === 'http' && details && details.textStatus === 'abort' ) ) {
-                                       mw.log( 'mw.Api error: ', code, details );
-                               }
-                       } );
-               },
-
-               /**
-                * Post to API with specified type of token. If we have no token, get one and try to post.
-                * If we have a cached token try using that, and if it fails, blank out the
-                * cached token and start over. For example to change an user option you could do:
-                *
-                *     new mw.Api().postWithToken( 'options', {
-                *         action: 'options',
-                *         optionname: 'gender',
-                *         optionvalue: 'female'
-                *     } );
-                *
-                * @param {string} tokenType The name of the token, like options or edit.
-                * @param {Object} params API parameters
-                * @param {Object} [ajaxOptions]
-                * @return {jQuery.Promise} See #post
-                * @since 1.22
-                */
-               postWithToken: function ( tokenType, params, ajaxOptions ) {
-                       var api = this;
-
-                       return api.getToken( tokenType, params.assert ).then( function ( token ) {
-                               params.token = token;
-                               return api.post( params, ajaxOptions ).then(
-                                       // If no error, return to caller as-is
-                                       null,
-                                       // Error handler
-                                       function ( code ) {
-                                               if ( code === 'badtoken' ) {
-                                                       api.badToken( tokenType );
-                                                       // Try again, once
-                                                       params.token = undefined;
-                                                       return api.getToken( tokenType, params.assert ).then( function ( token ) {
-                                                               params.token = token;
-                                                               return api.post( params, ajaxOptions );
-                                                       } );
-                                               }
-
-                                               // Different error, pass on to let caller handle the error code
-                                               return this;
-                                       }
-                               );
-                       } );
-               },
-
-               /**
-                * Get a token for a certain action from the API.
-                *
-                * The assert parameter is only for internal use by postWithToken.
-                *
-                * @param {string} type Token type
-                * @return {jQuery.Promise}
-                * @return {Function} return.done
-                * @return {string} return.done.token Received token.
-                * @since 1.22
-                */
-               getToken: function ( type, assert ) {
-                       var apiPromise,
-                               promiseGroup = promises[ this.defaults.ajax.url ],
-                               d = promiseGroup && promiseGroup[ type + 'Token' ];
-
-                       if ( !d ) {
-                               apiPromise = this.get( { action: 'tokens', type: type, assert: assert } );
-
-                               d = apiPromise
-                                       .then( function ( data ) {
-                                               if ( data.tokens && data.tokens[ type + 'token' ] ) {
-                                                       return data.tokens[ type + 'token' ];
-                                               }
-
-                                               // If token type is not available for this user,
-                                               // key '...token' is either missing or set to boolean false
-                                               return $.Deferred().reject( 'token-missing', data );
-                                       }, function () {
-                                               // Clear promise. Do not cache errors.
-                                               delete promiseGroup[ type + 'Token' ];
-                                               // Pass on to allow the caller to handle the error
-                                               return this;
-                                       } )
-                                       // Attach abort handler
-                                       .promise( { abort: apiPromise.abort } );
-
-                               // Store deferred now so that we can use it again even if it isn't ready yet
-                               if ( !promiseGroup ) {
-                                       promiseGroup = promises[ this.defaults.ajax.url ] = {};
-                               }
-                               promiseGroup[ type + 'Token' ] = d;
-                       }
-
-                       return d;
-               },
-
-               /**
-                * Indicate that the cached token for a certain action of the API is bad.
-                *
-                * Call this if you get a 'badtoken' error when using the token returned by #getToken.
-                * You may also want to use #postWithToken instead, which invalidates bad cached tokens
-                * automatically.
-                *
-                * @param {string} type Token type
-                * @since 1.26
-                */
-               badToken: function ( type ) {
-                       var promiseGroup = promises[ this.defaults.ajax.url ];
-                       if ( promiseGroup ) {
-                               delete promiseGroup[ type + 'Token' ];
-                       }
-               }
-       };
-
-       /**
-        * @static
-        * @property {Array}
-        * List of errors we might receive from the API.
-        * For now, this just documents our expectation that there should be similar messages
-        * available.
-        */
-       mw.Api.errors = [
-               // occurs when POST aborted
-               // jQuery 1.4 can't distinguish abort or lost connection from 200 OK + empty result
-               'ok-but-empty',
-
-               // timeout
-               'timeout',
-
-               // really a warning, but we treat it like an error
-               'duplicate',
-               'duplicate-archive',
-
-               // upload succeeded, but no image info.
-               // this is probably impossible, but might as well check for it
-               'noimageinfo',
-               // remote errors, defined in API
-               'uploaddisabled',
-               'nomodule',
-               'mustbeposted',
-               'badaccess-groups',
-               'missingresult',
-               'missingparam',
-               'invalid-file-key',
-               'copyuploaddisabled',
-               'mustbeloggedin',
-               'empty-file',
-               'file-too-large',
-               'filetype-missing',
-               'filetype-banned',
-               'filetype-banned-type',
-               'filename-tooshort',
-               'illegal-filename',
-               'verification-error',
-               'hookaborted',
-               'unknown-error',
-               'internal-error',
-               'overwrite',
-               'badtoken',
-               'fetchfileerror',
-               'fileexists-shared-forbidden',
-               'invalidtitle',
-               'notloggedin',
-
-               // Stash-specific errors - expanded
-               'stashfailed',
-               'stasherror',
-               'stashedfilenotfound',
-               'stashpathinvalid',
-               'stashfilestorage',
-               'stashzerolength',
-               'stashnotloggedin',
-               'stashwrongowner',
-               'stashnosuchfilekey'
-       ];
-
-       /**
-        * @static
-        * @property {Array}
-        * List of warnings we might receive from the API.
-        * For now, this just documents our expectation that there should be similar messages
-        * available.
-        */
-       mw.Api.warnings = [
-               'duplicate',
-               'exists'
-       ];
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.api/mediawiki.api.login.js b/resources/src/mediawiki.api/mediawiki.api.login.js
deleted file mode 100644 (file)
index 2b709aa..0000000
+++ /dev/null
@@ -1,60 +0,0 @@
-/**
- * Make the two-step login easier.
- *
- * @author Niklas Laxström
- * @class mw.Api.plugin.login
- * @since 1.22
- */
-( function ( mw, $ ) {
-       'use strict';
-
-       $.extend( mw.Api.prototype, {
-               /**
-                * @param {string} username
-                * @param {string} password
-                * @return {jQuery.Promise} See mw.Api#post
-                */
-               login: function ( username, password ) {
-                       var params, apiPromise, innerPromise,
-                               api = this;
-
-                       params = {
-                               action: 'login',
-                               lgname: username,
-                               lgpassword: password
-                       };
-
-                       apiPromise = api.post( params );
-
-                       return apiPromise
-                               .then( function ( data ) {
-                                       params.lgtoken = data.login.token;
-                                       innerPromise = api.post( params )
-                                               .then( function ( data ) {
-                                                       var code;
-                                                       if ( data.login.result !== 'Success' ) {
-                                                               // Set proper error code whenever possible
-                                                               code = data.error && data.error.code || 'unknown';
-                                                               return $.Deferred().reject( code, data );
-                                                       }
-                                                       return data;
-                                               } );
-                                       return innerPromise;
-                               } )
-                               .promise( {
-                                       abort: function () {
-                                               apiPromise.abort();
-                                               if ( innerPromise ) {
-                                                       innerPromise.abort();
-                                               }
-                                       }
-                               } );
-               }
-       } );
-
-       /**
-        * @class mw.Api
-        * @mixins mw.Api.plugin.login
-        */
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.api/mediawiki.api.options.js b/resources/src/mediawiki.api/mediawiki.api.options.js
deleted file mode 100644 (file)
index 399e6f4..0000000
+++ /dev/null
@@ -1,89 +0,0 @@
-/**
- * @class mw.Api.plugin.options
- */
-( function ( mw, $ ) {
-
-       $.extend( mw.Api.prototype, {
-
-               /**
-                * Asynchronously save the value of a single user option using the API. See #saveOptions.
-                *
-                * @param {string} name
-                * @param {string|null} value
-                * @return {jQuery.Promise}
-                */
-               saveOption: function ( name, value ) {
-                       var param = {};
-                       param[ name ] = value;
-                       return this.saveOptions( param );
-               },
-
-               /**
-                * Asynchronously save the values of user options using the API.
-                *
-                * If a value of `null` is provided, the given option will be reset to the default value.
-                *
-                * Any warnings returned by the API, including warnings about invalid option names or values,
-                * are ignored. However, do not rely on this behavior.
-                *
-                * If necessary, the options will be saved using several parallel API requests. Only one promise
-                * is always returned that will be resolved when all requests complete.
-                *
-                * @param {Object} options Options as a `{ name: value, … }` object
-                * @return {jQuery.Promise}
-                */
-               saveOptions: function ( options ) {
-                       var name, value, bundleable,
-                               grouped = [],
-                               deferreds = [];
-
-                       for ( name in options ) {
-                               value = options[ name ] === null ? null : String( options[ name ] );
-
-                               // Can we bundle this option, or does it need a separate request?
-                               bundleable =
-                                       ( value === null || value.indexOf( '|' ) === -1 ) &&
-                                       ( name.indexOf( '|' ) === -1 && name.indexOf( '=' ) === -1 );
-
-                               if ( bundleable ) {
-                                       if ( value !== null ) {
-                                               grouped.push( name + '=' + value );
-                                       } else {
-                                               // Omitting value resets the option
-                                               grouped.push( name );
-                                       }
-                               } else {
-                                       if ( value !== null ) {
-                                               deferreds.push( this.postWithToken( 'options', {
-                                                       action: 'options',
-                                                       optionname: name,
-                                                       optionvalue: value
-                                               } ) );
-                                       } else {
-                                               // Omitting value resets the option
-                                               deferreds.push( this.postWithToken( 'options', {
-                                                       action: 'options',
-                                                       optionname: name
-                                               } ) );
-                                       }
-                               }
-                       }
-
-                       if ( grouped.length ) {
-                               deferreds.push( this.postWithToken( 'options', {
-                                       action: 'options',
-                                       change: grouped.join( '|' )
-                               } ) );
-                       }
-
-                       return $.when.apply( $, deferreds );
-               }
-
-       } );
-
-       /**
-        * @class mw.Api
-        * @mixins mw.Api.plugin.options
-        */
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.api/mediawiki.api.parse.js b/resources/src/mediawiki.api/mediawiki.api.parse.js
deleted file mode 100644 (file)
index bc3d44f..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-/**
- * @class mw.Api.plugin.parse
- */
-( function ( mw, $ ) {
-
-       $.extend( mw.Api.prototype, {
-               /**
-                * Convenience method for 'action=parse'.
-                *
-                * @param {string} wikitext
-                * @return {jQuery.Promise}
-                * @return {Function} return.done
-                * @return {string} return.done.data Parsed HTML of `wikitext`.
-                */
-               parse: function ( wikitext ) {
-                       var apiPromise = this.get( {
-                               action: 'parse',
-                               contentmodel: 'wikitext',
-                               text: wikitext
-                       } );
-
-                       return apiPromise
-                               .then( function ( data ) {
-                                       return data.parse.text[ '*' ];
-                               } )
-                               .promise( { abort: apiPromise.abort } );
-               }
-       } );
-
-       /**
-        * @class mw.Api
-        * @mixins mw.Api.plugin.parse
-        */
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.api/mediawiki.api.upload.js b/resources/src/mediawiki.api/mediawiki.api.upload.js
deleted file mode 100644 (file)
index 4abff28..0000000
+++ /dev/null
@@ -1,368 +0,0 @@
-/**
- * Provides an interface for uploading files to MediaWiki.
- *
- * @class mw.Api.plugin.upload
- * @singleton
- */
-( function ( mw, $ ) {
-       var nonce = 0,
-               fieldsAllowed = {
-                       stash: true,
-                       filekey: true,
-                       filename: true,
-                       comment: true,
-                       text: true,
-                       watchlist: true,
-                       ignorewarnings: true
-               };
-
-       /**
-        * @private
-        * Get nonce for iframe IDs on the page.
-        *
-        * @return {number}
-        */
-       function getNonce() {
-               return nonce++;
-       }
-
-       /**
-        * @private
-        * Get new iframe object for an upload.
-        *
-        * @return {HTMLIframeElement}
-        */
-       function getNewIframe( id ) {
-               var frame = document.createElement( 'iframe' );
-               frame.id = id;
-               frame.name = id;
-               return frame;
-       }
-
-       /**
-        * @private
-        * Shortcut for getting hidden inputs
-        *
-        * @return {jQuery}
-        */
-       function getHiddenInput( name, val ) {
-               return $( '<input type="hidden" />' )
-                       .attr( 'name', name )
-                       .val( val );
-       }
-
-       /**
-        * Process the result of the form submission, returned to an iframe.
-        * This is the iframe's onload event.
-        *
-        * @param {HTMLIframeElement} iframe Iframe to extract result from
-        * @return {Object} Response from the server. The return value may or may
-        *   not be an XMLDocument, this code was copied from elsewhere, so if you
-        *   see an unexpected return type, please file a bug.
-        */
-       function processIframeResult( iframe ) {
-               var json,
-                       doc = iframe.contentDocument || frames[ iframe.id ].document;
-
-               if ( doc.XMLDocument ) {
-                       // The response is a document property in IE
-                       return doc.XMLDocument;
-               }
-
-               if ( doc.body ) {
-                       // Get the json string
-                       // We're actually searching through an HTML doc here --
-                       // according to mdale we need to do this
-                       // because IE does not load JSON properly in an iframe
-                       json = $( doc.body ).find( 'pre' ).text();
-
-                       return JSON.parse( json );
-               }
-
-               // Response is a xml document
-               return doc;
-       }
-
-       function formDataAvailable() {
-               return window.FormData !== undefined &&
-                       window.File !== undefined &&
-                       window.File.prototype.slice !== undefined;
-       }
-
-       $.extend( mw.Api.prototype, {
-               /**
-                * Upload a file to MediaWiki.
-                *
-                * The file will be uploaded using AJAX and FormData, if the browser supports it, or via an
-                * iframe if it doesn't.
-                *
-                * Caveats of iframe upload:
-                * - The returned jQuery.Promise will not receive `progress` notifications during the upload
-                * - It is incompatible with uploads to a foreign wiki using mw.ForeignApi
-                * - You must pass a HTMLInputElement and not a File for it to be possible
-                *
-                * @param {HTMLInputElement|File} file HTML input type=file element with a file already inside
-                *     of it, or a File object.
-                * @param {Object} data Other upload options, see action=upload API docs for more
-                * @return {jQuery.Promise}
-                */
-               upload: function ( file, data ) {
-                       var isFileInput, canUseFormData;
-
-                       isFileInput = file && file.nodeType === Node.ELEMENT_NODE;
-
-                       if ( formDataAvailable() && isFileInput && file.files ) {
-                               file = file.files[ 0 ];
-                       }
-
-                       if ( !file ) {
-                               return $.Deferred().reject( 'No file' );
-                       }
-
-                       canUseFormData = formDataAvailable() && file instanceof window.File;
-
-                       if ( !isFileInput && !canUseFormData ) {
-                               return $.Deferred().reject( 'Unsupported argument type passed to mw.Api.upload' );
-                       }
-
-                       if ( canUseFormData ) {
-                               return this.uploadWithFormData( file, data );
-                       }
-
-                       return this.uploadWithIframe( file, data );
-               },
-
-               /**
-                * Upload a file to MediaWiki with an iframe and a form.
-                *
-                * This method is necessary for browsers without the File/FormData
-                * APIs, and continues to work in browsers with those APIs.
-                *
-                * The rough sketch of how this method works is as follows:
-                * 1. An iframe is loaded with no content.
-                * 2. A form is submitted with the passed-in file input and some extras.
-                * 3. The MediaWiki API receives that form data, and sends back a response.
-                * 4. The response is sent to the iframe, because we set target=(iframe id)
-                * 5. The response is parsed out of the iframe's document, and passed back
-                *    through the promise.
-                *
-                * @private
-                * @param {HTMLInputElement} file The file input with a file in it.
-                * @param {Object} data Other upload options, see action=upload API docs for more
-                * @return {jQuery.Promise}
-                */
-               uploadWithIframe: function ( file, data ) {
-                       var key,
-                               tokenPromise = $.Deferred(),
-                               api = this,
-                               deferred = $.Deferred(),
-                               nonce = getNonce(),
-                               id = 'uploadframe-' + nonce,
-                               $form = $( '<form>' ),
-                               iframe = getNewIframe( id ),
-                               $iframe = $( iframe );
-
-                       for ( key in data ) {
-                               if ( !fieldsAllowed[ key ] ) {
-                                       delete data[ key ];
-                               }
-                       }
-
-                       data = $.extend( {}, this.defaults.parameters, { action: 'upload' }, data );
-                       $form.addClass( 'mw-api-upload-form' );
-
-                       $form.css( 'display', 'none' )
-                               .attr( {
-                                       action: this.defaults.ajax.url,
-                                       method: 'POST',
-                                       target: id,
-                                       enctype: 'multipart/form-data'
-                               } );
-
-                       $iframe.one( 'load', function () {
-                               $iframe.one( 'load', function () {
-                                       var result = processIframeResult( iframe );
-
-                                       if ( !result ) {
-                                               deferred.reject( 'No response from API on upload attempt.' );
-                                       } else if ( result.error || result.warnings ) {
-                                               if ( result.error && result.error.code === 'badtoken' ) {
-                                                       api.badToken( 'edit' );
-                                               }
-
-                                               deferred.reject( result.error || result.warnings );
-                                       } else {
-                                               deferred.notify( 1 );
-                                               deferred.resolve( result );
-                                       }
-                               } );
-                               tokenPromise.done( function () {
-                                       $form.submit();
-                               } );
-                       } );
-
-                       $iframe.error( function ( error ) {
-                               deferred.reject( 'iframe failed to load: ' + error );
-                       } );
-
-                       $iframe.prop( 'src', 'about:blank' ).hide();
-
-                       file.name = 'file';
-
-                       $.each( data, function ( key, val ) {
-                               $form.append( getHiddenInput( key, val ) );
-                       } );
-
-                       if ( !data.filename && !data.stash ) {
-                               return $.Deferred().reject( 'Filename not included in file data.' );
-                       }
-
-                       if ( this.needToken() ) {
-                               this.getEditToken().then( function ( token ) {
-                                       $form.append( getHiddenInput( 'token', token ) );
-                                       tokenPromise.resolve();
-                               }, tokenPromise.reject );
-                       } else {
-                               tokenPromise.resolve();
-                       }
-
-                       $( 'body' ).append( $form, $iframe );
-
-                       deferred.always( function () {
-                               $form.remove();
-                               $iframe.remove();
-                       } );
-
-                       return deferred.promise();
-               },
-
-               /**
-                * Uploads a file using the FormData API.
-                *
-                * @private
-                * @param {File} file
-                * @param {Object} data Other upload options, see action=upload API docs for more
-                * @return {jQuery.Promise}
-                */
-               uploadWithFormData: function ( file, data ) {
-                       var key,
-                               deferred = $.Deferred();
-
-                       for ( key in data ) {
-                               if ( !fieldsAllowed[ key ] ) {
-                                       delete data[ key ];
-                               }
-                       }
-
-                       data = $.extend( {}, this.defaults.parameters, { action: 'upload' }, data );
-                       data.file = file;
-
-                       if ( !data.filename && !data.stash ) {
-                               return $.Deferred().reject( 'Filename not included in file data.' );
-                       }
-
-                       // Use this.postWithEditToken() or this.post()
-                       this[ this.needToken() ? 'postWithEditToken' : 'post' ]( data, {
-                               // Use FormData (if we got here, we know that it's available)
-                               contentType: 'multipart/form-data',
-                               // Provide upload progress notifications
-                               xhr: function () {
-                                       var xhr = $.ajaxSettings.xhr();
-                                       if ( xhr.upload ) {
-                                               // need to bind this event before we open the connection (see note at
-                                               // https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress)
-                                               xhr.upload.addEventListener( 'progress', function ( ev ) {
-                                                       if ( ev.lengthComputable ) {
-                                                               deferred.notify( ev.loaded / ev.total );
-                                                       }
-                                               } );
-                                       }
-                                       return xhr;
-                               }
-                       } )
-                               .done( function ( result ) {
-                                       if ( result.error || result.warnings ) {
-                                               deferred.reject( result.error || result.warnings );
-                                       } else {
-                                               deferred.notify( 1 );
-                                               deferred.resolve( result );
-                                       }
-                               } )
-                               .fail( function ( result ) {
-                                       deferred.reject( result );
-                               } );
-
-                       return deferred.promise();
-               },
-
-               /**
-                * Upload a file to the stash.
-                *
-                * This function will return a promise, which when resolved, will pass back a function
-                * to finish the stash upload. You can call that function with an argument containing
-                * more, or conflicting, data to pass to the server. For example:
-                *
-                *     // upload a file to the stash with a placeholder filename
-                *     api.uploadToStash( file, { filename: 'testing.png' } ).done( function ( finish ) {
-                *         // finish is now the function we can use to finalize the upload
-                *         // pass it a new filename from user input to override the initial value
-                *         finish( { filename: getFilenameFromUser() } ).done( function ( data ) {
-                *             // the upload is complete, data holds the API response
-                *         } );
-                *     } );
-                *
-                * @param {File|HTMLInputElement} file
-                * @param {Object} [data]
-                * @return {jQuery.Promise}
-                * @return {Function} return.finishStashUpload Call this function to finish the upload.
-                * @return {Object} return.finishStashUpload.data Additional data for the upload.
-                * @return {jQuery.Promise} return.finishStashUpload.return API promise for the final upload
-                * @return {Object} return.finishStashUpload.return.data API return value for the final upload
-                */
-               uploadToStash: function ( file, data ) {
-                       var filekey,
-                               api = this;
-
-                       if ( !data.filename ) {
-                               return $.Deferred().reject( 'Filename not included in file data.' );
-                       }
-
-                       function finishUpload( moreData ) {
-                               data = $.extend( data, moreData );
-                               data.filekey = filekey;
-                               data.action = 'upload';
-                               data.format = 'json';
-
-                               if ( !data.filename ) {
-                                       return $.Deferred().reject( 'Filename not included in file data.' );
-                               }
-
-                               return api.postWithEditToken( data ).then( function ( result ) {
-                                       if ( result.upload && ( result.upload.error || result.upload.warnings ) ) {
-                                               return $.Deferred().reject( result.upload.error || result.upload.warnings ).promise();
-                                       }
-                                       return result;
-                               } );
-                       }
-
-                       return this.upload( file, { stash: true, filename: data.filename } ).then( function ( result ) {
-                               if ( result && result.upload && result.upload.filekey ) {
-                                       filekey = result.upload.filekey;
-                               } else if ( result && ( result.error || result.warning ) ) {
-                                       return $.Deferred().reject( result );
-                               }
-
-                               return finishUpload;
-                       } );
-               },
-
-               needToken: function () {
-                       return true;
-               }
-       } );
-
-       /**
-        * @class mw.Api
-        * @mixins mw.Api.plugin.upload
-        */
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.api/mediawiki.api.watch.js b/resources/src/mediawiki.api/mediawiki.api.watch.js
deleted file mode 100644 (file)
index a2ff129..0000000
+++ /dev/null
@@ -1,70 +0,0 @@
-/**
- * @class mw.Api.plugin.watch
- * @since 1.19
- */
-( function ( mw, $ ) {
-
-       /**
-        * @private
-        * @static
-        * @context mw.Api
-        *
-        * @param {string|mw.Title|string[]|mw.Title[]} pages Full page name or instance of mw.Title, or an
-        *  array thereof. If an array is passed, the return value passed to the promise will also be an
-        *  array of appropriate objects.
-        * @return {jQuery.Promise}
-        * @return {Function} return.done
-        * @return {Object|Object[]} return.done.watch Object or list of objects (depends on the `pages`
-        *  parameter)
-        * @return {string} return.done.watch.title Full pagename
-        * @return {boolean} return.done.watch.watched Whether the page is now watched or unwatched
-        * @return {string} return.done.watch.message Parsed HTML of the confirmational interface message
-        */
-       function doWatchInternal( pages, addParams ) {
-               // XXX: Parameter addParams is undocumented because we inherit this
-               // documentation in the public method...
-               var apiPromise = this.postWithToken( 'watch',
-                       $.extend(
-                               {
-                                       action: 'watch',
-                                       titles: $.isArray( pages ) ? pages.join( '|' ) : String( pages ),
-                                       uselang: mw.config.get( 'wgUserLanguage' )
-                               },
-                               addParams
-                       )
-               );
-
-               return apiPromise
-                       .then( function ( data ) {
-                               // If a single page was given (not an array) respond with a single item as well.
-                               return $.isArray( pages ) ? data.watch : data.watch[ 0 ];
-                       } )
-                       .promise( { abort: apiPromise.abort } );
-       }
-
-       $.extend( mw.Api.prototype, {
-               /**
-                * Convenience method for `action=watch`.
-                *
-                * @inheritdoc #doWatchInternal
-                */
-               watch: function ( pages ) {
-                       return doWatchInternal.call( this, pages );
-               },
-
-               /**
-                * Convenience method for `action=watch&unwatch=1`.
-                *
-                * @inheritdoc #doWatchInternal
-                */
-               unwatch: function ( pages ) {
-                       return doWatchInternal.call( this, pages, { unwatch: 1 } );
-               }
-       } );
-
-       /**
-        * @class mw.Api
-        * @mixins mw.Api.plugin.watch
-        */
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.css b/resources/src/mediawiki.page/mediawiki.page.gallery.css
deleted file mode 100644 (file)
index 20deb21..0000000
+++ /dev/null
@@ -1,101 +0,0 @@
-/* Galleries */
-/* These display attributes look nonsensical, but are needed to support IE and FF2 */
-/* Don't forget to update mediawiki.page.gallery.print.css */
-li.gallerybox {
-       vertical-align: top;
-       display: -moz-inline-box;
-       display: inline-block;
-}
-
-ul.gallery,
-li.gallerybox {
-       zoom: 1;
-       *display: inline;
-}
-
-ul.gallery {
-       margin: 2px;
-       padding: 2px;
-       display: block;
-}
-
-li.gallerycaption {
-       font-weight: bold;
-       text-align: center;
-       display: block;
-       word-wrap: break-word;
-}
-
-li.gallerybox div.thumb {
-       text-align: center;
-       border: 1px solid #ccc;
-       background-color: #f9f9f9;
-       margin: 2px;
-}
-
-li.gallerybox div.thumb img {
-       display: block;
-       margin: 0 auto;
-}
-
-div.gallerytext {
-       overflow: hidden;
-       font-size: 94%;
-       padding: 2px 4px;
-       word-wrap: break-word;
-}
-
-/* new gallery stuff */
-ul.mw-gallery-nolines li.gallerybox div.thumb {
-       background-color: transparent;
-       border: none;
-}
-
-ul.mw-gallery-nolines li.gallerybox div.gallerytext {
-       text-align: center;
-}
-
-/* height constrained gallery */
-
-ul.mw-gallery-packed li.gallerybox div.thumb,
-ul.mw-gallery-packed-overlay li.gallerybox div.thumb,
-ul.mw-gallery-packed-hover li.gallerybox div.thumb {
-       background-color: transparent;
-       border: none;
-}
-
-ul.mw-gallery-packed li.gallerybox div.thumb img,
-ul.mw-gallery-packed-overlay li.gallerybox div.thumb img,
-ul.mw-gallery-packed-hover li.gallerybox div.thumb img {
-       margin: 0 auto;
-}
-
-ul.mw-gallery-packed-hover li.gallerybox,
-ul.mw-gallery-packed-overlay li.gallerybox {
-       position: relative;
-}
-
-ul.mw-gallery-packed-hover div.gallerytextwrapper {
-       overflow: hidden;
-       height: 0;
-}
-
-ul.mw-gallery-packed-hover li.gallerybox:hover div.gallerytextwrapper,
-ul.mw-gallery-packed-overlay li.gallerybox div.gallerytextwrapper,
-ul.mw-gallery-packed-hover li.gallerybox.mw-gallery-focused div.gallerytextwrapper {
-       position: absolute;
-       background: white;
-       background: rgba(255, 255, 255, 0.8);
-       padding: 5px 10px;
-       bottom: 0;
-       left: 0; /* Needed for IE */
-       height: auto;
-       font-weight: bold;
-       margin: 2px; /* correspond to style on div.thumb */
-}
-
-ul.mw-gallery-packed-hover,
-ul.mw-gallery-packed-overlay,
-ul.mw-gallery-packed {
-       text-align: center;
-}
diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.js b/resources/src/mediawiki.page/mediawiki.page.gallery.js
deleted file mode 100644 (file)
index dfccf21..0000000
+++ /dev/null
@@ -1,268 +0,0 @@
-/*!
- * Show gallery captions when focused. Copied directly from jquery.mw-jump.js.
- * Also Dynamically resize images to justify them.
- */
-( function ( mw, $ ) {
-       var $galleries,
-               bound = false,
-               // Is there a better way to detect a touchscreen? Current check taken from stack overflow.
-               isTouchScreen = !!( window.ontouchstart !== undefined ||
-                       window.DocumentTouch !== undefined && document instanceof window.DocumentTouch
-               );
-
-       /**
-        * Perform the layout justification.
-        *
-        * @ignore
-        * @context {HTMLElement} A `ul.mw-gallery-*` element
-        */
-       function justify() {
-               var lastTop,
-                       $img,
-                       imgWidth,
-                       imgHeight,
-                       captionWidth,
-                       rows = [],
-                       $gallery = $( this );
-
-               $gallery.children( 'li' ).each( function () {
-                       // Math.floor to be paranoid if things are off by 0.00000000001
-                       var top = Math.floor( $( this ).position().top ),
-                               $this = $( this );
-
-                       if ( top !== lastTop ) {
-                               rows[ rows.length ] = [];
-                               lastTop = top;
-                       }
-
-                       $img = $this.find( 'div.thumb a.image img' );
-                       if ( $img.length && $img[ 0 ].height ) {
-                               imgHeight = $img[ 0 ].height;
-                               imgWidth = $img[ 0 ].width;
-                       } else {
-                               // If we don't have a real image, get the containing divs width/height.
-                               // Note that if we do have a real image, using this method will generally
-                               // give the same answer, but can be different in the case of a very
-                               // narrow image where extra padding is added.
-                               imgHeight = $this.children().children( 'div:first' ).height();
-                               imgWidth = $this.children().children( 'div:first' ).width();
-                       }
-
-                       // Hack to make an edge case work ok
-                       if ( imgHeight < 30 ) {
-                               // Don't try and resize this item.
-                               imgHeight = 0;
-                       }
-
-                       captionWidth = $this.children().children( 'div.gallerytextwrapper' ).width();
-                       rows[ rows.length - 1 ][ rows[ rows.length - 1 ].length ] = {
-                               $elm: $this,
-                               width: $this.outerWidth(),
-                               imgWidth: imgWidth,
-                               // XXX: can divide by 0 ever happen?
-                               aspect: imgWidth / imgHeight,
-                               captionWidth: captionWidth,
-                               height: imgHeight
-                       };
-
-                       // Save all boundaries so we can restore them on window resize
-                       $this.data( 'imgWidth', imgWidth );
-                       $this.data( 'imgHeight', imgHeight );
-                       $this.data( 'width', $this.outerWidth() );
-                       $this.data( 'captionWidth', captionWidth );
-               } );
-
-               ( function () {
-                       var maxWidth,
-                               combinedAspect,
-                               combinedPadding,
-                               curRow,
-                               curRowHeight,
-                               wantedWidth,
-                               preferredHeight,
-                               newWidth,
-                               padding,
-                               $outerDiv,
-                               $innerDiv,
-                               $imageDiv,
-                               $imageElm,
-                               imageElm,
-                               $caption,
-                               i,
-                               j,
-                               avgZoom,
-                               totalZoom = 0;
-
-                       for ( i = 0; i < rows.length; i++ ) {
-                               maxWidth = $gallery.width();
-                               combinedAspect = 0;
-                               combinedPadding = 0;
-                               curRow = rows[ i ];
-                               curRowHeight = 0;
-
-                               for ( j = 0; j < curRow.length; j++ ) {
-                                       if ( curRowHeight === 0 ) {
-                                               if ( isFinite( curRow[ j ].height ) ) {
-                                                       // Get the height of this row, by taking the first
-                                                       // non-out of bounds height
-                                                       curRowHeight = curRow[ j ].height;
-                                               }
-                                       }
-
-                                       if ( curRow[ j ].aspect === 0 || !isFinite( curRow[ j ].aspect ) ) {
-                                               // One of the dimensions are 0. Probably should
-                                               // not try to resize.
-                                               combinedPadding += curRow[ j ].width;
-                                       } else {
-                                               combinedAspect += curRow[ j ].aspect;
-                                               combinedPadding += curRow[ j ].width - curRow[ j ].imgWidth;
-                                       }
-                               }
-
-                               // Add some padding for inter-element spacing.
-                               combinedPadding += 5 * curRow.length;
-                               wantedWidth = maxWidth - combinedPadding;
-                               preferredHeight = wantedWidth / combinedAspect;
-
-                               if ( preferredHeight > curRowHeight * 1.5 ) {
-                                       // Only expand at most 1.5 times current size
-                                       // As that's as high a resolution as we have.
-                                       // Also on the off chance there is a bug in this
-                                       // code, would prevent accidentally expanding to
-                                       // be 10 billion pixels wide.
-                                       if ( i === rows.length - 1 ) {
-                                               // If its the last row, and we can't fit it,
-                                               // don't make the entire row huge.
-                                               avgZoom = ( totalZoom / ( rows.length - 1 ) ) * curRowHeight;
-                                               if ( isFinite( avgZoom ) && avgZoom >= 1 && avgZoom <= 1.5 ) {
-                                                       preferredHeight = avgZoom;
-                                               } else {
-                                                       // Probably a single row gallery
-                                                       preferredHeight = curRowHeight;
-                                               }
-                                       } else {
-                                               preferredHeight = 1.5 * curRowHeight;
-                                       }
-                               }
-                               if ( !isFinite( preferredHeight ) ) {
-                                       // This *definitely* should not happen.
-                                       // Skip this row.
-                                       continue;
-                               }
-                               if ( preferredHeight < 5 ) {
-                                       // Well something clearly went wrong...
-                                       // Skip this row.
-                                       continue;
-                               }
-
-                               if ( preferredHeight / curRowHeight > 1 ) {
-                                       totalZoom += preferredHeight / curRowHeight;
-                               } else {
-                                       // If we shrink, still consider that a zoom of 1
-                                       totalZoom += 1;
-                               }
-
-                               for ( j = 0; j < curRow.length; j++ ) {
-                                       newWidth = preferredHeight * curRow[ j ].aspect;
-                                       padding = curRow[ j ].width - curRow[ j ].imgWidth;
-                                       $outerDiv = curRow[ j ].$elm;
-                                       $innerDiv = $outerDiv.children( 'div' ).first();
-                                       $imageDiv = $innerDiv.children( 'div.thumb' );
-                                       $imageElm = $imageDiv.find( 'img' ).first();
-                                       imageElm = $imageElm.length ? $imageElm[ 0 ] : null;
-                                       $caption = $outerDiv.find( 'div.gallerytextwrapper' );
-
-                                       // Since we are going to re-adjust the height, the vertical
-                                       // centering margins need to be reset.
-                                       $imageDiv.children( 'div' ).css( 'margin', '0px auto' );
-
-                                       if ( newWidth < 60 || !isFinite( newWidth ) ) {
-                                               // Making something skinnier than this will mess up captions,
-                                               if ( newWidth < 1 || !isFinite( newWidth ) ) {
-                                                       $innerDiv.height( preferredHeight );
-                                                       // Don't even try and touch the image size if it could mean
-                                                       // making it disappear.
-                                                       continue;
-                                               }
-                                       } else {
-                                               $outerDiv.width( newWidth + padding );
-                                               $innerDiv.width( newWidth + padding );
-                                               $imageDiv.width( newWidth );
-                                               $caption.width( curRow[ j ].captionWidth + ( newWidth - curRow[ j ].imgWidth ) );
-                                       }
-
-                                       if ( imageElm ) {
-                                               // We don't always have an img, e.g. in the case of an invalid file.
-                                               imageElm.width = newWidth;
-                                               imageElm.height = preferredHeight;
-                                       } else {
-                                               // Not a file box.
-                                               $imageDiv.height( preferredHeight );
-                                       }
-                               }
-                       }
-               }() );
-       }
-
-       function handleResizeStart() {
-               $galleries.children( 'li' ).each( function () {
-                       var imgWidth = $( this ).data( 'imgWidth' ),
-                               imgHeight = $( this ).data( 'imgHeight' ),
-                               width = $( this ).data( 'width' ),
-                               captionWidth = $( this ).data( 'captionWidth' ),
-                               $innerDiv = $( this ).children( 'div' ).first(),
-                               $imageDiv = $innerDiv.children( 'div.thumb' ),
-                               $imageElm, imageElm;
-
-                       // Restore original sizes so we can arrange the elements as on freshly loaded page
-                       $( this ).width( width );
-                       $innerDiv.width( width );
-                       $imageDiv.width( imgWidth );
-                       $( this ).find( 'div.gallerytextwrapper' ).width( captionWidth );
-
-                       $imageElm = $( this ).find( 'img' ).first();
-                       imageElm = $imageElm.length ? $imageElm[ 0 ] : null;
-                       if ( imageElm ) {
-                               imageElm.width = imgWidth;
-                               imageElm.height = imgHeight;
-                       } else {
-                               $imageDiv.height( imgHeight );
-                       }
-               } );
-       }
-
-       function handleResizeEnd() {
-               $galleries.each( justify );
-       }
-
-       mw.hook( 'wikipage.content' ).add( function ( $content ) {
-               if ( isTouchScreen ) {
-                       // Always show the caption for a touch screen.
-                       $content.find( 'ul.mw-gallery-packed-hover' )
-                               .addClass( 'mw-gallery-packed-overlay' )
-                               .removeClass( 'mw-gallery-packed-hover' );
-               } else {
-                       // Note use of just "a", not a.image, since we want this to trigger if a link in
-                       // the caption receives focus
-                       $content.find( 'ul.mw-gallery-packed-hover li.gallerybox' ).on( 'focus blur', 'a', function ( e ) {
-                               // Confusingly jQuery leaves e.type as focusout for delegated blur events
-                               var gettingFocus = e.type !== 'blur' && e.type !== 'focusout';
-                               $( this ).closest( 'li.gallerybox' ).toggleClass( 'mw-gallery-focused', gettingFocus );
-                       } );
-               }
-
-               $galleries = $content.find( 'ul.mw-gallery-packed-overlay, ul.mw-gallery-packed-hover, ul.mw-gallery-packed' );
-               // Call the justification asynchronous because live preview fires the hook with detached $content.
-               setTimeout( function () {
-                       $galleries.each( justify );
-
-                       // Bind here instead of in the top scope as the callbacks use $galleries.
-                       if ( !bound ) {
-                               bound = true;
-                               $( window )
-                                       .resize( $.debounce( 300, true, handleResizeStart ) )
-                                       .resize( $.debounce( 300, handleResizeEnd ) );
-                       }
-               } );
-       } );
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.page/mediawiki.page.gallery.print.css b/resources/src/mediawiki.page/mediawiki.page.gallery.print.css
deleted file mode 100644 (file)
index 0c14865..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-li.gallerybox {
-       vertical-align: top;
-       display: inline-block;
-}
-
-ul.gallery, li.gallerybox {
-       zoom: 1;
-       *display: inline;
-}
-
-ul.gallery {
-       margin: 2px;
-       padding: 2px;
-       display: block;
-}
-
-li.gallerycaption {
-       font-weight: bold;
-       text-align: center;
-       display: block;
-       word-wrap: break-word;
-}
-
-li.gallerybox div.thumb {
-       text-align: center;
-       border: 1px solid #ccc;
-       margin: 2px;
-}
-
-div.gallerytext {
-       overflow: hidden;
-       font-size: 94%;
-       padding: 2px 4px;
-       word-wrap: break-word;
-}
diff --git a/resources/src/mediawiki.page/mediawiki.page.image.pagination.js b/resources/src/mediawiki.page/mediawiki.page.image.pagination.js
deleted file mode 100644 (file)
index 49a51df..0000000
+++ /dev/null
@@ -1,143 +0,0 @@
-/*!
- * Implement AJAX navigation for multi-page images so the user may browse without a full page reload.
- */
-( function ( mw, $ ) {
-       /*jshint latedef:false */
-       var jqXhr, $multipageimage, $spinner,
-               cache = {},
-               cacheOrder = [];
-
-       /* Fetch the next page, caching up to 10 last-loaded pages.
-        * @param {string} url
-        * @return {jQuery.Promise}
-        */
-       function fetchPageData( url ) {
-               if ( jqXhr && jqXhr.abort ) {
-                       // Prevent race conditions and piling up pending requests
-                       jqXhr.abort();
-               }
-               jqXhr = undefined;
-
-               // Try the cache
-               if ( cache[ url ] ) {
-                       // Update access freshness
-                       cacheOrder.splice( $.inArray( url, cacheOrder ), 1 );
-                       cacheOrder.push( url );
-                       return $.Deferred().resolve( cache[ url ] ).promise();
-               }
-
-               // @todo Don't fetch the entire page. Ideally we'd only fetch the content portion or the data
-               // (thumbnail urls) and update the interface manually.
-               jqXhr = $.ajax( url ).then( function ( data ) {
-                       return $( data ).find( 'table.multipageimage' ).contents();
-               } );
-
-               // Handle cache updates
-               jqXhr.done( function ( $contents ) {
-                       jqXhr = undefined;
-
-                       // Cache the newly loaded page
-                       cache[ url ] = $contents;
-                       cacheOrder.push( url );
-
-                       // Remove the oldest entry if we're over the limit
-                       if ( cacheOrder.length > 10 ) {
-                               delete cache[ cacheOrder[ 0 ] ];
-                               cacheOrder = cacheOrder.slice( 1 );
-                       }
-               } );
-
-               return jqXhr.promise();
-       }
-
-       /* Fetch the next page and use jQuery to swap the table.multipageimage contents.
-        * @param {string} url
-        * @param {boolean} [hist=false] Whether this is a load triggered by history navigation (if
-        *   true, this function won't push a new history state, for the browser did so already).
-        */
-       function switchPage( url, hist ) {
-               var $tr, promise;
-
-               // Start fetching data (might be cached)
-               promise = fetchPageData( url );
-
-               // Add a new spinner if one doesn't already exist and the data is not already ready
-               if ( !$spinner && promise.state() !== 'resolved' ) {
-                       $tr = $multipageimage.find( 'tr' );
-                       $spinner = $.createSpinner( {
-                               size: 'large',
-                               type: 'block'
-                       } )
-                               // Copy the old content dimensions equal so that the current scroll position is not
-                               // lost between emptying the table is and receiving the new contents.
-                               .css( {
-                                       height: $tr.outerHeight(),
-                                       width: $tr.outerWidth()
-                               } );
-
-                       $multipageimage.empty().append( $spinner );
-               }
-
-               promise.done( function ( $contents ) {
-                       $spinner = undefined;
-
-                       // Replace table contents
-                       $multipageimage.empty().append( $contents.clone() );
-
-                       bindPageNavigation( $multipageimage );
-
-                       // Fire hook because the page's content has changed
-                       mw.hook( 'wikipage.content' ).fire( $multipageimage );
-
-                       // Update browser history and address bar. But not if we came here from a history
-                       // event, in which case the url is already updated by the browser.
-                       if ( history.pushState && !hist ) {
-                               history.pushState( { tag: 'mw-pagination' }, document.title, url );
-                       }
-               } );
-       }
-
-       function bindPageNavigation( $container ) {
-               $container.find( '.multipageimagenavbox' ).one( 'click', 'a', function ( e ) {
-                       var page, uri;
-
-                       // Generate the same URL on client side as the one generated in ImagePage::openShowImage.
-                       // We avoid using the URL in the link directly since it could have been manipulated (bug 66608)
-                       page = Number( mw.util.getParamValue( 'page', this.href ) );
-                       uri = new mw.Uri( mw.util.wikiScript() )
-                               .extend( { title: mw.config.get( 'wgPageName' ), page: page } )
-                               .toString();
-
-                       switchPage( uri );
-                       e.preventDefault();
-               } );
-
-               $container.find( 'form[name="pageselector"]' ).one( 'change submit', function ( e ) {
-                       switchPage( this.action + '?' + $( this ).serialize() );
-                       e.preventDefault();
-               } );
-       }
-
-       $( function () {
-               if ( mw.config.get( 'wgNamespaceNumber' ) !== 6 ) {
-                       return;
-               }
-               $multipageimage = $( 'table.multipageimage' );
-               if ( !$multipageimage.length ) {
-                       return;
-               }
-
-               bindPageNavigation( $multipageimage );
-
-               // Update the url using the History API (if available)
-               if ( history.pushState && history.replaceState ) {
-                       history.replaceState( { tag: 'mw-pagination' }, '' );
-                       $( window ).on( 'popstate', function ( e ) {
-                               var state = e.originalEvent.state;
-                               if ( state && state.tag === 'mw-pagination' ) {
-                                       switchPage( location.href, true );
-                               }
-                       } );
-               }
-       } );
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.page/mediawiki.page.patrol.ajax.js b/resources/src/mediawiki.page/mediawiki.page.patrol.ajax.js
deleted file mode 100644 (file)
index f9b0d35..0000000
+++ /dev/null
@@ -1,65 +0,0 @@
-/*!
- * Animate patrol links to use asynchronous API requests to
- * patrol pages, rather than navigating to a different URI.
- *
- * @since 1.21
- * @author Marius Hoch <hoo@online.de>
- */
-( function ( mw, $ ) {
-       if ( !mw.user.tokens.exists( 'patrolToken' ) ) {
-               // Current user has no patrol right, or an old cached version of user.tokens
-               // that didn't have patrolToken yet.
-               return;
-       }
-       $( function () {
-               var $patrolLinks = $( '.patrollink a' );
-               $patrolLinks.on( 'click', function ( e ) {
-                       var $spinner, href, rcid, apiRequest;
-
-                       // Start preloading the notification module (normally loaded by mw.notify())
-                       mw.loader.load( 'mediawiki.notification' );
-
-                       // Hide the link and create a spinner to show it inside the brackets.
-                       $spinner = $.createSpinner( {
-                               size: 'small',
-                               type: 'inline'
-                       } );
-                       $( this ).hide().after( $spinner );
-
-                       href = $( this ).attr( 'href' );
-                       rcid = mw.util.getParamValue( 'rcid', href );
-                       apiRequest = new mw.Api();
-
-                       apiRequest.postWithToken( 'patrol', {
-                               action: 'patrol',
-                               rcid: rcid
-                       } )
-                       .done( function ( data ) {
-                               // Remove all patrollinks from the page (including any spinners inside).
-                               $patrolLinks.closest( '.patrollink' ).remove();
-                               if ( data.patrol !== undefined ) {
-                                       // Success
-                                       var title = new mw.Title( data.patrol.title );
-                                       mw.notify( mw.msg( 'markedaspatrollednotify', title.toText() ) );
-                               } else {
-                                       // This should never happen as errors should trigger fail
-                                       mw.notify( mw.msg( 'markedaspatrollederrornotify' ), { type: 'error' } );
-                               }
-                       } )
-                       .fail( function ( error ) {
-                               $spinner.remove();
-                               // Restore the patrol link. This allows the user to try again
-                               // (or open it in a new window, bypassing this ajax module).
-                               $patrolLinks.show();
-                               if ( error === 'noautopatrol' ) {
-                                       // Can't patrol own
-                                       mw.notify( mw.msg( 'markedaspatrollederror-noautopatrol' ), { type: 'warn' } );
-                               } else {
-                                       mw.notify( mw.msg( 'markedaspatrollederrornotify' ), { type: 'error' } );
-                               }
-                       } );
-
-                       e.preventDefault();
-               } );
-       } );
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.page/mediawiki.page.ready.js b/resources/src/mediawiki.page/mediawiki.page.ready.js
deleted file mode 100644 (file)
index 8ec4cf0..0000000
+++ /dev/null
@@ -1,74 +0,0 @@
-( function ( mw, $ ) {
-       var supportsPlaceholder = 'placeholder' in document.createElement( 'input' );
-
-       // Break out of framesets
-       if ( mw.config.get( 'wgBreakFrames' ) ) {
-               // Note: In IE < 9 strict comparison to window is non-standard (the standard didn't exist yet)
-               // it works only comparing to window.self or window.window (http://stackoverflow.com/q/4850978/319266)
-               if ( window.top !== window.self ) {
-                       // Un-trap us from framesets
-                       window.top.location.href = location.href;
-               }
-       }
-
-       mw.hook( 'wikipage.content' ).add( function ( $content ) {
-               var $sortableTables;
-
-               // Run jquery.placeholder polyfill if placeholder is not supported
-               if ( !supportsPlaceholder ) {
-                       $content.find( 'input[placeholder]' ).placeholder();
-               }
-
-               // Run jquery.makeCollapsible
-               $content.find( '.mw-collapsible' ).makeCollapsible();
-
-               // Lazy load jquery.tablesorter
-               $sortableTables = $content.find( 'table.sortable' );
-               if ( $sortableTables.length ) {
-                       mw.loader.using( 'jquery.tablesorter', function () {
-                               $sortableTables.tablesorter();
-                       } );
-               }
-
-               // Run jquery.checkboxShiftClick
-               $content.find( 'input[type="checkbox"]:not(.noshiftselect)' ).checkboxShiftClick();
-       } );
-
-       // Things outside the wikipage content
-       $( function () {
-               var $nodes;
-
-               if ( !supportsPlaceholder ) {
-                       // Exclude content to avoid hitting it twice for the (first) wikipage content
-                       $( 'input[placeholder]' ).not( '#mw-content-text input' ).placeholder();
-               }
-
-               // Add accesskey hints to the tooltips
-               if ( document.querySelectorAll ) {
-                       // If we're running on a browser where we can do this efficiently,
-                       // just find all elements that have accesskeys. We can't use jQuery's
-                       // polyfill for the selector since looping over all elements on page
-                       // load might be too slow.
-                       $nodes = $( document.querySelectorAll( '[accesskey]' ) );
-               } else {
-                       // Otherwise go through some elements likely to have accesskeys rather
-                       // than looping over all of them. Unfortunately this will not fully
-                       // work for custom skins with different HTML structures. Input, label
-                       // and button should be rare enough that no optimizations are needed.
-                       $nodes = $( '#column-one a, #mw-head a, #mw-panel a, #p-logo a, input, label, button' );
-               }
-               $nodes.updateTooltipAccessKeys();
-
-               // Infuse OOUI widgets, if any are present
-               $nodes = $( '[data-ooui]' );
-               if ( $nodes.length ) {
-                       mw.loader.using( 'mediawiki.widgets' ).done( function () {
-                               $nodes.each( function () {
-                                       OO.ui.infuse( this );
-                               } );
-                       } );
-               }
-
-       } );
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.page/mediawiki.page.startup.js b/resources/src/mediawiki.page/mediawiki.page.startup.js
deleted file mode 100644 (file)
index 708dcb5..0000000
+++ /dev/null
@@ -1,32 +0,0 @@
-( function ( mw, $ ) {
-
-       // Support: MediaWiki < 1.26
-       // Cached HTML will not yet have this from OutputPage::getHeadScripts.
-       document.documentElement.className = document.documentElement.className
-               .replace( /(^|\s)client-nojs(\s|$)/, '$1client-js$2' );
-
-       mw.page = {};
-
-       $( function () {
-               mw.util.init();
-
-               /**
-                * Fired when wiki content is being added to the DOM
-                *
-                * It is encouraged to fire it before the main DOM is changed (when $content
-                * is still detatched).  However, this order is not defined either way, so you
-                * should only rely on $content itself.
-                *
-                * This includes the ready event on a page load (including post-edit loads)
-                * and when content has been previewed with LivePreview.
-                *
-                * @event wikipage_content
-                * @member mw.hook
-                * @param {jQuery} $content The most appropriate element containing the content,
-                *   such as #mw-content-text (regular content root) or #wikiPreview (live preview
-                *   root)
-                */
-               mw.hook( 'wikipage.content' ).fire( $( '#mw-content-text' ) );
-       } );
-
-}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js b/resources/src/mediawiki.page/mediawiki.page.watch.ajax.js
deleted file mode 100644 (file)
index a3197da..0000000
+++ /dev/null
@@ -1,181 +0,0 @@
-/**
- * Animate watch/unwatch links to use asynchronous API requests to
- * watch pages, rather than navigating to a different URI.
- *
- * @class mw.page.watch.ajax
- */
-( function ( mw, $ ) {
-       // The name of the page to watch or unwatch
-       var title = mw.config.get( 'wgRelevantPageName' );
-
-       /**
-        * Update the link text, link href attribute and (if applicable)
-        * "loading" class.
-        *
-        * @param {jQuery} $link Anchor tag of (un)watch link
-        * @param {string} action One of 'watch', 'unwatch'
-        * @param {string} [state="idle"] 'idle' or 'loading'. Default is 'idle'
-        */
-       function updateWatchLink( $link, action, state ) {
-               var msgKey, $li, otherAction;
-
-               // A valid but empty jQuery object shouldn't throw a TypeError
-               if ( !$link.length ) {
-                       return;
-               }
-
-               // Invalid actions shouldn't silently turn the page in an unrecoverable state
-               if ( action !== 'watch' && action !== 'unwatch' ) {
-                       throw new Error( 'Invalid action' );
-               }
-
-               // message keys 'watch', 'watching', 'unwatch' or 'unwatching'.
-               msgKey = state === 'loading' ? action + 'ing' : action;
-               otherAction = action === 'watch' ? 'unwatch' : 'watch';
-               $li = $link.closest( 'li' );
-
-               // Trigger a 'watchpage' event for this List item.
-               // Announce the otherAction value as the first param.
-               // Used to monitor the state of watch link.
-               // TODO: Revise when system wide hooks are implemented
-               if ( state === undefined ) {
-                       $li.trigger( 'watchpage.mw', otherAction );
-               }
-
-               $link
-                       .text( mw.msg( msgKey ) )
-                       .attr( 'title', mw.msg( 'tooltip-ca-' + action ) )
-                       .updateTooltipAccessKeys()
-                       .attr( 'href', mw.util.wikiScript() + '?' + $.param( {
-                                       title: title,
-                                       action: action
-                               } )
-                       );
-
-               // Most common ID style
-               if ( $li.prop( 'id' ) === 'ca-' + otherAction ) {
-                       $li.prop( 'id', 'ca-' + action );
-               }
-
-               if ( state === 'loading' ) {
-                       $link.addClass( 'loading' );
-               } else {
-                       $link.removeClass( 'loading' );
-               }
-       }
-
-       /**
-        * TODO: This should be moved somewhere more accessible.
-        *
-        * @private
-        * @param {string} url
-        * @return {string} The extracted action, defaults to 'view'
-        */
-       function mwUriGetAction( url ) {
-               var action, actionPaths, key, i, m, parts;
-
-               // TODO: Does MediaWiki give action path or query param
-               // precedence? If the former, move this to the bottom
-               action = mw.util.getParamValue( 'action', url );
-               if ( action !== null ) {
-                       return action;
-               }
-
-               actionPaths = mw.config.get( 'wgActionPaths' );
-               for ( key in actionPaths ) {
-                       if ( actionPaths.hasOwnProperty( key ) ) {
-                               parts = actionPaths[ key ].split( '$1' );
-                               for ( i = 0; i < parts.length; i++ ) {
-                                       parts[ i ] = mw.RegExp.escape( parts[ i ] );
-                               }
-                               m = new RegExp( parts.join( '(.+)' ) ).exec( url );
-                               if ( m && m[ 1 ] ) {
-                                       return key;
-                               }
-
-                       }
-               }
-
-               return 'view';
-       }
-
-       // Expose public methods
-       mw.page.watch = {
-               updateWatchLink: updateWatchLink
-       };
-
-       $( function () {
-               var $links = $( '.mw-watchlink a, a.mw-watchlink, ' +
-                       '#ca-watch a, #ca-unwatch a, #mw-unwatch-link1, ' +
-                       '#mw-unwatch-link2, #mw-watch-link2, #mw-watch-link1' );
-
-               // Allowing people to add inline animated links is a little scary
-               $links = $links.filter( ':not( #bodyContent *, #content * )' );
-
-               $links.click( function ( e ) {
-                       var action, api, $link;
-
-                       // Start preloading the notification module (normally loaded by mw.notify())
-                       mw.loader.load( 'mediawiki.notification' );
-
-                       action = mwUriGetAction( this.href );
-
-                       if ( action !== 'watch' && action !== 'unwatch' ) {
-                               // Could not extract target action from link url,
-                               // let native browsing handle it further
-                               return true;
-                       }
-                       e.preventDefault();
-                       e.stopPropagation();
-
-                       $link = $( this );
-
-                       if ( $link.hasClass( 'loading' ) ) {
-                               return;
-                       }
-
-                       updateWatchLink( $link, action, 'loading' );
-
-                       api = new mw.Api();
-
-                       api[ action ]( title )
-                               .done( function ( watchResponse ) {
-                                       var otherAction = action === 'watch' ? 'unwatch' : 'watch';
-
-                                       mw.notify( $.parseHTML( watchResponse.message ), {
-                                               tag: 'watch-self'
-                                       } );
-
-                                       // Set link to opposite
-                                       updateWatchLink( $link, otherAction );
-
-                                       // Update the "Watch this page" checkbox on action=edit when the
-                                       // page is watched or unwatched via the tab (bug 12395).
-                                       $( '#wpWatchthis' ).prop( 'checked', watchResponse.watched !== undefined );
-                               } )
-                               .fail( function () {
-                                       var cleanTitle, msg, link;
-
-                                       // Reset link to non-loading mode
-                                       updateWatchLink( $link, action );
-
-                                       // Format error message
-                                       cleanTitle = title.replace( /_/g, ' ' );
-                                       link = mw.html.element(
-                                               'a', {
-                                                       href: mw.util.getUrl( title ),
-                                                       title: cleanTitle
-                                               }, cleanTitle
-                                       );
-                                       msg = mw.message( 'watcherrortext', link );
-
-                                       // Report to user about the error
-                                       mw.notify( msg, {
-                                               tag: 'watch-self',
-                                               type: 'error'
-                                       } );
-                               } );
-               } );
-       } );
-
-}( mediaWiki, jQuery ) );
index 1154c9f..138715a 100644 (file)
@@ -13,9 +13,9 @@
         * @extends OO.ui.MenuOptionWidget
         *
         * @constructor
-        * @param {Object} [config] Configuration options
-        * @cfg {string} [data] Label to display
-        * @cfg {mw.Title} [title] Page title object
+        * @param {Object} config Configuration options
+        * @cfg {string} data Label to display
+        * @cfg {string} url URL of page
         * @cfg {string} [imageUrl] Thumbnail image URL with URL encoding
         * @cfg {string} [description] Page description
         * @cfg {boolean} [missing] Page doesn't exist
                config = $.extend( {
                        icon: icon,
                        label: config.data,
-                       href: config.title.getUrl(),
-                       autoFitLabel: false
+                       autoFitLabel: false,
+                       $label: $( '<a>' )
                }, config );
 
                // Parent constructor
                mw.widgets.TitleOptionWidget.parent.call( this, config );
 
                // Initialization
-               this.$label.wrap( '<a>' );
-               this.$link = this.$label.parent();
-               this.$link.attr( 'href', config.href );
+               this.$label.attr( 'href', config.url );
                this.$element.addClass( 'mw-widget-titleOptionWidget' );
 
                // Highlight matching parts of link suggestion
                this.$label.autoEllipsis( { hasSpan: false, tooltip: true, matchText: config.query } );
 
                if ( config.missing ) {
-                       this.$link.addClass( 'new' );
+                       this.$label.addClass( 'new' );
                }
 
                if ( config.imageUrl ) {
                                        .text( config.description )
                        );
                }
-
-               // Events
-               this.$link.on( 'click', function () {
-                       return false;
-               } );
        };
 
        /* Setup */
index f51c559..672b54a 100644 (file)
@@ -47,6 +47,7 @@
                this.cache = config.cache;
 
                // Initialization
+               this.$element.addClass( 'mw-widget-titleWidget' );
                this.interwikiPrefixes = [];
                this.interwikiPrefixesPromise = new mw.Api().get( {
                        action: 'query',
        /**
         * Get menu option widget data from the title and page data
         *
-        * @param {mw.Title} title Title object
+        * @param {string} title Title object
         * @param {Object} data Page data
         * @return {Object} Data for option widget
         */
                        data: this.namespace !== null && this.relative
                                ? mwTitle.getRelativeText( this.namespace )
                                : title,
-                       title: mwTitle,
+                       url: mwTitle.getUrl(),
                        imageUrl: this.showImages ? data.imageUrl : null,
                        description: this.showDescriptions ? data.description : null,
                        missing: data.missing,
index 93c4b20..ecd0824 100644 (file)
@@ -5,59 +5,73 @@
  * @license The MIT License (MIT); see LICENSE.txt
  */
 
-.mw-widget-titleOptionWidget-description {
-       display: none;
-}
-
 .mw-widget-titleWidget {
+       .mw-widget-titleOptionWidget {
+               line-height: normal;
+
+               &-description {
+                       color: #888;
+               }
+       }
+
        &-menu-withImages {
                .mw-widget-titleOptionWidget {
                        -webkit-box-sizing: border-box;
                        -moz-box-sizing: border-box;
                        box-sizing: border-box;
                        min-height: 3.75em;
-                       margin-left: 3.75em;
-               }
+                       padding-left: 4.75em;
 
-               .mw-widget-titleOptionWidget:not(:last-child) {
-                       margin-bottom: 1px;
-               }
+                       &:not(:last-child) {
+                               margin-bottom: 2px;
+                       }
 
-               .oo-ui-iconElement .oo-ui-iconElement-icon {
-                       display: block;
-                       width: 3.75em;
-                       height: 3.75em;
-                       left: -3.75em;
-                       background-color: #ccc;
-                       opacity: 0.4;
-               }
+                       > .oo-ui-labelElement-label {
+                               line-height: 2.8em;
+                       }
+
+                       &.oo-ui-iconElement {
+                               >.oo-ui-iconElement-icon {
+                                       display: block;
+                                       width: 3.75em;
+                                       height: 3.75em;
+                                       left: 0;
+                                       background-color: #ccc;
+                                       opacity: 0.4;
+                               }
 
-               .oo-ui-iconElement .mw-widget-titleOptionWidget-hasImage {
-                       border: 0;
-                       background-size: cover;
-                       opacity: 1;
+                               > .mw-widget-titleOptionWidget-hasImage {
+                                       border: 0;
+                                       background-size: cover;
+                                       opacity: 0.7;
+                               }
+                       }
                }
 
-               .mw-widget-titleOptionWidget .oo-ui-labelElement-label {
-                       line-height: 2.8em;
+               &.oo-ui-optionWidget-highlighted, &.oo-ui-optionWidget-selected {
+                       &.oo-ui-iconElement > .mw-widget-titleOptionWidget-hasImage {
+                               opacity: 1;
+                       }
                }
        }
 
        &-menu-withDescriptions {
-               .mw-widget-titleOptionWidget .oo-ui-labelElement-label {
-                       line-height: 1.5em;
+               .mw-widget-titleOptionWidget {
+                       > .oo-ui-labelElement-label {
+                               line-height: 1.5em;
+                       }
+
+                       &-description {
+                               white-space: nowrap;
+                               text-overflow: ellipsis;
+                               overflow: hidden;
+                       }
                }
+       }
 
+       &:not(&-menu-withDescriptions) {
                .mw-widget-titleOptionWidget-description {
-                       display: block;
-                       white-space: nowrap;
-                       text-overflow: ellipsis;
-                       overflow: hidden;
+                       display: none;
                }
        }
 }
-
-.oo-ui-menuOptionWidget:not(.oo-ui-optionWidget-selected) .mw-widget-titleOptionWidget-description,
-.oo-ui-menuOptionWidget.oo-ui-optionWidget-highlighted .mw-widget-titleOptionWidget-description {
-       color: #888;
-}
diff --git a/resources/src/mediawiki/ForeignApi.js b/resources/src/mediawiki/ForeignApi.js
new file mode 100644 (file)
index 0000000..b8cc059
--- /dev/null
@@ -0,0 +1,109 @@
+( function ( mw, $ ) {
+
+       /**
+        * Create an object like mw.Api, but automatically handling everything required to communicate
+        * with another MediaWiki wiki via cross-origin requests (CORS).
+        *
+        * The foreign wiki must be configured to accept requests from the current wiki. See
+        * <https://www.mediawiki.org/wiki/Manual:$wgCrossSiteAJAXdomains> for details.
+        *
+        *     var api = new mw.ForeignApi( 'https://commons.wikimedia.org/w/api.php' );
+        *     api.get( {
+        *         action: 'query',
+        *         meta: 'userinfo'
+        *     } ).done( function ( data ) {
+        *         console.log( data );
+        *     } );
+        *
+        * To ensure that the user at the foreign wiki is logged in, pass the `assert: 'user'` parameter
+        * to #get/#post (since MW 1.23): if they are not, the API request will fail. (Note that this
+        * doesn't guarantee that it's the same user.)
+        *
+        * Authentication-related MediaWiki extensions may extend this class to ensure that the user
+        * authenticated on the current wiki will be automatically authenticated on the foreign one. These
+        * extension modules should be registered using the ResourceLoaderForeignApiModules hook. See
+        * CentralAuth for a practical example. The general pattern to extend and override the name is:
+        *
+        *     function MyForeignApi() {};
+        *     OO.inheritClass( MyForeignApi, mw.ForeignApi );
+        *     mw.ForeignApi = MyForeignApi;
+        *
+        * @class mw.ForeignApi
+        * @extends mw.Api
+        * @since 1.26
+        *
+        * @constructor
+        * @param {string|mw.Uri} url URL pointing to another wiki's `api.php` endpoint.
+        * @param {Object} [options] See mw.Api.
+        *
+        * @author Bartosz Dziewoński
+        * @author Jon Robson
+        */
+       function CoreForeignApi( url, options ) {
+               if ( !url || $.isPlainObject( url ) ) {
+                       throw new Error( 'mw.ForeignApi() requires a `url` parameter' );
+               }
+
+               this.apiUrl = String( url );
+
+               options = $.extend( /*deep=*/ true,
+                       {
+                               ajax: {
+                                       url: this.apiUrl,
+                                       xhrFields: {
+                                               withCredentials: true
+                                       }
+                               },
+                               parameters: {
+                                       // Add 'origin' query parameter to all requests.
+                                       origin: this.getOrigin()
+                               }
+                       },
+                       options
+               );
+
+               // Call parent constructor
+               CoreForeignApi.parent.call( this, options );
+       }
+
+       OO.inheritClass( CoreForeignApi, mw.Api );
+
+       /**
+        * Return the origin to use for API requests, in the required format (protocol, host and port, if
+        * any).
+        *
+        * @protected
+        * @return {string}
+        */
+       CoreForeignApi.prototype.getOrigin = function () {
+               var origin = location.protocol + '//' + location.hostname;
+               if ( location.port ) {
+                       origin += ':' + location.port;
+               }
+               return origin;
+       };
+
+       /**
+        * @inheritdoc
+        */
+       CoreForeignApi.prototype.ajax = function ( parameters, ajaxOptions ) {
+               var url, origin, newAjaxOptions;
+
+               // 'origin' query parameter must be part of the request URI, and not just POST request body
+               if ( ajaxOptions.type === 'POST' ) {
+                       url = ( ajaxOptions && ajaxOptions.url ) || this.defaults.ajax.url;
+                       origin = ( parameters && parameters.origin ) || this.defaults.parameters.origin;
+                       url += ( url.indexOf( '?' ) !== -1 ? '&' : '?' ) +
+                               'origin=' + encodeURIComponent( origin );
+                       newAjaxOptions = $.extend( {}, ajaxOptions, { url: url } );
+               } else {
+                       newAjaxOptions = ajaxOptions;
+               }
+
+               return CoreForeignApi.parent.prototype.ajax.call( this, parameters, newAjaxOptions );
+       };
+
+       // Expose
+       mw.ForeignApi = CoreForeignApi;
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/api.js b/resources/src/mediawiki/api.js
new file mode 100644 (file)
index 0000000..43b20b8
--- /dev/null
@@ -0,0 +1,416 @@
+( function ( mw, $ ) {
+
+       /**
+        * @class mw.Api
+        */
+
+       /**
+        * @property {Object} defaultOptions Default options for #ajax calls. Can be overridden by passing
+        *     `options` to mw.Api constructor.
+        * @property {Object} defaultOptions.parameters Default query parameters for API requests.
+        * @property {Object} defaultOptions.ajax Default options for jQuery#ajax.
+        * @private
+        */
+       var defaultOptions = {
+                       parameters: {
+                               action: 'query',
+                               format: 'json'
+                       },
+                       ajax: {
+                               url: mw.util.wikiScript( 'api' ),
+                               timeout: 30 * 1000, // 30 seconds
+                               dataType: 'json'
+                       }
+               },
+
+               // Keyed by ajax url and symbolic name for the individual request
+               promises = {};
+
+       // Pre-populate with fake ajax promises to save http requests for tokens
+       // we already have on the page via the user.tokens module (bug 34733).
+       promises[ defaultOptions.ajax.url ] = {};
+       $.each( mw.user.tokens.get(), function ( key, value ) {
+               // This requires #getToken to use the same key as user.tokens.
+               // Format: token-type + "Token" (eg. editToken, patrolToken, watchToken).
+               promises[ defaultOptions.ajax.url ][ key ] = $.Deferred()
+                       .resolve( value )
+                       .promise( { abort: function () {} } );
+       } );
+
+       /**
+        * Constructor to create an object to interact with the API of a particular MediaWiki server.
+        * mw.Api objects represent the API of a particular MediaWiki server.
+        *
+        *     var api = new mw.Api();
+        *     api.get( {
+        *         action: 'query',
+        *         meta: 'userinfo'
+        *     } ).done( function ( data ) {
+        *         console.log( data );
+        *     } );
+        *
+        * Since MW 1.25, multiple values for a parameter can be specified using an array:
+        *
+        *     var api = new mw.Api();
+        *     api.get( {
+        *         action: 'query',
+        *         meta: [ 'userinfo', 'siteinfo' ] // same effect as 'userinfo|siteinfo'
+        *     } ).done( function ( data ) {
+        *         console.log( data );
+        *     } );
+        *
+        * Since MW 1.26, boolean values for a parameter can be specified directly. If the value is
+        * `false` or `undefined`, the parameter will be omitted from the request, as required by the API.
+        *
+        * @constructor
+        * @param {Object} [options] See #defaultOptions documentation above. Can also be overridden for
+        *  each individual request by passing them to #get or #post (or directly #ajax) later on.
+        */
+       mw.Api = function ( options ) {
+               // TODO: Share API objects with exact same config.
+               options = options || {};
+
+               // Force a string if we got a mw.Uri object
+               if ( options.ajax && options.ajax.url !== undefined ) {
+                       options.ajax.url = String( options.ajax.url );
+               }
+
+               options.parameters = $.extend( {}, defaultOptions.parameters, options.parameters );
+               options.ajax = $.extend( {}, defaultOptions.ajax, options.ajax );
+
+               this.defaults = options;
+       };
+
+       mw.Api.prototype = {
+
+               /**
+                * Perform API get request
+                *
+                * @param {Object} parameters
+                * @param {Object} [ajaxOptions]
+                * @return {jQuery.Promise}
+                */
+               get: function ( parameters, ajaxOptions ) {
+                       ajaxOptions = ajaxOptions || {};
+                       ajaxOptions.type = 'GET';
+                       return this.ajax( parameters, ajaxOptions );
+               },
+
+               /**
+                * Perform API post request
+                *
+                * TODO: Post actions for non-local hostnames will need proxy.
+                *
+                * @param {Object} parameters
+                * @param {Object} [ajaxOptions]
+                * @return {jQuery.Promise}
+                */
+               post: function ( parameters, ajaxOptions ) {
+                       ajaxOptions = ajaxOptions || {};
+                       ajaxOptions.type = 'POST';
+                       return this.ajax( parameters, ajaxOptions );
+               },
+
+               /**
+                * Massage parameters from the nice format we accept into a format suitable for the API.
+                *
+                * @private
+                * @param {Object} parameters (modified in-place)
+                */
+               preprocessParameters: function ( parameters ) {
+                       var key;
+                       // Handle common MediaWiki API idioms for passing parameters
+                       for ( key in parameters ) {
+                               // Multiple values are pipe-separated
+                               if ( $.isArray( parameters[ key ] ) ) {
+                                       parameters[ key ] = parameters[ key ].join( '|' );
+                               }
+                               // Boolean values are only false when not given at all
+                               if ( parameters[ key ] === false || parameters[ key ] === undefined ) {
+                                       delete parameters[ key ];
+                               }
+                       }
+               },
+
+               /**
+                * Perform the API call.
+                *
+                * @param {Object} parameters
+                * @param {Object} [ajaxOptions]
+                * @return {jQuery.Promise} Done: API response data and the jqXHR object.
+                *  Fail: Error code
+                */
+               ajax: function ( parameters, ajaxOptions ) {
+                       var token,
+                               apiDeferred = $.Deferred(),
+                               xhr, key, formData;
+
+                       parameters = $.extend( {}, this.defaults.parameters, parameters );
+                       ajaxOptions = $.extend( {}, this.defaults.ajax, ajaxOptions );
+
+                       // Ensure that token parameter is last (per [[mw:API:Edit#Token]]).
+                       if ( parameters.token ) {
+                               token = parameters.token;
+                               delete parameters.token;
+                       }
+
+                       this.preprocessParameters( parameters );
+
+                       // If multipart/form-data has been requested and emulation is possible, emulate it
+                       if (
+                               ajaxOptions.type === 'POST' &&
+                               window.FormData &&
+                               ajaxOptions.contentType === 'multipart/form-data'
+                       ) {
+
+                               formData = new FormData();
+
+                               for ( key in parameters ) {
+                                       formData.append( key, parameters[ key ] );
+                               }
+                               // If we extracted a token parameter, add it back in.
+                               if ( token ) {
+                                       formData.append( 'token', token );
+                               }
+
+                               ajaxOptions.data = formData;
+
+                               // Prevent jQuery from mangling our FormData object
+                               ajaxOptions.processData = false;
+                               // Prevent jQuery from overriding the Content-Type header
+                               ajaxOptions.contentType = false;
+                       } else {
+                               // Some deployed MediaWiki >= 1.17 forbid periods in URLs, due to an IE XSS bug
+                               // So let's escape them here. See bug #28235
+                               // This works because jQuery accepts data as a query string or as an Object
+                               ajaxOptions.data = $.param( parameters ).replace( /\./g, '%2E' );
+
+                               // If we extracted a token parameter, add it back in.
+                               if ( token ) {
+                                       ajaxOptions.data += '&token=' + encodeURIComponent( token );
+                               }
+
+                               if ( ajaxOptions.contentType === 'multipart/form-data' ) {
+                                       // We were asked to emulate but can't, so drop the Content-Type header, otherwise
+                                       // it'll be wrong and the server will fail to decode the POST body
+                                       delete ajaxOptions.contentType;
+                               }
+                       }
+
+                       // Make the AJAX request
+                       xhr = $.ajax( ajaxOptions )
+                               // If AJAX fails, reject API call with error code 'http'
+                               // and details in second argument.
+                               .fail( function ( xhr, textStatus, exception ) {
+                                       apiDeferred.reject( 'http', {
+                                               xhr: xhr,
+                                               textStatus: textStatus,
+                                               exception: exception
+                                       } );
+                               } )
+                               // AJAX success just means "200 OK" response, also check API error codes
+                               .done( function ( result, textStatus, jqXHR ) {
+                                       if ( result === undefined || result === null || result === '' ) {
+                                               apiDeferred.reject( 'ok-but-empty',
+                                                       'OK response but empty result (check HTTP headers?)'
+                                               );
+                                       } else if ( result.error ) {
+                                               var code = result.error.code === undefined ? 'unknown' : result.error.code;
+                                               apiDeferred.reject( code, result );
+                                       } else {
+                                               apiDeferred.resolve( result, jqXHR );
+                                       }
+                               } );
+
+                       // Return the Promise
+                       return apiDeferred.promise( { abort: xhr.abort } ).fail( function ( code, details ) {
+                               if ( !( code === 'http' && details && details.textStatus === 'abort' ) ) {
+                                       mw.log( 'mw.Api error: ', code, details );
+                               }
+                       } );
+               },
+
+               /**
+                * Post to API with specified type of token. If we have no token, get one and try to post.
+                * If we have a cached token try using that, and if it fails, blank out the
+                * cached token and start over. For example to change an user option you could do:
+                *
+                *     new mw.Api().postWithToken( 'options', {
+                *         action: 'options',
+                *         optionname: 'gender',
+                *         optionvalue: 'female'
+                *     } );
+                *
+                * @param {string} tokenType The name of the token, like options or edit.
+                * @param {Object} params API parameters
+                * @param {Object} [ajaxOptions]
+                * @return {jQuery.Promise} See #post
+                * @since 1.22
+                */
+               postWithToken: function ( tokenType, params, ajaxOptions ) {
+                       var api = this;
+
+                       return api.getToken( tokenType, params.assert ).then( function ( token ) {
+                               params.token = token;
+                               return api.post( params, ajaxOptions ).then(
+                                       // If no error, return to caller as-is
+                                       null,
+                                       // Error handler
+                                       function ( code ) {
+                                               if ( code === 'badtoken' ) {
+                                                       api.badToken( tokenType );
+                                                       // Try again, once
+                                                       params.token = undefined;
+                                                       return api.getToken( tokenType, params.assert ).then( function ( token ) {
+                                                               params.token = token;
+                                                               return api.post( params, ajaxOptions );
+                                                       } );
+                                               }
+
+                                               // Different error, pass on to let caller handle the error code
+                                               return this;
+                                       }
+                               );
+                       } );
+               },
+
+               /**
+                * Get a token for a certain action from the API.
+                *
+                * The assert parameter is only for internal use by postWithToken.
+                *
+                * @param {string} type Token type
+                * @return {jQuery.Promise}
+                * @return {Function} return.done
+                * @return {string} return.done.token Received token.
+                * @since 1.22
+                */
+               getToken: function ( type, assert ) {
+                       var apiPromise,
+                               promiseGroup = promises[ this.defaults.ajax.url ],
+                               d = promiseGroup && promiseGroup[ type + 'Token' ];
+
+                       if ( !d ) {
+                               apiPromise = this.get( { action: 'tokens', type: type, assert: assert } );
+
+                               d = apiPromise
+                                       .then( function ( data ) {
+                                               if ( data.tokens && data.tokens[ type + 'token' ] ) {
+                                                       return data.tokens[ type + 'token' ];
+                                               }
+
+                                               // If token type is not available for this user,
+                                               // key '...token' is either missing or set to boolean false
+                                               return $.Deferred().reject( 'token-missing', data );
+                                       }, function () {
+                                               // Clear promise. Do not cache errors.
+                                               delete promiseGroup[ type + 'Token' ];
+                                               // Pass on to allow the caller to handle the error
+                                               return this;
+                                       } )
+                                       // Attach abort handler
+                                       .promise( { abort: apiPromise.abort } );
+
+                               // Store deferred now so that we can use it again even if it isn't ready yet
+                               if ( !promiseGroup ) {
+                                       promiseGroup = promises[ this.defaults.ajax.url ] = {};
+                               }
+                               promiseGroup[ type + 'Token' ] = d;
+                       }
+
+                       return d;
+               },
+
+               /**
+                * Indicate that the cached token for a certain action of the API is bad.
+                *
+                * Call this if you get a 'badtoken' error when using the token returned by #getToken.
+                * You may also want to use #postWithToken instead, which invalidates bad cached tokens
+                * automatically.
+                *
+                * @param {string} type Token type
+                * @since 1.26
+                */
+               badToken: function ( type ) {
+                       var promiseGroup = promises[ this.defaults.ajax.url ];
+                       if ( promiseGroup ) {
+                               delete promiseGroup[ type + 'Token' ];
+                       }
+               }
+       };
+
+       /**
+        * @static
+        * @property {Array}
+        * List of errors we might receive from the API.
+        * For now, this just documents our expectation that there should be similar messages
+        * available.
+        */
+       mw.Api.errors = [
+               // occurs when POST aborted
+               // jQuery 1.4 can't distinguish abort or lost connection from 200 OK + empty result
+               'ok-but-empty',
+
+               // timeout
+               'timeout',
+
+               // really a warning, but we treat it like an error
+               'duplicate',
+               'duplicate-archive',
+
+               // upload succeeded, but no image info.
+               // this is probably impossible, but might as well check for it
+               'noimageinfo',
+               // remote errors, defined in API
+               'uploaddisabled',
+               'nomodule',
+               'mustbeposted',
+               'badaccess-groups',
+               'missingresult',
+               'missingparam',
+               'invalid-file-key',
+               'copyuploaddisabled',
+               'mustbeloggedin',
+               'empty-file',
+               'file-too-large',
+               'filetype-missing',
+               'filetype-banned',
+               'filetype-banned-type',
+               'filename-tooshort',
+               'illegal-filename',
+               'verification-error',
+               'hookaborted',
+               'unknown-error',
+               'internal-error',
+               'overwrite',
+               'badtoken',
+               'fetchfileerror',
+               'fileexists-shared-forbidden',
+               'invalidtitle',
+               'notloggedin',
+
+               // Stash-specific errors - expanded
+               'stashfailed',
+               'stasherror',
+               'stashedfilenotfound',
+               'stashpathinvalid',
+               'stashfilestorage',
+               'stashzerolength',
+               'stashnotloggedin',
+               'stashwrongowner',
+               'stashnosuchfilekey'
+       ];
+
+       /**
+        * @static
+        * @property {Array}
+        * List of warnings we might receive from the API.
+        * For now, this just documents our expectation that there should be similar messages
+        * available.
+        */
+       mw.Api.warnings = [
+               'duplicate',
+               'exists'
+       ];
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/api/category.js b/resources/src/mediawiki/api/category.js
new file mode 100644 (file)
index 0000000..14077e0
--- /dev/null
@@ -0,0 +1,108 @@
+/**
+ * @class mw.Api.plugin.category
+ */
+( function ( mw, $ ) {
+
+       $.extend( mw.Api.prototype, {
+               /**
+                * Determine if a category exists.
+                *
+                * @param {mw.Title|string} title
+                * @return {jQuery.Promise}
+                * @return {Function} return.done
+                * @return {boolean} return.done.isCategory Whether the category exists.
+                */
+               isCategory: function ( title ) {
+                       var apiPromise = this.get( {
+                               prop: 'categoryinfo',
+                               titles: String( title )
+                       } );
+
+                       return apiPromise
+                               .then( function ( data ) {
+                                       var exists = false;
+                                       if ( data.query && data.query.pages ) {
+                                               $.each( data.query.pages, function ( id, page ) {
+                                                       if ( page.categoryinfo ) {
+                                                               exists = true;
+                                                       }
+                                               } );
+                                       }
+                                       return exists;
+                               } )
+                               .promise( { abort: apiPromise.abort } );
+               },
+
+               /**
+                * Get a list of categories that match a certain prefix.
+                *
+                * E.g. given "Foo", return "Food", "Foolish people", "Foosball tables"...
+                *
+                * @param {string} prefix Prefix to match.
+                * @return {jQuery.Promise}
+                * @return {Function} return.done
+                * @return {string[]} return.done.categories Matched categories
+                */
+               getCategoriesByPrefix: function ( prefix ) {
+                       // Fetch with allpages to only get categories that have a corresponding description page.
+                       var apiPromise = this.get( {
+                               list: 'allpages',
+                               apprefix: prefix,
+                               apnamespace: mw.config.get( 'wgNamespaceIds' ).category
+                       } );
+
+                       return apiPromise
+                               .then( function ( data ) {
+                                       var texts = [];
+                                       if ( data.query && data.query.allpages ) {
+                                               $.each( data.query.allpages, function ( i, category ) {
+                                                       texts.push( new mw.Title( category.title ).getMainText() );
+                                               } );
+                                       }
+                                       return texts;
+                               } )
+                               .promise( { abort: apiPromise.abort } );
+               },
+
+               /**
+                * Get the categories that a particular page on the wiki belongs to.
+                *
+                * @param {mw.Title|string} title
+                * @return {jQuery.Promise}
+                * @return {Function} return.done
+                * @return {boolean|mw.Title[]} return.done.categories List of category titles or false
+                *  if title was not found.
+                */
+               getCategories: function ( title ) {
+                       var apiPromise = this.get( {
+                               prop: 'categories',
+                               titles: String( title )
+                       } );
+
+                       return apiPromise
+                               .then( function ( data ) {
+                                       var titles = false;
+                                       if ( data.query && data.query.pages ) {
+                                               $.each( data.query.pages, function ( id, page ) {
+                                                       if ( page.categories ) {
+                                                               if ( titles === false ) {
+                                                                       titles = [];
+                                                               }
+                                                               $.each( page.categories, function ( i, cat ) {
+                                                                       titles.push( new mw.Title( cat.title ) );
+                                                               } );
+                                                       }
+                                               } );
+                                       }
+                                       return titles;
+                               } )
+                               .promise( { abort: apiPromise.abort } );
+               }
+       } );
+
+       /**
+        * @class mw.Api
+        * @mixins mw.Api.plugin.category
+        */
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/api/edit.js b/resources/src/mediawiki/api/edit.js
new file mode 100644 (file)
index 0000000..e43285f
--- /dev/null
@@ -0,0 +1,58 @@
+/**
+ * @class mw.Api.plugin.edit
+ */
+( function ( mw, $ ) {
+
+       $.extend( mw.Api.prototype, {
+
+               /**
+                * Post to API with edit token. If we have no token, get one and try to post.
+                * If we have a cached token try using that, and if it fails, blank out the
+                * cached token and start over.
+                *
+                * @param {Object} params API parameters
+                * @param {Object} [ajaxOptions]
+                * @return {jQuery.Promise} See #post
+                */
+               postWithEditToken: function ( params, ajaxOptions ) {
+                       return this.postWithToken( 'edit', params, ajaxOptions );
+               },
+
+               /**
+                * API helper to grab an edit token.
+                *
+                * @return {jQuery.Promise}
+                * @return {Function} return.done
+                * @return {string} return.done.token Received token.
+                */
+               getEditToken: function () {
+                       return this.getToken( 'edit' );
+               },
+
+               /**
+                * Post a new section to the page.
+                *
+                * @see #postWithEditToken
+                * @param {mw.Title|String} title Target page
+                * @param {string} header
+                * @param {string} message wikitext message
+                * @param {Object} [additionalParams] Additional API parameters, e.g. `{ redirect: true }`
+                * @return {jQuery.Promise}
+                */
+               newSection: function ( title, header, message, additionalParams ) {
+                       return this.postWithEditToken( $.extend( {
+                               action: 'edit',
+                               section: 'new',
+                               title: String( title ),
+                               summary: header,
+                               text: message
+                       }, additionalParams ) );
+               }
+       } );
+
+       /**
+        * @class mw.Api
+        * @mixins mw.Api.plugin.edit
+        */
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/api/login.js b/resources/src/mediawiki/api/login.js
new file mode 100644 (file)
index 0000000..2b709aa
--- /dev/null
@@ -0,0 +1,60 @@
+/**
+ * Make the two-step login easier.
+ *
+ * @author Niklas Laxström
+ * @class mw.Api.plugin.login
+ * @since 1.22
+ */
+( function ( mw, $ ) {
+       'use strict';
+
+       $.extend( mw.Api.prototype, {
+               /**
+                * @param {string} username
+                * @param {string} password
+                * @return {jQuery.Promise} See mw.Api#post
+                */
+               login: function ( username, password ) {
+                       var params, apiPromise, innerPromise,
+                               api = this;
+
+                       params = {
+                               action: 'login',
+                               lgname: username,
+                               lgpassword: password
+                       };
+
+                       apiPromise = api.post( params );
+
+                       return apiPromise
+                               .then( function ( data ) {
+                                       params.lgtoken = data.login.token;
+                                       innerPromise = api.post( params )
+                                               .then( function ( data ) {
+                                                       var code;
+                                                       if ( data.login.result !== 'Success' ) {
+                                                               // Set proper error code whenever possible
+                                                               code = data.error && data.error.code || 'unknown';
+                                                               return $.Deferred().reject( code, data );
+                                                       }
+                                                       return data;
+                                               } );
+                                       return innerPromise;
+                               } )
+                               .promise( {
+                                       abort: function () {
+                                               apiPromise.abort();
+                                               if ( innerPromise ) {
+                                                       innerPromise.abort();
+                                               }
+                                       }
+                               } );
+               }
+       } );
+
+       /**
+        * @class mw.Api
+        * @mixins mw.Api.plugin.login
+        */
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/api/options.js b/resources/src/mediawiki/api/options.js
new file mode 100644 (file)
index 0000000..399e6f4
--- /dev/null
@@ -0,0 +1,89 @@
+/**
+ * @class mw.Api.plugin.options
+ */
+( function ( mw, $ ) {
+
+       $.extend( mw.Api.prototype, {
+
+               /**
+                * Asynchronously save the value of a single user option using the API. See #saveOptions.
+                *
+                * @param {string} name
+                * @param {string|null} value
+                * @return {jQuery.Promise}
+                */
+               saveOption: function ( name, value ) {
+                       var param = {};
+                       param[ name ] = value;
+                       return this.saveOptions( param );
+               },
+
+               /**
+                * Asynchronously save the values of user options using the API.
+                *
+                * If a value of `null` is provided, the given option will be reset to the default value.
+                *
+                * Any warnings returned by the API, including warnings about invalid option names or values,
+                * are ignored. However, do not rely on this behavior.
+                *
+                * If necessary, the options will be saved using several parallel API requests. Only one promise
+                * is always returned that will be resolved when all requests complete.
+                *
+                * @param {Object} options Options as a `{ name: value, … }` object
+                * @return {jQuery.Promise}
+                */
+               saveOptions: function ( options ) {
+                       var name, value, bundleable,
+                               grouped = [],
+                               deferreds = [];
+
+                       for ( name in options ) {
+                               value = options[ name ] === null ? null : String( options[ name ] );
+
+                               // Can we bundle this option, or does it need a separate request?
+                               bundleable =
+                                       ( value === null || value.indexOf( '|' ) === -1 ) &&
+                                       ( name.indexOf( '|' ) === -1 && name.indexOf( '=' ) === -1 );
+
+                               if ( bundleable ) {
+                                       if ( value !== null ) {
+                                               grouped.push( name + '=' + value );
+                                       } else {
+                                               // Omitting value resets the option
+                                               grouped.push( name );
+                                       }
+                               } else {
+                                       if ( value !== null ) {
+                                               deferreds.push( this.postWithToken( 'options', {
+                                                       action: 'options',
+                                                       optionname: name,
+                                                       optionvalue: value
+                                               } ) );
+                                       } else {
+                                               // Omitting value resets the option
+                                               deferreds.push( this.postWithToken( 'options', {
+                                                       action: 'options',
+                                                       optionname: name
+                                               } ) );
+                                       }
+                               }
+                       }
+
+                       if ( grouped.length ) {
+                               deferreds.push( this.postWithToken( 'options', {
+                                       action: 'options',
+                                       change: grouped.join( '|' )
+                               } ) );
+                       }
+
+                       return $.when.apply( $, deferreds );
+               }
+
+       } );
+
+       /**
+        * @class mw.Api
+        * @mixins mw.Api.plugin.options
+        */
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/api/parse.js b/resources/src/mediawiki/api/parse.js
new file mode 100644 (file)
index 0000000..bc3d44f
--- /dev/null
@@ -0,0 +1,35 @@
+/**
+ * @class mw.Api.plugin.parse
+ */
+( function ( mw, $ ) {
+
+       $.extend( mw.Api.prototype, {
+               /**
+                * Convenience method for 'action=parse'.
+                *
+                * @param {string} wikitext
+                * @return {jQuery.Promise}
+                * @return {Function} return.done
+                * @return {string} return.done.data Parsed HTML of `wikitext`.
+                */
+               parse: function ( wikitext ) {
+                       var apiPromise = this.get( {
+                               action: 'parse',
+                               contentmodel: 'wikitext',
+                               text: wikitext
+                       } );
+
+                       return apiPromise
+                               .then( function ( data ) {
+                                       return data.parse.text[ '*' ];
+                               } )
+                               .promise( { abort: apiPromise.abort } );
+               }
+       } );
+
+       /**
+        * @class mw.Api
+        * @mixins mw.Api.plugin.parse
+        */
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/api/upload.js b/resources/src/mediawiki/api/upload.js
new file mode 100644 (file)
index 0000000..4abff28
--- /dev/null
@@ -0,0 +1,368 @@
+/**
+ * Provides an interface for uploading files to MediaWiki.
+ *
+ * @class mw.Api.plugin.upload
+ * @singleton
+ */
+( function ( mw, $ ) {
+       var nonce = 0,
+               fieldsAllowed = {
+                       stash: true,
+                       filekey: true,
+                       filename: true,
+                       comment: true,
+                       text: true,
+                       watchlist: true,
+                       ignorewarnings: true
+               };
+
+       /**
+        * @private
+        * Get nonce for iframe IDs on the page.
+        *
+        * @return {number}
+        */
+       function getNonce() {
+               return nonce++;
+       }
+
+       /**
+        * @private
+        * Get new iframe object for an upload.
+        *
+        * @return {HTMLIframeElement}
+        */
+       function getNewIframe( id ) {
+               var frame = document.createElement( 'iframe' );
+               frame.id = id;
+               frame.name = id;
+               return frame;
+       }
+
+       /**
+        * @private
+        * Shortcut for getting hidden inputs
+        *
+        * @return {jQuery}
+        */
+       function getHiddenInput( name, val ) {
+               return $( '<input type="hidden" />' )
+                       .attr( 'name', name )
+                       .val( val );
+       }
+
+       /**
+        * Process the result of the form submission, returned to an iframe.
+        * This is the iframe's onload event.
+        *
+        * @param {HTMLIframeElement} iframe Iframe to extract result from
+        * @return {Object} Response from the server. The return value may or may
+        *   not be an XMLDocument, this code was copied from elsewhere, so if you
+        *   see an unexpected return type, please file a bug.
+        */
+       function processIframeResult( iframe ) {
+               var json,
+                       doc = iframe.contentDocument || frames[ iframe.id ].document;
+
+               if ( doc.XMLDocument ) {
+                       // The response is a document property in IE
+                       return doc.XMLDocument;
+               }
+
+               if ( doc.body ) {
+                       // Get the json string
+                       // We're actually searching through an HTML doc here --
+                       // according to mdale we need to do this
+                       // because IE does not load JSON properly in an iframe
+                       json = $( doc.body ).find( 'pre' ).text();
+
+                       return JSON.parse( json );
+               }
+
+               // Response is a xml document
+               return doc;
+       }
+
+       function formDataAvailable() {
+               return window.FormData !== undefined &&
+                       window.File !== undefined &&
+                       window.File.prototype.slice !== undefined;
+       }
+
+       $.extend( mw.Api.prototype, {
+               /**
+                * Upload a file to MediaWiki.
+                *
+                * The file will be uploaded using AJAX and FormData, if the browser supports it, or via an
+                * iframe if it doesn't.
+                *
+                * Caveats of iframe upload:
+                * - The returned jQuery.Promise will not receive `progress` notifications during the upload
+                * - It is incompatible with uploads to a foreign wiki using mw.ForeignApi
+                * - You must pass a HTMLInputElement and not a File for it to be possible
+                *
+                * @param {HTMLInputElement|File} file HTML input type=file element with a file already inside
+                *     of it, or a File object.
+                * @param {Object} data Other upload options, see action=upload API docs for more
+                * @return {jQuery.Promise}
+                */
+               upload: function ( file, data ) {
+                       var isFileInput, canUseFormData;
+
+                       isFileInput = file && file.nodeType === Node.ELEMENT_NODE;
+
+                       if ( formDataAvailable() && isFileInput && file.files ) {
+                               file = file.files[ 0 ];
+                       }
+
+                       if ( !file ) {
+                               return $.Deferred().reject( 'No file' );
+                       }
+
+                       canUseFormData = formDataAvailable() && file instanceof window.File;
+
+                       if ( !isFileInput && !canUseFormData ) {
+                               return $.Deferred().reject( 'Unsupported argument type passed to mw.Api.upload' );
+                       }
+
+                       if ( canUseFormData ) {
+                               return this.uploadWithFormData( file, data );
+                       }
+
+                       return this.uploadWithIframe( file, data );
+               },
+
+               /**
+                * Upload a file to MediaWiki with an iframe and a form.
+                *
+                * This method is necessary for browsers without the File/FormData
+                * APIs, and continues to work in browsers with those APIs.
+                *
+                * The rough sketch of how this method works is as follows:
+                * 1. An iframe is loaded with no content.
+                * 2. A form is submitted with the passed-in file input and some extras.
+                * 3. The MediaWiki API receives that form data, and sends back a response.
+                * 4. The response is sent to the iframe, because we set target=(iframe id)
+                * 5. The response is parsed out of the iframe's document, and passed back
+                *    through the promise.
+                *
+                * @private
+                * @param {HTMLInputElement} file The file input with a file in it.
+                * @param {Object} data Other upload options, see action=upload API docs for more
+                * @return {jQuery.Promise}
+                */
+               uploadWithIframe: function ( file, data ) {
+                       var key,
+                               tokenPromise = $.Deferred(),
+                               api = this,
+                               deferred = $.Deferred(),
+                               nonce = getNonce(),
+                               id = 'uploadframe-' + nonce,
+                               $form = $( '<form>' ),
+                               iframe = getNewIframe( id ),
+                               $iframe = $( iframe );
+
+                       for ( key in data ) {
+                               if ( !fieldsAllowed[ key ] ) {
+                                       delete data[ key ];
+                               }
+                       }
+
+                       data = $.extend( {}, this.defaults.parameters, { action: 'upload' }, data );
+                       $form.addClass( 'mw-api-upload-form' );
+
+                       $form.css( 'display', 'none' )
+                               .attr( {
+                                       action: this.defaults.ajax.url,
+                                       method: 'POST',
+                                       target: id,
+                                       enctype: 'multipart/form-data'
+                               } );
+
+                       $iframe.one( 'load', function () {
+                               $iframe.one( 'load', function () {
+                                       var result = processIframeResult( iframe );
+
+                                       if ( !result ) {
+                                               deferred.reject( 'No response from API on upload attempt.' );
+                                       } else if ( result.error || result.warnings ) {
+                                               if ( result.error && result.error.code === 'badtoken' ) {
+                                                       api.badToken( 'edit' );
+                                               }
+
+                                               deferred.reject( result.error || result.warnings );
+                                       } else {
+                                               deferred.notify( 1 );
+                                               deferred.resolve( result );
+                                       }
+                               } );
+                               tokenPromise.done( function () {
+                                       $form.submit();
+                               } );
+                       } );
+
+                       $iframe.error( function ( error ) {
+                               deferred.reject( 'iframe failed to load: ' + error );
+                       } );
+
+                       $iframe.prop( 'src', 'about:blank' ).hide();
+
+                       file.name = 'file';
+
+                       $.each( data, function ( key, val ) {
+                               $form.append( getHiddenInput( key, val ) );
+                       } );
+
+                       if ( !data.filename && !data.stash ) {
+                               return $.Deferred().reject( 'Filename not included in file data.' );
+                       }
+
+                       if ( this.needToken() ) {
+                               this.getEditToken().then( function ( token ) {
+                                       $form.append( getHiddenInput( 'token', token ) );
+                                       tokenPromise.resolve();
+                               }, tokenPromise.reject );
+                       } else {
+                               tokenPromise.resolve();
+                       }
+
+                       $( 'body' ).append( $form, $iframe );
+
+                       deferred.always( function () {
+                               $form.remove();
+                               $iframe.remove();
+                       } );
+
+                       return deferred.promise();
+               },
+
+               /**
+                * Uploads a file using the FormData API.
+                *
+                * @private
+                * @param {File} file
+                * @param {Object} data Other upload options, see action=upload API docs for more
+                * @return {jQuery.Promise}
+                */
+               uploadWithFormData: function ( file, data ) {
+                       var key,
+                               deferred = $.Deferred();
+
+                       for ( key in data ) {
+                               if ( !fieldsAllowed[ key ] ) {
+                                       delete data[ key ];
+                               }
+                       }
+
+                       data = $.extend( {}, this.defaults.parameters, { action: 'upload' }, data );
+                       data.file = file;
+
+                       if ( !data.filename && !data.stash ) {
+                               return $.Deferred().reject( 'Filename not included in file data.' );
+                       }
+
+                       // Use this.postWithEditToken() or this.post()
+                       this[ this.needToken() ? 'postWithEditToken' : 'post' ]( data, {
+                               // Use FormData (if we got here, we know that it's available)
+                               contentType: 'multipart/form-data',
+                               // Provide upload progress notifications
+                               xhr: function () {
+                                       var xhr = $.ajaxSettings.xhr();
+                                       if ( xhr.upload ) {
+                                               // need to bind this event before we open the connection (see note at
+                                               // https://developer.mozilla.org/en-US/docs/DOM/XMLHttpRequest/Using_XMLHttpRequest#Monitoring_progress)
+                                               xhr.upload.addEventListener( 'progress', function ( ev ) {
+                                                       if ( ev.lengthComputable ) {
+                                                               deferred.notify( ev.loaded / ev.total );
+                                                       }
+                                               } );
+                                       }
+                                       return xhr;
+                               }
+                       } )
+                               .done( function ( result ) {
+                                       if ( result.error || result.warnings ) {
+                                               deferred.reject( result.error || result.warnings );
+                                       } else {
+                                               deferred.notify( 1 );
+                                               deferred.resolve( result );
+                                       }
+                               } )
+                               .fail( function ( result ) {
+                                       deferred.reject( result );
+                               } );
+
+                       return deferred.promise();
+               },
+
+               /**
+                * Upload a file to the stash.
+                *
+                * This function will return a promise, which when resolved, will pass back a function
+                * to finish the stash upload. You can call that function with an argument containing
+                * more, or conflicting, data to pass to the server. For example:
+                *
+                *     // upload a file to the stash with a placeholder filename
+                *     api.uploadToStash( file, { filename: 'testing.png' } ).done( function ( finish ) {
+                *         // finish is now the function we can use to finalize the upload
+                *         // pass it a new filename from user input to override the initial value
+                *         finish( { filename: getFilenameFromUser() } ).done( function ( data ) {
+                *             // the upload is complete, data holds the API response
+                *         } );
+                *     } );
+                *
+                * @param {File|HTMLInputElement} file
+                * @param {Object} [data]
+                * @return {jQuery.Promise}
+                * @return {Function} return.finishStashUpload Call this function to finish the upload.
+                * @return {Object} return.finishStashUpload.data Additional data for the upload.
+                * @return {jQuery.Promise} return.finishStashUpload.return API promise for the final upload
+                * @return {Object} return.finishStashUpload.return.data API return value for the final upload
+                */
+               uploadToStash: function ( file, data ) {
+                       var filekey,
+                               api = this;
+
+                       if ( !data.filename ) {
+                               return $.Deferred().reject( 'Filename not included in file data.' );
+                       }
+
+                       function finishUpload( moreData ) {
+                               data = $.extend( data, moreData );
+                               data.filekey = filekey;
+                               data.action = 'upload';
+                               data.format = 'json';
+
+                               if ( !data.filename ) {
+                                       return $.Deferred().reject( 'Filename not included in file data.' );
+                               }
+
+                               return api.postWithEditToken( data ).then( function ( result ) {
+                                       if ( result.upload && ( result.upload.error || result.upload.warnings ) ) {
+                                               return $.Deferred().reject( result.upload.error || result.upload.warnings ).promise();
+                                       }
+                                       return result;
+                               } );
+                       }
+
+                       return this.upload( file, { stash: true, filename: data.filename } ).then( function ( result ) {
+                               if ( result && result.upload && result.upload.filekey ) {
+                                       filekey = result.upload.filekey;
+                               } else if ( result && ( result.error || result.warning ) ) {
+                                       return $.Deferred().reject( result );
+                               }
+
+                               return finishUpload;
+                       } );
+               },
+
+               needToken: function () {
+                       return true;
+               }
+       } );
+
+       /**
+        * @class mw.Api
+        * @mixins mw.Api.plugin.upload
+        */
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/api/watch.js b/resources/src/mediawiki/api/watch.js
new file mode 100644 (file)
index 0000000..a2ff129
--- /dev/null
@@ -0,0 +1,70 @@
+/**
+ * @class mw.Api.plugin.watch
+ * @since 1.19
+ */
+( function ( mw, $ ) {
+
+       /**
+        * @private
+        * @static
+        * @context mw.Api
+        *
+        * @param {string|mw.Title|string[]|mw.Title[]} pages Full page name or instance of mw.Title, or an
+        *  array thereof. If an array is passed, the return value passed to the promise will also be an
+        *  array of appropriate objects.
+        * @return {jQuery.Promise}
+        * @return {Function} return.done
+        * @return {Object|Object[]} return.done.watch Object or list of objects (depends on the `pages`
+        *  parameter)
+        * @return {string} return.done.watch.title Full pagename
+        * @return {boolean} return.done.watch.watched Whether the page is now watched or unwatched
+        * @return {string} return.done.watch.message Parsed HTML of the confirmational interface message
+        */
+       function doWatchInternal( pages, addParams ) {
+               // XXX: Parameter addParams is undocumented because we inherit this
+               // documentation in the public method...
+               var apiPromise = this.postWithToken( 'watch',
+                       $.extend(
+                               {
+                                       action: 'watch',
+                                       titles: $.isArray( pages ) ? pages.join( '|' ) : String( pages ),
+                                       uselang: mw.config.get( 'wgUserLanguage' )
+                               },
+                               addParams
+                       )
+               );
+
+               return apiPromise
+                       .then( function ( data ) {
+                               // If a single page was given (not an array) respond with a single item as well.
+                               return $.isArray( pages ) ? data.watch : data.watch[ 0 ];
+                       } )
+                       .promise( { abort: apiPromise.abort } );
+       }
+
+       $.extend( mw.Api.prototype, {
+               /**
+                * Convenience method for `action=watch`.
+                *
+                * @inheritdoc #doWatchInternal
+                */
+               watch: function ( pages ) {
+                       return doWatchInternal.call( this, pages );
+               },
+
+               /**
+                * Convenience method for `action=watch&unwatch=1`.
+                *
+                * @inheritdoc #doWatchInternal
+                */
+               unwatch: function ( pages ) {
+                       return doWatchInternal.call( this, pages, { unwatch: 1 } );
+               }
+       } );
+
+       /**
+        * @class mw.Api
+        * @mixins mw.Api.plugin.watch
+        */
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/page/gallery-print.css b/resources/src/mediawiki/page/gallery-print.css
new file mode 100644 (file)
index 0000000..0c14865
--- /dev/null
@@ -0,0 +1,35 @@
+li.gallerybox {
+       vertical-align: top;
+       display: inline-block;
+}
+
+ul.gallery, li.gallerybox {
+       zoom: 1;
+       *display: inline;
+}
+
+ul.gallery {
+       margin: 2px;
+       padding: 2px;
+       display: block;
+}
+
+li.gallerycaption {
+       font-weight: bold;
+       text-align: center;
+       display: block;
+       word-wrap: break-word;
+}
+
+li.gallerybox div.thumb {
+       text-align: center;
+       border: 1px solid #ccc;
+       margin: 2px;
+}
+
+div.gallerytext {
+       overflow: hidden;
+       font-size: 94%;
+       padding: 2px 4px;
+       word-wrap: break-word;
+}
diff --git a/resources/src/mediawiki/page/gallery.css b/resources/src/mediawiki/page/gallery.css
new file mode 100644 (file)
index 0000000..20deb21
--- /dev/null
@@ -0,0 +1,101 @@
+/* Galleries */
+/* These display attributes look nonsensical, but are needed to support IE and FF2 */
+/* Don't forget to update mediawiki.page.gallery.print.css */
+li.gallerybox {
+       vertical-align: top;
+       display: -moz-inline-box;
+       display: inline-block;
+}
+
+ul.gallery,
+li.gallerybox {
+       zoom: 1;
+       *display: inline;
+}
+
+ul.gallery {
+       margin: 2px;
+       padding: 2px;
+       display: block;
+}
+
+li.gallerycaption {
+       font-weight: bold;
+       text-align: center;
+       display: block;
+       word-wrap: break-word;
+}
+
+li.gallerybox div.thumb {
+       text-align: center;
+       border: 1px solid #ccc;
+       background-color: #f9f9f9;
+       margin: 2px;
+}
+
+li.gallerybox div.thumb img {
+       display: block;
+       margin: 0 auto;
+}
+
+div.gallerytext {
+       overflow: hidden;
+       font-size: 94%;
+       padding: 2px 4px;
+       word-wrap: break-word;
+}
+
+/* new gallery stuff */
+ul.mw-gallery-nolines li.gallerybox div.thumb {
+       background-color: transparent;
+       border: none;
+}
+
+ul.mw-gallery-nolines li.gallerybox div.gallerytext {
+       text-align: center;
+}
+
+/* height constrained gallery */
+
+ul.mw-gallery-packed li.gallerybox div.thumb,
+ul.mw-gallery-packed-overlay li.gallerybox div.thumb,
+ul.mw-gallery-packed-hover li.gallerybox div.thumb {
+       background-color: transparent;
+       border: none;
+}
+
+ul.mw-gallery-packed li.gallerybox div.thumb img,
+ul.mw-gallery-packed-overlay li.gallerybox div.thumb img,
+ul.mw-gallery-packed-hover li.gallerybox div.thumb img {
+       margin: 0 auto;
+}
+
+ul.mw-gallery-packed-hover li.gallerybox,
+ul.mw-gallery-packed-overlay li.gallerybox {
+       position: relative;
+}
+
+ul.mw-gallery-packed-hover div.gallerytextwrapper {
+       overflow: hidden;
+       height: 0;
+}
+
+ul.mw-gallery-packed-hover li.gallerybox:hover div.gallerytextwrapper,
+ul.mw-gallery-packed-overlay li.gallerybox div.gallerytextwrapper,
+ul.mw-gallery-packed-hover li.gallerybox.mw-gallery-focused div.gallerytextwrapper {
+       position: absolute;
+       background: white;
+       background: rgba(255, 255, 255, 0.8);
+       padding: 5px 10px;
+       bottom: 0;
+       left: 0; /* Needed for IE */
+       height: auto;
+       font-weight: bold;
+       margin: 2px; /* correspond to style on div.thumb */
+}
+
+ul.mw-gallery-packed-hover,
+ul.mw-gallery-packed-overlay,
+ul.mw-gallery-packed {
+       text-align: center;
+}
diff --git a/resources/src/mediawiki/page/gallery.js b/resources/src/mediawiki/page/gallery.js
new file mode 100644 (file)
index 0000000..dfccf21
--- /dev/null
@@ -0,0 +1,268 @@
+/*!
+ * Show gallery captions when focused. Copied directly from jquery.mw-jump.js.
+ * Also Dynamically resize images to justify them.
+ */
+( function ( mw, $ ) {
+       var $galleries,
+               bound = false,
+               // Is there a better way to detect a touchscreen? Current check taken from stack overflow.
+               isTouchScreen = !!( window.ontouchstart !== undefined ||
+                       window.DocumentTouch !== undefined && document instanceof window.DocumentTouch
+               );
+
+       /**
+        * Perform the layout justification.
+        *
+        * @ignore
+        * @context {HTMLElement} A `ul.mw-gallery-*` element
+        */
+       function justify() {
+               var lastTop,
+                       $img,
+                       imgWidth,
+                       imgHeight,
+                       captionWidth,
+                       rows = [],
+                       $gallery = $( this );
+
+               $gallery.children( 'li' ).each( function () {
+                       // Math.floor to be paranoid if things are off by 0.00000000001
+                       var top = Math.floor( $( this ).position().top ),
+                               $this = $( this );
+
+                       if ( top !== lastTop ) {
+                               rows[ rows.length ] = [];
+                               lastTop = top;
+                       }
+
+                       $img = $this.find( 'div.thumb a.image img' );
+                       if ( $img.length && $img[ 0 ].height ) {
+                               imgHeight = $img[ 0 ].height;
+                               imgWidth = $img[ 0 ].width;
+                       } else {
+                               // If we don't have a real image, get the containing divs width/height.
+                               // Note that if we do have a real image, using this method will generally
+                               // give the same answer, but can be different in the case of a very
+                               // narrow image where extra padding is added.
+                               imgHeight = $this.children().children( 'div:first' ).height();
+                               imgWidth = $this.children().children( 'div:first' ).width();
+                       }
+
+                       // Hack to make an edge case work ok
+                       if ( imgHeight < 30 ) {
+                               // Don't try and resize this item.
+                               imgHeight = 0;
+                       }
+
+                       captionWidth = $this.children().children( 'div.gallerytextwrapper' ).width();
+                       rows[ rows.length - 1 ][ rows[ rows.length - 1 ].length ] = {
+                               $elm: $this,
+                               width: $this.outerWidth(),
+                               imgWidth: imgWidth,
+                               // XXX: can divide by 0 ever happen?
+                               aspect: imgWidth / imgHeight,
+                               captionWidth: captionWidth,
+                               height: imgHeight
+                       };
+
+                       // Save all boundaries so we can restore them on window resize
+                       $this.data( 'imgWidth', imgWidth );
+                       $this.data( 'imgHeight', imgHeight );
+                       $this.data( 'width', $this.outerWidth() );
+                       $this.data( 'captionWidth', captionWidth );
+               } );
+
+               ( function () {
+                       var maxWidth,
+                               combinedAspect,
+                               combinedPadding,
+                               curRow,
+                               curRowHeight,
+                               wantedWidth,
+                               preferredHeight,
+                               newWidth,
+                               padding,
+                               $outerDiv,
+                               $innerDiv,
+                               $imageDiv,
+                               $imageElm,
+                               imageElm,
+                               $caption,
+                               i,
+                               j,
+                               avgZoom,
+                               totalZoom = 0;
+
+                       for ( i = 0; i < rows.length; i++ ) {
+                               maxWidth = $gallery.width();
+                               combinedAspect = 0;
+                               combinedPadding = 0;
+                               curRow = rows[ i ];
+                               curRowHeight = 0;
+
+                               for ( j = 0; j < curRow.length; j++ ) {
+                                       if ( curRowHeight === 0 ) {
+                                               if ( isFinite( curRow[ j ].height ) ) {
+                                                       // Get the height of this row, by taking the first
+                                                       // non-out of bounds height
+                                                       curRowHeight = curRow[ j ].height;
+                                               }
+                                       }
+
+                                       if ( curRow[ j ].aspect === 0 || !isFinite( curRow[ j ].aspect ) ) {
+                                               // One of the dimensions are 0. Probably should
+                                               // not try to resize.
+                                               combinedPadding += curRow[ j ].width;
+                                       } else {
+                                               combinedAspect += curRow[ j ].aspect;
+                                               combinedPadding += curRow[ j ].width - curRow[ j ].imgWidth;
+                                       }
+                               }
+
+                               // Add some padding for inter-element spacing.
+                               combinedPadding += 5 * curRow.length;
+                               wantedWidth = maxWidth - combinedPadding;
+                               preferredHeight = wantedWidth / combinedAspect;
+
+                               if ( preferredHeight > curRowHeight * 1.5 ) {
+                                       // Only expand at most 1.5 times current size
+                                       // As that's as high a resolution as we have.
+                                       // Also on the off chance there is a bug in this
+                                       // code, would prevent accidentally expanding to
+                                       // be 10 billion pixels wide.
+                                       if ( i === rows.length - 1 ) {
+                                               // If its the last row, and we can't fit it,
+                                               // don't make the entire row huge.
+                                               avgZoom = ( totalZoom / ( rows.length - 1 ) ) * curRowHeight;
+                                               if ( isFinite( avgZoom ) && avgZoom >= 1 && avgZoom <= 1.5 ) {
+                                                       preferredHeight = avgZoom;
+                                               } else {
+                                                       // Probably a single row gallery
+                                                       preferredHeight = curRowHeight;
+                                               }
+                                       } else {
+                                               preferredHeight = 1.5 * curRowHeight;
+                                       }
+                               }
+                               if ( !isFinite( preferredHeight ) ) {
+                                       // This *definitely* should not happen.
+                                       // Skip this row.
+                                       continue;
+                               }
+                               if ( preferredHeight < 5 ) {
+                                       // Well something clearly went wrong...
+                                       // Skip this row.
+                                       continue;
+                               }
+
+                               if ( preferredHeight / curRowHeight > 1 ) {
+                                       totalZoom += preferredHeight / curRowHeight;
+                               } else {
+                                       // If we shrink, still consider that a zoom of 1
+                                       totalZoom += 1;
+                               }
+
+                               for ( j = 0; j < curRow.length; j++ ) {
+                                       newWidth = preferredHeight * curRow[ j ].aspect;
+                                       padding = curRow[ j ].width - curRow[ j ].imgWidth;
+                                       $outerDiv = curRow[ j ].$elm;
+                                       $innerDiv = $outerDiv.children( 'div' ).first();
+                                       $imageDiv = $innerDiv.children( 'div.thumb' );
+                                       $imageElm = $imageDiv.find( 'img' ).first();
+                                       imageElm = $imageElm.length ? $imageElm[ 0 ] : null;
+                                       $caption = $outerDiv.find( 'div.gallerytextwrapper' );
+
+                                       // Since we are going to re-adjust the height, the vertical
+                                       // centering margins need to be reset.
+                                       $imageDiv.children( 'div' ).css( 'margin', '0px auto' );
+
+                                       if ( newWidth < 60 || !isFinite( newWidth ) ) {
+                                               // Making something skinnier than this will mess up captions,
+                                               if ( newWidth < 1 || !isFinite( newWidth ) ) {
+                                                       $innerDiv.height( preferredHeight );
+                                                       // Don't even try and touch the image size if it could mean
+                                                       // making it disappear.
+                                                       continue;
+                                               }
+                                       } else {
+                                               $outerDiv.width( newWidth + padding );
+                                               $innerDiv.width( newWidth + padding );
+                                               $imageDiv.width( newWidth );
+                                               $caption.width( curRow[ j ].captionWidth + ( newWidth - curRow[ j ].imgWidth ) );
+                                       }
+
+                                       if ( imageElm ) {
+                                               // We don't always have an img, e.g. in the case of an invalid file.
+                                               imageElm.width = newWidth;
+                                               imageElm.height = preferredHeight;
+                                       } else {
+                                               // Not a file box.
+                                               $imageDiv.height( preferredHeight );
+                                       }
+                               }
+                       }
+               }() );
+       }
+
+       function handleResizeStart() {
+               $galleries.children( 'li' ).each( function () {
+                       var imgWidth = $( this ).data( 'imgWidth' ),
+                               imgHeight = $( this ).data( 'imgHeight' ),
+                               width = $( this ).data( 'width' ),
+                               captionWidth = $( this ).data( 'captionWidth' ),
+                               $innerDiv = $( this ).children( 'div' ).first(),
+                               $imageDiv = $innerDiv.children( 'div.thumb' ),
+                               $imageElm, imageElm;
+
+                       // Restore original sizes so we can arrange the elements as on freshly loaded page
+                       $( this ).width( width );
+                       $innerDiv.width( width );
+                       $imageDiv.width( imgWidth );
+                       $( this ).find( 'div.gallerytextwrapper' ).width( captionWidth );
+
+                       $imageElm = $( this ).find( 'img' ).first();
+                       imageElm = $imageElm.length ? $imageElm[ 0 ] : null;
+                       if ( imageElm ) {
+                               imageElm.width = imgWidth;
+                               imageElm.height = imgHeight;
+                       } else {
+                               $imageDiv.height( imgHeight );
+                       }
+               } );
+       }
+
+       function handleResizeEnd() {
+               $galleries.each( justify );
+       }
+
+       mw.hook( 'wikipage.content' ).add( function ( $content ) {
+               if ( isTouchScreen ) {
+                       // Always show the caption for a touch screen.
+                       $content.find( 'ul.mw-gallery-packed-hover' )
+                               .addClass( 'mw-gallery-packed-overlay' )
+                               .removeClass( 'mw-gallery-packed-hover' );
+               } else {
+                       // Note use of just "a", not a.image, since we want this to trigger if a link in
+                       // the caption receives focus
+                       $content.find( 'ul.mw-gallery-packed-hover li.gallerybox' ).on( 'focus blur', 'a', function ( e ) {
+                               // Confusingly jQuery leaves e.type as focusout for delegated blur events
+                               var gettingFocus = e.type !== 'blur' && e.type !== 'focusout';
+                               $( this ).closest( 'li.gallerybox' ).toggleClass( 'mw-gallery-focused', gettingFocus );
+                       } );
+               }
+
+               $galleries = $content.find( 'ul.mw-gallery-packed-overlay, ul.mw-gallery-packed-hover, ul.mw-gallery-packed' );
+               // Call the justification asynchronous because live preview fires the hook with detached $content.
+               setTimeout( function () {
+                       $galleries.each( justify );
+
+                       // Bind here instead of in the top scope as the callbacks use $galleries.
+                       if ( !bound ) {
+                               bound = true;
+                               $( window )
+                                       .resize( $.debounce( 300, true, handleResizeStart ) )
+                                       .resize( $.debounce( 300, handleResizeEnd ) );
+                       }
+               } );
+       } );
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/page/image-pagination.js b/resources/src/mediawiki/page/image-pagination.js
new file mode 100644 (file)
index 0000000..49a51df
--- /dev/null
@@ -0,0 +1,143 @@
+/*!
+ * Implement AJAX navigation for multi-page images so the user may browse without a full page reload.
+ */
+( function ( mw, $ ) {
+       /*jshint latedef:false */
+       var jqXhr, $multipageimage, $spinner,
+               cache = {},
+               cacheOrder = [];
+
+       /* Fetch the next page, caching up to 10 last-loaded pages.
+        * @param {string} url
+        * @return {jQuery.Promise}
+        */
+       function fetchPageData( url ) {
+               if ( jqXhr && jqXhr.abort ) {
+                       // Prevent race conditions and piling up pending requests
+                       jqXhr.abort();
+               }
+               jqXhr = undefined;
+
+               // Try the cache
+               if ( cache[ url ] ) {
+                       // Update access freshness
+                       cacheOrder.splice( $.inArray( url, cacheOrder ), 1 );
+                       cacheOrder.push( url );
+                       return $.Deferred().resolve( cache[ url ] ).promise();
+               }
+
+               // @todo Don't fetch the entire page. Ideally we'd only fetch the content portion or the data
+               // (thumbnail urls) and update the interface manually.
+               jqXhr = $.ajax( url ).then( function ( data ) {
+                       return $( data ).find( 'table.multipageimage' ).contents();
+               } );
+
+               // Handle cache updates
+               jqXhr.done( function ( $contents ) {
+                       jqXhr = undefined;
+
+                       // Cache the newly loaded page
+                       cache[ url ] = $contents;
+                       cacheOrder.push( url );
+
+                       // Remove the oldest entry if we're over the limit
+                       if ( cacheOrder.length > 10 ) {
+                               delete cache[ cacheOrder[ 0 ] ];
+                               cacheOrder = cacheOrder.slice( 1 );
+                       }
+               } );
+
+               return jqXhr.promise();
+       }
+
+       /* Fetch the next page and use jQuery to swap the table.multipageimage contents.
+        * @param {string} url
+        * @param {boolean} [hist=false] Whether this is a load triggered by history navigation (if
+        *   true, this function won't push a new history state, for the browser did so already).
+        */
+       function switchPage( url, hist ) {
+               var $tr, promise;
+
+               // Start fetching data (might be cached)
+               promise = fetchPageData( url );
+
+               // Add a new spinner if one doesn't already exist and the data is not already ready
+               if ( !$spinner && promise.state() !== 'resolved' ) {
+                       $tr = $multipageimage.find( 'tr' );
+                       $spinner = $.createSpinner( {
+                               size: 'large',
+                               type: 'block'
+                       } )
+                               // Copy the old content dimensions equal so that the current scroll position is not
+                               // lost between emptying the table is and receiving the new contents.
+                               .css( {
+                                       height: $tr.outerHeight(),
+                                       width: $tr.outerWidth()
+                               } );
+
+                       $multipageimage.empty().append( $spinner );
+               }
+
+               promise.done( function ( $contents ) {
+                       $spinner = undefined;
+
+                       // Replace table contents
+                       $multipageimage.empty().append( $contents.clone() );
+
+                       bindPageNavigation( $multipageimage );
+
+                       // Fire hook because the page's content has changed
+                       mw.hook( 'wikipage.content' ).fire( $multipageimage );
+
+                       // Update browser history and address bar. But not if we came here from a history
+                       // event, in which case the url is already updated by the browser.
+                       if ( history.pushState && !hist ) {
+                               history.pushState( { tag: 'mw-pagination' }, document.title, url );
+                       }
+               } );
+       }
+
+       function bindPageNavigation( $container ) {
+               $container.find( '.multipageimagenavbox' ).one( 'click', 'a', function ( e ) {
+                       var page, uri;
+
+                       // Generate the same URL on client side as the one generated in ImagePage::openShowImage.
+                       // We avoid using the URL in the link directly since it could have been manipulated (bug 66608)
+                       page = Number( mw.util.getParamValue( 'page', this.href ) );
+                       uri = new mw.Uri( mw.util.wikiScript() )
+                               .extend( { title: mw.config.get( 'wgPageName' ), page: page } )
+                               .toString();
+
+                       switchPage( uri );
+                       e.preventDefault();
+               } );
+
+               $container.find( 'form[name="pageselector"]' ).one( 'change submit', function ( e ) {
+                       switchPage( this.action + '?' + $( this ).serialize() );
+                       e.preventDefault();
+               } );
+       }
+
+       $( function () {
+               if ( mw.config.get( 'wgNamespaceNumber' ) !== 6 ) {
+                       return;
+               }
+               $multipageimage = $( 'table.multipageimage' );
+               if ( !$multipageimage.length ) {
+                       return;
+               }
+
+               bindPageNavigation( $multipageimage );
+
+               // Update the url using the History API (if available)
+               if ( history.pushState && history.replaceState ) {
+                       history.replaceState( { tag: 'mw-pagination' }, '' );
+                       $( window ).on( 'popstate', function ( e ) {
+                               var state = e.originalEvent.state;
+                               if ( state && state.tag === 'mw-pagination' ) {
+                                       switchPage( location.href, true );
+                               }
+                       } );
+               }
+       } );
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/page/patrol.js b/resources/src/mediawiki/page/patrol.js
new file mode 100644 (file)
index 0000000..f9b0d35
--- /dev/null
@@ -0,0 +1,65 @@
+/*!
+ * Animate patrol links to use asynchronous API requests to
+ * patrol pages, rather than navigating to a different URI.
+ *
+ * @since 1.21
+ * @author Marius Hoch <hoo@online.de>
+ */
+( function ( mw, $ ) {
+       if ( !mw.user.tokens.exists( 'patrolToken' ) ) {
+               // Current user has no patrol right, or an old cached version of user.tokens
+               // that didn't have patrolToken yet.
+               return;
+       }
+       $( function () {
+               var $patrolLinks = $( '.patrollink a' );
+               $patrolLinks.on( 'click', function ( e ) {
+                       var $spinner, href, rcid, apiRequest;
+
+                       // Start preloading the notification module (normally loaded by mw.notify())
+                       mw.loader.load( 'mediawiki.notification' );
+
+                       // Hide the link and create a spinner to show it inside the brackets.
+                       $spinner = $.createSpinner( {
+                               size: 'small',
+                               type: 'inline'
+                       } );
+                       $( this ).hide().after( $spinner );
+
+                       href = $( this ).attr( 'href' );
+                       rcid = mw.util.getParamValue( 'rcid', href );
+                       apiRequest = new mw.Api();
+
+                       apiRequest.postWithToken( 'patrol', {
+                               action: 'patrol',
+                               rcid: rcid
+                       } )
+                       .done( function ( data ) {
+                               // Remove all patrollinks from the page (including any spinners inside).
+                               $patrolLinks.closest( '.patrollink' ).remove();
+                               if ( data.patrol !== undefined ) {
+                                       // Success
+                                       var title = new mw.Title( data.patrol.title );
+                                       mw.notify( mw.msg( 'markedaspatrollednotify', title.toText() ) );
+                               } else {
+                                       // This should never happen as errors should trigger fail
+                                       mw.notify( mw.msg( 'markedaspatrollederrornotify' ), { type: 'error' } );
+                               }
+                       } )
+                       .fail( function ( error ) {
+                               $spinner.remove();
+                               // Restore the patrol link. This allows the user to try again
+                               // (or open it in a new window, bypassing this ajax module).
+                               $patrolLinks.show();
+                               if ( error === 'noautopatrol' ) {
+                                       // Can't patrol own
+                                       mw.notify( mw.msg( 'markedaspatrollederror-noautopatrol' ), { type: 'warn' } );
+                               } else {
+                                       mw.notify( mw.msg( 'markedaspatrollederrornotify' ), { type: 'error' } );
+                               }
+                       } );
+
+                       e.preventDefault();
+               } );
+       } );
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/page/ready.js b/resources/src/mediawiki/page/ready.js
new file mode 100644 (file)
index 0000000..8ec4cf0
--- /dev/null
@@ -0,0 +1,74 @@
+( function ( mw, $ ) {
+       var supportsPlaceholder = 'placeholder' in document.createElement( 'input' );
+
+       // Break out of framesets
+       if ( mw.config.get( 'wgBreakFrames' ) ) {
+               // Note: In IE < 9 strict comparison to window is non-standard (the standard didn't exist yet)
+               // it works only comparing to window.self or window.window (http://stackoverflow.com/q/4850978/319266)
+               if ( window.top !== window.self ) {
+                       // Un-trap us from framesets
+                       window.top.location.href = location.href;
+               }
+       }
+
+       mw.hook( 'wikipage.content' ).add( function ( $content ) {
+               var $sortableTables;
+
+               // Run jquery.placeholder polyfill if placeholder is not supported
+               if ( !supportsPlaceholder ) {
+                       $content.find( 'input[placeholder]' ).placeholder();
+               }
+
+               // Run jquery.makeCollapsible
+               $content.find( '.mw-collapsible' ).makeCollapsible();
+
+               // Lazy load jquery.tablesorter
+               $sortableTables = $content.find( 'table.sortable' );
+               if ( $sortableTables.length ) {
+                       mw.loader.using( 'jquery.tablesorter', function () {
+                               $sortableTables.tablesorter();
+                       } );
+               }
+
+               // Run jquery.checkboxShiftClick
+               $content.find( 'input[type="checkbox"]:not(.noshiftselect)' ).checkboxShiftClick();
+       } );
+
+       // Things outside the wikipage content
+       $( function () {
+               var $nodes;
+
+               if ( !supportsPlaceholder ) {
+                       // Exclude content to avoid hitting it twice for the (first) wikipage content
+                       $( 'input[placeholder]' ).not( '#mw-content-text input' ).placeholder();
+               }
+
+               // Add accesskey hints to the tooltips
+               if ( document.querySelectorAll ) {
+                       // If we're running on a browser where we can do this efficiently,
+                       // just find all elements that have accesskeys. We can't use jQuery's
+                       // polyfill for the selector since looping over all elements on page
+                       // load might be too slow.
+                       $nodes = $( document.querySelectorAll( '[accesskey]' ) );
+               } else {
+                       // Otherwise go through some elements likely to have accesskeys rather
+                       // than looping over all of them. Unfortunately this will not fully
+                       // work for custom skins with different HTML structures. Input, label
+                       // and button should be rare enough that no optimizations are needed.
+                       $nodes = $( '#column-one a, #mw-head a, #mw-panel a, #p-logo a, input, label, button' );
+               }
+               $nodes.updateTooltipAccessKeys();
+
+               // Infuse OOUI widgets, if any are present
+               $nodes = $( '[data-ooui]' );
+               if ( $nodes.length ) {
+                       mw.loader.using( 'mediawiki.widgets' ).done( function () {
+                               $nodes.each( function () {
+                                       OO.ui.infuse( this );
+                               } );
+                       } );
+               }
+
+       } );
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/page/startup.js b/resources/src/mediawiki/page/startup.js
new file mode 100644 (file)
index 0000000..708dcb5
--- /dev/null
@@ -0,0 +1,32 @@
+( function ( mw, $ ) {
+
+       // Support: MediaWiki < 1.26
+       // Cached HTML will not yet have this from OutputPage::getHeadScripts.
+       document.documentElement.className = document.documentElement.className
+               .replace( /(^|\s)client-nojs(\s|$)/, '$1client-js$2' );
+
+       mw.page = {};
+
+       $( function () {
+               mw.util.init();
+
+               /**
+                * Fired when wiki content is being added to the DOM
+                *
+                * It is encouraged to fire it before the main DOM is changed (when $content
+                * is still detatched).  However, this order is not defined either way, so you
+                * should only rely on $content itself.
+                *
+                * This includes the ready event on a page load (including post-edit loads)
+                * and when content has been previewed with LivePreview.
+                *
+                * @event wikipage_content
+                * @member mw.hook
+                * @param {jQuery} $content The most appropriate element containing the content,
+                *   such as #mw-content-text (regular content root) or #wikiPreview (live preview
+                *   root)
+                */
+               mw.hook( 'wikipage.content' ).fire( $( '#mw-content-text' ) );
+       } );
+
+}( mediaWiki, jQuery ) );
diff --git a/resources/src/mediawiki/page/watch.js b/resources/src/mediawiki/page/watch.js
new file mode 100644 (file)
index 0000000..a3197da
--- /dev/null
@@ -0,0 +1,181 @@
+/**
+ * Animate watch/unwatch links to use asynchronous API requests to
+ * watch pages, rather than navigating to a different URI.
+ *
+ * @class mw.page.watch.ajax
+ */
+( function ( mw, $ ) {
+       // The name of the page to watch or unwatch
+       var title = mw.config.get( 'wgRelevantPageName' );
+
+       /**
+        * Update the link text, link href attribute and (if applicable)
+        * "loading" class.
+        *
+        * @param {jQuery} $link Anchor tag of (un)watch link
+        * @param {string} action One of 'watch', 'unwatch'
+        * @param {string} [state="idle"] 'idle' or 'loading'. Default is 'idle'
+        */
+       function updateWatchLink( $link, action, state ) {
+               var msgKey, $li, otherAction;
+
+               // A valid but empty jQuery object shouldn't throw a TypeError
+               if ( !$link.length ) {
+                       return;
+               }
+
+               // Invalid actions shouldn't silently turn the page in an unrecoverable state
+               if ( action !== 'watch' && action !== 'unwatch' ) {
+                       throw new Error( 'Invalid action' );
+               }
+
+               // message keys 'watch', 'watching', 'unwatch' or 'unwatching'.
+               msgKey = state === 'loading' ? action + 'ing' : action;
+               otherAction = action === 'watch' ? 'unwatch' : 'watch';
+               $li = $link.closest( 'li' );
+
+               // Trigger a 'watchpage' event for this List item.
+               // Announce the otherAction value as the first param.
+               // Used to monitor the state of watch link.
+               // TODO: Revise when system wide hooks are implemented
+               if ( state === undefined ) {
+                       $li.trigger( 'watchpage.mw', otherAction );
+               }
+
+               $link
+                       .text( mw.msg( msgKey ) )
+                       .attr( 'title', mw.msg( 'tooltip-ca-' + action ) )
+                       .updateTooltipAccessKeys()
+                       .attr( 'href', mw.util.wikiScript() + '?' + $.param( {
+                                       title: title,
+                                       action: action
+                               } )
+                       );
+
+               // Most common ID style
+               if ( $li.prop( 'id' ) === 'ca-' + otherAction ) {
+                       $li.prop( 'id', 'ca-' + action );
+               }
+
+               if ( state === 'loading' ) {
+                       $link.addClass( 'loading' );
+               } else {
+                       $link.removeClass( 'loading' );
+               }
+       }
+
+       /**
+        * TODO: This should be moved somewhere more accessible.
+        *
+        * @private
+        * @param {string} url
+        * @return {string} The extracted action, defaults to 'view'
+        */
+       function mwUriGetAction( url ) {
+               var action, actionPaths, key, i, m, parts;
+
+               // TODO: Does MediaWiki give action path or query param
+               // precedence? If the former, move this to the bottom
+               action = mw.util.getParamValue( 'action', url );
+               if ( action !== null ) {
+                       return action;
+               }
+
+               actionPaths = mw.config.get( 'wgActionPaths' );
+               for ( key in actionPaths ) {
+                       if ( actionPaths.hasOwnProperty( key ) ) {
+                               parts = actionPaths[ key ].split( '$1' );
+                               for ( i = 0; i < parts.length; i++ ) {
+                                       parts[ i ] = mw.RegExp.escape( parts[ i ] );
+                               }
+                               m = new RegExp( parts.join( '(.+)' ) ).exec( url );
+                               if ( m && m[ 1 ] ) {
+                                       return key;
+                               }
+
+                       }
+               }
+
+               return 'view';
+       }
+
+       // Expose public methods
+       mw.page.watch = {
+               updateWatchLink: updateWatchLink
+       };
+
+       $( function () {
+               var $links = $( '.mw-watchlink a, a.mw-watchlink, ' +
+                       '#ca-watch a, #ca-unwatch a, #mw-unwatch-link1, ' +
+                       '#mw-unwatch-link2, #mw-watch-link2, #mw-watch-link1' );
+
+               // Allowing people to add inline animated links is a little scary
+               $links = $links.filter( ':not( #bodyContent *, #content * )' );
+
+               $links.click( function ( e ) {
+                       var action, api, $link;
+
+                       // Start preloading the notification module (normally loaded by mw.notify())
+                       mw.loader.load( 'mediawiki.notification' );
+
+                       action = mwUriGetAction( this.href );
+
+                       if ( action !== 'watch' && action !== 'unwatch' ) {
+                               // Could not extract target action from link url,
+                               // let native browsing handle it further
+                               return true;
+                       }
+                       e.preventDefault();
+                       e.stopPropagation();
+
+                       $link = $( this );
+
+                       if ( $link.hasClass( 'loading' ) ) {
+                               return;
+                       }
+
+                       updateWatchLink( $link, action, 'loading' );
+
+                       api = new mw.Api();
+
+                       api[ action ]( title )
+                               .done( function ( watchResponse ) {
+                                       var otherAction = action === 'watch' ? 'unwatch' : 'watch';
+
+                                       mw.notify( $.parseHTML( watchResponse.message ), {
+                                               tag: 'watch-self'
+                                       } );
+
+                                       // Set link to opposite
+                                       updateWatchLink( $link, otherAction );
+
+                                       // Update the "Watch this page" checkbox on action=edit when the
+                                       // page is watched or unwatched via the tab (bug 12395).
+                                       $( '#wpWatchthis' ).prop( 'checked', watchResponse.watched !== undefined );
+                               } )
+                               .fail( function () {
+                                       var cleanTitle, msg, link;
+
+                                       // Reset link to non-loading mode
+                                       updateWatchLink( $link, action );
+
+                                       // Format error message
+                                       cleanTitle = title.replace( /_/g, ' ' );
+                                       link = mw.html.element(
+                                               'a', {
+                                                       href: mw.util.getUrl( title ),
+                                                       title: cleanTitle
+                                               }, cleanTitle
+                                       );
+                                       msg = mw.message( 'watcherrortext', link );
+
+                                       // Report to user about the error
+                                       mw.notify( msg, {
+                                               tag: 'watch-self',
+                                               type: 'error'
+                                       } );
+                               } );
+               } );
+       } );
+
+}( mediaWiki, jQuery ) );
index eec02ed..5e1f1a9 100644 (file)
@@ -41,11 +41,9 @@ class LessFileCompilationTest extends ResourceLoaderTestCase {
                $rlContext = $this->getResourceLoaderContext();
 
                // Bleh
-               $method = new ReflectionMethod( $this->module, 'getLessCompiler' );
+               $method = new ReflectionMethod( $this->module, 'compileLessFile' );
                $method->setAccessible( true );
-               $compiler = $method->invoke( $this->module, $rlContext );
-
-               $this->assertNotNull( $compiler->parseFile( $this->file )->getCss() );
+               $this->assertNotNull( $method->invoke( $this->module, $this->file, $rlContext ) );
        }
 
        public function toString() {
index eefc926..23afabd 100644 (file)
@@ -198,7 +198,7 @@ class ResourcesTest extends MediaWikiTestCase {
                                                        $media,
                                                        $file,
                                                        // XXX: Wrapped in an object to keep it out of PHPUnit output
-                                                       (object)array( 'cssText' => $readStyleFile->invoke( $module, $file, $flip ) ),
+                                                       (object)array( 'cssText' => $readStyleFile->invoke( $module, $file, $flip, $data['context'] ) ),
                                                );
                                        }
                                }