Commit graph

16398 commits

Author SHA1 Message Date
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
Translation updater bot 66ba383d3e Localisation updates from https://translatewiki.net.
Change-Id: I608d508005e9d89f000aa8527dee779f78962b32
2019-12-10 09:31:22 +01:00
Translation updater bot 801050ba5b Localisation updates from https://translatewiki.net.
Change-Id: I6e4410830ead7a986caa7df0d8a638feaaa70162
2019-12-09 09:37:30 +01:00
Translation updater bot 4d4bee2eb0 Localisation updates from https://translatewiki.net.
Change-Id: I73391b0ffde3fca6fd77c58e777ecc2b2179ba5c
2019-12-06 09:35:35 +01:00
Translation updater bot f1dbf95639 Localisation updates from https://translatewiki.net.
Change-Id: Ia9943451a96450305ca0414513af9a849bd264ed
2019-12-04 09:30:07 +01:00
James D. Forrester 015f796b63 Update VE core submodule to master (3b3dcad84)
New changes:
7017efbce Sanitize HTML on paste

Bug: T239209
Change-Id: I5f59d537d39b64838a222ab0637957429860508f
2019-12-02 17:26:58 -08:00
James D. Forrester 42334f5609 Update VE core submodule to master (5c4b2eec8)
New changes:
3eaba6d96 Localisation updates from https://translatewiki.net.
1324cf759 Localisation updates from https://translatewiki.net.
5c4b2eec8 Localisation updates from https://translatewiki.net.

Change-Id: Icfde040914af973dcd450280379b953907533dff
2019-12-02 11:50:15 -08:00
jenkins-bot 90bbfb5683 Merge "ApiVisualEditorEdit: Simplify diff handling a bit more!" 2019-12-02 11:18:52 +00:00
jenkins-bot 9dbd6ce391 Merge "MWSaveDialog: Fix error handling for diffs" 2019-12-02 11:18:49 +00:00
Translation updater bot 7662ae2b8e Localisation updates from https://translatewiki.net.
Change-Id: Ia0fc0bafe27ddbb5aa5a0f3d43b73d5cca6dfef6
2019-12-02 09:24:34 +01:00
jenkins-bot 51ed492d0b Merge "Don't reject activatingDeferred on loadFail" 2019-11-28 19:47:43 +00:00
Translation updater bot 4254430274 Localisation updates from https://translatewiki.net.
Change-Id: Ib25204bb357f601fc61c9da0c68698d0b6763c90
2019-11-26 09:18:05 +01:00
Translation updater bot 9b43981011 Localisation updates from https://translatewiki.net.
Change-Id: I49d4049f2da893393a977f37ce32b269c17cf182
2019-11-25 09:11:34 +01:00
Bartosz Dziewoński 9779336403 ApiVisualEditorEdit: Simplify diff handling a bit more!
Dealing with `result: 'nochanges'` is annoying. Just return an empty
diff to indicate no changes.

Change-Id: I192caa67ec85224500a6919efd370cf7b5c1c592
2019-11-24 09:51:54 +00:00
Bartosz Dziewoński 092d0c332b MWSaveDialog: Fix error handling for diffs
In case of HTTP errors we'd crash and show no message.

Change-Id: Ideeff4ce75e7ca82ce63bf7ede6dff03eaa1c5d7
2019-11-24 09:51:43 +00:00
Ed Sanders e1db46612c Paste plaintext if conversion fails
Change-Id: I3891888f5d1d1de0c47e7bbcb1897d23b49bfa00
Depends-On: I3e9d5e167274440a424a47c266d8af67574c70b5
2019-11-24 09:37:40 +00:00
Bartosz Dziewoński 65f0264bcf Update VE core submodule to master (9d0ef183a)
New changes:
ea3136678 Add vendor prefixes for tab-size
d39e15064 Allow the afterPaste promise to reject

Change-Id: I2ef20357bf622dd9b65e959f708d273dd2304035
2019-11-24 10:36:51 +01:00
Translation updater bot 48912b3138 Localisation updates from https://translatewiki.net.
Change-Id: If23cf12f6a7d6435c78ac3da9c031288903b1fd9
2019-11-22 09:15:55 +01:00
jenkins-bot e9644ab918 Merge "Set tab-size to 4 in TempWikitextEditorWidget" 2019-11-20 17:27:03 +00:00
Ed Sanders 02d6709b1e Set tab-size to 4 in TempWikitextEditorWidget
Depends-On: Ic4a5ab803c89b3671f452579bca0da08b779bdfe
Change-Id: If6b87b9a86031b846a03d67cd8e05afd7ec0a888
2019-11-20 12:11:43 -05:00
James D. Forrester 7f752a14b1 Update VE core submodule to master (c6b5e46fa)
New changes:
b5d900376 ve.ui.TargetWidget: Avoid exception when destroying widgets
b861d5f72 Disable whitespace replacement in source mode
8530f924b ve.ce.TableEnterKeyDownHandler: unit test failing on Mac

