Commit graph

109 commits

Author SHA1 Message Date
Addshore b86be90b06 Reintroduce improved hover and bar clicking
This patch mainly reintroduces the option to click on bars and move
the pointers with it. To do this, 'ghost' pointers are introduced
to show what would happen when bars are clicked. The pointers moved
differ depending on where the user clicks on a bar. Pointers are
still not allowed to change positions, so in some cases booth pointers
move with one click. See the task description.

The patch also includes some renaming and also refactoring of the
click handling in general. Furthermore bar hover mechanics are handled
by the RevisionListView class now.

Moving both pointers is not possible when it would push one of them of
limits.

Bug: T172092, T173566
Change-Id: I32a8256f7667e03081324d54accdf03a17454faf
2017-08-29 09:19:13 +00:00
jenkins-bot c13e687cb0 Merge "Revert "Reintroduce hover and bar clicking"" 2017-08-17 14:08:22 +00:00
WMDE-Fisch 1d2811f3d9 Revert "Reintroduce hover and bar clicking"
We want to make an announcement first.

This reverts commit 0da5702f82.

Change-Id: Icbf5fb99c3fbb87a47106e25d9d80685e86cba32
2017-08-17 13:52:53 +00:00
mdew192837 61e5d029cd Fix unnecessary reloading of diff
Currently, when dragging a pointer over another revision but not
releasing it until it is at the same location, the diff still reloads
This change stores the initial positions and comparing at the end.

Bug: T163425
Change-Id: I430650d12bfeb3ce4af59abe91f18cc2b861a3de
2017-08-12 10:45:16 -05:00
WMDE-Fisch 0da5702f82 Reintroduce hover and bar clicking
Bug: T172092
Change-Id: I496143f2425eccd0028cc1980fc7189a457c70a2
2017-08-11 17:54:48 +02:00
Ed Sanders b1f2613d79 Use core wgDiffOldId/wgDiffNewId JS config values
Newly introduced in a469795efc5bc1c585c9f84ee289ee099833661d.
This will require MediaWiki 1.30.

Change-Id: I9897a77b24e258bf037f8ec6cafa1d0684bf867d
2017-07-18 16:16:05 +00:00
WMDE-Fisch cf5d602a53 Update eslint and fix issues
Change-Id: I0e3ad763398430608c30bb22741a57c81b2b7062
2017-07-14 12:28:45 +02:00
WMDE-Fisch ab874bdd57 Improve doc, naming and pointer updates
Several improvments including documentation, naming and refactoring:
- bundeling of methods setting, redrawing and loading new diffs
- renamed and improved documentation around some methods in that area
- fixed some leftovers from past refactoring not using new methods

Change-Id: Idf1afcd6ce9210951d28655128a47150f6b7a2aa
2017-07-14 10:19:33 +00:00
WMDE-Fisch 553e48e65a Move scrollType detection to utils
Change-Id: I465e0b74a7d7a6682b22bdd6e7aafb794bce9b24
2017-07-14 10:19:28 +00:00
WMDE-Fisch ada6498b81 Move data pos attr to PointerView
Change-Id: I46c3dceaddae84b279625caec3349aa10d931048
2017-07-14 12:18:51 +02:00
WMDE-Fisch 60f29e11cc Let pointers block each other at the ends of the slider
Bug: T168265
Change-Id: I072e0ddd5f6ab19f5676a0910ffa2e10c258a4a1
2017-07-11 12:37:01 +02:00
WMDE-Fisch 4a9ee131d3 Refactor pointer class names
Pointers can always be identified as the pointer for the "older" and
"newer" revisions. Class nameing was cleaned up and changed accordingly.

Change-Id: Id17878e780b5a405b196fdc5ec7429eeaef5bd4c
2017-07-11 10:17:24 +02:00
WMDE-Fisch 90d90a2f3c Refactor pointer position access
Pointers do not change roles anymore. Older and Newer pointer will
always stay the same. Removed and refactored some logic in that
regard.

Change-Id: I60cf58fb9d0728a9644ed29cac335ebbe7f3de11
2017-07-11 00:42:36 +02:00
WMDE-Fisch 94f9daef82 Minor optimisation and clean up
- reused jquery element
- removed unused method
- fixed doc type
- merged some css

Change-Id: Iadd9d7cb464691b39b7c251b401f687b3d5008b3
2017-07-10 22:41:43 +00:00
WMDE-Fisch d299926ff9 Merge/Remove revisionWrapperClickHandler code
Change-Id: I1060f94d81dcfcf4457cea27e71a5d92c22a2186
2017-07-04 12:16:57 +00:00
WMDE-Fisch 05925e3ab0 Merge remaining pointer methods
Change-Id: I89562e445481b9785cf18e02ea02040105632af7
2017-07-04 12:16:49 +00:00
WMDE-Fisch c6f24f2100 Merge container and pointer building and dependencies
Change-Id: I52ac8b42e39b3a37c0bac6b7fff5a676d7c2ecfe
2017-07-04 14:02:58 +02:00
WMDE-Fisch fc5c13f359 Merge draggableDragAction and dependencies
Also temporarily deactivate browser tests for bar clicking.

