Commit Graph

62 Commits

Author SHA1 Message Date
Gilles Dubuc
d04ade3574 Explicitly define module position
Style modules currently added through addModuleStyles default
to being in the head ("top" position). This is an unhealthy default,
since only critical styles that are needed at pageload should be
in the head. In order to be able to switch the default to "bottom",
existing module positions have to be defined explicitly.

Bug: T97410
Change-Id: I209f93a49ddd0aa143348c0238849a121856dce1
2015-05-05 17:34:54 +02:00
Santhosh Thottingal
91eff55c8c Revert "Update inputs to use mw-ui styles"
This reverts commit 30d26a4fd2.

Some issues in this patch were identified, see T52599.

Reverting so that MLEB can be released and issues fixed and
tested properly after the release.

Change-Id: I35c1eb2db5ead8ca75dc2724997d789c83c69b6d
2015-03-30 07:20:23 +00:00
Evan McIntire
30d26a4fd2 Update inputs to use mw-ui styles
Replaces many of the styles with the new standard ones in mw-ui, which is
present in v1.22 of Mediawiki, the current lowest supported version of
ULS.

Might require a follow-up to reduce the amount of redundant CSS present

Bug: T52599
Change-Id: Id186ece6513f154e0388bc4170c21bdabb59038a
2015-03-19 08:51:31 +00:00
jenkins-bot
bad1a5a080 Merge "Add missing messages for compact links" 2014-08-26 04:46:47 +00:00
Niharika Kohli
d976602278 Add missing messages for compact links
This is similar to the messages array that exists for ext.uls.interface and ext.uls.ime.

Change-Id: I73a5c917304d8aa99e7f5f8c0a4ceb878cbde805
2014-08-26 04:42:23 +00:00
Niklas Laxström
fe4e101851 Stop using deprecated jquery.json module
Not loading the "json" module either, because of backwards compatibility
and because we are likely already blacklisting browsers which don't
support json natively (mainly IE7 and older and IE8 not in standards mode)

Change-Id: I80b9eb9a7c224b5c843d42c36aca4c5e9f20c207
2014-07-12 19:20:22 +02:00
Amir E. Aharoni
6de6bdf8f2 Remove tofu detection logging
Change-Id: I2b808bae2ee19062c16d8aaff2bdf0b2986e8ad0
2014-06-26 16:02:49 +03:00
Juliusz Gonera
9f61d79a70 Add mobile target for modules that VE depends on
VE has its own copy of ULS, but uses it only if ULS is not loaded. If
ULS is loaded, original ULS modules are used and mobile target specified
in VE is not sufficient.

See also I6e1024b0f636b3a18d1073f5c38b9feea340b583

Bug: 66594
Change-Id: I8e521f537fcd5089e4a9e8e94bedcc6f49ceabe1
2014-06-13 13:41:06 -07:00
Amir E. Aharoni
7c5b750700 Localize the number in the "more languages" message
Change-Id: I11c88423b048f31c8a6fc9be1af63e32835717b4
2014-04-06 20:17:08 +05:30
Niklas Laxström
5d74d2407e Fix JS error seen on TwnMainPage if webfonts were enabled
Fixed by adding dependency to needed module

Change-Id: Ic1295c00d7f02580f808944cf181827f71e2791e
2014-03-21 09:54:11 +00:00
Amir E. Aharoni
b1e2812fd6 Cosmetic code fixes
* Clarified comment

Change-Id: Ie10152c979ccf34efea7490176a2752c01513354
2014-03-17 09:58:53 +00:00
Amir E. Aharoni
7e5d727583 Make jqueryMsg a dependency of ext.uls.interface
The message ext-uls-undo-language-tooltip-text uses GRAMMAR,
so it needs jqueryMsg.

Change-Id: I40225fa72ac0049163cc1ef29e8cbc086831e3d1
2014-03-05 16:14:48 +00: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
Amir E. Aharoni
261542d738 Log tofu detection event
This only works if webfonts enabled (the checkbox is checked).

