Commit graph

405 commits

Author SHA1 Message Date
Roan Kattouw 07754e8b71 NotificationBadgeWidget: Fix button icon positioning for change in OOUI
OOUI now uses absolute positioning for these icons, which breaks
the centered text model we'd like to use. Longer-term we should
use a different widget for these buttons, or perhaps a widget of
our own, but for now let's hack around that by undoing the
absolute positioning.

Change-Id: I8cc1fd69eeedde00facec80d82a21d5cc5610992
2015-09-29 16:23:10 -07:00
jenkins-bot 156dad4faf Merge "Fix Echo popup alignment in RTL" 2015-09-29 23:10:08 +00:00
Moriel Schottlender 16ddd5c7d7 Fix Echo popup alignment in RTL
Bug: T114184
Change-Id: I2b2b8c332efbcf0e646bf77f688433559da7b628
2015-09-29 16:05:31 -07:00
Moriel Schottlender 44bf7ac839 Do not reset an option that has no reset method
The placeholder method has no reset, skip it when resetting the
options.

Change-Id: I4936c5c9dde870b574b035384abcdf0b746d9b4a
2015-09-29 15:58:34 -07:00
Moriel Schottlender e0cd881aeb Mark all read button should always start invisible
Whether the button should appear or not is updated when the badge
is updated, based on having unread notifications. But during construction
the button should be hidden.

When we do update the badge, the button should only appear if there
are unread messages and if the current widget is not 'markReadWhenSeen'
to avoid having the button 'flash' while notifications are marked
read.

Bug: T113629
Change-Id: I002db9e3d8990b5a2cd67bf5d120b1c7eb454362
2015-09-28 20:37:01 +00:00
Moriel Schottlender 3ea86361a4 Rewrite browser tests for Echo
The new oouified echo popup makes the tests invalid; this commit
rewrites those tests.

Also by doing this commit we are upgrading to Selenium 1.4.

Change-Id: I26215558768d55be449276c55b4b745c3a458ecb
2015-09-25 15:50:59 -07:00
jenkins-bot a206bdd9ef Merge "Make middle-clicking badge work" 2015-09-24 23:16:07 +00:00
jenkins-bot 55d30ecb26 Merge "Add intermediate metrics for API and ext.echo.ui loading response times" 2015-09-24 23:06:01 +00:00
Kunal Mehta 480f8863c6 Add intermediate metrics for API and ext.echo.ui loading response times
And add a FIXME for our existing metric possibly being wrong if the API
request finishes before the ext.echo.ui module is loaded.

Change-Id: I918187dd276193b7602f60527b423ca06cb7e2d0
2015-09-24 14:33:21 -07:00
Moriel Schottlender e664cb220f Update seen time only if the popup is actually open
The notifications can be populated from the popup and outside of it.
We should update the seen time only if the request came from the popup
itself, and only if it is still open by the time the api request
has finished.

Bug: T113645
Change-Id: Id91ddabb85fd582be1890ea420d0559e0cdca167
2015-09-24 14:23:23 -07:00
Roan Kattouw 6efd060169 Make middle-clicking badge work
* Ignore non-left-button click events on initial badge
* Pass href into OOUI badge widget

Bug: T113555
Change-Id: I963aa5193435c46075df6d7204de335b51ecffd4
2015-09-24 10:35:55 -07:00
jenkins-bot 286aab802d Merge "Remove 'initiallyUnseen' class when the popup closes" 2015-09-24 01:37:37 +00:00
Moriel Schottlender 9514aa01ab Remove 'initiallyUnseen' class when the popup closes
The popup automatically updates itself every time it is opened.
If there are unseen notifications, they should be updated when the
next fetch happens, which means we must take off that class so
that the animation doesn't repeat itself.

Change-Id: Ib4173631efa1c5a3a3509e0797e60397397bd009
2015-09-23 16:58:57 -07:00
Moriel Schottlender c4485b91a7 Prevent the badge icon from flashing red when updating notifications
If the popup is open, whatever is coming in is immediately 'seen',
so we shouldn't flash the badge as red.

Bug: T112823
Change-Id: I9fe78ed11506de3c82043141f994e1ca96c5880b
2015-09-22 17:24:58 -07:00
Moriel Schottlender 091587142d Replace the orange bar with talk-page link, don't remove it
The orange bar is replacing the 'talk' link; when it is removed, it
should actually be replaced back to being a regular 'talk' page
and not be completely removed from the page.

