Created
April 7, 2022 15:13
-
-
Save dlgombert/6309172a0b72dd6a5dfd1948a5172c0a to your computer and use it in GitHub Desktop.
[truancy-tracker-new-referral] New Referral Bookmarklet for Truancy #bookmarklet
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function populate() { | |
| let y=Math.round(Math.random()*15)+2000; | |
| let m=String(Math.round(Math.random()*11)+1).padStart(2, '0') | |
| let d=String(Math.round(Math.random()*28)+1).padStart(2, '0') | |
| $('#firstname').val(chance.first()); | |
| $('#lastname').val(chance.last()); | |
| $('#birthdate').val(`${y}-${m}-${d}`); | |
| $fa('newReferral_submit').trigger('click'); | |
| } | |
| $fa = (function (n) { | |
| return $(`[name="${n}"]`); | |
| }); | |
| function init() { | |
| $(document).on('shown.bs.modal', populate); | |
| $('[data-target="#newReferral"]').trigger('click'); | |
| } | |
| if (typeof chance === "undefined") { | |
| $.getScript('//cdnjs.cloudflare.com/ajax/libs/chance/1.1.8/chance.min.js').then(init); | |
| } else { | |
| init(); | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment