Skip to content

Commit

Permalink
more
Browse files Browse the repository at this point in the history
  • Loading branch information
rtestardi committed Feb 2, 2024
1 parent 00ac113 commit e2dcab1
Show file tree
Hide file tree
Showing 4 changed files with 19 additions and 13 deletions.
4 changes: 0 additions & 4 deletions flea-scope.experimental.html
Original file line number Diff line number Diff line change
Expand Up @@ -1218,10 +1218,6 @@ <h1 id="h1">Flea-Scope™</h1>

hostname = lines[0];

if (hostname == "") {
debugger; // XXX -- deleteme!
}

if (hostname != "Flea-Scope") {
document.getElementById("h1").innerHTML += " (" + hostname + ")";
document.title += " (" + hostname + ")";
Expand Down
4 changes: 0 additions & 4 deletions flea-scope.html
Original file line number Diff line number Diff line change
Expand Up @@ -1218,10 +1218,6 @@ <h1 id="h1">Flea-Scope™</h1>

hostname = lines[0];

if (hostname == "") {
debugger; // XXX -- deleteme!
}

if (hostname != "Flea-Scope") {
document.getElementById("h1").innerHTML += " (" + hostname + ")";
document.title += " (" + hostname + ")";
Expand Down
4 changes: 0 additions & 4 deletions flea-scope.manual.html
Original file line number Diff line number Diff line change
Expand Up @@ -1219,10 +1219,6 @@ <h1 id="h1">Flea-Scope™</h1>

hostname = lines[0];

if (hostname == "") {
debugger; // XXX -- deleteme!
}

if (hostname != "Flea-Scope") {
document.getElementById("h1").innerHTML += " (" + hostname + ")";
document.title += " (" + hostname + ")";
Expand Down
20 changes: 19 additions & 1 deletion stickos-basic.html
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@

<body onload='Body()'>

<h1>StickOS® BASIC</h1>
<h1 id="h1">StickOS® BASIC</h1>

<div id="config">
Select:
Expand Down Expand Up @@ -68,6 +68,7 @@ <h1>StickOS® BASIC</h1>
var lines = [];
var cursor = 0;
var first = false;
var hostname = "";

// the user loaded the webpage; set up keyboard listeners
function Body()
Expand Down Expand Up @@ -119,6 +120,7 @@ <h1>StickOS® BASIC</h1>
Send("\r");
Send("echo on\r");
Send("prompt on\r");
Send("hostname\r");

setTimeout(Receive, 1);
document.getElementById("command").disabled = false;
Expand Down Expand Up @@ -158,6 +160,7 @@ <h1>StickOS® BASIC</h1>
Send("\r");
Send("echo on\r");
Send("prompt on\r");
Send("hostname\r");

setTimeout(Receive, 1);
document.getElementById("command").disabled = false;
Expand All @@ -180,6 +183,7 @@ <h1>StickOS® BASIC</h1>
{
var result;
var str;
var temp;

if (usb) {
result = await usb.transferIn(epin, 1024);
Expand All @@ -193,6 +197,20 @@ <h1>StickOS® BASIC</h1>
Clear();
} else {
document.getElementById("results").innerHTML += str.replace(/</g,'&lt;').replace(/>/g,'&gt;').replace(/\n/g,'');
if (hostname == "") {
temp = document.getElementById("results").innerHTML;
if (temp.match(/hostname/)) {
temp = temp.replace(/[\s\S]*hostname/,'');
temp = temp.split(/\r?\n|\r|\n/g);
if (temp[1]) {
hostname = temp[1];
if (hostname != "Flea-Scope") {
document.getElementById("h1").innerHTML += " (" + hostname + ")";
document.title += " (" + hostname + ")";
}
}
}
}
}
document.getElementById("command").scrollIntoView();
setTimeout(Receive, 1);
Expand Down

0 comments on commit e2dcab1

Please sign in to comment.