Commit graph

12189 commits

Author SHA1 Message Date
jenkins-bot 443cb0fe55 Merge "Overwrite "edit source" link only when needed" 2020-04-01 21:51:56 +00: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
MtMNC fd0b145db3 Overwrite "edit source" link only when needed
Prevent JS from overwriting the contents of the "edit source" link
if the change is unnecessary as it can break third-party skins.

Bug: T248025
Change-Id: Ica1e45488813877583efadabc72526544e8943ac
2020-03-27 12:20:33 -07:00
jenkins-bot 774c3ec1e4 Merge "Move MWutils to preinit and rename to parsoid utils" 2020-03-24 22:31:17 +00:00
Ed Sanders de47496b19 Move MWutils to preinit and rename to parsoid utils
Bring in ve.dm.MWInternalLinkAnnotation.static.getTargetDataFromHref
and ve.resolveUrl, so that the file has no dependencies on VE.

Change-Id: I03bc455d5484a6c51f3fa2397c64936b829fe7e3
2020-03-24 23:13:16 +01:00
Bartosz Dziewoński 494fc439fd Fix new section title when switching from NWE to OWE
This code path is triggered when saving a new section in NWE causes an
edit conflict, which should be impossible, but apparently does happen.

Add some TODOs for parameters being added to the API calls in weird
places, instead of the dedicated methods.

Bug: T248364
Change-Id: I0686671e86e35f9ba503d0dd84e9074dde72dc10
2020-03-24 21:57:03 +01:00
jenkins-bot 6c29d69e33 Merge "MWTransclusionDialog: Set 'aria-expanded' on "Show/hide options" button" 2020-03-19 19:57:37 +00:00
jenkins-bot 007604dd24 Merge "Update VE core submodule to master (cf72879d2)" 2020-03-19 19:51:19 +00:00
Akinwale Alagbe 2aeae1c3f9 MWTransclusionDialog: Set 'aria-expanded' on "Show/hide options" button
Adding the ability for screen reader to announce 
the state of the Transclusion dialog 
when the show/hide options button is clicked.

Bug: T248089
Change-Id: I89b86179bcb63376e480cb8df55e24b9d29df037
2020-03-19 19:43:14 +00:00
jenkins-bot fe15e3cc89 Merge "Add accessibility labels to all type: 'list' toolbar groups" 2020-03-19 19:35:52 +00:00
Ed Sanders 788c57a3ea Update VE core submodule to master (cf72879d2)
New changes:
cf72879d2 Show sum/average when selecting multiple numeric cells

Local changes:
Implement number parsing/formatting for table summing

Bug: T247877
Change-Id: I52af622dc8cfe7e77fd7ce88428be092d5b092a2
2020-03-19 12:26:26 -07:00
Bartosz Dziewoński e2cb9ce93e Remove incorrect handling for 'T-' prefix in section numbers
When a page is preprocessed for transclusion, sections are numbered
differently, and the 'T-' prefix indicates this. It can't just be
removed.

It seems that all of our other code can handle section "numbers" like
"T-1" just fine.

Bug: T246164
Change-Id: If19a2d48f94411a89525fb605169c7f8dd4b1797
2020-03-18 21:23:38 +01:00
jenkins-bot 39a8ecf890 Merge "Remove X-Parsoid-Variant configuration value, which is no longer needed" 2020-03-17 00:13:39 +00:00
Bartosz Dziewoński 7b47575a45 Add accessibility labels to all type: 'list' toolbar groups
Bug: T245776
Change-Id: I67d8e239f4fed7dd7ac4b98be3362426e753076b
2020-03-14 14:13:53 +01:00
Akinwale Alagbe a65c905287 Adding aria-label to the widgets in page settings that fail accessibility
Bug: T247048
Change-Id: I08469c9a38d905b8953b471f11839a5b99f4e7c8
2020-03-13 20:54:43 +01:00
jenkins-bot 2c1383b79e Merge "Move checkbox widget creation to mw.libs.ve" 2020-03-13 18:13:46 +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
jenkins-bot a5420c624a Merge "Update VE core submodule to master (ff82c0966)" 2020-03-11 23:32:23 +00:00
jenkins-bot cb9895e304 Merge "Ensure that ve.init.target is correct when re-activating an ArticleTarget" 2020-03-11 23:28:23 +00:00
Ed Sanders 0091d69231 Update VE core submodule to master (ff82c0966)
New changes:
8a3e25b98 build: Updating acorn to 7.1.1
032a2520d Localisation updates from https://translatewiki.net.
ff82c0966 [BREAKING CHANGE] Remove ve.init.target lookup from TargetWidget

