If you would add a move option with pass as the second part of the move, the player could choose that immediately, which would bypass the need for the player to complete the move on the next page.
But it was not possible to pass a pass option to setlegal, one could only pass the first leg. I didn't know the moves in $extralegal were also used for highlighting; I thought they were just for the auto-completion. One problem is that at the moment a move without side effects is generated, there is no way knowing whether the same move with side effect will be generated later. And it would look silly to write every simple move as a 2-leg move with pass as second leg, especially if it happened in a game where there even aren't any multi-leg movers.
So even now that I know that the $extralegal moves are used for highlighting, by studying the JavaScript, I still have the dilemma of whether to push a move a-b simply as a-b, or as a-b; pass. I now solve that by letting the JavaScript highlight the destination of the first leg also as possible destination of the second leg to select a move without side effect, and have it add the pass to the move just before submitting it, when that move gets selected by a third click. And I refrain now from using setlegal on moves with side effects.
That moves for $extralegal must be in standard format is indeed an extra obstacle for the programmer (although I think I got it right). This is why I proposed to use setlegal also for multi-leg moves, so that it can generate the standard format. What holds for simple moves holds to an even larger degree for multi-leg moves.
I'm working toward something that will do that, but I need to be able to test it with Mighty Lion Chess.
If you clone the Mighty Lion preset by saving it to another settings file, you won't copy the JavaScript with it. You can then use it to test your own JavaScript. Same with Odin's Rune Chess.
But it was not possible to pass a pass option to setlegal, one could only pass the first leg. I didn't know the moves in $extralegal were also used for highlighting; I thought they were just for the auto-completion. One problem is that at the moment a move without side effects is generated, there is no way knowing whether the same move with side effect will be generated later. And it would look silly to write every simple move as a 2-leg move with pass as second leg, especially if it happened in a game where there even aren't any multi-leg movers.
So even now that I know that the $extralegal moves are used for highlighting, by studying the JavaScript, I still have the dilemma of whether to push a move a-b simply as a-b, or as a-b; pass. I now solve that by letting the JavaScript highlight the destination of the first leg also as possible destination of the second leg to select a move without side effect, and have it add the pass to the move just before submitting it, when that move gets selected by a third click. And I refrain now from using setlegal on moves with side effects.
That moves for $extralegal must be in standard format is indeed an extra obstacle for the programmer (although I think I got it right). This is why I proposed to use setlegal also for multi-leg moves, so that it can generate the standard format. What holds for simple moves holds to an even larger degree for multi-leg moves.
If you clone the Mighty Lion preset by saving it to another settings file, you won't copy the JavaScript with it. You can then use it to test your own JavaScript. Same with Odin's Rune Chess.