r98152 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r98151‎ | r98152 | r98153 >
Date:18:13, 26 September 2011
Author:catrope
Status:ok
Tags:
Comment:
Modified paths:
  • /branches/wmf/1.18wmf1/extensions/UploadWizard/resources/mw.UploadWizard.js (modified) (history)
  • /branches/wmf/1.18wmf1/includes/ExternalStoreDB.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/OutputPage.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/SkinLegacy.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/specials/SpecialPrefixindex.php (modified) (history)
  • /branches/wmf/1.18wmf1/includes/upload/UploadFromUrl.php (modified) (history)
  • /branches/wmf/1.18wmf1/resources/mediawiki.page/mediawiki.page.startup.js (modified) (history)
  • /branches/wmf/1.18wmf1/resources/mediawiki.special/mediawiki.special.css (modified) (history)
  • /branches/wmf/1.18wmf1/skins/CologneBlue.php (modified) (history)
  • /branches/wmf/1.18wmf1/skins/Standard.php (modified) (history)
  • /branches/wmf/1.18wmf1/skins/monobook/IE60Fixes.css (modified) (history)
  • /branches/wmf/1.18wmf1/skins/vector/screen.css (modified) (history)

Diff [purge]

Index: branches/wmf/1.18wmf1/skins/monobook/IE60Fixes.css
@@ -11,17 +11,34 @@
1212 margin-top: 3em;
1313 height: 1%;
1414 }
 15+.rtl div#column-content div#content {
 16+ margin-right: 12.2em;
 17+ margin-left: 0;
 18+}
1519 div#column-one {
1620 position: absolute;
1721 top: 0;
1822 left: 0;
1923 z-index: 4;
2024 }
 25+.rtl div#column-one {
 26+ left: auto;
 27+ right: 0;
 28+}
2129 div#footer {
2230 margin-left: 13.6em;
2331 border-left: 1px solid #fabd23;
2432 }
 33+.rtl div#footer {
 34+ margin-left: 0;
 35+ margin-right: 13.6em;
 36+ border-left: none;
 37+ border-right: 1px solid #fabd23;
 38+}
2539
 40+ /* the tabs */
 41+
 42+
2643 /* the tabs */
2744
2845 #p-cactions {
Index: branches/wmf/1.18wmf1/skins/CologneBlue.php
@@ -29,19 +29,23 @@
3030 if ( 2 == $qb ) { # Right
3131 $rules[] = "/* @noflip */#quickbar { position: absolute; right: 4px; }";
3232 $rules[] = "/* @noflip */#article { margin-left: 4px; margin-right: 148px; }";
 33+ $rules[] = "/* @noflip */#topbar, #footer { margin-right: 152px; }";
3334 } elseif ( 1 == $qb ) {
3435 $rules[] = "/* @noflip */#quickbar { position: absolute; left: 4px; }";
3536 $rules[] = "/* @noflip */#article { margin-left: 148px; margin-right: 4px; }";
 37+ $rules[] = "/* @noflip */#topbar, #footer { margin-left: 152px; }";
3638 } elseif ( 3 == $qb ) { # Floating left
3739 $rules[] = "/* @noflip */#quickbar { position:absolute; left:4px }";
3840 $rules[] = "/* @noflip */#topbar { margin-left: 148px }";
3941 $rules[] = "/* @noflip */#article { margin-left:148px; margin-right: 4px; }";
4042 $rules[] = "/* @noflip */body>#quickbar { position:fixed; left:4px; top:4px; overflow:auto; bottom:4px;}"; # Hides from IE
 43+ $rules[] = "/* @noflip */#topbar, #footer { margin-left: 152px; }";
4144 } elseif ( 4 == $qb ) { # Floating right
4245 $rules[] = "/* @noflip */#quickbar { position: fixed; right: 4px; }";
4346 $rules[] = "/* @noflip */#topbar { margin-right: 148px }";
4447 $rules[] = "/* @noflip */#article { margin-right: 148px; margin-left: 4px; }";
4548 $rules[] = "/* @noflip */body>#quickbar { position: fixed; right: 4px; top: 4px; overflow: auto; bottom:4px;}"; # Hides from IE
 49+ $rules[] = "/* @noflip */#topbar, #footer { margin-left: 152px; }";
4650 }
4751 $style = implode( "\n", $rules );
4852 $out->addInlineStyle( $style, 'flip' );
@@ -99,10 +103,6 @@
100104 $s .= "\n<div id='footer'>";
101105 $s .= '<table width="98%" border="0" cellspacing="0"><tr>';
102106
103 - $qb = $this->getSkin()->qbSetting();
104 - if ( 1 == $qb || 3 == $qb ) { # Left
105 - $s .= $this->getQuickbarCompensator();
106 - }
107107 $s .= '<td class="bottom">';
108108
109109 $s .= $this->bottomLinks();
@@ -121,12 +121,9 @@
122122 $s .= "\n<br />" . $this->pageStats();
123123
124124 $s .= '</td>';
125 - if ( 2 == $qb ) { # Right
126 - $s .= $this->getQuickbarCompensator();
127 - }
128125 $s .= "</tr></table>\n</div>\n</div>\n";
129126
130 - if ( 0 != $qb ) {
 127+ if ( $this->getSkin()->qbSetting() != 0 ) {
131128 $s .= $this->quickBar();
132129 }
133130 return $s;
Index: branches/wmf/1.18wmf1/skins/Standard.php
@@ -28,9 +28,11 @@
2929 if ( 2 == $qb ) { # Right
3030 $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; right: 4px; border-left: 2px solid #000000; }";
3131 $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-left: 4px; margin-right: 152px; }";
 32+ $rules[] = "/* @noflip */#topbar, #footer { margin-right: 152px; }";
3233 } elseif ( 1 == $qb || 3 == $qb ) {
3334 $rules[] = "/* @noflip */#quickbar { position: absolute; top: 4px; left: 4px; border-right: 1px solid gray; }";
3435 $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-left: 152px; margin-right: 4px; }";
 36+ $rules[] = "/* @noflip */#topbar, #footer { margin-left: 152px; }";
