Commit graph

288 commits

Author SHA1 Message Date
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
jenkins-bot 3dcfec7f5e Merge "Update URL in print footer when reloading a diff" 2016-09-01 09:57:38 +00:00
WMDE-Fisch a0cb76f747 Improve tooltip handling
Reordering of stuff and splitting conditions seems to fix some of wiredness.
Mouseenter and Mouseleave are the better events in these cases.

Change-Id: I66d71b1d4f394199949475dc42ca085169e0584f
2016-09-01 07:40:49 +00:00
Leszek Manicki f10e137897 Update URL in print footer when reloading a diff
Print version of the page contains a "Retrieved from" link
referring to a particular revision. URL should be adjusted when
revisions are switched in the slider

Change-Id: Icca3c452ae6926a997b22d3bf9632591fbc0b58d
2016-08-31 15:54:09 +02:00
jenkins-bot ddf94dd141 Merge "Do not include Revision Slider in the printable version of the page" 2016-08-31 12:17:16 +00:00
jenkins-bot 3f6815858c Merge "Add button to have revision slider expanded automatically" 2016-08-31 08:27:02 +00: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
Leszek Manicki 6c8c275690 Do not include Revision Slider in the printable version of the page
Change-Id: I477e80b82a74ac02e48759fc912200350cfc1824
2016-08-29 08:23:00 +00:00
Leszek Manicki a64dc43963 Reload category links when reloading the diff after revisions change
Bug: T143843
Bug: T143204
Change-Id: I6871ef106729e598329647d2726bef4755c45299
2016-08-25 14:01:42 +02:00
jenkins-bot 805b92dd1a Merge "Use moment.js's localized date and time format" 2016-08-23 10:19:07 +00:00
jenkins-bot 3c1c284de5 Merge "Highlight revision bar when hovering revision wrapper." 2016-08-21 11:04:45 +00:00
jenkins-bot 923d9608e2 Merge "Expand draggable/clickable pointer area." 2016-08-21 11:01:23 +00:00
jenkins-bot 01cf07fc12 Merge "Remove transition on revision wrapper hover." 2016-08-21 10:58:14 +00:00
Jakob Warkotsch 188c5d58c8 Remove transition on revision wrapper hover.
Bug: T143116
Change-Id: I85dbb9e9c46a022d701dc956051304090daa44fc
2016-08-19 16:18:17 +02:00
Jakob Warkotsch c5687cde9a Highlight revision bar when hovering revision wrapper.
Bug: T143115
Change-Id: I4e4d749e4d1b9644db66a476731a052c450caa3c
2016-08-19 14:57:11 +02:00
Jakob Warkotsch 19d98c55df Remove 1px height from pointer container.
Bug: T143113
Change-Id: Id9eee9451cc2437adbf3c3e109b26bec028134ca
2016-08-19 14:44:05 +02:00
Jakob Warkotsch 2625c6f1aa Expand draggable/clickable pointer area.
Bug: T143091
Change-Id: I43d8635542e489d816aea0b8ab3366207f27546c
2016-08-19 14:15:06 +02:00
Jakob Warkotsch a88c05c1f6 Reload side panel when loading a new diff.
Bug: T143204
Change-Id: I1034c756f094c9a3b12cfdd65c94f036fc0e4eee
2016-08-18 15:00:55 +02:00
Leszek Manicki d2a4c63107 Expand slider if there are space for more revision at the beginning
After resizing a window there might be more space at the beginning
of the slider "axis" than there are revisions loaded so far. In such
case the slider should be expanded, so more revisions are loaded
to fill the whole available space.

Change-Id: Ied8abe294967328112afb1fe4d14b2e29ed2c092
2016-08-17 14:35:01 +02:00
jenkins-bot d353e0db32 Merge "Reload the page menu when loading a new revision." 2016-08-17 11:36:05 +00:00
Jakob Warkotsch 567ebde9fa Reload the page menu when loading a new revision.
This avoids opening the edit page for the wrong revision when clicking
"Edit".