Change-Id: I930d321952e85ee79acbbd162ab763b4eea63ff1
2015-09-22 15:36:14 -07:00
jenkins-bot 32d8991013 Merge "Move timing.MediaWiki.echo.overlay stats into ext.echo.init" 2015-09-22 21:41:03 +00:00
Kunal Mehta c8eea64259 Move timing.MediaWiki.echo.overlay stats into ext.echo.init
We really only care about measuring the timing of the first click,
because that is the one that loads OOjs UI and fires an API request.

Bug: T113387
Change-Id: Ib37d31b07c45d546c75251a57a848e3ae0f4bf1b
2015-09-22 12:04:35 -07:00
Moriel Schottlender 8bc0c98b6f Remove talk page notification bar if all messages are read
Bug: T106033
Change-Id: I5133896c204be701e0fae582af91c906175f39d1
2015-09-21 12:06:34 -07:00
jenkins-bot 61158920f8 Merge "Replace entire <li> element to produce button and popup separately" 2015-09-19 15:59:19 +00:00
Moriel Schottlender 429b11148b Replace entire <li> element to produce button and popup separately
We need the button to remain a standalone <a> element so it preserves
the exact same styling as the output we're getting from the PHP. the
only way to do this is to create the widget as the entire <li> and then
replace the original.

Bug: T112218
Change-Id: Ib6fd4369d46cb7f37b14675d63bbce9950abcd48
2015-09-19 17:56:29 +02:00
Moriel Schottlender 0e02fb2cde Update the API when a single notification is marked as read
The status changed internally but was never passed to the API.
This commit fixes that mishap.

Bug: T112826
Change-Id: I1a6d2a871eae837860eb1f21df28134d5e747cd7
2015-09-18 16:05:35 -07:00
jenkins-bot 09ba053c57 Merge "Correct unseen animation in notifications" 2015-09-18 11:10:09 +00:00
Moriel Schottlender d67e474d46 Correct unseen animation in notifications
The unseen animation should display whether the option is unread or
read, because it should point out notifications that were unseen/new in
this session even if they are immediately marked as read (in cases
where the configuration is 'mark read when seen', like in alerts).

However, the animation itself switched by default to white background
which is an 'unread' state. This made cases like "mark all as read"
mark the notifications as read but still have a white background as
if they are unread, and yet have no 'x' button because they are actually
read. (Bear with me here)

This commit organizes the animation better. We now have a proper clear
naming for the two animations - unseen-to-read and unseen-to-unread and
we use unseen-to-read as default. unseen-to-unread is used when
the -unread class is applied and the other cases should reflect the
correct state of the option read/unread status.

Bug: T112826
Change-Id: I7fe8ea5dcf8c3e31d16213313be34b2350d03655
2015-09-18 11:02:38 +00:00
jenkins-bot 1b590d4308 Merge "Show a default message if no notifications are available" 2015-09-17 23:52:48 +00:00
Moriel Schottlender 1474a21d4a Fix a code comment to make it much clearer
Change-Id: Ibd7c1e050f0d0790c1712a950568e3f9b09965ca
2015-09-17 16:43:36 -07:00
Moriel Schottlender 5e8e18ee48 Show a default message if no notifications are available
Bug: T112251
Change-Id: Ia17c50a11ea0a49041795332ba79bd3cbda5b548
2015-09-17 16:25:54 -07:00
jenkins-bot 24d83a8a32 Merge "Make the footer links readable in Modern" 2015-09-17 22:19:52 +00:00
Kunal Mehta 233da11ebd Make the footer links readable in Modern
White on white isn't readable :(

Change-Id: Ie352961048ef9788a53da4b1cfeddd5808284b68
2015-09-17 15:15:54 -07:00
jenkins-bot c64cdbd293 Merge "Handle API fetching errors" 2015-09-17 22:11:14 +00:00
Moriel Schottlender fd0aed5ae4 Handle API fetching errors
Bug: T112251
Change-Id: Ifb9c63cd056b0cc0e7076c73e98155cef445038f
2015-09-17 15:03:28 -07:00
Kunal Mehta 31c770741a Don't depend upon ext.echo.logger in ext.echo.init
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
2015-09-16 12:52:07 -07:00
Kunal Mehta c726c1ecab Measure how likely users open flyout if they have unseen notifications
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
2015-09-16 10:18:17 -07:00
Moriel Schottlender 8a8d1c4ff9 Adjust margins for the notification badge in MonoBook
Change-Id: Iae8c9a855fa407990548691d46974303fcc77ad9
2015-09-16 17:03:46 +00:00
Moriel Schottlender c5905962ab Only load ext.echo.ui if the user clicks the echo badge
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
2015-09-15 17:11:46 -07:00
Roan Kattouw 5b1fc2b818 Hack around OOUI's icon pack being too large by creating our own
Bug: T112401
Change-Id: Id2a527dc1f4846985beb2cc4d5562a27d5636d55
2015-09-14 22:21:45 +02:00
Roan Kattouw 0c5869c216 Use math to compute badge padding in nojs
More clearly indicates how those numbers get there, and fixes
a discrepancy of 0.02em.

