Initialization tests for both classes were checking
if the rendered view or the view related to the pointer
contained an element with particular CSS class.
The structure of the view has apparently changed as it
no longer contains an element with a particular class
but the view's DIV itself get the CSS class.
Assertion in tests has been wrong and did not catch the
change (in particular, apparently jQuery's find returned
an empty object which does not evaluate to false in qunit assertion).
This changes initialization tests to check the CSS class of the view element.
It also reflects the removal of left/right pointer distinction made in
I9d56314ea4cf46402df56e0a038bfb965521896.
This also rename both test modules as they had misleading names.
Change-Id: I5956022af332c9915e983a020732edbe1dd75aef
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
This was super annoying as if you went to refresh
the test page to run the tests again it would take
you to some broken diff page instead...
Change-Id: I43ca8edd005aa3ef72b74a5d812cbe39bccaf332
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
* 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
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