|  | 
|  | 1 | +import './globals.ts'; | 
|  | 2 | +import './htmx.ts'; | 
|  | 3 | +import '../fomantic/build/fomantic.js'; | 
|  | 4 | + | 
|  | 5 | +import '../../node_modules/easymde/dist/easymde.min.css'; // TODO: lazy load in "switchToEasyMDE" | 
|  | 6 | + | 
|  | 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 | +initGiteaFomantic(); | 
|  | 72 | +initSubmitEventPolyfill(); | 
|  | 73 | + | 
|  | 74 | +const initStartTime = performance.now(); | 
|  | 75 | +const initPerformanceTracer = callInitFunctions([ | 
|  | 76 | +  initGlobalAvatarUploader, | 
|  | 77 | +  initGlobalDropdown, | 
|  | 78 | +  initGlobalTabularMenu, | 
|  | 79 | +  initGlobalFetchAction, | 
|  | 80 | +  initGlobalTooltips, | 
|  | 81 | +  initGlobalButtonClickOnEnter, | 
|  | 82 | +  initGlobalButtons, | 
|  | 83 | +  initGlobalCopyToClipboardListener, | 
|  | 84 | +  initGlobalEnterQuickSubmit, | 
|  | 85 | +  initGlobalFormDirtyLeaveConfirm, | 
|  | 86 | +  initGlobalComboMarkdownEditor, | 
|  | 87 | +  initGlobalDeleteButton, | 
|  | 88 | +  initGlobalInput, | 
|  | 89 | + | 
|  | 90 | +  initCommonOrganization, | 
|  | 91 | +  initCommonIssueListQuickGoto, | 
|  | 92 | + | 
|  | 93 | +  initCompSearchUserBox, | 
|  | 94 | +  initCompWebHookEditor, | 
|  | 95 | + | 
|  | 96 | +  initInstall, | 
|  | 97 | + | 
|  | 98 | +  initHeadNavbarContentToggle, | 
|  | 99 | +  initFootLanguageMenu, | 
|  | 100 | + | 
|  | 101 | +  initContextPopups, | 
|  | 102 | +  initHeatmap, | 
|  | 103 | +  initImageDiff, | 
|  | 104 | +  initMarkupAnchors, | 
|  | 105 | +  initMarkupContent, | 
|  | 106 | +  initSshKeyFormParser, | 
|  | 107 | +  initStopwatch, | 
|  | 108 | +  initTableSort, | 
|  | 109 | +  initFindFileInRepo, | 
|  | 110 | +  initCopyContent, | 
|  | 111 | + | 
|  | 112 | +  initAdminCommon, | 
|  | 113 | +  initAdminUserListSearchForm, | 
|  | 114 | +  initAdminConfigs, | 
|  | 115 | +  initAdminSelfCheck, | 
|  | 116 | + | 
|  | 117 | +  initDashboardRepoList, | 
|  | 118 | + | 
|  | 119 | +  initNotificationCount, | 
|  | 120 | +  initNotificationsTable, | 
|  | 121 | + | 
|  | 122 | +  initOrgTeam, | 
|  | 123 | + | 
|  | 124 | +  initRepoActivityTopAuthorsChart, | 
|  | 125 | +  initRepoArchiveLinks, | 
|  | 126 | +  initRepoBranchButton, | 
|  | 127 | +  initRepoCodeView, | 
|  | 128 | +  initBranchSelectorTabs, | 
|  | 129 | +  initRepoEllipsisButton, | 
|  | 130 | +  initRepoDiffCommitBranchesAndTags, | 
|  | 131 | +  initRepoEditor, | 
|  | 132 | +  initRepoGraphGit, | 
|  | 133 | +  initRepoIssueContentHistory, | 
|  | 134 | +  initRepoIssueList, | 
|  | 135 | +  initRepoIssueFilterItemLabel, | 
|  | 136 | +  initRepoIssueSidebarDependency, | 
|  | 137 | +  initRepoMigration, | 
|  | 138 | +  initRepoMigrationStatusChecker, | 
|  | 139 | +  initRepoProject, | 
|  | 140 | +  initRepoPullRequestAllowMaintainerEdit, | 
|  | 141 | +  initRepoPullRequestReview, | 
|  | 142 | +  initRepoRelease, | 
|  | 143 | +  initRepoReleaseNew, | 
|  | 144 | +  initRepoTopicBar, | 
|  | 145 | +  initRepoViewFileTree, | 
|  | 146 | +  initRepoWikiForm, | 
|  | 147 | +  initRepository, | 
|  | 148 | +  initRepositoryActionView, | 
|  | 149 | +  initRepositorySearch, | 
|  | 150 | +  initRepoContributors, | 
|  | 151 | +  initRepoCodeFrequency, | 
|  | 152 | +  initRepoRecentCommits, | 
|  | 153 | + | 
|  | 154 | +  initCommitStatuses, | 
|  | 155 | +  initCaptcha, | 
|  | 156 | + | 
|  | 157 | +  initUserCheckAppUrl, | 
|  | 158 | +  initUserAuthOauth2, | 
|  | 159 | +  initUserAuthWebAuthn, | 
|  | 160 | +  initUserAuthWebAuthnRegister, | 
|  | 161 | +  initUserSettings, | 
|  | 162 | +  initRepoDiffView, | 
|  | 163 | +  initColorPickers, | 
|  | 164 | + | 
|  | 165 | +  initOAuth2SettingsDisableCheckbox, | 
|  | 166 | + | 
|  | 167 | +  initRepoFileView, | 
|  | 168 | +]); | 
|  | 169 | + | 
|  | 170 | +// it must be the last one, then the "querySelectorAll" only needs to be executed once for global init functions. | 
|  | 171 | +initGlobalSelectorObserver(initPerformanceTracer); | 
|  | 172 | +if (initPerformanceTracer) initPerformanceTracer.printResults(); | 
|  | 173 | + | 
|  | 174 | +const initDur = performance.now() - initStartTime; | 
|  | 175 | +if (initDur > 500) { | 
|  | 176 | +  console.error(`slow init functions took ${initDur.toFixed(3)}ms`); | 
|  | 177 | +} | 
0 commit comments