Bug: T143151
Change-Id: Iac2954449689c290c5f81a1a3a8505197d93dc14
2016-08-17 12:31:26 +02:00
Jakob Warkotsch 4d6233f842 Resize revision slider when resizing the browser window.
Bug: T139101
Change-Id: I57c7d9e553f02c2e8eaa76ee729f85ec4ae2ec3b
2016-08-16 16:08:44 +02:00
Ed Sanders 6c9e3e36a6 Fix loading state of diff page
* The jQuery for appending the 'darkness' mask was broken (not nesting)
* Use a more semantic name
* Simplify styling to just set opacity to 50%.
* Remove browser compatibility hacks as all MediaWiki's JS
  supported browsers also support CSS opacity.

Change-Id: Id893a75bb90a4e6e2e8a26ebc3863de565d8a4ee
2016-08-15 11:20:34 -07:00
Ed Sanders 6997f135db Abort pending requests
Ensure all requests are abortable promises, and abort if
a new, conflicting request is made.

Change-Id: Ie05142f6da8cba6dde4f73c1b22960b726af4764
2016-08-15 11:19:15 -07:00
Leszek Manicki 90d652adef Use moment.js's localized date and time format
Localized format of date containing month name, day, year and time
is used instead of format enforcing the order of time and date,
and use of short month name.

Bug: T141167
Change-Id: I39b2844e777beb986cefb3097d52d481bb038a63
2016-08-11 11:40:30 +00:00
Ed Sanders f6a44f43fe Convert the few instances of IDs to classes
Makes for more modular code.

Change-Id: Ic71d7421aea548e5b4a9c4841cd4af49a3d385a5
2016-08-10 15:32:12 -07: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
WMDE-Fisch c5690ba763 Revert "Do not load RevisionSlider initially, add button to load it"
This reverts commit b0f229d75f.

Change-Id: I26427faaa00b38c2aa1377a66224c9062dcca302
2016-08-09 16:34:53 +00:00
Leszek Manicki b0f229d75f Do not load RevisionSlider initially, add button to load 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.

Bug: T141871
Change-Id: Ib312f6225b85b9ebdf4ac5d16e254a57d5cf6411
2016-08-09 14:54:59 +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
jenkins-bot 7010b98d7f Merge "Include a number in messages showing a number with a unit" 2016-08-03 10:03:39 +00:00
WMDE-Fisch fefe746b07 Reduce help text font-size
Bug: T139100
Change-Id: Ie4401b1a49026606109d90160001d327472f1bff
2016-08-02 14:12:57 +00:00
jenkins-bot 7ce0442fa0 Merge "Track the load times of RevisionSlider" 2016-08-02 12:08:31 +00:00
addshore fd61e41db8 Track the load times of RevisionSlider
Change-Id: Ibeaac111802af80d2910c1892d233b7835069148
2016-08-02 13:02:57 +01:00
jenkins-bot dd8ee7bad4 Merge "Consider custom user language setting, and include all parameters in generated URLs" 2016-08-02 09:42:53 +00:00
Leszek Manicki 042a3bb213 Consider custom user language setting, and include all parameters in generated URLs
User langauge setting could be overriden by adding uselang parameter
to the URL. Extension should use its value if present when fetching
the localized diff page.

Bug: T141760
Change-Id: I2539bc7bf523870f55f67bc94000c28644528172
2016-08-01 17:10:21 +02:00
jenkins-bot ff550611b2 Merge "Clean up the usage of <bdi> tags" 2016-08-01 13:53:57 +00:00
Leszek Manicki de8ec35f2f Fix restoring the position of pointers when moving in browser history
This fixes two bugs:
 - when more older revisions are loaded and inserted at the "beginning"
   of revision list, the slider position in the top history state
   should be adjusted. Otherwise when going back in browser history
   wrong "window" of the slider is displayed.
   This bug has been introduced in Ib3f4a6ac57ff17008f9d8784c4716bd294443096
 - when clicking revision bars the history state should contain
   the position of the changed after the clicking instead of the
   position prior to the event. Otherwise when going back and forward,
   the latter does not change the pointer positions (two top history
   states before going back store the same pointer positions).

