Skip to content

Commit

Permalink
Fix: JS fixed.
Browse files Browse the repository at this point in the history
  • Loading branch information
Glomberg committed Dec 15, 2019
1 parent ea5a87b commit 0fbc2be
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions Antispam/Antispam.body.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static function AddJSCode() {

$html = '<script>
var ct_checkjs_val = \''.self::getJSChallenge().'\',
d = new Date()
d = new Date(),
ctTimeMs = new Date().getTime(),
ctMouseEventTimerFlag = true, //Reading interval flag
ctMouseData = "[",
Expand Down Expand Up @@ -199,15 +199,15 @@ function ctMouseStopData(){
//Logging mouse position each 300 ms
var ctFunctionMouseMove = function output(event){
if(ctMouseEventTimerFlag == true){
if(ctMouseEventTimerFlag === true){
var mouseDate = new Date();
ctMouseData += "[" + Math.round(event.pageY) + "," + Math.round(event.pageX) + "," + Math.round(mouseDate.getTime() - ctTimeMs) + "],";
ctMouseDataCounter++;
ctMouseEventTimerFlag = false;
if(ctMouseDataCounter >= 100)
ctMouseStopData();
}
}
};
//Stop key listening function
function ctKeyStopStopListening(){
Expand All @@ -225,7 +225,7 @@ function ctKeyStopStopListening(){
var KeyTimestamp = Math.floor(new Date().getTime()/1000);
ctSetCookie("ct_fkp_timestamp", KeyTimestamp);
ctKeyStopStopListening();
}
};
if(typeof window.addEventListener == "function"){
window.addEventListener("mousemove", ctFunctionMouseMove);
Expand Down

0 comments on commit 0fbc2be

Please sign in to comment.