Change-Id: Idbc33878953fda85185cada5550f99a1076b9036
2015-09-14 18:47:29 +02:00
Roan Kattouw b046a1062d Don't load oojs-ui.styles on every page
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
2015-09-14 12:38:44 +02:00
jenkins-bot d72a235854 Merge "Fix vertical alignment of 'Mark all as read' button" 2015-09-13 19:19:34 +00:00
jenkins-bot c73d29e324 Merge "Don't clear notifications when refetching" 2015-09-12 10:51:17 +00:00
jenkins-bot bfe49365db Merge "Link directly to notification preferences in flyout" 2015-09-11 17:53:51 +00:00
jenkins-bot 3b58c3985f Merge "Let action buttons center align" 2015-09-11 17:07:57 +00:00
jenkins-bot 158cab5c24 Merge "Wrap notifications with a link for native click behavior" 2015-09-11 17:07:54 +00:00
Moriel Schottlender bfd27ae712 Wrap notifications with a link for native click behavior
Remove the behavior of the SelectWidget 'choose' and instead wrap
the notifications with their primary url links. That way, the click
handler returns to browser native response, and we gain automatic
behavior for ctrl+click, middle click, and regular click.

CSS had to be adjusted as well.

Bug: T112004
Change-Id: If10a4d3be71a8cf3ce966f15b922da0b9a2ddcc7
2015-09-11 09:48:00 -07:00
jenkins-bot 6de9f78a4d Merge "Make links non-white in the notification popup in Modern" 2015-09-11 16:45:14 +00:00
Kunal Mehta 0eb5d53375 Link directly to notification preferences in flyout
Bug: T112254
Change-Id: Id468763ac2f678dde0794ff401147e8be834ce0c
2015-09-11 08:15:26 -07:00
jenkins-bot 892b3d7a8c Merge "Use localized numbers in the badge" 2015-09-11 13:04:45 +00:00
Ed Sanders e77d088499 Let action buttons center align
Bug: T112188
Change-Id: I98cee8f70c05dc82e574e5867107975cfec37a19
2015-09-11 12:32:23 +01:00
eranroz 381b7be7d8 Avoid flashes: late debounce causes annoying flashes
Validate elements are updated before replacing elements in the DOM.

Bug: T112168
Change-Id: Ia9556b0b9e9f5b0132be5a61a2cde7bb4dc5606e
2015-09-11 11:09:17 +00:00
Kunal Mehta 7ae462f5e4 Use localized numbers in the badge
Bug: T112224
Change-Id: I6df892bf92f5de0e0552a7b12c9799be640839bc
2015-09-10 21:29:56 -07:00
Moriel Schottlender 7ad8cc24d0 Make links non-white in the notification popup in Modern
Change-Id: Icceeb916efceb8c2395aae7b30b054b274645f02
2015-09-10 17:05:30 -07:00
jenkins-bot 0ed0f43da9 Merge "Override padding for links in personal tools in Modern skin" 2015-09-10 22:56:43 +00:00
Ed Sanders eef9cb8cf6 Fix vertical alignment of 'Mark all as read' button
Change-Id: I6292737cede797bb1c197e6b2a5092cd6554da6d
2015-09-10 23:44:25 +01:00
jenkins-bot 34e1ffa59a Merge "Restyle buttons to be fully clickable" 2015-09-10 22:43:31 +00:00
jenkins-bot b5a31ed9d0 Merge "Add constructed class and messages names in comment for greppability" 2015-09-10 22:42:36 +00:00
Ed Sanders 1301a8f3f9 Add constructed class and messages names in comment for greppability
Done in one place but missing in two others.

Change-Id: I671326c05e15dfad1fca06f66d6847fcca0c2737
2015-09-10 23:38:26 +01:00
Moriel Schottlender b1b9b6e257 Don't clear notifications when refetching
Make the popup header the pending element to give the user a visual
indication that the notification widget is being updated, but don't
clear the notifications before loading more from the database.

