Commit graph

78 commits

Author SHA1 Message Date
Leszek Manicki a2774984c4 Make JavaScript code and CSS follow the style guide.
Changes include:
 - not passing in HTML attributes when creating tag elements,
 - creating HTML elements instead of appending hand-crafted HTML,
 - single append() calls instead of multiple consecutie appends,
 - not using raw HTML messages when not needed,
 - prefixing all CSS classes and IDs with "mw-" to avoid potential
   name conflicts.

Change-Id: I164538bbaf44d46a4c66659f56e07ec7225d7fa9
2016-05-31 14:57:14 +02:00
jenkins-bot 72e059034a Merge "Fix opacity on load in IE & Edge" 2016-05-31 10:38:56 +00:00
addshore e0aa879b99 Fix opacity on load in IE & Edge
Divs can not be directly inside <table>
elements, and apparently IE11 and Edge will thus
put these elements somewhere else / throw them away
/ do different things to other browsers.

Thus add the div to a row!

Bug: T134983
Change-Id: I1ad38298fc0d4ec7e6f45cb77ac0100900df9bd1
2016-05-30 12:24:42 +01:00
jenkins-bot 768df0fa7e Merge "Adjust arrow styles" 2016-05-30 10:51:27 +00:00
Leszek Manicki f642fb44dc Adjust arrow styles
This introduces styles for "not available" arrow, and styles for hovered arrow
and "active" (under left mouse button click arrow).

Bug: T135970
Change-Id: If5f7df475eef36dcb6d038297ad97717b8c96f77
2016-05-30 11:54:24 +02:00
Jakob Warkotsch 49dea1cf68 Show correct slider window after refresh when the last revision is selected.
This fixes a bug that would show a slider window where neither of
the pointers is visible after selecting the last revision of the current
window with the old revision pointer and then refreshing.

Change-Id: I15402d8ca7b8c783990a32e2d8426871763e20e1
2016-05-27 16:10:59 +02:00
Leszek Manicki b0466a9615 Fix pointer pointer dragging to edge revisions
This fixes a problem with not being able to drag a pointer to the newest revision,
and an extension allowing to drag pointers to revision further than there
are revisions visible in the plot.

This stops snapping a pointer to the "stopper" element, and introduces a grid
for a pointers to be moved in. Size of the grid reflects a size of the current
revision plot which prevents moving a pointer out of the plot.
Custom "containment" is added for the "newer" edge as jquery ui's "containment"
does not work for this particular case.

Bug: T135837
Change-Id: Ifc6ae29c6d64d2baf44ef2b8ff96a45ae86b4f5f
2016-05-27 15:37:05 +02:00
WMDE-leszek dc3e840f72 Merge "Set correct pointer color on click." 2016-05-26 15:25:18 +00:00
WMDE-leszek 1aaad847f1 Merge "Show a pointer cursor on revision wrappers." 2016-05-26 15:19:32 +00:00
Jakob Warkotsch d4dd4c3576 Add labels to revision tooltips.
This adds labels for user, comment and article size to the revision
tooltip as well as the respective messages needed for the labels.

Bug: T135740
Change-Id: Ia65fb0bbbe3eb2405665d784bad157ea059e2d6e
2016-05-26 17:10:29 +02:00
WMDE-leszek 7f46eb45fc Merge "Make pointer offset depend on whether pointer is the upper pointer." 2016-05-26 15:00:49 +00:00
Jakob Warkotsch eb21b1a623 Set correct pointer color on click.
This fixes a bug which caused the old revision pointer to appear yellow
when being moved on click after the pointers switched places.

Change-Id: Ibfa104e059e847c68667605b60efe5cbb003327f
2016-05-26 16:54:56 +02:00
Jakob Warkotsch 910039cd6e Show a pointer cursor on revision wrappers.
Bug: T134993
Change-Id: I3412e03aba726fde6194b3cac88765655e69b8aa
2016-05-26 16:12:35 +02:00
Leszek Manicki 321659c70f Remove "legend" annotations and move scrolling button hint to a tooltip
This also removes a "diff size" axis legend.

