Notification badges are conceptually closer together than the rest of toolbar elements.
So it makes sense to move them closer visually too.
This is just a small CSS adjustment to compensate for the default margin
that items in the menu get. If there is a cleanner way to achieve the same,
feel free to refactor.
Bug: T108190
Change-Id: I06403f67c24f045c125c505dca2101f9eed79594
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
For some reason during the readjustment to the model/view the
mark all as read button was not toggled when it should have been.
It is now.
Change-Id: I05c32e9cb02e94b4e3dc3e2bcd9cead0eb802015
Listen to 'toggle' instead of onAction so we can only send api
requests for notifications if the popup is in the process of opening
and not when the button is clicked to close the popup.
Bug: T111667
Change-Id: I39aea942ff5a87a13043cccdb696ef8952ca61db
Make sure that when the seen state changes, the badge icon adjusts
in case there are two different icons for seen and unseen states.
Also organize a bit the unseen/unread status in initialization.
And separate and update the icons in the popup head to always fit
the status and icon of the badge.
Bug: T111432
Change-Id: I891a36c6eace9302b370a3efaf5aa6f57192c17f
The rule to make the firstHeading limited in height should only
apply to the design of the Special:Notifications page, and not
everywhere on MW.
Bug: T111628
Change-Id: I6636ed7f4ad0ccc7bbf83ace51dda62d09e09a5c
This is so that the animation definition remains on the notification even
after it is marked as seen.
Change-Id: Ifd19cd5cd003a4e29d0c42788d51aca985e0b859
First update the notifications as seen, then send the api request
for updating the seen time. Update the actual seen time from the
api response so the time is always in sync with server time.
Change-Id: I97717cfda7b665dcbc3add90712069700f44adf6
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 breaks pages using ?uselang=xx where "xx" is not
the user's language.
This reverts commit 0919b01e75.
Bug: T103935
Change-Id: I219810451b991cef88bac62cf880bfda6f98e930
mw.echo.setUpDismissability was removed in 08fc83b6de, and will
never be called since the class is never set.
Change-Id: I1e13bbabaeb7df21c161d4cf4205a1564e1d81d9
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
Removed exemptions from .jscsrc and fixed the code to make jscs still
pass.
Kept the dangling underscores exemption because leading underscores
are (for now) used as a naming convention for private functions in
this repo.
Change-Id: I18964f8469f52c294276527d92cb6bf9f48c2576
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
Links on the notification footer, "View edit" / "View changes", needs
to be blue instead of grey to be consistent with the Mediawiki interface.
The link turns blue upon hovering, just the way it is currently set
for other links on notifications like the page title.
Bug: T57367
Change-Id: Ibaaff52b9d4bdfc5beca442e10734dd5cf8886d7
This is now required to actually pick up the MW UI progressive
color, so there's a slight visual change (wrong blue => right blue).
Fixes T72818
Bug: T72818
Change-Id: I719eb20a3940904ab45f8376280e20432a3b2d80
Added ext.echo.updateNotificationCount to notify other extensions
about updates to the notification count.
Bug: T67178
Change-Id: I7f4e34f2c1808b249db010018dd1b49a8dde246a
mw-ui-quiet gets dark gray and bold.
This way it is easier to see which is the current tab.
Bug: T71929
Change-Id: Ie7e21cd71a385d216402d393344cf76d3ed45d23
Binding it to the element name should rarely be needed as it only
adds complexity with no clear benefit.
Nesting classes should also rarely be necessary as it basically
requires the code will never be embedded in or itself embed something
from another component (otherwise you'd clash with that other component's
class name, and if you don't clash, then it wasn't neccecary to
nest the class in the first place).
If the class is overlay-specfic it should be renamed to something
like '.mw-echo-overlay-grey-link'. Keeping it as-is and applying
directly though, as it doesn't appear overlay-specific.
Change-Id: Ied601058c8e501914113d542f88542c83157d5a0
The max-height of the notifications list was hardcoded to
the height of the window minus 134 pixels. I don't know
where this value came from, but it doesn't seem to take
borders into account. The correct value appears to be
139 in Chrome and 140 in Firefox, so I changed it to 140.
Also, this really really should not be a hardcoded value.
This 140 value can be measured in JavaScript; that's how I
derived it. Even better, oojs-ui has a mixin called
OO.ui.ClippableElement that automatically does this for you
AND automatically adjusts the height when the window is resized
as well.
Change-Id: I17bc2c5333e5c3d5dd720e6bccf8cbbdbb4abe6c
The "hover" pseudo-event was deprecated in jQuery 1.8 and removed in
1.9. This is logged as "JQMIGRATE: 'hover' pseudo-event is deprecated,
use 'mouseenter mouseleave'". This fix switches to using the .hover()
method which appears to be the original intent as two functions have
been used which .hover() supports, whereas .on() only accepts one
handler. Now the class change works as expected.
Change-Id: Ib28801293b72f8f344455b5f308876d185abc8bd
This reverts the tests and amends them after the
application of commit 5da9eac08a.
Luckily nothing appears to be broken.
Change-Id: I67acfe5dc74ef750d5443dd619dbb114623ee233
Just like all other text elements in the overlay: set the font-size to 13px
Not sure why this was em & rest px. 13px is equivalent to the current 0.8em in
Vector.
Change-Id: I29d67f21cc2af7209469299ab228ebe7dac98af7
The only exception is when there are new message notifications but no new
alert notifications.
Bug: 70461
Change-Id: I06daa3f7d526beeb878eb343c169e01acd49e71f
If you have an unread notifications not in the initial
load of special page, clicking load more would throw
an error
Bug: 69714
Change-Id: I9af588780b2ab8481ba252ddc21bad0601de7a0b
This class was only being applied to notification output
on special pages and not in the overlay, move it so it can.
Additionally:
* bolds .mw-echo-title-heading same as the anchors it works with
* clean up a repeated rule against `.mw-echo-title a`
Change-Id: I579252399b39746f5aa2cfc51b5cd3b9b8b2cdb0
Also adds browser tests for the behaviour of the mark all as read button
to ensure it only clears message notifications.
Dependency: Ifb7b1b7b7feb4a5af65c79bb16b91a5a9c70166c
Change-Id: I46e1de229e32d705e67cebde678ecea3f3633906
This removes the need from the super specific selectors.
It also allows us to create multiple notification elements
on a screen.
Change-Id: Ife5291a315915779689943ffc18ac73d77351d0e
IE8+ supports the pseudo element. The world will not explode if
IE6 and 7 do not have the chevron.
This simplifies code by dropping the use of the pokey element
Note: I know we can drop using the image too but I decided not to do
that in this patch.
Change-Id: Ia9ac434461e63bc2cf8554060126995ac65a3531
Danny noticed a bug where if both tabs have unread notifications,
then when opening the overlay and clicking on the alerts tab, the user
would be reverted back to the messages tab.
Test stops this from happening again.
Change-Id: I6bbbbf61251957336de8856201412fa3569ab22d
Don't mark messages as read until they have been acted on.
Show a mark as read button that marks entire list as read.
Change-Id: I4450a66cffd11c67b9a4ba9aac0fe958dc760e15
Note no design was defined so have taken this to mean use
mediawiki ui for consistency purposes.
* Use mw-ui-active and mw-ui-quiet for tabs
* Update tests
Change-Id: If7a51b2286cdfe6e839dacc2476c9a578bc7f1df
Shift to new API to support 2 tab view
When a new has no messages they will see the old style overlay with
Notifications heading. I have added tests to assure this is the case!
Later patches will:
1) Add the mark as read button only in message view
2) Note currently the tabs do not refresh when notifications is clear.
We need some kind of EventEmitter to make this sort of thing easier.
Change-Id: I62b590e81cd3fe867c4c13959cb43466aacfe2d5
Make various properties of the overlay properties of
EchoOverlay to reduce need for function parameters
Change-Id: I70ec0c650d58322aad93d71292a836d7cf7e7474
Not as scary as it looks. The change to _buildOverlay simply changes
indenting, and cleans up to reflect new parameter. Tests still pass ;-)
Kill noticationLimit concept
Only expose what's necessary on mw.echo.overlay
Change-Id: I2671a41af8188c14ad4c910396afa0d9000b6051