[MediaWiki-commits] [Gerrit] Update URL configuration for mobile when entering mobile mode - change (operations/mediawiki-config)

2015-07-30 Thread jenkins-bot (Code Review)
jenkins-bot has submitted this change and it was merged.

Change subject: Update URL configuration for mobile when entering mobile mode
..


Update URL configuration for mobile when entering mobile mode

* Use $wgCanonicalServer to construct $wgExtensionAssetsPath, $wgLoadScript,
  $wgResourceBasePath, and $wgStyleSheetPath, because
  MobileContext::getMobileUrl() does not work correctly with protocol-relative
  URLs.
* When entering mobile mode, call MobileContext::getMobileUrl() to transform
  each of the aforementioned configuration variables.

Bug: T106966
Change-Id: I0990ac5b6850315420511fce8b8be0bb97efda5d
---
M wmf-config/CommonSettings.php
M wmf-config/mobile.php
2 files changed, 12 insertions(+), 6 deletions(-)

Approvals:
  Ori.livneh: Looks good to me, approved
  jenkins-bot: Verified



diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 3e58cb9..9e22ca3 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -201,11 +201,10 @@
 unset( $wgStylePath );
 unset( $wgStyleSheetPath );
 
-$wmgAssetsHost = $_SERVER['SERVER_NAME'];
-$wgLoadScript = //{$wmgAssetsHost}/w/load.php;
-$wgExtensionAssetsPath = 
//{$wmgAssetsHost}/static/{$wmfVersionNumber}/extensions;
-$wgStyleSheetPath = //{$wmgAssetsHost}/static/{$wmfVersionNumber}/skins;
-$wgResourceBasePath = //{$wmgAssetsHost}/static/{$wmfVersionNumber};
+$wgLoadScript = {$wgCanonicalServer}/w/load.php;
+$wgExtensionAssetsPath = 
{$wgCanonicalServer}/static/{$wmfVersionNumber}/extensions;
+$wgStyleSheetPath = {$wgCanonicalServer}/static/{$wmfVersionNumber}/skins;
+$wgResourceBasePath = {$wgCanonicalServer}/static/{$wmfVersionNumber};
 
 $wgStylePath = $wgStyleSheetPath;
 $wgArticlePath = /wiki/$1;
diff --git a/wmf-config/mobile.php b/wmf-config/mobile.php
index 2e24a10..66bc9e7 100644
--- a/wmf-config/mobile.php
+++ b/wmf-config/mobile.php
@@ -64,7 +64,14 @@
$wgMFNoMobilePages = $wmgMFNoMobilePages;
 
$wgHooks['EnterMobileMode'][] = function() {
-   global $wgCentralAuthCookieDomain;
+   global $wgCentralAuthCookieDomain, $wgExtensionAssetsPath,
+   $wgLoadScript, $wgResourceBasePath, $wgStyleSheetPath;
+
+   $mobileContext = MobileContext::singleton();
+   $wgExtensionAssetsPath = $mobileContext-getMobileUrl( 
$wgExtensionAssetsPath );
+   $wgLoadScript = $mobileContext-getMobileUrl( $wgLoadScript );
+   $wgResourceBasePath = $mobileContext-getMobileUrl( 
$wgResourceBasePath );
+   $wgStyleSheetPath = $mobileContext-getMobileUrl( 
$wgStyleSheetPath );
 
// Hack for T49647
if ( $wgCentralAuthCookieDomain == 'commons.wikimedia.org' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/228122
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: merged
Gerrit-Change-Id: I0990ac5b6850315420511fce8b8be0bb97efda5d
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: Ori.livneh o...@wikimedia.org
Gerrit-Reviewer: jenkins-bot 

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits


[MediaWiki-commits] [Gerrit] Update URL configuration for mobile when entering mobile mode - change (operations/mediawiki-config)

2015-07-30 Thread Ori.livneh (Code Review)
Ori.livneh has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/228122

Change subject: Update URL configuration for mobile when entering mobile mode
..

Update URL configuration for mobile when entering mobile mode

* Use $wgCanonicalServer to construct $wgExtensionAssetsPath, $wgLoadScript,
  $wgResourceBasePath, and $wgStyleSheetPath, because
  MobileContext::getMobileUrl() does not work correctly with protocol-relative
  URLs.
* When entering mobile mode, call MobileContext::getMobileUrl() to transform
  each of the aforementioned configuration variables.

Bug: T106966
Change-Id: I0990ac5b6850315420511fce8b8be0bb97efda5d
---
M wmf-config/CommonSettings.php
M wmf-config/mobile.php
2 files changed, 12 insertions(+), 6 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/operations/mediawiki-config 
refs/changes/22/228122/1

diff --git a/wmf-config/CommonSettings.php b/wmf-config/CommonSettings.php
index 3e58cb9..9e22ca3 100755
--- a/wmf-config/CommonSettings.php
+++ b/wmf-config/CommonSettings.php
@@ -201,11 +201,10 @@
 unset( $wgStylePath );
 unset( $wgStyleSheetPath );
 
-$wmgAssetsHost = $_SERVER['SERVER_NAME'];
-$wgLoadScript = //{$wmgAssetsHost}/w/load.php;
-$wgExtensionAssetsPath = 
//{$wmgAssetsHost}/static/{$wmfVersionNumber}/extensions;
-$wgStyleSheetPath = //{$wmgAssetsHost}/static/{$wmfVersionNumber}/skins;
-$wgResourceBasePath = //{$wmgAssetsHost}/static/{$wmfVersionNumber};
+$wgLoadScript = {$wgCanonicalServer}/w/load.php;
+$wgExtensionAssetsPath = 
{$wgCanonicalServer}/static/{$wmfVersionNumber}/extensions;
+$wgStyleSheetPath = {$wgCanonicalServer}/static/{$wmfVersionNumber}/skins;
+$wgResourceBasePath = {$wgCanonicalServer}/static/{$wmfVersionNumber};
 
 $wgStylePath = $wgStyleSheetPath;
 $wgArticlePath = /wiki/$1;
diff --git a/wmf-config/mobile.php b/wmf-config/mobile.php
index 2e24a10..66bc9e7 100644
--- a/wmf-config/mobile.php
+++ b/wmf-config/mobile.php
@@ -64,7 +64,14 @@
$wgMFNoMobilePages = $wmgMFNoMobilePages;
 
$wgHooks['EnterMobileMode'][] = function() {
-   global $wgCentralAuthCookieDomain;
+   global $wgCentralAuthCookieDomain, $wgExtensionAssetsPath,
+   $wgLoadScript, $wgResourceBasePath, $wgStyleSheetPath;
+
+   $mobileContext = MobileContext::singleton();
+   $wgExtensionAssetsPath = $mobileContext-getMobileUrl( 
$wgExtensionAssetsPath );
+   $wgLoadScript = $mobileContext-getMobileUrl( $wgLoadScript );
+   $wgResourceBasePath = $mobileContext-getMobileUrl( 
$wgResourceBasePath );
+   $wgStyleSheetPath = $mobileContext-getMobileUrl( 
$wgStyleSheetPath );
 
// Hack for T49647
if ( $wgCentralAuthCookieDomain == 'commons.wikimedia.org' ) {

-- 
To view, visit https://gerrit.wikimedia.org/r/228122
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I0990ac5b6850315420511fce8b8be0bb97efda5d
Gerrit-PatchSet: 1
Gerrit-Project: operations/mediawiki-config
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh o...@wikimedia.org

___
MediaWiki-commits mailing list
MediaWiki-commits@lists.wikimedia.org
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits