Commit graph

26 commits

Author SHA1 Message Date
Thiemo Kreuz c2017f74b2 Remove @param/@return docs that literally repeat the code
These don't add any knowledge but make the code harder to read
and maintain, and are an additional source of errors.

Change-Id: Ied57741a3f985e355adfddb4e75378d5c497faa9
2021-06-14 15:44:51 +02:00
Ed Sanders 857014fae9 Support watchlist expiry
Bug: T251348
Change-Id: I017a54784c758c5e97fb640721bd456adc0fbab5
2021-06-08 20:14:45 +00:00
Ed Sanders db90e1e610 ArticleTargetLoader/Saver: Move vars inline
Change-Id: I4afe5d0c68cb6284fe5178674e8942afb2b9d5bd
2021-05-05 16:56:49 +01:00
Bartosz Dziewoński 504e47e03a ArticleTargetLoader: Allow customizing 'editintro' parameter
Bug: T269310
Change-Id: Ic77ce84172f114795708f48a4a7457b2965568f9
2020-12-17 02:01:09 +01:00
Roan Kattouw 4f5c27be09 ArticleTargetLoader: Add ve.loadModules hook
This provides a consistent entry point for registering plugins on both
desktop and mobile, without needing to do strange things if the right
ResourceLoader module hasn't loaded yet.

Without this, registering a plugin module in JS requires ugly code,
and on mobile it wasn't possible at all.

Bug: T267692
Change-Id: Ie2c320c33ec2b064fba4fb45ba62545b9211439a
2020-11-10 23:31:07 +00:00
jenkins-bot 4e55aa9488 Merge "Disable ArticleTargetLoader on invalid UTF-8 URIs" 2020-09-09 12:17:55 +00:00
jdlrobson 0d64cd8649 Disable ArticleTargetLoader on invalid UTF-8 URIs
Bug: T106244
Change-Id: Ieb2c7610e9f49fd33df63a920ebf871110f0b2e6
2020-09-08 15:57:59 -07:00
Ed Sanders 4545f53245 build: Update eslint-config-wikimedia to 0.17.0
Fix instances of variable shadowing.

Change-Id: I6e2befb020d7d4b506c7b46131eafacd951aa6d1
2020-08-18 13:16:49 +01:00
Sam Wilson 82bfa015ec Ignore non-checkbox fields for page saving dialog
The 'checkbox' part of the edit form is now allowed to contain
non-checkbox form widgets, but these are not yet supported
by VisualEditor. Until they are, this skips them entirely
in order that no broken form field be shown.

Bug: T259546
Change-Id: If62c11b174df235be611b9d32eb28e4759ba5f66
2020-08-07 13:18:41 +08:00
Ed Sanders f01d4ab35d Drop linting from the VE API
Calling the linter is very slow as the result is not
cached. Extensions needing this (DiscussionTools) should
just call the Linter extension API directly.

Bug: T253799
Change-Id: I994b52ca70c29a32900741a36087f10144396720
2020-06-04 18:51:38 +02:00
jenkins-bot e4fe634201 Merge "ApiVisualEditor: Add option to return lint errors from Parsoid" 2020-04-24 10:03:40 +00:00
Bartosz Dziewoński ae86f7290b ApiVisualEditor: Add option to return lint errors from Parsoid
Depends-On: I6bbe2fc5aea07c65eb99768f2c44ed42601792a3
Depends-On: I6bdf5635763ef8a44d44a031c64cd7f289261a32
Change-Id: I723ec766d1244d117f8d624440026fe5af0d3403
2020-04-21 22:49:29 +02:00
Ed Sanders 651756c4fc eslint: Enable the mediawiki/class-doc rule and make pass
Also minor other adjustments

Change-Id: I9ee48359e3e53799f2f6240e44b53972283ce328
2020-04-17 22:59:11 +01:00
Bartosz Dziewoński 92c3055628 Fix issues with treating section "numbers" as integers
In MediaWiki, section numbers may be prefixed with 'T-' if they refer
to sections on a transcluded page, so they are not really numbers.

Change e2cb9ce93e caused us to treat them as strings most of the time,
but it looks like there are several places where we treated them as
integer numbers, which I missed when making that patch.

The first two changes in ArticleTarget#restoreEditSection fix T248795
and T248968/T249112, respectively. The other changes are cleanup.

Bug: T248795
Bug: T248968
Bug: T249112
Change-Id: I8373a7ab515595769ce6f3051a182c922415b643
2020-04-01 21:41:17 +02:00
jenkins-bot 39a8ecf890 Merge "Remove X-Parsoid-Variant configuration value, which is no longer needed" 2020-03-17 00:13:39 +00:00
Ed Sanders e3d3e0869d Move checkbox widget creation to mw.libs.ve
So this can be used other VE API users (e.g. DiscussionTools).

