gitea/web_src/js
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
..
components Set user's 24h preference from their current OS locale (#29651) 2024-03-08 16:07:56 +08:00
features Support pasting URLs over markdown text (#29566) 2024-03-08 15:15:58 +00:00
markup Fix user-defined markup links targets (#29305) 2024-03-08 09:53:01 +00:00
modules Set user's 24h preference from their current OS locale (#29651) 2024-03-08 16:07:56 +08:00
render Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
standalone Add toasts to UI (#25449) 2023-06-27 02:45:24 +00:00
utils Support pasting URLs over markdown text (#29566) 2024-03-08 15:15:58 +00:00
vendor Vendor jquery.are-you-sure with strict mode fixes (#26901) 2023-09-06 00:02:44 +00:00
webcomponents Fix URL calculation in clone input box (#29470) 2024-02-28 15:04:04 +00:00
bootstrap.js Fix/Improve processWindowErrorEvent (#29407) 2024-02-28 22:20:53 +00:00
bootstrap.test.js Avoid duplicate JS error messages on UI (#28873) 2024-01-21 14:23:08 +00:00
htmx.js Auto-update the system status in admin dashboard (#29163) 2024-02-16 02:52:25 +00:00
index.js Filter Repositories by type (#29231) 2024-03-03 10:18:34 +00:00
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) 2020-04-18 18:46:29 -04:00
svg.js Artifact deletion in actions ui (#27172) 2024-02-18 10:33:50 +00:00
svg.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
utils.js enforce maxlength in frontend (#29389) 2024-02-25 14:31:15 +00:00
utils.test.js Use vitest globals (#27102) 2023-09-27 04:37:13 +00:00
vitest.setup.js Move vitest setup file to root (#29097) 2024-02-08 20:07:02 +08:00