Skip to content

armgit / Cap

Public Imported from GitHub
0

Open source Loom alternative. Beautiful, shareable screen recordings.

fix: remove unused bench script declarations

Richie McIlroy8768ac24767a
diff --git a/capcodec/bench/corpus/pages/common/dashboard.js b/capcodec/bench/corpus/pages/common/dashboard.js
index 3d966a552..efc3bf7dd 100644
--- a/capcodec/bench/corpus/pages/common/dashboard.js
+++ b/capcodec/bench/corpus/pages/common/dashboard.js
@@ -62,9 +62,10 @@
const xs = (i) => (i / (data.length - 1)) * (w - 2) + 1;
const ys = (v) => h - padY - ((v - lo) / (hi - lo)) * (h - 2 * padY);
ctx.beginPath();
- data.forEach((v, i) =>
- i ? ctx.lineTo(xs(i), ys(v)) : ctx.moveTo(xs(i), ys(v)),
- );
+ data.forEach((v, i) => {
+ if (i) ctx.lineTo(xs(i), ys(v));
+ else ctx.moveTo(xs(i), ys(v));
+ });
if (fill) {
ctx.save();
ctx.lineTo(xs(data.length - 1), h);
@@ -77,9 +78,10 @@
ctx.fill();
ctx.restore();
ctx.beginPath();
- data.forEach((v, i) =>
- i ? ctx.lineTo(xs(i), ys(v)) : ctx.moveTo(xs(i), ys(v)),
- );
+ data.forEach((v, i) => {
+ if (i) ctx.lineTo(xs(i), ys(v));
+ else ctx.moveTo(xs(i), ys(v));
+ });
}
ctx.strokeStyle = color;
ctx.lineWidth = 1.5;
@@ -198,7 +200,9 @@
for (let i = 0; i <= this.n; i++) {
this.times.push(t0 + i * 1000);
const vals = opts.gen(i - this.n);
- this.series.forEach((s, j) => s.data.push(vals[j]));
+ this.series.forEach((s, j) => {
+ s.data.push(vals[j]);
+ });
}
this.anim = null;
this.yMax = this.targetMax();
@@ -294,9 +298,10 @@
ctx.clip();
this.series.forEach((s, j) => {
ctx.beginPath();
- s.data.forEach((v, i) =>
- i ? ctx.lineTo(xOf(i), yOf(v)) : ctx.moveTo(xOf(i), yOf(v)),
- );
+ s.data.forEach((v, i) => {
+ if (i) ctx.lineTo(xOf(i), yOf(v));
+ else ctx.moveTo(xOf(i), yOf(v));
+ });
if (j === 0) {
ctx.save();
ctx.lineTo(xOf(len - 1), top + ph);
@@ -309,9 +314,10 @@
ctx.fill();
ctx.restore();
ctx.beginPath();
- s.data.forEach((v, i) =>
- i ? ctx.lineTo(xOf(i), yOf(v)) : ctx.moveTo(xOf(i), yOf(v)),
- );
+ s.data.forEach((v, i) => {
+ if (i) ctx.lineTo(xOf(i), yOf(v));
+ else ctx.moveTo(xOf(i), yOf(v));
+ });
}
ctx.strokeStyle = s.color;
ctx.lineWidth = s.width || 1.6;
diff --git a/capcodec/bench/corpus/pages/common/editor.js b/capcodec/bench/corpus/pages/common/editor.js
index 3d2ec563b..7fdfcdd5b 100644
--- a/capcodec/bench/corpus/pages/common/editor.js
+++ b/capcodec/bench/corpus/pages/common/editor.js
@@ -11,11 +11,6 @@
" ",
),
);
- const PY_BUILTINS = new Set(
- "len range isinstance min max sum enumerate zip sorted reversed print super any all map filter iter next abs hash id repr getattr setattr hasattr divmod round".split(
- " ",
- ),
- );
const C_CONTROL = new Set(
"if else for while do switch case default break continue return goto".split(
" ",
@@ -58,7 +53,6 @@
const out = [];
let i = 0;
let prevWord = "";
- const n = line.length;
const pushTok = (cls, text) => {
if (!text) return;
const last = out[out.length - 1];
@@ -581,7 +575,7 @@
col: Math.min(this.lines[l].length, this.goalCol),
};
this.hideSuggest();
- this.updateCaret(true, true);
+ this.updateCaret(true);
this.renderRows(this.dirtyRows);
return true;
} else if (e.key === "Home") {
@@ -712,7 +706,7 @@
this.selEl.style.display = "none";
}
- updateCaret(reveal, keepGoal) {
+ updateCaret(reveal) {
const { line, col } = this.caret;
const lh = this.lineHeight;
this.caretEl.style.transform = `translate(${this.gutter + col * this.cw}px, ${line * lh}px)`;
diff --git a/capcodec/bench/corpus/pages/common/slides.js b/capcodec/bench/corpus/pages/common/slides.js
index 3626d0410..000128390 100644
--- a/capcodec/bench/corpus/pages/common/slides.js
+++ b/capcodec/bench/corpus/pages/common/slides.js
@@ -1,7 +1,7 @@
(() => {
const deck = document.getElementById("deck");
const TOTAL = 14;
- const foot = (n, dark) =>
+ const foot = (n) =>
`<div class="foot"><span class="logo"></span><span>Capture Pipeline 2.0 · Q3 Review</span><span class="num">${n} / ${TOTAL}</span></div>`;
function barChart() {
diff --git a/capcodec/bench/corpus/pages/common/webcam.js b/capcodec/bench/corpus/pages/common/webcam.js
index 741d5ac07..aabb2960b 100644
--- a/capcodec/bench/corpus/pages/common/webcam.js
+++ b/capcodec/bench/corpus/pages/common/webcam.js
@@ -29,7 +29,6 @@
}
let noise = null;
- let frame = 0;
let lastDraw = 0;
function draw(tms) {
@@ -202,7 +201,6 @@
d[i + 2] += g + ((rand() * 7) | 0) - 3;
}
ctx.putImageData(img, 0, 0);
- frame++;
}
function loop(ts) {