Skip to content

Commit

Permalink
QOL DevEnv features
Browse files Browse the repository at this point in the history
  • Loading branch information
ItsLap committed Jun 21, 2024
1 parent 0cb0b87 commit c71ee21
Showing 1 changed file with 29 additions and 8 deletions.
37 changes: 29 additions & 8 deletions pkgs/apps/DevEnv.js
Original file line number Diff line number Diff line change
Expand Up @@ -297,14 +297,35 @@ export default {
DvSettings.fontSize = Number(editorSize.toString());
DvSaveSettings();
},
run: () => {
Root.Core.startPkg(
URL.createObjectURL(
new Blob([editor.getValue()], { type: "application/javascript" })
),
// URL.createObjectURL(["data:text/javascript," + encodeURIComponent(`/*${currentDocument.path}*/` +editor.getValue())], {type:'text/plain'}),
false
);
run: async () => {
if (currentDocument.dirty === true) {
modal(
new Html("div").appendMany(
new Html("span").text(
"You have unsaved changes. Save your work before running the app."
)
),
true,
Root.Lib.getString("error")
);
return;
}

if (currentDocument.path.endsWith(".app")) {
Root.Core.startPkg(
URL.createObjectURL(
new Blob([editor.getValue()], { type: "application/javascript" })
),
// URL.createObjectURL(["data:text/javascript," + encodeURIComponent(`/*${currentDocument.path}*/` +editor.getValue())], {type:'text/plain'}),
false
);
} else if (currentDocument.path.endsWith(".pml")) {
let x = await Root.Core.startPkg("apps:PML", true, true);
x.proc.send({
type: "loadFile",
path: currentDocument.path,
});
}
},
prettify: async () => {
try {
Expand Down

0 comments on commit c71ee21

Please sign in to comment.