Begin XenForo Sync and continue Uploader

This commit is contained in:
2026-01-24 14:43:58 +01:00
parent 86b70562bc
commit f029371a68
21 changed files with 722 additions and 21 deletions

View File

@@ -1,10 +1,16 @@
import {type Can_Upload_Detail, during_upload, I} from "./globals";
import {type Can_Upload_Detail, I} from "./globals";
import {Upload} from "./class-upload";
import {DropContainer} from "./class-drop-container";
document.addEventListener('DOMContentLoaded', () => {
if( !document.getElementById( 'fileInput' ) ) // Check if exists.
if( !document.getElementById( 'file-container' ) ) // Check if exists.
return;
// Add PostID if edit.
let url_params = new URLSearchParams(window.location.search);
I.is_edit = url_params.has( 'edit_entry' );
I.reserved_post_id = url_params.get('edit_entry' ) || null;
// @ts-ignore
I.drop_container = new DropContainer( document.getElementById( 'file-container' ) as HTMLElement, document.getElementById( 'file-container-text' ) as HTMLElement );
@@ -13,7 +19,7 @@ document.addEventListener('DOMContentLoaded', () => {
document.addEventListener( 'can_upload', (e: CustomEvent<Can_Upload_Detail> ) => {
const { file } = e.detail;
if( !during_upload ) // @ts-ignore
if( !I.during_upload ) // @ts-ignore
I.upload = new Upload( file );
});