Bmansurov has uploaded a new change for review.
https://gerrit.wikimedia.org/r/214113
Change subject: Fix the last modified bar regression for cached pages
......................................................................
Fix the last modified bar regression for cached pages
Bug: T100429
Change-Id: I227e1395ba1d3f45a6ff9f8acd79cc0703cb122c
---
M resources/mobile.head/init.js
1 file changed, 21 insertions(+), 8 deletions(-)
git pull ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/MobileFrontend
refs/changes/13/214113/1
diff --git a/resources/mobile.head/init.js b/resources/mobile.head/init.js
index e263da5..abbd07e 100644
--- a/resources/mobile.head/init.js
+++ b/resources/mobile.head/init.js
@@ -13,7 +13,10 @@
*/
function initHistoryLink() {
var $lastModified = $( '#mw-mf-last-modified' ),
- $lastModifiedLink = $lastModified.find( 'a' ),
+ // FIXME remove when the cache clears. Today is
05/27/2015
+ isPageCached = $lastModified.length &&
$lastModified.prop( 'tagName' ).toLowerCase() === 'a',
+ // FIXME remove the cache related part. Today is
05/27/2015
+ $lastModifiedLink = isPageCached ? $lastModified :
$lastModified.find( 'a' ),
historyUrl = $lastModifiedLink.attr( 'href' ),
ts = $lastModifiedLink.data( 'timestamp' ),
username = $lastModifiedLink.data( 'user-name' ) ||
false,
@@ -48,14 +51,24 @@
username ? mw.util.getUrl(
'Special:UserProfile/' + username ) : ''
] );
- $lastModifiedLink.html( mw.message.apply( this, args
).parse() );
+ // FIXME: remove the if part when the cache clears.
Today is 05/27/2015
+ if ( isPageCached ) {
+ $( '<div>' ).attr( 'id', 'mw-mf-last-modified' )
+ .css( 'padding', '5px 3.35em' )
+ .attr( 'class', $lastModified.attr(
'class' ) )
+ .html( mw.message.apply( this, args
).parse() )
+ .insertBefore( $lastModified );
+ $lastModified.remove();
+ } else {
+ $lastModifiedLink.html( mw.message.apply( this,
args ).parse() );
- // FIXME: remove this when the cache clears. Today is
05/21/2015.
- // Make the cached DOM look similar to the new DOM
- if ( $lastModified.hasClass( 'last-modified-bar' ) ) {
- $lastModified
- .removeClass( 'last-modified-bar' )
- .wrap( '<div
class="last-modified-bar"></div>' );
+ // FIXME: remove this when the cache clears.
Today is 05/21/2015.
+ // Make the cached DOM look similar to the new
DOM
+ if ( $lastModified.hasClass(
'last-modified-bar' ) ) {
+ $lastModified
+ .removeClass(
'last-modified-bar' )
+ .wrap( '<div
class="last-modified-bar"></div>' );
+ }
}
} else {
// FIXME: remove this when the cache clears. Today is
05/21/2015.
--
To view, visit https://gerrit.wikimedia.org/r/214113
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: newchange
Gerrit-Change-Id: I227e1395ba1d3f45a6ff9f8acd79cc0703cb122c
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Bmansurov <[email protected]>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits