From 0833f833797c67dbc4b67c4d44d6d7795eae7212 Mon Sep 17 00:00:00 2001 From: Fabien Cazenave Date: Mon, 11 Nov 2024 12:32:53 +0100 Subject: [PATCH] bugfix: proper keyboard layout paths (#274) --- code/duck-typist.js | 3 ++- www/layouts/shortcodes/x-keyboard.html | 2 +- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/code/duck-typist.js b/code/duck-typist.js index 9b27ff9c..f0b4f2cc 100644 --- a/code/duck-typist.js +++ b/code/duck-typist.js @@ -96,7 +96,8 @@ window.addEventListener('DOMContentLoaded', () => { // fetch a kalamine keyboard layout const fetchLayout = () => { - return fetch(`../layouts/${gLayout.value}.json`) + const selected = gLayout.querySelector(`option[value="${gLayout.value}"`); + return fetch(`../layouts/${selected.dataset.folder}/${gLayout.value}.json`) .then(response => response.json()) .then(layout => { gKeyboard.setKeyboardLayout(layout.keymap, layout.deadkeys, gGeometry.value); diff --git a/www/layouts/shortcodes/x-keyboard.html b/www/layouts/shortcodes/x-keyboard.html index 5296c00e..c92f5076 100644 --- a/www/layouts/shortcodes/x-keyboard.html +++ b/www/layouts/shortcodes/x-keyboard.html @@ -36,7 +36,7 @@ {{ with .Get "data" }} - + {{ end }}