Commit graph

113 commits

Author SHA1 Message Date
Ed Sanders 2359b587ed ve.collab: Create ResouceLoader module
Change-Id: I2fd9d604521901e3ccdf862afc0a4f2099c533b1
2024-03-06 16:31:19 +00:00
Ed Sanders d42a0772bb Move verbose copyright message to AUTHORS.txt
Avoids having to update the date in every file every year,
which we stopped doing.

Change-Id: I7bf7aa0937eef911e00772470091753a7b06fd3d
2023-12-01 16:07:39 +00:00
Ed Sanders ba28b340db CollabTarget: Remove unused CSS rules
Change-Id: I7439fcef195f59cb1a30f264d1164a91c67424d2
2023-11-09 12:46:31 +00:00
Bartosz Dziewoński bbda4fc160 Revert "Revert "Targets: Use align:'after' instead of actionGroups""
This reverts commit e2b5e2a1bb.
It should be safe to re-attempt this now.

Bug: T339317
Change-Id: Ia4ebb11ca162a4e6d985076ea2d2dd914d04fc1d
2023-06-29 18:17:01 +00:00
Bartosz Dziewoński e2b5e2a1bb Revert "Targets: Use align:'after' instead of actionGroups"
This reverts commit 45a60e3fb2.

Bug: T339292
Change-Id: Ifefdf36370ff0de87218f390e5e21d2800a81ebd
2023-06-15 20:06:21 +00:00
Ed Sanders 45a60e3fb2 Targets: Use align:'after' instead of actionGroups
Change-Id: I2b2b0c86697e3afde7ea192ce6dc5996998dfa4b
2023-06-09 18:09:27 +01:00
Bartosz Dziewoński 51a8541255 Replace references to actionsToolbar
Target#actionsToolbar and Target#toolbar refer to the same object
since change dfaed62d3632d381db9682c603b3ddbeed182292 in VE/VE
(barring bugs like T335469). Once we no longer use the old name,
we'll be able to remove this backwards-compatibility alias.

Bug: T335469
Change-Id: I577e8ae6a857519eb0e8181543ca0a96b515e019
2023-04-27 15:51:35 +02:00
Ed Sanders 7954f5897c Update VE core submodule to master (f5142bc0d)
New changes:
1b912ce6b ve.ui.DiffElement: Don't override margin on added/removed block elements
a43720b34 [BREAKING CHANGE] Move ve.dm.MetaList to ve.dm.Document
e7d6d2317 ve.dm.VisualDiff: Include metadata in diff

Local changes:
* Use new ve.dm.MetaList API

Bug: T331925
Change-Id: Id21c122d48519013a5c3325cc4bc316cedcb63f6
2023-03-14 23:07:14 +01:00
Ed Sanders e4ce6db868 Update eslint-config-wikimedia to 0.24.0
Change-Id: I8299d287721eee6cb6d2354836e82812bf57badd
2023-01-18 14:39:04 +00:00
Bartosz Dziewoński fd80fae57f Replace mediawiki.Uri with native URL (easy cases)
Replacing one-off uses in various auxiliary features: only used
in function scope (or narrower), nothing else depends on them.
Some of them didn't even need to do any URL parsing or formatting.

Bug: T325249
Change-Id: Ia9a18656f67cb0a204c87605459abb9f5bbdc347
2023-01-03 22:18:01 +01:00
Bartosz Dziewoński 133cacc42d Remove obsolete browser support checks for HTML5 History API
It is available in all browsers we support.

Change-Id: I6c860eadd91e6e4061ed0364be0dc8c7b750d3e7
2022-12-12 20:47:32 +01:00
Ed Sanders 686ef07ed3 Pass empty string to unused argument of pushState/replaceState
Per https://developer.mozilla.org/en-US/docs/Web/API/History/replaceState
this argument is treated as unused in all the browsers we support.

Change-Id: I83d3e2e8d9d2defa49e7a832f78bfc29f15da719
2022-08-09 13:37:34 +01:00
Jan Drewniak a3e28fa0bf Rename data-ve-target-container attribute to data-mw-ve-target-container
This data attribute, used to give skins the ability to position VE on the
page, should be prefixed with `data-mw` to prevent it being inserted on
the page by user generated content.

Bug: T310197
Change-Id: Ia6f87535f11ccc7aadb26b7dd9e1ac8a867c377c
2022-06-23 10:49:07 -04:00
Jan Drewniak 2e42a46654 Introduce data-ve-target-container as a skin-customizable VE target
Defines an HTML attribute, `data-ve-target-container` that gives skins
the ability to choose which element they want to act as VE's target.

This attribute addresses a need in the Vector 2022 skin, where the
default selector, `#content` was no longer suitable to act as VE's
content container and more flexible approach was needed, so that the
skin itself could define which element VE should use.

This selector falls back to `#content` as was the case previously.

Additional change:
Update modules/ve-mw/preinit/styles/ve.init.mw.DesktopArticleTarget.init-vector.less
to account for the planned change to retain line between tabs and
toolbar in new layout.

Bug: T310197
Change-Id: Idae6755c90eacaab1a9daa88c6e28850d427810c
2022-06-22 20:18:12 +00:00
Adam Wight b189ce2825 Special:CollabPad supports importTitle parameter
This lets us begin the import from another page, for example an edit
tab or button.

If the CollabPad page already exists, it will be opened without
overwriting with freshly-imported page contents.

Change-Id: I89293b9b06253243826d8f8144a5e93d55856e7c
2022-05-21 14:48:09 +02:00
Ed Sanders 78decedd47 Desktop: Always show loading progress in a toolbar placeholder
Bug: T299907
Change-Id: I0eaeb98719bf7a43e4a87366cfcd204f35b74650
2022-02-14 16:17:48 +00:00
libraryupgrader aa28b52dc9 build: Updating npm dependencies
* eslint-config-wikimedia: 0.21.0 → 0.22.1
* ansi-regex: 5.0.1 → 5.0.1
  * https://github.com/advisories/GHSA-93q8-gq69-wqmw
* meow: 3.7.0 → 3.7.0
  * https://github.com/advisories/GHSA-7p7h-4mm5-852v
* string-width: 4.2.3 → 4.2.3
  * https://github.com/advisories/GHSA-93q8-gq69-wqmw
* strip-ansi: 6.0.1 → 6.0.1
  * https://github.com/advisories/GHSA-93q8-gq69-wqmw
* trim-newlines: 1.0.0 → 1.0.0
  * https://github.com/advisories/GHSA-7p7h-4mm5-852v

Change-Id: Iad400485f197940efd00dfabaddcae805365d116
2022-02-09 07:52:22 +00:00
Ed Sanders 2098292318 Use no-jquery/no-html to warn against writing HTML strings to the DOM
This forces us to comment when we are doing this deliberately.

Change-Id: Ide1bcb64f6c6076b48e88f1f27045bd93392f8a0
2021-12-16 01:28:42 +00:00
Ed Sanders 4d13a4f4ed eslint: Enable no-jquery/no-append-html
Prevents accidentally treating plain text or user input
as HTML, which could be an XSS vulnerability.

Change-Id: Id4af48447a0907962a57340cb60aca08df9cc505
2021-12-16 02:04:11 +01:00
Ed Sanders 5c0344aeda Use new select[First|Last]SelectableContentOffset methods
* Make ve.ce.MWBlockImageNode autofocus=false, remove
  unused transition property
* Remove ignoreChildren from ve.dm.MWBlockImageNode
  based on new definition
* Remove tests which assert that deleting in a list next
  to a block image always de-indents. If this is desired
  behaviour it should be fixed without reference to
  ignoreChildren.

Bug: T295905
Depends-On: Idc0cccbe73d1b49d07b60c14a192a40f47d64608
Change-Id: Ib79a070f5d36dbe7742fa0760f8cdf55fe3046ed
2021-12-08 15:53:35 +00:00
jenkins-bot 90643ef6d0 Merge "Prefere ve.extendObject over $.extend" 2021-11-18 21:22:16 +00:00
Ed Sanders 86c405a2e1 Prefere ve.extendObject over $.extend
Change-Id: I37fef45701653cef08de9ec699865aa4fdf477bc
2021-11-15 21:30:19 +00:00
Ed Sanders 24d7f3f4d4 MobileCollabTarget: Add surface class using dedicated method
Change-Id: I8a977115a67dd894a9b469d68e4cc6078fe12463
2021-11-15 18:05:58 +00:00
Ed Sanders 3801aa1bac Move var declarations inline
Change-Id: I12639c515e33b3d9e7a819581b5022ea42fd7046
2021-10-13 14:02:31 +01:00
Bartosz Dziewoński a4cafb1691 Update VE core submodule to master (1f76dea7e)
New changes:
6cde8742e i18n: Rename keys for error messages in rebaser

Local changes:
* Rebaser i18n message renames

Change-Id: I0c2e3a956c81f625822bacd40835dc4fadb57211
2021-06-04 23:53:02 +02:00
Ed Sanders a71dd4f797 Ensure correct classes are added to surfaces
* Create getSurfaceClasses method.
* Pass surfaceClasses to target widgets.

This ensures that the 'content' class is passed to mobile
target widgets, and the 'mw-body-content' class is added
in a less hacky way.

Change-Id: Ibce6d1a1d0fda63cca354761f1b91f808858e95b
2021-05-23 20:04:28 +01:00
Ed Sanders 2f4140117a Add 'close' flags to closing actions in dialogs
Change-Id: Ib0eb947432c3cdaa316d1a8116d4ab91f791930d
2020-12-07 18:53:16 +00:00
Ed Sanders 4b9ad322ea CollabTarget: Fix focus of authorList
Change-Id: I91e4fb75af6b65df9da2d8b2f7277e685d54d0f8
2020-12-04 17:59:48 +00: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
Ed Sanders 09f4af2a63 CollabTarget: Add close button on mobile
Move comment button into 'insert' menu to make room.

