Commit Graph

77 Commits

Author SHA1 Message Date
Niklas Laxström
4f82a8650a Make previous languages have most recent in the beginning
This is already expected by the callers. Added addPreviousLanguage
to make updating the list easier.

Change-Id: Ie4f888235ea4de4a2ce6bf5a9f24955e423e8c48
2016-05-23 14:50:02 +02:00
jenkins-bot
4c5263e3f0 Merge "Fix language undo tooltip not showing" 2016-04-12 11:28:26 +00:00
Santhosh Thottingal
7d90ecef1d Use localstorage instead of cookie for previous language autonym
Change-Id: I1025a8bbb9fad0cfd326547a09c982925a55e55d
2016-04-12 09:40:50 +02:00
Santhosh Thottingal
64eab95b94 Remove browser checks and use MediaWiki browser policy
We had a browser check to blacklist all browsers older than IE 8
IE <= 7

But that is no longer required since JS support is not there for such
browsers as per https://www.mediawiki.org/wiki/Compatibility#Modern
We can support all modern browsers listed there and we don't need
additional blacklisting now. From 1.27 onwards, there is no JS loaded
for IE 8 too. So we can just use MW browser support policy.

In this commit, the code to do brower checks removed and simplified
the initialization code. Still I am not happy with the interface module,
that need further refactoring.

Change-Id: I655826c55fb2c7c5c88f16368110142d64a96eec
2016-04-12 12:12:35 +05:30
Niklas Laxström
c0fe2d1a54 Fix language undo tooltip not showing
Test plan:
* Remove localstorage and cookies for a site
* Go the the site
* Change language and observe the undo tooltip

Change-Id: Ibecb5ea1cd537b2f019e7a9aa67ffac1a4e0923d
2016-04-12 08:22:27 +02:00
Santhosh Thottingal
d728d8c8a7 Remove logging the language selection method
Removed the code to log whether map(removed long time back), search,
common languages used for selecting the language.

This logs were introduced to measure and adapt UI effectiveness.
No longer needed now.

Change-Id: I83bdd250cb6474da4fbf22aed2011071b9f9eba4
2016-04-06 09:59:12 +05:30
Niklas Laxström
9ea6f8d6ba Add a warning about T130390
Change-Id: I872d1dc0ec8d0827c3f56aeb1474f4596e08532d
2016-03-24 11:14:17 +01:00
Siebrand Mazeland
6a2b2e0bba Update test files
- Updated versions and order of checkers.
- Some consistency updates in Gruntfile.js.
- Updates to make jscs pass.

Change-Id: I7ed93596ff383dc713bd17af2da0472be934d59d
2016-02-18 18:51:37 +00:00
Fomafix
c329f1473d Use spaces inside of brackets in JavaScript
* For consistency
* For MediaWiki coding conventions

Change-Id: I625a8ce0119b1490073f048e1b8ad4e90762d6e2
2016-02-15 13:31:45 +00:00
Fomafix
63bc85649a Ensure module 'jquery.tipsy' is loaded before using
Move the showTipsy calls into the callback.

Move the declaration of the functions hideTipsy and showTipsy before the
new call position.

Also change the order of the declaration of the functions hideTipsy and
showTipsy to avoid a forward reference in showTipsy. Spotted by JSLint.

Bug: T118507
Change-Id: I338a78cde249405459be14948b78cf59d715145a
2016-02-15 13:03:52 +00:00
Ori Livneh
02fe8719dc Only use jQuery.tipsy for undo popover
Per discussion on Gerrit about previous patch-sets in this change, only use
jQuery.tipsy for the undo popover. This means that in the common case (i.e.,
the user has not just changed languages), the ULS tooltip will be system native
tooltip.

Change-Id: I9206a79d59687930c26b7ef86d29bfba050691fe
2015-11-11 13:46:35 -08:00
Niklas Laxström
d574548d41 Refactor showULSTooltip
Makes the code easier to understand and fixes T52743

Bug: T52743
Change-Id: If508f26b5133284f3059b50d420066a8b4fefb07
2015-03-27 15:02:09 +00:00
Niklas Laxström
9bc291522b When changing language first time, language code was shown
Now it shows the language autonym as expected

Change-Id: I1f2c3bca2b5582b917d65533b08545d1332782ab
2015-03-27 14:03:52 +05:30
Niklas Laxström
231ab2dca0 Clunky workaround for putting link into escaped message
Not escaping the message trips up my unescaped message checker

