Now asking whether to omit the Makefile

This commit is contained in:
2025-10-07 16:42:01 +02:00
parent 85e286c2c5
commit 14c347b2f1
2 changed files with 53 additions and 6 deletions

26
ui.js
View File

@@ -178,7 +178,7 @@ async function assignment_layout(content, result) {
}
}
async function finishing_touches_layout(content, result) {
async function other_details_layout(content, result) {
content.appendChild(new BinaryInputBuilder(result, "has_keywords")
.label("Vložit klíčová slova")
.finish());
@@ -191,6 +191,30 @@ async function finishing_touches_layout(content, result) {
.finish());
}
async function toolchain_layout(content, result) {
if(!Object.keys(toolchains).includes(result.toolchain)) {
document.querySelector("#next-button").disabled = true;
}
let buttons = new ButtonListBuilder(Object.keys(toolchains))
.should_be_pressed((key) => result.toolchain == key)
.modify((b, key) => b.class("wide").text(toolchains[key].name))
.on_click((key) => {
result.toolchain = key;
document.querySelector("#next-button").disabled = false;
})
.finish();
for(const button of buttons) {
content.appendChild(button);
}
content.appendChild(new ElementBuilder("div.vertical-spacer").finish());
content.appendChild(new ElementBuilder("div.hint")
.text("Toto rozhodnutí pouze ovlivní, zda výsledná šablona bude obsahovat soubor Makefile pro jednodušší použití s příkazovou řádkou. Webový editor Typstu tento soubor nepotřebuje.")
.finish());
}
async function run() {
startbutton.style.cursor = "auto";
startbutton.disabled = true;