Commit Graph

92 Commits

Author SHA1 Message Date
Amir E. Aharoni
6de6bdf8f2 Remove tofu detection logging
Change-Id: I2b808bae2ee19062c16d8aaff2bdf0b2986e8ad0
2014-06-26 16:02:49 +03:00
jenkins-bot
53a4d8b087 Merge "Allow always logging tofu detection" 2014-04-14 03:46:01 +00:00
Amir E. Aharoni
10a25c1cc9 Allow always logging tofu detection
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
2014-04-14 09:14:14 +05:30
Amir E. Aharoni
0d384a3f09 Use rtl beta feature icon for compact links
Change-Id: Ifaaadba7815efe00f38253b450d4ef9803986d08
2014-03-22 01:09:14 +02:00
Amir E. Aharoni
9732c5b3cf Coding conventions - whitespace, ===
Change-Id: I56d876529993970b42cf33dc1badb1429b1eda12
2014-03-14 16:47:19 +02:00
Niharika Kohli
76bf85a3e4 Enable compact links feature when ULS position is "personal"
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
2014-03-07 10:20:59 +00:00
James D. Forrester
ba97f53114 Follow-up Ia268c3a49: Actually hide the BF behind a feature flag
Change-Id: I9bfbfb4512bc6d5c96cdd8e7f75056f0e26b2016
2014-03-06 17:26:26 -08:00
Niharika Kohli
7f405134c7 Put new compact language links Beta Feature behind a feature flag
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
2014-03-06 15:34:59 -08:00
Niharika Kohli
5ca0d5d400 Compacting the interlanguage links with the ULS
Displays a shorter version of the language list with the languages that are more relevant to you.
More info at https://www.mediawiki.org/wiki/Universal_Language_Selector/Design/Interlanguage_links

Due to a problem with duplicate patchsets we had to create a new one. 
The history and info on code and security revisions is available at
https://gerrit.wikimedia.org/r/#/c/104793/

Change-Id: I109bfb10f6181b6408aab170db5e8ca32493d657
2014-03-04 09:41:47 +00:00
Santhosh Thottingal
27771fdeaf Restore enableWebfonts pref and remove uls-enable
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
2014-02-10 17:40:30 +05:30
Santhosh Thottingal
81c4dfe848 Refactor the css so that embedded images are optimally loaded
Change-Id: If19d20fb22afafbf62c355394dcda825a0151ac6
2014-01-23 16:48:18 +00:00
Kunal Mehta
ad9caf32be Add user preference to enable ULS
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
2014-01-21 02:46:01 -08:00
Kunal Mehta
091b8a9e02 Load wgULSCurrentAutonym variable in MakeGlobalVariablesScript hook
The ResourceLoaderGetConfigVars hook is intended for static
variables, not ones that depend on the current request.

Change-Id: I596495bd103e5b7735fb454e3b5f12cd4257ee99
2013-12-17 21:55:57 -08:00
Amir E. Aharoni
fd885d9881 Initial support for webfonts in MobileFrontend
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
2013-11-30 12:28:46 +02:00
jenkins-bot
4c6229e9ba Merge "Revert "Do not load jquery.jStorage for logged in users"" 2013-11-12 12:48:51 +00:00
Nikerabbit
2bc77f2c18 Revert "Do not load jquery.jStorage for logged in users"
This reverts commit 5884337c9f.

Change-Id: Icfdfd89059a417a6aaea30d12164e7174dd5f58b
2013-11-12 12:47:56 +00:00
jenkins-bot
601ff3bc60 Merge "Do not load jquery.jStorage for logged in users" 2013-11-12 10:43:57 +00:00
Niklas Laxström
5884337c9f Do not load jquery.jStorage for logged in users
Change-Id: Ibe77962cecd6aa8504aa60d5d2b8d17a56e1319f
2013-11-12 10:40:59 +00:00
Amir E. Aharoni
b23f937cb7 Remove the dependency on uls.data
Change-Id: I9fa103ee7d338ed8ea2032c82249a47d022d2c90
2013-11-11 09:56:55 +00:00
jenkins-bot
a049e25962 Merge "Refactor ime lazy loading" 2013-11-06 04:46:57 +00:00
Niklas Laxström
193f69b017 Refactor ime lazy loading
* 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
2013-11-05 16:48:47 +05:30
Santhosh Thottingal
2b31b242f9 Add autonym class to ULS trigger
Change-Id: I1c613988d399e2ee38ba5d1f1fa8ad5747f7da15
2013-11-05 14:54:15 +05:30
Ori Livneh
03e40f7215 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
2013-10-17 00:10:00 -07:00
Siebrand Mazeland
315cf739bc Update formatting
Change-Id: Iaee2ab4f36d3a0dce143c62965ab29de504b31ea
2013-10-09 15:40:39 +02:00
Santhosh Thottingal
3fbbf05c26 Optionally exclude elements from applying webfonts
* 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
2013-09-19 10:17:54 -07:00
Santhosh Thottingal
117cc5bf46 eventlogger module for ULS
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
2013-08-15 17:08:15 +03:00
Amir E. Aharoni
8205e294d7 Allow disabling of IME by a jQuery selector
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
2013-07-05 13:37:31 +00:00
jenkins-bot
7b9f4c863c Merge "Prepare ULS for EventLogging" 2013-07-03 10:42:43 +00:00
Niklas Laxström
4543d43dda Prepare ULS for EventLogging
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
2013-07-02 12:47:22 +00:00
Santhosh Thottingal
2776a28d58 ULS i18n performance fixes
* 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
2013-06-30 18:08:19 +05:30
Siebrand Mazeland
4a1035dcbf Remove last bits of MediaWiki 1.19 compatibility
Compatibility with MediaWiki 1.19 had already been dropped and this hadn't
been removed yet.