Bug: T112186
Change-Id: If2b724fab07ef5b7caf5cab3e44fe326470ac0e7
2015-09-10 15:24:21 -07:00
Ed Sanders 48dc79be11 Restyle buttons to be fully clickable
Also use framed buttons (which these sort of are) as they
have hover styles.

Bug: T112188
Change-Id: I750a18a90c655cc7916e050b5e300300a4437b69
2015-09-10 23:08:33 +01:00
Ed Sanders fbd05031fc Remove unnecessary calc() from css
The expression is evaluated by the LESS compiler.

Change-Id: I7922d1ff2306ce880c6c9c011fda7576eea8e183
2015-09-10 22:53:31 +01:00
Kunal Mehta 5c49d1482b Override padding for links in personal tools in Modern skin
The flyout is now part of the personal tools, so Modern's styling of
`#p-personal li a` now affects it. Override that for links in the flyout
so it doesn't look super silly.

Bug: T111825
Change-Id: Ie67ff2d7803362bd7214bade27383282620799b9
2015-09-10 13:41:18 -07:00
jenkins-bot d36f940f06 Merge "Align popup footer buttons to take 50% width each" 2015-09-09 20:47:50 +00:00
Moriel Schottlender a37e764d3d Align popup footer buttons to take 50% width each
The alignment of the buttons was done haphazadly before, using
padding. This should be done better; we should calculate the buttons
width to be 50% of the width of the popup.

Since the popup accepts a width config, we know what its value is,
and can calculate the proper width. The width was added to the
variables.less file for continued use.

* Added popupWidth config variable to the badge widget
* Added OO.ui.ButtonGroupWidget to place the buttons in for
  consistency and styling
* Added calculated width styles to both footer buttons
* Added corrections for MonoBook

Change-Id: Iad2c947da06241e9303cf1f35574177a0f602bbb
2015-09-09 13:37:24 -07:00
jenkins-bot d220eacd60 Merge "Only show 'mark all as read' AFTER there are notifications" 2015-09-09 20:13:55 +00:00
Moriel Schottlender 71999b28c4 Only show 'mark all as read' AFTER there are notifications
Hide the 'mark all read' button while we fetch notifications.
We can't mark all as read before there are any actual unread
notifications in the popup anyways.

Change-Id: I38ace6a3f8b7898bdcd82ce650947f0c7ef319e2
2015-09-09 11:50:54 -07:00
Pau Giner b6712be9a3 Reduce distance between notification badges
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
2015-09-09 11:36:18 -07:00
jenkins-bot 9a2262d694 Merge "Use #pt-notifications-alert to get Special:Notifications link" 2015-09-08 21:13:53 +00:00
jenkins-bot 582017e82f Merge "Add a tooltip to the notification badges" 2015-09-08 21:11:43 +00:00
jenkins-bot 05d350b122 Merge "Show unread notifications first in the popup" 2015-09-08 21:08:26 +00:00
Kunal Mehta aae891d839 Use #pt-notifications-alert to get Special:Notifications link
Users who have never received a message will not have a messages badge.

Bug: T111783
Change-Id: I5e2b9834f4bc2f30948d1799215e29b16cb64c3e
2015-09-08 14:08:14 -07:00
Moriel Schottlender 73e3ed3717 Add a tooltip to the notification badges
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
2015-09-08 14:03:34 -07:00
Moriel Schottlender 7310a6b387 Show unread notifications first in the popup
Change-Id: Ib4947cee84a28a2850a86032528fa75bf472c5fa
2015-09-08 13:57:00 -07:00
Moriel Schottlender 2ec0ccad78 The return of the 'mark all as read' button
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
2015-09-08 13:46:57 -07:00
jenkins-bot 6e142da08e Merge "Align notification badge higher on the personal navigation bar" 2015-09-08 03:40:51 +00:00
Moriel Schottlender f4fd809e56 Only send api request if the popup is opening
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
2015-09-07 17:11:31 -07:00
Moriel Schottlender 327466a2d3 Align notification badge higher on the personal navigation bar
Bug: T108190
Change-Id: Id25213689c2ec9a6031bd120020c0b5ebde6e14f
2015-09-07 16:32:57 -07:00
jenkins-bot 1502371c2a Merge "Fix the badge icon update" 2015-09-07 19:11:31 +00:00
Moriel Schottlender 36191fc290 Fix the badge icon update
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
2015-09-07 12:05:14 -07:00
jenkins-bot 04edd414cf Merge "Specify firstHeading rule for .mw-special-Notifications only" 2015-09-07 05:22:01 +00:00
Moriel Schottlender dbefd3b6f0 Specify firstHeading rule for .mw-special-Notifications only
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
2015-09-06 22:05:34 -07:00
Moriel Schottlender 311c3aad8f Restore echo.alert styles
Change-Id: I079d59b9d9dfea5b53dc2fb73d0a054ba3d7e270
2015-09-04 16:36:01 -07:00
Moriel Schottlender fc2711ebc4 Create an 'initiallyUnseen' class for initially unseen notifications
This is so that the animation definition remains on the notification even
after it is marked as seen.

