This hook is now executed through the job queue, so $wgUser will not
accurately be set.
This depends upon I083736a174b6 in MediaWiki core to actually work.
Bug: T116485
Change-Id: I176fec492d136b097ada79a308e6822832705472
When UserMerge is used to merge an account into anonymous user,
we shouldn't attempt to operate on MWEchoNotifUser for $newUser,
as it would cause an exception.
Change-Id: I726e6115d2c30e1579dae55e57cc800aa61d9d7c
When an user sent an email to another user with [[Special:Emailuser]] or
action=emailuser, give an echo for the target user to be lookup in his
mailbox.
This option is off by default. It is only useful as web notification,
because an email notification would go to the same address.
Bug: T56130
Change-Id: Ie279457daf51e1c34c998197ce9e76c78ee705e4
And rename "nojs" to "styles". It was supposed to mean base styles that
are used by no-JavaScript and JavaScript mode, but it confused people.
Hopefully "styles" is clearer.
Change-Id: Ie8d668fb0d95a9162392c5fa7c3200bcacef1025
The logger code for clicktracking is only needed after something has
been clicked, so we don't need it in init.
* Move EventLogging initialization into Logger.js
* Add ext.eventLogging dependency server-side if needed
Change-Id: I46ff3c62b05c24dd2bb18a1574df17f9d2823125
If users are likely to open the flyout whenever they have unseen
notifications, we should preload some more resources to make those
intial openings faster instead of lazy-loading everything.
On the server-side, we will increment the MediaWiki.echo.unseen metric
whenever we serve a page when the user has unseen notifications. Then on
the client we will increment MediaWiki.echo.unseen.click if they opened
the flyout while having unseen notifications.
By comparing the two graphs, we can determine how likely users are to
click on the flyout whenever they have unread notifications, and how
useful preloading extra resources will be.
Change-Id: I14e9aa7f03d6ef275042b8a2c4cb0e5b5a64c0d7
There is no need to load the entire of Echo's ui module (especially
since that includes ooui widgets and their styles) on every page load.
There's only need to load the entire module if and when a user clicks
the Echo notification badge.
Also, make the echo.dm model accept an external fetchNotifications
promise so we can send the API request alongside loading the echo UI
and "feed" it into the DM for processing.
CSS adjusted to make the "jump" between the nojs and the js buttons
seem less jumpy.
Bug: T112401
Change-Id: I516e655ffd198511d694489a0702c5c713a5fd68
We cannot count on the user_newtalk flag being cleared since that
happens in a deferred update.
Bug: T107655
Change-Id: Ie954ed7c5a4e784c3feb86288943a56cfb9c23c0
MobileFrontend has its own implementation of the notifications
flyout, so don't load any of Echo's code. We do still need
ext.echo.nojs on Special:Notifications though.
Bug: T112571
Change-Id: If4d84810070ccd48a8007a3ff80733a7db30fdb3
We don't really need it to render the no-JS version
of the notification badges (the only rule we were missing
was background-repeat: no-repeat;) and it significantly
increased the amount of render-blocking CSS.
This means we do need to call setupOOUI() ourselves
in order for our get_class( OOUI\Theme::singleton() ) hack
to keep working.
Bug: T112401
Change-Id: I148f8ac19dfe62cc84abe03e1a2ff00683d515c1
Otherwise it causes flashes due to colors changing in skins that don't
use it, like MonoBook
Bug: T111821
Change-Id: I03acdbcbfa3912b439a18187d52944931e94506a
Since the nojs "base" version uses the automatic title creation
of the personal tools, the message keys were adjusted accordingly,
and the old unified message was removed.
Bug: T108190
Change-Id: I1f242f530aa68562aa4dc885156586c22c4df618
So we're not abusing user preferences for the last seen time.
EchoSeenTime is a small wrapper around ObjectCache that handles the
fallback to user preferences during the transition.
All JavaScript code now needs to use mw.config.get('wgEchoSeenTime').
Bug: T95839
Change-Id: Ia45ba5e30eb4564250539d04d5886d2598ebd49a
Split the notifications into 'alert' and 'message' badget with two
different flyouts. Also clean up styling and module behavior.
** Depends on ooui change Id4bbe14ba0bf6c for footers in popups.
** Depends on ooui change Ie93e4d6ed5637c for fixing a bug in
inverted icons.
** MobileFrontend must also be updated to support the new modules
in this patch I168f485d6e54cb4067
In this change:
* Split notifcations into alert and messages and display those in
two different badges.
* Create two separate flyout/popups for each category with their
notifications.
* Create a view-model to control notification state and emit events
for both the popup and the badge to intercept and react to.
* Clean up module load and distribution:
* Create an ext.echo.ui module for javascript-ui support and ooui
widgets.
* Create an ext.echo.nojs module that unifies all base classes that
are needed for both nojs and js support, that the js version
builds upon.
* Create a separate ext.echo.logger module as a singleton that can
be called to perform all logging.
* Clean up style uses
* Move the special page LESS file into nojs module so all styles
load properly even in nojs mode.
* Transfer some of the styling from JS to LESS for consistency.
* Make the 'read more' button load already with the styles it
needs to look like a button, since its behavior is similar in
nojs and js vesions, but before its classes were applied only
by the js, making it inconsistent and also making its appearance
'jump' from a link to a button.
* Delete and clean up all old and unused files.
* Moved 'Help.png' icon from modules/overlay to modules/icons for
later use.
Bug: T108190
Change-Id: I55f440ed9f64c46817f620328a6bb522d44c9ca9
This preference has been disabled since bug 47562, and doesn't make
sense to keep around given that the flyout is the main interaction most
users have with Echo.
Change-Id: I7e8ddf96dbde9a95ac01a0cc83bad396151d01bd
* Use standard "on{hook}" naming pattern
* Skip hook if using an external database server ($wgEchoCluster)
* Don't return true, it's not necessary anymore
Change-Id: I488e4636f9499c468b870966614b0762c2ade8ea
The Echo cohort study was finished in July 2013 and hasn't been used
since. The code was also checking in reverse order, for example it
checked registration before checking whether the survey was still
active.
EchoHooks::isEchoDisabled() was removed, and all callers were checked to
make sure they were also checking for anonymity.
EchoNotificationController::doNotification() will throw an exception if
the user is anonymous, since it shouldn't be possible to get an
anonymous user into that code path.
Bug: T101047
Change-Id: Iada2f6d2066c0f6bba5cc58aeb03d687632ac5a4
Let EventLogging register the schema modules by using the
EventLoggingRegisterSchemas hook.
Don't modify $wgResourceModules at run time because that's a hack.
Instead register the module in the ResourceLoaderRegisterModules hook
itself.
Change-Id: I9457546c1ec38cf6896fe6f9f445fe1191afe72a
Since we didn't use to save seen time, it is unreliable at first.
I decided to just show them as read then, since we couldn't know
if they had or hadn't been read.
However, it would make more sense to keep them unread until we first
save the time a notifiation is seen: it is in line with the current
behavior (where the badge just stays red, always)
Also fixed a problem where I meant to .get a value but had .set
instead. It wasn't noticable because that function is currently
only called when things have just been seen, so even though it
was wrong, it produced a good result.
Bug: T94634
Change-Id: I7ee447249527feb3914c76cfffd673bbda062b75
I tried to stick as close to the existing code as possible.
Special:Notifications is slightly different from the overlay,
however. I made it add .mw-echo-unread class for consistency,
but that JS doesn't record seen time (it only loads older
entries), not does the CSS fadeout apply there (it marks
everything as read as soon as it's displayed, so different
behavior from overlay)
PS: I'm not sure about browser compat for the fadeout. But
even if some obscure browsers don't support this, meh. It's
not an "important" feature that can't be missed.
Bug: T94634
Change-Id: Ibb201823fb52ef8a3d5eaa39b0b724ede8d271d1
Follows-up 8d12ef9.
Tests were failing because wgEchoConfig was undefined and ext.base.js
accesses wgEchoConfig.eventlogging.
This mock should not be needed. Modules should be loadable at any
time and react to the current environment. If they should not do
anything, the client should be able to determine that. Perhaps
an isAnon() or some property wgEchoConfig to indicate this.
It only being loaded from beforePageDisplay() when logged-in is a
load optimisation, not business logic. wgEchoConfig should always
be there, or the code should handle the case of it not being there.
Change-Id: Ide90adf20e583921c9f3bd5cd37057995aa3d2c3