3537 if( 3 == $qb ) {
3638 $rules[] = "/* @noflip */#quickbar { position: fixed; padding: 4px; }";
3739 }
@@ -38,6 +40,7 @@
3941 $rules[] = "/* @noflip */#quickbar { position: fixed; right: 0px; top: 0px; padding: 4px;}";
4042 $rules[] = "/* @noflip */#quickbar { border-right: 1px solid gray; }";
4143 $rules[] = "/* @noflip */#article, #mw-data-after-content { margin-right: 152px; margin-left: 4px; }";
 44+ $rules[] = "/* @noflip */#topbar, #footer { margin-right: 152px; }";
4245 }
4346 $style = implode( "\n", $rules );
4447 $out->addInlineStyle( $style, 'flip' );
@@ -58,17 +61,7 @@
5962
6063 wfProfileOut( __METHOD__ . '-1' );
6164 wfProfileIn( __METHOD__ . '-2' );
62 -
63 - $qb = $this->getSkin()->qbSetting();
64 - $shove = ( $qb != 0 );
65 - $left = ( $qb == 1 || $qb == 3 );
66 -
67 - if ( $shove && $left ) { # Left
68 - $s .= $this->getQuickbarCompensator();
69 - }
70 - wfProfileOut( __METHOD__ . '-2' );
71 - wfProfileIn( __METHOD__ . '-3' );
72 - $l = $wgContLang->alignStart();
 65+ $l = $this->getSkin()->getLang()->alignStart();
7366 $s .= "<td class='bottom' align='$l' valign='top'>";
7467
7568 $s .= $this->bottomLinks();
@@ -80,17 +73,14 @@
8174 . '<br /><span id="pagestats">' . $this->pageStats() . '</span>';
8275
8376 $s .= '</td>';
84 - if ( $shove && !$left ) { # Right
85 - $s .= $this->getQuickbarCompensator();
86 - }
8777 $s .= "</tr></table>\n</div>\n</div>\n";
8878
89 - wfProfileOut( __METHOD__ . '-3' );
90 - wfProfileIn( __METHOD__ . '-4' );
91 - if ( 0 != $qb ) {
 79+ wfProfileOut( __METHOD__ . '-2' );
 80+ wfProfileIn( __METHOD__ . '-3' );
 81+ if ( $this->getSkin()->qbSetting() != 0 ) {
9282 $s .= $this->quickBar();
9383 }
94 - wfProfileOut( __METHOD__ . '-4' );
 84+ wfProfileOut( __METHOD__ . '-3' );
9585 wfProfileOut( __METHOD__ );
9686 return $s;
9787 }
Index: branches/wmf/1.18wmf1/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/wmf/1.18wmf1/extensions/UploadWizard/resources/mw.UploadWizard.js
@@ -358,11 +358,20 @@
359359 this.imageinfo.metadata.orientation = meta.tiff.Orientation.value;
360360 }
361361 if ( meta.general ) {
 362+ var pixelHeightDim = 'height';
 363+ var pixelWidthDim = 'width';
 364+ // this must be called after orientation is set above. If no orientation set, defaults to 0
 365+ var degrees = this.getOrientationDegrees();
 366+ // jpegmeta reports pixelHeight & width
 367+ if ( degrees == 90 || degrees == 270 ) {
 368+ pixelHeightDim = 'width';
 369+ pixelWidthDim = 'height';
 370+ }
362371 if ( meta.general.pixelHeight ) {
363 - this.imageinfo.height = meta.general.pixelHeight.value;
 372+ this.imageinfo[pixelHeightDim] = meta.general.pixelHeight.value;
364373 }
365374 if ( meta.general.pixelWidth ) {
366 - this.imageinfo.width = meta.general.pixelWidth.value;
 375+ this.imageinfo[pixelWidthDim] = meta.general.pixelWidth.value;
367376 }
368377 }
369378 }
Index: branches/wmf/1.18wmf1/includes/upload/UploadFromUrl.php
@@ -145,7 +145,9 @@
146146 $this->mRemoveTempFile = true;
147147 $this->mFileSize = 0;
148148
149 - $req = MWHttpRequest::factory( $this->mUrl );
 149+ $req = MWHttpRequest::factory( $this->mUrl, array(
 150+ 'followRedirects' => true
 151+ ) );
