Skip to content

Commit

Permalink
update data logging files
Browse files Browse the repository at this point in the history
  • Loading branch information
Amerlander committed Jun 14, 2023
1 parent eea0e22 commit 1e1af47
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 14 deletions.
2 changes: 1 addition & 1 deletion resources/logfs/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ if (process.argv[2] === "test") {
.readdirSync(".")
.filter((f) => /^sample-.+\.txt$/.test(f));
// Enable local testing of included CSS/JS. Do it after byte count.
result = result.replace(/https:\/\/microbit.org\/dl\/\d\//g, "./");
result = result.replace(/https:\/\/go.calliope.cc\/assets\/dl\/\d\//g, "./");
for (const trailerName of trailers) {
const trailer = fs.readFileSync(trailerName);
const htmlName = trailerName.replace(/\.txt$/, ".html");
Expand Down
10 changes: 5 additions & 5 deletions resources/logfs/dl.css
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@
* This content is managed in https://github.com/lancaster-university/codal-microbit-v2/
*/
body {
font-family: "Helvetica Now", Helvetica, Arial, sans-serif;
font-family: "Roboto", "Helvetica Now", Helvetica, Arial, sans-serif;
}
a {
color: rgba(108, 75, 193, 1);
color: rgba(66, 201, 201, 1);
}
button {
display: block;
Expand All @@ -19,14 +19,14 @@ button {
padding: 0 16px;

/* Secondary buttons */
color: #000;
border: 2px solid #000;
color: rgba(66, 201, 201, 1);
border: 2px solid rgba(66, 201, 201, 1);
background: #fff;
}
/* Primary button */
button:first-of-type {
border: none;
background: #000;
background: rgba(66, 201, 201, 1);
color: #fff;
}
tr:nth-child(even) {
Expand Down
12 changes: 6 additions & 6 deletions resources/logfs/dl.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,11 +26,11 @@ function UserGraphError(message) {
const overrides = {
update: alert.bind(
null,
"To see the latest data that changed after you opened this file, you must unplug your micro:bit and plug it back in."
"To see the latest data that changed after you opened this file, you must unplug your calliope mini and plug it back in."
),
clear: alert.bind(
null,
"The log is cleared when you reflash your micro:bit. Your program can include code or blocks to clear the log when you choose."
"The log is cleared when you reflash your calliope mini. Your program can include code or blocks to clear the log when you choose."
),
copy: function () {
base.copy();
Expand All @@ -57,7 +57,7 @@ function UserGraphError(message) {
wrapper
);
header.outerHTML =
'<header><div class="header-strip"></div><div class="header-contents"><a href="https://microbit.org"><svg role="img" aria-labelledby="microbit-logo" viewBox="0 0 166.8 28.7" width="167" height="40"><title id="microbit-logo">micro:bit logo</title><path fill="#fff" d="M71.7 23.1h-3.3V14c0-2-1.2-3.5-2.8-3.5-1.6 0-2.8 1.4-2.8 3.5v9.1h-3.3V14c0-2.3-1.4-3.5-2.8-3.5-1.6 0-2.8 1.4-2.8 3.5v9.1h-3.3v-9c0-4.1 2.5-6.9 6.1-6.9 1.7 0 3.1.7 4.4 2.1 1.2-1.4 2.7-2.1 4.5-2.1 3.6 0 6 2.9 6 6.9v9zM77.7 23.1h-3.3V7.6h3.3v15.5zM76 5.3c-1.2 0-2.1-.9-2.1-2.1 0-1.2.9-2.1 2.1-2.1 1.2 0 2.1.9 2.1 2.1.1 1.2-.9 2.1-2.1 2.1zM88.1 23.5c-2.1 0-4.2-.9-5.7-2.4s-2.3-3.5-2.3-5.8c0-2.2.8-4.3 2.3-5.8C84 8.1 86 7.2 88.1 7.2c2.3 0 4.3.8 5.8 2.3l.4.4-2.3 2.4-.4-.4c-1.1-1-2.2-1.5-3.4-1.5-2.6 0-4.8 2.2-4.8 4.9s2.1 4.9 4.8 4.9c1.2 0 2.3-.5 3.4-1.4l.4-.4 2.4 2.3-.5.4c-1.8 1.6-3.7 2.4-5.8 2.4zM100.1 23.1h-3.5v-7.8c0-5 2.2-7.4 7-7.8l.7-.1v3.3l-.5.1c-2.6.3-3.6 1.5-3.6 4.3v8zM113.4 23.5c-2.1 0-4.2-.9-5.7-2.4s-2.3-3.6-2.3-5.8c0-2.2.8-4.2 2.3-5.8 1.5-1.6 3.5-2.4 5.7-2.4 2.1 0 4.1.9 5.6 2.4s2.3 3.6 2.3 5.8c0 2.2-.8 4.3-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 7.8-3.5 7.8-7.8s-3.5-7.8-7.8-7.8H13.3m19.5 20.8H13.3c-7.2 0-13-5.8-13-13s5.8-13 13-13h19.5c7.2 0 13 5.8 13 13s-5.9 13-13 13"></path></g></svg></a></div></header>';
'<header><div class="header-strip"></div><div class="header-contents"><a href="https://calliope.cc"><svg role="img" aria-labelledby="calliope-logo" viewBox="0 0 166.8 28.7" width="167" height="40"><title id="calliope-logo">calliope mini logo</title><path fill="#fff" d="M71.7 23.1h-3.3V14c0-2-1.2-3.5-2.8-3.5-1.6 0-2.8 1.4-2.8 3.5v9.1h-3.3V14c0-2.3-1.4-3.5-2.8-3.5-1.6 0-2.8 1.4-2.8 3.5v9.1h-3.3v-9c0-4.1 2.5-6.9 6.1-6.9 1.7 0 3.1.7 4.4 2.1 1.2-1.4 2.7-2.1 4.5-2.1 3.6 0 6 2.9 6 6.9v9zM77.7 23.1h-3.3V7.6h3.3v15.5zM76 5.3c-1.2 0-2.1-.9-2.1-2.1 0-1.2.9-2.1 2.1-2.1 1.2 0 2.1.9 2.1 2.1.1 1.2-.9 2.1-2.1 2.1zM88.1 23.5c-2.1 0-4.2-.9-5.7-2.4s-2.3-3.5-2.3-5.8c0-2.2.8-4.3 2.3-5.8C84 8.1 86 7.2 88.1 7.2c2.3 0 4.3.8 5.8 2.3l.4.4-2.3 2.4-.4-.4c-1.1-1-2.2-1.5-3.4-1.5-2.6 0-4.8 2.2-4.8 4.9s2.1 4.9 4.8 4.9c1.2 0 2.3-.5 3.4-1.4l.4-.4 2.4 2.3-.5.4c-1.8 1.6-3.7 2.4-5.8 2.4zM100.1 23.1h-3.5v-7.8c0-5 2.2-7.4 7-7.8l.7-.1v3.3l-.5.1c-2.6.3-3.6 1.5-3.6 4.3v8zM113.4 23.5c-2.1 0-4.2-.9-5.7-2.4s-2.3-3.6-2.3-5.8c0-2.2.8-4.2 2.3-5.8 1.5-1.6 3.5-2.4 5.7-2.4 2.1 0 4.1.9 5.6 2.4s2.3 3.6 2.3 5.8c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7.8h19.5c4.3 0 7.8-3.5 7.8-7.8s-3.5-7.8-7.8-7.8H13.3m19.5 20.8H13.3c-7.2 0-13-5.8-13-13s5.8-13 13-13h19.5c7.2 0 13 5.8 13 13s-5.9 13-13 13"></path></g></svg></a></div></header>';

let info = document.createElement("p");
info.id = "info";
Expand Down Expand Up @@ -95,7 +95,7 @@ function UserGraphError(message) {

resetGraph: function () {
document.querySelector("#info").innerHTML =
"This is the data on your micro:bit. To analyse it and create your own graphs, transfer it to your computer. You can copy and paste your data, or download it as a CSV file which you can import into a spreadsheet or graphing tool. <a href='https://microbit.org/get-started/user-guide/data-logging/'>Learn more about micro:bit data logging</a>.";
"This is the data on your calliope mini. To analyse it and create your own graphs, transfer it to your computer. You can copy and paste your data, or download it as a CSV file which you can import into a spreadsheet or graphing tool. <a href='https://microbit.org/get-started/user-guide/data-logging/'>Learn more about calliope mini data logging</a>.";
let graphButton = document.querySelector("#graphButton");
graphButton.innerText = "Visual preview";

Expand Down Expand Up @@ -168,7 +168,7 @@ function UserGraphError(message) {
}

const colors = [
// micro:bit brand colors
// calliope mini brand colors
"rgb(0, 200, 0)",
"rgb(62, 182, 253)",
"rgb(205, 3, 101)",
Expand Down Expand Up @@ -252,7 +252,7 @@ function UserGraphError(message) {
// We fade it in along with the graph.
info.style.opacity = 0;
info.innerHTML =
"This is a visual preview of the data on your micro:bit. To analyse it in more detail or create your own graphs, transfer it to your computer. You can copy and paste your data, or download it as a CSV file which you can import into a spreadsheet or graphing tool. <a href='https://microbit.org/get-started/user-guide/data-logging/'>Learn more about micro:bit data logging</a>.";
"This is a visual preview of the data on your calliope mini. To analyse it in more detail or create your own graphs, transfer it to your computer. You can copy and paste your data, or download it as a CSV file which you can import into a spreadsheet or graphing tool. <a href='https://microbit.org/get-started/user-guide/data-logging/'>Learn more about calliope mini data logging</a>.";

Plotly.newPlot(
graphContainer,
Expand Down
4 changes: 2 additions & 2 deletions resources/logfs/header.html
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
display: none;
}
</style>
<link rel="stylesheet" href="https://microbit.org/dl/2/dl.css" />
<link rel="stylesheet" href="https://go.calliope.cc/assets/dl/3/dl.css" />
<script>
// These help significantly to save bytes.
let w = window;
Expand Down Expand Up @@ -129,7 +129,7 @@
},
};
</script>
<script src="https://microbit.org/dl/2/dl.js"></script>
<script src="https://go.calliope.cc/assets/dl/3/dl.js"></script>
<title>micro:bit data log</title>
</head>
<body onload="dl.load()">
Expand Down

0 comments on commit 1e1af47

Please sign in to comment.