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
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
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
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