Index: branches/REL1_18/phase3/includes/ProtectionForm.php |
— | — | @@ -577,25 +577,26 @@ |
578 | 578 | } |
579 | 579 | |
580 | 580 | function buildCleanupScript() { |
581 | | - global $wgRestrictionLevels, $wgGroupPermissions; |
582 | | - $script = 'var wgCascadeableLevels='; |
583 | | - $CascadeableLevels = array(); |
| 581 | + global $wgRestrictionLevels, $wgGroupPermissions, $wgOut; |
| 582 | + |
| 583 | + $cascadeableLevels = array(); |
584 | 584 | 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; |
587 | 589 | } |
588 | 590 | } |
589 | | - $script .= "[" . implode(',',$CascadeableLevels) . "];\n"; |
590 | | - $options = (object)array( |
| 591 | + $options = array( |
591 | 592 | '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, |
595 | 596 | ); |
596 | | - $encOptions = Xml::encodeJsVar( $options ); |
597 | 597 | |
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 ) ); |
600 | 601 | } |
601 | 602 | |
602 | 603 | /** |
Index: branches/REL1_18/phase3/includes/EditPage.php |
— | — | @@ -2491,7 +2491,6 @@ |
2492 | 2492 | 'key' => 'R' |
2493 | 2493 | ) |
2494 | 2494 | ); |
2495 | | - $toolbar = "<div id='toolbar'>\n"; |
2496 | 2495 | |
2497 | 2496 | $script = ''; |
2498 | 2497 | foreach ( $toolarray as $tool ) { |
— | — | @@ -2516,15 +2515,11 @@ |
2517 | 2516 | $cssId = $tool['id'], |
2518 | 2517 | ); |
2519 | 2518 | |
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 ); |
2523 | 2520 | } |
2524 | | - $wgOut->addScript( Html::inlineScript( |
2525 | | - "if ( window.mediaWiki ) {{$script}}" |
2526 | | - ) ); |
| 2521 | + $wgOut->addScript( Html::inlineScript( ResourceLoader::makeLoaderConditionalScript( $script ) ) ); |
2527 | 2522 | |
2528 | | - $toolbar .= "\n</div>"; |
| 2523 | + $toolbar = '<div id="toolbar"></div>'; |
2529 | 2524 | |
2530 | 2525 | wfRunHooks( 'EditPageBeforeEditToolbar', array( &$toolbar ) ); |
2531 | 2526 | |
Property changes on: branches/REL1_18/phase3/includes/EditPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2532 | 2527 | 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 @@ |
105 | 105 | return; |
106 | 106 | } |
107 | 107 | |
108 | | - $res = $qp->doQuery( $params['limit'] + 1, $params['offset'] ); |
| 108 | + $res = $qp->doQuery( $params['offset'], $params['limit'] + 1 ); |
109 | 109 | $count = 0; |
110 | 110 | $titles = array(); |
111 | 111 | foreach ( $res as $row ) { |
Property changes on: branches/REL1_18/phase3/includes/api |
___________________________________________________________________ |
Modified: svn:mergeinfo |
112 | 112 | Merged /trunk/phase3/includes/api:r98411,98612,98676,98756,98774,98812 |
Index: branches/REL1_18/phase3/includes/resourceloader/ResourceLoader.php |
— | — | @@ -731,7 +731,7 @@ |
732 | 732 | */ |
733 | 733 | public static function makeLoaderConditionalScript( $script ) { |
734 | 734 | $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"; |
736 | 736 | } |
737 | 737 | |
738 | 738 | /** |
Property changes on: branches/REL1_18/phase3/includes/resourceloader/ResourceLoader.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
739 | 739 | 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 @@ |
18 | 18 | * Conversion to PNG for inline display can be disabled here... |
19 | 19 | * Note scaling should work with ImageMagick, but may not with GD scaling. |
20 | 20 | * |
| 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 | + * |
21 | 25 | * @param $file |
22 | 26 | * |
23 | 27 | * @return bool |
24 | 28 | */ |
25 | 29 | function canRender( $file ) { |
26 | 30 | global $wgTiffThumbnailType; |
27 | | - return (bool)$wgTiffThumbnailType; |
| 31 | + return (bool)$wgTiffThumbnailType |
| 32 | + || ($file->getRepo() instanceof ForeignAPIRepo); |
28 | 33 | } |
29 | 34 | |
30 | 35 | /** |
Index: branches/REL1_18/phase3/includes/ExternalStoreDB.php |
— | — | @@ -18,7 +18,7 @@ |
19 | 19 | */ |
20 | 20 | function &getLoadBalancer( $cluster ) { |
21 | 21 | $wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false; |
22 | | - |
| 22 | + |
23 | 23 | return wfGetLBFactory()->getExternalLB( $cluster, $wiki ); |
24 | 24 | } |
25 | 25 | |
— | — | @@ -29,8 +29,18 @@ |
30 | 30 | * @return DatabaseBase object |
31 | 31 | */ |
32 | 32 | function &getSlave( $cluster ) { |
| 33 | + global $wgDefaultExternalStore; |
| 34 | + |
33 | 35 | $wiki = isset($this->mParams['wiki']) ? $this->mParams['wiki'] : false; |
34 | 36 | $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 | + |
35 | 45 | return $lb->getConnection( DB_SLAVE, array(), $wiki ); |
36 | 46 | } |
37 | 47 | |
— | — | @@ -139,8 +149,8 @@ |
140 | 150 | function store( $cluster, $data ) { |
141 | 151 | $dbw = $this->getMaster( $cluster ); |
142 | 152 | $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 ), |
145 | 155 | __METHOD__ ); |
146 | 156 | $id = $dbw->insertId(); |
147 | 157 | if ( !$id ) { |
Index: branches/REL1_18/phase3/includes/specials/SpecialUserlogin.php |
— | — | @@ -1037,7 +1037,7 @@ |
1038 | 1038 | |
1039 | 1039 | // Use loginend-https for HTTPS requests if it's not blank, loginend otherwise |
1040 | 1040 | // Ditto for signupend |
1041 | | - $usingHTTPS = WebRequest::detectProtocol(); |
| 1041 | + $usingHTTPS = WebRequest::detectProtocol() == 'https'; |
1042 | 1042 | $loginendHTTPS = wfMessage( 'loginend-https' ); |
1043 | 1043 | $signupendHTTPS = wfMessage( 'signupend-https' ); |
1044 | 1044 | if ( $usingHTTPS && !$loginendHTTPS->isBlank() ) { |
Property changes on: branches/REL1_18/phase3/includes/specials |
___________________________________________________________________ |
Modified: svn:mergeinfo |
1045 | 1045 | Merged /trunk/phase3/includes/specials:r98774,98812 |
Index: branches/REL1_18/phase3/includes/QueryPage.php |
— | — | @@ -423,7 +423,7 @@ |
424 | 424 | } |
425 | 425 | |
426 | 426 | public function getCachedTimestamp() { |
427 | | - if ( !is_null( $this->cachedTimestamp ) ) { |
| 427 | + if ( is_null( $this->cachedTimestamp ) ) { |
428 | 428 | $dbr = wfGetDB( DB_SLAVE ); |
429 | 429 | $fname = get_class( $this ) . '::getCachedTimestamp'; |
430 | 430 | $this->cachedTimestamp = $dbr->selectField( 'querycache_info', 'qci_timestamp', |
Property changes on: branches/REL1_18/phase3/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
431 | 431 | 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 |
1 | 16 | + native |
Index: branches/REL1_18/phase3/resources/mediawiki.special/mediawiki.special.block.js |
— | — | @@ -4,7 +4,7 @@ |
5 | 5 | |
6 | 6 | var DO_INSTANT = true, |
7 | 7 | $blockTarget = $( '#mw-bi-target' ), |
8 | | - $anonOnlyRow = $( '#mw-input-wpHardblock' ).closest( 'tr' ), |
| 8 | + $anonOnlyRow = $( '#mw-input-wpHardBlock' ).closest( 'tr' ), |
9 | 9 | $enableAutoblockRow = $( '#mw-input-wpAutoBlock' ).closest( 'tr' ), |
10 | 10 | $hideUser = $( '#mw-input-wpHideUser' ).closest( 'tr' ), |
11 | 11 | $watchUser = $( '#mw-input-wpWatch' ).closest( 'tr' ); |
— | — | @@ -43,4 +43,4 @@ |
44 | 44 | |
45 | 45 | // Call them now to set initial state (ie. Special:Block/Foobar?wpBlockExpiry=2+hours) |
46 | 46 | updateBlockOptions( DO_INSTANT ); |
47 | | -}); |
\ No newline at end of file |
| 47 | +}); |
Property changes on: branches/REL1_18/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
48 | 48 | Merged /trunk/phase3:r98379,98411,98612,98676,98756,98774,98812 |