150152 $req->setCallback( array( $this, 'saveTempFileChunk' ) );
151153 $status = $req->execute();
152154
Index: branches/wmf/1.18wmf1/includes/OutputPage.php
@@ -2216,7 +2216,7 @@
22172217 }
22182218 $sk->setupUserCss( $this );
22192219
2220 - $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir ) );
 2220+ $ret = Html::htmlHeader( array( 'lang' => $this->getLang()->getCode(), 'dir' => $userdir, 'class' => 'client-nojs' ) );
22212221
22222222 if ( $this->getHTMLTitle() == '' ) {
22232223 $this->setHTMLTitle( wfMsg( 'pagetitle', $this->getPageTitle() ) );
Property changes on: branches/wmf/1.18wmf1/includes/OutputPage.php
___________________________________________________________________
Modified: svn:mergeinfo
22242224 Merged /branches/wmf/1.17wmf1/includes/OutputPage.php:r97403,97650,97657,97661,97687,97777
22252225 Merged /trunk/extensions/includes/OutputPage.php:r97403,97650
22262226 Merged /trunk/phase3/includes/OutputPage.php:r93912,95318,97403,97650,97657,97661,97687,97777
Index: branches/wmf/1.18wmf1/includes/SkinLegacy.php
@@ -90,11 +90,10 @@
9191 }
9292
9393 function doBeforeContent() {
94 - global $wgContLang;
 94+ global $wgLang;
9595 wfProfileIn( __METHOD__ );
9696
9797 $s = '';
98 - $qb = $this->getSkin()->qbSetting();
9998
10099 $langlinks = $this->otherLanguages();
101100 if ( $langlinks ) {
@@ -107,25 +106,20 @@
108107 }
109108
110109 $s .= "\n<div id='content'>\n<div id='topbar'>\n" .
111 - "<table border='0' cellspacing='0' width='98%'>\n<tr>\n";
 110+ "<table border='0' cellspacing='0' width='100%'>\n<tr>\n";
112111
113 - $shove = ( $qb != 0 );
114 - $left = ( $qb == 1 || $qb == 3 );
115 -
116 - if ( !$shove ) {
 112+ if ( $this->getSkin()->qbSetting() == 0 ) {
117113 $s .= "<td class='top' align='left' valign='top' rowspan='{$rows}'>\n" .
118 - $this->getSkin()->logoText() . '</td>';
119 - } elseif ( $left ) {
120 - $s .= $this->getQuickbarCompensator( $rows );
 114+ $this->getSkin()->logoText( $wgLang->alignStart() ) . '</td>';
121115 }
122116
123 - $l = $wgContLang->alignStart();
 117+ $l = $wgLang->alignStart();
124118 $s .= "<td {$borderhack} align='$l' valign='top'>\n";
125119
126120 $s .= $this->topLinks();
127121 $s .= '<p class="subtitle">' . $this->pageTitleLinks() . "</p>\n";
128122
129 - $r = $wgContLang->alignEnd();
 123+ $r = $wgLang->alignEnd();
130124 $s .= "</td>\n<td {$borderhack} valign='top' align='$r' nowrap='nowrap'>";
131125 $s .= $this->nameAndLogin();
132126 $s .= "\n<br />" . $this->searchForm() . '</td>';
@@ -134,10 +128,6 @@
135129 $s .= "</tr>\n<tr>\n<td class='top' colspan=\"2\">$langlinks</td>\n";
136130 }
137131
138 - if ( $shove && !$left ) { # Right
139 - $s .= $this->getQuickbarCompensator( $rows );
140 - }
141 -
142132 $s .= "</tr>\n</table>\n</div>\n";
143133 $s .= "\n<div id='article'>\n";
144134
@@ -593,6 +583,9 @@
594584 return $wgLang->pipeList( $s );
595585 }
596586
 587+ /**
 588+ * @deprecated in 1.19
 589+ */