Local changes:
* Pass toolbarGroups explicitly form Target to TargetWidget

Change-Id: I4ff6f432412ab958f2858879b2b857278866350a
2020-03-11 23:59:10 +01: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
jenkins-bot 74ee640664 Merge "ve.ui.MWSaveDialog: Remove meta element filtering from wikitext preview" 2020-03-11 15:26:05 +00:00
Ed Sanders bcfb250f56 Ensure that ve.init.target is correct when re-activating an ArticleTarget
Change-Id: Ic30cd99583019823b51f52ab97ee6f9d7adc53f2
2020-03-11 14:45:37 +00:00
jenkins-bot ee43838e79 Merge "Making Categories page in page option dialog accessible" 2020-03-10 19:48:57 +00:00
Ed Sanders 8726a71342 Move switchToWikitext to switchToFallbackWikitext
This should be a no-op as the inherited switchToWikitext
implementation will always call switchToFallbackWikitext
if 'source' is not passed as a supported mode (which it
isn't currently in MobileFrontend).

Change-Id: I213e7d54d158127b5c42bc05ff9ea2dececc42fe
2020-03-09 18:55:15 +00:00
Ed Sanders bc29a8cdd1 MobileArticleTarget: Remove definition of editSource, identical to parent
Change-Id: I939b34416722fe81f643ca48fe1c5f8ea9e3cbc5
2020-03-09 18:55:05 +00:00
Akinwale Alagbe 30c90b867a Making Categories page in page option dialog accessible
Bug: T247122
Change-Id: Id91438bf6bc1bf0781fbbcbed32326c5700bfb7d
2020-03-06 13:32:48 -08:00
Bartosz Dziewoński 734c929ea0 Add some accessibility labels to buttons on mobile
Various buttons have a label on desktop, but only an icon on mobile.
We should still use the label for accessibility.

Change-Id: I2b49a80e174dc30ae997a69662643b28b428263a
2020-03-06 15:09:44 +01:00
Bartosz Dziewoński d0c45940d0 ve.ui.MWSaveDialog: Remove meta element filtering from wikitext preview
Once upon a time, we added code to filter <style> and <link> elements
from the rendering of templates in visual editor, because attempting
to cut them would crash Chrome (T52043).

There are at least three reasons why that is not needed here:
* The preview is not editable text, so you can't cut from it
* The Chrome bug was fixed 7 years ago anyway
* We now use TemplateStyles in articles and they work just fine

The code was added here in 9dd638a5ab
without explanation, I think it was just done for consistency.

Bug: T212085
Change-Id: I0712e3a081f04d0b74cda47652fa6eb118dfe7b2
2020-03-05 16:57:51 +01:00
jenkins-bot c69b46adfc Merge "Clean up code related to token and bad token handling" 2020-03-05 11:25:58 +00:00
jenkins-bot 5bcd4a82f8 Merge "Use built-in mw.Api 'badtoken' handling, also 'assert'/'assertuser'" 2020-03-05 11:25:46 +00:00
jenkins-bot becafcdadf Merge "Fix checkbox handling in the API" 2020-03-02 18:06:36 +00:00
Ed Sanders 42194ec411 Fix checkbox handling in the API
The code for setting 'watchlist' in the EditAPI request
was completely broken as it always evaluated to 'unwatch'.
Instead pass through 'watchlist' directly from the client
where it must be set to 'watch' or 'unwatch'.

Bug: T245579
Change-Id: Ia5a2bb76ef35a685b39bcc0c4727796acd0f510d
2020-02-29 17:35:29 +00:00
jenkins-bot f2cc6d9fc0 Merge "NWE: Don't change editor preference if visual mode not available" 2020-02-27 17:23:53 +00:00
Ed Sanders 71157aab76 NWE: Don't change editor preference if visual mode not available
Bug: T246259
Change-Id: I1513098be707ca5c1a40a061917487785f5100e8
2020-02-27 16:53:45 +00:00
Derk-Jan Hartman 9655bee7de Fix dimensions of WE2017 switch to VE
Correct dimensions are 32px, not 34px.

Bug: T223155
Change-Id: I74da7fc12b642984a680d58c20af054ebaf2e64c
2020-02-26 14:02:41 +01:00
jenkins-bot 4a2d636dab Merge "Fix: non descriptive announcement of version no." 2020-02-25 22:00:52 +00:00
Akinwale Alagbe dd91c3cd09 Fix: non descriptive announcement of version no.
When user navigate to the version number,
the screen reader only narrates the hexadecimal number
associated with the version label without providing context
about what this number represents

Bug: T245470
Change-Id: If9cccac0d71de2de5da96a3a053d21e3deb0d80c
2020-02-25 21:45:31 +00:00
jenkins-bot a2ceb67351 Merge "Fix:Internal and External Link annotation widget" 2020-02-25 16:03:01 +00:00
jenkins-bot a0cf9cb9f6 Merge "ve.ui.MWEducationPopupTool: Autofocus the button to close it" 2020-02-25 14:28:05 +00:00
Akinwale Alagbe d3292378cc Fix:Internal and External Link annotation widget
Adding the ability to special aria-label for the link annotation widgets
in order to aid accessibility to visually impaired audience

Bug: T245294
Change-Id: I3e1fd4a3e3a951092b5212397acc38b2b89a23c2
2020-02-24 16:40:19 -08:00
jenkins-bot 119d3df502 Merge "Remove incorrect init special case for wikitext single edit tab" 2020-02-20 22:39:13 +00:00
Bartosz Dziewoński 387e0d3cb3 Remove incorrect init special case for wikitext single edit tab
This line was added in 9eebfbcac5
and I can't tell what it was supposed to do (that commit's message
only says "Fix NWE-only edit tab", thanks a lot).

