Follows-up c578db02 and ea671b1f, which I thought removed
all code relating to the old async EventLogging method.
I didn't notice this UI code at the time, because I only took a
single pass over the code to find dead code. Now that that code
is gone, it is clear that the UI code is also redundant.
The mw.track() and logEvent() methods don't track the Beacon API's
async fetches, which also isn't needed, since the loss of browser
context upon navigation doesn't abort background beacons.
The loading of the EL library itself is already ensured via a
dependency so we already know there won't be an async fetch for
that.
What that leaves is some portion of older browsers in which a
EventLogging falls back to 'new Image'. This is basically just
IE 11 per <https://caniuse.com/beacon>, and for those some portion
of events will have been lost since EventLogging removed support
two+ years ago for tracking those fallback fetches via a Promise
(because of the perf issues caused by what the removed code here
was able to do).
Change-Id: Idf4378f983b6ba0e755ebadb97aa6d87cf95f7a5
This change prevents a failure when clicking on the language revert
button.
This change is a follow-up to c578db020d.
Change-Id: Ic5da1b1dcdcc07de417a6eef0189940cb5a2392f
Given the code no longer uses any EventLogging methods directly,
but rather mw.track(), this means it also doesn't need to declare
any dependencies, including for older MediaWiki versions this
will work as-is.
Change-Id: I8cdcef54321d0887c509fc3683acf132c113e628
I guess the expectation was that for browsers that don't support
Navigator.sendBeacon, the promise would wait for the 'new Image'
fallback to complete.
However, EventLogging never did that. In browsers where the Beacon API
is not supported, 'new Image' starts asynchronously and either
way the returned promise is immediately resolved.
The only purpose of the returned promise was to detect errors
in the format of the event (e.g. missing properties), which this
code is not concerned with (given that it uses "always",
not "done"). And besides, for that you'd probably want to use
the EventLogging debug mode [1] instead.
This is the last step before ULS can switch to a soft EL dependency
by using mw.track instead, which I'll do in the next commit.
Change-Id: If016b73dcd7320ddf1478c1678d2cc6371fe0fa1
Follows-up e58be7c411, 1ad0c9c819.
* The mw.uls.eventlogger property does not appear to be
used anywhere indexed by Codesearch. It was also undocumented.
Removed without deprecation. Kept exposed for debugging purpopses
via module.exports, which could be retreived in tests via require(),
or via mw.loader.require() from the browser console.
* Remove redundant $.Deferred wrapper.
Change-Id: Id081038e5d4902c7e38967353c6f551c12517311
Follows-up 2ac8a0a4b6, which removed this method. In checking
Codesearch, I somehow missed this one call among the false positive
results for Datepicker and TMH-related calls to a different method
also called "setDefaults".
Bug: T206588
Bug: T187207
Change-Id: I4f94ce6f8f1b85c192b69c5b50c3f090f7b4bfd2
'mw' are '$' are globals, always have been, and aren't going
anywhere. They're every bit as real as their longer versions.
If anything, the longer ones are less "real" or 'stable" because
they're not used internally by RL and easier to accidentally
replace or override. For anecdotes and history, see 91f950d6b0.
Change-Id: I526fb8c961d9477992d88f2780a0ff4cbdc51923
It is created, unconditionally fired only once (right after creation),
and then used only with add(), which becomes a synchronous
self-call.
I've searched in Wikimedia Git and Codesearch, and found no uses
of `logEventQueue` or `mw.uls.eventlogger` outside this file.
Change-Id: I3832bcb409fc919c2078e583d50e20413dede163
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
- Updated versions and order of checkers.
- Some consistency updates in Gruntfile.js.
- Updates to make jscs pass.
Change-Id: I7ed93596ff383dc713bd17af2da0472be934d59d
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
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
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