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( '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 ); // @ts-ignore document.addEventListener( 'can_upload', (e: CustomEvent ) => { const { file } = e.detail; if( !I.during_upload ) // @ts-ignore I.upload = new Upload( file ); }); })