Fossil SCM
Attempt to make recent robot defense improvements portable to IE. I do not have access to IE and hence cannot test this, so the changes are mostly a guess. [forum:/forumpost/e18c040d32|Forum post e18c040d32].
Commit
3d32a109301d1cab482c6f48c4a7c3617aec3408db09a4c95c20a08a0fb006c7
Parent
3710202914e5ddd…
2 files changed
+2
-1
+2
-2
+2
-1
| --- src/href.js | ||
| +++ src/href.js | ||
| @@ -18,11 +18,12 @@ | ||
| 18 | 18 | ** until the first mousedown event that occurs after the timer expires. |
| 19 | 19 | */ |
| 20 | 20 | var antiRobot = 0; |
| 21 | 21 | function antiRobotGo(){ |
| 22 | 22 | if( antiRobot!=3 ) return; |
| 23 | - if( window.getComputedStyle(document.body).zIndex==='0' ){ | |
| 23 | + var z = window.getComputedStyle(document.body).zIndex; | |
| 24 | + if( z==='0' || z===0 ){ | |
| 24 | 25 | antiRobot = 7; |
| 25 | 26 | var anchors = document.getElementsByTagName("a"); |
| 26 | 27 | for(var i=0; i<anchors.length; i++){ |
| 27 | 28 | var j = anchors[i]; |
| 28 | 29 | if(j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 29 | 30 |
| --- src/href.js | |
| +++ src/href.js | |
| @@ -18,11 +18,12 @@ | |
| 18 | ** until the first mousedown event that occurs after the timer expires. |
| 19 | */ |
| 20 | var antiRobot = 0; |
| 21 | function antiRobotGo(){ |
| 22 | if( antiRobot!=3 ) return; |
| 23 | if( window.getComputedStyle(document.body).zIndex==='0' ){ |
| 24 | antiRobot = 7; |
| 25 | var anchors = document.getElementsByTagName("a"); |
| 26 | for(var i=0; i<anchors.length; i++){ |
| 27 | var j = anchors[i]; |
| 28 | if(j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 29 |
| --- src/href.js | |
| +++ src/href.js | |
| @@ -18,11 +18,12 @@ | |
| 18 | ** until the first mousedown event that occurs after the timer expires. |
| 19 | */ |
| 20 | var antiRobot = 0; |
| 21 | function antiRobotGo(){ |
| 22 | if( antiRobot!=3 ) return; |
| 23 | var z = window.getComputedStyle(document.body).zIndex; |
| 24 | if( z==='0' || z===0 ){ |
| 25 | antiRobot = 7; |
| 26 | var anchors = document.getElementsByTagName("a"); |
| 27 | for(var i=0; i<anchors.length; i++){ |
| 28 | var j = anchors[i]; |
| 29 | if(j.hasAttribute("data-href")) j.href=j.getAttribute("data-href"); |
| 30 |
+2
-2
| --- src/robot.c | ||
| +++ src/robot.c | ||
| @@ -213,14 +213,14 @@ | ||
| 213 | 213 | @ function aaa(x){return document.getElementById(x);}\ |
| 214 | 214 | @ function bbb(h,a){\ |
| 215 | 215 | @ aaa("x4").value=h;\ |
| 216 | 216 | @ if((a%%75)==0){\ |
| 217 | 217 | @ aaa("x2").textContent=aaa("x2").textContent+".";\ |
| 218 | - @ }\ | |
| 218 | + @ }var z;\ | |
| 219 | 219 | @ if(a>0){\ |
| 220 | 220 | @ setTimeout(bbb,1,h+a,a-1);\ |
| 221 | - @ }else if(window.getComputedStyle(document.body).zIndex==='0'){\ | |
| 221 | + @ }else if((z=window.getComputedStyle(document.body).zIndex)==='0'||z===0){\ | |
| 222 | 222 | @ aaa("x3").style.visibility="visible";\ |
| 223 | 223 | @ aaa("x2").textContent="";\ |
| 224 | 224 | @ aaa("x1").textContent="All clear";\ |
| 225 | 225 | @ aaa("x6").onsubmit=function(){aaa("x3").style.visibility="hidden";};\ |
| 226 | 226 | @ aaa("x5").focus();\ |
| 227 | 227 |
| --- src/robot.c | |
| +++ src/robot.c | |
| @@ -213,14 +213,14 @@ | |
| 213 | @ function aaa(x){return document.getElementById(x);}\ |
| 214 | @ function bbb(h,a){\ |
| 215 | @ aaa("x4").value=h;\ |
| 216 | @ if((a%%75)==0){\ |
| 217 | @ aaa("x2").textContent=aaa("x2").textContent+".";\ |
| 218 | @ }\ |
| 219 | @ if(a>0){\ |
| 220 | @ setTimeout(bbb,1,h+a,a-1);\ |
| 221 | @ }else if(window.getComputedStyle(document.body).zIndex==='0'){\ |
| 222 | @ aaa("x3").style.visibility="visible";\ |
| 223 | @ aaa("x2").textContent="";\ |
| 224 | @ aaa("x1").textContent="All clear";\ |
| 225 | @ aaa("x6").onsubmit=function(){aaa("x3").style.visibility="hidden";};\ |
| 226 | @ aaa("x5").focus();\ |
| 227 |
| --- src/robot.c | |
| +++ src/robot.c | |
| @@ -213,14 +213,14 @@ | |
| 213 | @ function aaa(x){return document.getElementById(x);}\ |
| 214 | @ function bbb(h,a){\ |
| 215 | @ aaa("x4").value=h;\ |
| 216 | @ if((a%%75)==0){\ |
| 217 | @ aaa("x2").textContent=aaa("x2").textContent+".";\ |
| 218 | @ }var z;\ |
| 219 | @ if(a>0){\ |
| 220 | @ setTimeout(bbb,1,h+a,a-1);\ |
| 221 | @ }else if((z=window.getComputedStyle(document.body).zIndex)==='0'||z===0){\ |
| 222 | @ aaa("x3").style.visibility="visible";\ |
| 223 | @ aaa("x2").textContent="";\ |
| 224 | @ aaa("x1").textContent="All clear";\ |
| 225 | @ aaa("x6").onsubmit=function(){aaa("x3").style.visibility="hidden";};\ |
| 226 | @ aaa("x5").focus();\ |
| 227 |