-
Notifications
You must be signed in to change notification settings - Fork 0
/
editor.js
97 lines (95 loc) · 2.38 KB
/
editor.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
JSONEditor.defaults.options.theme = "bootstrap3";
JSONEditor.defaults.options.iconlib = "fontawesome4";
JSONEditor.defaults.options.disable_collapse = true;
JSONEditor.defaults.options.show_errors = "change";
JSONEditor.defaults.options.disable_edit_json = true;
JSONEditor.defaults.options.disable_properties = true;
exports.editor = new JSONEditor(document.getElementById("editor_holder"), {
schema: {
title: "Book",
type: "object",
properties: {
title: {
type: "string",
description: "* Titolo del libro",
minLength: 1
},
description: {
type: "string",
format: "textarea",
description: "Sinossi"
},
publisher: {
type: "string",
description: "* Editore",
minLength: 1
},
language: {
type: "string",
description: "Lingua ISO 639-2 (ita, eng, fra, ger)"
},
subject: {
type: "string",
description: "Soggetti o keywords (separati da virgola)"
},
rights: {
type: "string",
enum: ["", "open access", "closed access"],
description: "Licenza"
},
date: {
type: "string",
description: "* Data di pubblicazione",
minLength: 1
},
creator: {
type: "array",
minItems: 1,
format: "table",
title: "Creators",
uniqueItems: true,
items: {
type: "object",
title: "Creator",
properties: {
type: {
type: "string",
enum: ["author", "translator", "contributor"],
default: "author"
},
name: {
type: "string",
description: "Nome e cognome"
}
}
}
},
identifiers: {
type: "array",
minItems: 1,
maxItems: 4,
format: "table",
title: "Identifiers",
uniqueItems: true,
items: {
type: "object",
title: "Identifier",
properties: {
type: {
type: "string",
enum: ["URL", "ISBN", "ISSN", "DOI", "other"],
default: "URL"
},
ID:
{
type: "string",
minLength: 1
}
},
required: ["type"],
additionalProperties: false
}
}
}
}
});