Skip to content
This repository has been archived by the owner on Dec 29, 2023. It is now read-only.

Commit

Permalink
Use " instead of ' in JS
Browse files Browse the repository at this point in the history
  • Loading branch information
dodaucy committed Nov 5, 2023
1 parent 7e97e43 commit af4f05c
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions static/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -63,17 +63,17 @@ async function render_stats() {
ctx.lineTo(stats_canvas.width, y);
ctx.stroke();
// Draw text
ctx.font = `${line_spacing / 6}px ${getComputedStyle(document.body).getPropertyValue('--font-family')}`;
ctx.font = `${line_spacing / 6}px ${getComputedStyle(document.body).getPropertyValue("--font-family")}`;
ctx.fillText(["Bad", "Okay", "Good"][2 - i], 0, y - line_spacing / 6);
}

// Draw stats
var checkboxes = document.getElementById('display-box').children;
var checkboxes = document.getElementById("display-box").children;
for (var i = 0; i < checkboxes.length; i++) {
// Get elements
var input = checkboxes[i].getElementsByTagName('input')[0];
var label = checkboxes[i].getElementsByTagName('label')[0];
var id = input.id.split('-')[0];
var input = checkboxes[i].getElementsByTagName("input")[0];
var label = checkboxes[i].getElementsByTagName("label")[0];
var id = input.id.split("-")[0];
// Check if checkbox is checked
if (input.checked) {
// Set color
Expand Down Expand Up @@ -199,7 +199,7 @@ async function init() {
var ctx = stats_canvas.getContext("2d");
stats_canvas.width = Math.min(window.innerWidth, 800);
stats_canvas.height = stats_canvas.width / 10 * 3;
ctx.font = `${stats_canvas.height / 6}px ${getComputedStyle(document.body).getPropertyValue('--font-family')}`;
ctx.font = `${stats_canvas.height / 6}px ${getComputedStyle(document.body).getPropertyValue("--font-family")}`;
ctx.fillStyle = font_color;
ctx.textAlign = "center";
ctx.fillText("Loading...", stats_canvas.width / 2, stats_canvas.height / 2);
Expand Down
2 changes: 1 addition & 1 deletion static/utils.js
Original file line number Diff line number Diff line change
Expand Up @@ -236,7 +236,7 @@ function request(method, url, success_callback, error_callback, data) {
if (data === undefined) {
xhr.send();
} else {
xhr.setRequestHeader('Content-Type', 'application/json');
xhr.setRequestHeader("Content-Type", "application/json");
xhr.send(JSON.stringify(data));
}
}
Expand Down

0 comments on commit af4f05c

Please sign in to comment.