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,9 +1,12 @@
import {__, FORBIDDEN_CARS, romhackplaza_modal_submissions, during_upload, I } from "./globals";
import {__, FORBIDDEN_CARS, I } from "./globals";
import {DropContainer} from "./class-drop-container";
declare const _romhackplaza_script_uploader: any;
declare const romhackplaza_modal_submissions: any;
export class Upload {
file: File;
progress_bar: HTMLElement|undefined;
constructor( file: File ){
@@ -22,10 +25,20 @@ export class Upload {
console.error("WTF at beginUpload method.");
return;
}
this.switchDuringUpload();
if( typeof I.drop_container !== 'undefined' && I.drop_container instanceof DropContainer )
I.drop_container.switch();
let progress = document.getElementById( 'progress' );
if( progress !== null ) {
progress.style.display = 'block';
this.progress_bar = progress.querySelector('.bar') as HTMLElement;
}
if( I.reserved_post_id === undefined || I.reserved_post_id === null )
console.log( "ok" );
}
checkForbiddenCars() :boolean {
@@ -42,11 +55,20 @@ export class Upload {
private switchDuringUpload(): void {
// @ts-ignore
during_upload = !during_upload;
I.during_upload = !I.during_upload;
this.changeStatus( __( "Preparing upload...", 'romhackplaza' ) );
this.switchSubmissionButton();
}
private changeStatus( str: string ){
let sts: HTMLElement|null = document.getElementById( 'status' );
if( sts !== null )
sts.textContent = str;
}
private switchSubmissionButton(): void {
let btn: HTMLElement|null = document.getElementById( 'submitTranslationButton' );