Skip to content

Commit

Permalink
Some more 1.4 fixes
Browse files Browse the repository at this point in the history
Co-authored-by: Lap <ItsLap@users.noreply.github.com>
Co-authored-by: Exeon <actuallyexeon@users.noreply.github.com>
  • Loading branch information
3 people committed Oct 26, 2023
1 parent e9172cb commit ea8c47c
Show file tree
Hide file tree
Showing 6 changed files with 33 additions and 15 deletions.
5 changes: 5 additions & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,11 @@
</head>

<body>
<script
defer
type="text/javascript"
src="https://cdnjs.cloudflare.com/ajax/libs/jshashes/1.0.8/hashes.min.js"
></script>
<script
defer
src="https://cdnjs.cloudflare.com/ajax/libs/ace/1.22.0/ace.min.js"
Expand Down
2 changes: 1 addition & 1 deletion pkgs/lib/FileDialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -325,7 +325,7 @@ export default {

let pathInput = new L.html("input")
.class("fg")
.attr({ placeholder: "Path", value: "Root/" })
.attr({ placeholder: "Path", value: path + "/" || "Root/" })
.on("keyup", async (e) => {
let toBeSavedItem = e.target.value;
if (!toBeSavedItem.startsWith("Root/")) e.target.value = "Root/";
Expand Down
6 changes: 6 additions & 0 deletions pkgs/lib/FileMappings.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,12 @@ export default {
opensWith: "apps:DevEnv",
icon: "fileJson",
},
js: {
type: "code",
label: "JavaScript file",
opensWith: "apps:DevEnv",
icon: "fileJson",
},
png: {
type: "image",
label: "PNG image",
Expand Down
5 changes: 5 additions & 0 deletions pkgs/lib/WindowSystem.js
Original file line number Diff line number Diff line change
Expand Up @@ -140,6 +140,11 @@ export default {
let thisWin = wrapper.elm.querySelector(".win-window");
thisWin.style.position = "absolute";

if (this.options.width > screen.width) {
// this.maximize('top');
this.options.width = screen.width - (snapMargin*8);
}

thisWin.id = this.options.id;
thisWin.style.width = parseInt(this.options.width) + "px";
thisWin.style.height = parseInt(this.options.height) + "px";
Expand Down
5 changes: 3 additions & 2 deletions pkgs/ui/Modal.js
Original file line number Diff line number Diff line change
Expand Up @@ -113,12 +113,13 @@ export default {
description,
placeholder,
parent = "body",
isPassword = false
isPassword = false,
value = ''
) {
let wrapper = new lib.html("div").class("col");
/* span */ new lib.html("span").text(description).appendTo(wrapper);
let input = new lib.html("input")
.attr({ placeholder, type: isPassword === true ? "password" : "text" })
.attr({ placeholder, value, type: isPassword === true ? "password" : "text" })
.appendTo(wrapper);

return new Promise((res, _rej) => {
Expand Down
25 changes: 13 additions & 12 deletions style.css
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,8 @@ a {
cursor: default !important;
}

:root {
:root,
:root[data-theme="dark"] {
color-scheme: dark;
accent-color: var(--primary);
--primary: hsl(222, 80%, 40%);
Expand Down Expand Up @@ -219,12 +220,12 @@ body {
.desktop ~ .win-window.max {
height: calc(100% - 42px - 12px) !important;
}
.win-window.max .win-titlebar,
.win-window.max .win-content {
.win-window.max > .win-titlebar,
.win-window.max > .win-content {
border-radius: 0;
}

.win-window.max .resize-grips {
.win-window.max > .resize-grips {
display: none;
}

Expand All @@ -233,7 +234,7 @@ body {
height: auto !important;
border-radius: 5px;
}
.win-window.min .win-titlebar {
.win-window.min > .win-titlebar {
border-radius: 5px;
}
.win-window.min .win-content {
Expand All @@ -254,17 +255,17 @@ body {
flex-shrink: 0;
}

.win-window:not(.focus) .win-titlebar .title,
.win-window-decorative:not(.focus) .win-titlebar .title {
.win-window:not(.focus) > .win-titlebar .title,
.win-window-decorative:not(.focus) > .win-titlebar .title {
opacity: 0.5;
}
.win-window:not(.focus) .win-titlebar button,
.win-window-decorative:not(.focus) .win-titlebar button {
.win-window:not(.focus) > .win-titlebar button,
.win-window-decorative:not(.focus) > .win-titlebar button {
filter: brightness(0.5);
}

.win-window.focus .win-titlebar,
.win-window-decorative.focus .win-titlebar {
.win-window.focus > .win-titlebar,
.win-window-decorative.focus > .win-titlebar {
background-color: var(--header);
}

Expand Down Expand Up @@ -704,7 +705,7 @@ textarea {
background-color: var(--neutral);
border: 1px solid var(--outline);
margin: 4px;
padding: 4px;
padding: 4px 6px;
border-radius: 8px;
outline: none;
resize: none;
Expand Down

0 comments on commit ea8c47c

Please sign in to comment.