Browse Source

Can load buttons removed.

refactor/modularize
RUSHIL AMBARISH KADU 9 months ago
parent
commit
fdad9851df
  1. 6
      steps/index.html
  2. 7
      steps/src/main.js

6
steps/index.html

@ -229,10 +229,6 @@
class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition-colors text-sm font-medium"> class="bg-green-600 text-white px-4 py-2 rounded-lg hover:bg-green-700 transition-colors text-sm font-medium">
Load Video Load Video
</button> </button>
<button id="load-can-btn"
class="bg-yellow-500 text-white px-4 py-2 rounded-lg hover:bg-yellow-600 transition-colors text-sm font-medium">
Load CAN Log
</button>
<button id="clear-cache-btn" <button id="clear-cache-btn"
class="bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition-colors text-sm font-medium"> class="bg-red-600 text-white px-4 py-2 rounded-lg hover:bg-red-700 transition-colors text-sm font-medium">
Clear Cache Clear Cache
@ -284,7 +280,7 @@
</div> </div>
</div> </div>
<input type="file" id="json-file-input" class="hidden" accept=".json" /><input type="file" id="video-file-input" <input type="file" id="json-file-input" class="hidden" accept=".json" /><input type="file" id="video-file-input"
class="hidden" accept="video/*" /><input type="file" id="can-file-input" class="hidden" accept=".log, .txt" />
class="hidden" accept="video/*" />
<script type="module" src="./src/main.js"></script> <script type="module" src="./src/main.js"></script>
</body> </body>

7
steps/src/main.js

@ -100,7 +100,6 @@ function setupVideoPlayer(fileURL) {
// Event listener for loading JSON file. // Event listener for loading JSON file.
loadJsonBtn.addEventListener("click", () => jsonFileInput.click()); loadJsonBtn.addEventListener("click", () => jsonFileInput.click());
loadVideoBtn.addEventListener("click", () => videoFileInput.click()); loadVideoBtn.addEventListener("click", () => videoFileInput.click());
loadCanBtn.addEventListener("click", () => canFileInput.click());
clearCacheBtn.addEventListener("click", async () => { clearCacheBtn.addEventListener("click", async () => {
const confirmed = await showModal("Clear all cached data and reload?", true); const confirmed = await showModal("Clear all cached data and reload?", true);
@ -225,9 +224,7 @@ videoFileInput.addEventListener("change", (event) => {
}); });
// Event listener for CAN file input change. // Event listener for CAN file input change.
canFileInput.addEventListener("change", (event) => {
const file = event.target.files[0];
if (!file) return;
appState.canLogFilename = file.name; appState.canLogFilename = file.name;
localStorage.setItem("canLogFilename", appState.canLogFilename); localStorage.setItem("canLogFilename", appState.canLogFilename);
@ -264,7 +261,7 @@ canFileInput.addEventListener("change", (event) => {
} }
}; };
reader.readAsText(file); reader.readAsText(file);
});
// Event listener for offset input change. // Event listener for offset input change.
offsetInput.addEventListener("input", () => { offsetInput.addEventListener("input", () => {

Loading…
Cancel
Save