Commit graph

233 commits

Author SHA1 Message Date
Ed Sanders 1c3ef546ad eslint: Remove old jshint/jscs refs, fix exceptions
Change-Id: I56b9f037405d0f93f82dc81dad1cc1b111be338e
2016-11-19 13:37:20 +00:00
jenkins-bot c3643df69e Merge "Fix padding for toggle button element" 2016-11-17 16:20:06 +00:00
addshore 1e8bfa62fb Fix padding for toggle button element
Bug: T150845
Change-Id: I64b9aa3b547c119410067a98df8dd2574f41e0b7
2016-11-17 15:43:26 +00:00
addshore ccc6905a05 Fix / Change autoexpand metric name
.'s in a metric name can essentially be thought of
as directories.

When building graphs from this data an * can be used to
match everything in a directory, for example:
MediaWiki.RevisionSlider.event.*

As these 2 events held another . in their name they
would ont be matched by the abov wild card, so instead use
a _ so that they will!

Change-Id: I1dce9253eb9d4ccb99516683897564e14bb9a577
2016-11-17 11:02:26 +00:00
addshore fc213c8880 Flip toggle button in 2 missing cases
- The first case is when the slider is collapsed and the auto
   expand is switched on, the slider expands and now the toggle
   switches.
 - The second case is when the slider is loaded expanded, the toggle
   now loads in the correct direction

Bug: T150846
Change-Id: I75610308c9f169fb926953a12dc5108e0fba23bf
2016-11-17 10:59:40 +00:00
WMDE-Fisch f17850d6e6 Clean up logging in code
Change-Id: Iad9f6846f9a80e7c6e82d930f643a92c8f42cab6
2016-11-16 15:42:04 +01:00
James D. Forrester 3269f791f5 build: Bump eslint-config-wikimedia to v0.3.0 and make pass
Change-Id: I774e05c4393eca8b4719f335a124efcb3d2a6dd5
2016-11-15 16:48:38 -08:00
WMDE-Fisch a8a129d627 Move lines into container
Bug: T149175
Change-Id: I4e231ff450661eaeaabae0fd2883914bb62101dc
2016-11-08 15:45:59 +01:00
WMDE-Fisch df9d94ca60 Draw lines between pointers and related columns
Introducing a new class that draws lines between the pointers
and the related diff columns. Lines are redrawn when pointers
were moved. A colored border is added to the diff columns and
readded when the diff changes.

Bug: T149175
Change-Id: Iadf779368c58da7779c769bda8e9bd3fc5afcffa
2016-11-08 13:46:14 +01:00
jenkins-bot bf9cde5d66 Merge "Remove negative margin" 2016-11-03 12:23:40 +00:00
WMDE-Fisch 6f8e23f7d9 Remove negative margin
The top pointer hovers a few pixel over the slider line. Thats
not intended.

Change-Id: I5424ea72ccf2828d638c1fc4e9e2e345ba7bf94e
2016-11-03 13:00:40 +01:00
Tobias Gritschacher 1bef050429 Add margin to pin button
This also fixes the "border-overlapping-issue" when hovering
the pin button in Chrome.

Bug: T145726
Bug: T145519
Change-Id: I6d3788ca5f54937f84c6a7f0fcc456ddf4b665d7
2016-11-02 14:16:02 +01:00
WMDE-Fisch 300c552334 Store settings for anonymous users
Introducing the Settings class handling settings for all users.
Use hidden user prefs for logged-in users and localStorage or
cookies for anonymous users.

Bug: T145494
Change-Id: I8676873c87d5656c55365706f1ccefa604caae4d
2016-10-24 16:46:42 +02:00
addshore 1e1c2f5943 Don't nest mw-content-text element when reloading diff
Bug: T144391
Change-Id: I5763c6c4288bfcfef03df0cd949715d21430c9af
2016-10-24 09:53:08 +01:00
Ed Sanders 62c5b4cff9 Prevent selecting the same revision twice
Bug: T141254
Change-Id: Ic51605dca1484ce66ce9764a2291c8a947f9d376
2016-10-14 10:25:10 -07:00
Ed Sanders 79c0305b09 Throttle the window resize event handler
Drag-resizing a window results in hundreds of events being fired,
so limit this to one event every 250ms.

