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/bef0f20a1389f641cd14 to your computer and use it in GitHub Desktop.
Save impressivewebs/bef0f20a1389f641cd14 to your computer and use it in GitHub Desktop.
B.js
// A script to quickly select everything outside the 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=false;
}
}
for (var i = 11; i <= 14; i++) {
if (d.getElementById('chk_z_' + i)) {
d.getElementById('chk_z_' + i).checked=true;
}
}
d.getElementById('hfZ').value='11|12|13|14|';
d.getElementById('boxZone').innerHTML = '4 (14)';
}(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=false}}for(var t=11;t<=14;t++){if(e.getElementById("chk_z_"+t)){e.getElementById("chk_z_"+t).checked=true}}e.getElementById("hfZ").value="11|12|13|14|";e.getElementById("boxZone").innerHTML="4 (14)"})(document));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment