Commit graph

1625 commits

Author SHA1 Message Date
jdlrobson bf8485b6c7 Hygiene: Pull out event handler for display of Hovercards
* Make it clearer what event is being bound, consistent with
onLinkClick and onLinkAbandon
* Don't create event data twice
* Refactor to reduce function size

Change-Id: Ie4368531612a2829ad191629410ba548eadb2007
2016-10-13 15:59:29 -07:00
Ed Sanders 469d3e7f02 Update beta feature screenshots to use proper layout and colours
Bug: T144428
Change-Id: Ic97bed840c5e9c34a4c8e81a2148e2a0af4ed286
2016-10-12 15:32:21 -07:00
jdlrobson aa5e622ca0 Event handlers should not be exposed globally
Bug: T147306
Change-Id: Ib0bae3e7c2e420a4b717391d4a25473a3a9f9128
2016-10-12 14:58:17 -07:00
Translation updater bot 945920f33e Localisation updates from https://translatewiki.net.
Change-Id: Iecd06481e59285c6ccec8e4ad85c968c1869a768
2016-10-11 22:47:51 +02:00
Translation updater bot fe66ae3940 Localisation updates from https://translatewiki.net.
Change-Id: I7bf5458880af0e54bb9eda99949032438bfc8663
2016-10-05 22:44:01 +02:00
jenkins-bot 46274a5518 Merge "Regression: correctly log the click action total interaction time" 2016-10-04 10:23:46 +00:00
jenkins-bot fcde4eaed5 Merge "EventLogging sampling rate should default to 0" 2016-10-04 10:18:21 +00:00
jenkins-bot 66d8daddba Merge "Regression: Correctly log total interaction time for dismiss event" 2016-10-03 11:09:52 +00:00
Baha 3c0ea0f9cd Regression: correctly log the click action total interaction time
Per T143051, hovercards was asked to be closed after the user clicks on
the hovercard (or the link that showed it). Closing the popup before
logging the `click` event causes `logData` to be lost. This patch logs
the data first and then clears it.

The regression was introduced in Ifd6f75c2a53d8d7b5ef9fd3f232f85b55eea24c8.

Also do not attempt closing a popup when it may not be open.

Bug: T146934
Change-Id: I02febc83036130bcea0a769114c9126cb481bafe
2016-09-30 12:03:09 +00:00
Baha ae96fddb40 Regression: Correctly log total interaction time for dismiss event
Per T143051, hovercards was asked to be closed after the user clicks on
the hovercard (or the link that showed it). Doing so before logging the
`dismiss` event caused `logData` to be lost. This patch logs the data first
and the clears it.

The regression was introduced in I3f3c4780cc31dc8d84cdd76df2c77fa45fbea882

Bug: T146927
Change-Id: Ie965d43b04962b2dbe2d15caa4c14bf62d1e39ea
2016-09-30 08:02:05 -04:00
Prateek Saxena 898648dfa2 settings: Use mw-ui-progressive instead of progressive buttons
Bug: T146923
Change-Id: I35078d5f61afb368ff3fc37e2f9cf0986bed2294
2016-09-29 18:47:00 +05:30
jdlrobson f974a024f4 Clicking a Hovercards legible link should close popup
A click event is used to capture links that may be clicked via
the keyboard.

Bug: T143051
Change-Id: Ifd6f75c2a53d8d7b5ef9fd3f232f85b55eea24c8
2016-09-23 21:01:50 +00:00
jdlrobson 9f92324b4d Dismiss event should not be tied to render method
The dismiss event is currently a side effect of closing a popup.
This should be more closely coupled with the event that causes it.

This allows the closePopup method to be called without trigging
an event which is a necessary precursor to closing popups when
navigating away from the page.

Change-Id: I3f3c4780cc31dc8d84cdd76df2c77fa45fbea882
2016-09-23 20:56:46 +00:00
jdlrobson 25fabbf5f4 Hygiene: Only allow calls to closePopup on an active link
Change-Id: I7c15870e1586aa8629af723accad67dee5483369
2016-09-23 20:27:41 +00:00
jdlrobson 5a226ebd39 Hygiene: Add set and get methods for active link
Named functions help explain to a reader and reviewer what the code
is actually doing.

Change-Id: I1d059c9270fd2298285fa5e4e52e403a06f35503
2016-09-23 11:01:21 -07:00
jdlrobson da5d61e485 Improve documentation for render methods
The parameter types are incorrect and this leads to confusion
Use $ prefix for $link parameter to make clear it is a jQuery.Object

