|
33 | 33 | margin: 0; /* remove extra margin */ |
34 | 34 | overflow: hidden; /* prevent text overflow */ |
35 | 35 | } |
| 36 | + .hint { color: #666; font-size: 12px; margin-left: 6px; } |
36 | 37 | .message { |
37 | 38 | color: green; |
38 | 39 | margin-top: 20px; |
|
328 | 329 |
|
329 | 330 | }); |
330 | 331 | </script> |
331 | | - <style> |
332 | | -html[data-theme=dark]{filter:invert(.9) hue-rotate(180deg);background:#fff} |
333 | | -html[data-theme=dark] img,html[data-theme=dark] iframe,html[data-theme=dark] video, |
334 | | -html[data-theme=dark] .leaflet-container,html[data-theme=dark] .locmap,html[data-theme=dark] .routemap |
335 | | -{filter:invert(1) hue-rotate(180deg)} |
336 | | -#theme{position:fixed;right:12px;bottom:12px;z-index:9999;padding:6px 10px;border:1px solid #bbb;border-radius:16px; |
337 | | -background:#fff;color:#222;font-size:13px;cursor:pointer} |
338 | | - </style> |
339 | | - <script> |
340 | | -// dark unless switched to light; a cookie, not localStorage: the hub and each review page run on their own port, |
341 | | -// and cookies are shared across the ports of a host |
342 | | -(function () { |
343 | | - const m = document.cookie.match(/(?:^|; )theme=(dark|light)/); |
344 | | - document.documentElement.dataset.theme = m ? m[1] : 'dark'; |
345 | | - addEventListener('DOMContentLoaded', () => { |
346 | | - const b = document.createElement('button'); |
347 | | - b.id = 'theme'; |
348 | | - const label = () => { b.textContent = document.documentElement.dataset.theme === 'dark' ? '☀️ Light' : '🌙 Dark'; }; |
349 | | - b.onclick = () => { |
350 | | - const t = document.documentElement.dataset.theme === 'dark' ? 'light' : 'dark'; |
351 | | - document.documentElement.dataset.theme = t; |
352 | | - document.cookie = `theme=${t}; path=/; max-age=31536000; SameSite=Lax`; |
353 | | - label(); |
354 | | - }; |
355 | | - label(); |
356 | | - document.body.appendChild(b); |
357 | | - }); |
358 | | -})(); |
359 | | -</script> |
360 | 332 | </head> |
361 | 333 | <body> |
362 | 334 | <div class="container"> |
@@ -657,6 +629,7 @@ <h3>{{ message | safe }}</h3> |
657 | 629 | <input type="hidden" name="video_url" value="{{ video_url }}"> |
658 | 630 | <input type="hidden" name="yt_description" value="{{ yt_description }}"> |
659 | 631 | <input type="hidden" name="yt_upload_date" value="{{ yt_upload_date }}"> |
| 632 | + <input type="hidden" name="video_length" value="{{ video_length or '' }}"> |
660 | 633 |
|
661 | 634 | <div class="form-group"> |
662 | 635 | <label for="time_of_day">Time of day:</label> |
@@ -696,12 +669,13 @@ <h3>{{ message | safe }}</h3> |
696 | 669 | </div> |
697 | 670 | <div class="form-group"> |
698 | 671 | <label for="start_time">Start time (seconds):</label> |
699 | | - <input type="number" id="start_time" name="start_time" value="{{ start_time_input }}" required min="0" step="1"> |
| 672 | + <input type="number" id="start_time" name="start_time" value="{{ start_time_input }}" required min="0" step="1"{% if video_length %} max="{{ video_length - 1 }}"{% endif %}> |
700 | 673 | </div> |
701 | 674 |
|
702 | 675 | <div class="form-group"> |
703 | 676 | <label for="end_time">End time (seconds):</label> |
704 | | - <input type="number" id="end_time" name="end_time" value="{{ end_time_input }}" required min="1" step="1"> |
| 677 | + <input type="number" id="end_time" name="end_time" value="{{ end_time_input }}" required min="1" step="1"{% if video_length %} max="{{ video_length }}"{% endif %}> |
| 678 | + {% if video_length %}<span class="hint">video: {{ video_length }} s</span>{% endif %} |
705 | 679 | </div> |
706 | 680 |
|
707 | 681 | <div class="form-group"> |
|
0 commit comments