You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
gitea/web_src/js/features
wxiaoguang 27bf63ad20
Refactor global init code and add more comments (#33755)
Follow up #33748

Now there are 3 "global" functions:

* registerGlobalSelectorFunc: for all elements matching the selector, eg: `.ui.dropdown`
* registerGlobalInitFunc: for `data-global-init="initInputAutoFocusEnd"`
* registerGlobalEventFunc: for `data-global-click="onCommentReactionButtonClick"`


And introduce `initGlobalInput` to replace old `initAutoFocusEnd` and
`attachDirAuto`, use `data-global-init` to replace fragile
`.js-autofocus-end` selector.

Another benefit is that by the new approach, no matter how many times
`registerGlobalInitFunc` is called, we only need to do one
"querySelectorAll" in the last step, it could slightly improve the
performance.
3 weeks ago
..
admin Add cropping support when modifying the user/org/repo avatar (#33498) 2 months ago
comp Fix dynamic content loading init problem (#33748) 4 weeks ago
captcha.ts Fix mCaptcha bug (#33659) 1 month ago
citation.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
clipboard.ts Enable Typescript `strictFunctionTypes` (#32911) 3 months ago
code-frequency.ts Convert frontend code to typescript (#31559) 9 months ago
codeeditor.ts Improve JSX/TSX support in code editor (#32833) 3 months ago
colorpicker.ts Enable Typescript `strictFunctionTypes` (#32911) 3 months ago
common-button.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
common-fetch-action.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
common-form.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
common-issue-list.test.ts Convert frontend code to typescript (#31559) 9 months ago
common-issue-list.ts Fix remaining typescript issues, enable `tsc` (#32840) 3 months ago
common-organization.ts Add cropping support when modifying the user/org/repo avatar (#33498) 2 months ago
common-page.ts Refactor global init code and add more comments (#33755) 3 weeks ago
contextpopup.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
contributors.ts Add "n commits" link to contributors in contributors graph page (#32799) 3 months ago
copycontent.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
dashboard.ts Enable Typescript `noImplicitThis` (#33250) 2 months ago
dropzone.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
emoji.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
eventsource.sharedworker.ts Enable Typescript `strictFunctionTypes` (#32911) 3 months ago
file-fold.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
heatmap.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
imagediff.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
install.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
issue.ts Trivial fixes (#33304) 2 months ago
notification.ts Refactor legacy JS (#33115) 3 months ago
oauth2-settings.ts Enable Typescript `strictFunctionTypes` (#32911) 3 months ago
org-team.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
pull-view-file.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
recent-commits.ts Convert frontend code to typescript (#31559) 9 months ago
repo-actions.ts Enable Typescript `noImplicitThis` (#33250) 2 months ago
repo-branch.ts Fix a number of typescript errors (#32773) 4 months ago
repo-code.ts Refactor legacy line-number and scroll code (#33094) 3 months ago
repo-commit.ts Enable Typescript `noImplicitThis` (#33250) 2 months ago
repo-common.test.ts Improve Open-with URL encoding (#33666) 1 month ago
repo-common.ts Clone repository with Tea CLI (#33725) 4 weeks ago
repo-diff-commit.ts Fix a number of typescript errors (#32773) 4 months ago
repo-diff-commitselect.ts Convert frontend code to typescript (#31559) 9 months ago
repo-diff-filetree.ts Use `git diff-tree` for `DiffFileTree` on diff pages (#33514) 4 weeks ago
repo-diff.ts Refactor global init code and add more comments (#33755) 3 weeks ago
repo-editor.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
repo-findfile.test.ts Convert frontend code to typescript (#31559) 9 months ago
repo-findfile.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
repo-graph.ts Fix dynamic content loading init problem (#33748) 4 weeks ago
repo-home.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
repo-issue-content.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
repo-issue-edit.ts Fix js error when edit issue (#33384) 2 months ago
repo-issue-list.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
repo-issue-pr-form.ts Convert frontend code to typescript (#31559) 9 months ago
repo-issue-pr-status.ts Fix a number of typescript errors (#32773) 4 months ago
repo-issue-sidebar-combolist.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
repo-issue-sidebar.md Fix issue sidebar dropdown keyboard support (#33447) 2 months ago
repo-issue-sidebar.ts Refactor legacy JS (#33115) 3 months ago
repo-issue.ts Hide/disable unusable UI elements when a repository is archived (#33459) 2 months ago
repo-legacy.ts Refactor repo-diff.ts (#33746) 4 weeks ago
repo-migrate.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
repo-migration.ts Fix a number of typescript errors (#32773) 4 months ago
repo-milestone.ts Fix milestone deadline and date related problems (#32339) 5 months ago
repo-new.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
repo-projects.ts Refactor repo-projects.ts (#32892) 3 months ago
repo-release.ts Enable Typescript `strictFunctionTypes` (#32911) 3 months ago
repo-search.ts Enable Typescript `strictFunctionTypes` (#32911) 3 months ago
repo-settings-branches.test.ts Refactor repo-projects.ts (#32892) 3 months ago
repo-settings-branches.ts Allow cropping an avatar before setting it (#32565) 4 months ago
repo-settings.ts Add cropping support when modifying the user/org/repo avatar (#33498) 2 months ago
repo-unicode-escape.ts Fix "unicode escape" JS error (#32806) 3 months ago
repo-wiki.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
sshkey-helper.ts Enable Typescript `noImplicitThis` (#33250) 2 months ago
stopwatch.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
tablesort.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
tribute.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
user-auth-webauthn.ts Enable Typescript `noImplicitAny` (#33322) 2 months ago
user-auth.ts Warn users when they try to use a non-root-url to sign in/up (#32272) 5 months ago
user-settings.ts Add cropping support when modifying the user/org/repo avatar (#33498) 2 months ago