Change-Id: I3f98f3729cd06aedd791e7503233082c1402dc95
2016-09-22 15:28:57 -07:00
jenkins-bot 5520c6c4ac Merge "Merge mw.popups.experiment into mw.popups.core" 2016-09-21 22:31:39 +00:00
jenkins-bot 98d76e2591 Merge "Minor refactor - use named function for wikipage.content hook" 2016-09-21 21:34:28 +00:00
jdlrobson 523213466e Minor refactor - use named function for wikipage.content hook
The handler for the hook `wikipage.content` was long
and undocumented but is a crucial piece of code.

To make it a little easier for people not so familiar with the code
to find this code and understand what it does I've pulled it out into
a named function.

Change-Id: I3ada53e135dea7dc6846440999b0d42285e14013
2016-09-21 14:23:25 -07:00
Sam Smith 0b2961c318 Merge mw.popups.experiment into mw.popups.core
ext.popups.experiment depends on .core as it initialized the mw.popups
namespace and .core depends on .experiments for
mw.popups#getEnabledState.

By merging the experiment module into core, we can eliminate any
circular dependencies.

Changes:
* Move ext.popups.experiment.js code into ext.popups.core.js
* Remove mw.popups.experiment module and any references to it

Note: ext.popups.experiment.test.js was left in its own file for cleaner
QUnit module setups and easier removal later. I'm not entirely happy
with doing it this way, but I'm not sure changing the mw.config within
the mw.popups.core QUnit module is worth merging the files.

Bug: T146035
Change-Id: I1f024567010acaa61c1d613c6e59c998198a5976
2016-09-21 16:43:49 -04:00
joakin 8f001ee4bd Respect beta feature flag for logged in users
Both in active and inactive state (not just active like before).

Bug: T146017
Change-Id: Ieb4cd39c2870fb701cabd0f1d01c0ab42b6ebe78
2016-09-20 17:48:39 +02:00
jhobs c9c82828d0 EventLogging sampling rate should default to 0
The EventLogging sampling rate should be set in the wiki config.

Bug: T136746
Change-Id: I7a954edf00e56b426f94f39d39c19cbc338186d6
2016-09-16 12:27:58 -04:00
joakin d0d10f51bb Update Schema to the last version
Which has updated docs about the min dwell interaction time.

Everything else stays the same.

See https://meta.wikimedia.org/wiki/Schema:Popups

Bug: T145379
Change-Id: Iae5da98cfc3f2290aa93aa04effab016b5d700b4
2016-09-14 14:52:33 -04:00
joakin 9787f515d0 Log all dwelledButAbandoned events
Extract the minimum interaction time of dwelledButAbandoned events to
a unique place: mw.popups.render.DWELL_EVENTS_MIN_INTERACTION_TIME

Lower that interaction time to 0 so that all dwelledButAbandoned events
are logged.

Bug: T145379
Change-Id: Id68183367966b9f0d52e0cd570cab64671a3e87e
2016-09-14 14:50:39 -04:00
joakin eb852cacd5 Fix enabling/disabling browser tests
features/popups_settings.feature:33 seems to fail because of quick
interactions after disabling+enabling hovercards.

Setting a sleep 1 after disabling and enabling hovercards (to allow the
page to start refreshing) makes the tests more resilient

Bug: T145152
Change-Id: Iaf66aaf0e2c4f8e55419d22889f91a02891e49a1
2016-09-14 16:42:56 +00:00
Alex Monk 5574c98628 Follow-up I6dac2911: ext.popups.core depends on mediawiki.storage
To stop TypeError: Cannot read property 'get' of undefined in
Object.mw.popups.getEnabledState

Change-Id: I8fb648e1e6a4921ba04752a4314cb5937485ac01
2016-09-08 17:40:01 +01:00
Translation updater bot 5180dd6de3 Localisation updates from https://translatewiki.net.
Change-Id: I99980fd55da0e826c25fd83a1e51e8229c57792b
2016-09-07 22:45:35 +02:00
Translation updater bot 1a708bd6db Localisation updates from https://translatewiki.net.
Change-Id: I1f6c36f0939d89ae2e8949fbf62b3bf1b50fca69
2016-09-04 00:23:59 +02:00
Translation updater bot 010b0417a8 Localisation updates from https://translatewiki.net.
Change-Id: If89d2beaae917e4488010f41462fbea241f1fb30
2016-09-01 23:26:35 +02:00
jenkins-bot 994b14c16b Merge "Do not log the click event multiple times" 2016-08-31 10:29:32 +00:00
Translation updater bot 023943eb8a Localisation updates from https://translatewiki.net.
Change-Id: Ib0e278269b8be88671ad06851a4a1c1273349221
2016-08-29 22:38:41 +02:00
Baha 1d71b3d9bd Do not log the click event multiple times
When hovercards are off clicking of a link will log the click
event as many times as you hovered over the link prior to clicking.
To prevent this, stop listening to old events before listening to
new ones.

