r98446 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98445‎ | r98446 | r98447 >
Date:20:59, 29 September 2011
Author:reedy
Status:ok
Tags:
Comment:
1.18: MFT r93912, r95318, r96139
Modified paths:
  • /branches/REL1_18/phase3/RELEASE-NOTES-1.18 (modified) (history)
  • /branches/REL1_18/phase3/includes/OutputPage.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/Site.php (modified) (history)
  • /branches/REL1_18/phase3/maintenance/dumpInterwiki.php (modified) (history)
  • /branches/REL1_18/phase3/resources/mediawiki.page/mediawiki.page.startup.js (modified) (history)
  • /branches/REL1_18/phase3/skins/vector/screen.css (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/maintenance/Site.php
@@ -12,8 +12,8 @@
1313 $this->url = $u;
1414 }
1515
16 - function getURL( $lang ) {
 16+ function getURL( $lang, $urlprotocol ) {
1717 $xlang = str_replace( '_', '-', $lang );
18 - return "http://$xlang.{$this->url}/wiki/\$1";
 18+ return "$urlprotocol//$xlang.{$this->url}/wiki/\$1";
1919 }
20 -}
\ No newline at end of file
 20+}
Index: branches/REL1_18/phase3/maintenance/dumpInterwiki.php
@@ -37,6 +37,7 @@
3838 $this->addOption( 'dblist', 'File with one db per line', false, true );
3939 $this->addOption( 'specialdbs', "File with one 'special' db per line", false, true );
4040 $this->addOption( 'o', 'Cdb output file', false, true );
 41+ $this->addOption( 'protocolrelative', 'Output wikimedia interwiki urls as protocol relative', false, false );
4142 }
4243
4344 function execute() {
@@ -55,6 +56,12 @@
5657 $this->dbFile = false;
5758 }
5859
 60+ if ( $this->hasOption( 'protocolrelative' ) ) {
 61+ $this->urlprotocol = '';
 62+ } else {
 63+ $this->urlprotocol = 'http:';
 64+ }
 65+
