Skip to content

Commit 0833f83

Browse files
bugfix: proper keyboard layout paths (#274)
1 parent 7908202 commit 0833f83

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

code/duck-typist.js

+2-1
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,8 @@ window.addEventListener('DOMContentLoaded', () => {
9696

9797
// fetch a kalamine keyboard layout
9898
const fetchLayout = () => {
99-
return fetch(`../layouts/${gLayout.value}.json`)
99+
const selected = gLayout.querySelector(`option[value="${gLayout.value}"`);
100+
return fetch(`../layouts/${selected.dataset.folder}/${gLayout.value}.json`)
100101
.then(response => response.json())
101102
.then(layout => {
102103
gKeyboard.setKeyboardLayout(layout.keymap, layout.deadkeys, gGeometry.value);

www/layouts/shortcodes/x-keyboard.html

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
{{ with .Get "data" }}
3737
<dialog>
3838
<input spellcheck="false" placeholder="zone de saisie {{ $name }}" />
39-
<x-keyboard src="/layouts/{{ . }}.json"></x-keyboard>
39+
<x-keyboard src="/layouts/fr/{{ . }}.json"></x-keyboard>
4040
</dialog>
4141
{{ end }}
4242
<nav>

0 commit comments

Comments
 (0)