Change-Id: I63788ef1d4a6eb87e4280ea2625579a7874eaff8
2013-06-17 16:44:00 +02:00
Siebrand Mazeland
1aa4940de7 Update docs and type hints
Change-Id: I6c513265d7e3136c43c160b86a83a921defaa3ec
2013-06-17 16:33:52 +02:00
Siebrand Mazeland
d8434da23f Initialise possibly undefined variables
Change-Id: I095395e3b3e3514dc4e6fd5d905112da122a7418
2013-06-17 16:28:34 +02:00
Santhosh Thottingal
8b46d34004 Allow ULS language settings accessed from user preference screen.
Adds a link in 'personal/i18n' section of user preferences

Bug: 47240
Change-Id: I04d1ea7d36db45f9a0af04e11dade9ae0b524e8e
2013-05-27 16:33:40 +03:00
jenkins-bot
c57cab0403 Merge "Reduce use of globals" 2013-05-26 11:07:01 +00:00
Siebrand Mazeland
264652b1fd Reduce use of globals
Or reduce the scope where they are available.

Change-Id: Idce74bda8f64cc6be62b58b2624629408ca18d4b
2013-05-26 11:46:12 +02:00
Siebrand Mazeland
17c1ce60e5 Update formatting
Break or shrink long lines.

Change-Id: I729dffe3f0d9e1132d9232779dc60647a1dc5a97
2013-05-26 11:23:17 +02:00
Niklas Laxström
15b57bc315 Fix some incorrect hook annotations
Change-Id: I2594b50c07eafbee68df29152066c81a79035a9e
2013-05-25 08:43:27 +00:00
Amir E. Aharoni
4221b97ab2 Hide the ULS trigger for users who disabled JS
Bug: 42500
Change-Id: I297a8d3bb9d9031e21dd6842f5d27dd54f469c29
2013-05-22 16:04:20 +03:00
Santhosh Thottingal
2174740bb6 Revert "Add a MediaWiki preference for enabling ULS IME"
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
2013-05-22 07:46:05 +00:00
Amir E. Aharoni
6ae0fe3e44 Add a MediaWiki preference for enabling ULS IME
Bug: 47240
Change-Id: I957d9f409b0c29f956bcf8a49187cdf27c4f42f8
2013-05-13 15:48:00 +03:00
Amir E. Aharoni
c9a5ec7f19 Add backward compatibility for fetchLanguageNames
Bug: 46737
Change-Id: Ife7c2834c2b2c4f2619b4a5d8e0b0aa1db595984
2013-04-30 16:01:47 +03:00
Niklas Laxström
4554c79d51 Load ULS language list from a resource loader module
Having them in the page source of every page view is wasteful.

Bug: 41210
Change-Id: If15e297a4781cc49ded06fbc906529f57a22aafe
2013-04-28 11:26:40 +00:00
Niklas Laxström
60242e2c53 Use wmf geoip by default
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
2013-04-28 14:25:26 +03:00
Niklas Laxström
6b143320ad Introduced $wgULSAnonCanChangeLanguage
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
2013-04-26 12:21:23 +00:00
Amir E. Aharoni
f4f332a459 Add the sidebar ULS cog icon and $wgULSPosition variable
Change-Id: I6acf1e21316a41ab8fcb4fd65e065be68693430f
2013-04-23 14:53:58 +02:00
Santhosh Thottingal
453912fdf2 Provide a base ULS RL module and seperate UI language selection
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
2013-03-26 07:20:01 +00:00
Niklas Laxström
dfcade7f69 Update to match core changes in Idc11b547
Change-Id: I5481df33c7056cf2c661527f6ed3cf2374b6a0bf
2013-01-18 08:25:40 +00:00
Niklas Laxström
9b72969b07 (bug 44010) Try to avoid messing wrong request contexts
Also takes use of $request parameter if given, but does
not depend on Idc11b547

Change-Id: I870281f26cbc87c43d9b2a763f78c5756cb2327f
2013-01-16 09:55:48 +00:00
Amir E. Aharoni
027776c85f (bug 41763) Add a hook for support uls-preferences
Change-Id: I8fdc1a0527c9a99b6e5eb95c183955a162233b1d
2013-01-09 16:12:20 +02:00