Convert frontend code to typescript (#31559)

None of the frontend js/ts files was touched besides these two commands
(edit: no longer true, I touched one file in
61105d0618
because of a deprecation that was not showing before the rename).

`tsc` currently reports 778 errors, so I have disabled it in CI as
planned.

Everything appears to work fine.
This commit is contained in:
silverwind 2024-07-07 17:32:30 +02:00 committed by GitHub
parent 5115c278ff
commit 5791a73e75
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
168 changed files with 562 additions and 386 deletions

View file

@ -1,4 +1,4 @@
import {showGlobalErrorMessage} from './bootstrap.js';
import {showGlobalErrorMessage} from './bootstrap.ts';
test('showGlobalErrorMessage', () => {
document.body.innerHTML = '<div class="page-content"></div>';

View file

@ -2,8 +2,8 @@
Please also update the template file above if this vue is modified.
action status accepted: success, skipped, waiting, blocked, running, failure, cancelled, unknown
-->
<script>
import {SvgIcon} from '../svg.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
export default {
components: {SvgIcon},

View file

@ -1,4 +1,4 @@
<script>
<script lang="ts">
// TODO: Switch to upstream after https://github.com/razorness/vue3-calendar-heatmap/pull/34 is merged
import {CalendarHeatmap} from '@silverwind/vue3-calendar-heatmap';

View file

@ -1,6 +1,6 @@
<script>
import {SvgIcon} from '../svg.js';
import {GET} from '../modules/fetch.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
import {GET} from '../modules/fetch.ts';
const {appSubUrl, i18n} = window.config;

View file

@ -1,8 +1,8 @@
<script>
<script lang="ts">
import {createApp, nextTick} from 'vue';
import $ from 'jquery';
import {SvgIcon} from '../svg.js';
import {GET} from '../modules/fetch.js';
import {SvgIcon} from '../svg.ts';
import {GET} from '../modules/fetch.ts';
const {appSubUrl, assetUrlPrefix, pageData} = window.config;

View file

@ -1,6 +1,6 @@
<script>
import {SvgIcon} from '../svg.js';
import {GET} from '../modules/fetch.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
import {GET} from '../modules/fetch.ts';
export default {
components: {SvgIcon},

View file

@ -1,6 +1,6 @@
<script>
import {loadMoreFiles} from '../features/repo-diff.js';
import {diffTreeStore} from '../modules/stores.js';
<script lang="ts">
import {loadMoreFiles} from '../features/repo-diff.ts';
import {diffTreeStore} from '../modules/stores.ts';
export default {
data: () => {

View file

@ -1,9 +1,9 @@
<script>
<script lang="ts">
import DiffFileTreeItem from './DiffFileTreeItem.vue';
import {loadMoreFiles} from '../features/repo-diff.js';
import {toggleElem} from '../utils/dom.js';
import {diffTreeStore} from '../modules/stores.js';
import {setFileFolding} from '../features/file-fold.js';
import {loadMoreFiles} from '../features/repo-diff.ts';
import {toggleElem} from '../utils/dom.ts';
import {diffTreeStore} from '../modules/stores.ts';
import {setFileFolding} from '../features/file-fold.ts';
const LOCAL_STORAGE_KEY = 'diff_file_tree_visible';

View file

@ -1,6 +1,6 @@
<script>
import {SvgIcon} from '../svg.js';
import {diffTreeStore} from '../modules/stores.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
import {diffTreeStore} from '../modules/stores.ts';
export default {
components: {SvgIcon},

View file

@ -1,6 +1,6 @@
<script>
import {SvgIcon} from '../svg.js';
import {toggleElem} from '../utils/dom.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
import {toggleElem} from '../utils/dom.ts';
const {csrfToken, pageData} = window.config;

View file

@ -1,11 +1,11 @@
<script>
import {SvgIcon} from '../svg.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
import ActionRunStatus from './ActionRunStatus.vue';
import {createApp} from 'vue';
import {toggleElem} from '../utils/dom.js';
import {formatDatetime} from '../utils/time.js';
import {renderAnsi} from '../render/ansi.js';
import {GET, POST, DELETE} from '../modules/fetch.js';
import {toggleElem} from '../utils/dom.ts';
import {formatDatetime} from '../utils/time.ts';
import {renderAnsi} from '../render/ansi.ts';
import {GET, POST, DELETE} from '../modules/fetch.ts';
const sfc = {
name: 'RepoActionView',

View file

@ -1,4 +1,4 @@
<script>
<script lang="ts">
import VueBarGraph from 'vue-bar-graph';
import {createApp} from 'vue';

View file

@ -1,10 +1,10 @@
<script>
<script lang="ts">
import {createApp, nextTick} from 'vue';
import $ from 'jquery';
import {SvgIcon} from '../svg.js';
import {pathEscapeSegments} from '../utils/url.js';
import {showErrorToast} from '../modules/toast.js';
import {GET} from '../modules/fetch.js';
import {SvgIcon} from '../svg.ts';
import {pathEscapeSegments} from '../utils/url.ts';
import {showErrorToast} from '../modules/toast.ts';
import {GET} from '../modules/fetch.ts';
const sfc = {
components: {SvgIcon},

View file

@ -1,5 +1,5 @@
<script>
import {SvgIcon} from '../svg.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
import {
Chart,
Legend,
@ -9,15 +9,15 @@ import {
LineElement,
Filler,
} from 'chart.js';
import {GET} from '../modules/fetch.js';
import {GET} from '../modules/fetch.ts';
import {Line as ChartLine} from 'vue-chartjs';
import {
startDaysBetween,
firstStartDateAfterDate,
fillEmptyStartDaysWithZeroes,
} from '../utils/time.js';
import {chartJsColors} from '../utils/color.js';
import {sleep} from '../utils.js';
} from '../utils/time.ts';
import {chartJsColors} from '../utils/color.ts';
import {sleep} from '../utils.ts';
import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm';
const {pageData} = window.config;

View file

@ -1,5 +1,5 @@
<script>
import {SvgIcon} from '../svg.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
import {
Chart,
Title,
@ -10,16 +10,16 @@ import {
LineElement,
Filler,
} from 'chart.js';
import {GET} from '../modules/fetch.js';
import {GET} from '../modules/fetch.ts';
import zoomPlugin from 'chartjs-plugin-zoom';
import {Line as ChartLine} from 'vue-chartjs';
import {
startDaysBetween,
firstStartDateAfterDate,
fillEmptyStartDaysWithZeroes,
} from '../utils/time.js';
import {chartJsColors} from '../utils/color.js';
import {sleep} from '../utils.js';
} from '../utils/time.ts';
import {chartJsColors} from '../utils/color.ts';
import {sleep} from '../utils.ts';
import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm';
import $ from 'jquery';

View file

@ -1,5 +1,5 @@
<script>
import {SvgIcon} from '../svg.js';
<script lang="ts">
import {SvgIcon} from '../svg.ts';
import {
Chart,
Tooltip,
@ -7,15 +7,15 @@ import {
LinearScale,
TimeScale,
} from 'chart.js';
import {GET} from '../modules/fetch.js';
import {GET} from '../modules/fetch.ts';
import {Bar} from 'vue-chartjs';
import {
startDaysBetween,
firstStartDateAfterDate,
fillEmptyStartDaysWithZeroes,
} from '../utils/time.js';
import {chartJsColors} from '../utils/color.js';
import {sleep} from '../utils.js';
} from '../utils/time.ts';
import {chartJsColors} from '../utils/color.ts';
import {sleep} from '../utils.ts';
import 'chartjs-adapter-dayjs-4/dist/chartjs-adapter-dayjs-4.esm';
const {pageData} = window.config;

View file

@ -1,6 +1,6 @@
<script>
<script lang="ts">
import {createApp} from 'vue';
import {hideElem, showElem} from '../utils/dom.js';
import {hideElem, showElem} from '../utils/dom.ts';
const sfc = {
props: {

View file

@ -1,7 +1,7 @@
import $ from 'jquery';
import {checkAppUrl} from '../common-page.js';
import {hideElem, showElem, toggleElem} from '../../utils/dom.js';
import {POST} from '../../modules/fetch.js';
import {checkAppUrl} from '../common-page.ts';
import {hideElem, showElem, toggleElem} from '../../utils/dom.ts';
import {POST} from '../../modules/fetch.ts';
const {appSubUrl} = window.config;

View file

@ -1,5 +1,5 @@
import {showTemporaryTooltip} from '../../modules/tippy.js';
import {POST} from '../../modules/fetch.js';
import {showTemporaryTooltip} from '../../modules/tippy.ts';
import {POST} from '../../modules/fetch.ts';
const {appSubUrl} = window.config;

View file

@ -1,5 +1,5 @@
import {toggleElem} from '../../utils/dom.js';
import {POST} from '../../modules/fetch.js';
import {toggleElem} from '../../utils/dom.ts';
import {POST} from '../../modules/fetch.ts';
const {appSubUrl} = window.config;

View file

@ -1,4 +1,4 @@
import {isDarkTheme} from '../utils.js';
import {isDarkTheme} from '../utils.ts';
export async function initCaptcha() {
const captchaEl = document.querySelector('#captcha');

View file

@ -1,5 +1,5 @@
import $ from 'jquery';
import {getCurrentLocale} from '../utils.js';
import {getCurrentLocale} from '../utils.ts';
const {pageData} = window.config;

View file

@ -1,5 +1,5 @@
import {showTemporaryTooltip} from '../modules/tippy.js';
import {toAbsoluteUrl} from '../utils.js';
import {showTemporaryTooltip} from '../modules/tippy.ts';
import {toAbsoluteUrl} from '../utils.ts';
import {clippie} from 'clippie';
const {copy_success, copy_error} = window.config.i18n;

View file

@ -1,6 +1,6 @@
import tinycolor from 'tinycolor2';
import {basename, extname, isObject, isDarkTheme} from '../utils.js';
import {onInputDebounce} from '../utils/dom.js';
import {basename, extname, isObject, isDarkTheme} from '../utils.ts';
import {onInputDebounce} from '../utils/dom.ts';
const languagesByFilename = {};
const languagesByExt = {};

View file

@ -1,4 +1,4 @@
import {createTippy} from '../modules/tippy.js';
import {createTippy} from '../modules/tippy.ts';
export async function initColorPickers() {
const els = document.querySelectorAll('.js-color-picker-input');

View file

@ -1,7 +1,7 @@
import $ from 'jquery';
import {POST} from '../modules/fetch.js';
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
import {showErrorToast} from '../modules/toast.js';
import {POST} from '../modules/fetch.ts';
import {hideElem, showElem, toggleElem} from '../utils/dom.ts';
import {showErrorToast} from '../modules/toast.ts';
export function initGlobalButtonClickOnEnter() {
$(document).on('keypress', 'div.ui.button,span.ui.button', (e) => {

View file

@ -1,8 +1,8 @@
import {request} from '../modules/fetch.js';
import {showErrorToast} from '../modules/toast.js';
import {submitEventSubmitter} from '../utils/dom.js';
import {request} from '../modules/fetch.ts';
import {showErrorToast} from '../modules/toast.ts';
import {submitEventSubmitter} from '../utils/dom.ts';
import {htmlEscape} from 'escape-goat';
import {confirmModal} from './comp/ConfirmModal.js';
import {confirmModal} from './comp/ConfirmModal.ts';
const {appSubUrl, i18n} = window.config;

View file

@ -1,6 +1,6 @@
import $ from 'jquery';
import {initAreYouSure} from '../vendor/jquery.are-you-sure.js';
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js';
import {initAreYouSure} from '../vendor/jquery.are-you-sure.ts';
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.ts';
export function initGlobalFormDirtyLeaveConfirm() {
initAreYouSure(window.jQuery);

View file

@ -1,4 +1,4 @@
import {parseIssueListQuickGotoLink} from './common-issue-list.js';
import {parseIssueListQuickGotoLink} from './common-issue-list.ts';
test('parseIssueListQuickGotoLink', () => {
expect(parseIssueListQuickGotoLink('/link', '')).toEqual('');

View file

@ -1,5 +1,5 @@
import {isElemHidden, onInputDebounce, submitEventSubmitter, toggleElem} from '../utils/dom.js';
import {GET} from '../modules/fetch.js';
import {isElemHidden, onInputDebounce, submitEventSubmitter, toggleElem} from '../utils/dom.ts';
import {GET} from '../modules/fetch.ts';
const {appSubUrl} = window.config;
const reIssueIndex = /^(\d+)$/; // eg: "123"

View file

@ -1,5 +1,5 @@
import {initCompLabelEdit} from './comp/LabelEdit.js';
import {toggleElem} from '../utils/dom.js';
import {initCompLabelEdit} from './comp/LabelEdit.ts';
import {toggleElem} from '../utils/dom.ts';
export function initCommonOrganization() {
if (!document.querySelectorAll('.organization').length) {

View file

@ -1,6 +1,6 @@
import $ from 'jquery';
import {GET} from '../modules/fetch.js';
import {showGlobalErrorMessage} from '../bootstrap.js';
import {GET} from '../modules/fetch.ts';
import {showGlobalErrorMessage} from '../bootstrap.ts';
const {appUrl} = window.config;

View file

@ -1,17 +1,17 @@
import '@github/markdown-toolbar-element';
import '@github/text-expander-element';
import $ from 'jquery';
import {attachTribute} from '../tribute.js';
import {hideElem, showElem, autosize, isElemVisible} from '../../utils/dom.js';
import {initEasyMDEPaste, initTextareaUpload} from './EditorUpload.js';
import {handleGlobalEnterQuickSubmit} from './QuickSubmit.js';
import {renderPreviewPanelContent} from '../repo-editor.js';
import {easyMDEToolbarActions} from './EasyMDEToolbarActions.js';
import {initTextExpander} from './TextExpander.js';
import {showErrorToast} from '../../modules/toast.js';
import {POST} from '../../modules/fetch.js';
import {initTextareaMarkdown} from './EditorMarkdown.js';
import {DropzoneCustomEventReloadFiles, initDropzone} from '../dropzone.js';
import {attachTribute} from '../tribute.ts';
import {hideElem, showElem, autosize, isElemVisible} from '../../utils/dom.ts';
import {initEasyMDEPaste, initTextareaUpload} from './EditorUpload.ts';
import {handleGlobalEnterQuickSubmit} from './QuickSubmit.ts';
import {renderPreviewPanelContent} from '../repo-editor.ts';
import {easyMDEToolbarActions} from './EasyMDEToolbarActions.ts';
import {initTextExpander} from './TextExpander.ts';
import {showErrorToast} from '../../modules/toast.ts';
import {POST} from '../../modules/fetch.ts';
import {initTextareaMarkdown} from './EditorMarkdown.ts';
import {DropzoneCustomEventReloadFiles, initDropzone} from '../dropzone.ts';
let elementIdCounter = 0;

View file

@ -1,7 +1,7 @@
import $ from 'jquery';
import {svg} from '../../svg.js';
import {svg} from '../../svg.ts';
import {htmlEscape} from 'escape-goat';
import {createElementFromHTML} from '../../utils/dom.js';
import {createElementFromHTML} from '../../utils/dom.ts';
const {i18n} = window.config;

View file

@ -1,4 +1,4 @@
import {svg} from '../../svg.js';
import {svg} from '../../svg.ts';
export function easyMDEToolbarActions(EasyMDE, editor) {
const actions = {

View file

@ -1,4 +1,4 @@
import {removeAttachmentLinksFromMarkdown} from './EditorUpload.js';
import {removeAttachmentLinksFromMarkdown} from './EditorUpload.ts';
test('removeAttachmentLinksFromMarkdown', () => {
expect(removeAttachmentLinksFromMarkdown('a foo b', 'foo')).toBe('a foo b');

View file

@ -1,12 +1,12 @@
import {imageInfo} from '../../utils/image.js';
import {replaceTextareaSelection} from '../../utils/dom.js';
import {isUrl} from '../../utils/url.js';
import {triggerEditorContentChanged} from './EditorMarkdown.js';
import {imageInfo} from '../../utils/image.ts';
import {replaceTextareaSelection} from '../../utils/dom.ts';
import {isUrl} from '../../utils/url.ts';
import {triggerEditorContentChanged} from './EditorMarkdown.ts';
import {
DropzoneCustomEventRemovedFile,
DropzoneCustomEventUploadDone,
generateMarkdownLinkForAttachment,
} from '../dropzone.js';
} from '../dropzone.ts';
let uploadIdCounter = 0;

View file

@ -1,5 +1,5 @@
import $ from 'jquery';
import {POST} from '../../modules/fetch.js';
import {POST} from '../../modules/fetch.ts';
export function initCompReactionSelector() {
for (const container of document.querySelectorAll('.issue-content, .diff-file-body')) {

View file

@ -1,5 +1,5 @@
import {matchEmoji, matchMention} from '../../utils/match.js';
import {emojiString} from '../emoji.js';
import {matchEmoji, matchMention} from '../../utils/match.ts';
import {emojiString} from '../emoji.ts';
export function initTextExpander(expander) {
expander?.addEventListener('text-expander-change', ({detail: {key, provide, text}}) => {

View file

@ -1,5 +1,5 @@
import {POST} from '../../modules/fetch.js';
import {hideElem, showElem, toggleElem} from '../../utils/dom.js';
import {POST} from '../../modules/fetch.ts';
import {hideElem, showElem, toggleElem} from '../../utils/dom.ts';
export function initCompWebHookEditor() {
if (!document.querySelectorAll('.new.webhook').length) {

View file

@ -1,7 +1,7 @@
import {createApp} from 'vue';
import ContextPopup from '../components/ContextPopup.vue';
import {parseIssueHref} from '../utils.js';
import {createTippy} from '../modules/tippy.js';
import {parseIssueHref} from '../utils.ts';
import {createTippy} from '../modules/tippy.ts';
export function initContextPopups() {
const refIssues = document.querySelectorAll('.ref-issue');

View file

@ -1,7 +1,7 @@
import {clippie} from 'clippie';
import {showTemporaryTooltip} from '../modules/tippy.js';
import {convertImage} from '../utils.js';
import {GET} from '../modules/fetch.js';
import {showTemporaryTooltip} from '../modules/tippy.ts';
import {convertImage} from '../utils.ts';
import {GET} from '../modules/fetch.ts';
const {i18n} = window.config;

View file

@ -1,11 +1,11 @@
import {svg} from '../svg.js';
import {svg} from '../svg.ts';
import {htmlEscape} from 'escape-goat';
import {clippie} from 'clippie';
import {showTemporaryTooltip} from '../modules/tippy.js';
import {GET, POST} from '../modules/fetch.js';
import {showErrorToast} from '../modules/toast.js';
import {createElementFromHTML, createElementFromAttrs} from '../utils/dom.js';
import {isImageFile, isVideoFile} from '../utils.js';
import {showTemporaryTooltip} from '../modules/tippy.ts';
import {GET, POST} from '../modules/fetch.ts';
import {showErrorToast} from '../modules/toast.ts';
import {createElementFromHTML, createElementFromAttrs} from '../utils/dom.ts';
import {isImageFile, isVideoFile} from '../utils.ts';
const {csrfToken, i18n} = window.config;

View file

@ -1,4 +1,4 @@
import {svg} from '../svg.js';
import {svg} from '../svg.ts';
// Hides the file if newFold is true, and shows it otherwise. The actual hiding is performed using CSS.
//

View file

@ -1,6 +1,6 @@
import {createApp} from 'vue';
import ActivityHeatmap from '../components/ActivityHeatmap.vue';
import {translateMonth, translateDay} from '../utils.js';
import {translateMonth, translateDay} from '../utils.ts';
export function initHeatmap() {
const el = document.querySelector('#user-heatmap');

View file

@ -1,7 +1,7 @@
import $ from 'jquery';
import {GET} from '../modules/fetch.js';
import {hideElem, loadElem, queryElemChildren, queryElems} from '../utils/dom.js';
import {parseDom} from '../utils.js';
import {GET} from '../modules/fetch.ts';
import {hideElem, loadElem, queryElemChildren, queryElems} from '../utils/dom.ts';
import {parseDom} from '../utils.ts';
function getDefaultSvgBoundsIfUndefined(text, src) {
const defaultSize = 300;

View file

@ -1,5 +1,5 @@
import {hideElem, showElem} from '../utils/dom.js';
import {GET} from '../modules/fetch.js';
import {hideElem, showElem} from '../utils/dom.ts';
import {GET} from '../modules/fetch.ts';
export function initInstall() {
const page = document.querySelector('.page-content.install');

View file

@ -1,7 +1,7 @@
import $ from 'jquery';
import {GET} from '../modules/fetch.js';
import {toggleElem} from '../utils/dom.js';
import {logoutFromWorker} from '../modules/worker.js';
import {GET} from '../modules/fetch.ts';
import {toggleElem} from '../utils/dom.ts';
import {logoutFromWorker} from '../modules/worker.ts';
const {appSubUrl, notificationSettings, assetVersionEncoded} = window.config;
let notificationSequenceNumber = 0;

View file

@ -1,5 +1,5 @@
import $ from 'jquery';
import {hideElem, showElem} from '../utils/dom.js';
import {hideElem, showElem} from '../utils/dom.ts';
const {appSubUrl} = window.config;

View file

@ -1,6 +1,6 @@
import {diffTreeStore} from '../modules/stores.js';
import {setFileFolding} from './file-fold.js';
import {POST} from '../modules/fetch.js';
import {diffTreeStore} from '../modules/stores.ts';
import {setFileFolding} from './file-fold.ts';
import {POST} from '../modules/fetch.ts';
const {pageData} = window.config;
const prReview = pageData.prReview || {};

View file

@ -1,5 +1,5 @@
import $ from 'jquery';
import {toggleElem} from '../utils/dom.js';
import {toggleElem} from '../utils/dom.ts';
export function initRepoBranchButton() {
initRepoCreateBranchButton();

View file

@ -1,4 +1,4 @@
import {singleAnchorRegex, rangeAnchorRegex} from './repo-code.js';
import {singleAnchorRegex, rangeAnchorRegex} from './repo-code.ts';
test('singleAnchorRegex', () => {
expect(singleAnchorRegex.test('#L0')).toEqual(false);

View file

@ -1,9 +1,9 @@
import $ from 'jquery';
import {svg} from '../svg.js';
import {invertFileFolding} from './file-fold.js';
import {createTippy} from '../modules/tippy.js';
import {svg} from '../svg.ts';
import {invertFileFolding} from './file-fold.ts';
import {createTippy} from '../modules/tippy.ts';
import {clippie} from 'clippie';
import {toAbsoluteUrl} from '../utils.js';
import {toAbsoluteUrl} from '../utils.ts';
export const singleAnchorRegex = /^#(L|n)([1-9][0-9]*)$/;
export const rangeAnchorRegex = /^#(L[1-9][0-9]*)-(L[1-9][0-9]*)$/;

View file

@ -1,5 +1,5 @@
import {createTippy} from '../modules/tippy.js';
import {toggleElem} from '../utils/dom.js';
import {createTippy} from '../modules/tippy.ts';
import {toggleElem} from '../utils/dom.ts';
export function initRepoEllipsisButton() {
for (const button of document.querySelectorAll('.js-toggle-commit-body')) {

View file

@ -1,8 +1,8 @@
import $ from 'jquery';
import {hideElem, queryElems, showElem} from '../utils/dom.js';
import {POST} from '../modules/fetch.js';
import {showErrorToast} from '../modules/toast.js';
import {sleep} from '../utils.js';
import {hideElem, queryElems, showElem} from '../utils/dom.ts';
import {POST} from '../modules/fetch.ts';
import {showErrorToast} from '../modules/toast.ts';
import {sleep} from '../utils.ts';
async function onDownloadArchive(e) {
e.preventDefault();

View file

@ -1,5 +1,5 @@
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
import {GET} from '../modules/fetch.js';
import {hideElem, showElem, toggleElem} from '../utils/dom.ts';
import {GET} from '../modules/fetch.ts';
async function loadBranchesAndTags(area, loadingButton) {
loadingButton.classList.add('disabled');

View file

@ -1,14 +1,14 @@
import $ from 'jquery';
import {initCompReactionSelector} from './comp/ReactionSelector.js';
import {initRepoIssueContentHistory} from './repo-issue-content.js';
import {initDiffFileTree} from './repo-diff-filetree.js';
import {initDiffCommitSelect} from './repo-diff-commitselect.js';
import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.js';
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles, initExpandAndCollapseFilesButton} from './pull-view-file.js';
import {initImageDiff} from './imagediff.js';
import {showErrorToast} from '../modules/toast.js';
import {submitEventSubmitter, queryElemSiblings, hideElem, showElem, animateOnce} from '../utils/dom.js';
import {POST, GET} from '../modules/fetch.js';
import {initCompReactionSelector} from './comp/ReactionSelector.ts';
import {initRepoIssueContentHistory} from './repo-issue-content.ts';
import {initDiffFileTree} from './repo-diff-filetree.ts';
import {initDiffCommitSelect} from './repo-diff-commitselect.ts';
import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.ts';
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles, initExpandAndCollapseFilesButton} from './pull-view-file.ts';
import {initImageDiff} from './imagediff.ts';
import {showErrorToast} from '../modules/toast.ts';
import {submitEventSubmitter, queryElemSiblings, hideElem, showElem, animateOnce} from '../utils/dom.ts';
import {POST, GET} from '../modules/fetch.ts';
const {pageData, i18n} = window.config;

View file

@ -1,11 +1,11 @@
import $ from 'jquery';
import {htmlEscape} from 'escape-goat';
import {createCodeEditor} from './codeeditor.js';
import {hideElem, queryElems, showElem} from '../utils/dom.js';
import {initMarkupContent} from '../markup/content.js';
import {attachRefIssueContextPopup} from './contextpopup.js';
import {POST} from '../modules/fetch.js';
import {initDropzone} from './dropzone.js';
import {createCodeEditor} from './codeeditor.ts';
import {hideElem, queryElems, showElem} from '../utils/dom.ts';
import {initMarkupContent} from '../markup/content.ts';
import {attachRefIssueContextPopup} from './contextpopup.ts';
import {POST} from '../modules/fetch.ts';
import {initDropzone} from './dropzone.ts';
function initEditPreviewTab($form) {
const $tabMenu = $form.find('.repo-editor-menu');

View file

@ -1,4 +1,4 @@
import {strSubMatch, calcMatchedWeight, filterRepoFilesWeighted} from './repo-findfile.js';
import {strSubMatch, calcMatchedWeight, filterRepoFilesWeighted} from './repo-findfile.ts';
describe('Repo Find Files', () => {
test('strSubMatch', () => {

View file

@ -1,7 +1,7 @@
import {svg} from '../svg.js';
import {toggleElem} from '../utils/dom.js';
import {pathEscapeSegments} from '../utils/url.js';
import {GET} from '../modules/fetch.js';
import {svg} from '../svg.ts';
import {toggleElem} from '../utils/dom.ts';
import {pathEscapeSegments} from '../utils/url.ts';
import {GET} from '../modules/fetch.ts';
const threshold = 50;
let files = [];

View file

@ -1,6 +1,6 @@
import $ from 'jquery';
import {hideElem, showElem} from '../utils/dom.js';
import {GET} from '../modules/fetch.js';
import {hideElem, showElem} from '../utils/dom.ts';
import {GET} from '../modules/fetch.ts';
export function initRepoGraphGit() {
const graphContainer = document.querySelector('#git-graph-container');

View file

@ -1,8 +1,8 @@
import $ from 'jquery';
import {stripTags} from '../utils.js';
import {hideElem, queryElemChildren, showElem} from '../utils/dom.js';
import {POST} from '../modules/fetch.js';
import {showErrorToast} from '../modules/toast.js';
import {stripTags} from '../utils.ts';
import {hideElem, queryElemChildren, showElem} from '../utils/dom.ts';
import {POST} from '../modules/fetch.ts';
import {showErrorToast} from '../modules/toast.ts';
const {appSubUrl} = window.config;

View file

@ -1,8 +1,8 @@
import $ from 'jquery';
import {svg} from '../svg.js';
import {showErrorToast} from '../modules/toast.js';
import {GET, POST} from '../modules/fetch.js';
import {showElem} from '../utils/dom.js';
import {svg} from '../svg.ts';
import {showErrorToast} from '../modules/toast.ts';
import {GET, POST} from '../modules/fetch.ts';
import {showElem} from '../utils/dom.ts';
const {appSubUrl} = window.config;
let i18nTextEdited;

View file

@ -1,11 +1,11 @@
import $ from 'jquery';
import {handleReply} from './repo-issue.js';
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
import {POST} from '../modules/fetch.js';
import {showErrorToast} from '../modules/toast.js';
import {hideElem, showElem} from '../utils/dom.js';
import {attachRefIssueContextPopup} from './contextpopup.js';
import {initCommentContent, initMarkupContent} from '../markup/content.js';
import {handleReply} from './repo-issue.ts';
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.ts';
import {POST} from '../modules/fetch.ts';
import {showErrorToast} from '../modules/toast.ts';
import {hideElem, showElem} from '../utils/dom.ts';
import {attachRefIssueContextPopup} from './contextpopup.ts';
import {initCommentContent, initMarkupContent} from '../markup/content.ts';
async function onEditContent(event) {
event.preventDefault();

View file

@ -1,12 +1,12 @@
import $ from 'jquery';
import {updateIssuesMeta} from './repo-issue.js';
import {toggleElem, hideElem, isElemHidden} from '../utils/dom.js';
import {updateIssuesMeta} from './repo-issue.ts';
import {toggleElem, hideElem, isElemHidden} from '../utils/dom.ts';
import {htmlEscape} from 'escape-goat';
import {confirmModal} from './comp/ConfirmModal.js';
import {showErrorToast} from '../modules/toast.js';
import {createSortable} from '../modules/sortable.js';
import {DELETE, POST} from '../modules/fetch.js';
import {parseDom} from '../utils.js';
import {confirmModal} from './comp/ConfirmModal.ts';
import {showErrorToast} from '../modules/toast.ts';
import {createSortable} from '../modules/sortable.ts';
import {DELETE, POST} from '../modules/fetch.ts';
import {parseDom} from '../utils.ts';
function initRepoIssueListCheckboxes() {
const issueSelectAll = document.querySelector('.issue-checkbox-all');

View file

@ -1,12 +1,12 @@
import $ from 'jquery';
import {htmlEscape} from 'escape-goat';
import {createTippy, showTemporaryTooltip} from '../modules/tippy.js';
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
import {setFileFolding} from './file-fold.js';
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
import {toAbsoluteUrl} from '../utils.js';
import {GET, POST} from '../modules/fetch.js';
import {showErrorToast} from '../modules/toast.js';
import {createTippy, showTemporaryTooltip} from '../modules/tippy.ts';
import {hideElem, showElem, toggleElem} from '../utils/dom.ts';
import {setFileFolding} from './file-fold.ts';
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.ts';
import {toAbsoluteUrl} from '../utils.ts';
import {GET, POST} from '../modules/fetch.ts';
import {showErrorToast} from '../modules/toast.ts';
const {appSubUrl} = window.config;
@ -19,7 +19,7 @@ export function initRepoIssueTimeTracking() {
},
}).modal('show');
$('.issue-start-time-modal input').on('keydown', (e) => {
if ((e.keyCode || e.key) === 13) {
if (e.key === 'Enter') {
$('#add_time_manual_form').trigger('submit');
}
});
@ -146,7 +146,7 @@ export function initRepoIssueSidebarList() {
});
$('.menu .ui.dropdown.label-filter').on('keydown', (e) => {
if (e.altKey && e.keyCode === 13) {
if (e.altKey && e.key === 'Enter') {
const selectedItem = document.querySelector('.menu .ui.dropdown.label-filter .menu .item.selected');
if (selectedItem) {
excludeLabel(selectedItem);

View file

@ -4,24 +4,24 @@ import {
initRepoIssueComments, initRepoIssueDependencyDelete, initRepoIssueReferenceIssue,
initRepoIssueTitleEdit, initRepoIssueWipToggle,
initRepoPullRequestUpdate, updateIssuesMeta, initIssueTemplateCommentEditors, initSingleCommentEditor,
} from './repo-issue.js';
import {initUnicodeEscapeButton} from './repo-unicode-escape.js';
import {svg} from '../svg.js';
} from './repo-issue.ts';
import {initUnicodeEscapeButton} from './repo-unicode-escape.ts';
import {svg} from '../svg.ts';
import {htmlEscape} from 'escape-goat';
import {initRepoBranchTagSelector} from '../components/RepoBranchTagSelector.vue';
import {
initRepoCloneLink, initRepoCommonBranchOrTagDropdown, initRepoCommonFilterSearchDropdown,
} from './repo-common.js';
import {initCitationFileCopyContent} from './citation.js';
import {initCompLabelEdit} from './comp/LabelEdit.js';
import {initRepoDiffConversationNav} from './repo-diff.js';
import {initCompReactionSelector} from './comp/ReactionSelector.js';
import {initRepoSettingBranches} from './repo-settings.js';
import {initRepoPullRequestMergeForm} from './repo-issue-pr-form.js';
import {initRepoPullRequestCommitStatus} from './repo-issue-pr-status.js';
import {hideElem, queryElemChildren, showElem} from '../utils/dom.js';
import {POST} from '../modules/fetch.js';
import {initRepoIssueCommentEdit} from './repo-issue-edit.js';
} from './repo-common.ts';
import {initCitationFileCopyContent} from './citation.ts';
import {initCompLabelEdit} from './comp/LabelEdit.ts';
import {initRepoDiffConversationNav} from './repo-diff.ts';
import {initCompReactionSelector} from './comp/ReactionSelector.ts';
import {initRepoSettingBranches} from './repo-settings.ts';
import {initRepoPullRequestMergeForm} from './repo-issue-pr-form.ts';
import {initRepoPullRequestCommitStatus} from './repo-issue-pr-status.ts';
import {hideElem, queryElemChildren, showElem} from '../utils/dom.ts';
import {POST} from '../modules/fetch.ts';
import {initRepoIssueCommentEdit} from './repo-issue-edit.ts';
// if there are draft comments, confirm before reloading, to avoid losing comments
function reloadConfirmDraftComment() {

View file

@ -1,5 +1,5 @@
import {hideElem, showElem} from '../utils/dom.js';
import {GET, POST} from '../modules/fetch.js';
import {hideElem, showElem} from '../utils/dom.ts';
import {GET, POST} from '../modules/fetch.ts';
const {appSubUrl} = window.config;

View file

@ -1,4 +1,4 @@
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
import {hideElem, showElem, toggleElem} from '../utils/dom.ts';
const service = document.querySelector('#service_type');
const user = document.querySelector('#auth_username');

View file

@ -1,7 +1,7 @@
import $ from 'jquery';
import {contrastColor} from '../utils/color.js';
import {createSortable} from '../modules/sortable.js';
import {POST, DELETE, PUT} from '../modules/fetch.js';
import {contrastColor} from '../utils/color.ts';
import {createSortable} from '../modules/sortable.ts';
import {POST, DELETE, PUT} from '../modules/fetch.ts';
function updateIssueCount(cards) {
const parent = cards.parentElement;

View file

@ -1,5 +1,5 @@
import {hideElem, showElem} from '../utils/dom.js';
import {initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
import {hideElem, showElem} from '../utils/dom.ts';
import {initComboMarkdownEditor} from './comp/ComboMarkdownEditor.ts';
export function initRepoRelease() {
document.addEventListener('click', (e) => {

View file

@ -1,8 +1,8 @@
import $ from 'jquery';
import {minimatch} from 'minimatch';
import {createMonaco} from './codeeditor.js';
import {onInputDebounce, queryElems, toggleElem} from '../utils/dom.js';
import {POST} from '../modules/fetch.js';
import {createMonaco} from './codeeditor.ts';
import {onInputDebounce, queryElems, toggleElem} from '../utils/dom.ts';
import {POST} from '../modules/fetch.ts';
const {appSubUrl, csrfToken} = window.config;

View file

@ -1,6 +1,6 @@
import $ from 'jquery';
import {htmlEscape} from 'escape-goat';
import {hideElem, showElem} from '../utils/dom.js';
import {hideElem, showElem} from '../utils/dom.ts';
const {appSubUrl} = window.config;

View file

@ -1,4 +1,4 @@
import {hideElem, queryElemSiblings, showElem, toggleElem} from '../utils/dom.js';
import {hideElem, queryElemSiblings, showElem, toggleElem} from '../utils/dom.ts';
export function initUnicodeEscapeButton() {
document.addEventListener('click', (e) => {

View file

@ -1,7 +1,7 @@
import {initMarkupContent} from '../markup/content.js';
import {validateTextareaNonEmpty, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
import {fomanticMobileScreen} from '../modules/fomantic.js';
import {POST} from '../modules/fetch.js';
import {initMarkupContent} from '../markup/content.ts';
import {validateTextareaNonEmpty, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.ts';
import {fomanticMobileScreen} from '../modules/fomantic.ts';
import {POST} from '../modules/fetch.ts';
async function initRepoWikiFormEditor() {
const editArea = document.querySelector('.repository.wiki .combo-markdown-editor textarea');

View file

@ -1,7 +1,7 @@
import {createTippy} from '../modules/tippy.js';
import {GET} from '../modules/fetch.js';
import {hideElem, showElem} from '../utils/dom.js';
import {logoutFromWorker} from '../modules/worker.js';
import {createTippy} from '../modules/tippy.ts';
import {GET} from '../modules/fetch.ts';
import {hideElem, showElem} from '../utils/dom.ts';
import {logoutFromWorker} from '../modules/worker.ts';
const {appSubUrl, notificationSettings, enableTimeTracking, assetVersionEncoded} = window.config;

View file

@ -1,4 +1,4 @@
import {emojiKeys, emojiHTML, emojiString} from './emoji.js';
import {emojiKeys, emojiHTML, emojiString} from './emoji.ts';
import {htmlEscape} from 'escape-goat';
function makeCollections({mentions, emoji}) {

View file

@ -1,6 +1,6 @@
import {encodeURLEncodedBase64, decodeURLEncodedBase64} from '../utils.js';
import {showElem} from '../utils/dom.js';
import {GET, POST} from '../modules/fetch.js';
import {encodeURLEncodedBase64, decodeURLEncodedBase64} from '../utils.ts';
import {showElem} from '../utils/dom.ts';
import {GET, POST} from '../modules/fetch.ts';
const {appSubUrl} = window.config;

View file

@ -1,4 +1,4 @@
import {checkAppUrl} from './common-page.js';
import {checkAppUrl} from './common-page.ts';
export function initUserAuthOauth2() {
const outer = document.querySelector('#oauth2-login-navigator');

View file

@ -1,4 +1,4 @@
import {hideElem, showElem} from '../utils/dom.js';
import {hideElem, showElem} from '../utils/dom.ts';
export function initUserSettings() {
if (!document.querySelectorAll('.user.settings.profile').length) return;

Some files were not shown because too many files have changed in this diff Show more