From 776a2c75360b1a376b2c22bcadce606030d8c75f Mon Sep 17 00:00:00 2001 From: amy Date: Thu, 23 Feb 2023 17:46:35 -0600 Subject: aa --- readme.md | 4 +++- src/common.js | 5 ++++- src/img/cards.png | Bin 0 -> 501 bytes src/img/doc.png | Bin 0 -> 451 bytes src/jssh.js | 26 ++++++++++++-------------- src/window-utils.js | 24 ++++++++++++++---------- 6 files changed, 33 insertions(+), 26 deletions(-) create mode 100644 src/img/cards.png create mode 100644 src/img/doc.png diff --git a/readme.md b/readme.md index bd108ba..6fee23d 100644 --- a/readme.md +++ b/readme.md @@ -5,6 +5,8 @@ icons (src/img/\*): [here](https://win98icons.alexmeub.com/)
todo: -solitaire! +solitaire!
+fix some of the image scaling
+ ./badges/000010.gif./badges/catp0rtal.gif./badges/getbsod.gif./badges/reshirii.gif./badges/104.gif./badges/css2.gif./badges/gitea.gif./badges/rosemary22.gif./badges/1of2.gif./badges/css.png./badges/hexrain.png./badges/rosemary7.gif./badges/amatsuki.gif./badges/devils_button.gif./badges/linuxnow2.gif./badges/thatwhitehand.png./badges/anibanner.gif./badges/devils.gif./badges/neovim.gif./badges/transistor_cafe.gif./badges/anticodeandrun.gif./badges/digby88.gif./badges/newlambda.gif./badges/transnow2.gif./badges/arizona.gif./badges/dramaturgie.gif./badges/nvidia.gif./badges/zettai.gif./badges/asexuals_now.gif./badges/finger-logo-people.gif./badges/nya2.gif./badges/beyes.gif./badges/firefox4.gif./badges/photo.jpeg./badges/calcium.png./badges/friday-girl.gif./badges/photo.png \ No newline at end of file diff --git a/src/common.js b/src/common.js index a3309d9..f7d2cca 100644 --- a/src/common.js +++ b/src/common.js @@ -8,4 +8,7 @@ function appendHtml(el, str) { while (div.children.length > 0) { el.appendChild(div.children[0]); } -} \ No newline at end of file +} + + +const rem_emp = function (e) {return e !== "";}; \ No newline at end of file diff --git a/src/img/cards.png b/src/img/cards.png new file mode 100644 index 0000000..b8fbe87 Binary files /dev/null and b/src/img/cards.png differ diff --git a/src/img/doc.png b/src/img/doc.png new file mode 100644 index 0000000..02767af Binary files /dev/null and b/src/img/doc.png differ diff --git a/src/jssh.js b/src/jssh.js index 1da1f83..51c8562 100644 --- a/src/jssh.js +++ b/src/jssh.js @@ -84,14 +84,20 @@ class jssh { } add_file(fs, path, dir) { //console.log(fs, path); - if (path.length == 1) + if (path.length == 1){ + for(let o of fs){ + if(o.name == path[0]){ + path[0] += '-1' + return this.add_file(fs,path,dir) + } + } return fs.push({ name: path[0], perms: { r: true }, dir: dir, content: dir ? [] : "", }); - + } for (let f in fs) { if (fs[f].name == path[0] && fs[f].dir) { fs = fs[f].content; @@ -254,9 +260,7 @@ class jssh { : this.working_dir + "/" + stripped[1] ) .split("/") - .filter(function (e) { - return e !== ""; - }), + .filter(rem_emp), false ); @@ -270,9 +274,7 @@ class jssh { : this.working_dir + "/" + stripped[1] ) .split("/") - .filter(function (e) { - return e !== ""; - }) + .filter(rem_emp) ); break; case "mkdir": @@ -284,9 +286,7 @@ class jssh { : this.working_dir + "/" + stripped[1] ) .split("/") - .filter(function (e) { - return e !== ""; - }), + .filter(rem_emp), true ); break; @@ -469,9 +469,7 @@ class jssh { .trim(); pp = this.clean_path(pp[0] == "/" ? pp : this.working_dir + "/" + pp); - pp = pp.split("/").filter(function (e) { - return e !== ""; - }); + pp = pp.split("/").filter(rem_emp); this.write_file(this.fs, pp, history_write.trim(), redir_app); } else { document.getElementById(this.history).innerHTML += history_write; diff --git a/src/window-utils.js b/src/window-utils.js index 2fdf1bb..40b5c62 100644 --- a/src/window-utils.js +++ b/src/window-utils.js @@ -174,9 +174,7 @@ let util = { files += "
" //left bar //console.log(inp.path) - let ppp = inp.path.split("/").filter(function (e) { - return e !== ""; - }) + let ppp = inp.path.split("/").filter(rem_emp) function rec_bar_fun(cdir,target_full,target_ind,padding,patt){ @@ -237,7 +235,7 @@ let util = { i + "-id-name-" + f.name + - "'style='height:55px;position:relative;width:48px;display:inline-block;padding:10px;'>
" + + "'style='height:55px;position:relative;width:48px;display:inline-block;padding:10px;'>
" + f.name + "
"; fil.push(f) @@ -286,10 +284,11 @@ let util = { let ele = document.getElementById(i+"-fs-inner-cont") let ele_root = document.getElementById(i+"-content-content") + console.log(inp.path.split("/").filter(rem_emp)) util.scrollbar(i,'root-bar',ele_root.parentElement,ele) util.context_menu(ele,{menu:[ - {name:'new file',callback:()=>{console.log("copy")}}, - {name:'new directory',callback:()=>{ll.add_file(ll.fs,['untitled'],true);load()}}, + {name:'new file',callback:()=>{ll.add_file(ll.fs,[...inp.path.split("/").filter(rem_emp),'untitled'],false);load()}}, + {name:'new directory',callback:()=>{ll.add_file(ll.fs,[...inp.path.split("/").filter(rem_emp),'untitled'],true);load()}}, ]}) //document.getElementById(i+"-fs-inner-cont").oncontextmenu = (ev) => { // return false @@ -363,8 +362,8 @@ let util = { dou = false; } else { dou = true; - - tt.style.backgroundColor = "blue"; + tt.style.boxShadow = "0 0 0 1px rgba(0,0,244,0.4) inset" + tt.style.backgroundColor = "rgba(0,0,244,0.2)"; setTimeout(() => { if (dou) { if (ev.ctrlKey) { @@ -373,9 +372,11 @@ let util = { } else sel.push(f.name); } else if (ev.shiftKey) { let tem = false + let osel = sel + sel = [] for (let ff of fil) { //console.log(ff.name,sel[0]) - if(ff==f||ff.name==sel[0]){ + if(ff==f||ff.name==osel[0]){ //console.log("uwu") if(tem){ sel.push(ff.name) @@ -397,8 +398,11 @@ let util = { i + "-id-name-" + aa.name ); if (sel.includes(aa.name)) { - ttt.style.backgroundColor = "blue"; + ttt.style.backgroundColor = "rgba(0,0,244,0.2)"; + ttt.style.boxShadow = "0 0 0 1px rgba(0,0,244,0.4) inset" + } else { + ttt.style.boxShadow = "" ttt.style.backgroundColor = ""; } } -- cgit v1.2.3