Change-Id: I7e4de4c5b9008988f9d3eedd83c825b3a050849b
2015-03-26 13:26:41 +01:00
Ori Livneh
57b617f775 Don't force #p-lang to show using jQuery.fn.show
It's a performance anti-pattern; see
<https://github.com/jquery/jquery.com/issues/88#issuecomment-72400007>

Change-Id: If6e521c27975f7d64932268fde5778aa63fd08ee
2015-03-07 18:31:04 -08:00
Thiemo Mättig
91018834c3 Keep Monobook skin intact
Bug: 64741
Change-Id: I5f54537f66d72785744221c64a6705d98f1689f9
2014-05-30 22:49:04 +02:00
Santhosh Thottingal
2d9a28b694 Remove unwanted anonymous functions
Change-Id: Ieefbd58fbc829182048df1d89921b97599a3392c
2014-05-26 11:51:59 +05:30
florianschmidtwelzow
2794039142 Close the tipsy tooltip when clicked on it
We want to close tipsy when user clicks on itself, not on trigger.

Bug: 65664
Change-Id: I0de52d3917a984e675e42b83b9f5b767bd7f2e4b
2014-05-26 06:14:58 +00:00
Santhosh Thottingal
e3a480205c Update the class names per update jquery.uls lib
jquery.uls renamed settings-block class to uls-settings-block.
Similarly icon-close to uls-icon-close

Change-Id: I39005ef2425c01b8623bf9df6d75c1e27f1c5bda
2014-05-22 11:27:08 +00:00
Niklas Laxström
62939949b4 Use preventDefault instead of stopPropagation
Change-Id: I9c2da14b94348cec39e6a9a1571b22de39e437f0
2014-03-08 11:04:34 +00:00
Timo Tijhof
c6d71015ff Various clean up
Files:
* Consistently have one (1) new line at EOF
  (.gitignore, *.css, *.sh)

JSHint:
* Separate the common (general Wikimedia code conventions) from
  the local more stricter rules (nice work!).

Maintenance:
* Use simplified $IP definition where getenv is only called once.
  Based on http://git.io/ve-mw-36fc3b59-makeStaticLoader