Bug: T136098
Change-Id: I9705d6ab37c8d24b9bdb1fddaa895b2863e98043
2016-05-26 15:19:18 +02:00
Jakob Warkotsch f5d9347d93 Make pointer offset depend on whether pointer is the upper pointer.
Bug: T135837
Change-Id: I0ccc34751765f1f98dd29426d4efb3f3419f3932
2016-05-26 12:30:12 +02:00
WMDE-leszek 9b008b502d Merge "Fix bug that caused the most recent revision to never be visible." 2016-05-26 09:05:16 +00:00
Jakob Warkotsch 90ef5dbb23 Fix bug that caused the most recent revision to never be visible.
Bug: T135739
Change-Id: I00e30a585b3a38da7e405f200356163b20358df9
2016-05-26 10:56:25 +02:00
Jakob Warkotsch e3c9502686 Enable moving of the pointers by clicking on the revisions.
Bug: T134993
Change-Id: I6b467d8b89bdccc2d6e01fbd94ac5890a07d20b4
2016-05-24 13:45:30 +02:00
jenkins-bot 6de7022a8d Merge "Add annotation labels to the slider" 2016-05-22 11:30:34 +00:00
jenkins-bot 154649d2d9 Merge "Mark selected and intermediate revisions with colours" 2016-05-22 11:27:07 +00:00
WMDE-Fisch e126efa953 Add annotation labels to the slider
Bug: T133270
Change-Id: Ibfc16196d35305a56c63d6c23a174712442f31a8
2016-05-22 12:26:41 +01:00
jenkins-bot 91194c3c88 Merge "Fix pointer alignment." 2016-05-22 11:25:45 +00:00
jenkins-bot 6096164380 Merge "Internationalize the tooltip pieces" 2016-05-22 11:25:37 +00:00
Moriel Schottlender 2440c52bc0 Internationalize the tooltip pieces
Make sure that username and comment fields are bidi-isolated and
add an i18n message to "bytes".

Change-Id: I6a27cd7fdebf775dd86ccfc6084505aad4e931d2
2016-05-20 16:40:26 +02:00
Jakob Warkotsch 9ae092c4fe Fix pointer alignment.
The pointer weren't pointing exactly at the middle of a revision. It
appears to be off by 4px.

Bug: T135837
Change-Id: I750debb4ed82025dfb5b4ef9f988ff9bbeb36acb
2016-05-20 15:44:28 +02:00
jenkins-bot 2f93a591d2 Merge "Do not restrict width of the tooltip" 2016-05-20 10:43:51 +00:00
jenkins-bot a206b47670 Merge "Add navigation arrow bars" 2016-05-20 10:02:43 +00:00
WMDE-Fisch 43b3c36336 Add navigation arrow bars
Also adjusted margins and slider to side calculation to prevent
sliders from moving into the arrow bars.

Change-Id: I90078ff86ba8346baa6c9ab01474da871c046033
2016-05-20 09:44:36 +02:00
Leszek Manicki f2f29832e5 Mark selected and intermediate revisions with colours
Change-Id: If8e2268540a9e5f8110256e779cbee92c6a413ca
2016-05-19 18:39:58 +02:00
Leszek Manicki b0963da338 Do not restrict width of the tooltip
Longer edit summaries were squashed into 200-pixel-wide box.

Bug: T135742
Change-Id: Ic73c44df7d73b18d14f7eb10ee761f465276e72e
2016-05-19 17:16:10 +02:00
jenkins-bot b2c1de07b8 Merge "Adjust pointer size and make them drop shadow" 2016-05-19 13:22:29 +00:00
Jakob Warkotsch cf12a390f6 Resume slider scroll position after refresh.
This fixes a bug that caused the slider to always show the first "page"
after a refresh even if a different page was selected before the
refresh.

Change-Id: Ic5defd28f699617be6cf2ae5827e90f294d616b5
2016-05-19 15:03:38 +02:00
Leszek Manicki 6df5692dd4 Adjust pointer size and make them drop shadow
Bug: T134994
Change-Id: I8d65ed9abba412a4b960ee858c51dcf3cf95b879
2016-05-19 14:15:17 +02:00
WMDE-Fisch 6a95afb4f5 Add wrapper with hover effect for revisions
Also removes black borders and replaces them with white ones.
This part was a bit tricky because we want to keep bottom/top borders
to have a continuous line in the middle.

Bug: T134996

