diff options
author | Alex Vitkov <alexvitkov98@gmail.com> | 2021-03-19 22:40:38 +0200 |
---|---|---|
committer | Alex Vitkov <alexvitkov98@gmail.com> | 2021-03-19 22:40:38 +0200 |
commit | cb3949d974f30501281fd2546ef23c81ac0282b3 (patch) | |
tree | b463e63c16c9288af42d34cf86a0fd6ffeeeb5a5 /front | |
parent | dd6cf660b033251c5ab08fa0c3e32a44022a7039 (diff) | |
download | fileup-cb3949d974f30501281fd2546ef23c81ac0282b3.tar.gz |
bundler
Diffstat (limited to 'front')
-rw-r--r-- | front/main.ts (renamed from front/loggedin.ts) | 33 | ||||
-rw-r--r-- | front/window.ts | 25 |
2 files changed, 32 insertions, 26 deletions
diff --git a/front/loggedin.ts b/front/main.ts index db237ac..1761597 100644 --- a/front/loggedin.ts +++ b/front/main.ts @@ -3,6 +3,10 @@ // and you will be able to see PHP's echo output in the browser var FORM_ASYNC = true; +import { OurWindow } from './window'; + +declare var actions: any; + // A FileView is an entry inside the explorer window class FileView { filename: string; @@ -28,30 +32,6 @@ class FileView { // An array of all fileviews currently open -class OurWindow { - pwd: string[]; - visuals: HTMLElement; - h2: HTMLElement; // The titlebar of the window - fileview: any; // TODO what is this - files: any[]; - txt_editor: HTMLElement; // For editable text files, this is the DOM element the user can edit - - // TODO move these to a subclass - foldercontents: any; - filecontents: any; - filecontentsroot: any; - filegrid: any; - save_btn_container: any; - - constructor(pwd) { - this.pwd = pwd; // pwd = [ "Folder1", "Folder2" ] means the current directory of that window is /Folder1/Folder2 - this.visuals = null; // The DOM object - this.h2 = null; // The titlebar of the window - this.fileview = null; - this.files = []; - this.txt_editor = null; // For editable text files, this is the DOM element the user can edit - } -} // An array with all the windows on the screen var windows: OurWindow[] = []; @@ -1188,8 +1168,9 @@ document.body.oncontextmenu = (e) => { the_file.onchange = (e) => { on_file_added(e); }; function set_iframe_enabled(en) { - for (const iframe of document.getElementsByTagName('iframe')) - iframe.hidden = !en; + const frames = document.getElementsByTagName('iframe'); + for (var i = 0; i < frames.length; i++) + frames.item(i).hidden = !en; } main(); diff --git a/front/window.ts b/front/window.ts new file mode 100644 index 0000000..79d053b --- /dev/null +++ b/front/window.ts @@ -0,0 +1,25 @@ + +export class OurWindow { + pwd: string[]; + visuals: HTMLElement; + h2: HTMLElement; // The titlebar of the window + fileview: any; // TODO what is this + files: any[]; + txt_editor: HTMLElement; // For editable text files, this is the DOM element the user can edit + + // TODO move these to a subclass + foldercontents: any; + filecontents: any; + filecontentsroot: any; + filegrid: any; + save_btn_container: any; + + constructor(pwd) { + this.pwd = pwd; // pwd = [ "Folder1", "Folder2" ] means the current directory of that window is /Folder1/Folder2 + this.visuals = null; // The DOM object + this.h2 = null; // The titlebar of the window + this.fileview = null; + this.files = []; + this.txt_editor = null; // For editable text files, this is the DOM element the user can edit + } +}
\ No newline at end of file |