Change-Id: I00ace1477d08041e9af6d81ae2e6635151575f8b
2020-08-03 07:55:06 +00:00
Ed Sanders 76cea9b235 ExportWikitextDialog: Make height of wikitext input fit dialog
Change-Id: If60dc55a442ffb255248d3bf5c3e1d0e14b2821f
2020-07-31 16:27:27 +01:00
Ed Sanders ec872093aa ExportWikitextDialog: Add help text
Change-Id: I5508c167aa8119eb86356858fc0eedf69cc093bf
2020-07-30 16:43:59 +01:00
Ed Sanders a9d7884d3b ExportWikitextDialog: Add ellipses to "Export" buttons
This indicates these are not the final actions in the process.

Change-Id: I88227a1025f56ea59ef76a59b81cde22e81a959a
2020-07-30 16:23:02 +01:00
Ed Sanders 3ebcf5695d ExportWikitextDialog: Add copy button to wikitext
Change-Id: I8ed63a0ac38a812b09e51738b25b6b384ba30c04
2020-07-30 16:17:32 +01:00
Ed Sanders d8a0f475e4 ExportWikitextDialog: Fix title comparison
getImportTitle may be null

Change-Id: I04d3504e1b4d815859d3ea57fb846ea2277ee5fa
2020-07-30 16:17:32 +01:00
Mvolz 842a728488 Revert "Allow generic params to be passed to getWikitextFragment"
This reverts commit e5c1ef651b.

This change caused an error where templates failed to be inserted
into wikitext in the 2017 wikitext editor.

Bug: T255785
Change-Id: Ie57c49e68e594be22af2b1b479840f29e46131db
2020-06-19 13:15:23 +00:00
Ed Sanders e5c1ef651b Allow generic params to be passed to getWikitextFragment
mw.Target doesn't know about revid and etag, so move that logic
to ArticleTarget, where the param can still just be a boolean.

Change-Id: Idf4632cd28554aaf5bbf5f2b44ded047c0c4b182
2020-06-04 22:45:09 +01:00
Ed Sanders 6076708ff3 build: Update eslint-config-wikimedia to 0.16.0
Change-Id: I638e0f82949597e2a2e4ea18fc2f0258f225358c
2020-06-02 21:30:00 +01: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 7b47575a45 Add accessibility labels to all type: 'list' toolbar groups
Bug: T245776
Change-Id: I67d8e239f4fed7dd7ac4b98be3362426e753076b
2020-03-14 14:13:53 +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
James D. Forrester 2c77e88d2c doc: Bump copyright year for 2020
Change-Id: I30539877543dc2a57bd1428a00d10ac46d8fc294
2020-01-08 09:13:24 -08:00
Ed Sanders 5a24e78616 Prefix document titles with wgWikiID
This allows one rebase server to serve multiple wikis.

Change-Id: I212e6d0eca99a5d5a0d1634078f63e63e0574506
2019-12-17 14:55:05 +00:00
David Chan 22098d6b16 Convert $.Deferred() to ve.createDeferred(), except in preinit
Follow-up to a8e07e026dea4f54241d1dbb6b7bcdbd8c670db2 in core.

Change-Id: I09333adb4876c6e584a4a6b6a1628227c4cd2616
2019-11-02 13:06:28 +08:00
Ed Sanders 57d8e53111 Catch errors during document initialization
Change-Id: I5dc29666f99ac10bbf63a56153ba9a32d3568daa
Depends-On: I57fb6319bc3a9cee347c39fc75f555543991d703
2019-10-11 15:13:10 +00:00
Ed Sanders 901f107bd0 Delete mobile toolbar flexbox code, upstreamed to VE core
Depends-On: If973baa556a557c2fe5cb3aed44f937fc9d2b62e
Change-Id: I775fb24bd16572cfb8472f5260a7552b2fbb9930
2019-09-03 17:30:19 +00:00
Ed Sanders 32042d76e8 Update VE core submodule to master (fbbb9c4cb)
New changes:
854a1fa2c Distinguish active link styling

Local changes:
* Pull through active link styling

Bug: T228220
Change-Id: I925f88d32a514a749b96f501a211003bc4c924f0
2019-07-25 20:25:54 +00:00
Ed Sanders 20561e7e10 Remove citefromid alias support
Change-Id: I74d67a2ea5118ee18c462ccfea06a72cc73c627b
2019-06-20 16:06:07 +01:00
Ed Sanders 48b4051bef CollabTarget: Enable undo
Change-Id: I228ae26662d6577a1499ded1611b48a96f2fc8ef
Depends-On: Ic40e7290a06175916c8b7c0b20b5e8e8acbba7c8
2019-06-04 22:59:13 +00:00
Ed Sanders 25cbd22b23 Synchronizer: Fix defaultName config
Change-Id: I2b7482f6405d7da8515f30c8060f7eac1758e6a9
2019-06-01 17:51:41 +01:00