Change-Id: Ibbedc6a34dacb983f156d8a33afa5ab625e32f5f
2014-02-26 00:19:08 +02:00
jenkins-bot
ce27557f02 Merge "Update jquery.i18n from upstream" 2014-02-14 04:24:34 +00:00
Santhosh Thottingal
e21c221e2b Use localStorage, fallback to cookie, remove jquery.jStorage RL dependency
As per comments in I22613d9f6846db5456beb532cec47396fccda8ae

Change-Id: I09b2bd52972d9aef20dd469c556631e0299bc407
2014-02-10 12:11:13 +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
Niklas Laxström
7c28df5125 Add ext.uls.messages as dependency for ext.uls.mediawiki
Turns out the messages for language selector were not loading
in Special:MainPage. This fixes that as well as cleaning up the
dependencies.

Change-Id: Ice8dcf1b2e878a0fe3cd0e002a9b1cff2f1901dd
2014-01-25 00:53:47 +00:00
Niklas Laxström
15b3c31029 Avoid loading of jquery.i18n and messages until trigger clicked
Use RL for trigger tooltip messages to avoid using jquery.i18n just
to display the triggers. Reordered dependencies so that messages
are loaded for the setting panels and ime menu.

Change-Id: Ic9518f7b63699542deb02a413e03c28344c99fa4
2014-01-23 23:35:27 +00:00
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
7071db6ede Make ext.uls.mediawiki depend upon ext.uls.init
With the user preference now enabled, we can no longer
assume that ext.uls.init will be loaded on every view.

This also fixes integration with the Translate extension.

Bug: 46306
Change-Id: I05c76e478ddcfb29000471dc79ca35ce77ad59b8
2014-01-21 17:45:01 +00:00
Kartik Mistry
9c40252a72 Update jquery.i18n from upstream
Upstream: https://github.com/wikimedia/jquery.i18n
Changes:
 * Support fallback loading when folder is passed as source to load
 * Do not overwrite existing messages for a locale while adding messages
   second time
 * Fix the country code case issue
 * Renamed jquery.i18n.messages.js to jquery.i18n.messagestore
 * ULS: Updated Resources.php for renaming of jquery.i18n.messages file

Change-Id: I60a6e3224cb7b8ea813a8ccd7e389071b3d1244c
2014-01-21 10:20:57 +05:30
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
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
Santhosh Thottingal
cd6766da28 Add explicit mediawiki.util dependency to RL modules
Change-Id: I3f08b9cda83bd6c25c14c976d6c81e1e2d07ff5e
2013-11-13 12:57:39 +00: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
Santhosh Thottingal
f5ce066c80 Lazyload jquery.uls library
In the "interlanguage" position ULS is shown after 2 clicks,
so don't load it initially.

In the "personal" position ULS is shown immediately after
the language icon click, so load it, but conditionally.

The new RL module ext.uls.mediawiki is added for setting
jquery.uls defaults in a way that will lazy-load the language names.

Change-Id: Ic33ef034c794a523b5403867196c6098a58eb5b1
2013-11-11 14:13:02 +05:30
Santhosh Thottingal
dfc40c8f59 Refactor the css for interlanguage links and autonym class
Move it to a seperate css file ext.uls.webfonts.css so that the RL
modules are more granular and clear.

Also get the @font-face css for Autonym font get ready on page load
so that the font applied automatically to any future elements on page.

Change-Id: Icb76df5baedaba8ab613d665a1be923779a6b9e7
2013-11-06 20:51:26 +05:30
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
Niklas Laxström
0423290ec3 Delay loading of jquery.uls.grid until needed
Change-Id: I790333ac03a4103bed757867acfd1b44a7e00525
2013-11-01 11:39:28 +00:00
Niklas Laxström
3d3152df8e Move button styles to separate module
Removes 8 KiB from *uncompressed* initial payload

Also added missing dependency to jquery.cookie to ext.uls.init

Change-Id: If0e30d3822fa7db317d53a0a58051295da0ec0e6
2013-11-01 09:52:30 +00:00
Santhosh Thottingal
8f5be106f5 Update jquery.ime library
upstream: http://github.com/wikimedia/jquery.ime