Bug: T143805
Change-Id: I3e0dd2d1f259cdadfd3e02c67a137697540ca955
2016-08-29 14:33:21 -04:00
Translation updater bot fb0306469f Localisation updates from https://translatewiki.net.
Change-Id: I4bcf2a8b62dd041a8df58aa5e0d0e6bffe342410
2016-08-28 22:40:43 +02:00
Translation updater bot 004c645ea3 Localisation updates from https://translatewiki.net.
Change-Id: I5479769f1ddae50be5cf209dada6df32c4b63e6e
2016-08-25 22:38:22 +02:00
Translation updater bot ff4281cdb7 Localisation updates from https://translatewiki.net.
Change-Id: Ifb81ddd701006c210a56effdf325843cc4d89302
2016-08-24 22:38:10 +02:00
Translation updater bot a4ec6b28f0 Localisation updates from https://translatewiki.net.
Change-Id: I47c2c106b2420d8be756b984acdafa0b24dd5e0d
2016-08-24 10:35:37 +02:00
Translation updater bot 053d9c14ac Localisation updates from https://translatewiki.net.
Change-Id: I37a82774677bdf89c20bebdf9bcdce383f8ae375
2016-08-21 22:53:58 +02:00
Translation updater bot 06081b13e8 Localisation updates from https://translatewiki.net.
Change-Id: I1cdcd4551a016dc81a9c8892b67ad01a42762aa0
2016-08-19 22:41:58 +02:00
Translation updater bot dabbadf956 Localisation updates from https://translatewiki.net.
Change-Id: Ib2a6a9ab41f5ebdb69152bcd54f3c2166e4ad125
2016-08-17 22:40:47 +02:00
jenkins-bot 193b8dd9f3 Merge "Remove jQuery.jStorage shim" 2016-08-16 23:00:27 +00:00
Translation updater bot c8f5002792 Localisation updates from https://translatewiki.net.
Change-Id: I2c92576c2ce4602e024f8f65c740677f16a4ce2d
2016-08-16 22:44:37 +02:00
Sam Smith 0ad88a2416 Remove jQuery.jStorage shim
Per the FIXME above, it should've been removed midway through June.

Bug: T136241
Change-Id: I10723f9067c2573786270cd40fe012adb8c19c8b
2016-08-16 13:47:05 +01:00
Translation updater bot fb0e580d01 Localisation updates from https://translatewiki.net.
Change-Id: I1b7c1c0c58d1e5a2afd02e375e515e75fb27f6be
2016-08-15 23:01:03 +02:00
Translation updater bot defed308a5 Localisation updates from https://translatewiki.net.
Change-Id: If0dd533cce1d247d9c699b4490f63977bb1de39b
2016-08-14 22:29:03 +02:00
Translation updater bot dc191edb0b Localisation updates from https://translatewiki.net.
Change-Id: Iee8a7960a52ab499ada125ef265407cbc7a990e3
2016-08-12 23:14:12 +02:00
Translation updater bot 974368b396 Localisation updates from https://translatewiki.net.
Change-Id: Ie3173d98adb0f24fecc1b1025f853158fa28bc1c
2016-08-11 23:57:14 +02:00
jhobs 672e67d7fc Fix settings dialog layout on IE
Bug: T138612
Change-Id: I6f530c12dd498705b1797faf820cb5e620c81853
2016-08-11 15:42:15 +00:00
Translation updater bot 988beaa221 Localisation updates from https://translatewiki.net.
Change-Id: I90fda465bf198a74c6a255f3fd8f9d037b0fbdc5
2016-08-10 22:38:42 +02:00
Volker E 0282b9648f Hovercards: Improve layout of settings dialog to design spec
Improving Hovercards' settings dialog to fulfill design specification.
Also fixing HTML structure by removing invalid `radiogroup` element and
adding missing `</div>` element, fixing related QUnit test.

Changes:
 * Add close icon instead of using text
 * Style header as a table for alignment
 * Remove redundant "OK" button and have it replace "Save" instead
 * Update text of "OK" button to "Done"
 * Fix description for translation of "Done" button
 * Fix qunit and selenium tests
 * Remove unnecessary markup and less
 * Add mediawiki-ui-button and mediawiki-ui-icon dependencies
 * Shrink dialog width some per design spec
 * Fix dialog horizontal position calculation to remove hard-coded value

Bug: T138612
Change-Id: I7395e3438836149becdd576942bdaf6f21b4163f
2016-08-10 14:01:36 -04:00
Translation updater bot b7962f1c6a Localisation updates from https://translatewiki.net.
Change-Id: I3adec844baa83c4b4f39406249ff0e48ba906dcf
2016-08-02 22:44:50 +02:00