Commit graph

199 commits

Author SHA1 Message Date
jdlrobson 71a1ec3f6f Reduce specifity of Echo css
The #p-personal only is needed to override the ul padding.
Let's make this explict.

Change-Id: Idf538d2a09ffc4d325d4fb3061564d8dd11b1e60
2014-08-07 21:07:14 +00:00
jdlrobson 1896424e9a Hygiene: use self where possible
Change-Id: I30e9d6ea8b59e168fc5b151f215c3592f475bedf
2014-08-06 13:30:42 -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 a815733447 Hygiene: Move code for header into _getTitleElement
Change-Id: Ic53933189bf51772a88689794a7633ba8ba0ac2c
2014-08-06 20:29:30 +00:00
jdlrobson f02d3f059d Hygiene: Add _getFooterElement method
Continue to shrink down the size of buildOverlay

Change-Id: I69b339947bfe4d5e73c6d293f0ae5e9e494ec6ca
2014-08-06 20:29:25 +00:00
jdlrobson 9b30d33549 Hygiene: Refactor out mark as read button code
Change-Id: Iad935174925bd1c16e51bbc36c84b48769e9780c
2014-08-06 20:29:01 +00:00
jdlrobson e064126209 Hygiene: Split buildOverlay into smaller functions
Start with a getNotificationLimit and markAllAsRead function

Change-Id: Ice53af40a152f6c3b5a92683c574ef7dc2d01047
2014-08-06 20:28:55 +00:00
jdlrobson 01b0f912f3 Hygiene: More LESS cleanup in ext.echo.overlays.less
Change-Id: I2d2daad00a11a156dc0ac693ea99322c9470cc6f
2014-08-05 11:37:43 -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
Legoktm a09d4cbaf5 Revert "New hooks for external integration to notification intiialization"
No usecase has been provided, and additionally the hooks
are not documented. Bartosz also points out that
mw.hook calls are asynchronous and memorized.

This reverts commit 9d3561afaf.

Change-Id: If735b46996fab3def835a54223412ef6d3105395
2014-07-26 01:05:35 +00:00
Erik Bernhardson 9d3561afaf New hooks for external integration to notification intiialization
Adds two new hooks to allow extensions to tie into the notification
loading process.  Between these two hooks and the new isInitialized()
method any extension can run code whenever a notification is displayed.

Change-Id: If351835be5f65ca098e2d235ea8c8e4dc40ae2b4
2014-07-21 16:08:56 -07:00
Thiemo Mättig e205992d0b Remove unused code and fix missing/broken documentation
General code cleanup as reported by the PHPStorm static code
analysis. I hope it's not a problem that I made a lot of very
different (but all very tiny) changes in a single patch. If you
want to merge this but you think it's better to split it into
several patches first, please tell me.

Change-Id: I2e2c4bb47f8d20e038d28e236e2ff813b30504af
2014-06-04 04:54:00 +00:00
Thiemo Mättig 0656e7594a Avoid line break in the "All notifications" footer link
Tested with latest Firefox and Chrome as well as Opera 12.

See bug 57327 for full description, please.

