Commit Graph

93 Commits

Author SHA1 Message Date
Kartik Mistry
1de86b4ba7 Fixed year in version
Change-Id: I06ad3251b91b00dc93a1fdf2a1d97ff7b9cc18f6
2014-02-10 18:54:02 +05:30
Kartik Mistry
b3a30c3e28 Update version and copyright year
Change-Id: I8ee6d6f53d24eceabf36f17c7e85e34f6034de0d
2014-02-10 18:50:03 +05:30
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
Amir E. Aharoni
5796a742ca Clarify the comment according to the variable name
Change-Id: Ie196339c26737f86d31a2a258123049901dcf7c6
2014-01-22 22:27:10 +02: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
Santhosh Thottingal
1113786330 Detect tofu before applying any default fonts
To detect whether the client can render a given string,
use a tofu detection algorithm.

If the user has an explicit font preference, do not override it.

If the user has no preference and there is a default font for a
language, see if that language can be rendered at the user's browser
using tofu detection.

If tofu is detected, apply the font.

If the element has 'autonym' class, apply Autonym font only when
that language has tofu.

Change-Id: Ib9ee9497e6bcfa7eb86f7d264e0980d8880d6b70
2014-01-20 22:20:58 +05:30
Niklas Laxström
f3f61fdbc9 Prepare for composer
Bug: 49121
Change-Id: I7b391cc856ca4526951db409173deb0f1b955c4b
2014-01-05 12:40:00 +00:00
Kartik Mistry
34eee436bb Update version date.
Change-Id: I9d189c8e0b37fee21230ea94ca3f9443e4d6958f
2013-12-31 14:23:26 +05:30
Santhosh Thottingal
e231ba72ae Update the $wgULSNoWebfontsSelectors defaults
$wgULSNoWebfontsSelectors had default value as '#p-lang li > a'
-the interlanguage links. It does not make sense after the class
'autonym' was added to such links. That 'autonym' css class has
fontfamily definition as Autonym, sans-serif

ie, Autonym font is applied to the interlanguage links.

So, now it make sense to have default value as .autonym to
exclude from parsing.

This also fixes the problems like Bug 58374 where in random cases
the default font for the language get applied even if it has 'autonym' class.

This issue was because the js get executed before the css for .autonym class is
ready and applied. The jquery.webfonts parser will miss to detect the explicit
fontfamily 'Autonym, sans-serif' and the default font is applied.

Bug: 58374
Change-Id: I7478a58583d3b029ae8e2d63e118917499c29c30
2013-12-12 16:17:30 +05:30
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
Kartik Mistry
b511fca15e Update version date.
Change-Id: I8533c30bec825a2ef6ebde4c33bb9d5fb09ffd59
2013-11-27 10:40:58 +05:30
Santhosh Thottingal
328eb017c8 Json message loader clean up
* Rename JsonMessageLoader to ULSJsonMessageLoader
* Correct the return type of mw.uls.loadLocalization

Follow up: Ic39dec1c484982fb07edd167e83794c0b5f470ee

Change-Id: I13c64a5e89ac75be8a95d951658018a78534f466
2013-11-19 10:55:52 +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
76e82e4a9c ResourceLoader Module for serving json based localization messages
ApiULSLocalization is still present since we have to provide live
language preview feature.

Moved the loading of json file to includes/JsonMessageLoader.php

Also moved all RL modules to includes folder.

