Last active
August 29, 2015 14:03
-
-
Save impressivewebs/bef0f20a1389f641cd14 to your computer and use it in GitHub Desktop.
B.js
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
// 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