r99989 MediaWiki - Code Review archive

Repository:MediaWiki
Revision:r99988‎ | r99989 | r99990 >
Date:22:24, 16 October 2011
Author:reedy
Status:ok
Tags:
Comment:
REL1_18:

r98812
* (bug 31282) Fix use of ForeignAPIRepo/InstantCommons TIFF images when $wgTiffThumbnailType is left unset.
---------------------
r98774
Fix embarrassing mistake in r98718
---------------------
r98756
Merge r97687
---------------------
r98676
Follow up to r98665.
---------------------
r98612
Fixed case of ID in selector
---------------------
r98411
Fix handling of qplimit/qpoffset and cachedtimestamp in QueryPage api module
---------------------
r98379
clean up Html::inlineScript usage * ResourceLoader::makeLoaderConditionalScript: -- window.mediaWiki -> window.mw; Not just because it's shorter but because that's the variable that is actually being used inside the script. * ProtectionForm...
---------------------
Modified paths:
  • /branches/REL1_18/phase3 (modified) (history)
  • /branches/REL1_18/phase3/includes (modified) (history)
  • /branches/REL1_18/phase3/includes/EditPage.php (modified) (history)
  • /branches/REL1_18/phase3/includes/ExternalStoreDB.php (modified) (history)
  • /branches/REL1_18/phase3/includes/ProtectionForm.php (modified) (history)
  • /branches/REL1_18/phase3/includes/QueryPage.php (modified) (history)
  • /branches/REL1_18/phase3/includes/api (modified) (history)
  • /branches/REL1_18/phase3/includes/api/ApiQueryQueryPage.php (modified) (history)
  • /branches/REL1_18/phase3/includes/media/Tiff.php (modified) (history)
  • /branches/REL1_18/phase3/includes/resourceloader/ResourceLoader.php (modified) (history)
  • /branches/REL1_18/phase3/includes/specials (modified) (history)
  • /branches/REL1_18/phase3/includes/specials/SpecialUserlogin.php (modified) (history)
  • /branches/REL1_18/phase3/resources/jquery/jquery.tablesorter.css (added) (history)
  • /branches/REL1_18/phase3/resources/mediawiki.special/mediawiki.special.block.js (modified) (history)

Diff [purge]

Index: branches/REL1_18/phase3/includes/ProtectionForm.php
@@ -577,25 +577,26 @@
578578 }
579579
580580 function buildCleanupScript() {
581 - global $wgRestrictionLevels, $wgGroupPermissions;
582 - $script = 'var wgCascadeableLevels=';
583 - $CascadeableLevels = array();
 581+ global $wgRestrictionLevels, $wgGroupPermissions, $wgOut;
 582+
 583+ $cascadeableLevels = array();
584584 foreach( $wgRestrictionLevels as $key ) {
585 - if ( (isset($wgGroupPermissions[$key]['protect']) && $wgGroupPermissions[$key]['protect']) || $key == 'protect' ) {
586 - $CascadeableLevels[] = "'" . Xml::escapeJsString( $key ) . "'";
 585+ if ( ( isset( $wgGroupPermissions[$key]['protect'] ) && $wgGroupPermissions[$key]['protect'] )
 586+ || $key == 'protect'
 587+ ) {
 588+ $cascadeableLevels[] = $key;
587589 }
588590 }
589 - $script .= "[" . implode(',',$CascadeableLevels) . "];\n";
590 - $options = (object)array(
 591+ $options = array(
591592 'tableId' => 'mwProtectSet',
592 - 'labelText' => wfMsg( 'protect-unchain-permissions' ),
593 - 'numTypes' => count($this->mApplicableTypes),
594 - 'existingMatch' => 1 == count( array_unique( $this->mExistingExpiry ) ),
 593+ 'labelText' => wfMessage( 'protect-unchain-permissions' )->plain(),
 594+ 'numTypes' => count( $this->mApplicableTypes ),
 595+ 'existingMatch' => count( array_unique( $this->mExistingExpiry ) ) === 1,
595596 );
596 - $encOptions = Xml::encodeJsVar( $options );
597597
598 - $script .= "ProtectionForm.init($encOptions)";
599 - return Html::inlineScript( "if ( window.mediaWiki ) { $script }" );
 598+ $wgOut->addJsConfigVars( 'wgCascadeableLevels', $cascadeableLevels );
 599+ $script = Xml::encodeJsCall( 'ProtectionForm.init', array( $options ) );
 600+ return Html::inlineScript( ResourceLoader::makeLoaderConditionalScript( $script ) );
600601 }
601602
602603 /**
Index: branches/REL1_18/phase3/includes/EditPage.php
@@ -2491,7 +2491,6 @@
24922492 'key' => 'R'
24932493 )
24942494 );
2495 - $toolbar = "<div id='toolbar'>\n";
24962495
24972496 $script = '';
24982497 foreach ( $toolarray as $tool ) {
@@ -2516,15 +2515,11 @@
25172516 $cssId = $tool['id'],
25182517 );
25192518
2520 - $paramList = implode( ',',
2521 - array_map( array( 'Xml', 'encodeJsVar' ), $params ) );
2522 - $script .= "mw.toolbar.addButton($paramList);\n";
 2519+ $script .= Xml::encodeJsCall( 'mw.toolbar.addButton', $params );
25232520 }
2524 - $wgOut->addScript( Html::inlineScript(
2525 - "if ( window.mediaWiki ) {{$script}}"
2526 - ) );
 2521+ $wgOut->addScript( Html::inlineScript( ResourceLoader::makeLoaderConditionalScript( $script ) ) );
25272522
2528 - $toolbar .= "\n</div>";
 2523+ $toolbar = '<div id="toolbar"></div>';
25292524
25302525 wfRunHooks( 'EditPageBeforeEditToolbar', array( &$toolbar ) );
25312526
Property changes on: branches/REL1_18/phase3/includes/EditPage.php
___________________________________________________________________
Modified: svn:mergeinfo
25322527 Merged /trunk/phase3/includes/EditPage.php:r98379,98411,98612,98676,98756,98774,98812
Index: branches/REL1_18/phase3/includes/api/ApiQueryQueryPage.php
@@ -104,7 +104,7 @@
105105 return;
106106 }
107107
108 - $res = $qp->doQuery( $params['limit'] + 1, $params['offset'] );
 108+ $res = $qp->doQuery( $params['offset'], $params['limit'] + 1 );
109109 $count = 0;
110110 $titles = array();
111111 foreach ( $res as $row ) {
Property changes on: branches/REL1_18/phase3/includes/api
___________________________________________________________________
Modified: svn:mergeinfo
112112 Merged /trunk/phase3/includes/api:r98411,98612,98676,98756,98774,98812
Index: branches/REL1_18/phase3/includes/resourceloader/ResourceLoader.php
@@ -731,7 +731,7 @@
732732 */
733733 public static function makeLoaderConditionalScript( $script ) {
734734 $script = str_replace( "\n", "\n\t", trim( $script ) );
735 - return "if ( window.mediaWiki ) {\n\t$script\n}\n";
 735+ return "if(window.mw){\n\t$script\n}\n";
736736 }
737737
738738 /**
Property changes on: branches/REL1_18/phase3/includes/resourceloader/ResourceLoader.php
___________________________________________________________________
Modified: svn:mergeinfo
739739 Merged /trunk/phase3/includes/resourceloader/ResourceLoader.php:r98379,98411,98612,98676,98756,98774,98812
Index: branches/REL1_18/phase3/includes/media/Tiff.php
@@ -17,13 +17,18 @@
1818 * Conversion to PNG for inline display can be disabled here...
1919 * Note scaling should work with ImageMagick, but may not with GD scaling.
2020 *
 21+ * Files pulled from an another MediaWiki instance via ForeignAPIRepo /
 22+ * InstantCommons will have thumbnails managed from the remote instance,
 23+ * so we can skip this check.
 24+ *
2125 * @param $file
2226 *
2327 * @return bool
2428 */
2529 function canRender( $file ) {
2630 global $wgTiffThumbnailType;
27 - return (bool)$wgTiffThumbnailType;
 31+ return (bool)$wgTiffThumbnailType
 32+ || ($file->getRepo() instanceof ForeignAPIRepo);
2833 }
2934
3035 /**
Index: branches/REL1_18/phase3/includes/ExternalStoreDB.php
@@ -18,7 +18,7 @@
1919 */
2020 function &getLoadBalancer( $cluster ) {
2121 $wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false;
22 -
 22+
2323 return wfGetLBFactory()->getExternalLB( $cluster, $wiki );
2424 }
2525
@@ -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
@@ -139,8 +149,8 @@
140150 function store( $cluster, $data ) {
141151 $dbw = $this->getMaster( $cluster );
142152 $id = $dbw->nextSequenceValue( 'blob_blob_id_seq' );
143 - $dbw->insert( $this->getTable( $dbw ),
144 - array( 'blob_id' => $id, 'blob_text' => $data ),
 153+ $dbw->insert( $this->getTable( $dbw ),
 154+ array( 'blob_id' => $id, 'blob_text' => $data ),
145155 __METHOD__ );
146156 $id = $dbw->insertId();
147157 if ( !$id ) {
Index: branches/REL1_18/phase3/includes/specials/SpecialUserlogin.php
@@ -1037,7 +1037,7 @@
10381038
10391039 // Use loginend-https for HTTPS requests if it's not blank, loginend otherwise
10401040 // Ditto for signupend
1041 - $usingHTTPS = WebRequest::detectProtocol();
 1041+ $usingHTTPS = WebRequest::detectProtocol() == 'https';
10421042 $loginendHTTPS = wfMessage( 'loginend-https' );
10431043 $signupendHTTPS = wfMessage( 'signupend-https' );
10441044 if ( $usingHTTPS && !$loginendHTTPS->isBlank() ) {
Property changes on: branches/REL1_18/phase3/includes/specials
___________________________________________________________________
Modified: svn:mergeinfo
10451045 Merged /trunk/phase3/includes/specials:r98774,98812
Index: branches/REL1_18/phase3/includes/QueryPage.php
@@ -423,7 +423,7 @@
424424 }
425425
426426 public function getCachedTimestamp() {
427 - if ( !is_null( $this->cachedTimestamp ) ) {
 427+ if ( is_null( $this->cachedTimestamp ) ) {
428428 $dbr = wfGetDB( DB_SLAVE );
429429 $fname = get_class( $this ) . '::getCachedTimestamp';
430430 $this->cachedTimestamp = $dbr->selectField( 'querycache_info', 'qci_timestamp',
Property changes on: branches/REL1_18/phase3/includes
___________________________________________________________________
Modified: svn:mergeinfo
431431 Merged /trunk/phase3/includes:r98379,98411,98612,98676,98756,98774,98812
Index: branches/REL1_18/phase3/resources/jquery/jquery.tablesorter.css
@@ -0,0 +1,14 @@
 2+/* Table Sorting */
 3+table.jquery-tablesorter th.headerSort {
 4+ background-image: url(images/sort_both.gif);
 5+ cursor: pointer;
 6+ background-repeat: no-repeat;
 7+ background-position: center right;
 8+ padding-right: 21px;
 9+}
 10+table.jquery-tablesorter th.headerSortUp {
 11+ background-image: url(images/sort_up.gif);
 12+}
 13+table.jquery-tablesorter th.headerSortDown {
 14+ background-image: url(images/sort_down.gif);
 15+}
Property changes on: branches/REL1_18/phase3/resources/jquery/jquery.tablesorter.css
___________________________________________________________________
Added: svn:eol-style
116 + native
Index: branches/REL1_18/phase3/resources/mediawiki.special/mediawiki.special.block.js
@@ -4,7 +4,7 @@
55
66 var DO_INSTANT = true,
77 $blockTarget = $( '#mw-bi-target' ),
8 - $anonOnlyRow = $( '#mw-input-wpHardblock' ).closest( 'tr' ),
 8+ $anonOnlyRow = $( '#mw-input-wpHardBlock' ).closest( 'tr' ),
99 $enableAutoblockRow = $( '#mw-input-wpAutoBlock' ).closest( 'tr' ),
1010 $hideUser = $( '#mw-input-wpHideUser' ).closest( 'tr' ),
1111 $watchUser = $( '#mw-input-wpWatch' ).closest( 'tr' );
@@ -43,4 +43,4 @@
4444
4545 // Call them now to set initial state (ie. Special:Block/Foobar?wpBlockExpiry=2+hours)
4646 updateBlockOptions( DO_INSTANT );
47 -});
\ No newline at end of file
 47+});
Property changes on: branches/REL1_18/phase3
___________________________________________________________________
Modified: svn:mergeinfo
4848 Merged /trunk/phase3:r98379,98411,98612,98676,98756,98774,98812

Past revisions this follows-up on

RevisionCommit summaryAuthorDate
r97687bug 31052 : live hack to support reading from old non-slave external store se...asher01:08, 21 September 2011
r98379clean up Html::inlineScript usage...krinkle22:47, 28 September 2011
r98411Fix handling of qplimit/qpoffset and cachedtimestamp in QueryPage api module...bawolff15:16, 29 September 2011
r98612Fixed case of ID in selectoraaron06:16, 1 October 2011
r98665Add the class jquery-tablesorter to all tables that are made sortable....hartman11:08, 2 October 2011
r98676Follow up to r98665....hartman16:06, 2 October 2011
r98718Followup r98707: apply this logic to signupend too, per a bug comment.catrope21:07, 2 October 2011
r98756Merge r97687reedy13:19, 3 October 2011
r98774Fix embarrassing mistake in r98718catrope16:26, 3 October 2011
r98812* (bug 31282) Fix use of ForeignAPIRepo/InstantCommons TIFF images when $wgTi...brion22:04, 3 October 2011

Status & tagging log