Change-Id: Ifd19cd5cd003a4e29d0c42788d51aca985e0b859
2015-09-03 15:37:02 -07:00
Moriel Schottlender ea1f23e04d Don't wait for the API to update seen status of notifications
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
2015-09-03 15:06:14 -07:00
jenkins-bot 20a380cd9c Merge "Add a border between the popup head and notification list" 2015-09-03 21:34:51 +00:00
Moriel Schottlender 820eaa2726 Add a border between the popup head and notification list
Bug: T111432
Change-Id: Ic10edbafa96ab76416165237228f0f259bd9f5f7
2015-09-03 14:28:56 -07:00
jenkins-bot 61516ebe53 Merge "Separate 'seen time' for alerts and messages" 2015-09-03 21:17:06 +00:00
Moriel Schottlender e650df6644 Separate 'seen time' for alerts and messages
Bug: T111285
Change-Id: I277f94ae705d3323ac8612111d7fd704b36793cb
2015-09-03 13:14:15 -07:00
Moriel Schottlender f6a12f1051 Correct 'primaryLink' to 'primaryUrl' everywhere
Change-Id: Id42940460f7825541f9bc6e65ff864035591f47e
2015-09-02 16:59:55 -07:00
Kunal Mehta 35c4a37918 Use db-replicated objectcache for storing last seen time
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
2015-09-02 22:42:35 +00:00
Moriel Schottlender 1ac72cc01a Split alerts and messages in Echo
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
2015-09-02 15:36:37 -07:00
Kunal Mehta 686a8ab5a4 Measure how long it takes for the flyout to open
Bug: T56486
Change-Id: I12bfbfb186e8ab2bfe22052402ad4c71b2e6bd81
2015-08-11 16:57:29 -07:00
Kunal Mehta bce9dbab18 Link to localized Special:Notifications in overlay footer
Re-use the localized link from the badge.

Bug: T59350
Change-Id: I4b859a07b253894ac776519971cc130548350321
2015-07-06 17:57:59 -07:00
Legoktm 2257dd2a56 Revert "Pass uselang=user to the API instead of figuring it out client side"
This breaks pages using ?uselang=xx where "xx" is not
the user's language.

This reverts commit 0919b01e75.

Bug: T103935
Change-Id: I219810451b991cef88bac62cf880bfda6f98e930
2015-06-25 17:16:13 -07:00
Kunal Mehta 78dc653c80 Remove dead dismiss code
mw.echo.setUpDismissability was removed in 08fc83b6de, and will
never be called since the class is never set.

Change-Id: I1e13bbabaeb7df21c161d4cf4205a1564e1d81d9
2015-06-07 18:30:49 -07:00
Kunal Mehta 70d95fbad0 Use mw.Api.postWithToken to automatically re-try badtoken errors
Bug: T101664
Change-Id: I93188099e24102b47384c08113e8dbd26dac8df1
2015-06-07 18:11:48 -07:00
Kunal Mehta 7a196ce358 Remove pre-MW 1.22 compatability code
Change-Id: Ia59464f4a9a5589d84e5028cdabb33aa95df4209
2015-06-07 17:34:26 -07:00
Kunal Mehta 0919b01e75 Pass uselang=user to the API instead of figuring it out client side
Change-Id: I09add693567af577c14c646d2b6b943716e0522e
2015-06-07 17:30:00 -07:00
Matthias Mullie d150625ce1 Until seentime is recorded, we should treat notifications as unseen
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
2015-05-06 10:53:45 +02:00
Roan Kattouw 518101e495 Actually pass jscs
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
2015-05-04 19:28:01 +00:00
Matthias Mullie da07893647 Display red badge based on time of notifications vs last time panel was opened
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
2015-05-01 11:39:45 -07:00
Matthew Flaschen 0dbf078f8d Make sure eventId is int for client-side events.
Bug: T95169
Change-Id: Ic15b963a3656f8886532d1b990befe327159d56e
2015-04-15 00:18:38 -04:00
Tina Johnson 0e810f0510 Make links in Echo's notification footer blue on hover
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
2015-03-14 00:41:11 +05:30