|
| 1 | +import './globals.ts'; |
| 2 | +import '../fomantic/build/fomantic.js'; |
| 3 | + |
| 4 | +import '../../node_modules/easymde/dist/easymde.min.css'; // TODO: lazy load in "switchToEasyMDE" |
| 5 | + |
| 6 | +import {initHtmx} from './htmx.ts'; |
| 7 | +import {initDashboardRepoList} from './features/dashboard.ts'; |
| 8 | +import {initGlobalCopyToClipboardListener} from './features/clipboard.ts'; |
| 9 | +import {initContextPopups} from './features/contextpopup.ts'; |
| 10 | +import {initRepoGraphGit} from './features/repo-graph.ts'; |
| 11 | +import {initHeatmap} from './features/heatmap.ts'; |
| 12 | +import {initImageDiff} from './features/imagediff.ts'; |
| 13 | +import {initRepoMigration} from './features/repo-migration.ts'; |
| 14 | +import {initRepoProject} from './features/repo-projects.ts'; |
| 15 | +import {initTableSort} from './features/tablesort.ts'; |
| 16 | +import {initAdminUserListSearchForm} from './features/admin/users.ts'; |
| 17 | +import {initAdminConfigs} from './features/admin/config.ts'; |
| 18 | +import {initMarkupAnchors} from './markup/anchors.ts'; |
| 19 | +import {initNotificationCount, initNotificationsTable} from './features/notification.ts'; |
| 20 | +import {initRepoIssueContentHistory} from './features/repo-issue-content.ts'; |
| 21 | +import {initStopwatch} from './features/stopwatch.ts'; |
| 22 | +import {initFindFileInRepo} from './features/repo-findfile.ts'; |
| 23 | +import {initMarkupContent} from './markup/content.ts'; |
| 24 | +import {initRepoFileView} from './features/file-view.ts'; |
| 25 | +import {initUserAuthOauth2, initUserCheckAppUrl} from './features/user-auth.ts'; |
| 26 | +import {initRepoPullRequestAllowMaintainerEdit, initRepoPullRequestReview, initRepoIssueSidebarDependency, initRepoIssueFilterItemLabel} from './features/repo-issue.ts'; |
| 27 | +import {initRepoEllipsisButton, initCommitStatuses} from './features/repo-commit.ts'; |
| 28 | +import {initRepoTopicBar} from './features/repo-home.ts'; |
| 29 | +import {initAdminCommon} from './features/admin/common.ts'; |
| 30 | +import {initRepoCodeView} from './features/repo-code.ts'; |
| 31 | +import {initSshKeyFormParser} from './features/sshkey-helper.ts'; |
| 32 | +import {initUserSettings} from './features/user-settings.ts'; |
| 33 | +import {initRepoActivityTopAuthorsChart, initRepoArchiveLinks} from './features/repo-common.ts'; |
| 34 | +import {initRepoMigrationStatusChecker} from './features/repo-migrate.ts'; |
| 35 | +import {initRepoDiffView} from './features/repo-diff.ts'; |
| 36 | +import {initOrgTeam} from './features/org-team.ts'; |
| 37 | +import {initUserAuthWebAuthn, initUserAuthWebAuthnRegister} from './features/user-auth-webauthn.ts'; |
| 38 | +import {initRepoRelease, initRepoReleaseNew} from './features/repo-release.ts'; |
| 39 | +import {initRepoEditor} from './features/repo-editor.ts'; |
| 40 | +import {initCompSearchUserBox} from './features/comp/SearchUserBox.ts'; |
| 41 | +import {initInstall} from './features/install.ts'; |
| 42 | +import {initCompWebHookEditor} from './features/comp/WebHookEditor.ts'; |
| 43 | +import {initRepoBranchButton} from './features/repo-branch.ts'; |
| 44 | +import {initCommonOrganization} from './features/common-organization.ts'; |
| 45 | +import {initRepoWikiForm} from './features/repo-wiki.ts'; |
| 46 | +import {initRepository, initBranchSelectorTabs} from './features/repo-legacy.ts'; |
| 47 | +import {initCopyContent} from './features/copycontent.ts'; |
| 48 | +import {initCaptcha} from './features/captcha.ts'; |
| 49 | +import {initRepositoryActionView} from './features/repo-actions.ts'; |
| 50 | +import {initGlobalTooltips} from './modules/tippy.ts'; |
| 51 | +import {initGiteaFomantic} from './modules/fomantic.ts'; |
| 52 | +import {initSubmitEventPolyfill} from './utils/dom.ts'; |
| 53 | +import {initRepoIssueList} from './features/repo-issue-list.ts'; |
| 54 | +import {initCommonIssueListQuickGoto} from './features/common-issue-list.ts'; |
| 55 | +import {initRepoContributors} from './features/contributors.ts'; |
| 56 | +import {initRepoCodeFrequency} from './features/code-frequency.ts'; |
| 57 | +import {initRepoRecentCommits} from './features/recent-commits.ts'; |
| 58 | +import {initRepoDiffCommitBranchesAndTags} from './features/repo-diff-commit.ts'; |
| 59 | +import {initGlobalSelectorObserver} from './modules/observer.ts'; |
| 60 | +import {initRepositorySearch} from './features/repo-search.ts'; |
| 61 | +import {initColorPickers} from './features/colorpicker.ts'; |
| 62 | +import {initAdminSelfCheck} from './features/admin/selfcheck.ts'; |
| 63 | +import {initOAuth2SettingsDisableCheckbox} from './features/oauth2-settings.ts'; |
| 64 | +import {initGlobalFetchAction} from './features/common-fetch-action.ts'; |
| 65 | +import {initFootLanguageMenu, initGlobalAvatarUploader, initGlobalDropdown, initGlobalInput, initGlobalTabularMenu, initHeadNavbarContentToggle} from './features/common-page.ts'; |
| 66 | +import {initGlobalButtonClickOnEnter, initGlobalButtons, initGlobalDeleteButton} from './features/common-button.ts'; |
| 67 | +import {initGlobalComboMarkdownEditor, initGlobalEnterQuickSubmit, initGlobalFormDirtyLeaveConfirm} from './features/common-form.ts'; |
| 68 | +import {callInitFunctions} from './modules/init.ts'; |
| 69 | +import {initRepoViewFileTree} from './features/repo-view-file-tree.ts'; |
| 70 | + |
| 71 | +const initStartTime = performance.now(); |
| 72 | +const initPerformanceTracer = callInitFunctions([ |
| 73 | + initHtmx, |
| 74 | + initSubmitEventPolyfill, |
| 75 | + initGiteaFomantic, |
| 76 | + |
| 77 | + initGlobalAvatarUploader, |
| 78 | + initGlobalDropdown, |
| 79 | + initGlobalTabularMenu, |
| 80 | + initGlobalFetchAction, |
| 81 | + initGlobalTooltips, |
| 82 | + initGlobalButtonClickOnEnter, |
| 83 | + initGlobalButtons, |
| 84 | + initGlobalCopyToClipboardListener, |
| 85 | + initGlobalEnterQuickSubmit, |
| 86 | + initGlobalFormDirtyLeaveConfirm, |
| 87 | + initGlobalComboMarkdownEditor, |
| 88 | + initGlobalDeleteButton, |
| 89 | + initGlobalInput, |
| 90 | + |
| 91 | + initCommonOrganization, |
| 92 | + initCommonIssueListQuickGoto, |
| 93 | + |
| 94 | + initCompSearchUserBox, |
| 95 | + initCompWebHookEditor, |
| 96 | + |
| 97 | + initInstall, |
| 98 | + |
| 99 | + initHeadNavbarContentToggle, |
| 100 | + initFootLanguageMenu, |
| 101 | + |
| 102 | + initContextPopups, |
| 103 | + initHeatmap, |
| 104 | + initImageDiff, |
| 105 | + initMarkupAnchors, |
| 106 | + initMarkupContent, |
| 107 | + initSshKeyFormParser, |
| 108 | + initStopwatch, |
| 109 | + initTableSort, |
| 110 | + initFindFileInRepo, |
| 111 | + initCopyContent, |
| 112 | + |
| 113 | + initAdminCommon, |
| 114 | + initAdminUserListSearchForm, |
| 115 | + initAdminConfigs, |
| 116 | + initAdminSelfCheck, |
| 117 | + |
| 118 | + initDashboardRepoList, |
| 119 | + |
| 120 | + initNotificationCount, |
| 121 | + initNotificationsTable, |
| 122 | + |
| 123 | + initOrgTeam, |
| 124 | + |
| 125 | + initRepoActivityTopAuthorsChart, |
| 126 | + initRepoArchiveLinks, |
| 127 | + initRepoBranchButton, |
| 128 | + initRepoCodeView, |
| 129 | + initBranchSelectorTabs, |
| 130 | + initRepoEllipsisButton, |
| 131 | + initRepoDiffCommitBranchesAndTags, |
| 132 | + initRepoEditor, |
| 133 | + initRepoGraphGit, |
| 134 | + initRepoIssueContentHistory, |
| 135 | + initRepoIssueList, |
| 136 | + initRepoIssueFilterItemLabel, |
| 137 | + initRepoIssueSidebarDependency, |
| 138 | + initRepoMigration, |
| 139 | + initRepoMigrationStatusChecker, |
| 140 | + initRepoProject, |
| 141 | + initRepoPullRequestAllowMaintainerEdit, |
| 142 | + initRepoPullRequestReview, |
| 143 | + initRepoRelease, |
| 144 | + initRepoReleaseNew, |
| 145 | + initRepoTopicBar, |
| 146 | + initRepoViewFileTree, |
| 147 | + initRepoWikiForm, |
| 148 | + initRepository, |
| 149 | + initRepositoryActionView, |
| 150 | + initRepositorySearch, |
| 151 | + initRepoContributors, |
| 152 | + initRepoCodeFrequency, |
| 153 | + initRepoRecentCommits, |
| 154 | + |
| 155 | + initCommitStatuses, |
| 156 | + initCaptcha, |
| 157 | + |
| 158 | + initUserCheckAppUrl, |
| 159 | + initUserAuthOauth2, |
| 160 | + initUserAuthWebAuthn, |
| 161 | + initUserAuthWebAuthnRegister, |
| 162 | + initUserSettings, |
| 163 | + initRepoDiffView, |
| 164 | + initColorPickers, |
| 165 | + |
| 166 | + initOAuth2SettingsDisableCheckbox, |
| 167 | + |
| 168 | + initRepoFileView, |
| 169 | +]); |
| 170 | + |
| 171 | +// it must be the last one, then the "querySelectorAll" only needs to be executed once for global init functions. |
| 172 | +initGlobalSelectorObserver(initPerformanceTracer); |
| 173 | +if (initPerformanceTracer) initPerformanceTracer.printResults(); |
| 174 | + |
| 175 | +const initDur = performance.now() - initStartTime; |
| 176 | +if (initDur > 500) { |
| 177 | + console.error(`slow init functions took ${initDur.toFixed(3)}ms`); |
| 178 | +} |
0 commit comments