- Updated versions and order of checkers.
- Some consistency updates in Gruntfile.js.
- Updates to make jscs pass.
Change-Id: I7ed93596ff383dc713bd17af2da0472be934d59d
Requests using GET should only retrieve data and should have no other effect.
(https://en.wikipedia.org/wiki/HTTP_GET_request)
* Use API with POST to change the user interface language in user settings.
* When allowed by wgULSAnonCanChangeLanguage set cookie for anonymous user
or when API fails.
This change uses mediawiki.cookie which requires MediaWiki 1.24+.
Bug: T46649
Change-Id: Iaf6fafbf200933dfc760be69d2adf5e5efcf8245
Automatically migrates data from uls-previous-language cookie to localStorage.
See associated bug for rationale.
Bug: T110353
Change-Id: Ib98499040b9edf4a1f1d9e3afd7661fc2d1f7fea
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
No change in functionality. Refactored the code a lot and made it as
a jquery plugin, similar to the other components of ULS
Change-Id: I69199ba37b13ec7fd4a9b7b8eba5b3aa28f0edb5
These methods aren't designed to return "undefined" or "null".
What they return is not checked. It's assumed to always be an
object (2 of them) or an array (1 of them). This simple patch
does make sure the following code does not fail with TypeErrors.
Bug: 55701
Change-Id: I19f51bbff2209044485b9d7cef4c7654cb5f6425
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
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
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
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
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
Our logEvent wrapper now returns jQuery.Promise too.
Added timeout out parameter to our logEvent wrapper. Unlike
GettingStarted, I didn't create separate logUnlessTimeout
function.
Chrome apparently emulates enter on links as a click, so
this catches enters, left and middle clicks, but not if
the link is opened via right click menu. Might not catch
enter in all browsers.
Change-Id: I4b0eb56e7c7d6e56f8fd99d536f9b60b94a2e09e
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
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
This patch provides a workaround for bug 50746. It modifies mw.uls.eventLog so
that it does not directly attempt to log events but instead adds them to a
$.Callbacks('memory once') queue. If EventLogging is not enabled, the Callbacks
object never fires. If EventLogging is enabled, it is requested via
mw.loader.using, but only after $(document).ready. This prevents ResourceLoader
from attempting to inject it via document.write. The mw.loader.using callback
sets the schema defaults and calls .fire on the Callbacks object, causing the
EventLogging event queue to be processed. Tested on Opera 12 and Chrome 30 on
OS X.
Bug: 50746
Change-Id: I89cf06990ee85e70698149b4812d7900218e4fb4
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
For position=sidebar, the dummy "in other languages" section is
visible in the same manner as it is to browsers without JavaScript.
Bug: 49028
Change-Id: I931a2e904b37c754f63bfe5feb2d98bfe6c2747b
IE8 and IE9 does not support ajax with CORS. So make sure they
load json files from same domain.
See http://bugs.jquery.com/ticket/8283
Bug: 45958
Change-Id: I8442a5efbd4ca7db0f0a407ff94772ea8e213b29
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