Change-Id: I2305a731a5e43ea15ad8468eb3dc4a5eea12b182
2016-08-01 12:35:35 +02:00
addshore 093bb1466b Use history.replaceState on initial load
Bug: T141732
Change-Id: I283b9f45f9ecf6bed5d5031ea21b374f12758309
2016-07-31 20:13:00 +01:00
addshore f7289bf65c Use SliderView refreshRevisions method in SliderView
Change-Id: Ibaeb9776ee18061c99ddf1a6e794b5a3a6faa16a
2016-07-31 19:50:33 +01: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
jenkins-bot c6be0d7660 Merge "Smarter setting of the "gravity" of tooltips" 2016-07-27 14:27:50 +00:00
Leszek Manicki 0534bf2ba8 Clean up the usage of <bdi> tags
Bug: T141215
Change-Id: I981eb29a40fbca76ae5e7bc6aa3d723ecfb42f23
2016-07-27 11:50:15 +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
Leszek Manicki 8ec7004cc3 Do not escape quotes and double quotes in user names
Quotes and double quotes are allowed as part of a user name/page title.
Other things escaped by previously used mw.html.escape, ie. <, >, &
are not allowed in a user name any way. But just in case, to stick with
current preventive behaviour, this strips those three characters
if they somehow happen to appear in the user name returned by API.

Bug: T141171
Change-Id: I08dd09dcc94823461d7e9a8b116c088c4e8ee8d5
2016-07-26 10:24:44 +02:00
Leszek Manicki d737153e29 Smarter setting of the "gravity" of tooltips
This adjusts the position of the tooltip depending on what is the
position of the related revision bar in the plot, and on the
size of the contents of the tooltip.

This change makes the tooltip be always displayed below
the revision plot, so it is visible to the user no matter if there is
enough (visible) space above the plot.
Also now it is checked if there is enough space on the left and right
side of the browser window to display the tooltip centered horizontally.
If not, this adjusts the horizontal position of the tooltip so that
it does not get shown outside of the window.
The latter in particular improves displaying of longer edit
summaries in RTL mode. Apparently LTR-centered browsers took care
of not showing the tooltip outside the right edge of the window
but in the case of left edge the tooltip could run outside of the window
leaving a part of summary not visible to the user without scrolling.

Bug: T141071
Bug: T141093
Change-Id: I8d519c5fd42d8403b527fa97d72a5c46991fc27b
2016-07-25 12:14:42 +02:00
Leszek Manicki 8d91433b61 Open links in the "tutorial" in the new window
In particular, link to a Meta page on the related community wish
should open in the new window/tab.

Bug: T140875
Change-Id: Ib0d7bf679c9ac8a3ee2fdf2289fc53cfdfdaa671
2016-07-20 12:28:20 +02:00
Amire80 bee97e111f Make sure that positive/negative sign in displayed correctly
In RTL UI the positive and negative numbers will
appear on the wrong side unless the direction is
defined explicitly.

Change-Id: I39ef512993878daf10008e967ffd0492f7e1e80a
2016-07-18 11:24:08 +00:00
addshore f0cb111671 Account for suppressed comments and users
Bug: T140397
Change-Id: Ie3a4d81da38f6b721c80738d725fc59cc4fec345
2016-07-15 09:27:59 +01:00
jenkins-bot e901b847a5 Merge "Fix parameter type in docblock" 2016-07-06 08:28:08 +00:00
addshore 1e65ec602f Tooltip browser tests
Bug: T133278
Change-Id: I7ee7143ab3fcd9c2fe41604c370d9c4e2e7a9d20
2016-07-05 11:57:36 +01:00
Leszek Manicki 8e2365502b Make RevisionList expect list of Revision object
Despite its documentation the "constructor" of RevisionList tends
to expect array of revision data in a format returned by API instead
of array of Revision objects.
Due to different name of ID fields in Revision object and in API array,
if "real" Revision object is passed to RevisionList, its ID is lost.

This changes RevisionList so that it only accepts an array of Revision
objects. This provides better abstraction.

This is basically a revert of I147270f28381038d05f8bcfd2317e8c269b2e458
which aimed at the same problem but suggested solution doesn't seem right.

Change-Id: Ic45cdd3e7b707a8c6a19eecf0a84d4c11696cd1f
2016-07-05 00:01:46 +02:00
Leszek Manicki a5c441ecd3 Fix parameter type in docblock
Change-Id: I62e9f2035d869aec5bee02f628623962fab17be9
2016-07-04 23:58:22 +02:00
addshore 6101897460 Add browser tests for tutorial / help dialog
Testing the visibility / presence of things around
the dialog appears to be hard and the DOM for the dialog
remains unchanged when shown / hidden as far as I can see.

