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.

Merge pull request 'Port "Remove jQuery from the repo release form"' (#2402) from gusted/forgejo-port-gitea-pr-2 into forgejo

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/2402
Reviewed-by: Earl Warren <earl-warren@noreply.codeberg.org>

+11 -11
+11 -11
web_src/js/features/repo-release.js
··· 1 - import $ from 'jquery'; 2 1 import {hideElem, showElem} from '../utils/dom.js'; 3 2 import {initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js'; 4 3 5 4 export function initRepoRelease() { 6 - $(document).on('click', '.remove-rel-attach', function() { 7 - const uuid = $(this).data('uuid'); 8 - const id = $(this).data('id'); 9 - $(`input[name='attachment-del-${uuid}']`).attr('value', true); 10 - hideElem($(`#attachment-${id}`)); 5 + [...document.querySelectorAll('.remove-rel-attach')].forEach((el) => { 6 + el.addEventListener('click', (e) => { 7 + const uuid = e.target.getAttribute('data-uuid'); 8 + const id = e.target.getAttribute('data-id'); 9 + document.querySelector(`input[name='attachment-del-${uuid}']`).value = 'true'; 10 + hideElem(`#attachment-${id}`); 11 + }); 11 12 }); 12 13 } 13 14 14 15 export function initRepoReleaseNew() { 15 - const $repoReleaseNew = $('.repository.new.release'); 16 - if (!$repoReleaseNew.length) return; 16 + if (!document.querySelector('.repository.new.release')) return; 17 17 18 18 initTagNameEditor(); 19 19 initRepoReleaseEditor(); ··· 45 45 } 46 46 47 47 function initRepoReleaseEditor() { 48 - const $editor = $('.repository.new.release .combo-markdown-editor'); 49 - if ($editor.length === 0) { 48 + const editor = document.querySelector('.repository.new.release .combo-markdown-editor'); 49 + if (!editor) { 50 50 return; 51 51 } 52 - const _promise = initComboMarkdownEditor($editor); 52 + initComboMarkdownEditor(editor); 53 53 }