Skip to content

Commit

Permalink
bugfix: proper keyboard layout paths (#274)
Browse files Browse the repository at this point in the history
  • Loading branch information
fabi1cazenave authored Nov 11, 2024
1 parent 7908202 commit 0833f83
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 2 deletions.
3 changes: 2 additions & 1 deletion code/duck-typist.js
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
2 changes: 1 addition & 1 deletion www/layouts/shortcodes/x-keyboard.html
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
{{ with .Get "data" }}
<dialog>
<input spellcheck="false" placeholder="zone de saisie {{ $name }}" />
<x-keyboard src="/layouts/{{ . }}.json"></x-keyboard>
<x-keyboard src="/layouts/fr/{{ . }}.json"></x-keyboard>
</dialog>
{{ end }}
<nav>
Expand Down

0 comments on commit 0833f83

Please sign in to comment.