dehezhang2 commited on
Commit
95c84a4
·
verified ·
1 Parent(s): 42141a8

deploy rater (Docker/FastAPI): registration + completeness gate + /api/submit → dataset

Browse files
Files changed (2) hide show
  1. static/index.html +9 -17
  2. static/mobile.html +2 -2
static/index.html CHANGED
@@ -236,9 +236,6 @@
236
  .q-card .likert button.selected[data-score="4"] { background: var(--score-4); }
237
  .q-card .likert button.selected[data-score="5"] { background: var(--score-5); }
238
 
239
- /* Long prompts: cap their height; prompt scrolls inside its own box. */
240
- .left-pane .prompt-box { max-height: 7em; overflow-y: auto; }
241
-
242
  /* ---------- footer / nav ---------- */
243
  footer.bottom { position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
244
  background: var(--panel); border-top: 1px solid var(--border);
@@ -2006,13 +2003,10 @@ function renderCaseHeader(c) {
2006
  }
2007
 
2008
  function renderVideoControls(c) {
2009
- // Controls act on whichever video is currently visible (the active tab).
2010
- // "Play all" was meaningful when videos sat side-by-side; with tabs there
2011
- // is only one playing video at a time so the button is now a plain "Play".
2012
  const ctl = el("div", { class: "video-controls" });
2013
- ctl.appendChild(el("button", {
2014
- class: "ctl-btn", onclick: playActive,
2015
- }, t("play_all")));
2016
  ctl.appendChild(el("button", {
2017
  class: "ctl-btn", onclick: pauseAll,
2018
  }, t("pause")));
@@ -2050,7 +2044,6 @@ function activeVideo() {
2050
  // The only video that's NOT inside a .hidden tile is the active one.
2051
  return document.querySelector(".video-tile:not(.hidden) video[data-slot]");
2052
  }
2053
- function playActive() { const v = activeVideo(); if (v) { try { v.play(); } catch(e){} } }
2054
  function restartActive() {
2055
  const v = activeVideo();
2056
  if (v) { v.currentTime = 0; try { v.play(); } catch(e){} }
@@ -2071,7 +2064,6 @@ function rowSlotOrder(caseId, qKey, slotCount) {
2071
  function allVideos() {
2072
  return Array.from(document.querySelectorAll("video[data-slot]"));
2073
  }
2074
- function playAll() { allVideos().forEach(v => { try { v.play(); } catch(e){} }); }
2075
  function pauseAll() { allVideos().forEach(v => v.pause()); }
2076
  function restartAll() {
2077
  allVideos().forEach(v => { v.currentTime = 0; try { v.play(); } catch(e){} });
@@ -2090,11 +2082,11 @@ function toggleMute(btn) {
2090
  btn.textContent = MUTED ? "🔇 Muted" : "🔊 Sound";
2091
  }
2092
  function setSpeed(rate) { allVideos().forEach(v => v.playbackRate = rate); }
2093
- function togglePlayAll() {
2094
- const vids = allVideos();
2095
- if (!vids.length) return;
2096
- const anyPlaying = vids.some(v => !v.paused);
2097
- if (anyPlaying) pauseAll(); else playAll();
2098
  }
2099
 
2100
  /* =========================================================================
@@ -2394,7 +2386,7 @@ document.addEventListener("keydown", e => {
2394
  switch (e.key) {
2395
  case "ArrowLeft": case "k": e.preventDefault(); step(-1); break;
2396
  case "ArrowRight": case "j": e.preventDefault(); step(1); break;
2397
- case " ": e.preventDefault(); togglePlayAll(); break;
2398
  case "r": case "R": e.preventDefault(); restartAll(); break;
2399
  case "l": case "L":
2400
  e.preventDefault();
 
236
  .q-card .likert button.selected[data-score="4"] { background: var(--score-4); }
237
  .q-card .likert button.selected[data-score="5"] { background: var(--score-5); }
238
 
 
 
 
239
  /* ---------- footer / nav ---------- */
240
  footer.bottom { position: fixed; bottom: 0; left: var(--sidebar-w); right: 0;
241
  background: var(--panel); border-top: 1px solid var(--border);
 
2003
  }
2004
 
2005
  function renderVideoControls(c) {
2006
+ // The active <video> already exposes the browser's native play/pause UI,
2007
+ // so there's no separate "Play" button here. Pause / Restart stay because
2008
+ // they act globally / sync-style.
2009
  const ctl = el("div", { class: "video-controls" });
 
 
 
2010
  ctl.appendChild(el("button", {
2011
  class: "ctl-btn", onclick: pauseAll,
2012
  }, t("pause")));
 
2044
  // The only video that's NOT inside a .hidden tile is the active one.
2045
  return document.querySelector(".video-tile:not(.hidden) video[data-slot]");
2046
  }
 
2047
  function restartActive() {
2048
  const v = activeVideo();
2049
  if (v) { v.currentTime = 0; try { v.play(); } catch(e){} }
 
2064
  function allVideos() {
2065
  return Array.from(document.querySelectorAll("video[data-slot]"));
2066
  }
 
2067
  function pauseAll() { allVideos().forEach(v => v.pause()); }
2068
  function restartAll() {
2069
  allVideos().forEach(v => { v.currentTime = 0; try { v.play(); } catch(e){} });
 
2082
  btn.textContent = MUTED ? "🔇 Muted" : "🔊 Sound";
2083
  }
2084
  function setSpeed(rate) { allVideos().forEach(v => v.playbackRate = rate); }
2085
+ // Space-bar shortcut: play/pause whichever video is on the active tab.
2086
+ function toggleActive() {
2087
+ const v = activeVideo();
2088
+ if (!v) return;
2089
+ if (v.paused) { try { v.play(); } catch(e){} } else { v.pause(); }
2090
  }
2091
 
2092
  /* =========================================================================
 
2386
  switch (e.key) {
2387
  case "ArrowLeft": case "k": e.preventDefault(); step(-1); break;
2388
  case "ArrowRight": case "j": e.preventDefault(); step(1); break;
2389
+ case " ": e.preventDefault(); toggleActive(); break;
2390
  case "r": case "R": e.preventDefault(); restartAll(); break;
2391
  case "l": case "L":
2392
  e.preventDefault();
static/mobile.html CHANGED
@@ -1038,7 +1038,8 @@ function renderVideoControls(){
1038
  b.textContent = label; b.onclick = fn; if (id) b.id = id;
1039
  return b;
1040
  };
1041
- wrap.appendChild(mkBtn(t("play"), playAll));
 
1042
  wrap.appendChild(mkBtn(t("pause"), pauseAll));
1043
  wrap.appendChild(mkBtn(t("restart"), restartAll));
1044
  const loop = mkBtn(t("loop"), () => toggleLoop(loop));
@@ -1135,7 +1136,6 @@ function closeDrawer(){
1135
 
1136
  /* ----- Video controls ----- */
1137
  function allVideos(){ return Array.from(document.querySelectorAll("video[data-slot]")); }
1138
- function playAll(){ allVideos().forEach(v=>{ try{ v.play(); }catch(e){} }); }
1139
  function pauseAll(){ allVideos().forEach(v=>v.pause()); }
1140
  function restartAll(){ allVideos().forEach(v=>{ v.currentTime=0; try{ v.play(); }catch(e){} }); }
1141
  let LOOPING=false;
 
1038
  b.textContent = label; b.onclick = fn; if (id) b.id = id;
1039
  return b;
1040
  };
1041
+ // Play button removed — the native <video controls> on the active tab
1042
+ // provides play/pause already.
1043
  wrap.appendChild(mkBtn(t("pause"), pauseAll));
1044
  wrap.appendChild(mkBtn(t("restart"), restartAll));
1045
  const loop = mkBtn(t("loop"), () => toggleLoop(loop));
 
1136
 
1137
  /* ----- Video controls ----- */
1138
  function allVideos(){ return Array.from(document.querySelectorAll("video[data-slot]")); }
 
1139
  function pauseAll(){ allVideos().forEach(v=>v.pause()); }
1140
  function restartAll(){ allVideos().forEach(v=>{ v.currentTime=0; try{ v.play(); }catch(e){} }); }
1141
  let LOOPING=false;