JavaScript:
* Use the same closure in all files:
  - No need for "undefined".
  - One linebreak between license header and start of closure
    (sometimes there were 1 or 2 empty lines).
  - ext.uls.ime.js: No need for "document" (redundant in general,
    but especially as it wasn't used anywhere in this file).
  - Use "$, mw" for all ext.* modules (one of them used "mw, $").

Change-Id: Iba5dab14bbc3fbfc9f8fe96dd2d95529587a69aa
2014-02-08 00:11:50 -08:00
Kartik Mistry
abd130ed64 Set tooltip load timeout later than collapsible navs
Load tooltip at 700ms on page load to give enough time for collapsible
navigation to finish altering sidebar layout.

Bug: 51170
Change-Id: I8c7666a51ffe68007c4aadb4e72aa668d0fe6164
2014-02-06 09:11:02 +00:00
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
Niklas Laxström
7822d5d03b Page scrolls when opening language selector
Was happening mostly on Firefox when ULS was in personal
position and you were logged out and allowed to change language.

Loading grid here already prevents graphical glitch and delaying
the click seems to prevent scrolling to wrong position.

Bug: 56937
Change-Id: Ie9acaa5a46fd903221d30c94dbc26a83355cdb64
2013-11-12 12:50:31 +00:00
Amir E. Aharoni
97c79ec668 Fix incorrect module name
Follow up to Ic33ef034c794a523b5403867196c6098a58eb5b1.

Change-Id: I15c9e58b24bf4f43ac58f065ed42614df59e638f
2013-11-11 12:39:20 +02: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
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
Siebrand Mazeland
315cf739bc Update formatting
Change-Id: Iaee2ab4f36d3a0dce143c62965ab29de504b31ea
2013-10-09 15:40:39 +02:00
Amir E. Aharoni
a3bca89a42 Implement language-selection-method event
Change-Id: If2d207f8a221c8f2a560b1399ad69a3032b2064b
2013-08-20 05:16:35 +00:00
Amir E. Aharoni
0f34b4d934 Fixing "Common language" functionality
If was broken in
Icda498f676d1d3ddaefad75fd9212150f6966666

Bug: 53035
Change-Id: Ida29364073b07b985050565cacc6634c134f8d6c
2013-08-19 16:34:43 +03:00
Santhosh Thottingal
7649b47f5c Followup I59dfcfb25c, language change work with out event logging
In I59dfcfb25c, for logging events when page is navigating away, we
used callbacks with mw.hook. That is wrong approach. If event logging
is disabled those callbacks will never called: it broke language change
and all use cases which navigates away from current page.

Event logging should not interfere with any ULS functionality. If ULS
functionality depends on callbacks from event logging, it is wrong.

In this patch, we give a small time window to make sure event logging is
fired, but we won't wait for its success or failure.

If eventlogging is disabled, this time window does not exist.

Change-Id: I0b7d9d8b9d1d01b99422010596ebfa80b2589d04
2013-08-19 10:13:56 +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
jenkins-bot
d0b9d2717f Merge "Log settings-open event" 2013-08-14 09:36:57 +00:00
Siebrand Mazeland
e75b174b10 Make return values consistent
Tipsy does not expect a return value.

Change-Id: I9172dfe18ee1dc6d7773ce861a8a8b52638bc7b6
2013-08-05 17:20:10 +00:00
Niklas Laxström
df18f0a5ff Log settings-open event
Change-Id: I55fb9e4b8b6b210003f6bbad07486e1c2a8cba4f
2013-08-05 15:19:57 +08:00
Niklas Laxström
0af4375e7c Fix spelling mistake in variable name
Change-Id: I791555dc4a04beb6109e212314f8f4747fc8b6d9
2013-08-05 04:04:19 +00:00
Niklas Laxström
e8479a070d Log ui-lang-revert
Change-Id: Ic48dbd7a9d4d43812f437e3c9f17d1ee208166e8
2013-08-02 13:14:27 +00: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
Santhosh Thottingal
81586572ab Lazy initialization of language settings and ULS from interface triggers
1. For interlanguage position, initialize language settings on first
click on cog
2. For personal toolbar position, initialie ULS on first click of
ULS trigger

Change-Id: Icda498f676d1d3ddaefad75fd9212150f6966666
2013-07-25 12:10:46 +05:30
Santhosh Thottingal
472432517a Lazy initilization of language settings from ULS
For personal toolbar position, initialize langauge settings only
after user clicks on the settings links

Bug: 48211

Change-Id: Ib3e2372e982de890db614a81c06fbbe170ce0d01
2013-07-25 12:10:38 +05:30
Siebrand Mazeland
160ee87f15 Pass integer instead of string
Change-Id: I8b831108d6f40a2e764fbbd46f4241530d7f6153
2013-07-08 14:32:25 +02:00
jenkins-bot
2fdf4bffb3 Merge "Accessibility attributes for ULS trigger" 2013-07-08 07:41:59 +00:00
Santhosh Thottingal
d217a2fe73 Make anything with class 'uls-settings-trigger' work like ULS trigger
Usecase:

Reading problems? click [here]. That [here] can be a ULS trigger to open
language settings.

Change-Id: I1561f8b782037bfdb418f33097fc8b4c519ef393
2013-07-08 13:05:44 +05:30
Santhosh Thottingal
1445d02e6e Accessibility attributes for ULS trigger
Bug: 50575
Change-Id: I07a6fa740e6dcdcb0fd4ae8832ba0ad6fd875170
2013-07-08 07:30:04 +00:00
jenkins-bot
2ea66a84a1 Merge "Use /** for method documentation blocks" 2013-07-06 12:22:35 +00:00
Amir E. Aharoni
6fdc9241e6 Fix indentation and tweak comments a bit
Bug: 50859
Change-Id: Ic827e200674fb72b8b88e362bab30662cc13e304
2013-07-06 14:00:35 +03:00
Niklas Laxström
c51384e4e1 Use /** for method documentation blocks
Change-Id: I6c7a8b7c2e2e861120caa1f1b5ff9b0dc7537737
2013-07-06 10:33:12 +00:00
Santhosh Thottingal
8ddff0b2fc Use single entry point mw.uls.init for all ULS ui initialization
Change-Id: I485ea27deebb530eb89e4b0935eda01a5276f884
2013-07-04 17:05:10 +00:00