mirror of
https://github.com/go-gitea/gitea
synced 2025-01-19 06:04:26 +00:00
parent
be4e961240
commit
c0751ef116
@ -38,9 +38,6 @@ export function initRepoEditor() {
|
|||||||
const dropzoneUpload = document.querySelector<HTMLElement>('.page-content.repository.editor.upload .dropzone');
|
const dropzoneUpload = document.querySelector<HTMLElement>('.page-content.repository.editor.upload .dropzone');
|
||||||
if (dropzoneUpload) initDropzone(dropzoneUpload);
|
if (dropzoneUpload) initDropzone(dropzoneUpload);
|
||||||
|
|
||||||
const editArea = document.querySelector<HTMLTextAreaElement>('.page-content.repository.editor textarea#edit_area');
|
|
||||||
if (!editArea) return;
|
|
||||||
|
|
||||||
for (const el of queryElems<HTMLInputElement>(document, '.js-quick-pull-choice-option')) {
|
for (const el of queryElems<HTMLInputElement>(document, '.js-quick-pull-choice-option')) {
|
||||||
el.addEventListener('input', () => {
|
el.addEventListener('input', () => {
|
||||||
if (el.value === 'commit-to-new-branch') {
|
if (el.value === 'commit-to-new-branch') {
|
||||||
@ -55,6 +52,7 @@ export function initRepoEditor() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
const filenameInput = document.querySelector<HTMLInputElement>('#file-name');
|
const filenameInput = document.querySelector<HTMLInputElement>('#file-name');
|
||||||
|
if (!filenameInput) return;
|
||||||
function joinTreePath() {
|
function joinTreePath() {
|
||||||
const parts = [];
|
const parts = [];
|
||||||
for (const el of document.querySelectorAll('.breadcrumb span.section')) {
|
for (const el of document.querySelectorAll('.breadcrumb span.section')) {
|
||||||
@ -144,6 +142,10 @@ export function initRepoEditor() {
|
|||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
// on the upload page, there is no editor(textarea)
|
||||||
|
const editArea = document.querySelector<HTMLTextAreaElement>('.page-content.repository.editor textarea#edit_area');
|
||||||
|
if (!editArea) return;
|
||||||
|
|
||||||
const elForm = document.querySelector<HTMLFormElement>('.repository.editor .edit.form');
|
const elForm = document.querySelector<HTMLFormElement>('.repository.editor .edit.form');
|
||||||
initEditPreviewTab(elForm);
|
initEditPreviewTab(elForm);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user