1
0
mirror of https://github.com/go-gitea/gitea.git synced 2024-11-04 08:17:24 -05:00
gitea/web_src/js/features/comp
silverwind a3cfe6f39b
Support pasting URLs over markdown text (#29566)
Support pasting URLs over selection text in the textarea editor. Does
not work in EasyMDE and I don't intend to support it. Image paste works
as usual in both Textarea and EasyMDE.

The new `replaceTextareaSelection` function changes textarea content via
[`insertText`](https://developer.mozilla.org/en-US/docs/Web/API/Document/execCommand#using_inserttext)
command, which preserves history, e.g. `CTRL-Z` works and is also
demostrated below. We should later refactor the image paste code to use
the same function because it currently destroys history.

Overriding the formatting via `Shift` key is supported as well, e.g.
`Ctrl+Shift+V` will insert the URL as-is, like on GitHub.


![urlpaste](https://github.com/go-gitea/gitea/assets/115237/522b1023-6797-401c-9e4a-498570adfc88)
2024-03-08 15:15:58 +00:00
..
ColorPicker.js JS refactors (#22227) 2022-12-24 00:03:11 +08:00
ComboMarkdownEditor.js Support pasting URLs over markdown text (#29566) 2024-03-08 15:15:58 +00:00
ConfirmModal.js Change green buttons to primary color (#27099) 2023-09-18 22:05:31 +00:00
EasyMDEToolbarActions.js Fix EasyMDE toolbar (#24489) 2023-05-03 01:23:39 -04:00
LabelEdit.js Allow to archive labels (#26478) 2023-08-14 11:56:14 +02:00
Paste.js Support pasting URLs over markdown text (#29566) 2024-03-08 15:15:58 +00:00
QuickSubmit.js Remove jQuery from the "quick submit" handler (#29200) 2024-02-16 21:03:50 +01:00
ReactionSelector.js Use fetch helpers instead of fetch (#27026) 2023-09-19 00:50:30 +00:00
SearchUserBox.js Improve user search display name (#29002) 2024-02-01 17:10:16 +00:00
TextExpander.js Update JS dependencies, remove space after emoji completion (#25266) 2023-06-18 08:38:47 +00:00
WebHookEditor.js Remove jQuery from the webhook editor (#29211) 2024-02-17 13:17:04 +00:00