Bug: T245222
Change-Id: I1e0e9bb9da53a62f8a20126e579dcd6300bd2376
2020-03-13 18:00:44 +00:00
C. Scott Ananian ce094c72d4 Remove X-Parsoid-Variant configuration value, which is no longer needed
Reverts Ib1403638b12ec5808f6b81bd114949043aa9ac2e.

Bug: T229074
Change-Id: I9bbc02821d5ee82c9944516ab07d3cb380d2f3a8
2020-03-11 13:24:43 -04:00
Bartosz Dziewoński 4fc5d964db ArticleTargetLoader: Fix loading visual diffs when no RESTBase
When mw.libs.ve.diffLoader#fetchRevision was calling this method, we
were accidentally making no query at all if RESTBase wasn't in use.

Change-Id: Ia98343aa1ba7f4f3be0c1a8ee5864653c429fb82
2020-01-29 11:15:18 -08:00
James D. Forrester 2c77e88d2c doc: Bump copyright year for 2020
Change-Id: I30539877543dc2a57bd1428a00d10ac46d8fc294
2020-01-08 09:13:24 -08:00
Ed Sanders a725643aa1 ArticleTargetLoader: Check apiXhr exists
Change-Id: I891d642728094af9c5a550a814d322822436a9e5
2019-12-16 09:53:57 +00:00
Ed Sanders e6bb954edd Don't bother fetching metadata for diffs
Only HTML content is used for building diffs

Change-Id: I4f9af162792c27e7771838b6294c106bc9dc359a
2019-12-13 18:18:36 +00:00
Bartosz Dziewoński 571bec41d1 ve.init.mw.ArticleTargetLoader: Fix promises to be abortable again
Cancelling the loading of the editor should stop the network requests.

Broken in 0498c03191. Forwarding the
'abort' function manually is the worst.

(found when working on I5146b726c5ce213992febb23f24c5937db0b9bfe)

Change-Id: Ifa7c11a433cb5ed3545fa2f3d9fae2800bcae7d7
2019-12-11 01:27:33 +01:00
David Lynch 46e7b3ba19 Config value for X-Parsoid-Variant
Bug: T229074
Change-Id: Ib1403638b12ec5808f6b81bd114949043aa9ac2e
2019-11-05 10:56:10 -06:00
Bartosz Dziewoński f3dfd98e55 Don't retry when etag is undefined because the page doesn't exist
Follow-up to 5d1a67757a.

Bug: T233320
Change-Id: Ice27187862dde75c69bbdb666c0981fce94249ba
2019-10-21 19:21:59 +00:00
Bartosz Dziewoński 5d1a67757a Detect mangled etags from RESTBase and retry via MediaWiki API
Something is causing the 'ETag' headers produced by the "public"
RESTBase (queried directly from the client) to be mangled or lost.
My theory is that some proxy or browser extension is doing that.

When we detect a bad etag when fetching the page contents, discard
the result and try querying the "private" RESTBase via the MediaWiki
API (similar to what we do on private wikis, except there we talk
directly to Parsoid instead of RESTBase). After I463a84de63, that
returns the etag as part of the payload rather than HTTP headers,
and should pass unharmed through whatever is mangling the data.

Also compare and log the two etags.

Bug: T233320
Change-Id: I2ef0ca872597566f74b650aea71bf3f15747a6d7
2019-10-16 19:53:43 +02:00
Bartosz Dziewoński 3f0f302577 Enforce that some files must not use the ve global
Previously, the ve-mw/init/ directory contained two kinds of files:
those that were used when initializing VE, and those that may be
loaded even if VE is not going to be initialized at all. The latter
kind must not use the `ve` global variable.

After moving those files to ve-mw/preinit/ we can enforce this with
.eslintrc.json in that directory. This would have prevented T228684.

(Technically they merely must not use `ve.init`, and may use `ve`,
but that's harder to enforce. We should instead move the few non-init
methods out of `ve`: now, track, trackSubscribe, trackSubscribeAll).

Also, group some files under ve-mw/init/: targets/ now (only)
contains ve.init.mw.Target and its subclasses, apiresponsecache/
now contains ve.init.mw.ApiResponseCache and its subclasses.

Bug: T228684
Change-Id: I945249a27f6a0fa10a432d5c5dc57bc7e0461fd8
2019-10-10 15:15:40 +00:00
Renamed from modules/ve-mw/init/ve.init.mw.ArticleTargetLoader.js (Browse further)