Change-Id: I7ac95604eceb732b31d39120adb57cbc8e44b230
2016-05-19 12:46:14 +02:00
Leszek Manicki 4d8949533f Change the position of the "newid" pointer
This also allows pointer to be dragged past the other. In such case
pointer colour changes while dragging, but pointer orientation/position
is only updated after dragging is finished (along with reloading diff etc).

Bug: T134994
Bug: T134996
Change-Id: Ia333306b5b0a488a4f8e92ac4b1b843dc4863d47
2016-05-19 11:02:42 +02:00
jenkins-bot ecfcc0f4e8 Merge "Use SVG icons for pointers instead of CSS magic" 2016-05-18 17:34:41 +00:00
Leszek Manicki b77cf18cbc Use SVG icons for pointers instead of CSS magic
Pointer shadow is left out here on purpose. It will be
added after changing "new" pointer's position.

Bug: T134994

Change-Id: Id80ed63cda9f015228a22bb1d8b9b742438fe27d
2016-05-18 12:54:40 +00:00
Leszek Manicki 10da0333b7 Stop using ancient <center> tag in tooltips
Change-Id: I26aef8df98a7950c93a5de2c0d426cb5db4afde4
2016-05-18 12:45:06 +02:00
Leszek Manicki 4569540481 Fix height of bars for revisions that haven't changed the page size
Zero has been passed to Math.log which returned -Infinity resulting
in incorrect size of a "negative" bar.

Bug: T135219
Change-Id: I5facc94f8cb555a95d730cc507df21399124913d
2016-05-14 09:46:14 +00:00
addshore b86ceb02bf Also refresh the article preview
Change-Id: I8a96515db9a0dbe329000a51840ad2f365b5aba0
2016-05-13 11:23:20 +00:00
addshore ec80c4fa6f Get rid of left and right pointers.
As the pointers can switch side the idea
of having a left and right one will just lead
to confusion, so lets kill that idea now! :D

Change-Id: I9d56314ea4cf46402df56e0a038bfb9655218960
2016-05-13 11:23:11 +00:00
addshore f894286873 Map pointer colors to diff colours
The need for left-pointer and right-pointer should be cleaned up at
some stage.

Infact It may be wise to loose the distinction between left and right
pointer and simply have 2 pointers.

Bug: T134994
Change-Id: I68a2159bde6fff969ca54a79587cfe03ed783454
2016-05-13 11:23:05 +00:00
addshore fc74a35709 Use correct time offset based on server and user settings
If the user has a time offset that will be used.

If the user uses the default then the offset is
still retrieved from mw.user.options.values.timecorrection

If the user is anon then mw.config.values.extRevisionSliderTimeOffset
is used which is added as a JS var by the Hook

Bug: T135109
Change-Id: Iab56bbeb6a1dd2ea08b73983341485623ff63ef1
2016-05-13 11:02:20 +00:00
addshore 39663c4539 Use JS config vars instead of DOM injection
Change-Id: I0d670de6e6c6c2a86e1f1227487b16b85a10b4f4
2016-05-13 11:01:44 +00:00
addshore 8ba5d9acea Add size & minor flag to tooltip
Bug: T135118
Change-Id: I2bc90a2f8a03693df092a4785cfe2fdfcc85730a
2016-05-13 11:57:31 +01:00
addshore 7d5de12c11 Remove section legend and colors
Bug: T135115
Change-Id: I01948c58812c37731f076629fe917f03d2b29a13
2016-05-12 16:46:02 +01:00
addshore b14f4cac33 Remove bytes changes from tooltip
New things will be added in a followup

Bug: T135118
Change-Id: I5f337f2ded0ac6ffe08c734b4e0c1a743d2aef12
2016-05-12 15:44:59 +00:00
addshore 91759f25bd Show useful error if either rev is not in our range
Bug: T135119
Change-Id: I48f3316f2285b987d1a7e4c4a622eb1291de6357
2016-05-12 16:44:34 +01:00
jenkins-bot 6565cffcfe Merge "Clean up awkward slider.slider dependency." 2016-05-12 15:38:55 +00:00
Jakob Warkotsch 139368093e Adds the missing first revision to the slider.
The first revision was previously not included because revision size was
calculated by subtracting the size in bytes of a revision from the size
of the previous revision which lead to a problem with the first
revision. The first revision's relative size is now equal to its actual
size.

Bug: T135003
Change-Id: I71441ed33673b06407be0fc566c96c3955dddbf9
2016-05-12 15:25:37 +00:00