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
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
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
Since IE8 support is dropped, remove hint for incompatibility.
Hint for IE9 is kept to keep track of possible issues.
Bug: T123218
Change-Id: I0fd066dbc22f603da733dcfa339e5af3ffbde41f
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
Tabs are hooked up to JS events which will break
if they are replaced, just switch out the oldid
in the edit link as that is all that changes.
Change-Id: Iea073f8d435a511ba91cdc0c7bdb9e8f1ec1d4ac
Adding position data-attribute to the pointer elements and always
apply the same value as for the revision bars they are pointing to.
This will allow us to reduce the complexity of browsertests.
Bug: T146276
Change-Id: I6e6db55204b0c45fe94a5173e297a67a7ed38d00
Also add a note to the console about WikEdDiff
& RevisionSlider interaction and the required code
change.
As the code change uses the wikipage.diff hook the code
change will actually have no effect until this patch
is deployed, which includes the removal of the hack
for WikEdDiff.
Bug: T142636
Change-Id: Ie88021abb2325cc6259cf2fb041fbdca4ae9ca89
Depends-On: Ie488021f5d0e314a8ad6c8d1f1f3d936c427d719
In order to properly fix problems reported in T142636, core hook
triggered on diff change (on diff page) will be added in
I5aad7cc10a0db869d7c25d41f7db056885dad69b.
When that change is merged, Thanks extension will be listening
to this hook and not to RevisionSlider-specific revslider.diffreload.
This adds temporary code fixing RevisionSlider's and Thanks' interaction
before hook introduced in I5aad7cc10a0db869d7c25d41f7db056885dad69b is
available. After it gets merged, the code added here should be replaced
by firing the new core hook.
Change-Id: I5dd6c592165ed30244ac8bff37bb6e4949c8bc4a
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
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
* 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
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
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
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
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
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
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
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
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