Change-Id: Ie3ace9001cd840a5d790cd269c4ae3c77649079a
2016-10-14 08:25:35 +00:00
jenkins-bot 64f6724128 Merge "Avoid parseInt" 2016-10-14 08:25:30 +00:00
jenkins-bot ef111d2342 Merge "Compute and cache directionality once" 2016-10-14 08:25:29 +00:00
Ed Sanders a020b238e9 Avoid parseInt
Where we know the number contains only numerals, just cast
straight to a number using '+' operator. When getting computed
css from jQuery, use more suitable position methods instead.

Change-Id: Ia58b41a4522a1ef5a1516852821573c47e8dc9c9
2016-10-13 11:58:55 -07:00
WMDE-Fisch 8fef5ac005 Fix order when executing pointer update
This should always happen before updating the diff.

Change-Id: Icf6b52c3495e42e188bfa5d5307f91d0558cc7a4
2016-10-13 16:51:11 +02:00
Ed Sanders d728cda396 Compute and cache directionality once
Computed CSS ($.css) is relatively slow, and directionality
should never change, so just compute it once.

Change-Id: I6519fa7f54599c498e22a348dfaedd940c860955
2016-10-12 21:07:28 -07:00
Tobias Gritschacher da8f7fb064 Update pointer position attributes immediately
Update attributes right after setting position and
don't wait until revisions are refreshed.

Change-Id: Ic32a554d6939806ce95d4e7b441ee08965b81940
2016-10-12 15:31:38 +02:00
Tobias Gritschacher 70ea8fafda Always apply data-pos attribute to pointers as well
Adding position data-attribute to the pointer elements and always
apply the same value as for the revision bars they are pointing to.

This will allow us to reduce the complexity of browsertests.

Bug: T146276
Change-Id: I6e6db55204b0c45fe94a5173e297a67a7ed38d00
2016-10-10 14:52:45 +00:00
Tobias Gritschacher 4872d31669 Add fixed padding for scrollbar
This is not very nice but the simplest I was able to come up with.

Bug: T144267
Change-Id: I959c8e6e7aa053f372455b1ec4ed5768a02d8b5d
2016-09-28 14:27:51 +02:00
jenkins-bot 82a7af9be5 Merge "Fix pin button style" 2016-09-26 08:20:06 +00:00
addshore 5c9b9f7eb4 Fix pin button style
Bug: T145519
Change-Id: I1fdc0ec32b223732d59640a6462758c59b99ebac
2016-09-20 12:35:30 +02:00
Ed Sanders a97c4d1c0e Use word-break to avoid horizontal scrollbars inside popups
Bug: T144267
Change-Id: If946b2a71dfede4cf33a513b3fad974517d4359f
2016-09-19 17:36:10 -07:00
jenkins-bot a79bccf2ea Merge "Close HelpDialouge when clicking away from it" 2016-09-15 10:14:33 +00:00
addshore 22556fcf16 Close HelpDialouge when clicking away from it
Bug: T145525
Change-Id: Ia21d5163f561ede4f327eec3a4aaf7c34d103094
2016-09-15 12:01:08 +02:00
jenkins-bot dec6b85652 Merge "Fire wikipage.diff instead of revslider.diffreload" 2016-09-15 09:04:54 +00:00
jenkins-bot cce4ff706c Merge "Expand Revision Slider when user activates pin button" 2016-09-14 09:18:42 +00:00
jenkins-bot 9aabbb4ae4 Merge "Fix position from top of tuitorial" 2016-09-13 16:07:20 +00:00
addshore 42917b1821 Fix position from top of tuitorial
Bug: T145526
Change-Id: Id7d344c946dd0e66d1ed2fd639ebbb1edf06b913
2016-09-13 15:56:49 +00:00
Tobi Gritschacher a3244e1805 Expand Revision Slider when user activates pin button
Bug: T145068
Change-Id: I26bd6d3cbd2e0da6e3d537431a45ef8193906c40
2016-09-13 16:05:01 +02:00
addshore 5fbe86fc0f Fire wikipage.diff instead of revslider.diffreload
Also add a note to the console about WikEdDiff
& RevisionSlider interaction and the required code
change.

As the code change uses the wikipage.diff hook the code
change will actually have no effect until this patch
is deployed, which includes the removal of the hack
for WikEdDiff.

Bug: T142636
Change-Id: Ie88021abb2325cc6259cf2fb041fbdca4ae9ca89
Depends-On: Ie488021f5d0e314a8ad6c8d1f1f3d936c427d719
2016-09-13 10:37:51 +02:00
addshore c8cd4c5fb4 Only show pin button to logged in users
When the extension is used without the BetaFeatures
extension it is possible to use while not logged in.

