This commit allows to log tofu detection always,
even if the rest of the webfonts library is not loaded.
By default this is disabled.
To enable it, set the variable $wgULSTofuLoggingChance
to a number between 0 and 100, indicating the chance of it
getting logged. The idea of the lottery is that even a partial
sample can be useful.
Change-Id: Ia08fe0de348b7eebfa95498a6be58ae41608ba3b
Placing a check to not allow feature to appear in beta feature list
if there are no interlanguage links in wiki
Bug: 62361
Change-Id: I8fff949539f40953845c8ee695006ff3f4ea8241
Add new $wgULSCompactLinks feature flag, defaulting to false (as is standard
for Beta Features). Only allow enabling of the feature if ULS position is
'interlanguage'.
Change-Id: Ia268c3a49b5aa14b6a00e33c7f01a61eba48e776
This patch restores the enableWebfonts preference, stored inside
the uls-preferences blob. It existed as 'enable-webfonts' in
the past and was removed in
If735a733717596fae03042c5e277bd538bd8501f
Each wiki can be configured to load the fonts by default
using the new global variable $wgULSWebfontsEnabled.
Its default value is true (to load fonts).
This also removes the preference 'uls-enable', recently added in
I71b70d8ee7c3cad7f49b32e5dc494ef4fc1bdb2f
The initialization of ext.uls.webfonts.js is changed as well,
so that minimal webfonts JS library code is loaded,
and the rest is loaded only if a user requests it.
Bug: 60304
Change-Id: I49e812eae32266f165591c75fd67b86ca06b13f0
Adds an option, 'enable-uls' for users to enable ULS. By default
it is enabled. Wikis can use $wgHiddenPrefs to prevent users from
disabling ULS.
Bug: 46306
Change-Id: I71b70d8ee7c3cad7f49b32e5dc494ef4fc1bdb2f
The ResourceLoaderGetConfigVars hook is intended for static
variables, not ones that depend on the current request.
Change-Id: I596495bd103e5b7735fb454e3b5f12cd4257ee99
Written in pair-programming with Ryan Kaldari.
This adds a version of webfonts initialization that is stripped
of any smart features. It only loads the basic jquery.webfonts
library and the fonts repository in a way that is usable
with the MobileFronted extension.
It is completely disabled by default.
It can be enabled by setting
$wgULSMobileWebfontsEnabled = true;
and even then it will only be enabled for users
who opted in for the mobile beta mode.
Change-Id: I488e411232a1192bbf46ae5675c701366bda9a3e
* Do not load anything unless input field is focused
* Split the setup function to smaller functions
* Introduce $wgULSImeSelectors to allow configuration and avoid
duplication of selectors in two places.
Change-Id: If5a476e66681dde9f0b72f619d35ddf6255246ac
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
* Updates jquery.webfonts from upstream
* Introduces wgULSNoWebfontsSelectors configuration variable. It
takes an array of jquery selector to which webfonts will not be
applied if defined.
Change-Id: I0dc263f84620af4077f52e18eeb0f986ff0f13b9
Separating event logging out of ULS functionality. Event logging
is now loosely coupled with ULS. ULS core modules can emit an event
whenever EventLogging is required. The eventlogger module will act
on the event if configured.
Change-Id: I59dfcfb25c1acb85376b56239f2355ee7c4aff1e
Add the variable $wgULSNoImeSelectors to allow custom
disabling of IME in specific elements.
Add captcha input field id to the exclusion list.
Bug: 41675
Change-Id: Ib03a20c50a4f473e6a58638b85da16659268eb09
This change introduces a new configuration variable, $wgULSEventLogging. When
set to true, ULS will register an EventLogging schema module for
<http://meta.wikimedia.org/wiki/Schema:UniversalLanguageSelector>,
making it possible to log events using `mw.uls.logEvent`. When false, the
schema module is not loaded, and `mw.uls.logEvent` is a no-op.
Change-Id: I7139e67cc2f830a6b4b3c8ff1fc72dfcdec9a699
* Since there is an API to load the i18n json files, avoid sending
list of localizations to client. Previously this list was used to
avoid 404s for json files. Now API takes care of it. Remove the
caching for this list too.
* Preload the i18n files on document ready. This avoids delay in
initializing IME or ULS window after fetch i18n from server.
* ApiULSLocalization can serve messages for all namespaces known if
namespace parameter is not set
Bug: 50391
Change-Id: I6b848da35f57353790bf460983cdf19a11bb238a
This reverts commit 6ae0fe3e44.
The commit was duplicating the preferences in 2 places
making the syncing hard.
As per discussion with Pau, we will try alternate approach.
Bug: 48642
Change-Id: I5c97838ed875364dc35b66a3d6c33d9975b5107e
Unlike freegeoip it also works with https
Also moved the getCountryCode function to init, as it should be
available regardless of whether we load the optional geoclient
module.
Bug: 40965
Change-Id: Ia18130890d09f86a93b5b61f7da7c48fcfa480c7
This allows us to enable web fonts and input methods for all
users by disabling just the interface language selection.
Updated the documentation of the variables to make it clearer
what each does. Summary:
* Enabling: $wgULSEnable and $wgULSEnableAnon
* Workarounds: $wgULSAnonCanChangeLanguage and $wgULSLanguageDetection
Cleaned up hooks, in particular rewritten getLanguage to separate
the logged in vs. logged out steps for easier understanding.
A followup commit is needed to disable language selection UI for
anon if $wgULSAnonCanChangeLanguage is false.
Change-Id: Ia8d21c394ff5efac0ce94664710c97dc3b74ec18
ULS is disabled for anonymous users on WMF projects. But to provide
rest of the features - apis, language database, language selection for
many use cases, we need to provide a minimal ULS. RL module
ext.uls.init does that job now.
For using ULS as interface language selection tool, new RL module
ext.uls.interface is introduced. That will add UI language selection,
webfonts, ime features, if enabled.
Change-Id: I796a7c9cce0de42bf8aa06b26e383e0075dbe1dd