diff --git a/.github/workflows/live.yml b/.github/workflows/live.yml index 49cd5359..e5b6e152 100644 --- a/.github/workflows/live.yml +++ b/.github/workflows/live.yml @@ -33,6 +33,10 @@ jobs: mkdir -p dist/bin cp -r build_wasm/bin/* dist/bin/ cp src/experimental/studio/index.html dist/index.html + COMMIT_HASH=$(git rev-parse HEAD 2>/dev/null || true) + if [ -n "$COMMIT_HASH" ]; then + sed -i "s/__COMMIT_HASH_PLACEHOLDER__/$COMMIT_HASH/g" dist/index.html + fi - name: Upload GitHub Pages artifacts uses: actions/upload-pages-artifact@v3 diff --git a/src/experimental/studio/index.html b/src/experimental/studio/index.html index 8ab12f48..0b667c75 100644 --- a/src/experimental/studio/index.html +++ b/src/experimental/studio/index.html @@ -5,10 +5,17 @@ MuJoCo Live -
- - -
+
__COMMIT_HASH_PLACEHOLDER__
+ { - const uploadButton = document.getElementById('uploadButton'); - const fileInput = document.getElementById('fileInput'); - - uploadButton.addEventListener('click', () => { - fileInput.click(); - }); - - fileInput.addEventListener('change', (event) => { - const file = event.target.files[0]; - if (!file) { - return; - } - handleFile(file); - }); - // --- Drag-and-drop support --- const dropOverlay = document.createElement('div'); dropOverlay.id = 'dropOverlay';