These tests test that the dialog is only shown once per
user.
And that the sequence of the dialog works in regards to the correct
buttons being present at the correct times.

Bug: T133278
Change-Id: Ia86cb69573da3e888c2897b8b50f1d2e5c61d8d4
2016-07-04 13:39:19 +00: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
Ed Sanders 7b463c52eb Replace csslint with stylelint and make a pass
Change-Id: I7f3d1cd867399fa23b087daa89970ebe305c46d9
2016-06-30 21:21:28 +01:00
Jakob f2f24b1b11 Merge "Add more QUnit tests for public methods" 2016-06-30 15:08:15 +00:00
WMDE-Fisch f7ae734b99 Add more QUnit tests for public methods
Added tests for DiffPage, HelpDialog and RevisionListView.
Slightly refactored RevisionListView to improve testability.

Bug:T137964
Change-Id: I07dc8059d5a90bdd6623fd7748d36ba212763e15
2016-06-30 17:01:10 +02:00
WMDE-leszek 200f3e1ddd Merge "Start browser tests (Initial test for beta feature switch)" 2016-06-30 14:01:29 +00:00
addshore d7caa6c1f3 Start browser tests (Initial test for beta feature switch)
This adds 1 simple browser test to make sure that the placeholder
for the revision slider loads when the beta feature is enabled and
does not load when it is disabled

More tests will follow.

Bug: T133278
Change-Id: I5be9014b6c5ac03128c034fd866141e89fd7a0ed
2016-06-30 14:46:37 +01:00
WMDE-leszek 2964b673d5 Merge "Show a tooltip for the questionmark that opens the help text." 2016-06-30 13:11:46 +00: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
Leszek Manicki 946c7656f3 Make username in the toolip a link, another approach
This makes Mediawiki render the link. Unfortunately, it is
not rendering redlinks for not exisiting pages.

Also updates qqq.json i18n file which was missing in
Ifb2f33febbdf0f7c9584941b71596abb47fb8088

Bug: T138944
Change-Id: If336984362358193a6c43144ace2f818dbe0633d
2016-06-30 14:27:16 +02:00
Leszek Manicki 22dc00571f Make username in the tooltip a link
Bug: T138944
Change-Id: Ifb2f33febbdf0f7c9584941b71596abb47fb8088
2016-06-30 13:17:07 +02:00
Leszek Manicki 8e5189422a Highlight revision "wrapper" when mouse inside a tooltip
Bug: T138946
Change-Id: I93da2bc2fad36dc2927fe4123f91cab470cb3553
2016-06-30 11:52:57 +02:00
WMDE-Fisch 64c84fd573 Add own message for minor edit
Change-Id: I644d200c05e9d3cad6ef14aa48757e8d58e919f0
2016-06-28 13:48:25 +02: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
jenkins-bot 8bfed7caf1 Merge "Make a symbol on the "Show help" button translatable" 2016-06-25 11:40:18 +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
Jakob Warkotsch ec9caea004 Make revision tooltips hoverable.
Bug: T138392
Change-Id: Ic43345839cf8d04486141d24074a4d735c9c5c1f
2016-06-24 15:13:20 +02:00
Leszek Manicki 94405e7f6d Add a simple JSDuck config file
Running jsduck command generates API documentation to docs directory.

Change-Id: I1f9acbaf7868ebf48a56d20d6906cbcf23ef9748
2016-06-22 14:40:27 +02:00
jenkins-bot da0ee1560c Merge "Enhance code documentation." 2016-06-21 11:30:37 +00:00
Jakob Warkotsch 11ceffab2f Enhance code documentation.
Bug: T137965
Change-Id: Ice393838545f1545ee085ecdcddfa35f60b32ecd
2016-06-21 13:25:50 +02:00
jenkins-bot d4ea6b838f Merge "Add button to reopen the help dialog." 2016-06-17 11:23:56 +00:00
Jakob Warkotsch 079f5607c9 Add button to reopen the help dialog.
Bug: T137086
Change-Id: Ifef5c8451a53bf43b10418ace8e6651801480bb2
2016-06-17 13:11:38 +02:00
Leszek Manicki 202e76e78b Add a link to Meta page describing a community wish
Link is added to the first "slide" of the help dialogue.

