Merge "Update README & COPYING"
authorjenkins-bot <jenkins-bot@gerrit.wikimedia.org>
Fri, 2 Aug 2013 18:06:12 +0000 (18:06 +0000)
committerGerrit Code Review <gerrit@wikimedia.org>
Fri, 2 Aug 2013 18:06:12 +0000 (18:06 +0000)
13 files changed:
RELEASE-NOTES-1.22
includes/DefaultSettings.php
includes/Preferences.php
includes/SkinTemplate.php
includes/WebRequest.php
includes/parser/ParserOptions.php
languages/messages/MessagesEn.php
maintenance/language/messages.inc
maintenance/mctest.php
resources/mediawiki/mediawiki.util.js
skins/Modern.php
skins/MonoBook.php
skins/Vector.php

index 2142522..a36d8cf 100644 (file)
@@ -373,6 +373,8 @@ changes to languages because of Bugzilla reports.
   jobs to the job table to update pages which use the edited page as a template.
 * The LivePreviewPrepare and LivePreviewDone events triggered on "jQuery( mw )"
   have been deprecated in favour of using mw.hook.
+* The 'showjumplinks' user preference has been removed, jump links are now
+  always included.
 
 == Compatibility ==
 
index 5eb1bdd..8302e6d 100644 (file)
@@ -3712,7 +3712,6 @@ $wgDefaultUserOptions = array(
        'rows' => 25,
        'searchlimit' => 20,
        'showhiddencats' => 0,
-       'showjumplinks' => 1,
        'shownumberswatching' => 1,
        'showtoc' => 1,
        'showtoolbar' => 1,
index 6f4f327..709f15c 100644 (file)
@@ -721,11 +721,6 @@ class Preferences {
                        'section' => 'rendering/advancedrendering',
                        'label-message' => 'tog-showhiddencats'
                );
-               $defaultPreferences['showjumplinks'] = array(
-                       'type' => 'toggle',
-                       'section' => 'rendering/advancedrendering',
-                       'label-message' => 'tog-showjumplinks',
-               );
 
                if ( $wgAllowUserCssPrefs ) {
                        $defaultPreferences['justify'] = array(
index a2ffb8e..cca1c6c 100644 (file)
@@ -339,7 +339,7 @@ class SkinTemplate extends Skin {
                $tpl->set( 'rtl', $userLang->isRTL() );
 
                $tpl->set( 'capitalizeallnouns', $userLang->capitalizeAllNouns() ? ' capitalize-all-nouns' : '' );
-               $tpl->set( 'showjumplinks', $user->getOption( 'showjumplinks' ) );
+               $tpl->set( 'showjumplinks', true ); // showjumplinks preference has been removed
                $tpl->set( 'username', $this->loggedin ? $this->username : null );
                $tpl->setRef( 'userpage', $this->userpage );
                $tpl->setRef( 'userpageurl', $this->userpageUrlDetails['href'] );
index dbd0740..80881c9 100644 (file)
@@ -568,6 +568,44 @@ class WebRequest {
                return $_GET;
        }
 
+       /**
+        * Return the contents of the Query with no decoding. Use when you need to
+        * know exactly what was sent, e.g. for an OAuth signature over the elements.
+        *
+        * @return String
+        */
+       public function getRawQueryString() {
+               return $_SERVER['QUERY_STRING'];
+       }
+
+       /**
+        * Return the contents of the POST with no decoding. Use when you need to
+        * know exactly what was sent, e.g. for an OAuth signature over the elements.
+        *
+        * @return String
+        */
+       public function getRawPostString() {
+               if ( !$this->wasPosted() ) {
+                       return '';
+               }
+               return $this->getRawInput();
+       }
+
+       /**
+        * Return the raw request body, with no processing. Cached since some methods
+        * disallow reading the stream more than once. As stated in the php docs, this
+        * does not work with enctype="multipart/form-data".
+        *
+        * @return String
+        */
+       public function getRawInput() {
+               static $input = false;
+               if ( $input === false ) {
+                       $input = file_get_contents( 'php://input' );
+               }
+               return $input;
+       }
+
        /**
         * Get the HTTP method used for this request.
         *
@@ -1391,6 +1429,30 @@ class FauxRequest extends WebRequest {
                return false;
        }
 
+       /**
+        * FauxRequests shouldn't depend on raw request data (but that could be implemented here)
+        * @return String
+        */
+       public function getRawQueryString() {
+               return '';
+       }
+
+       /**
+        * FauxRequests shouldn't depend on raw request data (but that could be implemented here)
+        * @return String
+        */
+       public function getRawPostString() {
+               return '';
+       }
+
+       /**
+        * FauxRequests shouldn't depend on raw request data (but that could be implemented here)
+        * @return String
+        */
+       public function getRawInput() {
+               return '';
+       }
+
        /**
         * @param array $extWhitelist
         * @return bool
index b01f162..bde508a 100644 (file)
@@ -280,9 +280,17 @@ class ParserOptions {
        }
 
        /**
+        * Get the user language used by the parser for this page.
+        *
         * You shouldn't use this. Really. $parser->getFunctionLang() is all you need.
-        * Using this fragments the cache and is discouraged. Yes, {{int: }} uses this,
-        * producing inconsistent tables (Bug 14404).
+        *
+        * To avoid side-effects where the page will be rendered based on the language
+        * of the user who last saved, this function will triger a cache fragmentation.
+        * Usage of this method is discouraged for that reason.
+        *
+        * When saving, this will return the default language instead of the user's.
+        *
+        * {{int: }} uses this which used to produce inconsistent link tables (bug 14404).
         *
         * @return Language object
         * @since 1.19
index d0c09be..f042f41 100644 (file)
@@ -680,7 +680,6 @@ future releases. Also note that since each list value is wrapped in a unique
 'tog-shownumberswatching'     => 'Show the number of watching users',
 'tog-oldsig'                  => 'Existing signature:',
 'tog-fancysig'                => 'Treat signature as wikitext (without an automatic link)',
-'tog-showjumplinks'           => 'Enable "jump to" accessibility links',
 'tog-uselivepreview'          => 'Use live preview (requires JavaScript) (experimental)',
 'tog-forceeditsummary'        => 'Prompt me when entering a blank edit summary',
 'tog-watchlisthideown'        => 'Hide my edits from the watchlist',
index 8553824..aa9fa9e 100644 (file)
@@ -56,7 +56,6 @@ $wgMessageStructure = array(
                'tog-shownumberswatching',
                'tog-oldsig',
                'tog-fancysig',
-               'tog-showjumplinks',
                'tog-uselivepreview',
                'tog-forceeditsummary',
                'tog-watchlisthideown',
index 26e1e18..28b041a 100644 (file)
@@ -61,8 +61,15 @@ class mcTest extends Maintenance {
                        $this->error( "MediaWiki isn't configured for Memcached usage", 1 );
                }
 
+               # find out the longest server string to nicely align output later on
+               $maxSrvLen = $servers ? max( array_map( 'strlen', $servers ) ) : 0;
+
                foreach ( $servers as $server ) {
-                       $this->output( $server . " ", $server );
+                       $this->output(
+                               str_pad( $server, $maxSrvLen ),
+                               $server  # output channel
+                       );
+
                        $mcc = new MemCachedClientforWiki( array(
                                'persistant' => true,
                                'timeout' => $wgMemCachedTimeout
@@ -90,7 +97,7 @@ class mcTest extends Maintenance {
                        }
                        $exectime = $this->microtime_float() - $time_start;
 
-                       $this->output( "set: $set   incr: $incr   get: $get time: $exectime", $server );
+                       $this->output( " set: $set   incr: $incr   get: $get time: $exectime", $server );
                }
        }
 
index 6f76839..071a52b 100644 (file)
                                $link.attr( 'accesskey', accesskey );
                        }
 
-                       // nextnode is a DOM element (was the only option before MW 1.17, in wikibits.js)
-                       // so we make it a jQuery object!
-                       if ( nextnode && nextnode.nodeType ) {
-                               nextnode = $( nextnode );
-                       }
-
-                       // Where to put our node ?
-                       // - nextnode is a jQuery object that represents exactly one element
-                       if ( nextnode && nextnode.jquery && nextnode.length === 1 && nextnode[0].parentNode === $ul[0] ) {
-                               nextnode.before( $item );
-
-                       // - nextnode is a CSS selector for jQuery
-                       } else if ( typeof nextnode === 'string' && $ul.find( nextnode ).length !== 0 ) {
-                               $ul.find( nextnode ).eq( 0 ).before( $item );
-
-                       // If the jQuery selector isn't found within the <ul>,
-                       // or if nextnode was invalid or not passed at all,
-                       // then just append it at the end of the <ul> (this is the default behavior)
-                       } else {
-                               $ul.append( $item );
+                       if ( nextnode ) {
+                               if ( nextnode.nodeType || typeof nextnode === 'string' ) {
+                                       // nextnode is a DOM element (was the only option before MW 1.17, in wikibits.js)
+                                       // or nextnode is a CSS selector for jQuery
+                                       nextnode = $ul.find( nextnode );
+                               } else if ( !nextnode.jquery || nextnode[0].parentNode !== $ul[0] ) {
+                                       // Fallback
+                                       $ul.append( $item );
+                                       return $item[0];
+                               }
+                               if ( nextnode.length === 1 ) {
+                                       // nextnode is a jQuery object that represents exactly one element
+                                       nextnode.before( $item );
+                                       return $item[0];
+                               }
                        }
 
+                       // Fallback (this is the default behavior)
+                       $ul.append( $item );
                        return $item[0];
+
                },
 
                /**
index 52f9fa2..56acd7e 100644 (file)
@@ -96,7 +96,7 @@ class ModernTemplate extends MonoBookTemplate {
                <div id="contentSub"<?php $this->html( 'userlangattributes' ) ?>><?php $this->html( 'subtitle' ) ?></div>
 
                <?php if ( $this->data['undelete'] ) { ?><div id="contentSub2"><?php $this->html( 'undelete' ) ?></div><?php } ?>
-               <?php if ( $this->data['showjumplinks'] ) { ?><div id="jump-to-nav"><?php $this->msg( 'jumpto' ) ?> <a href="#mw_portlets"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?><a href="#searchInput"><?php $this->msg( 'jumptosearch' ) ?></a></div><?php } ?>
+               <div id="jump-to-nav"><?php $this->msg( 'jumpto' ) ?> <a href="#mw_portlets"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?><a href="#searchInput"><?php $this->msg( 'jumptosearch' ) ?></a></div>
 
                <?php $this->html( 'bodytext' ) ?>
                <div class='mw_clear'></div>
index e805aca..c7a3ffc 100644 (file)
@@ -89,9 +89,9 @@ class MonoBookTemplate extends BaseTemplate {
                <div id="contentSub2"><?php $this->html( 'undelete' ) ?></div>
 <?php } ?><?php if ( $this->data['newtalk'] ) { ?>
                <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
-<?php } ?><?php if ( $this->data['showjumplinks'] ) { ?>
-               <div id="jump-to-nav" class="mw-jump"><?php $this->msg( 'jumpto' ) ?> <a href="#column-one"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?><a href="#searchInput"><?php $this->msg( 'jumptosearch' ) ?></a></div>
 <?php } ?>
+               <div id="jump-to-nav" class="mw-jump"><?php $this->msg('jumpto') ?> <a href="#column-one"><?php $this->msg('jumptonavigation') ?></a><?php $this->msg( 'comma-separator' ) ?><a href="#searchInput"><?php $this->msg('jumptosearch') ?></a></div>
+
                <!-- start content -->
 <?php $this->html( 'bodytext' ) ?>
                <?php if ( $this->data['catlinks'] ) { $this->html( 'catlinks' ); } ?>
index d0305f0..713ec8b 100644 (file)
@@ -175,13 +175,11 @@ class VectorTemplate extends BaseTemplate {
                                <?php if ( $this->data['newtalk'] ) { ?>
                                <div class="usermessage"><?php $this->html( 'newtalk' ) ?></div>
                                <?php } ?>
-                               <?php if ( $this->data['showjumplinks'] ) { ?>
                                <div id="jump-to-nav" class="mw-jump">
                                        <?php $this->msg( 'jumpto' ) ?>
                                        <a href="#mw-navigation"><?php $this->msg( 'jumptonavigation' ) ?></a><?php $this->msg( 'comma-separator' ) ?>
                                        <a href="#p-search"><?php $this->msg( 'jumptosearch' ) ?></a>
                                </div>
-                               <?php } ?>
                                <?php $this->html( 'bodycontent' ) ?>
                                <?php if ( $this->data['printfooter'] ) { ?>
                                <div class="printfooter">