Skip to content

Commit ef4fd4b

Browse files
author
Omri Schwarz
committed
media keyword handling
1 parent 15354b3 commit ef4fd4b

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/js/brutusin-json-forms.js

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -153,6 +153,8 @@ if (typeof brutusin === "undefined") {
153153
};
154154

155155
renderers["string"] = function (container, id, parentObject, propertyProvider, value) {
156+
/// TODO change the handler for when there is a 'media'
157+
/// specifier so it becomes a file element.
156158
var schemaId = getSchemaId(id);
157159
var s = getSchema(schemaId);
158160
var input;
@@ -161,6 +163,11 @@ if (typeof brutusin === "undefined") {
161163
if (value) {
162164
input.value = JSON.stringify(value, null, 4);
163165
}
166+
} else if (s.media) {
167+
input = document.createElement("input");
168+
input.type = "file";
169+
appendChild(input, option, s);
170+
// TODO, encode the SOB properly.
164171
} else if (s.enum) {
165172
input = document.createElement("select");
166173
if (!s.required) {

0 commit comments

Comments
 (0)