Commit graph

68 commits

Author SHA1 Message Date
addshore 12c6010de5 Require MW 1.25+
This extension uses extension registration...

Change-Id: Ice7a7ba6b69a2fcb3c9f6ebcf5ef89a1dd8589bf
2017-01-06 14:54:15 +00:00
addshore 6755c1b0ce Move RevisionSliderHooks class to src dir
Change-Id: I57a52c8f82180c715cbe97f4f4dd8a765992e482
2017-01-03 19:26:33 +00:00
addshore 2cf768f7b7 Lazy load most of the JS
With the parent of this commit (current master)
Loading the RevisionSlider JS without it expanded increases
the request size by roughly 767KB on first request and 242KB
on subsequent requests.
The large size of the first request is mainly down the to
dependancies of the slider.

This lazy loading patch means the RevisionSlider JS
only causes an increase of 184 KB per request.

If the user has the bar expand by default the main JS will
be loaded straight away (and the lazy JS will not be).

This patch also means that when only the bar is loaded the
pin button to set auto expand will not be shown.
This will be added once the RevsionSlider is loaded.

Bug: T151668
Change-Id: I054a82e9ea2aa89326464632e744497239f7adba
2016-11-30 11:59:16 +01:00
Leszek Manicki f97b572c27 Add missing dependency on mw.Uri
Bug: T151747
Change-Id: Ibefeb151661727b817482207ae043f2361e0190b
2016-11-28 12:40:32 +01:00
addshore 0d4323c4a1 User preference to disable the Extension
Bug: T151452
Change-Id: I35a50a411006dca6919a50ba2d0c5f2e8bc1b2e9
2016-11-23 17:58:13 +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
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
jenkins-bot 530295db60 Merge "Add a betaFeature switch" 2016-10-24 14:46:00 +00:00
addshore 02991a7bd0 Add a betaFeature switch
This config option allows the extension to be deployed
on a site that has the BF extension enabled while not using
it (ie, being a default feature)

Bug: T148644
Change-Id: I2539e4762d7c1c34ea24f98fdf24c2aecb3d27b0
2016-10-24 13:08:58 +00:00
addshore 066d905d33 Fix my author entry
Change-Id: I8bbdc9b4a39c235170ba3bfba71c78b453a3176a
2016-10-22 14:43:59 +00: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
Fomafix d33ef6e515 Add missing dependencies to core modules
Change-Id: I53174e3d437b4d12525c1cf915027cb26f87bedc
2016-09-09 07:08:42 +02:00
Leszek Manicki 6502728184 Add button to have revision slider expanded automatically
This adds a button which allows a user to make revision slider
automatically expand on each diff page (disabled by default).
User's choice is stored as a hidden user preference.

This is a bit hacky as it squeezes a button on top
of another button (100% wide expand/collapse button).
This also adjusts styles of ToggleButtonWidget so
the button looks more like a frameless button, although
it is created as a framed one (to have inverted behaviour
when button is in its "on" state).

The button only gets visible when Resource Loader finishes
loading JS and CSS to avoid button jumping around the top
of slider window before "right" styles are applied.

Bug: T142196
Change-Id: Id561485344cba9b136666fe31b086151467de19e
2016-08-30 13:57:12 +02:00
Jakob Warkotsch 2a25f73fc5 Remove unused message.
Change-Id: I3a266e1576aeec50c618568d7a05ab3ad29d39f1
2016-08-18 15:26:54 +02:00
Leszek Manicki e243ca2746 Do not load RevisionSlider initially, add a button to show/hide it
Instead of loading RevisionSlider only add a little button
to expand RevisionSlider on top of the diff page.

This makes RevisionSlider only steal a bit of space over the
diff, and only inserts quite a big slider to users that want
to have it visible for the particular diff.

API calls are only made once RevisionSlider has been expanded.

This is re-submit of b0f229d75f
that was reverted in I26427faaa00b38c2aa1377a66224c9062dcca302.

Bug: T141871
Change-Id: I879de5774b2cce7b908e73cbbe869fd48d6afa23
2016-08-10 16:26:54 +02:00
Leszek Manicki 796a971118 Make backward/forward arrows OO.ui.ButtonWidgets
Bug: T142206
Change-Id: I25c98e32c74235a2b70ac1d02c221f1898ba9958
2016-08-08 16:17:35 +00:00
Leszek Manicki 77095bfa65 Use OOjs Popup Widgets instead of tipsy
Bug: T141983
Change-Id: I4b4ea427f82b15625537d859623461eceb1eb52b
2016-08-08 18:11:23 +02:00
Leszek Manicki 0af4fe35d5 Make the "show help" button a OOjs ButtonWidget
This also adjusts position of the help icon so it better fits
the available space.

Bug: T139150
Change-Id: Iec7ec31a83a1a847cd68a994ecac12acf960d699
2016-08-08 13:14:31 +00:00
Leszek Manicki 3cc218391c Include a number in messages showing a number with a unit
Extension should not enforce English order with number being followed
by unit "bytes" in messages related to byte size.
This also splits a message into two messages: one for page size value,
and other for change size. The latter size is signed and value to be
shown is colour-coded HTML element so it is a bit more complicated
case than the page size.

Bug: T141507
Change-Id: I96992eafd4cd8a5aed3fcd5944129bcd83139a16
2016-07-28 15:04:25 +02:00
jenkins-bot 6aea17b627 Merge "Fetch more revisions as the user moves back and forward" 2016-07-28 11:38:53 +00:00
Leszek Manicki dc838bc87d Fetch more revisions as the user moves back and forward
This changes the previous behaviour of fetching always up to
500 most recent revisions.

Now the extensions fetches N revisions including the newer
revision selected to diff as the most recent revision.
N is number of revisions that would fit in the current
window when rendered as bars.
When user is close to either "end" of the slider, extensions
fetches another batch of up to N older or newer revisions,
as long as user does not reach the oldest or the newest
revision of the page.

Among others, this removes the limitations of the previous
approach: showing only 500 revisions, and failing to show
anything when any of selected revisions was older than
500 recent revisions.

This change also simplifies usage of Api class.

Bug: T135005
Change-Id: Ib3f4a6ac57ff17008f9d8784c4716bd294443096
2016-07-28 12:58:35 +02:00
Leszek Manicki 633e7421e1 Remove HTML tags from i18n messages
This moves all HTML formatting out of messages and makes all
formatting happen in code. This should make work of translator
easier and the UI of the extension no longer rely on HTML tags
being included or not in i18n messages.

In particular "tooltip" rows are now generated in code, with
only their labels being translatable.

Change-Id: I2af9b9f0e231a7b2827a202d9ac7161b8c95855a
2016-07-27 10:28:37 +02:00
Leszek Manicki c7190cf97d Add support for GENDER to the username label in the tooltip
After fetching a batch of revision data, user names are extracted
and another API query is made to get gender preferences for users.

This change also moves a code responsible for MediaWiki API calls
to its own class.

Bug: T136367
Change-Id: Id11fe14e9ca37829141ae92b13b51f10f992eb96
2016-07-26 11:50:59 +02:00
Ed Sanders a5f36af0f3 Prefix all classes and IDs with mw-revslider
Bug: T139105
Change-Id: Ia92396ec4f8acea39398173c81842d66257dc519
2016-07-01 11:27:23 +01:00
Jakob Warkotsch 80aafa27d9 Show a tooltip for the questionmark that opens the help text.
Bug: T138945
Change-Id: I6c3235bdf228d051c7039f188ff62d1137377bca
2016-06-30 15:07:18 +02:00
WMDE-Fisch 64c84fd573 Add own message for minor edit
Change-Id: I644d200c05e9d3cad6ef14aa48757e8d58e919f0
2016-06-28 13:48:25 +02:00
WMDE-leszek 53335ddb56 Merge "Bump version number to 1.0.0 and add authors" 2016-06-25 14:22:34 +00:00
WMDE-Fisch a2d4b2cbc8 Use username for username label
After changing this several times to address concerns related to
GENDER, decided to use the mediawiki standard here also used
in the core code. For translators a hint was added that GENDER
is not supported here so an appropriate translation should be
chosen by them.

Bug: T136367
Change-Id: Icc2a8e6fc08761367c4ab6bb2a446262f8aa86e6
2016-06-25 16:12:44 +02:00
WMDE-leszek 33cf55a6f4 Merge "Bold tooltip labels and color-coded change size" 2016-06-25 14:07:55 +00:00
WMDE-Fisch 1d436fcfea Bold tooltip labels and color-coded change size
Also introduced language specific number formating. Therefore removed the
'bytes' message. Plural form will be computed in the size messages directly.

Comment label and value were split so the parsed comment can be used
plain without parsing the html again.

Bug: T137183
Change-Id: I12f30cb518e3cc5210528d5b22737dde868a0325
2016-06-24 17:51:36 +02:00
Leszek Manicki cd12add2cb Make a symbol on the "Show help" button translatable
Change-Id: I60ae368f59203f63fb352ec861db5d75d488f8fa
2016-06-24 15:55:03 +02:00
WMDE-Fisch 8d1745749e Add RTL helptext SVG
Bug: T136830

Change-Id: I0cd51d01fa451f027252f9f98ef8b9df2206d60d
2016-06-17 14:46:48 +02:00
WMDE-Fisch 8ce4d433f8 Bump version number to 1.0.0 and add authors
Bug: T137948
Change-Id: Ibcd39fbb503d0a603dae35c8ae515b5bb19178ee
2016-06-17 13:50:13 +02:00
Jakob Warkotsch 5f6b3c8556 Show a help dialog.
- slide show dialog using OOJS UI
 - setting a user option to only show it once
 - translatable content
 - images of the slides

Bug: T136830
Change-Id: Ia820aecb20aa6b239f1a64dd328683639baf399e
2016-06-16 18:05:10 +02:00
Jakob Warkotsch 183abd6286 Merge "Use a gender-neutral label for user." 2016-06-07 08:54:13 +00:00
Jakob Warkotsch 78a691ca06 Use a gender-neutral label for user.
Gender-specific labels here would be to expensive.

Bug: T136367
Change-Id: Id66790cd5c921ae536cbc5bede71f61d0e55a043
2016-06-06 15:51:29 +02:00
Moriel Schottlender 7b75c1ebf2 Use momentjs to display internationalized timestamps
MediaWiki uses the momentJS module to display standard timestamps;
this means you can avoid calculating the user offset, but also, it
means that all timestamps are internationalized and translated, and
use the standard view that MW uses in its interfaces.

We can store the user's offset in a RevisionSlider variable so we can
refer to it in timestamp construction, as well as manipulate it in
tests without touching any global user options that may affect other
tests.

Bug: T136825
Change-Id: I67d9859b8f33ab8a217128822e246e7ab67f6511
2016-06-03 13:20:35 +00:00
WMDE-Fisch 1a8a4312de Move dependencies to extension.json
Also removed unused dependency.

Bug: T135198
Change-Id: I1ee53ec9d7e123bdca84701b9557aeeeade815ff
2016-06-02 18:16:23 +02:00
Brian Wolff 39d8d9229a Make files not executable
I know it doesn't matter, but it was kind of bothering me.

Change-Id: Iae9f8b17a3fb5ced362dc2da95e67e20db8af5a5
2016-06-02 13:48:09 +00:00
WMDE-Fisch da43204662 Add change size to tooltip
Bug: T135740

Change-Id: I50833c5b65c821eb885b261a15de2088cd15da6d
2016-06-01 17:05:09 +02:00
Leszek Manicki f9d9a4a4b7 When JavaScript disabled do not show RevisionSlider
As suggested in a comment in T135198, do not show anything above the
diff when JavaScript disabled instead of always putting a message
there.

Change-Id: I1c66fa4a9fa6e90f8318de3a4f656d629000d9ca
2016-05-31 19:49:08 +00:00
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 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
Brian Wolff 4091343920 No remoteExtPath key in extension.json. Broke RL debug mode
Change-Id: Ie417c6361910cf574a0c127ff66d0d64b2d6c509
2016-05-27 14:21:09 -04: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
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
WMDE-Fisch e126efa953 Add annotation labels to the slider
Bug: T133270
Change-Id: Ibfc16196d35305a56c63d6c23a174712442f31a8
2016-05-22 12:26:41 +01: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