forked from inveniosoftware-contrib/ng2-json-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathapp.config.ts
112 lines (110 loc) · 2.72 KB
/
app.config.ts
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
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
import { Injectable } from '@angular/core';
import { JsonEditorConfig } from '../../dist';
@Injectable()
export class AppConfig {
jsonEditorConfig: JsonEditorConfig = {
schemaOptions: {
'': {
alwaysShow: ['deleted']
},
'/$schema': {
hidden: true
},
'/deleted': {
toggleColor: '#e74c3c'
},
'/citeable': {
toggleColor: '#3498db'
},
'/core': {
toggleColor: '#27ae60'
},
'/authors/items': {
order: ['full_name', 'affiliations'],
alwaysShow: ['credit_roles']
},
'/authors/items/properties/ids': {
disabled: true
},
'/references': {
sortable: true,
longListNavigatorConfig: {
findSingle: (value, expression) => {
return value.getIn(['reference', 'number']) === parseInt(expression, 10);
},
findMultiple: (value, expression) => {
return JSON.stringify(value).search(expression) > -1;
},
itemsPerPage: 20,
maxVisiblePageCount: 5
},
viewTemplateConfig: {
itemTemplateName: 'referenceTemplate',
showEditForm: (value) => {
return !(value.hasIn(['record', '$ref']));
}
}
},
'/arxiv_eprints/items/properties/value': {
linkBuilder: (value: any) => {
return `http://arxiv.org/abs/${value}`;
},
},
'/abstracts/items/properties/source': {
columnWidth: 20
},
'/publication_info/items/properties/conference_record': {
refFieldConfig: {
anchorBuilder: (url) => {
let parts = url.split('/');
let type = parts[parts.length - 2].slice(0, -1);
let display = `View ${type}`;
let href = url.replace(/\/api\//, '/');
return { href, display };
}
}
},
'/titles/items/properties/title': {
latexPreviewEnabled: true
},
'/abstracts/items/properties/value': {
latexPreviewEnabled: true
}
},
shortcuts: {
navigateLeft: {
key: 'mod+left'
},
navigateRight: {
key: 'mod+right'
}
},
enableAdminModeSwitch: true,
menuMaxDepth: 1,
tabsConfig: {
defaultTabName: 'Main',
tabs: [
{
name: 'References',
properties: ['references']
},
{
name: 'Authors',
properties: [
'collaboration',
'accelerator_experiments',
'authors',
'corporate_author'
]
}
]
},
previews: [
{
name: 'pdf',
type: 'html',
urlPath: '/urls/0/value'
}
]
};
}