jenkins-bot has submitted this change and it was merged.
Change subject: Allow optin to lazy loaded references via cookie
......................................................................
Allow optin to lazy loaded references via cookie
Depends-On: I1526c844ad34f5dc61a1485120245c362c00118e
Bug: T129693
Change-Id: Ib59dc05710357d13903330b87060ac8f4a7394cf
---
M includes/MobileContext.php
1 file changed, 5 insertions(+), 1 deletion(-)
Approvals:
Jdlrobson: Looks good to me, approved
Bmansurov: Looks good to me, approved
jenkins-bot: Verified
diff --git a/includes/MobileContext.php b/includes/MobileContext.php
index c751615..950b434 100644
--- a/includes/MobileContext.php
+++ b/includes/MobileContext.php
@@ -11,6 +11,8 @@
const USER_MODE_PREFERENCE_NAME = 'mfMode';
const LAZY_LOAD_IMAGES_COOKIE_NAME = 'mfLazyLoadImages';
const LAZY_LOAD_IMAGES_COOKIE_VALUE = 'A';
+ const LAZY_LOAD_REFERENCES_COOKIE_NAME = 'mfLazyLoadReferences';
+ const LAZY_LOAD_REFERENCES_COOKIE_VALUE = 'A';
/**
* Saves the testing mode user has opted in: 'beta' or 'stable'
@@ -176,8 +178,10 @@
public function isLazyLoadReferencesEnabled() {
if ( $this->lazyLoadReferences === null ) {
$mfLazyLoadReferences = $this->getMFConfig()->get(
'MFLazyLoadReferences' );
+ $cookie = $this->getRequest()->getCookie(
self::LAZY_LOAD_REFERENCES_COOKIE_NAME, '' );
$this->lazyLoadReferences =
$mfLazyLoadReferences['base'] ||
- ( $this->isBetaGroupMember() &&
$mfLazyLoadReferences['beta'] );
+ ( $this->isBetaGroupMember() &&
$mfLazyLoadReferences['beta'] ) ||
+ $cookie ===
self::LAZY_LOAD_REFERENCES_COOKIE_VALUE;
}
return $this->lazyLoadReferences;
}
--
To view, visit https://gerrit.wikimedia.org/r/284593
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings
Gerrit-MessageType: merged
Gerrit-Change-Id: Ib59dc05710357d13903330b87060ac8f4a7394cf
Gerrit-PatchSet: 6
Gerrit-Project: mediawiki/extensions/MobileFrontend
Gerrit-Branch: master
Gerrit-Owner: Jdlrobson <[email protected]>
Gerrit-Reviewer: Bmansurov <[email protected]>
Gerrit-Reviewer: Jdlrobson <[email protected]>
Gerrit-Reviewer: jenkins-bot <>
_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits