loading up the forgejo repo on tangled to test page performance
0
fork

Configure Feed

Select the types of activity you want to include in your feed.

Support Copy Link for video attachments (#24833)

Creating a `<video>` tag with controls and title.

authored by

Brecht Van Lommel and committed by
GitHub
65dff8e3 268d121f

+3
+3
web_src/js/features/common-global.js
··· 7 7 import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js'; 8 8 import {svg} from '../svg.js'; 9 9 import {hideElem, showElem, toggleElem} from '../utils/dom.js'; 10 + import {htmlEscape} from 'escape-goat'; 10 11 11 12 const {appUrl, csrfToken} = window.config; 12 13 ··· 168 169 let fileMarkdown = `[${file.name}](/attachments/${file.uuid})`; 169 170 if (file.type.startsWith('image/')) { 170 171 fileMarkdown = `!${fileMarkdown}`; 172 + } else if (file.type.startsWith('video/')) { 173 + fileMarkdown = `<video src="/attachments/${file.uuid}" title="${htmlEscape(file.name)}" controls></video>`; 171 174 } 172 175 navigator.clipboard.writeText(fileMarkdown); 173 176 });