5966 $this->getRebuildInterwikiDump();
6067 }
6168
@@ -76,9 +83,9 @@
7784
7885 # Extra interwiki links that can't be in the intermap for some reason
7986 $extraLinks = array(
80 - array( 'm', 'http://meta.wikimedia.org/wiki/$1', 1 ),
81 - array( 'meta', 'http://meta.wikimedia.org/wiki/$1', 1 ),
82 - array( 'sep11', 'http://sep11.wikipedia.org/wiki/$1', 1 ),
 87+ array( 'm', $this->urlprotocol . '//meta.wikimedia.org/wiki/$1', 1 ),
 88+ array( 'meta', $this->urlprotocol . '//meta.wikimedia.org/wiki/$1', 1 ),
 89+ array( 'sep11', $this->urlprotocol . '//sep11.wikipedia.org/wiki/$1', 1 ),
8390 );
8491
8592 # Language aliases, usually configured as redirects to the real wiki in apache
@@ -126,6 +133,13 @@
127134
128135 $url = $matches[2];
129136 if ( preg_match( '/(wikipedia|wiktionary|wikisource|wikiquote|wikibooks|wikimedia)\.org/', $url ) ) {
 137+ if ( $this->hasOption( 'protocolrelative' ) ) {
 138+ if ( substr( $url, 0, 5 ) == 'http:' ) {
 139+ $url = substr( $url, 5 );
 140+ } else if ( substr( $url, 0, 6 ) == 'https:' ) {
 141+ $url = substr( $url, 6 );
 142+ }
 143+ }
130144 $local = 1;
131145 } else {
132146 $local = 0;
@@ -155,7 +169,7 @@
156170 # Links to multilanguage sites
157171 foreach ( $sites as $targetSite ) {
158172 $this->makeLink( array( 'iw_prefix' => $targetSite->lateral,
159 - 'iw_url' => $targetSite->getURL( 'en' ),
 173+ 'iw_url' => $targetSite->getURL( 'en', $this->urlprotocol ),
160174 'iw_local' => 1 ), $db );
161175 }
162176 } else {
@@ -179,14 +193,14 @@
180194 foreach ( $sites as $targetSite ) {
181195 if ( $targetSite->suffix != $site->suffix ) {
182196 $this->makeLink( array( 'iw_prefix' => $targetSite->lateral,
183 - 'iw_url' => $targetSite->getURL( $lang ),
 197+ 'iw_url' => $targetSite->getURL( $lang, $this->urlprotocol ),
184198 'iw_local' => 1 ), $db );
185199 }
186200 }
187201
188202 if ( $site->suffix == "wiki" ) {
189203 $this->makeLink( array( 'iw_prefix' => 'w',
190 - 'iw_url' => "http://en.wikipedia.org/wiki/$1",
 204+ 'iw_url' => $this->urlprotocol . "//en.wikipedia.org/wiki/$1",
191205 'iw_local' => 1 ), $db );
192206 }
193207
@@ -203,12 +217,12 @@
204218 function makeLanguageLinks( &$site, $source ) {
205219 # Actual languages with their own databases
206220 foreach ( $this->langlist as $targetLang ) {
207 - $this->makeLink( array( $targetLang, $site->getURL( $targetLang ), 1 ), $source );
 221+ $this->makeLink( array( $targetLang, $site->getURL( $targetLang, $this->urlprotocol ), 1 ), $source );
208222 }
209223
210224 # Language aliases
211225 foreach ( $this->languageAliases as $alias => $lang ) {
212 - $this->makeLink( array( $alias, $site->getURL( $lang ), 1 ), $source );
 226+ $this->makeLink( array( $alias, $site->getURL( $lang, $this->urlprotocol ), 1 ), $source );
213227 }
214228 }
215229
Index: branches/REL1_18/phase3/skins/vector/screen.css
@@ -790,11 +790,10 @@
791791 background-color: #f9f9f9;
792792 }
793793 pre {
794 - overflow-x: auto;
795794 padding: 1em;
796 - border: 1px solid #EBEBEB;
 795+ border: 1px dashed #2f6fab;
797796 color: black;
798 - background-color: #F7F7F7;
 797+ background-color: #f9f9f9;
799798 line-height: 1.3em;
800799 }
801800 ul {
Index: branches/REL1_18/phase3/RELEASE-NOTES-1.18
@@ -454,6 +454,8 @@
455455 * (bug 30907) Special:Unusedcategories should sort ascendingly.
456456 * (bug 28545) When using the uca-default collation, sortkey's starting with a
457457 space (U+20) will sort under an invisible header like in 1.16 rather than a U+6DE
 458+* (bug 30497) Add client-nojs and client-js classes on document element
 459+ to let styles easily hide or show things based on general JS availability
458460
459461 === API changes in 1.18 ===
460462 * BREAKING CHANGE: action=watch now requires POST and token.
Property changes on: branches/REL1_18/phase3/RELEASE-NOTES-1.18
___________________________________________________________________
Modified: svn:mergeinfo
461463 Merged /trunk/phase3/RELEASE-NOTES-1.18:r93912,95318,96139
Index: branches/REL1_18/phase3/includes/OutputPage.php
@@ -2213,7 +2213,7 @@
22142214 }
22152215 $sk->setupUserCss( $this );
22162216
2217 - $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir ) );
 2217+ $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) );
22182218
22192219 if ( $this->getHTMLTitle() == '' ) {
22202220 $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) );
Property changes on: branches/REL1_18/phase3/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
22212221 Merged /trunk/phase3/includes/OutputPage.php:r93912,95318,96139
Index: branches/REL1_18/phase3/resources/mediawiki.page/mediawiki.page.startup.js
@@ -3,11 +3,13 @@
44 /* Client profile classes for <html> */
55
66 var prof = $.client.profile();
7 - $( 'html' ).addClass(
8 - 'client-' + prof.name
9 - + ' client-' + prof.name + '-' + prof.versionBase
10 - + ' client-' + prof.layout
11 - + ' client-' + prof.platform
12 - );
 7+ $( 'html' )
 8+ .addClass(
 9+ 'client-' + prof.name
 10+ + ' client-' + prof.name + '-' + prof.versionBase
 11+ + ' client-' + prof.layout
 12+ + ' client-' + prof.platform
 13+ + ' client-js' )
 14+ .removeClass( 'client-nojs' );
1315
1416 } )( jQuery );

Follow-up revisions

RevisionCommit summaryAuthorDate
r98447Followup r98446, move RELEASE-NOTES from r95318reedy21:00, 29 September 2011

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r93912Reverted r91548 per CRaaron20:57, 4 August 2011
r95318* (bug 30497) Add client-nojs and client-js classes on document element to le...brion18:33, 23 August 2011
r96139Merge r96132 from 1.17wmf1: support protocol-relative URLs in dumpInterwiki.phpcatrope18:28, 2 September 2011

Status & tagging log