Bug: T153434
Bug: T236949
Bug: T238351
Change-Id: I96da18199e858d32026b60c0494c5e23d0cf6cd0
2019-11-20 11:49:10 -05:00
Translation updater bot 777063bb35 Localisation updates from https://translatewiki.net.
Change-Id: Idf12a3cd2a79e22b0bda2627f01b6be8af5e4534
2019-11-20 09:38:46 +01:00
jenkins-bot a1b6c47962 Merge "Localize some hardcoded English error messages" 2019-11-19 21:18:04 +00:00
jenkins-bot 924e579c19 Merge "ArticleTargetSaver: Fix handling for data.result !== 'success'" 2019-11-19 21:18:01 +00:00
Bartosz Dziewoński a8ab487876 Localize some hardcoded English error messages
Bug: T227325
Change-Id: I5a43b34a4492c20cab4b4ef3eceafaf669e89730
2019-11-19 15:23:58 -05:00
Bartosz Dziewoński 1dc642ee57 ArticleTargetSaver: Fix handling for data.result !== 'success'
The comment here seems to be wrong, as far as I can tell, this
case can only happen when viewing a diff with no changes
(`data.result === 'nochanges'`) or saving an edit and getting
a captcha (`data.result === 'error'`).

The handling here, added in the recent refactor
b0f4b4c94e, causes both of these
cases to behave wrong (displaying the error message, instead of
empty diff / captcha form).

Change-Id: I305e8ca9ff769c229a93d5fb3307e545a0227f2f
2019-11-19 14:23:58 -05:00
jenkins-bot ab62ad729d Merge "ApiVisualEditorEdit: Simplify diff handling a bit" 2019-11-19 16:09:14 +00:00
jenkins-bot 2e6e75233f Merge "Remove unused message 'visualeditor-loaderror-title'" 2019-11-19 16:09:11 +00:00
jenkins-bot 8a65008317 Merge "EditAttemptStep: Allow session ID override from query string or mw.config" 2019-11-19 14:19:44 +00:00
Translation updater bot 93a9811159 Localisation updates from https://translatewiki.net.
Change-Id: Ib16f2bb9031ee4ee4d4fd73b8fd2e998c3b4c81a
2019-11-19 09:35:30 +01:00
Roan Kattouw eebe4cd993 Unbreak instrumentation of init events
ve.track.js was being loaded twice, once early on as part of the
ext.visualEditor.track module, and again later on as part of the
ext.visualEditor.core.utils module (which it was added to by b676b22).
This caused ve.trackSubscribe()'s buffer to be reset. Recording the
first init event relies on this buffer, because it's logged with
ve.track() before the logger subscribes with ve.trackSubscribe().
Subsequent init events did get logged. Some performance logging during
initialization was also dropped, but the 'ready' event and subsequent
events were logged correctly.

Fix this by loading ve.track.js only once, as part of the
ext.visualEditor.track module. Make ext.visualEditor.core.utils depend
on ext.visualEditor.track, rather than also adding ve.track.js to it.

Change-Id: I781595d27edb2dc0ad662fcc8e3c7cb0ddae78f1
2019-11-18 17:19:16 -08:00
Roan Kattouw 0f97e1dce9 EditAttemptStep: Allow session ID override from query string or mw.config
Similar to WikiEditor, allow the editing_session_id value to be
overriden through the editingStatsId query parameter. Also allow
server-side code to override the session ID by setting
wgWMESchemaEditAttemptStepSessionId in mw.config.

Only apply the override to the first session. Once a second init event
happens, discard the overridden editing_session_id and generate a fresh
one.

Bug: T238249
Change-Id: I4ede70f310a35c95b6eb9cc34cfcf2baa77e69ee
2019-11-18 17:18:10 -08:00
Bartosz Dziewoński 1e890f975f ApiVisualEditorEdit: Simplify diff handling a bit
I'm trying to track down possible values of 'result' for client-side
error handling and this was confusing.