Bug: 57327
Change-Id: Ibf6e7d590754402f4cfafa3a3db55bb0c6aa525e
2014-06-04 04:53:25 +00:00
Juliusz Gonera c9cff5c600 Always show the overlay when badge clicked
The badge is always close to the top of the window (if it's visible), so
this is not necessary. Also, this behavior is definitely not desired
for the upcoming fixed header beta feature (the badge will always be
visible as a part of the fixed header).

Change-Id: I66e8a50b1139f7bcd005cfb3c3576578efe6a653
2014-05-15 23:45:03 +00:00
tinajohnson.1234 19dacca2e2 Added keyboard shortcut (ESC key) to close notifications flyout
Notifications flyout is closed when ESC key is pressed.

Bug: 53588
Change-Id: I220affcc383c943ca9d977bc4014d45904ce06c2
2014-04-06 11:40:10 +05:30
aude 5dfc53c990 Remove usage of wikiGetlink deprecated function
Change-Id: I59ecfdcdf834d265b9a911c37fd9a35fd2588ec7
2014-02-24 12:56:04 +01:00
bsitu 7637e1283d Automatically mark invalid notifications as read upon request
Change-Id: I8f72daf1b49bcb42037c1415f806bab3472d8e39
2014-02-05 16:53:04 -08:00
jenkins-bot a065dea8af Merge "Catch exceptions formatting notifications" 2014-02-05 23:26:28 +00:00
Erik Bernhardson 425a4a09fa Catch exceptions formatting notifications
Provide users a better user experience by catching and logging
errors with Echo notifications.

Bug: 60906
Change-Id: Iee93a05c6eed468af8bbfa60249df0819c49c45b
2014-02-05 13:55:27 -08:00
jenkins-bot 6857a6e719 Merge "Don't show the overlay if the badge is not near the top of the window" 2014-01-30 01:36:17 +00:00
roopak 57103b8f29 Changed the font size used for subheading in notificatons
Changed the font size of notifications which was earlier too small
and also the accessibility was also too low

Bug: 60239
Change-Id: I20be3cd2277e865ee694070f119999b7b170547c
2014-01-21 18:50:20 +05:30
jenkins-bot 6cd68481bf Merge "Add new messages indicator from a hook" 2014-01-12 15:16:35 +00:00
Bartosz Dziewoński 3dc2b10b78 Don't show the overlay if the badge is not near the top of the window
Bug: 58728
Change-Id: Ia714425078c277d65af99389c95014d87e138e8c
2014-01-12 14:37:32 +00:00
jenkins-bot 3932d39a10 Merge "Make sure the overlay is visible, even if the badge is near the edge" 2014-01-12 14:06:14 +00:00
Bartosz Dziewoński a46fb8ac83 Make sure the overlay is visible, even if the badge is near the edge
We just shift it a bit to fit it on the screen.

Bug: 58728
Change-Id: I61847ed7b9f08ce6618a903bb4f5e0d6afb07e9b
2014-01-12 14:58:27 +01:00
Kunal Mehta 1240492018 Add new messages indicator from a hook
So it works for users without JavaScript

Bug: 56974
Change-Id: I0652a740ca7156257d4459931d80872877339c0d
2014-01-12 03:31:46 +00:00
kaldari f1e0a73abd Add logging support for mobile boolean flag in EchoInteraction
See also: I8db8d3c4eb2bb396195c42073a95ac8530fe869d
Change-Id: I3cb6b9cff91a927b03d30e5f3fec9984cf3f790b
2013-12-24 19:45:51 +00:00
m4tx fb438a1a17 Prevent "Mark as read" and title-overflow text from overlapping
If the echo-overlay-title-overflow text is too long, it's wrapped into multiple lines now.

Bug: 55919
Change-Id: Ib1d252ab26be7d73cbf71c6fb19d84b80d8d30c8
2013-11-30 01:53:59 +01:00
jenkins-bot 4b4e955ae7 Merge "ext.echo.overlay: Unbreak removal logic" 2013-11-10 02:46:46 +00:00
jenkins-bot d810a6f573 Merge "ext.echo.overlay: Various minor consistency fixes and cleanup" 2013-11-09 02:15:36 +00:00
jenkins-bot 55f40efe9d Merge "ext.echo.overlay: Only build the 'mark all as read' button if it's used" 2013-11-05 00:23:02 +00:00
MatmaRex be1cbc4e60 ext.echo.overlay: Unbreak removal logic
Apparently three wrongs make a right: hiding the overlay still worked.

* '#pt-notifications a' click event handler was not correctly checking
  for events comig from inside the overlay due to a missing dot before
  class name
  * But if it were correctly checking, it would not be hiding the
    overlay pokey (just its body) due to a copy-paste error
* Instead the clicks were handled by the 'body' click event handler,
  which did not correctly check for events coming from
  '#pt-notifications a'

I made things right again. The user-facing behavior is the same.

Change-Id: I02aba0e25ba4d81b234b327f120e0e2ff13d117c
2013-11-01 22:38:42 +01:00
MatmaRex c6b65f674a ext.echo.overlay: Various minor consistency fixes and cleanup
Change-Id: Id3b0f4fd7253282b190d6b2ed5fc78b714295e96
2013-11-01 22:15:08 +01:00
MatmaRex 4c8fd7843b ext.echo.overlay: Only build the 'mark all as read' button if it's used
Otherwise a new copy will be created every time the user opens and closes
the popup, and jQuery will hold on to each one forever (because it has
events bound), leaking a minuscule amount of memory.

Change-Id: I70c713be839f826fc27d07b04260c166f9052020
2013-11-01 20:23:05 +01:00
MatmaRex dc1443f57f ext.echo.alert: Restore orange background on Monobook
Core styles for Monobook include high-specificity background: transparent;
rule for #p-personal li a, we need to match it to set our background.

Also change hover behavior: switch to a deeper orange instead of
default white, similarly to how the badge already behaves.

Partially reverts I682182fe.

Bug: 56214
Change-Id: I9f343264c395ecf09c1e34e03d208ec2119fb622
2013-10-27 15:30:22 +01:00
Kunal Mehta 790f4bee9e Remove "Talk:" prefix from "You have new messages"
Bug: 49324
Change-Id: I51d9fc5c891d4489fcb5bce74b0428575f1df7f6
2013-10-21 11:56:20 -07:00
jenkins-bot de93be2b47 Merge "Revert "Notification overlay is partially hidden in RTL language"" 2013-10-16 17:33:31 +00:00
Bartosz Dziewoński 4ad3cb4674 Revert "Notification overlay is partially hidden in RTL language"
Ugly workaround for bug 55779. Let's not do this.

This reverts commit 67bcecff5d.

Bug: 55629
Change-Id: I5f5503aa1d1f7c93b11bf82cfcd73370a991783c
2013-10-16 09:49:09 +00:00
jenkins-bot 2ba05992be Merge "Notification overlay is partially hidden in RTL language" 2013-10-15 15:59:28 +00:00
Ebrahim Byagowi 88937d21c1 Native digits on 'mw-echo-overlay-title-text'
Change-Id: Icdd52ea0267ffbaa0e103070655735eff8423ca1
2013-10-13 19:34:03 +00:00
bsitu 67bcecff5d Notification overlay is partially hidden in RTL language
bug: 55629
Change-Id: I820386379fbea64fb88cfc1a1966ee08680f5c59
2013-10-11 19:06:58 +00:00
Timo Tijhof 72c8aba10e alert: Make selectors less overly specific and clean up js
Follows-up 383a818.

* There is no need for the additional element ("a") or
  descendant ("#pt-mytalk") selector.
  It isn't overrriding anything, only hardcodes details that make
  it harder to maintain or extend this stylesheet. For example,
  there is a gadget that makes  user messages green instead of
  orange, it now was required to hardcode the "#pt-mytalk a" part
  of the selector eventhough those are subject to change.
  Separation of concerns.

* Cache/reuse the jQuery object instead of executing the same
  query to the document, again. It also avoids a potential bug
  where the second query matches different elements (e.g. after
  appending alertMessage, there could potentially be an additional
  nested anchor link; there isn't now though, as the message is
  plain text).

* Add comment about weird echoNewMsgAlertDisplayed variable.

Change-Id: I682182fe15a868969f25fa5bfe2412e2a6f3dddf
2013-10-06 23:52:47 +00:00
bsitu 3b3ed1e3bc Fix some notification badge related issue
* In some languages like persian, the number 0 is represented as '.', we can't compare
  '.' with either 0 or '0' to detect the no-notification status of the badge

* The markread API doesn't respect uselang param, it would return 0 instead of . in a url with uselang=fa

Note: we need to provide raw and formatted count in the API since client side javascript
      doesn't provide fancy function like $wgLang->formatNum()

bug: 54575

Change-Id: I0a49828253ec346ed27c5b9a976f8bdff4e1fa90
2013-10-02 11:25:05 -07:00
kaldari 08fc83b6de Cleaning up Echo 'base' module.
Removing unused functions and declaring correct dependencies.

Targetting to desktop and mobile so it can be used by both.

Also removing dismiss-related code from the formatter.

Change-Id: Icccce64cfb3c564ab468a93ccdba9c5a61687fd5
2013-09-23 11:29:49 -07:00
bsitu 2b57fbd3c2 Split the Echo API into their own write/read APIs
Change-Id: I0ab85c91c6fbe17e9a1c7dc9e504980f629a5065
2013-09-18 14:28:41 -07:00
bsitu 06e7317472 Archive page and overlay should respect ?uselang=xxx
In addition, any message used in the email should be
sent in the user's language.

Bug: 52992
Change-Id: I3585f28d4ec97b86a467958bdfd603791f293d52
2013-09-09 13:44:05 -07:00
jenkins-bot 7591f85e43 Merge "Make items on notifications flyout behave like links" 2013-09-05 17:22:37 +00:00
jenkins-bot 5899f3d4f1 Merge "ext.echo.special: Cross-skin adjustments" 2013-09-04 16:22:47 +00:00
EBernhardson (WMF) e3bdd61952 Merge "Preventing empty payloads from being created when using summary" 2013-09-03 17:40:42 +00:00
kaldari d1463ea6a7 Preventing empty payloads from being created when using summary
Also making sure that footer has some amount of separation from
the notification title even if there is no payload.

Change-Id: I85a1a7989539044a0b0b53e76e70ddee9bb7165c
2013-08-29 15:10:06 -07:00