Many hyperlinks are disabled.
Use anonymous login
to enable hyperlinks.
Overview
Comment: | Converted src/href.js to jQuery as a demonstration: the code's nearly half the size, and it's clearer as a result. |
---|---|
Downloads: | Tarball | ZIP archive | SQL archive |
Timelines: | family | ancestors | descendants | both | js-hamburger-menu |
Files: | files | file ages | folders |
SHA3-256: |
59c7ca0509e49872a09f3a89bb6cc55a |
User & Date: | wyoung 2018-09-06 03:56:00 |
References
2018-09-09
| ||
17:41 | Reverted [59c7ca0509]: drh says we can't use jQuery. Also, there was a syntax error that sent all hyperlinks to the honeypot in some conditions. ... (check-in: 5a62b395 user: wyoung tags: js-hamburger-menu) | |
Context
2018-09-09
| ||
17:41 | Reverted [59c7ca0509]: drh says we can't use jQuery. Also, there was a syntax error that sent all hyperlinks to the honeypot in some conditions. ... (check-in: 5a62b395 user: wyoung tags: js-hamburger-menu) | |
2018-09-06
| ||
03:56 | The hyperlinks in the hamburger menu drop-down still had the anti-robot defense activated. Defeated it. ... (check-in: 571df2e8 user: wyoung tags: js-hamburger-menu) | |
03:56 | Converted src/href.js to jQuery as a demonstration: the code's nearly half the size, and it's clearer as a result. ... (check-in: 59c7ca05 user: wyoung tags: js-hamburger-menu) | |
2018-09-05
| ||
23:45 | Fixed a bug in the onclick handler for the new hamburger button which allowed the browser to follow our empty 'a href="#"' link. For some reason, Chrome only did this sometimes, not always, which lead to me thinking it was some kind of race condition. ... (check-in: e806e5c4 user: wyoung tags: js-hamburger-menu) | |
Changes
Changes to src/href.js.
︙ | ︙ | |||
14 15 16 17 18 19 20 | ** ** The <script> must have an id='href-data'. DELAY is the number ** milliseconds delay prior to populating href= and action=. If the ** mouseover boolean is true, then the timer does not start until a ** mouse motion event occurs over top of the document. */ function setAllHrefs(){ | | < < | | < < | | | | < < | | < | | | | < < | < < | 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 | ** ** The <script> must have an id='href-data'. DELAY is the number ** milliseconds delay prior to populating href= and action=. If the ** mouseover boolean is true, then the timer does not start until a ** mouse motion event occurs over top of the document. */ function setAllHrefs(){ $('a[data-href]').attr('href', function() { return this.attr("data-href"); }); $('form[data-action]').attr('action'), function() { return this.attr("data-action"); }); } (function antiRobotDefense(){ var g = JSON.parse($('#href-data').text()); var hasMouseMove = 'onmousemove' in createElement('body'); var initEvent = g.mouseover && hasMouseMove ? 'mousemove' : 'load'; $('body').on(initEvent, function() { setTimeout(setAllHrefs, g.delay); }); })(); |