diff options
-rw-r--r-- | html/display.html | 12 | ||||
-rw-r--r-- | src/fs-types.json | 4 | ||||
-rw-r--r-- | src/window-utils.js | 31 |
3 files changed, 38 insertions, 9 deletions
diff --git a/html/display.html b/html/display.html index b9cf718..44b68e1 100644 --- a/html/display.html +++ b/html/display.html @@ -317,7 +317,7 @@ .fd-bottom { width: 100%; - height: 26px; + height: 56px; background-color: #b1b1b1; position: absolute; bottom: 0; @@ -360,6 +360,13 @@ border-radius: 0px; background-color: #c1c1c1; } + + select, + option { + background-color: rgba(0, 0, 0, 0); + border: none; + border-radius: 0; + } </style> <script> function compare(a, b) { @@ -898,9 +905,10 @@ } - + let fs_types; async function main() { fs = await req('src/fs.json') + fs_types = await req('src/fs-types.json') fd = await util.fd({ path: '/', filetype: '*' }) console.log(fd) document.getElementById("bar-menu").onclick = ((ev) => { diff --git a/src/fs-types.json b/src/fs-types.json new file mode 100644 index 0000000..4b1d9f7 --- /dev/null +++ b/src/fs-types.json @@ -0,0 +1,4 @@ +[ + { "identifier": "*", "descriptor": "All Files", "regex": "/(.*)/g" }, + { "identifier": "*.txt", "descriptor": "Text Files", "regex": "/(.*txt$)/g" } +] diff --git a/src/window-utils.js b/src/window-utils.js index 2755878..8f990c8 100644 --- a/src/window-utils.js +++ b/src/window-utils.js @@ -72,18 +72,35 @@ let util = { "</div></div>"; } } + let opts = ""; + for (let uwu of fs_types) { + opts += + "<option>(" + uwu.identifier + ") " + uwu.descriptor + "</option>"; + } files += "<div id='" + i + - "-fd-bottom' class='fd-bottom' >file/directory name: <div style='display:inline-block;' id='" + + "-fd-bottom' class='fd-bottom' ><div id='" + i + - "-fd-bottom-sel'>" + + "-fd-bar-top'><div style='width:70px;display:inline-block;'> File <u>n</u>ame: </div><div style='background-color:white;display:inline-block;width:40%' ><input style='display:inline-block;text-shadow:none;width:100%;' id='" + + i + + "-fd-bottom-sel' value='" + sel.join(",") + - (sel.length == 0 ? "select a file!" : "") + - "</div>" + + (sel.length == 0 ? "Untitled" : "") + + "'></div><button id='" + + i + + "-content-button-sub' style='width:70px;margin-left:22px;padding-left:15px;padding-right:15px;top:0;text-align: center;display:inline-block;'>save</button></div>" + + "<div id='" + + i + + "-fd-bar-bottom'>" + + "<div style='width:70px;display:inline-block;'>File <u>t</u>ype: </div><div style='background-color:white;display:inline-block;width:40%' ><select style='display:inline-block;text-shadow:none;width:100%;' id='" + + i + + "-fd-bottom-sel'>" + + opts + + "'</select>" + "<button id='" + i + - "-content-button-sub' style='padding-left:15px;padding-right:15px;top:0;text-align: center;display:inline-block;position:absolute;right:0;'>submit</button>" + + "-content-button-sub' style='width:70px;margin-left:22px;padding-left:15px;padding-right:15px;top:0;text-align: center;display:inline-block;'>cancel</button></div>" + "</div>"; document.getElementById(i + "-content-content").innerHTML = files; for (let f of tfs) { @@ -125,8 +142,8 @@ let util = { } else sel.push(f.name); } else sel = [f.name]; //sel = [f.name]; - document.getElementById(i + "-fd-bottom-sel").innerHTML = - sel.join(",") + (sel.length == 0 ? "select a file!" : ""); + document.getElementById(i + "-fd-bottom-sel").value = + sel.join(",") + (sel.length == 0 ? "Untitled" : ""); for (let aa of tfs) { let ttt = document.getElementById( i + "-id-name-" + aa.name |