Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 10 additions & 0 deletions data/firmware.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -165,6 +165,16 @@ groups:
files:
- label: { ru: Скачать, en: Firmware }
url: https://github.com/ergohaven/vial-qmk/releases/download/4.0.6/4.0.6_k03pro_v2_v3.uf2
- id: qmk-hpd-classic
name: HPD Classic
picker_order: 29.5
instruction: qmk_split_new
description:
ru: 'Версия с несъёмными модулями: энкодер слева, трекбол справа'
en: 'Version with fixed modules: encoder on the left, trackball on the right'
files:
- label: { ru: Скачать, en: Download }
url: https://github.com/ergohaven/vial-qmk/releases/download/4.0.6/4.0.6_hpd_v2_enc_ball.uf2
- id: qmk-imperial44-v3-v4
name: Imperial44 v3/v4
picker_order: 26
Expand Down
3 changes: 3 additions & 0 deletions layouts/shortcodes/firmware-picker.html
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,9 @@
<section class="firmware-picker__device" data-firmware-device="{{ .picker_id | default .id }}" data-firmware-variant="{{ .firmware_type | default "" }}" hidden>
<p class="firmware-picker__group">{{ $groupName }}</p>
<p class="firmware-picker__device-name">{{ $deviceName }}</p>
{{- with .description }}
<p class="firmware-picker__description">{{ index . $lang | default (index . "en") }}</p>
{{- end }}
<div class="firmware-picker__downloads">
{{- range .files }}
{{- $managedReleaseURL := or (strings.HasPrefix .url "https://github.com/ergohaven/vial-qmk/releases/download/") (strings.HasPrefix .url "https://github.com/ergohaven/rmk/releases/download/") -}}
Expand Down
17 changes: 17 additions & 0 deletions scripts/test-firmware-picker.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -75,6 +75,23 @@ for (const page of pages) {
assert.equal(visible[0].dataset.firmwareDevice, option.dataset.firmwareValue);
assert.match(visible[0].textContent, /firmware-picker__instruction/);
}
choose('qmk-hpd-classic');
assert.equal(field.hidden, true, 'HPD Classic must have no firmware-type selection');
const classic = devices.filter(d => !d.hidden);
assert.equal(classic.length, 1);
const classicContent = classic[0].textContent;
assert.equal((classicContent.match(/class=["']?firmware-picker__download(?:["' >])/g) || []).length, 1);
assert.match(classicContent, /4\.0\.6_hpd_v2_enc_ball\.uf2/);
assert.match(classicContent, /<span>(?:Download|Скачать)<\/span>/);
assert.match(classicContent, /несъёмными модулями: энкодер слева, трекбол справа|fixed modules: encoder on the left, trackball on the right/);
choose('qmk-hpd-v2');
const hpd = devices.find(d => !d.hidden).textContent;
assert.equal((hpd.match(/class=["']?firmware-picker__download(?:["' >])/g) || []).length, 4, 'Preserve HPD v2 variants');
const stepsOf = text => text.match(/<ol[^>]*firmware-picker__instruction-steps[^>]*>([\s\S]*?)<\/ol>/)?.[1];
assert.ok(stepsOf(classicContent));
assert.equal(stepsOf(classicContent), stepsOf(hpd), 'Reuse HPD v2 flashing instructions');
search.value = 'HPD Classic'; search.listeners.input();
assert.ok(options.find(o => o.dataset.firmwareValue === 'qmk-hpd-classic' && !o.hidden), 'HPD Classic must be searchable');
choose('qmk-sm62');
assert.equal(field.hidden, true, 'SM62 is QMK-only');
const sm62 = devices.find(d => !d.hidden);
Expand Down
Loading