Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
- package-ecosystem: "npm"
directory: "/"
schedule:
interval: "weekly"
2 changes: 1 addition & 1 deletion assets/css/style.css

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion assets/css/style.css.map

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

7 changes: 5 additions & 2 deletions assets/js/common/file_dialog.js
Original file line number Diff line number Diff line change
Expand Up @@ -27,10 +27,13 @@ const extensionMap = {
"jpg": {style: FA_STYLE_REGULAR, icon: "file-image", type: "bin"},
"jpeg": {style: FA_STYLE_REGULAR, icon: "file-image", type: "bin"},
"zip": {style: FA_STYLE_REGULAR, icon: "file-archive", type: "bin"},
"py": {style: FA_STYLE_REGULAR, icon: "file-alt", type: "text"},
"py": {style: FA_STYLE_REGULAR, icon: "file-lines", type: "text"},
"js": {style: FA_STYLE_REGULAR, icon: "file-code", type: "text"},
"json": {style: FA_STYLE_REGULAR, icon: "file-code", type: "text"},
"toml": {style: FA_STYLE_REGULAR, icon: "file-lines", type: "text"},
"pdf": {style: FA_STYLE_REGULAR, icon: "file-pdf", type: "bin"},
"mpy": {style: FA_STYLE_REGULAR, icon: "file", type: "bin"},
"txt": {style: FA_STYLE_REGULAR, icon: "file-alt", type: "text"},
"txt": {style: FA_STYLE_REGULAR, icon: "file-lines", type: "text"},
"mov": {style: FA_STYLE_REGULAR, icon: "file-video", type: "bin"},
"mp4": {style: FA_STYLE_REGULAR, icon: "file-video", type: "bin"},
"avi": {style: FA_STYLE_REGULAR, icon: "file-video", type: "bin"},
Expand Down
3 changes: 2 additions & 1 deletion assets/js/common/web-file-transfer.js
Original file line number Diff line number Diff line change
Expand Up @@ -182,6 +182,7 @@ class FileTransferClient {
if (!response) {
return null;
}

return JSON.parse(response);
}

Expand All @@ -190,7 +191,7 @@ class FileTransferClient {
try {
versionResponse = await fetch(`http://${host}/cp/version.json`, {mode: "cors"});
} catch (error) {
console.error(`Host '${host}' not found.`);
//console.error(`Host '${host}' not found.`);
throw new ProtocolError(`Host '${host}' not found.`);
}
return new URL("/", versionResponse.url).host;
Expand Down
13 changes: 9 additions & 4 deletions assets/js/script.js
Original file line number Diff line number Diff line change
Expand Up @@ -172,9 +172,13 @@ async function checkReadOnly() {
btnSaveRun.forEach((element) => {
element.disabled = readOnly;
});
if (readOnly) {
if (readOnly instanceof Error) {
await showMessage(readOnly);
return false;
} else if (readOnly) {
await showMessage("Warning: File System is in read only mode. Disable the USB drive to allow write access.");
}
return true;
}

/* Update the filename and update the UI */
Expand Down Expand Up @@ -512,9 +516,10 @@ document.addEventListener('DOMContentLoaded', async (event) => {
// If we don't have all the info we need to connect
let returnVal = await workflow.parseParams();
if (returnVal === true && await workflowConnect() && workflow.type === CONNTYPE.Web) {
await checkReadOnly();
// We're connected, local, and using Web Workflow
await workflow.showInfo(getDocState());
if (await checkReadOnly()) {
// We're connected, local, no errors, and using Web Workflow
await workflow.showInfo(getDocState());
}
} else {
if (returnVal instanceof Error) {
await showMessage(returnVal);
Expand Down
10 changes: 5 additions & 5 deletions assets/js/workflows/web.js
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,11 @@ class WebWorkflow extends Workflow {

async connect() {
let result;
if (result = await super.connect() instanceof Error) {
if ((result = await super.connect()) instanceof Error) {
return result;
}
if (!await this.checkHost()) {
return false;
if ((result = await this.checkHost()) instanceof Error) {
return result;
}
return await this.connectToHost(this.host);
}
Expand Down Expand Up @@ -179,8 +179,8 @@ class WebWorkflow extends Workflow {
this.host = await FileTransferClient.getRedirectedHost(this.host);
console.log("New Host", this.host);
} catch (e) {
console.error("Unable to forward to device. Ensure they are set up and connected to the same local network.");
return false;
console.error(e);
return new Error("Unable to forward to device. Ensure they are set up and connected to the same local network.");
}
}

Expand Down
5 changes: 4 additions & 1 deletion assets/js/workflows/workflow.js
Original file line number Diff line number Diff line change
Expand Up @@ -291,7 +291,10 @@ class Workflow {
}

async readOnly() {
return await this.fileHelper.readOnly();
if (this.fileHelper) {
return await this.fileHelper.readOnly();
}
return false;
}

async parseParams() {
Expand Down
1 change: 1 addition & 0 deletions assets/sass/layout/_header.scss
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@

.content {
display: grid;
padding-top: 20px;
padding-bottom: 20px;
}

Expand Down
5 changes: 5 additions & 0 deletions assets/sass/layout/_header_mobile.scss
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,11 @@
.bottom-bar {
height: 3px;
}

.get-started {
padding-top: 5px;
padding-bottom: 5px;
}
}

#mobile-editor-bar {
Expand Down
1 change: 1 addition & 0 deletions assets/sass/pages/_code.scss
Original file line number Diff line number Diff line change
Expand Up @@ -429,6 +429,7 @@

a {
cursor: pointer;
display: block;
}
}
}
Expand Down