Bug: 56509
Change-Id: Ic39dec1c484982fb07edd167e83794c0b5f470ee
2013-11-04 14:59:14 +00:00
Kartik Mistry
3457c697f0 Update version date and copyright year.
Change-Id: I86d529d388bad7124f9974cf565987e715f9bab6
2013-10-28 19:33:37 +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
Ori Livneh
e7539a341e Prefer __DIR__ to $dir
__DIR__ is the more common idiom these days, and there is absolutely no
advantage (in fact, there's a slight performance penalty) to storing it in a
variable. Use alternate syntax for declaring autoload classes to avoid
exceeding line length limits or having to break lines in unsightly ways.

Change-Id: I20211539ccc17937b141331c1875f219a92b1483
2013-10-14 01:22:56 -07:00
jenkins-bot
bb535a2eed Merge "Update formatting" 2013-10-10 20:30:02 +00:00
Siebrand Mazeland
315cf739bc Update formatting
Change-Id: Iaee2ab4f36d3a0dce143c62965ab29de504b31ea
2013-10-09 15:40:39 +02:00
Santhosh Thottingal
efaa3dc317 Disable jquery.ime for VE till IME support is improved
Bug: 55492
Change-Id: I30cffd94413b50bb57a403a9d06dbc0498a02d0a
2013-10-09 19:05:20 +05:30
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
Amir E. Aharoni
a3bca89a42 Implement language-selection-method event
Change-Id: If2d207f8a221c8f2a560b1399ad69a3032b2064b
2013-08-20 05:16:35 +00: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
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
Siebrand Mazeland
7ad76c6b64 Coding style updates
Fix issues pointed out by PHP Code Sniffer.

Change-Id: I31279cda12101bb0ad66f104c9cd0e11019d46f1
2013-06-17 16:48:41 +02:00
Siebrand Mazeland
48b8f11ca6 Update version
Change-Id: Ica44e38470c5d4356130ec9e398274b624b4045c
2013-06-17 16:45:14 +02:00
Siebrand Mazeland
1aa4940de7 Update docs and type hints
Change-Id: I6c513265d7e3136c43c160b86a83a921defaa3ec
2013-06-17 16:33:52 +02:00
Santhosh Thottingal
7b92820129 Update version
Change-Id: I5c6fdd33ff8ef1aee8f090b5bf80d124b26f68df
2013-06-11 10:31:22 +05:30
Santhosh Thottingal
ec0ea0407d Introduce Api for loading jquery.i18n json files
To avoid CORS issue with old browsers

Bug: 45958
Change-Id: I37638e06f21ab573c9ce37a4e9fb20bc763ac98f
2013-06-04 10:21:32 +00: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
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
5bbdd16aa7 Version update
Change-Id: I52b4c9c7d5f8172dffe51c9fdfd1213f58d73b14
2013-04-01 09:44:36 +05:30
Niklas Laxström
7158b0adeb Add separate Resources.php
Change-Id: Ie02fbdd1bb8a1c83f66eacff8de0ca0bd6c67ab4
2013-03-27 15:09:59 +05:30
Niklas Laxström
00189afa66 Add ext.uls.geoclient back to deps
Change-Id: I4e1aa22edd89ff666b29c7b26c1928885e8bc896
2013-03-26 10:18:44 +00: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
Santhosh Thottingal
d4cea039b4 Update jquery.uls and make it more modular
jquery.uls RL module split to
* jquery.uls (language selector UI/UX)
* jquery.uls.grid (Foundation grid framework)
* jquery.uls.data (language database)
* jquery.uls.compact (compact mode ULS)

This contains updates from jquery.uls upstream

Change-Id: Iaddb1228c076f698498d3b0554061624b6e433c6
2013-03-26 07:17:58 +00:00
Siebrand Mazeland
e3a4d27a49 Update code formatting
Change-Id: I6a004a2d1ee803325cb6cfa3ee797a89db058635
2013-01-28 11:04:45 +01:00
Santhosh Thottingal
bfb1f319eb Version update
Change-Id: I7afb84041b2700ad5fe1dd49c806ff8e1cb9ebbb
2013-01-16 17:15:12 +05:30
Amir E. Aharoni
027776c85f (bug 41763) Add a hook for support uls-preferences
Change-Id: I8fdc1a0527c9a99b6e5eb95c183955a162233b1d
2013-01-09 16:12:20 +02:00
jeblad
236a940fac (Bug 42453) Fix dependency of uls to include geoclient
Change-Id: Idc3c07b314ea47e1e3764bb87572e6d1a7ac33cc
2012-11-26 18:29:34 +01:00
Tim Starling
86e6bc9654 Allow ULS toolbar to be disabled for anons only
Per Daniel's request on bug 42157

Change-Id: I5df826f0466bf20729c7969cb7b549e41016c194
2012-11-16 10:43:26 +11:00
Tim Starling
6abb1b3d4a Allow the main functionality of ULS to be disabled
Allow the cache-breaking toolbar and cookie-based user language
selection features to be disabled, while still allowing Wikibase to have
its language autocompletion drop-downs on special pages.

Change-Id: Iba18f666fdcf5b87b7068ab6b1537c868c8fe861
2012-11-15 16:33:13 +11:00
Niklas Laxström
3c9e7249a8 Geoclient fixes for https and WMF
* Don't call freegeoip on https, it wont work
* Use Geo instead of GEO like WMF

Change-Id: I9ebdd9f3518e15e70122a9c8c8d64240d5e44c5b
2012-11-10 07:15:07 +00:00
Santhosh Thottingal
fc29a7e587 Option for disabling the IME system
* It can be a user preference using the ULS Input method settings
* It can be a mediaWiki configuration $wgULSIMEEnabled

Change-Id: Ic5fb4932d62ab18db5d3b10ca81c0f6bfe9fd29e
2012-10-31 12:57:14 +05:30
Santhosh Thottingal
f13e474e43 Input method integration with ULS
The file ext.uls.settingspanel.js is a draft for common
code in the different settings panels.

Change-Id: I057274f16b27b2c18d43d41c1d43f485a18ef0bf
2012-10-26 11:14:02 +05:30
Santhosh Thottingal
c19c0b4db7 Fix Bug 40714 - ULS geoclient needs proper interface
Change-Id: Id8d7356ec75e8652c75927736a60b916dd069c28
2012-10-13 20:02:32 +05:30