Skip to content

Commit

Permalink
allow pasting a FEN in the topnav search bar
Browse files Browse the repository at this point in the history
  • Loading branch information
ornicar committed Jul 12, 2023
1 parent f10a055 commit 5897579
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion ui/cli/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,10 @@ export function initModule({ input }: { input: HTMLInputElement }) {
function execute(q: string) {
if (!q) return;
if (q[0] == '/') return command(q.replace(/\//g, ''));
else location.href = '/@/' + q;
// 5kr1/p1p2p2/2b2Q2/3q2r1/2p4p/2P4P/P2P1PP1/1R1K3R b - - 1 23
if (q.match(/^([1-8pnbrqk]+\/){7}.*/i))
return (location.href = '/analysis/standard/' + q.replace(/ /g, '_'));
location.href = '/@/' + q;
}

function command(q: string) {
Expand Down

0 comments on commit 5897579

Please sign in to comment.