From 29b3b70738ed3f5b9625f7febedcf9192401de7e Mon Sep 17 00:00:00 2001 From: Adam Goldsmith Date: Mon, 9 Oct 2017 03:27:42 -0400 Subject: [PATCH] Use `textarea`s for block text --- js/editor.js | 4 +++- template/environment/input.json | 4 ++-- 2 files changed, 5 insertions(+), 3 deletions(-) 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"