Change-Id: I325249f7c57936c9c11a1d3dc9166b1ca3737c39
2019-11-18 15:57:36 -05:00
Bartosz Dziewoński 99cd4e26e9 Remove unused message 'visualeditor-loaderror-title'
Introduced in 7653dec439 (2015),
has never actually been used.

Change-Id: I35d06b50fbfdfdfbfdcfd0acbe094895a4f7698d
2019-11-18 15:25:45 -05:00
Bartosz Dziewoński 050227aee6 Remove unused message 'visualeditor-loadwarning-token'
No longer used since a701e87caa (2013).

Change-Id: I7708453ac321a92893a1d92c3082023f9ebe769c
2019-11-18 15:18:36 -05:00
Translation updater bot 71ed114518 Localisation updates from https://translatewiki.net.
Change-Id: I6b588e891eaa7ca86e2a2cc324cdc281e529075a
2019-11-18 09:24:46 +01:00
Translation updater bot 99cec5d610 Localisation updates from https://translatewiki.net.
Change-Id: Ie64d17d6a4729377a7d492b1f5cf351f93de7c8b
2019-11-15 09:22:29 +01:00
jenkins-bot 35f2093c62 Merge "Move more code to ArticleTargetSaver" 2019-11-14 21:26:24 +00:00
Ed Sanders 687882f596 Don't reject activatingDeferred on loadFail
loadFail can result in a retry, in which case it isn't
approraite to reject this promise. Also many of the code
paths call 'tryTeardown' which itself will reject the promise.

Bug: T238332
Change-Id: I366662847304d8ecf79d5899b2804dded67ee999
2019-11-14 15:23:46 +00:00
Ed Sanders b0f4b4c94e Move more code to ArticleTargetSaver
* Add a postWikitext method and split out postContent
  from postHtml
* Move saveSuccess handling into postContent promise
* Connect promise directly to saveComplete instead
* Pass whole response.visualeditoredit object, instead
  of splitting into variadic arguments for saveComplete.
* [DEPRECATION] Make serialize return the postHtml promise
  and deprecate passing a callback.

Change-Id: I905737515578000b2b87214c92e8b9fe9e82f6b7
2019-11-14 14:34:22 +00:00
Bartosz Dziewoński c8fa50c3b2 Exactly match collapsible logic of jquery.makeCollapsible
Bug: T236247
Change-Id: Iaf8e8515585989fd8ca64ffd33b02399a69278b4
2019-11-13 23:26:08 +00:00
Bartosz Dziewoński a4d7c41e68 ApiVisualEditorEdit: Normalize newlines in wikitext
Firefox apparently sends us \r\n newlines, even though we use \n.

Bug: T154977
Change-Id: I22e9a2e11c63ab62b6e37c86455638bf23d5b431
2019-11-13 23:24:06 +01:00
Translation updater bot ca003af9fb Localisation updates from https://translatewiki.net.
Change-Id: I9482810437bd136282db16877e11238d0fc83d16
2019-11-13 09:27:40 +01:00
Ed Sanders 6caa4601aa Generate internal links locally
Bug: T147230
Change-Id: Ib154ffebb601dc76c708f2d8a8315cbf98ff6da1
2019-11-12 20:36:00 +00:00
Bartosz Dziewoński 3e93c00a28 Update VE core submodule to master (12422dc27)
New changes:
ce76e95d4 Allow config to be passed to mock surfaces
12e2d2686 tests: Put FragmentInspector test runner in shared util

Change-Id: I426ae2cb96ca8dd126656c018740ec122007c2ff
2019-11-12 21:33:59 +01:00
jenkins-bot 84663fab0f Merge "Add missing FragmentInspector tests to MW" 2019-11-12 15:27:39 +00:00
jenkins-bot 206c440a4e Merge "tests: Have MWDummyTarget create the correct surface type" 2019-11-12 15:26:41 +00:00
Ed Sanders 545c6f1301 Add missing FragmentInspector tests to MW
Requires unregistering MWLinkAnnotationInspector

Bonus: Remove unnecessary list of unregsiters as
teardownOverrides is run on init.

Change-Id: I3e36ab7736cc8479ab53f40d2eb24c0fa15d3dc0
2019-11-12 13:52:35 +00:00
Translation updater bot 59004a75d9 Localisation updates from https://translatewiki.net.
Change-Id: Ie09a3e51f44cb212a005b7da7929996e6a74adb6
2019-11-12 09:33:12 +01:00
Ed Sanders 3542799ab4 tests: Have MWDummyTarget create the correct surface type
Change-Id: I3cd025d726e9db56a2391ef52852d1cb2f4305a0
2019-11-11 20:22:33 +00:00