Index: branches/REL1_17/phase3/includes/OutputPage.php |
— | — | @@ -2381,14 +2381,29 @@ |
2382 | 2382 | } |
2383 | 2383 | $links = ''; |
2384 | 2384 | foreach ( $groups as $group => $modules ) { |
2385 | | - $query['modules'] = implode( '|', array_keys( $modules ) ); |
2386 | 2385 | // Special handling for user-specific groups |
2387 | 2386 | if ( ( $group === 'user' || $group === 'private' ) && $wgUser->isLoggedIn() ) { |
2388 | 2387 | $query['user'] = $wgUser->getName(); |
2389 | 2388 | } |
| 2389 | + |
| 2390 | + // Create a fake request based on the one we are about to make so modules return |
| 2391 | + // correct timestamp and emptiness data |
| 2392 | + $context = new ResourceLoaderContext( $resourceLoader, new FauxRequest( $query ) ); |
| 2393 | + // Drop modules that know they're empty |
| 2394 | + foreach ( $modules as $key => $module ) { |
| 2395 | + if ( $module->isKnownEmpty( $context ) ) { |
| 2396 | + unset( $modules[$key] ); |
| 2397 | + } |
| 2398 | + } |
| 2399 | + // If there are no modules left, skip this group |
| 2400 | + if ( $modules === array() ) { |
| 2401 | + continue; |
| 2402 | + } |
| 2403 | + |
| 2404 | + $query['modules'] = implode( '|', array_keys( $modules ) ); |
| 2405 | + |
2390 | 2406 | // Support inlining of private modules if configured as such |
2391 | 2407 | if ( $group === 'private' && $wgResourceLoaderInlinePrivateModules ) { |
2392 | | - $context = new ResourceLoaderContext( $resourceLoader, new FauxRequest( $query ) ); |
2393 | 2408 | if ( $only == 'styles' ) { |
2394 | 2409 | $links .= Html::inlineStyle( |
2395 | 2410 | $resourceLoader->makeModuleResponse( $context, $modules ) |
— | — | @@ -2406,9 +2421,6 @@ |
2407 | 2422 | // on-wiki like site or user pages, or user preferences; we need to find the highest |
2408 | 2423 | // timestamp of these user-changable modules so we can ensure cache misses on change |
2409 | 2424 | if ( $group === 'user' || $group === 'site' ) { |
2410 | | - // Create a fake request based on the one we are about to make so modules return |
2411 | | - // correct times |
2412 | | - $context = new ResourceLoaderContext( $resourceLoader, new FauxRequest( $query ) ); |
2413 | 2425 | // Get the maximum timestamp |
2414 | 2426 | $timestamp = 1; |
2415 | 2427 | foreach ( $modules as $module ) { |
Property changes on: branches/REL1_17/phase3/includes/OutputPage.php |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2416 | 2428 | Merged /trunk/phase3/includes/includes/OutputPage.php:r82474 |
2417 | 2429 | Merged /trunk/phase3/includes/OutputPage.php:r82468,82474 |
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderContext.php |
— | — | @@ -131,7 +131,7 @@ |
132 | 132 | } |
133 | 133 | |
134 | 134 | public function getHash() { |
135 | | - if ( isset( $this->hash ) ) { |
| 135 | + if ( !isset( $this->hash ) ) { |
136 | 136 | $this->hash = implode( '|', array( |
137 | 137 | $this->getLanguage(), $this->getDirection(), $this->skin, $this->user, |
138 | 138 | $this->debug, $this->only, $this->version |
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderModule.php |
— | — | @@ -223,4 +223,17 @@ |
224 | 224 | // 0 would mean now |
225 | 225 | return 1; |
226 | 226 | } |
| 227 | + |
| 228 | + /** |
| 229 | + * Check whether this module is known to be empty. If a child class |
| 230 | + * has an easy and cheap way to determine that this module is |
| 231 | + * definitely going to be empty, it should override this method to |
| 232 | + * return true in that case. Callers may optimize the request for this |
| 233 | + * module away if this function returns true. |
| 234 | + * @param $context ResourceLoaderContext: Context object |
| 235 | + * @return Boolean |
| 236 | + */ |
| 237 | + public function isKnownEmpty( ResourceLoaderContext $context ) { |
| 238 | + return false; |
| 239 | + } |
227 | 240 | } |
Index: branches/REL1_17/phase3/includes/resourceloader/ResourceLoaderWikiModule.php |
— | — | @@ -33,8 +33,8 @@ |
34 | 34 | |
35 | 35 | /* Protected Members */ |
36 | 36 | |
37 | | - // In-object cache for modified time |
38 | | - protected $modifiedTime = array(); |
| 37 | + // In-object cache for title mtimes |
| 38 | + protected $titleMtimes = array(); |
39 | 39 | |
40 | 40 | /* Abstract Protected Methods */ |
41 | 41 | |
— | — | @@ -113,29 +113,59 @@ |
114 | 114 | } |
115 | 115 | |
116 | 116 | public function getModifiedTime( ResourceLoaderContext $context ) { |
| 117 | + $modifiedTime = 1; // wfTimestamp() interprets 0 as "now" |
| 118 | + $mtimes = $this->getTitleMtimes( $context ); |
| 119 | + if ( count( $mtimes ) ) { |
| 120 | + $modifiedTime = max( $modifiedTime, max( $mtimes ) ); |
| 121 | + } |
| 122 | + return $modifiedTime; |
| 123 | + } |
| 124 | + |
| 125 | + public function isKnownEmpty( ResourceLoaderContext $context ) { |
| 126 | + return count( $this->getTitleMtimes( $context ) ) == 0; |
| 127 | + } |
| 128 | + |
| 129 | + /** |
| 130 | + * @param $context ResourceLoaderContext |
| 131 | + * @return bool |
| 132 | + */ |
| 133 | + public function getFlip( $context ) { |
| 134 | + global $wgContLang; |
| 135 | + |
| 136 | + return $wgContLang->getDir() !== $context->getDirection(); |
| 137 | + } |
| 138 | + |
| 139 | + /** |
| 140 | + * Get the modification times of all titles that would be loaded for |
| 141 | + * a given context. |
| 142 | + * @param $context ResourceLoaderContext: Context object |
| 143 | + * @return array( prefixed DB key => UNIX timestamp ), nonexistent titles are dropped |
| 144 | + */ |
| 145 | + protected function getTitleMtimes( ResourceLoaderContext $context ) { |
117 | 146 | $hash = $context->getHash(); |
118 | | - if ( isset( $this->modifiedTime[$hash] ) ) { |
119 | | - return $this->modifiedTime[$hash]; |
| 147 | + if ( isset( $this->titleMtimes[$hash] ) ) { |
| 148 | + return $this->titleMtimes[$hash]; |
120 | 149 | } |
121 | | - |
| 150 | + |
| 151 | + $this->titleMtimes[$hash] = array(); |
122 | 152 | $batch = new LinkBatch; |
123 | 153 | foreach ( $this->getPages( $context ) as $titleText => $options ) { |
124 | 154 | $batch->addObj( Title::newFromText( $titleText ) ); |
125 | 155 | } |
126 | | - |
127 | | - $modifiedTime = 1; // wfTimestamp() interprets 0 as "now" |
| 156 | + |
128 | 157 | if ( !$batch->isEmpty() ) { |
129 | 158 | $dbr = wfGetDB( DB_SLAVE ); |
130 | | - $latest = $dbr->selectField( 'page', 'MAX(page_touched)', |
| 159 | + $res = $dbr->select( 'page', |
| 160 | + array( 'page_namespace', 'page_title', 'page_touched' ), |
131 | 161 | $batch->constructSet( 'page', $dbr ), |
132 | | - __METHOD__ ); |
133 | | - |
134 | | - if ( $latest ) { |
135 | | - $modifiedTime = wfTimestamp( TS_UNIX, $latest ); |
| 162 | + __METHOD__ |
| 163 | + ); |
| 164 | + foreach ( $res as $row ) { |
| 165 | + $title = Title::makeTitle( $row->page_namespace, $row->page_title ); |
| 166 | + $this->titleMtimes[$hash][$title->getPrefixedDBkey()] = |
| 167 | + wfTimestamp( TS_UNIX, $row->page_touched ); |
136 | 168 | } |
137 | 169 | } |
138 | | - |
139 | | - $this->modifiedTime[$hash] = $modifiedTime; |
140 | | - return $modifiedTime; |
| 170 | + return $this->titleMtimes[$hash]; |
141 | 171 | } |
142 | 172 | } |
Index: branches/REL1_17/phase3/includes/EditPage.php |
— | — | @@ -340,6 +340,8 @@ |
341 | 341 | if ( $wgUser->getOption( 'uselivepreview', false ) ) { |
342 | 342 | $wgOut->addModules( 'mediawiki.legacy.preview' ); |
343 | 343 | } |
| 344 | + // Bug #19334: textarea jumps when editing articles in IE8 |
| 345 | + $wgOut->addStyle( 'common/IE80Fixes.css', 'screen', 'IE 8' ); |
344 | 346 | |
345 | 347 | $permErrors = $this->getEditPermissionErrors(); |
346 | 348 | if ( $permErrors ) { |
Property changes on: branches/REL1_17/phase3/includes |
___________________________________________________________________ |
Modified: svn:mergeinfo |
347 | 349 | Merged /trunk/phase3/includes:r82474 |
Index: branches/REL1_17/phase3/skins/common/IE80Fixes.css |
— | — | @@ -0,0 +1,15 @@ |
| 2 | +/** |
| 3 | + * Fixes textarea scrolling bug (bug #19334). The bug only occurs when a |
| 4 | + * percentage width is given, so instead of width: 100%, use min-width: 100%; |
| 5 | + * max-width: 100%. We also need to give a fixed width for the actual width |
| 6 | + * property for the hack to work, although the actual value (500px here) ends |
| 7 | + * up being ignored; min/max-width take precedence. |
| 8 | + * |
| 9 | + * More info: http://grantovich.net/posts/2009/06/that-weird-ie8-textarea-bug/ |
| 10 | + */ |
| 11 | +#wpTextbox1 { |
| 12 | + height: 390px; |
| 13 | + width: 500px; |
| 14 | + min-width: 100%; |
| 15 | + max-width: 100%; |
| 16 | +} |
Property changes on: branches/REL1_17/phase3/skins/common/IE80Fixes.css |
___________________________________________________________________ |
Added: svn:eol-style |
1 | 17 | + native |
Property changes on: branches/REL1_17/phase3 |
___________________________________________________________________ |
Modified: svn:mergeinfo |
2 | 18 | Merged /trunk/phase3:r82474 |