Fossil SCM
Wrap the robot_restrict() JS check in an onload handler so that it won't run until the external resources (namely style.css) are loaded.
Commit
e5991efb681a88edb74a399d7bd6b92d7f8479a2e934136631e13d6eb24f9147
Parent
e5b00c610dee894…
1 file changed
+2
+2
| --- src/robot.c | ||
| +++ src/robot.c | ||
| @@ -102,10 +102,11 @@ | ||
| 102 | 102 | @ <span id="x7" style="visibility:hidden;">You appear to be a robot.</span></p> |
| 103 | 103 | cgi_query_parameters_to_hidden(); |
| 104 | 104 | @ <input id="x4" type="hidden" name="proof" value="0"> |
| 105 | 105 | @ </form> |
| 106 | 106 | @ <script nonce='%s(style_nonce())'> |
| 107 | + @ window.addEventListener('load',function(){ | |
| 107 | 108 | @ function aaa(x){return document.getElementById(x);} |
| 108 | 109 | @ function bbb(h,a){\ |
| 109 | 110 | @ aaa("x4").value=h;\ |
| 110 | 111 | @ if((a%%75)==0){\ |
| 111 | 112 | @ aaa("x2").textContent=aaa("x2").textContent+".";\ |
| @@ -126,10 +127,11 @@ | ||
| 126 | 127 | @ }\ |
| 127 | 128 | @ } |
| 128 | 129 | k = 400 + h2%299; |
| 129 | 130 | h2 = (k*k + k)/2; |
| 130 | 131 | @ setTimeout(function(){bbb(%u(h1-h2),%u(k));},10); |
| 132 | + @ }, false); | |
| 131 | 133 | @ </script> |
| 132 | 134 | style_finish_page(); |
| 133 | 135 | return 1; |
| 134 | 136 | } |
| 135 | 137 | |
| 136 | 138 |
| --- src/robot.c | |
| +++ src/robot.c | |
| @@ -102,10 +102,11 @@ | |
| 102 | @ <span id="x7" style="visibility:hidden;">You appear to be a robot.</span></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+".";\ |
| @@ -126,10 +127,11 @@ | |
| 126 | @ }\ |
| 127 | @ } |
| 128 | k = 400 + h2%299; |
| 129 | h2 = (k*k + k)/2; |
| 130 | @ setTimeout(function(){bbb(%u(h1-h2),%u(k));},10); |
| 131 | @ </script> |
| 132 | style_finish_page(); |
| 133 | return 1; |
| 134 | } |
| 135 | |
| 136 |
| --- src/robot.c | |
| +++ src/robot.c | |
| @@ -102,10 +102,11 @@ | |
| 102 | @ <span id="x7" style="visibility:hidden;">You appear to be a robot.</span></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 | @ window.addEventListener('load',function(){ |
| 108 | @ function aaa(x){return document.getElementById(x);} |
| 109 | @ function bbb(h,a){\ |
| 110 | @ aaa("x4").value=h;\ |
| 111 | @ if((a%%75)==0){\ |
| 112 | @ aaa("x2").textContent=aaa("x2").textContent+".";\ |
| @@ -126,10 +127,11 @@ | |
| 127 | @ }\ |
| 128 | @ } |
| 129 | k = 400 + h2%299; |
| 130 | h2 = (k*k + k)/2; |
| 131 | @ setTimeout(function(){bbb(%u(h1-h2),%u(k));},10); |
| 132 | @ }, false); |
| 133 | @ </script> |
| 134 | style_finish_page(); |
| 135 | return 1; |
| 136 | } |
| 137 | |
| 138 |