forgejo-federation/web_src/js
wxiaoguang d4c789dfc1
Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208)
The last PR about clone buttons introduced an JS error when visiting an empty repo page:
* https://github.com/go-gitea/gitea/pull/19028
* `Uncaught ReferenceError: isSSH is not defined`, because the variables are scoped and doesn't share between sub templates.

This:
1. Simplify `templates/repo/clone_buttons.tmpl` and make code clear
2. Move most JS code into `initRepoCloneLink`
3. Remove unused `CloneLink.Git`
4. Remove `ctx.Data["DisableSSH"] / ctx.Data["ExposeAnonSSH"] / ctx.Data["DisableHTTP"]`, and only set them when is is needed (eg: deploy keys / ssh keys)
5. Introduce `Data["CloneButton*"]` to provide data for clone buttons and links
6. Introduce `Data["RepoCloneLink"]` for the repo clone link (not the wiki)
7. Remove most `ctx.Data["PageIsWiki"]` because it has been set in the `/wiki` middleware
8. Remove incorrect `quickstart` class in `migrating.tmpl`
2022-03-29 05:21:30 +02:00
..
components Add apply-patch, basic revert and cherry-pick functionality (#17902) 2022-02-09 20:28:55 +00:00
features Refactor repo clone button and repo clone links, fix JS error on empty repo page (#19208) 2022-03-29 05:21:30 +02:00
markup Various Mermaid improvements (#18776) 2022-02-16 11:28:29 +08:00
standalone Add new JS linter rules (#17699) 2021-11-22 16:19:01 +08:00
vendor Restore Accessibility for Dropdown (#16576) 2021-08-06 01:16:24 +03:00
index.js Fix behavior or checkbox submission. (#18851) 2022-02-22 14:43:11 -05:00
jquery.js Upgrade jQuery to 3.5.0, remove jQuery-Migrate, fix deprecations (#11055) 2020-04-18 18:46:29 -04:00
publicpath.js Frontend refactor, PascalCase to camelCase, remove unused code (#17365) 2021-10-21 15:37:43 +08:00
serviceworker.js Fix serviceworker output file and misc improvements (#11562) 2020-05-24 08:36:40 +01:00
svg.js Add copy button to markdown code blocks (#17638) 2021-11-16 16:16:05 +08:00
svg.test.js Add copy button to markdown code blocks (#17638) 2021-11-16 16:16:05 +08:00
utils.js Detect dark theme via css variable (#17800) 2021-11-25 15:14:48 +08:00
utils.test.js Fix context popup error (#17398) 2021-10-22 22:34:01 +08:00