changes:
* Support for contenteditable, like the VisualEditor surfaces. This
  support is very minimal now. Because of VE bugs on IME support, many
  things are broken. But one-one keyboard mappings should work with less
  issues. The UI of jquery.ime is not integrated with VE toolbar
* More input methods
	- IPA-X-SAMPA by Amir
	- Armenian keymaps by  Aleksey Chalabyan
	- Kurdish keymaps by Ghybu
	- Кыргыз keymap by Amir
	- Central Kurdish keyboards by Çalak
* A lot of input method bug fixes multiple contributors
* Minor UX fixes

Introduces Rangy library.
A module named rangy is defined in VisualEditor extension with more features of rangy.
Here we need only the core library. This module is loaded dynamically from
client when rangy is undefined. If VE is present rangy will be defined, the module
defined in VE will be used. ie, This get loaded only when VE is not present and
user trying to type in a contenteditable.

Bug: 49569
Bug: 50849
Bug: 50220

Change-Id: Iadad5a4e5972fbd1359847526d28e9dbbe00a7c4
2013-08-19 04:40:08 +00: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
Santhosh Thottingal
82fbfe62e7 Load jquery.ime only when user focus on editable fields
To reduce javascript size for page load.

Change-Id: Ibf2ccd5b5501720837051d6e268b122e8a9f8590
2013-07-30 14:18:55 +03:00
Amir E. Aharoni
56dd512725 Revert "Load jquery.ime only when user focus on editable fields"
This reverts commit 63d547915f.

Bug: 52115
Change-Id: I1d6b65622e8a103a8a892beacf268e77b9e1b2d0
2013-07-27 00:56:18 +03:00
Santhosh Thottingal
63d547915f Load jquery.ime only when user focus on editable fields
To reduce javascript size for page load.

Change-Id: I71928ac5149cbcf2cc75073fdf628403e6abe456
2013-07-26 16:08:35 +03:00
Santhosh Thottingal
d92c75518b Delay loading of language settings javascript
Load them when language settings is opened using cog or ULS icon click

Change-Id: I472497c549bff0fd578156fa0113dae2d6a7a7fb
2013-07-26 15:55:07 +03:00
jenkins-bot
c9e354d638 Merge "Remove some unwanted top RL module definitions" 2013-07-23 11:41:01 +00:00
Santhosh Thottingal
2159822145 Update jquery.i18n from upstream, use its default message store
In Iddef0805ab a custom message store was introduced for ULS, but
there were updates in jquery.i18n that allows us to use default
message store again.

(see https://github.com/wikimedia/jquery.i18n/pull/40)

Change-Id: I86cb7a44efa83e5811824cd1104c6be11b1e2925
2013-07-23 15:32:45 +05:30
Santhosh Thottingal
321c5ccc07 Remove some unwanted top RL module definitions
Change-Id: I7ae638fa606a68b93519dea726725d0dc714811e
2013-07-23 14:09:09 +05:30
Santhosh Thottingal
6ac12b6584 Better blacklisting of browsers using $.client
Change-Id: Ibc4d15008671700374fdc1e33d2e85f9899f9b35
2013-07-21 19:36:12 +03:00
Santhosh Thottingal
28154206bf Remove jquery.i18n code that the ULS extension overrides
Instead of using the whole jquery.i18n code, use only required parts
that are not customized in MW ULS. For this define a new RL module
ext.uls.i18n.

Also refactor MW message store for jquery.i18n.

Change-Id: Idda9fe505428ade409d937314d7216ebb4232c36
2013-07-15 13:28:12 +00:00
Niklas Laxström
da1baaf663 Help links for input settings
Bug: 42373
Change-Id: I30c8d6cbe916ac026ad70974755942c5bbea7162
2013-07-15 11:08:17 +00:00
Santhosh Thottingal
3b3e2da332 Disable Webfonts too for blacklisted browsers
Change-Id: I9feb342b091e00ef0279333018b86045932d68de
2013-06-17 09:33:03 +00:00