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
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
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
Pointer shadow is left out here on purpose. It will be
added after changing "new" pointer's position.
Bug: T134994
Change-Id: Id80ed63cda9f015228a22bb1d8b9b742438fe27d
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
Zero has been passed to Math.log which returned -Infinity resulting
in incorrect size of a "negative" bar.
Bug: T135219
Change-Id: I5facc94f8cb555a95d730cc507df21399124913d
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
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
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