Since then the init code was refactored a lot, at some point this
line was moved to be a part of a completely different check (???),
and now it's causing visual mode to be disabled even though the
user only set their preferences to *prefer* wikitext mode.

Bug: T243723
Change-Id: I3c1f502c3cd079fc5eeb2e9587b22d854ae3a72c
2020-02-20 22:37:45 +01:00
Adam Wight c0ad11b960 Purge autosave before submitting merged content
When using TwoColConflict with VisualEditor, the autosave buffer wouldn't
be cleared after saving the successful merge.  This would cause a user to
see a "restore changes?" prompt the next time they entered the editor,
with the potential to confuse them and cause them to do extra work,
repeating the conflict resolution unnecessarily.

This change purges the autosave buffer before submitting a merge.

Note that it is not transactional, so there is a chance we're losing the
autosaved content even if the submit will fail.

Bug: T245119
Change-Id: I150023f548c5565412769d644a828176f907bc25
2020-02-20 09:43:26 +01:00
Bartosz Dziewoński 8c949955e6 ve.ui.MWEducationPopupTool: Autofocus the button to close it
Change-Id: I4c2a3620b0477492713580baab8c3ae503009ed5
2020-02-19 00:25:37 +01:00
jenkins-bot 13108d8f4d Merge "ve.init.mw.DesktopArticleTarget.init: Update for Minerva changes yet again" 2020-02-16 00:13:18 +00:00
jenkins-bot 95a20dbc08 Merge "ve.dm.MWGalleryNode: Preserve 'class' attribute unchanged" 2020-02-15 16:59:56 +00:00
Bartosz Dziewoński a0c603a137 ve.init.mw.DesktopArticleTarget.init: Update for Minerva changes yet again
This continues to take more effort than all other skins combined, but
still every time our overrides get less crazy. Maybe, and stay with me
here, maybe a year and five patches from now I'll remove the last one.
See 91f99ce78d for the last time.

Change-Id: Id880d1cd1ecef59635b347102dc2107204382fb2
2020-02-15 16:40:57 +01:00
Bartosz Dziewoński 8065fdf2b9 Clean up code related to token and bad token handling
Things I noticed while writing I37f8e89b6d92c419d1b6569891612256342f8139,
but which felt too messy to include in that commit.

* Use promise chaining
* Update documentation
* Remove redundant code
* Split a method that now handles two different errors
* Grumble about localisation messages

Change-Id: I81e28a03af4f6c3452679ef6bbcaa89bb1235122
2020-02-15 03:52:40 +01:00
Bartosz Dziewoński 58757d4e3e Use built-in mw.Api 'badtoken' handling, also 'assert'/'assertuser'
When the user is saving their edit, we want to ensure that they
understand how it will be attributed. If the user gets logged out or
logs in in another tab, we want to display a message about it before
saving.

Instead of manually managing tokens and handling the 'badtoken' error
to detect this, use the 'assert'/'assertuser' parameters for the API
to detect it for us. Thanks to this we can rely on automatic retrying
for 'badtoken' errors in mw.Api#postWithToken.

It will be possible to share some of this code with other extensions
that already use ArticleTargetSaver, namely DiscussionTools, now that
it doesn't need to manage tokens for VisualEditor.

Bug: T245327
Depends-On: I485f99e1f5f493262b0c9af22370da01adf1e09c
Change-Id: I37f8e89b6d92c419d1b6569891612256342f8139
2020-02-15 03:37:22 +01:00