File "std-task-tracking.min.js"
Path: /ThinkIB/js/std/std-task-trackingminjs
File size: 1015 B
MIME-type: text/plain
Charset: utf-8
var iniTime=parseInt((new Date).getTime()/1e3),reportDelay=15,focused=!0,windowFocused=!1;function catchEventsToTrack(e){document.onvisibilitychange=function(){this.focused="visible"===document.visibilityState},window.onblur=function(){this.focused=!1,this.windowFocused=!1},window.onfocus=function(){this.focused=!0,this.windowFocused=!0},ckeditorFocus(e),setInterval(()=>reportTask(),1e3*reportDelay),window.addEventListener("unload",(function e(){reportTask()}))}function reportTask(){var e=timeSpent();this.focused?"undefined"!=typeof sendLogs&&sendLogs&&e>=5&&("undefined"!=typeof amountSecs&&(amountSecs+=e),navigator.sendBeacon(URLogger+`&secs=${e}`,null),iniTime=parseInt((new Date).getTime()/1e3)):iniTime=parseInt((new Date).getTime()/1e3)}function timeSpent(){var e=(new Date).getTime()/1e3,n;return parseInt(e-iniTime)}function ckeditorFocus(e){"undefined"!=typeof ClassicEditor&&"undefined"==typeof isExamMode&&e.editing.view.document.on("change:isFocused",(function(e,n,i){focused=i||windowFocused}))}