forgejo/templates
oliverpool 83ea43cf49 frontend: generic lazy loader for webcomponents (#8510)
After seeing #8111 use a webcomponent, I think that they are a neat usecase for Forgejo where most of the frontend is backend-generated, with some "island of enhancements".

I am considering using a webcomponent for the CITATION management (last occurrence of [`Blob.GetBlobContent`](https://codeberg.org/forgejo/forgejo/issues/8222)), however I noticed that the developer experience wasn't ideal.

With this PR it would be very easy to declare a webcomponent, which will be loaded only if needed (I converted `model-viewer` and `pdf-object` to this technique).

Some cleanup in the neighbor webcomponents.

## Testing

1) Create a new repository or use an existing one.
2) Upload a `.pdf` or `.glb`  file (such as https://codeberg.org/forgejo/forgejo/src/branch/forgejo/tests/testdata/data/viewer/Unicode%E2%9D%A4%E2%99%BBTest.glb)
3) Open the Network inspector and view the file in the repository.
    - After a short loading spinner, the PDF or 3D model should be rendered in a viewer
    - the related JS should have been loaded (e.g. http://localhost:3000/assets/js/model-viewer.494bf0cd.js)
    - visiting another page and check that this JS file isn't loaded

Reviewed-on: https://codeberg.org/forgejo/forgejo/pulls/8510
Reviewed-by: Gusted <gusted@noreply.codeberg.org>
Reviewed-by: 0ko <0ko@noreply.codeberg.org>
Reviewed-by: Beowulf <beowulf@beocode.eu>
Co-authored-by: oliverpool <git@olivier.pfad.fr>
Co-committed-by: oliverpool <git@olivier.pfad.fr>
2025-07-23 04:10:50 +02:00
..
admin feat: Admin interface for abuse reports (#7905) 2025-07-23 00:20:15 +02:00
api/packages/pypi Update templates/api/packages/pypi/simple.tmpl 2024-04-12 16:43:30 +00:00
base feat(ui): redesign user profile actions layout (#7906) 2025-06-24 14:16:51 +02:00
custom [FEAT] Repository flags 2024-02-05 16:09:42 +01:00
devtest chore(ui): clean up hashbox CSS, small design changes (#7822) 2025-05-25 12:51:27 +02:00
explore ui: simplify main-attribute labels 2024-12-08 17:30:52 +05:00
htmx feat: reduce amount of morphing for milestone (#8350) 2025-07-15 02:22:49 +02:00
mail fix(email): actions notification template confuses branch with PR (#8448) 2025-07-09 09:43:33 +02:00
moderation feat!: Abusive content reporting (#6977) 2025-05-18 08:05:16 +00:00
org feat(ui): improve org header with new noJS dropdown and more options (#8572) 2025-07-23 02:06:13 +02:00
package several fixes of ALT Package registry (#8475) 2025-07-10 17:12:07 +02:00
projects fix(ui): use gap in switch items (#7581) 2025-04-21 04:25:08 +00:00
repo frontend: generic lazy loader for webcomponents (#8510) 2025-07-23 04:10:50 +02:00
shared feat(ui): redesign user profile actions layout (#7906) 2025-06-24 14:16:51 +02:00
status ui: improve error pages (#7274) 2025-03-28 19:50:43 +00:00
swagger feat: add configuration to only push mirror selected branches (#7823) 2025-07-12 00:39:35 +02:00
user fix(ui): add missing lazy load attribute to images (#8246) 2025-06-25 18:31:03 +02:00
webhook Actions Failure, Succes, Recover Webhooks (#7508) 2025-06-03 14:29:19 +02:00
home.tmpl Split Forgejo landing page template to allow patching or removing Forgejo introduction section (#6675) 2025-02-03 08:41:52 +00:00
home_forgejo.tmpl Split Forgejo landing page template to allow patching or removing Forgejo introduction section (#6675) 2025-02-03 08:41:52 +00:00
install.tmpl Added alt's to <img> 2025-01-31 21:22:00 +00:00
post-install.tmpl [BRANDING] Custom loading animation for Forgejo 2024-02-05 16:02:13 +01:00