Change-Id: I347533ef445cb3c37e420beebcc79919e56a1223
2017-07-04 10:56:40 +00:00
WMDE-Fisch 6ffe96bc4c Fix errors leading to wrong slider scroll postions
The detection touched in this patch addresses slightly different
kinds of RTL handling in browsers. The detection how things are
handled seems to be broken in the mentioned Chrome V8 versions.

The workaround takes care of that issue. With Chrome V8 6.0 this
should be fixed and the workaround can be removed.

P.S.: Credits to Leszek for the idea what's actually going on.

Bug: T168299
Change-Id: I068c2fb6ba60189004c0ec6661fcd346af16126c
2017-06-21 15:21:08 +02:00
WMDE-Fisch 0525f0bdb2 Do not assume that revIds increase in time
This patch fixes issues with the RevisonSlider assuming that the higher
revision id belongs to the newer revision. Min/Max methods to decide what
the diff and what the oldid is are removed and the usage of methods is
adjusted accordingly.

Also the test for switchover pointers is removed since this will not work
with the patch.

Bug: T164455
Change-Id: If5d9cbb8ebd872aee376d249942e6881c8edb984
2017-06-01 18:29:22 +02:00
pppery 4ed9851610 Fix handling of escape key
Previously, pressing ESC aborted the dragging of the slider, but this
was broken by I64cca7a7547310bee64ad95f500b722c362bbb45, which refactored
uses of a variable that was previously a closure into two separate functions.

Bug: T140965
Change-Id: I6b7bc383128d8c7d99da469706bff881f1329cd9
2017-05-22 15:22:55 -04:00
WMDE-Fisch 31b9fe31ef Convert touch events to mouse events on pointers
This will make the pointers work on touch devices. The events responsible
for the touch drag and move are converted to mouse actions that will
trigger the draggable.

When using Chrome on touch devices and zooming the offset of elements
calculated by jQuery is wrong. There is a workaround that seems to work
and also seems to not break behavior with normal browsers and on other
devices. Since this only seems to be a problem in Chrome the fix will
only applied to Chrome browsers to avoid performance los on others.

Also introduced a script file for static utility methods.

Bug: T164249
Change-Id: I245f77eb836afded249f3b5ebb7129dab08d0017
2017-05-08 12:55:31 +02:00
Ed Sanders c6465dee07 build: Update eslint to 0.4.0 and make pass
Change-Id: I6e3e2f30615996c57650127cde9738d3a6dd9ae5
2017-05-04 21:06:08 +00:00
jenkins-bot 095c3ea863 Merge "Throw errors, not strings" 2017-05-03 09:33:09 +00:00
Ed Sanders 4e9689ce36 Throw errors, not strings
Change-Id: I65bad18f2526283ba426aed8ff7da9121f230770
2017-05-03 09:47:14 +01:00
WMDE-Fisch 9e6f44cb06 Tooltips when hovering slider lines in the SliderViewTwo
This change enables tooltips when hovering the slider lines. To avoid
interference of these events when dragging a variable is set to keep
track of the dragging state.

Bug: T162602
Change-Id: I45c1b73ca470d7b8fcf8b95e15187864e35e907f
2017-04-19 11:26:51 +00:00
WMDE-Fisch 177d6a1bd1 Factored out drag action from draggable
As preperation for tooltip and hover color changes while dragging in
the new SliderView.

Change-Id: I679fc1b6fb5f69d27f6dee0aafd168493dc33957
2017-04-06 13:47:59 +02:00
WMDE-Fisch c52c657516 Introduce alternate SliderView
Adding a new class for an alternative slider view with
one slider for each pointer. The new class will be used
when the extension is installed as a beta feature.

Each pointer has now its own pointer container visualized
with a thin line. Pointers can not change places anymore
and methods doing so where overwritten in the patch.

Selected revisions are not colored atm to better distinguish
between pointers and bars. Poiner lines are now shown above
the bars. ( as from feedback in the last PM session )

Some issues with the design might remain. But since we plan
the deployment anyway next week this could be merged if reviewed. 

