event-util.js (727B)
1 // Allows a moment for events to be processed then performs a seek and runs 2 // a snapshot. 3 function delayedSnapshot(seekTimeInSeconds) 4 { 5 // Allow time for events to be processed 6 window.setTimeout(finish, 10, seekTimeInSeconds); 7 } 8 9 function finish(seekTimeInSeconds) 10 { 11 document.documentElement.pauseAnimations(); 12 if (seekTimeInSeconds) 13 document.documentElement.setCurrentTime(seekTimeInSeconds); 14 document.documentElement.removeAttribute("class"); 15 } 16 17 function click(targetId) 18 { 19 var evt = document.createEvent("MouseEvents"); 20 evt.initMouseEvent("click", true, true, window, 21 0, 0, 0, 0, 0, false, false, false, false, 0, null); 22 var target = document.getElementById(targetId); 23 target.dispatchEvent(evt); 24 }