Skip to content

Instantly share code, notes, and snippets.

@impressivewebs
Last active August 29, 2015 14:03
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save impressivewebs/da4e0dbb7b0a51742294 to your computer and use it in GitHub Desktop.
Save impressivewebs/da4e0dbb7b0a51742294 to your computer and use it in GitHub Desktop.
K.js
// A script to quickly select the entire strike zone in BaseballSavant.com's pitchFX search tool.
(function(d) {
for (var i = 1; i <= 9; i++) {
if (d.getElementById('chk_z_' + i)) {
d.getElementById('chk_z_' + i).checked=true;
}
}
for (var i = 11; i <= 14; i++) {
if (d.getElementById('chk_z_' + i)) {
d.getElementById('chk_z_' + i).checked=false;
}
}
d.getElementById('hfZ').value='1|2|3|4|5|6|7|8|9|';
d.getElementById('boxZone').innerHTML = '9 (9)';
}(document));
// as a bookmarklet:
javascript:void((function(e){for(var t=1;t<=9;t++){if(e.getElementById("chk_z_"+t)){e.getElementById("chk_z_"+t).checked=true}}for(var t=11;t<=14;t++){if(e.getElementById("chk_z_"+t)){e.getElementById("chk_z_"+t).checked=false}}e.getElementById("hfZ").value="1|2|3|4|5|6|7|8|9|";e.getElementById("boxZone").innerHTML="9 (9)"})(document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment