refactor(pages): move the Pages settings script into web_src #199
No reviewers
Labels
No milestone
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set
Reference
codefloe/forgejo-codefloe!199
Loading…
Reference in a new issue
No description provided.
Delete branch "enh/pages-settings-script"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Closes #190.
Moves the roughly 380 lines of inline JavaScript and the
<style>block out oftemplates/repo/settings/codefloe_pages.tmplintoweb_src/js/codefloe/pages-settings.js(registered fromweb_src/js/codefloe/index.js) andweb_src/css/codefloe/pages-settings.css.Changes
alert()with hard-coded English is nowshowErrorToastwith two new locale strings (repo.settings.pages.primary_remove_blocked,repo.settings.pages.primary_required), passed throughdata-*attributes on#domains-list.title="Remove domain"is nowrepo.settings.pages.remove_domain.data-clipboard-targetlistener, so its hard-coded'Copied!'is gone and the feedback is the localised tooltip.modules/fetch.js; the log copy button usesclippie.<template>instead ofinnerHTML, and the inlineonclick="return false;"is gone (the disabled link has nohref). Removal is one delegated listener instead of re-cloning every button on each add.style="..."attributes aretw-classes; the remove button sizing moved into the CSS file.word-break: break-wordbecameoverflow-wrap: anywhereto satisfy stylelint.templates/admin/codefloe_pages.tmplhas no inline script or styles, so it is unchanged.Verification
web_src/js/codefloe/pages-settings.test.js(9 tests): domain serialisation, primary validation, add/remove rows, deleted-domain tracking, status rendering and failure, lazy log loading and colour validation.domains_json/deleted_domainswere correct, the log tab loaded, and there were no console errors.81ab7d9e5ba773bbc01f