initial import

This commit is contained in:
www-data
2026-05-25 13:47:46 +02:00
parent 3e7f238cf4
commit 97f23260ed
32 changed files with 8898 additions and 0 deletions
+45
View File
@@ -0,0 +1,45 @@
(function () {
'use strict';
function byId(id) {
return document.getElementById(id);
}
function renderPrompt(data, select, output) {
const selectedId = select.value;
const prompt = (data.prompts || []).find(function (item) {
return String(item.id) === String(selectedId);
});
if (!prompt) {
output.value = '';
return;
}
output.value = String(prompt.content || '').split('{{bootstrap-racket-link}}').join(data.link || '');
}
document.addEventListener('DOMContentLoaded', function () {
const dataEl = byId('bootstrapPromptData');
const select = byId('bootstrapPromptSelect');
const output = byId('bootstrapPromptOutput');
if (!dataEl || !select || !output) {
return;
}
let data = { link: '', prompts: [] };
try {
data = JSON.parse(dataEl.textContent || '{}');
} catch (e) {
data = { link: '', prompts: [] };
}
select.addEventListener('change', function () {
renderPrompt(data, select, output);
});
renderPrompt(data, select, output);
});
}());