Anon users can not have a user preference set.
Thus anon users should not be shown the pin icon.

It may be an idea to add a cookie for anon users
later down the line.

Change-Id: Iafeacf6ae9e24b3134f1c180d390cfad4245719a
2016-09-12 12:45:35 +02:00
jenkins-bot f068f9b684 Merge "Revert "Do not nest mw-content-text element when reloading a diff"" 2016-09-07 07:58:45 +00:00
Addshore b6906e70f1 Revert "Do not nest mw-content-text element when reloading a diff"
This reverts commit a6c5c5a81c.

Change-Id: Iba8e287e200ece043fe6e0ebed960b5d9e522236
2016-09-07 07:15:28 +00:00
jenkins-bot 90455594e6 Merge "Temporarily trigger revslider.diffreload to re-add Thanks JS code" 2016-09-06 16:42:32 +00:00
jenkins-bot d1148c49c5 Merge "Fix position of pointers in RTL mode" 2016-09-06 16:42:31 +00:00
jenkins-bot 86f62f85c5 Merge "Do not nest mw-content-text element when reloading a diff" 2016-09-06 16:42:31 +00:00
Leszek Manicki 08afa590de Fix position of pointers in RTL mode
Apparently after some recent changes, pointers in RTL UI were a bit off

Change-Id: Idae3b043d1d596c36b59b784b0a24fd0b9da76d3
2016-09-06 18:03:11 +02:00
Leszek Manicki a6c5c5a81c Do not nest mw-content-text element when reloading a diff
Bug: T144391
Change-Id: I1ac8c5f31a5e0c34913ba37676f5b3a89aa4db35
2016-09-06 18:01:12 +02:00
Leszek Manicki 9581a55ba2 Temporarily trigger revslider.diffreload to re-add Thanks JS code
In order to properly fix problems reported in T142636, core hook
triggered on diff change (on diff page) will be added in
I5aad7cc10a0db869d7c25d41f7db056885dad69b.
When that change is merged, Thanks extension will be listening
to this hook and not to RevisionSlider-specific revslider.diffreload.

This adds temporary code fixing RevisionSlider's and Thanks' interaction
before hook introduced in I5aad7cc10a0db869d7c25d41f7db056885dad69b is
available. After it gets merged, the code added here should be replaced
by firing the new core hook.

Change-Id: I5dd6c592165ed30244ac8bff37bb6e4949c8bc4a
2016-09-06 18:00:02 +02:00
Leszek Manicki effe850b57 Add temporary code to re-add WikEdDiff gadget after reloading a diff
Bug: T143199
Change-Id: If839acfc86bc3640b91d37211b56bd62df2f210d
2016-09-06 17:52:58 +02:00
Leszek Manicki 8e7fe2434d Add eslint, to be used instead of jscs and/or jshint
First I jumped on replacing both jscs and jshint with eslint but
it might be premature decision. Although linting with eslint
is possible (like in there is wikimedia config for eslint)
it is still not clear should it

But in case the change happens we will be ready.

Apart from config stuff this changes few bits spotted by eslint:
improves some indentation, removes weird spaces, completes some
doc blocks, changes IIFE forms in tests. These changes do not
seem controversial.

Change-Id: I9f8bf0f5745da8e662685f4cd879ea4baa609c01
2016-09-05 09:47:11 +02:00
jenkins-bot ea9c83aa80 Merge "Close tooltips when clicking somewhere outside of them" 2016-09-01 12:42:16 +00:00
jenkins-bot 50313505fd Merge "Avoid having multiple revision tooltips at once" 2016-09-01 12:38:50 +00:00
WMDE-Fisch 9be2aa5a56 Close tooltips when clicking somewhere outside of them
Added the revisions to the exception to avoid tooltips beeing
closed and opened again when clicking on a revision-bar to
load it.

Bug: T143090
Change-Id: Ib8011a52c469ad715e97c1c42e7489c5b31aa4a8
2016-09-01 13:25:24 +02:00
WMDE-Fisch 2277651f44 Avoid having multiple revision tooltips at once
When rendering several RevisionListView items e.g. by loading and adding
more revisions each one had its own 'currentTooltip' so the elements
where not exclusive. This patch fixes that by looking for the class
objects when closing tooltips or changing wrapper highlighting.

Tooltip timeouts are still per-list but that should not affect the
behavior with multiple lists.

Bug: T143090
Change-Id: I23c61547e1a925da1c0b7e7a475ad61e6ed1b1b6
2016-09-01 13:18:12 +02:00