Begin XenForo Sync and continue Uploader
This commit is contained in:
@@ -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 );
|
||||
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user