summaryrefslogtreecommitdiffstats
path: root/web_src/js/features/copycontent.js
Commit message (Collapse)AuthorAgeFilesLines
* Remove fomantic input module (#30194)silverwind2024-03-311-2/+2
| | | | Another pure CSS module. Some styling is part of the `form` module which will likely follow next.
* Use fetch helpers instead of fetch (#27026)silverwind2023-09-191-1/+2
| | | | | | | | | | | | WIP because: - [x] Some calls set a `content-type` but send no body, can likely remove the header - [x] Need to check whether `charset=utf-8` has any significance on the webauthn calls, I assume not as it is the default for json content. - [x] Maybe `no-restricted-globals` is better for eslint, but will require a lot of duplication in the yaml or moving eslint config to a `.js` extension. - [x] Maybe export `request` as `fetch`, shadowing the global.
* Use "small-loading-icon" insead of "btn-octicon is-loading" (#26710)wxiaoguang2023-08-241-2/+2
| | | | | | | | The "btn-octicon is-loading" was introduced by #21842 , it is only used by the "Copy Content" button, but the "btn-octicon" selector would affect too many uncertain elements. Now there is a general "small-loading-icon" class, so the "btn-octicon is-loading" could be removed.
* Add two eslint plugins (#24776)silverwind2023-05-181-1/+1
| | | | | | | | Add these two plugins and autofix issues: - [eslint-plugin-no-use-extend-native](https://github.com/dustinspecker/eslint-plugin-no-use-extend-native) - [eslint-plugin-array-func](https://github.com/freaktechnik/eslint-plugin-array-func)
* Fix WEBP image copying (#24743)silverwind2023-05-161-16/+11
| | | | | Fix regression from https://github.com/go-gitea/gitea/pull/23801, where I forgot that the new module will not throw, so the `catch` handlers were never triggered and in turn, the WEBP was not converted to PNG.
* Use clippie module to copy to clipboard (#23801)silverwind2023-04-021-2/+2
| | | | | | | | | | | | Externalize clipboard copying to the [clippie](https://github.com/silverwind/clippie) module which I feel I can maintain outside this repo for shared benefit with my other projects. The module is feature-equivalent to the previous code and has one improvement where it sets `aria-hidden` on the fallback textarea, preventing screen readers from picking it up. Also it support `Array` of `content` as well to copy multiple items at once, in case it's ever needed.
* JS refactors (#22227)silverwind2022-12-241-0/+1
| | | | | | - Replace all default exports with named exports, except for Vue SFCs - Remove names from Vue SFCs, they are automatically inferred from the filename - Misc whitespace-related tweaks
* Improvements for Content Copy (#21842)silverwind2022-11-211-0/+59
It now supports copying Markdown, SVG and Images (not in Firefox currently because of lacking [`ClipboardItem`](https://developer.mozilla.org/en-US/docs/Web/API/ClipboardItem) support, but can be enabled in `about:config` and works). It will fetch the data if in a rendered view or when it's an image. Followup to https://github.com/go-gitea/gitea/pull/21629.