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
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
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
If something goes wrong with the initial api rquest the
slider would either load in a broken state or say that
it is loading forever.
Now a message will be displayed to the user as well
as the error logged to the console.
Change-Id: Id763f31432feb7bd0e9ecbbeb2dd40f7ca6acaaf
This allows using browser back and forward buttons
once users have started heading between revisions.
This also updates the URL so that the page can be
reloaded at any time and the same state will be held.
(This also removes a commented out block of code that
I think was left for updating the URL)
Change-Id: I4cfe38f76eeb9e090f0a8a42e22e75cf84014d60
* threw out most of the things from init.js
* turned Slider + View into respective modules
* pointers should remember position (except on page load) and correctly
slide back to their position/to the side
Some things still need testing and refactoring.
Addshore: - CS fixes and comment out current failing tests
Bug: T134395
Change-Id: I78a7095e1d9902314163b1443448f47ef0484d4e
This creates a module for the draggable pointers for the RevisionSlider
mainly to encapsulate both the pointers' state and their HTML code.
Some animation methods such as slideToSide and slideToPosition
that are still flying around in init.js weren't added to the
module since I thought they should be part of the not yet existing
Slider module.
Change-Id: I1292bfb0bbd68f8d2de04b3b5e5f3133ec6363b8
Slider width is now calculated according to number of revs.
Slider is now always shown in the center of the page.
The width of the ticks depends on the number of revisions per page.
Bug: T133281
Change-Id: I460b2bccff35c9dd6a4c2e5b7e847e2c59f882d3
This turns the prototype code of the Revision Slider into a MediaWiki
extension.
With this extension enabled the slider should appear on diff pages
already but it won't actually show diffs when adjusting the slider
pointers.
Things that changed so far in the prototype JS code:
- pulled out the rainbow function and made it use Math.floor instead of
the ~~ binary operator
- pulled out the API request that fetches the revisions into its own
module
- cleaned up and documented some parts of the code
The code is still very much WIP and JSCS still has a couple of
complaints.
Bug: T132576
Change-Id: I2e22365f3b93a76d5b8d3997242b5fed996c6d78