Change-Id: I6abf375951b11331fe1d67993e7d06a2bb0c8f51
2016-06-17 10:59:48 +02:00
Leszek Manicki 3b9c3e73ad Escape HTML message in the "help slideshow"
Change-Id: I6854da2d8c6d7176956394f4f4733d0c2529d295
2016-06-17 10:55:42 +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
Moriel Schottlender abfcd2c01b RTLize RevisionSlider's behavior
Allow RevisionSlider to work properly in both LTR and RTL contexts
by making sure that when the interface language is RTL, the entire
interface flips. "Backwards" and "Forwards" are reversed in RTL
context, and the code and behavior should respond to that.

Changes made:
* Make sure the container has a direction set
* Change the placement of the revision divs from absolute
  positioning (that requires re-calculations when the page
  is flipped to RTL) to divs that are display: inline-block
  and have no right/left setting. This means that the DOM
  will automatically flip its own visual order when the
  container is set to RTL.
* Flip the calculation of positioning and the calculation
  of which element the pointer is on when it is dragged
  if the document is RTL.
* Mirror all scroll animations when the page is in RTL.
* Rename the scroll buttons to 'backwards' and 'forwards'
  for clarity, as they are flipped when the interface is
  RTL.
* Rename pointers to 'older' and 'newer' instead of
  trusting their order in the DOM.

Bug: T136277
Change-Id: I7c903c2e9d8ee2a0ef2eeb7b99f2251f230a794e
2016-06-08 13:26:43 +00: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 05ea211e8b Fire event for wikipage.content hook
Bug: T136827
Change-Id: If3e92716c4db71b9aeae3fb624c17174cf909b7d
2016-06-03 11:52:49 +02:00
Jakob 9ec481052a Merge "Add resize cursor to pointers" 2016-06-03 09:14:47 +00:00
WMDE-Fisch 1a7fe36941 Add resize cursor to pointers
Also prevent cursor flickering when dragging.

Bug: T136099
Bug: T136833
Change-Id: Ie04c5ad9669c1e839b34bc8f649cc9264f70b666
2016-06-03 11:12:49 +02: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
jenkins-bot 04df38c25f Merge "Use parsed comment instead of custom parsing" 2016-06-02 15:46:02 +00: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 f8446590cb Use parsed comment instead of custom parsing
Bug: T135740
Change-Id: I49757b5bcf2c47f459538bd4383325882a15336f
2016-06-02 13:47:41 +00:00
Jakob 19c50267e7 Merge "Dont push state to history in cases where not possible" 2016-06-02 12:10:27 +00:00
Jakob 3482b4a968 Merge "Add change size to tooltip" 2016-06-02 12:01:12 +00:00
WMDE-leszek 0956cf51e9 Merge "Do not center tooltip text" 2016-06-02 10:16:29 +00:00
WMDE-Fisch f6854e0bd4 Do not center tooltip text
Bug: T135740
Change-Id: I6c3b825b27736f693260bc3a6447b6328449e0d6
2016-06-02 12:14:01 +02:00
addshore 7d996ec788 Dont push state to history in cases where not possible
This fixes some issues with older versions of IE

Bug: T136714
Change-Id: I20d35e16ff4b31c2f719cc72c80ca7c57d5b528e
2016-06-02 12:02:39 +02:00
WMDE-Fisch da43204662 Add change size to tooltip
Bug: T135740

Change-Id: I50833c5b65c821eb885b261a15de2088cd15da6d
2016-06-01 17:05:09 +02:00
Leszek Manicki c14fa78bc0 Remove unused parameters when creating Pointer objects
Change-Id: I2bc5337d2a48fb5dd6b81d6c95584f79974d7e9f
2016-06-01 16:49:26 +02:00
Leszek Manicki b86194eacb Fix updating revision bar styles when going back/forward in history
This left unchanged in I164538bbaf44d46a4c66659f56e07ec7225d7fa9

Change-Id: Ied950472458a61efbfae5850d070f7047a222879
2016-06-01 16:45:15 +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 225f48ac52 Do not fail when name of the user performing the revision is not available
For example when user name is not visible due to RevisionDelete the script
crashed. This makes it check if there is a user name defined and not try
to show it if there is none.

Bug: T135198
Change-Id: I43ce0e49e13ad6262cc60fd938c486ea3e328e64
2016-05-31 19:48:53 +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 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