Skip to content

Instantly share code, notes, and snippets.

@darai0512
Last active April 2, 2019 01:07
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save darai0512/925591b7d7bac378fbad497d1ae5ed68 to your computer and use it in GitHub Desktop.
Save darai0512/925591b7d7bac378fbad497d1ae5ed68 to your computer and use it in GitHub Desktop.
Auto-fill in TeamSpirit Attendance Sheet (if you'd like to stop this script, reload the page.)
javascript:(()=>{const targets = document.querySelectorAll('td.dval.vst.day_time0');const len = targets.length;if(len===0)return;let i = 0;const id = setInterval(()=>{if(document.querySelector('#dlgInpTimeOk')!==null)return;targets[i++].click();const st=document.querySelector('#startTime');if(st.value==='')st.value='12:00';const en=document.querySelector('#endTime');if(en.value==='')en.value='20:00';document.querySelector('#dlgInpTimeOk').click();if(i===len)clearInterval(id);}, 1000);})()
(() => {
const targets = document.querySelectorAll('td.dval.vst.day_time0');
const len = targets.length;
if (len === 0) return;
let i = 0;
const id = setInterval(() => {
if (document.querySelector('#dlgInpTimeOk') !== null) return;
targets[i++].click();
const st = document.querySelector('#startTime');
if (st.value === '') st.value = '12:00';
const en = document.querySelector('#endTime');
if (en.value === '') en.value = '20:00';
document.querySelector('#dlgInpTimeOk').click();
if (i === len) clearInterval(id);
}, 1000);
})()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment