mirror of https://github.com/go-gitea/gitea.git
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.
pull/31585/head
parent
5115c278ff
commit
5791a73e75
@ -0,0 +1,4 @@
|
|||||||
|
declare module '*.svg' {
|
||||||
|
const value: string;
|
||||||
|
export default value;
|
||||||
|
}
|
@ -1,4 +1,4 @@
|
|||||||
import {showGlobalErrorMessage} from './bootstrap.js';
|
import {showGlobalErrorMessage} from './bootstrap.ts';
|
||||||
|
|
||||||
test('showGlobalErrorMessage', () => {
|
test('showGlobalErrorMessage', () => {
|
||||||
document.body.innerHTML = '<div class="page-content"></div>';
|
document.body.innerHTML = '<div class="page-content"></div>';
|
@ -1,7 +1,7 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {checkAppUrl} from '../common-page.js';
|
import {checkAppUrl} from '../common-page.ts';
|
||||||
import {hideElem, showElem, toggleElem} from '../../utils/dom.js';
|
import {hideElem, showElem, toggleElem} from '../../utils/dom.ts';
|
||||||
import {POST} from '../../modules/fetch.js';
|
import {POST} from '../../modules/fetch.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
import {showTemporaryTooltip} from '../../modules/tippy.js';
|
import {showTemporaryTooltip} from '../../modules/tippy.ts';
|
||||||
import {POST} from '../../modules/fetch.js';
|
import {POST} from '../../modules/fetch.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
import {toggleElem} from '../../utils/dom.js';
|
import {toggleElem} from '../../utils/dom.ts';
|
||||||
import {POST} from '../../modules/fetch.js';
|
import {POST} from '../../modules/fetch.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
import {isDarkTheme} from '../utils.js';
|
import {isDarkTheme} from '../utils.ts';
|
||||||
|
|
||||||
export async function initCaptcha() {
|
export async function initCaptcha() {
|
||||||
const captchaEl = document.querySelector('#captcha');
|
const captchaEl = document.querySelector('#captcha');
|
@ -1,5 +1,5 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {getCurrentLocale} from '../utils.js';
|
import {getCurrentLocale} from '../utils.ts';
|
||||||
|
|
||||||
const {pageData} = window.config;
|
const {pageData} = window.config;
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
import {showTemporaryTooltip} from '../modules/tippy.js';
|
import {showTemporaryTooltip} from '../modules/tippy.ts';
|
||||||
import {toAbsoluteUrl} from '../utils.js';
|
import {toAbsoluteUrl} from '../utils.ts';
|
||||||
import {clippie} from 'clippie';
|
import {clippie} from 'clippie';
|
||||||
|
|
||||||
const {copy_success, copy_error} = window.config.i18n;
|
const {copy_success, copy_error} = window.config.i18n;
|
@ -1,6 +1,6 @@
|
|||||||
import tinycolor from 'tinycolor2';
|
import tinycolor from 'tinycolor2';
|
||||||
import {basename, extname, isObject, isDarkTheme} from '../utils.js';
|
import {basename, extname, isObject, isDarkTheme} from '../utils.ts';
|
||||||
import {onInputDebounce} from '../utils/dom.js';
|
import {onInputDebounce} from '../utils/dom.ts';
|
||||||
|
|
||||||
const languagesByFilename = {};
|
const languagesByFilename = {};
|
||||||
const languagesByExt = {};
|
const languagesByExt = {};
|
@ -1,4 +1,4 @@
|
|||||||
import {createTippy} from '../modules/tippy.js';
|
import {createTippy} from '../modules/tippy.ts';
|
||||||
|
|
||||||
export async function initColorPickers() {
|
export async function initColorPickers() {
|
||||||
const els = document.querySelectorAll('.js-color-picker-input');
|
const els = document.querySelectorAll('.js-color-picker-input');
|
@ -1,7 +1,7 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {POST} from '../modules/fetch.js';
|
import {POST} from '../modules/fetch.ts';
|
||||||
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
|
import {hideElem, showElem, toggleElem} from '../utils/dom.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
|
|
||||||
export function initGlobalButtonClickOnEnter() {
|
export function initGlobalButtonClickOnEnter() {
|
||||||
$(document).on('keypress', 'div.ui.button,span.ui.button', (e) => {
|
$(document).on('keypress', 'div.ui.button,span.ui.button', (e) => {
|
@ -1,8 +1,8 @@
|
|||||||
import {request} from '../modules/fetch.js';
|
import {request} from '../modules/fetch.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
import {submitEventSubmitter} from '../utils/dom.js';
|
import {submitEventSubmitter} from '../utils/dom.ts';
|
||||||
import {htmlEscape} from 'escape-goat';
|
import {htmlEscape} from 'escape-goat';
|
||||||
import {confirmModal} from './comp/ConfirmModal.js';
|
import {confirmModal} from './comp/ConfirmModal.ts';
|
||||||
|
|
||||||
const {appSubUrl, i18n} = window.config;
|
const {appSubUrl, i18n} = window.config;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {initAreYouSure} from '../vendor/jquery.are-you-sure.js';
|
import {initAreYouSure} from '../vendor/jquery.are-you-sure.ts';
|
||||||
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.js';
|
import {handleGlobalEnterQuickSubmit} from './comp/QuickSubmit.ts';
|
||||||
|
|
||||||
export function initGlobalFormDirtyLeaveConfirm() {
|
export function initGlobalFormDirtyLeaveConfirm() {
|
||||||
initAreYouSure(window.jQuery);
|
initAreYouSure(window.jQuery);
|
@ -1,4 +1,4 @@
|
|||||||
import {parseIssueListQuickGotoLink} from './common-issue-list.js';
|
import {parseIssueListQuickGotoLink} from './common-issue-list.ts';
|
||||||
|
|
||||||
test('parseIssueListQuickGotoLink', () => {
|
test('parseIssueListQuickGotoLink', () => {
|
||||||
expect(parseIssueListQuickGotoLink('/link', '')).toEqual('');
|
expect(parseIssueListQuickGotoLink('/link', '')).toEqual('');
|
@ -1,5 +1,5 @@
|
|||||||
import {isElemHidden, onInputDebounce, submitEventSubmitter, toggleElem} from '../utils/dom.js';
|
import {isElemHidden, onInputDebounce, submitEventSubmitter, toggleElem} from '../utils/dom.ts';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
const reIssueIndex = /^(\d+)$/; // eg: "123"
|
const reIssueIndex = /^(\d+)$/; // eg: "123"
|
@ -1,5 +1,5 @@
|
|||||||
import {initCompLabelEdit} from './comp/LabelEdit.js';
|
import {initCompLabelEdit} from './comp/LabelEdit.ts';
|
||||||
import {toggleElem} from '../utils/dom.js';
|
import {toggleElem} from '../utils/dom.ts';
|
||||||
|
|
||||||
export function initCommonOrganization() {
|
export function initCommonOrganization() {
|
||||||
if (!document.querySelectorAll('.organization').length) {
|
if (!document.querySelectorAll('.organization').length) {
|
@ -1,6 +1,6 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
import {showGlobalErrorMessage} from '../bootstrap.js';
|
import {showGlobalErrorMessage} from '../bootstrap.ts';
|
||||||
|
|
||||||
const {appUrl} = window.config;
|
const {appUrl} = window.config;
|
||||||
|
|
@ -1,17 +1,17 @@
|
|||||||
import '@github/markdown-toolbar-element';
|
import '@github/markdown-toolbar-element';
|
||||||
import '@github/text-expander-element';
|
import '@github/text-expander-element';
|
||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {attachTribute} from '../tribute.js';
|
import {attachTribute} from '../tribute.ts';
|
||||||
import {hideElem, showElem, autosize, isElemVisible} from '../../utils/dom.js';
|
import {hideElem, showElem, autosize, isElemVisible} from '../../utils/dom.ts';
|
||||||
import {initEasyMDEPaste, initTextareaUpload} from './EditorUpload.js';
|
import {initEasyMDEPaste, initTextareaUpload} from './EditorUpload.ts';
|
||||||
import {handleGlobalEnterQuickSubmit} from './QuickSubmit.js';
|
import {handleGlobalEnterQuickSubmit} from './QuickSubmit.ts';
|
||||||
import {renderPreviewPanelContent} from '../repo-editor.js';
|
import {renderPreviewPanelContent} from '../repo-editor.ts';
|
||||||
import {easyMDEToolbarActions} from './EasyMDEToolbarActions.js';
|
import {easyMDEToolbarActions} from './EasyMDEToolbarActions.ts';
|
||||||
import {initTextExpander} from './TextExpander.js';
|
import {initTextExpander} from './TextExpander.ts';
|
||||||
import {showErrorToast} from '../../modules/toast.js';
|
import {showErrorToast} from '../../modules/toast.ts';
|
||||||
import {POST} from '../../modules/fetch.js';
|
import {POST} from '../../modules/fetch.ts';
|
||||||
import {initTextareaMarkdown} from './EditorMarkdown.js';
|
import {initTextareaMarkdown} from './EditorMarkdown.ts';
|
||||||
import {DropzoneCustomEventReloadFiles, initDropzone} from '../dropzone.js';
|
import {DropzoneCustomEventReloadFiles, initDropzone} from '../dropzone.ts';
|
||||||
|
|
||||||
let elementIdCounter = 0;
|
let elementIdCounter = 0;
|
||||||
|
|
@ -1,7 +1,7 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {svg} from '../../svg.js';
|
import {svg} from '../../svg.ts';
|
||||||
import {htmlEscape} from 'escape-goat';
|
import {htmlEscape} from 'escape-goat';
|
||||||
import {createElementFromHTML} from '../../utils/dom.js';
|
import {createElementFromHTML} from '../../utils/dom.ts';
|
||||||
|
|
||||||
const {i18n} = window.config;
|
const {i18n} = window.config;
|
||||||
|
|
@ -1,4 +1,4 @@
|
|||||||
import {svg} from '../../svg.js';
|
import {svg} from '../../svg.ts';
|
||||||
|
|
||||||
export function easyMDEToolbarActions(EasyMDE, editor) {
|
export function easyMDEToolbarActions(EasyMDE, editor) {
|
||||||
const actions = {
|
const actions = {
|
@ -1,4 +1,4 @@
|
|||||||
import {removeAttachmentLinksFromMarkdown} from './EditorUpload.js';
|
import {removeAttachmentLinksFromMarkdown} from './EditorUpload.ts';
|
||||||
|
|
||||||
test('removeAttachmentLinksFromMarkdown', () => {
|
test('removeAttachmentLinksFromMarkdown', () => {
|
||||||
expect(removeAttachmentLinksFromMarkdown('a foo b', 'foo')).toBe('a foo b');
|
expect(removeAttachmentLinksFromMarkdown('a foo b', 'foo')).toBe('a foo b');
|
@ -1,12 +1,12 @@
|
|||||||
import {imageInfo} from '../../utils/image.js';
|
import {imageInfo} from '../../utils/image.ts';
|
||||||
import {replaceTextareaSelection} from '../../utils/dom.js';
|
import {replaceTextareaSelection} from '../../utils/dom.ts';
|
||||||
import {isUrl} from '../../utils/url.js';
|
import {isUrl} from '../../utils/url.ts';
|
||||||
import {triggerEditorContentChanged} from './EditorMarkdown.js';
|
import {triggerEditorContentChanged} from './EditorMarkdown.ts';
|
||||||
import {
|
import {
|
||||||
DropzoneCustomEventRemovedFile,
|
DropzoneCustomEventRemovedFile,
|
||||||
DropzoneCustomEventUploadDone,
|
DropzoneCustomEventUploadDone,
|
||||||
generateMarkdownLinkForAttachment,
|
generateMarkdownLinkForAttachment,
|
||||||
} from '../dropzone.js';
|
} from '../dropzone.ts';
|
||||||
|
|
||||||
let uploadIdCounter = 0;
|
let uploadIdCounter = 0;
|
||||||
|
|
@ -1,5 +1,5 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {POST} from '../../modules/fetch.js';
|
import {POST} from '../../modules/fetch.ts';
|
||||||
|
|
||||||
export function initCompReactionSelector() {
|
export function initCompReactionSelector() {
|
||||||
for (const container of document.querySelectorAll('.issue-content, .diff-file-body')) {
|
for (const container of document.querySelectorAll('.issue-content, .diff-file-body')) {
|
@ -1,5 +1,5 @@
|
|||||||
import {matchEmoji, matchMention} from '../../utils/match.js';
|
import {matchEmoji, matchMention} from '../../utils/match.ts';
|
||||||
import {emojiString} from '../emoji.js';
|
import {emojiString} from '../emoji.ts';
|
||||||
|
|
||||||
export function initTextExpander(expander) {
|
export function initTextExpander(expander) {
|
||||||
expander?.addEventListener('text-expander-change', ({detail: {key, provide, text}}) => {
|
expander?.addEventListener('text-expander-change', ({detail: {key, provide, text}}) => {
|
@ -1,5 +1,5 @@
|
|||||||
import {POST} from '../../modules/fetch.js';
|
import {POST} from '../../modules/fetch.ts';
|
||||||
import {hideElem, showElem, toggleElem} from '../../utils/dom.js';
|
import {hideElem, showElem, toggleElem} from '../../utils/dom.ts';
|
||||||
|
|
||||||
export function initCompWebHookEditor() {
|
export function initCompWebHookEditor() {
|
||||||
if (!document.querySelectorAll('.new.webhook').length) {
|
if (!document.querySelectorAll('.new.webhook').length) {
|
@ -1,7 +1,7 @@
|
|||||||
import {createApp} from 'vue';
|
import {createApp} from 'vue';
|
||||||
import ContextPopup from '../components/ContextPopup.vue';
|
import ContextPopup from '../components/ContextPopup.vue';
|
||||||
import {parseIssueHref} from '../utils.js';
|
import {parseIssueHref} from '../utils.ts';
|
||||||
import {createTippy} from '../modules/tippy.js';
|
import {createTippy} from '../modules/tippy.ts';
|
||||||
|
|
||||||
export function initContextPopups() {
|
export function initContextPopups() {
|
||||||
const refIssues = document.querySelectorAll('.ref-issue');
|
const refIssues = document.querySelectorAll('.ref-issue');
|
@ -1,7 +1,7 @@
|
|||||||
import {clippie} from 'clippie';
|
import {clippie} from 'clippie';
|
||||||
import {showTemporaryTooltip} from '../modules/tippy.js';
|
import {showTemporaryTooltip} from '../modules/tippy.ts';
|
||||||
import {convertImage} from '../utils.js';
|
import {convertImage} from '../utils.ts';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
|
|
||||||
const {i18n} = window.config;
|
const {i18n} = window.config;
|
||||||
|
|
@ -1,11 +1,11 @@
|
|||||||
import {svg} from '../svg.js';
|
import {svg} from '../svg.ts';
|
||||||
import {htmlEscape} from 'escape-goat';
|
import {htmlEscape} from 'escape-goat';
|
||||||
import {clippie} from 'clippie';
|
import {clippie} from 'clippie';
|
||||||
import {showTemporaryTooltip} from '../modules/tippy.js';
|
import {showTemporaryTooltip} from '../modules/tippy.ts';
|
||||||
import {GET, POST} from '../modules/fetch.js';
|
import {GET, POST} from '../modules/fetch.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
import {createElementFromHTML, createElementFromAttrs} from '../utils/dom.js';
|
import {createElementFromHTML, createElementFromAttrs} from '../utils/dom.ts';
|
||||||
import {isImageFile, isVideoFile} from '../utils.js';
|
import {isImageFile, isVideoFile} from '../utils.ts';
|
||||||
|
|
||||||
const {csrfToken, i18n} = window.config;
|
const {csrfToken, i18n} = window.config;
|
||||||
|
|
@ -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.
|
// Hides the file if newFold is true, and shows it otherwise. The actual hiding is performed using CSS.
|
||||||
//
|
//
|
@ -1,6 +1,6 @@
|
|||||||
import {createApp} from 'vue';
|
import {createApp} from 'vue';
|
||||||
import ActivityHeatmap from '../components/ActivityHeatmap.vue';
|
import ActivityHeatmap from '../components/ActivityHeatmap.vue';
|
||||||
import {translateMonth, translateDay} from '../utils.js';
|
import {translateMonth, translateDay} from '../utils.ts';
|
||||||
|
|
||||||
export function initHeatmap() {
|
export function initHeatmap() {
|
||||||
const el = document.querySelector('#user-heatmap');
|
const el = document.querySelector('#user-heatmap');
|
@ -1,7 +1,7 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
import {hideElem, loadElem, queryElemChildren, queryElems} from '../utils/dom.js';
|
import {hideElem, loadElem, queryElemChildren, queryElems} from '../utils/dom.ts';
|
||||||
import {parseDom} from '../utils.js';
|
import {parseDom} from '../utils.ts';
|
||||||
|
|
||||||
function getDefaultSvgBoundsIfUndefined(text, src) {
|
function getDefaultSvgBoundsIfUndefined(text, src) {
|
||||||
const defaultSize = 300;
|
const defaultSize = 300;
|
@ -1,5 +1,5 @@
|
|||||||
import {hideElem, showElem} from '../utils/dom.js';
|
import {hideElem, showElem} from '../utils/dom.ts';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
|
|
||||||
export function initInstall() {
|
export function initInstall() {
|
||||||
const page = document.querySelector('.page-content.install');
|
const page = document.querySelector('.page-content.install');
|
@ -1,7 +1,7 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
import {toggleElem} from '../utils/dom.js';
|
import {toggleElem} from '../utils/dom.ts';
|
||||||
import {logoutFromWorker} from '../modules/worker.js';
|
import {logoutFromWorker} from '../modules/worker.ts';
|
||||||
|
|
||||||
const {appSubUrl, notificationSettings, assetVersionEncoded} = window.config;
|
const {appSubUrl, notificationSettings, assetVersionEncoded} = window.config;
|
||||||
let notificationSequenceNumber = 0;
|
let notificationSequenceNumber = 0;
|
@ -1,5 +1,5 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {hideElem, showElem} from '../utils/dom.js';
|
import {hideElem, showElem} from '../utils/dom.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
import {diffTreeStore} from '../modules/stores.js';
|
import {diffTreeStore} from '../modules/stores.ts';
|
||||||
import {setFileFolding} from './file-fold.js';
|
import {setFileFolding} from './file-fold.ts';
|
||||||
import {POST} from '../modules/fetch.js';
|
import {POST} from '../modules/fetch.ts';
|
||||||
|
|
||||||
const {pageData} = window.config;
|
const {pageData} = window.config;
|
||||||
const prReview = pageData.prReview || {};
|
const prReview = pageData.prReview || {};
|
@ -1,5 +1,5 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {toggleElem} from '../utils/dom.js';
|
import {toggleElem} from '../utils/dom.ts';
|
||||||
|
|
||||||
export function initRepoBranchButton() {
|
export function initRepoBranchButton() {
|
||||||
initRepoCreateBranchButton();
|
initRepoCreateBranchButton();
|
@ -1,4 +1,4 @@
|
|||||||
import {singleAnchorRegex, rangeAnchorRegex} from './repo-code.js';
|
import {singleAnchorRegex, rangeAnchorRegex} from './repo-code.ts';
|
||||||
|
|
||||||
test('singleAnchorRegex', () => {
|
test('singleAnchorRegex', () => {
|
||||||
expect(singleAnchorRegex.test('#L0')).toEqual(false);
|
expect(singleAnchorRegex.test('#L0')).toEqual(false);
|
@ -1,9 +1,9 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {svg} from '../svg.js';
|
import {svg} from '../svg.ts';
|
||||||
import {invertFileFolding} from './file-fold.js';
|
import {invertFileFolding} from './file-fold.ts';
|
||||||
import {createTippy} from '../modules/tippy.js';
|
import {createTippy} from '../modules/tippy.ts';
|
||||||
import {clippie} from 'clippie';
|
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 singleAnchorRegex = /^#(L|n)([1-9][0-9]*)$/;
|
||||||
export const rangeAnchorRegex = /^#(L[1-9][0-9]*)-(L[1-9][0-9]*)$/;
|
export const rangeAnchorRegex = /^#(L[1-9][0-9]*)-(L[1-9][0-9]*)$/;
|
@ -1,5 +1,5 @@
|
|||||||
import {createTippy} from '../modules/tippy.js';
|
import {createTippy} from '../modules/tippy.ts';
|
||||||
import {toggleElem} from '../utils/dom.js';
|
import {toggleElem} from '../utils/dom.ts';
|
||||||
|
|
||||||
export function initRepoEllipsisButton() {
|
export function initRepoEllipsisButton() {
|
||||||
for (const button of document.querySelectorAll('.js-toggle-commit-body')) {
|
for (const button of document.querySelectorAll('.js-toggle-commit-body')) {
|
@ -1,8 +1,8 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {hideElem, queryElems, showElem} from '../utils/dom.js';
|
import {hideElem, queryElems, showElem} from '../utils/dom.ts';
|
||||||
import {POST} from '../modules/fetch.js';
|
import {POST} from '../modules/fetch.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
import {sleep} from '../utils.js';
|
import {sleep} from '../utils.ts';
|
||||||
|
|
||||||
async function onDownloadArchive(e) {
|
async function onDownloadArchive(e) {
|
||||||
e.preventDefault();
|
e.preventDefault();
|
@ -1,5 +1,5 @@
|
|||||||
import {hideElem, showElem, toggleElem} from '../utils/dom.js';
|
import {hideElem, showElem, toggleElem} from '../utils/dom.ts';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
|
|
||||||
async function loadBranchesAndTags(area, loadingButton) {
|
async function loadBranchesAndTags(area, loadingButton) {
|
||||||
loadingButton.classList.add('disabled');
|
loadingButton.classList.add('disabled');
|
@ -1,14 +1,14 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {initCompReactionSelector} from './comp/ReactionSelector.js';
|
import {initCompReactionSelector} from './comp/ReactionSelector.ts';
|
||||||
import {initRepoIssueContentHistory} from './repo-issue-content.js';
|
import {initRepoIssueContentHistory} from './repo-issue-content.ts';
|
||||||
import {initDiffFileTree} from './repo-diff-filetree.js';
|
import {initDiffFileTree} from './repo-diff-filetree.ts';
|
||||||
import {initDiffCommitSelect} from './repo-diff-commitselect.js';
|
import {initDiffCommitSelect} from './repo-diff-commitselect.ts';
|
||||||
import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.js';
|
import {validateTextareaNonEmpty} from './comp/ComboMarkdownEditor.ts';
|
||||||
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles, initExpandAndCollapseFilesButton} from './pull-view-file.js';
|
import {initViewedCheckboxListenerFor, countAndUpdateViewedFiles, initExpandAndCollapseFilesButton} from './pull-view-file.ts';
|
||||||
import {initImageDiff} from './imagediff.js';
|
import {initImageDiff} from './imagediff.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
import {submitEventSubmitter, queryElemSiblings, hideElem, showElem, animateOnce} from '../utils/dom.js';
|
import {submitEventSubmitter, queryElemSiblings, hideElem, showElem, animateOnce} from '../utils/dom.ts';
|
||||||
import {POST, GET} from '../modules/fetch.js';
|
import {POST, GET} from '../modules/fetch.ts';
|
||||||
|
|
||||||
const {pageData, i18n} = window.config;
|
const {pageData, i18n} = window.config;
|
||||||
|
|
@ -1,11 +1,11 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {htmlEscape} from 'escape-goat';
|
import {htmlEscape} from 'escape-goat';
|
||||||
import {createCodeEditor} from './codeeditor.js';
|
import {createCodeEditor} from './codeeditor.ts';
|
||||||
import {hideElem, queryElems, showElem} from '../utils/dom.js';
|
import {hideElem, queryElems, showElem} from '../utils/dom.ts';
|
||||||
import {initMarkupContent} from '../markup/content.js';
|
import {initMarkupContent} from '../markup/content.ts';
|
||||||
import {attachRefIssueContextPopup} from './contextpopup.js';
|
import {attachRefIssueContextPopup} from './contextpopup.ts';
|
||||||
import {POST} from '../modules/fetch.js';
|
import {POST} from '../modules/fetch.ts';
|
||||||
import {initDropzone} from './dropzone.js';
|
import {initDropzone} from './dropzone.ts';
|
||||||
|
|
||||||
function initEditPreviewTab($form) {
|
function initEditPreviewTab($form) {
|
||||||
const $tabMenu = $form.find('.repo-editor-menu');
|
const $tabMenu = $form.find('.repo-editor-menu');
|
@ -1,4 +1,4 @@
|
|||||||
import {strSubMatch, calcMatchedWeight, filterRepoFilesWeighted} from './repo-findfile.js';
|
import {strSubMatch, calcMatchedWeight, filterRepoFilesWeighted} from './repo-findfile.ts';
|
||||||
|
|
||||||
describe('Repo Find Files', () => {
|
describe('Repo Find Files', () => {
|
||||||
test('strSubMatch', () => {
|
test('strSubMatch', () => {
|
@ -1,7 +1,7 @@
|
|||||||
import {svg} from '../svg.js';
|
import {svg} from '../svg.ts';
|
||||||
import {toggleElem} from '../utils/dom.js';
|
import {toggleElem} from '../utils/dom.ts';
|
||||||
import {pathEscapeSegments} from '../utils/url.js';
|
import {pathEscapeSegments} from '../utils/url.ts';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
|
|
||||||
const threshold = 50;
|
const threshold = 50;
|
||||||
let files = [];
|
let files = [];
|
@ -1,6 +1,6 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {hideElem, showElem} from '../utils/dom.js';
|
import {hideElem, showElem} from '../utils/dom.ts';
|
||||||
import {GET} from '../modules/fetch.js';
|
import {GET} from '../modules/fetch.ts';
|
||||||
|
|
||||||
export function initRepoGraphGit() {
|
export function initRepoGraphGit() {
|
||||||
const graphContainer = document.querySelector('#git-graph-container');
|
const graphContainer = document.querySelector('#git-graph-container');
|
@ -1,8 +1,8 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {stripTags} from '../utils.js';
|
import {stripTags} from '../utils.ts';
|
||||||
import {hideElem, queryElemChildren, showElem} from '../utils/dom.js';
|
import {hideElem, queryElemChildren, showElem} from '../utils/dom.ts';
|
||||||
import {POST} from '../modules/fetch.js';
|
import {POST} from '../modules/fetch.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
|
|
@ -1,8 +1,8 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {svg} from '../svg.js';
|
import {svg} from '../svg.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
import {GET, POST} from '../modules/fetch.js';
|
import {GET, POST} from '../modules/fetch.ts';
|
||||||
import {showElem} from '../utils/dom.js';
|
import {showElem} from '../utils/dom.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
let i18nTextEdited;
|
let i18nTextEdited;
|
@ -1,11 +1,11 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {handleReply} from './repo-issue.js';
|
import {handleReply} from './repo-issue.ts';
|
||||||
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
|
import {getComboMarkdownEditor, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.ts';
|
||||||
import {POST} from '../modules/fetch.js';
|
import {POST} from '../modules/fetch.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
import {hideElem, showElem} from '../utils/dom.js';
|
import {hideElem, showElem} from '../utils/dom.ts';
|
||||||
import {attachRefIssueContextPopup} from './contextpopup.js';
|
import {attachRefIssueContextPopup} from './contextpopup.ts';
|
||||||
import {initCommentContent, initMarkupContent} from '../markup/content.js';
|
import {initCommentContent, initMarkupContent} from '../markup/content.ts';
|
||||||
|
|
||||||
async function onEditContent(event) {
|
async function onEditContent(event) {
|
||||||
event.preventDefault();
|
event.preventDefault();
|
@ -1,12 +1,12 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {updateIssuesMeta} from './repo-issue.js';
|
import {updateIssuesMeta} from './repo-issue.ts';
|
||||||
import {toggleElem, hideElem, isElemHidden} from '../utils/dom.js';
|
import {toggleElem, hideElem, isElemHidden} from '../utils/dom.ts';
|
||||||
import {htmlEscape} from 'escape-goat';
|
import {htmlEscape} from 'escape-goat';
|
||||||
import {confirmModal} from './comp/ConfirmModal.js';
|
import {confirmModal} from './comp/ConfirmModal.ts';
|
||||||
import {showErrorToast} from '../modules/toast.js';
|
import {showErrorToast} from '../modules/toast.ts';
|
||||||
import {createSortable} from '../modules/sortable.js';
|
import {createSortable} from '../modules/sortable.ts';
|
||||||
import {DELETE, POST} from '../modules/fetch.js';
|
import {DELETE, POST} from '../modules/fetch.ts';
|
||||||
import {parseDom} from '../utils.js';
|
import {parseDom} from '../utils.ts';
|
||||||
|
|
||||||
function initRepoIssueListCheckboxes() {
|
function initRepoIssueListCheckboxes() {
|
||||||
const issueSelectAll = document.querySelector('.issue-checkbox-all');
|
const issueSelectAll = document.querySelector('.issue-checkbox-all');
|
@ -1,5 +1,5 @@
|
|||||||
import {hideElem, showElem} from '../utils/dom.js';
|
import {hideElem, showElem} from '../utils/dom.ts';
|
||||||
import {GET, POST} from '../modules/fetch.js';
|
import {GET, POST} from '../modules/fetch.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
|
|
@ -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 service = document.querySelector('#service_type');
|
||||||
const user = document.querySelector('#auth_username');
|
const user = document.querySelector('#auth_username');
|
@ -1,7 +1,7 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {contrastColor} from '../utils/color.js';
|
import {contrastColor} from '../utils/color.ts';
|
||||||
import {createSortable} from '../modules/sortable.js';
|
import {createSortable} from '../modules/sortable.ts';
|
||||||
import {POST, DELETE, PUT} from '../modules/fetch.js';
|
import {POST, DELETE, PUT} from '../modules/fetch.ts';
|
||||||
|
|
||||||
function updateIssueCount(cards) {
|
function updateIssueCount(cards) {
|
||||||
const parent = cards.parentElement;
|
const parent = cards.parentElement;
|
@ -1,5 +1,5 @@
|
|||||||
import {hideElem, showElem} from '../utils/dom.js';
|
import {hideElem, showElem} from '../utils/dom.ts';
|
||||||
import {initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
|
import {initComboMarkdownEditor} from './comp/ComboMarkdownEditor.ts';
|
||||||
|
|
||||||
export function initRepoRelease() {
|
export function initRepoRelease() {
|
||||||
document.addEventListener('click', (e) => {
|
document.addEventListener('click', (e) => {
|
@ -1,8 +1,8 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {minimatch} from 'minimatch';
|
import {minimatch} from 'minimatch';
|
||||||
import {createMonaco} from './codeeditor.js';
|
import {createMonaco} from './codeeditor.ts';
|
||||||
import {onInputDebounce, queryElems, toggleElem} from '../utils/dom.js';
|
import {onInputDebounce, queryElems, toggleElem} from '../utils/dom.ts';
|
||||||
import {POST} from '../modules/fetch.js';
|
import {POST} from '../modules/fetch.ts';
|
||||||
|
|
||||||
const {appSubUrl, csrfToken} = window.config;
|
const {appSubUrl, csrfToken} = window.config;
|
||||||
|
|
@ -1,6 +1,6 @@
|
|||||||
import $ from 'jquery';
|
import $ from 'jquery';
|
||||||
import {htmlEscape} from 'escape-goat';
|
import {htmlEscape} from 'escape-goat';
|
||||||
import {hideElem, showElem} from '../utils/dom.js';
|
import {hideElem, showElem} from '../utils/dom.ts';
|
||||||
|
|
||||||
const {appSubUrl} = window.config;
|
const {appSubUrl} = window.config;
|
||||||
|
|
@ -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() {
|
export function initUnicodeEscapeButton() {
|
||||||
document.addEventListener('click', (e) => {
|
document.addEventListener('click', (e) => {
|
@ -1,7 +1,7 @@
|
|||||||
import {initMarkupContent} from '../markup/content.js';
|
import {initMarkupContent} from '../markup/content.ts';
|
||||||
import {validateTextareaNonEmpty, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.js';
|
import {validateTextareaNonEmpty, initComboMarkdownEditor} from './comp/ComboMarkdownEditor.ts';
|
||||||
import {fomanticMobileScreen} from '../modules/fomantic.js';
|
import {fomanticMobileScreen} from '../modules/fomantic.ts';
|
||||||
import {POST} from '../modules/fetch.js';
|
import {POST} from '../modules/fetch.ts';
|
||||||
|
|
||||||
async function initRepoWikiFormEditor() {
|
async function initRepoWikiFormEditor() {
|
||||||
const editArea = document.querySelector('.repository.wiki .combo-markdown-editor textarea');
|
const editArea = document.querySelector('.repository.wiki .combo-markdown-editor textarea');
|
Some files were not shown because too many files have changed in this diff Show More
Loading…
Reference in New Issue