aboutsummaryrefslogtreecommitdiff
path: root/html/display.html
diff options
context:
space:
mode:
authoramy <[email protected]>2023-02-16 14:04:44 -0600
committeramy <[email protected]>2023-02-16 14:04:44 -0600
commitf7d6c8db1fd7fa82c7da96d0f06da4e49fbd9a05 (patch)
treea2d0ad68c24962372b723aa66282401d893d8924 /html/display.html
parentc2d46691d9b774872ace260446ff309ec6a813b3 (diff)
a certified mess
Diffstat (limited to 'html/display.html')
-rw-r--r--html/display.html99
1 files changed, 64 insertions, 35 deletions
diff --git a/html/display.html b/html/display.html
index da955dd..b9cf718 100644
--- a/html/display.html
+++ b/html/display.html
@@ -90,6 +90,18 @@
cursor: ns-resize;
}
+ table {
+ display: table;
+ }
+
+ table tr {
+ display: table-cell;
+ }
+
+ table tr td {
+ display: block;
+ }
+
.resize-e {
position: absolute;
right: -3px;
@@ -300,7 +312,17 @@
position: absolute;
padding-top: 3px;
background-color: #c7c7c7;
+ overflow: hidden;
+ }
+ .fd-bottom {
+ width: 100%;
+ height: 26px;
+ background-color: #b1b1b1;
+ position: absolute;
+ bottom: 0;
+ overflow: hidden;
+ white-space: nowrap;
}
textarea {
@@ -333,7 +355,8 @@
input:hover {
cursor: text;
}
- button{
+
+ button {
border-radius: 0px;
background-color: #c1c1c1;
}
@@ -435,7 +458,7 @@
let temp = []
bar.innerHTML = ""
for (let i = 0; i != windows.length; i++) {
- bar.innerHTML += "<div style='left:" + last_left + ";' id='" + windows.item(i).id + "' class='bar-item'>" + windows.item(i).getAttribute("window-name") + "</div>"
+ bar.innerHTML += "<div style='left:" + last_left + ";' id='" + windows.item(i).id + "-bar' class='bar-item'>" + windows.item(i).getAttribute("window-name") + "</div>"
temp.push({ left: last_left, id: windows.item(i).id, width: bar.children.item(bar.children.length - 1).clientWidth + 5 })
last_left += bar.children.item(bar.children.length - 1).clientWidth + 5
@@ -446,8 +469,9 @@
for (let i = 0; i != bar.children.length; i++) {
let elemy = bar.children.item(i)
for (let ii = 0; ii != windows.length; ii++) {
- if (windows.item(ii).id == elemy.id) {
+ if (windows.item(ii).id + "-bar" == elemy.id) {
//let px = 0, py = 0;
+
elemy.onmousedown = ((ev) => {
for (let iii = 0; iii != windows.length; iii++) {
windows.item(iii).style.zIndex = 0;
@@ -501,44 +525,48 @@
let minx = 150;
let miny = 150;
function window_create(uid, name, content, options = {}) {
- let lines = content.split("</br>").length
- let a = ''
- let size = (options.width != undefined && options.height != undefined) ? ("width:" + options.width + "px;height:" + options.height + "px;") : ("width:" + Math.max(document.body.clientWidth * .56, minx) + "px;height:" + Math.max(miny, document.body.clientHeight * .30) + "px;");
- let pos = (options.left != undefined && options.top != undefined) ? ("left:" + options.left + "px;top:" + options.top + "px;") : ("left:0px;top:0px;");
- a += "<div id='" + uid + "-root' class='window' style=\"" + size + pos + "position:absolute;\" window-name='" + name + "'>"
- //console.log(document.getElementById(uid).attributes["window-name"].value)
- a += "<div id='" + uid + "-head' class='head-border' window-name='" + name + "'> <div style='color:fdffff'>" + name + "</div>"
- a += "<div id='" + uid + "-close' class='close-button' window-name='" + name + "'>" + `<svg draggable="false" xmlns="http://www.w3.org/2000/svg" style="position:absolute;left:-3px;top:0px;" xmlns:xlink="http://www.w3.org/1999/xlink" width="23px" height="20px" viewBox="0 0 23 20" version="1.1">
+ let promise = new Promise((res, rej) => {
+ let lines = content.split("</br>").length
+ let a = ''
+ let size = (options.width != undefined && options.height != undefined) ? ("width:" + options.width + "px;height:" + options.height + "px;") : ("width:" + Math.max(document.body.clientWidth * .36, minx) + "px;height:" + Math.max(miny, document.body.clientHeight * .30) + "px;");
+ let pos = (options.left != undefined && options.top != undefined) ? ("left:" + options.left + "px;top:" + options.top + "px;") : ("left:0px;top:0px;");
+ a += "<div id='" + uid + "-root' class='window' style=\"" + size + pos + "position:absolute;\" window-name='" + name + "'>"
+ //console.log(document.getElementById(uid).attributes["window-name"].value)
+ a += "<div id='" + uid + "-head' class='head-border' window-name='" + name + "'> <div style='color:fdffff'>" + name + "</div>"
+ a += "<div id='" + uid + "-close' class='close-button' window-name='" + name + "'>" + `<svg draggable="false" xmlns="http://www.w3.org/2000/svg" style="position:absolute;left:-3px;top:0px;" xmlns:xlink="http://www.w3.org/1999/xlink" width="23px" height="20px" viewBox="0 0 23 20" version="1.1">
<g id="surface1">
<path style=" stroke:none;fill-rule:evenodd;fill:rgb(2.745098%,3.137255%,2.745098%);fill-opacity:1;" d="M 8.476562 6.042969 C 9.042969 6.042969 9.613281 6.042969 10.179688 6.042969 C 10.179688 6.332031 10.179688 6.625 10.179688 6.914062 C 10.464844 6.914062 10.746094 6.914062 11.03125 6.914062 C 11.03125 7.203125 11.03125 7.492188 11.03125 7.78125 C 11.597656 7.78125 12.167969 7.78125 12.734375 7.78125 C 12.734375 7.492188 12.734375 7.203125 12.734375 6.914062 C 13.019531 6.914062 13.304688 6.914062 13.585938 6.914062 C 13.585938 6.625 13.585938 6.332031 13.585938 6.042969 C 14.15625 6.042969 14.722656 6.042969 15.289062 6.042969 C 15.289062 6.332031 15.289062 6.625 15.289062 6.914062 C 15.007812 6.914062 14.722656 6.914062 14.4375 6.914062 C 14.4375 7.203125 14.4375 7.492188 14.4375 7.78125 C 14.15625 7.78125 13.871094 7.78125 13.585938 7.78125 C 13.585938 8.074219 13.585938 8.363281 13.585938 8.652344 C 13.304688 8.652344 13.019531 8.652344 12.734375 8.652344 C 12.734375 8.941406 12.734375 9.230469 12.734375 9.523438 C 13.019531 9.523438 13.304688 9.523438 13.585938 9.523438 C 13.585938 9.8125 13.585938 10.101562 13.585938 10.390625 C 13.871094 10.390625 14.15625 10.390625 14.4375 10.390625 C 14.4375 10.679688 14.4375 10.972656 14.4375 11.261719 C 14.722656 11.261719 15.007812 11.261719 15.289062 11.261719 C 15.289062 11.550781 15.289062 11.839844 15.289062 12.128906 C 14.722656 12.128906 14.15625 12.128906 13.585938 12.128906 C 13.585938 11.839844 13.585938 11.550781 13.585938 11.261719 C 13.304688 11.261719 13.019531 11.261719 12.734375 11.261719 C 12.734375 10.972656 12.734375 10.679688 12.734375 10.390625 C 12.167969 10.390625 11.597656 10.390625 11.03125 10.390625 C 11.03125 10.679688 11.03125 10.972656 11.03125 11.261719 C 10.746094 11.261719 10.464844 11.261719 10.179688 11.261719 C 10.179688 11.550781 10.179688 11.839844 10.179688 12.128906 C 9.613281 12.128906 9.042969 12.128906 8.476562 12.128906 C 8.476562 11.839844 8.476562 11.550781 8.476562 11.261719 C 8.761719 11.261719 9.042969 11.261719 9.328125 11.261719 C 9.328125 10.972656 9.328125 10.679688 9.328125 10.390625 C 9.613281 10.390625 9.894531 10.390625 10.179688 10.390625 C 10.179688 10.101562 10.179688 9.8125 10.179688 9.523438 C 10.464844 9.523438 10.746094 9.523438 11.03125 9.523438 C 11.03125 9.230469 11.03125 8.941406 11.03125 8.652344 C 10.746094 8.652344 10.464844 8.652344 10.179688 8.652344 C 10.179688 8.363281 10.179688 8.074219 10.179688 7.78125 C 9.894531 7.78125 9.613281 7.78125 9.328125 7.78125 C 9.328125 7.492188 9.328125 7.203125 9.328125 6.914062 C 9.042969 6.914062 8.761719 6.914062 8.476562 6.914062 C 8.476562 6.625 8.476562 6.332031 8.476562 6.042969 Z M 8.476562 6.042969 "/>
</g>
</svg></div></div>`
- if (options.resize != false && options.resize != "false") {
- a += "<div id='" + uid + "-resize-n' class='resize-n'></div>"
- a += "<div id='" + uid + "-resize-s' class='resize-s'></div>"
- a += "<div id='" + uid + "-resize-e' class='resize-e'></div>"
- a += "<div id='" + uid + "-resize-w' class='resize-w'></div>"
- }
- a += "<div style='height:25px;'></div>"
- a += "<div id='" + uid + "-content-root' class='content-root' style='overflow:scroll;height:calc(100% - 26px);width:100%'>"
+ if (options.resize != false && options.resize != "false") {
+ a += "<div id='" + uid + "-resize-n' class='resize-n'></div>"
+ a += "<div id='" + uid + "-resize-s' class='resize-s'></div>"
+ a += "<div id='" + uid + "-resize-e' class='resize-e'></div>"
+ a += "<div id='" + uid + "-resize-w' class='resize-w'></div>"
+ }
+ a += "<div style='height:25px;'></div>"
+ a += "<div id='" + uid + "-content-root' class='content-root' style='overflow:scroll;height:calc(100% - 26px);width:100%'>"
- a += "<div id='" + uid + "-content-content' class='content-content'>" + content + "</div>"
- if (options.scroll != false && options.scroll != "false") {
- a += "<div id='" + uid + "-content-scrollbar' class='scrollbar'><div id='" + uid + "-content-scrollbar-point' class='scrollbar-point'></div>"
+ a += "<div id='" + uid + "-content-content' class='content-content'>" + content + "</div>"
+ if (options.scroll != false && options.scroll != "false") {
+ a += "<div id='" + uid + "-content-scrollbar' class='scrollbar'><div id='" + uid + "-content-scrollbar-point' class='scrollbar-point'></div>"
+ a += "</div>"
+ }
a += "</div>"
- }
- a += "</div>"
- if (options.resize != false && options.resize != "false") {
- a += "<div id='" + uid + "-resize-ne' class='resize-ne'></div>"
- a += "<div id='" + uid + "-resize-nw' class='resize-nw'></div>"
- a += "<div id='" + uid + "-resize-sw' class='resize-sw'></div>"
- a += "<div id='" + uid + "-resize-es' class='resize-es'></div>"
- }
- document.getElementById("root").innerHTML += a
- //console.log(document.getElementById(uid + "-content-root").clientHeight / (document.getElementById(uid + "-content-content").clientHeight / document.getElementById(uid + "-content-root").clientHeight))
+ if (options.resize != false && options.resize != "false") {
+ a += "<div id='" + uid + "-resize-ne' class='resize-ne'></div>"
+ a += "<div id='" + uid + "-resize-nw' class='resize-nw'></div>"
+ a += "<div id='" + uid + "-resize-sw' class='resize-sw'></div>"
+ a += "<div id='" + uid + "-resize-es' class='resize-es'></div>"
+ }
+ document.getElementById("root").innerHTML += a
+ //console.log(document.getElementById(uid + "-content-root").clientHeight / (document.getElementById(uid + "-content-content").clientHeight / document.getElementById(uid + "-content-root").clientHeight))
- //console.log(document.getElementById(uid + "-content-scrollbar-point"))
- refresh_windows()
+ //console.log(document.getElementById(uid + "-content-scrollbar-point"))
+ refresh_windows()
+ res()
+ })
+ return promise
}
function refresh_windows() {
load_bar()
@@ -873,7 +901,8 @@
async function main() {
fs = await req('src/fs.json')
- util.alert("test")
+ fd = await util.fd({ path: '/', filetype: '*' })
+ console.log(fd)
document.getElementById("bar-menu").onclick = ((ev) => {
if (document.getElementById("bar-menu-root").style.display == "block")
document.getElementById("bar-menu-root").style.display = "none"