Ori.livneh has uploaded a new change for review.

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


Change subject: Make base font repository path configurable via 
$wgULSFontRepositoryBasePath
......................................................................

Make base font repository path configurable via $wgULSFontRepositoryBasePath

This patch adds a configuration variable, '$wgULSFontRepositoryBasePath', which
specifies the base path to the font repository. By default, the variable is set
to its existing value, which is $wgExtensionAssetsPath +
'/UniversalLanguageSelector/data/fontrepo/fonts/'. However, adding a discrete
configuration variable makes it possible to configure ULS to use a custom URL
scheme that is more suitable for large static assets that change infrequently.

Change-Id: Idbe57072c4f3258757eb691e54cab5429cadcfda
---
M UniversalLanguageSelector.hooks.php
M UniversalLanguageSelector.php
M resources/js/ext.uls.webfonts.js
3 files changed, 11 insertions(+), 3 deletions(-)


  git pull 
ssh://gerrit.wikimedia.org:29418/mediawiki/extensions/UniversalLanguageSelector 
refs/changes/41/89641/1

diff --git a/UniversalLanguageSelector.hooks.php 
b/UniversalLanguageSelector.hooks.php
index b3fa7e8..566ed2d 100644
--- a/UniversalLanguageSelector.hooks.php
+++ b/UniversalLanguageSelector.hooks.php
@@ -256,7 +256,8 @@
         */
        public static function addConfig( &$vars ) {
                global $wgULSGeoService, $wgULSIMEEnabled, $wgULSPosition, 
$wgULSNoWebfontsSelectors,
-                       $wgULSAnonCanChangeLanguage, $wgULSEventLogging, 
$wgULSNoImeSelectors;
+                       $wgULSAnonCanChangeLanguage, $wgULSEventLogging, 
$wgULSNoImeSelectors,
+                       $wgULSFontRepositoryBasePath;
 
                // Place constant stuff here (not depending on request context)
                if ( is_string( $wgULSGeoService ) ) {
@@ -268,6 +269,7 @@
                $vars['wgULSEventLogging'] = $wgULSEventLogging;
                $vars['wgULSNoImeSelectors'] = $wgULSNoImeSelectors;
                $vars['wgULSNoWebfontsSelectors'] = $wgULSNoWebfontsSelectors;
+               $vars['wgULSFontRepositoryBasePath'] = 
$wgULSFontRepositoryBasePath;
 
                return true;
        }
diff --git a/UniversalLanguageSelector.php b/UniversalLanguageSelector.php
index eb586b4..b5a58b8 100644
--- a/UniversalLanguageSelector.php
+++ b/UniversalLanguageSelector.php
@@ -137,6 +137,13 @@
  */
 $wgULSNoWebfontsSelectors = array( '#p-lang li > a' );
 
+/**
+ * Base path of ULS font repository.
+ * @since 2013.10
+ */
+$wgULSFontRepositoryBasePath =
+       $wgExtensionAssetsPath . 
'/UniversalLanguageSelector/data/fontrepo/fonts/';
+
 // Internationalization
 $wgExtensionMessagesFiles['UniversalLanguageSelector'] =
        __DIR__ . '/UniversalLanguageSelector.i18n.php';
diff --git a/resources/js/ext.uls.webfonts.js b/resources/js/ext.uls.webfonts.js
index 52b87b3..91b240b 100644
--- a/resources/js/ext.uls.webfonts.js
+++ b/resources/js/ext.uls.webfonts.js
@@ -47,8 +47,7 @@
        };
 
        mediawikiFontRepository = $.webfonts.repository;
-       mediawikiFontRepository.base = mw.config.get( 'wgExtensionAssetsPath' ) 
+
-               '/UniversalLanguageSelector/data/fontrepo/fonts/';
+       mediawikiFontRepository.base = mw.config.get( 
'wgULSFontRepositoryBasePath' );
 
        mw.webfonts.setup = function () {
                // Initialize webfonts

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

Gerrit-MessageType: newchange
Gerrit-Change-Id: Idbe57072c4f3258757eb691e54cab5429cadcfda
Gerrit-PatchSet: 1
Gerrit-Project: mediawiki/extensions/UniversalLanguageSelector
Gerrit-Branch: master
Gerrit-Owner: Ori.livneh <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to