597590 function getQuickbarCompensator( $rows = 1 ) {
598591 return "<td width='152' rowspan='{$rows}'>&#160;</td>";
599592 }
Index: branches/wmf/1.18wmf1/includes/ExternalStoreDB.php
@@ -29,8 +29,18 @@
3030 * @return DatabaseBase object
3131 */
3232 function &getSlave( $cluster ) {
 33+ global $wgDefaultExternalStore;
 34+
3335 $wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false;
3436 $lb =& $this->getLoadBalancer( $cluster );
 37+
 38+ if ( !in_array( "DB://".$cluster, $wgDefaultExternalStore ) ) {
 39+ wfDebug( "read only external store" );
 40+ $lb->allowLagged(true);
 41+ } else {
 42+ wfDebug( "writable external store" );
 43+ }
 44+
3545 return $lb->getConnection( DB_SLAVE, array(), $wiki );
3646 }
3747
Index: branches/wmf/1.18wmf1/includes/specials/SpecialPrefixindex.php
@@ -195,6 +195,7 @@
196196 }
197197 }
198198
 199+ $footer = '';
199200 if ( $this->including() ) {
200201 $out2 = '';
201202 } else {
@@ -205,7 +206,7 @@
206207 <td>' .
207208 $nsForm .
208209 '</td>
209 - <td id="mw-prefixindex-nav-form">';
 210+ <td id="mw-prefixindex-nav-form" class="mw-prefixindex-nav">';
210211
211212 if( isset( $res ) && $res && ( $n == $this->maxPerPage ) && ( $s = $res->fetchObject() ) ) {
212213 $query = array(
@@ -217,20 +218,21 @@
218219 $query['namespace'] = $namespace;
219220 }
220221
221 - $out2 = $wgLang->pipeList( array(
222 - $out2,
223 - $sk->linkKnown(
 222+ $nextLink = Linker::linkKnown(
224223 $self,
225224 wfMsgHtml( 'nextpage', str_replace( '_',' ', htmlspecialchars( $s->page_title ) ) ),
226225 array(),
227226 $query
228 - )
229 - ) );
 227+ );
 228+ $out2 .= $nextLink;
 229+
 230+ $footer = "\n" . Html::element( "hr" )
 231+ . Html::rawElement( "div", array( "class" => "mw-prefixindex-nav" ), $nextLink );
230232 }
231233 $out2 .= "</td></tr>" .
232234 Xml::closeElement( 'table' );
233235 }
234236
235 - $wgOut->addHTML( $out2 . $out );
 237+ $this->getOutput()->addHTML( $out2 . $out . $footer );
236238 }
237239 }
Index: branches/wmf/1.18wmf1/resources/mediawiki.special/mediawiki.special.css
@@ -25,7 +25,6 @@
2626 }
2727 .mw-allpages-nav {
2828 text-align: right;
29 - font-size: smaller;
3029 margin-bottom: 1em;
3130 }
3231 table.mw-allpages-table-form tr {
@@ -72,11 +71,12 @@
7372 width: 98%;
7473 }
7574 td#mw-prefixindex-nav-form {
76 - font-size: smaller;
7775 margin-bottom: 1em;
78 - text-align: right;
7976 vertical-align: top;
8077 }
 78+.mw-prefixindex-nav {
 79+ text-align: right;
 80+}
8181
8282
8383 /**** Special:Search ****/
Index: branches/wmf/1.18wmf1/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 );

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
r97403(bug 18424) Clean up paging links on Special:allpages and special:prefixindex....bawolff04:25, 18 September 2011
r97650swap reported width and height for jpegmeta, if rotated 90 or 270 degreesneilk19:13, 20 September 2011
r97657Fix support of legacy skins Standard & CologneBlue for user language directio...robin19:47, 20 September 2011
r97661Fixed IE6 issues in RTL modetparscal20:40, 20 September 2011
r97687bug 31052 : live hack to support reading from old non-slave external store se...asher01:08, 21 September 2011
r97777* (bug 29154) Allow upload-by-URL to follow HTTP redirectsbrion01:15, 22 September 2011

Status & tagging log