Skip to content

Commit

Permalink
Update design
Browse files Browse the repository at this point in the history
fix bugs
  • Loading branch information
Playit3110 committed Dec 18, 2021
1 parent 4a1b808 commit 866d6f3
Show file tree
Hide file tree
Showing 8 changed files with 37 additions and 20 deletions.
8 changes: 4 additions & 4 deletions system/CSS/css.php
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php
foreach(glob(__DIR__."/*.css") as $file) {
if(strpos($file, "old") !== false) continue;
$file = ".".str_replace($ROOT, "", $file);
echo "<link rel=\"stylesheet\" href=\"$file\">\n";
foreach(glob(__DIR__."/*.css") as $style) {
// if(strpos($style, "old") !== false) continue;
$style = ".".str_replace($ROOT, "", $style);
echo "<link rel=\"stylesheet\" href=\"$style\">\n";
}
?>
6 changes: 5 additions & 1 deletion system/CSS/dark.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ body.dark {
background-color: #303030;
}

.dark .btn {
border-color: white;
}


.dark #explorer.ssh div.file {
color: #00af00;
Expand All @@ -48,4 +52,4 @@ body.dark {

.dark .bar.error .slider {
background-color: darkred;
}
}
17 changes: 13 additions & 4 deletions system/CSS/list.css
Original file line number Diff line number Diff line change
Expand Up @@ -23,18 +23,27 @@ ul li span {
ul li .btn {
border-left: 1px solid black;
display: block;
max-height: 3.5vw;
max-width: 3.5vw;
padding: 1%;
max-height: 100%;
max-width: 1.1em;
padding: 0.1em;
width: 100%;
}

/*ul li .btn::after {
content: "";
display: block;
padding-top: 100%;
}*/

ul li svg {
display: block;
height: 100%;
width: 100%;
}


ul li.menu {
flex-wrap: nowrap;
white-space: nowrap;
word-break: keep-all;
}
}
6 changes: 3 additions & 3 deletions system/JS/js.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php
foreach(glob(__DIR__."/*.js") as $file) {
$file = ".".str_replace($ROOT, "", $file);
echo "<script src=\"$file\"></script>\n";
foreach(glob(__DIR__."/*.js") as $script) {
$script = ".".str_replace($ROOT, "", $script);
echo "<script src=\"$script\"></script>\n";
}
?>
14 changes: 9 additions & 5 deletions system/JS/nav.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,20 @@ const Explorer = {
this.elem = elem;
this.path = path;
},
to: async function(dir = 0) {
to: async function(dir = 0, abs = false) {
if(dir == -1) {
this.path = this.path.split("/");
this.path.pop();
this.path.pop();
this.path = this.path.join("/") + "/";
if(this.path[0] !== "/") this.path = "/" + this.path;
} else if(dir !== 0) {
dir = dir.innerText;
this.path += dir + "/";
if(typeof dir == "object") dir = dir.innerText;
if(abs) {
this.path = dir;
} else {
this.path += dir + "/";
}
}

let paths = await request({
Expand Down Expand Up @@ -48,7 +52,7 @@ const Explorer = {
this.rename(false, elem, "add");
},
rename: function(e, elem, action = false) {
if(elem.tagName == "BUTTON") elem = elem.parentNode.firstElementChild;
if(elem.classList.contains("btn")) elem = elem.parentNode.firstElementChild;
let that = this;
let oldName = elem.innerText;
elem.onblur = function() {
Expand Down Expand Up @@ -87,7 +91,7 @@ const Explorer = {
if(e) e.preventDefault();
},
remove: function(elem) {
if(elem.tagName == "BUTTON") elem = elem.parentNode;
if(elem.classList.contains("btn")) elem = elem.parentNode;
if(!confirm("Do you really want to delete \""+elem.innerText+"\" ?")) return;
let path = elem.innerText;
request({
Expand Down
3 changes: 1 addition & 2 deletions system/JS/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,8 +19,7 @@ window.onload = function() {

window.onhashchange = function() {
let hash = location.hash.substr(1);
let elem = document.getElementById("path");
elem.innerText = hash;
Explorer.to(hash, true);
}

function Textcopy(txt) {
Expand Down
2 changes: 1 addition & 1 deletion system/PHP/modify.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ function add($fof) {
]);
}

function renameFoF($old, $new) {
function renamePath($old, $new) {
$oldpath = filterpath($old["path"]);
$oldpath = fullpath($oldpath);

Expand Down
1 change: 1 addition & 0 deletions system/conf.php
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
<?php
// $rootdir = realpath(__DIR__."/../folder/");
$rootdir = $_SERVER["DOCUMENT_ROOT"];
?>

0 comments on commit 866d6f3

Please sign in to comment.