Bug: T160410
Change-Id: If00c31e30f8a01f3525b191c70605b9c9381671d
2017-04-06 07:29:19 +00:00
WMDE-Fisch 040dd9c945 Factor out setting of cursor pointers
Change-Id: Idb66dcd1daeff48dcce3a39be32eae7c8e17acc8
2017-04-06 07:29:12 +00:00
WMDE-Fisch f978f8690c Fade out pointer lines while dragging / pointer animations
Bug: T162259
Change-Id: I54d6a9bc33b93c0785b2a808b4d1482789d91317
2017-04-06 07:29:02 +00:00
WMDE-Fisch a72b31b280 Renamed container offset variable
Change-Id: I6fc2d51f5a591dcf4898abb1ae010a433131a0d9
2017-04-03 11:05:51 +02:00
jenkins-bot 16d9e74760 Merge "Move arrow button logic to own class" 2017-03-27 22:45:37 +00:00
jenkins-bot 7abac9b03e Merge "Move helper button logic to own class" 2017-03-27 22:44:09 +00:00
WMDE-Fisch b0227f24b4 Renamed firstVisibleRevision to oldestVisibleRevison
The meaning of first in this context was totally unclear and not
very usefull. It turns out, that the "first" revision is always
the oldest and the last is always the newest revision.

Change-Id: I009438777908a5f4a8833f8f5cb7d3041057741c
2017-03-27 21:04:31 +02:00
WMDE-Fisch 97c85abdf2 Move arrow button logic to own class
Change-Id: I56e52d8b11f8557d759dc495512d9754e8f441f6
2017-03-27 18:56:59 +00:00
WMDE-Fisch 7e277fbd9d Move helper button logic to own class
Change-Id: I8fdfeb3344974b3cee7ce07bcf2ceea9308fffe6
2017-03-27 18:56:34 +00:00
WMDE-Fisch 277d714ec3 Factor out relative pointer index
Change-Id: If0843bea19089c1a91228a0c01f8ac65e44f7f3f
2017-03-23 17:54:12 +01:00
WMDE-Fisch c2510ab082 Factor out draggable options
Change-Id: I64cca7a7547310bee64ad95f500b722c362bbb45
2017-03-23 17:42:49 +01:00
WMDE-Fisch c01d07bc1f Add documentation for new methods
Also some minor refactoring in the pointer method.

Change-Id: I986036277d2b6e65cbed9f39c81f9f03ad0e9e3c
2017-03-23 12:46:24 +01:00
WMDE-Fisch 981e9d4a7e Bundle slider construction
Change-Id: I7202755ee49d1cb42d68f997750170defdc3304c
2017-03-22 18:56:11 +01:00
WMDE-Fisch 394f812d9b Extract pointer rendering
Change-Id: I9e0200faf477c2c9476574059c46d1f8b003537b
2017-03-22 13:32:17 +00:00
WMDE-Fisch 06bb204fac Extract pointer and revisions container rendering
Change-Id: I2f65a173c2020a5a0ed276d064f0a45104982497
2017-03-22 13:32:10 +00:00
WMDE-Fisch 9c80fda6f8 Extract rendering of arrows
Change-Id: Ie639cca4bfcd3fe3f8b81556d900dbcdc3232f83
2017-03-22 13:32:02 +00:00
WMDE-Fisch e611e40833 Extract rendering of help button
Change-Id: I1db2a87c70ffce126478533836ea0ab4e21e3a08
2017-03-22 13:27:48 +00:00
WMDE-Fisch fbac5c69a4 Refactor usage of OOjs UI tooltips
This patch changes the way OOjs UI tooltips are constructed.
Until now we did not use the full potential of the widget.

Some strange behaviour remains and it seems we can not use
'horizontalPosition' here. Therefore the direction is passed
down to the RevisionsListView to center the tooltip manually
and margins are set for the help and arrow tooltips.

Bug: T159428
Change-Id: I0a67340da4d94f2f6b29e507f94fc695b44b71f9
2017-03-03 14:31:07 +00:00
addshore ce4bc18569 Attach to Newer / Older edit links
This now attaches the revisionslider to the
older and new links that are by default in the
diff.

This means when clicking them the revision slider
will use an ajax call to reload the diff (while moving
its own pointes) rather than reloading the whole page

Change-Id: I11fa92828140f980ca8edee27403a4e2a5f5a6a7
2017-02-03 15:06:20 +00:00
pppery b169f6237a Introduce ESC key detection during dragging RevisionSlider
When the ESC key is pressed, aborts the drag and returns the sliders to
their original positions

Bug: T140965
Depends-On: Ib0f386c6a2447740f44591be70c34cf4a83b88c4
Change-Id: I2dfc2fa03d2c7705fa2947dffa07fbce8ed3b185
2017-01-23 09:51:52 +00:00
addshore 17caad54ca Use mw.Map#get instead of mw.Map#values
Change-Id: Ifbc7f3e40190f678d6d9dad41fc161334b9b12c2
2016-11-23 00:31:53 +00:00
Ed Sanders 1c3ef546ad eslint: Remove old jshint/jscs refs, fix exceptions
Change-Id: I56b9f037405d0f93f82dc81dad1cc1b111be338e
2016-11-19 13:37:20 +00: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