diff --git a/js/editor.js b/js/editor.js index 64bfe25..06300aa 100644 --- a/js/editor.js +++ b/js/editor.js @@ -124,8 +124,10 @@ function setForm(cardTemplate, card) { let label = div.appendChild(document.createElement('label')); label.textContent = prop[0]; - let input = label.appendChild(document.createElement('input')); + let input = label.appendChild( + document.createElement(prop[1] === 'textarea' ? 'textarea' : 'input')); input.id = "card-" + prop[0]; + if (prop[1] === "image") { input.type = "file"; } diff --git a/template/environment/input.json b/template/environment/input.json index 1c08284..a11ea81 100644 --- a/template/environment/input.json +++ b/template/environment/input.json @@ -4,8 +4,8 @@ "inputs": { "name": "text", "keywords": "text", - "text": "text", - "flavor": "text", + "text": "textarea", + "flavor": "textarea", "artist": "text", "hp": "number", "image": "image"