Spaces:
Running
Running
Download v118-runtime.js from mg696/pmx-vmd-sync-player: direct link, hf CLI and curl.
- Browser
- Download file 1.62 kB
-
https://huggingface.co/spaces/mg696/pmx-vmd-sync-player/resolve/main/v118-runtime.js
- Command line
-
hf download hf://spaces/mg696/pmx-vmd-sync-player/v118-runtime.js
-
curl -L -o v118-runtime.js https://huggingface.co/spaces/mg696/pmx-vmd-sync-player/resolve/main/v118-runtime.js
1.62 kB
| // v118-runtime.js: narrow runtime fixes only; do not touch v117 stable internals. | |
| (function(){ | |
| const VER='v118'; | |
| function log(m,l){try{(window.__dbg||console.log)(m,l||'info')}catch(e){console.log(m)}} | |
| function setVer(){try{document.title='MMD pmx Player '+VER;const v=document.getElementById('version-label');if(v)v.textContent=VER}catch(e){}} | |
| function clearVmdInput(id,why){const el=document.getElementById(id);if(el){el.value='';log('[VMD:'+VER+'] '+id+' cleared for same-file reselect ('+why+')','info')}} | |
| function bind(){ | |
| setVer();setTimeout(setVer,500);setTimeout(setVer,1500); | |
| const pairs=[['file-input','vmd-input'],['file-input2','vmd-input2']]; | |
| pairs.forEach(([modelId,vmdId])=>{ | |
| const m=document.getElementById(modelId); | |
| if(m&&!m.__v118ModelClear){m.__v118ModelClear=true;m.addEventListener('change',()=>clearVmdInput(vmdId,'model slot changed'),true)} | |
| }); | |
| ['vmd-input','vmd-input2','cam-vmd-input'].forEach(id=>{ | |
| const el=document.getElementById(id); | |
| if(!el||el.__v118SameFile)return; | |
| el.__v118SameFile=true; | |
| el.addEventListener('click',()=>{el.value='';log('[VMD:'+VER+'] '+id+' cleared before picker','info')},true); | |
| el.addEventListener('touchstart',()=>{el.value='';log('[VMD:'+VER+'] '+id+' cleared before picker(touch)','info')},{capture:true,passive:true}); | |
| el.addEventListener('change',()=>{setTimeout(()=>{try{el.value=''}catch(e){}},0)},false); | |
| }); | |
| log('[Runtime:'+VER+'] 同一VMD再選択パッチ有効','info'); | |
| } | |
| function wait(){if(window.__appReady)bind();else setTimeout(wait,100)} | |
| wait(); | |
| })(); | |