Commit graph

80 commits

Author SHA1 Message Date
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 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 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 b539621b7f Split up ext.echo.nojs into badge and notifications styles
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
2015-09-16 12:52:12 -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
jenkins-bot 1d9481f43c Merge "Only load ext.echo.ui if the user clicks the echo badge" 2015-09-16 17:14:51 +00:00
Kunal Mehta 9e75474b5f Split out .mw-echo-alert styles back into a separate module
Change-Id: Ia946eb3b7cd917f84b7ab57a280f55a3eadfcebf
2015-09-16 17:02:22 +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 f2ed7a6a53 Don't load unused Echo JS/CSS on mobile
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
2015-09-14 23:12:59 +02: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
Kunal Mehta 3940f523ba Only load nojs Special:Notifications styles on the special page
Bug: T112407
Change-Id: I4112c8b819127dea7c5e2117feedfeecf583ef1f
2015-09-12 21:23:08 -07: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 a3e5dd4c30 Add mediawiki.jqueryMsg dependency
Change-Id: If6348e501076afb2bd55af854284b9d865d10625
2015-09-09 12:15:22 -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 311c3aad8f Restore echo.alert styles
Change-Id: I079d59b9d9dfea5b53dc2fb73d0a054ba3d7e270
2015-09-04 16:36:01 -07: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 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
Kunal Mehta 10cd92a326 ext.echo.special depends upon mediawiki.api
Change-Id: Iabcfd263ae8cb857d767ea9b6af0480d67bf3d2d
2015-06-07 17:27:32 -07:00
Kunal Mehta d9e2695c7b Don't pollute $GLOBALS in Resources.php
Get rid of $mobileReadyTemplate, it's only used once now, and unset
$echoResourceTemplate after usage.

Change-Id: Ie371a6c1545383b8be1c0b99730228da6e381650
2015-06-02 00:55:44 +00:00
Kunal Mehta 94dd86f255 Simplify registration of EventLogging modules
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
2015-06-01 11:58:37 -07:00
Gilles Dubuc 001572b510 Explicitly define module position
Style modules currently added through addModuleStyles default
to being in the head ("top" position). This is an unhealthy default,
since only critical styles that are needed at pageload should be
in the head. In order to be able to switch the default to "bottom",
existing module positions have to be defined explicitly.

Bug: T97410
Change-Id: Id972c96526a32dc4ca332e973f6bd752601c2d5f
2015-04-28 15:46:03 +02:00
jdlrobson 4ff74ddd50 Hygiene: Alter how initialisation of the overlay works
Restructure code so MobileFrontend can make use of it
Kill ext.echo.desktop

Change-Id: I984373ba54206d447c54a435dbf60e8f6e814be1
2014-09-12 22:49:51 +00:00
bsitu 75d5c9b9a3 Remove (X) next to Alerts/Messages if there is one section
Change-Id: Ibf66328e31bfefb3d588196c3f4babfa65bb52f3
Eg: Alerts(X) becomes Alerts
2014-09-09 11:12:38 -07:00
jdlrobson bb27de169e E2c: Hover behaviour of notifications panel tabs
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
2014-08-12 21:06:12 +00:00
jdlrobson 9882898f92 Notification overlay Messages and Alerts sections
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
2014-08-12 12:33:06 -07:00
jdlrobson 0ff4295a88 Hygiene: Move the overlay initialisation code into a separate file
Change-Id: I4dcdf9708b700c57679ff878275c5560a62e3a06
2014-08-06 20:29:35 +00:00
jdlrobson 8d12ef9a80 The first ever Echo QUnit tests
Also change coding conventions of Resources to allows use
array for scripts key.

Change-Id: I0c9f358ce3eb62adb07b68623e97c07993c9c45c
2014-08-06 13:26:42 -07:00
jdlrobson 430628ccc1 Hygiene: Port all Echo css to less.
No changes.
Makes styling code more readable.

Change-Id: Ie45f2cd3671bee5b88ba92ca2946d6e77cd59508
2014-08-04 11:43:27 -07:00
Erik Bernhardson 71c7e02858 Directory reshuffle, add dev tools
* Port Flow Makefile to Echo
* Move resources to Resources.php

Change-Id: I75e96cc1e51a7768600ffc083550fc94ea9d1e6c
2014-08-01 22:38:41 +00:00