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