Fossil SCM

Merge the robot tests from trunk with the new tests from this branch so that *all* the tests are run.

drh 2025-08-17 18:44 robotck-instant
Commit 95a57c637f857e35c0830336fcf0a21d460a201b7a95492cb24ea734bc3ef275
1 file changed +23 -20
+23 -20
--- src/robot.c
+++ src/robot.c
@@ -97,36 +97,39 @@
9797
style_header("Browser Verification");
9898
@ <h1 id="x1">Checking to see if you are a robot<span id="x2"></span></h1>
9999
@ <form method="GET" id="x6">
100100
@ <p id="x3" style="visibility:hidden;">\
101101
@ Press <input type="submit" id="x5" value="Ok" focus> to continue</p>
102
+ @ <p id="x7" style="visibility:hidden;">You appear to be a robot.</p>
102103
cgi_query_parameters_to_hidden();
103
- k = 800 + h2%99;
104
- h2 = (k*k + k)/2;
105104
@ <input id="x4" type="hidden" name="proof" value="0">
106105
@ </form>
107106
@ <script nonce='%s(style_nonce())'>
108
- @ window.addEventListener('load',function(ev){
109
- @ const E = (x)=>document.getElementById(x);
110
- @ let h = %u(h1-h2);
111
- @ let a = %u(k);
112
- @ const x4 = E("x4");
113
- @ for( ; a>0; --a ) {
114
- @ h += a;
115
- @ }
116
- @ x4.value = h;
117
- @ const gcs = window.getComputedStyle(document.body);
118
- @ if( gcs.zIndex==='0' ) {
119
- @ E("x3").style.visibility="visible";
120
- @ E("x2").textContent="";
121
- @ E("x1").textContent="Robot-check passed";
122
- @ E("x6").onsubmit=function(){E("x3").style.visibility="hidden";};
123
- @ E("x5").focus();
107
+ @ function aaa(x){return document.getElementById(x);}
108
+ @ function bbb(h,a){
109
+ @ aaa("x4").value=h
110
+ @ if((a%%75)==0){
111
+ @ aaa("x2").textContent=aaa("x2").textContent+".";
112
+ @ }
113
+ @ if(a>0){
114
+ @ setTimeout(bbb,1,h+a,a-1);
115
+ @ }else if( window.getComputedStyle(document.body).zIndex==='0' ){
116
+ @ aaa("x3").style.visibility="visible";
117
+ @ aaa("x2").textContent="";
118
+ @ aaa("x1").textContent="All clear";
119
+ @ aaa("x6").onsubmit=function(){aaa("x3").style.visibility="hidden";};
120
+ @ aaa("x5").focus();
121
+ @ }else{
122
+ @ aaa("x7").style.visibility="visible";
123
+ @ aaa("x2").textContent="";
124
+ @ aaa("x1").textContent="Access Denied";
124125
@ }
125
- @ },false);
126
+ @ }
127
+ k = 400 + h2%299;
128
+ h2 = (k*k + k)/2;
129
+ @ setTimeout(function(){bbb(%u(h1-h2),%u(k));},10);
126130
@ </script>
127
- cgi_set_status(511, "OK for people");
128131
style_finish_page();
129132
return 1;
130133
}
131134
132135
/*
133136
--- src/robot.c
+++ src/robot.c
@@ -97,36 +97,39 @@
97 style_header("Browser Verification");
98 @ <h1 id="x1">Checking to see if you are a robot<span id="x2"></span></h1>
99 @ <form method="GET" id="x6">
100 @ <p id="x3" style="visibility:hidden;">\
101 @ Press <input type="submit" id="x5" value="Ok" focus> to continue</p>
 
102 cgi_query_parameters_to_hidden();
103 k = 800 + h2%99;
104 h2 = (k*k + k)/2;
105 @ <input id="x4" type="hidden" name="proof" value="0">
106 @ </form>
107 @ <script nonce='%s(style_nonce())'>
108 @ window.addEventListener('load',function(ev){
109 @ const E = (x)=>document.getElementById(x);
110 @ let h = %u(h1-h2);
111 @ let a = %u(k);
112 @ const x4 = E("x4");
113 @ for( ; a>0; --a ) {
114 @ h += a;
115 @ }
116 @ x4.value = h;
117 @ const gcs = window.getComputedStyle(document.body);
118 @ if( gcs.zIndex==='0' ) {
119 @ E("x3").style.visibility="visible";
120 @ E("x2").textContent="";
121 @ E("x1").textContent="Robot-check passed";
122 @ E("x6").onsubmit=function(){E("x3").style.visibility="hidden";};
123 @ E("x5").focus();
 
 
124 @ }
125 @ },false);
 
 
 
126 @ </script>
127 cgi_set_status(511, "OK for people");
128 style_finish_page();
129 return 1;
130 }
131
132 /*
133
--- src/robot.c
+++ src/robot.c
@@ -97,36 +97,39 @@
97 style_header("Browser Verification");
98 @ <h1 id="x1">Checking to see if you are a robot<span id="x2"></span></h1>
99 @ <form method="GET" id="x6">
100 @ <p id="x3" style="visibility:hidden;">\
101 @ Press <input type="submit" id="x5" value="Ok" focus> to continue</p>
102 @ <p id="x7" style="visibility:hidden;">You appear to be a robot.</p>
103 cgi_query_parameters_to_hidden();
 
 
104 @ <input id="x4" type="hidden" name="proof" value="0">
105 @ </form>
106 @ <script nonce='%s(style_nonce())'>
107 @ function aaa(x){return document.getElementById(x);}
108 @ function bbb(h,a){
109 @ aaa("x4").value=h
110 @ if((a%%75)==0){
111 @ aaa("x2").textContent=aaa("x2").textContent+".";
112 @ }
113 @ if(a>0){
114 @ setTimeout(bbb,1,h+a,a-1);
115 @ }else if( window.getComputedStyle(document.body).zIndex==='0' ){
116 @ aaa("x3").style.visibility="visible";
117 @ aaa("x2").textContent="";
118 @ aaa("x1").textContent="All clear";
119 @ aaa("x6").onsubmit=function(){aaa("x3").style.visibility="hidden";};
120 @ aaa("x5").focus();
121 @ }else{
122 @ aaa("x7").style.visibility="visible";
123 @ aaa("x2").textContent="";
124 @ aaa("x1").textContent="Access Denied";
125 @ }
126 @ }
127 k = 400 + h2%299;
128 h2 = (k*k + k)/2;
129 @ setTimeout(function(){bbb(%u(h1-h2),%u(k));},10);
130 @ </script>
 
131 style_finish_page();
132 return 1;
133 }
134
135 /*
136

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button