Commit graph

15 commits

Author SHA1 Message Date
Bartosz Dziewoński 0699e09dd8 Do not show entries for hidden tags
Bug: T249266
Change-Id: I7e83523c5e8f088efaf95acb339973e0f805ff48
2020-04-02 21:00:02 +00:00
Thiemo Kreuz 7f38c9c579 Improve discoverability of JS code with @class tags
In my PHPStorm IDE, this makes it possible to follow all methods and
properties in these classes, even these that are later defined.
Otherwise only the empty stub of each class is found.

This might be different in other IDEs.

Basically: PHPStorm does not understand the meaning of the $.extend()
syntax from jQuery without these hints.

Change-Id: I4aa76db183122f6669dc72561441f46f0056d793
2020-01-24 17:21:23 +01:00
Ed Sanders 57f9876e27 build: Update eslint-config-wikimedia to 0.10.1
Change-Id: I8aeddc384d25318e8618bb617884205f1c0c1f00
2019-02-10 16:54:28 +00:00
Ed Sanders e62f46dd80 Remove obsolete aliases from closures
Bug: T208951
Change-Id: Icf10ea6bbc09542e69c0cd583a4ee4f2f76a3f43
2018-11-16 16:33:52 +00:00
srish 6934b90d87 Show tags data on the tooltip in Revision Slider
Approach followed:
- Include tags as an additional parameter in rvprop field to fetch revision tags
- Use API Tags to fetch available change tags for a wiki along with their display names
- At the time of fetching revision data rebuild the revision list with tags containing display names
- Display tags one in each line on the tooltip

Bug: T180429
Change-Id: Ieba8b79ed408ff50b3f7d4bcfd7b2fa8cca83278
2018-08-28 23:22:12 -07:00
Thiemo Kreuz 2d5b40c40b Make use of JavaScript "in" feature instead of "undefined"
Change-Id: I914f7281101bc4873eff3574c884253775e9b4bb
2018-08-02 09:35:37 +02:00
Thiemo Kreuz 3520a606c9 Limit fetchUserGenderData to maximum 50 users
The 50 is the default. The worst-case scenario here is that users
beyond this limit don't have a gender for a while, until the next call
to the same API endpoint fetches the next 50 users with an unknown
gender.

Doing multiple API calls in advance is not worth it, in my opinion.

Bug: T197858
Change-Id: I0fdcc7ea96a6a5ee3934600c6f0fdc65263276e8
2018-07-04 10:44:27 +00:00
WMDE-Fisch 94f9daef82 Minor optimisation and clean up
- reused jquery element
- removed unused method
- fixed doc type
- merged some css

Change-Id: Iadd9d7cb464691b39b7c251b401f687b3d5008b3
2017-07-10 22:41:43 +00:00
Fomafix 5176e2f7fa Remove unrecognized parameter uslimit from API request
The current API request with uslimit=500 generates a warning in the response:

{"warnings":{"main":{"*":"Unrecognized parameter: uslimit."}}...

Change-Id: I5bb5e505f3f7b64cdf71b3ef0e2084075988aad2
2017-01-28 13:34:30 +01:00
Fomafix 8100318ad9 Use formatversion=2 for API request
The changes in the response (invalid:true instead of invalid:"" and UTF-8
encoding instead of JSON escaping) does not matter here.

Change-Id: I0b2382e373527973c8cbc75ce9213b3b6e9dafb9
2017-01-28 12:39:47 +01:00
Ed Sanders 1c3ef546ad eslint: Remove old jshint/jscs refs, fix exceptions
Change-Id: I56b9f037405d0f93f82dc81dad1cc1b111be338e
2016-11-19 13:37:20 +00:00
Leszek Manicki 8e7fe2434d Add eslint, to be used instead of jscs and/or jshint
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
2016-09-05 09:47:11 +02:00
Ed Sanders 6997f135db Abort pending requests
Ensure all requests are abortable promises, and abort if
a new, conflicting request is made.

Change-Id: Ie05142f6da8cba6dde4f73c1b22960b726af4764
2016-08-15 11:19:15 -07:00
Leszek Manicki dc838bc87d Fetch more revisions as the user moves back and forward
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
2016-07-28 12:58:35 +02:00
Leszek Manicki c7190cf97d Add support for GENDER to the username label in the tooltip
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
2016-07-26 11:50:59 +02:00