Created
November 25, 2016 19:27
-
-
Save prendradjaja/7e6d9362fa89f866087601535a2bd3ff to your computer and use it in GitHub Desktop.
Lichess seek settings 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 seekSettings(time, increment, rated, ratingRange) { | |
var expectedVariant = 'Standard'; | |
var expectedTimeMode = 'Real time'; | |
if ($('#variant').find(':selected').text() !== expectedVariant) { | |
alert('Failed. Set variant to: ' + expectedVariant); | |
return; | |
} | |
if ($('#timeMode').find(':selected').text() !== expectedTimeMode) { | |
alert('Failed. Set time control to: ' + expectedTimeMode); | |
return; | |
} | |
$('#time').prop('value', time); | |
$('#increment').prop('value', increment); | |
$('#ratingRange').prop('value', ratingRange); | |
$(rated ? '#mode_1' : '#mode_0').prop('checked', true); | |
} | |
seekSettings(15, 10, true, '1350-1950'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
👍