From bdf4524ce74420a2c3bb916d774ac9077e6556ea Mon Sep 17 00:00:00 2001 From: amy Date: Tue, 21 Feb 2023 19:56:13 +0000 Subject: new stuff! --- src/window-utils.js | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) (limited to 'src/window-utils.js') diff --git a/src/window-utils.js b/src/window-utils.js index 8f990c8..f2cb794 100644 --- a/src/window-utils.js +++ b/src/window-utils.js @@ -46,11 +46,21 @@ let util = { let promise = new Promise(async (res, rej) => { let i = document.getElementsByClassName("window").length; let sel = []; + let sel_t_n = 0 + let sel_t = fs_types[sel_t_n] + l_b_width = 80 await window_create(i, "fs", ""); function load() { + let fil = [] let ll = new jssh(fs, "/", i, "null", "null", window_create); let tfs = ll.set_wd(ll.clean_path(inp.path)); + //console.log(sel_t) let files = ""; + files += "
" + //left bar + files+= "
" + files += "
" + files += "
" for (let f of tfs) { if (f.dir) { files += @@ -61,7 +71,9 @@ let util = { "' style='height:55px;position:relative;width:48px;display:inline-block;padding:10px;'>
" + f.name + "
"; + fil.push(f) } else { + if(RegExp(sel_t.regex,"g").test(f.name)){ files += "
" + f.name + "
"; + fil.push(f) + } } } + files+="
" let opts = ""; for (let uwu of fs_types) { + let aad = "" + if(uwu==sel_t) + aad = "selected" opts += - ""; + ""; } files += "
" + - "
File type:
" + + "-fd-bottom2-sel' >"+ opts + "'" + "
" + "
"; document.getElementById(i + "-content-content").innerHTML = files; - for (let f of tfs) { + //console.log(tfs) + for (let f of fil) { let tt = document.getElementById(i + "-id-name-" + f.name); + //console.log(tt,f) let dou = false; tt.onclick = (ev) => { if (dou) { - console.log(f, inp); + //console.log(f, inp); if (f.dir) { inp.path += f.name; } else { @@ -161,6 +181,10 @@ let util = { } }; } + document.getElementById(i +"-fd-bottom2-sel").onchange = (ev) => { + sel_t = fs_types[ev.target.selectedIndex] + load() + }; } load(); }); -- cgit v1.2.3