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
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
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
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
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
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
In particular, link to a Meta page on the related community wish
should open in the new window/tab.
Bug: T140875
Change-Id: Ib0d7bf679c9ac8a3ee2fdf2289fc53cfdfdaa671
In RTL UI the positive and negative numbers will
appear on the wrong side unless the direction is
defined explicitly.
Change-Id: I39ef512993878daf10008e967ffd0492f7e1e80a
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
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
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
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
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
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
- 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
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
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