rb-document-form-constructor 0.6.1 → 0.6.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/rb-document-form-constructor.esm.js +29 -2
- package/dist/rb-document-form-constructor.min.js +2 -2
- package/dist/rb-document-form-constructor.ssr.js +47 -29
- package/dist/scss/_global.scss +3 -3
- package/dist/scss/_variables.scss +17 -17
- package/dist/scss/components/_doc-form.scss +36 -36
- package/dist/scss/components/_doc-template-constructor.scss +112 -112
- package/dist/scss/components/_doc-template-facet-list.scss +41 -41
- package/dist/scss/components/_doc-template-field-sidebar.scss +52 -52
- package/dist/scss/components/_field-rule-form-modal.scss +27 -27
- package/dist/scss/components.scss +7 -7
- package/package.json +63 -63
- package/src/components/DocForm.vue +202 -177
- package/src/components/DocTemplateConstructor.vue +250 -250
- package/src/components/DocTemplateFacetList.vue +119 -119
- package/src/components/DocTemplateFieldSidebar.vue +280 -280
- package/src/components/DocTemplateSectionModal.vue +63 -63
- package/src/components/FieldRuleFormModal.vue +272 -269
- package/src/assets/fontello/README.txt +0 -75
|
@@ -1,269 +1,272 @@
|
|
|
1
|
-
<template>
|
|
2
|
-
<b-modal :id="id"
|
|
3
|
-
:title="title"
|
|
4
|
-
modal-class="rb-field-rule-form-modal"
|
|
5
|
-
size="lg"
|
|
6
|
-
@ok.prevent="onOk"
|
|
7
|
-
ok-title="Сохранить правило"
|
|
8
|
-
cancel-variant="outline-gray"
|
|
9
|
-
cancel-title="Отмена">
|
|
10
|
-
<b-card no-body>
|
|
11
|
-
<b-tabs card @activate-tab="onActivateTab">
|
|
12
|
-
<b-tab title="Правило" active>
|
|
13
|
-
<b-form v-if="innerRule">
|
|
14
|
-
<b-form-row>
|
|
15
|
-
<b-col log="12">
|
|
16
|
-
<b-form-group label="Выбрать" v-if="rulePresets.length > 0">
|
|
17
|
-
<template #description>
|
|
18
|
-
Выберите готовое правило из списка и если нужно, измените
|
|
19
|
-
</template>
|
|
20
|
-
<b-form-select @input="onRuleSelected($event)">
|
|
21
|
-
<b-form-select-option v-for="r in rulePresets" :key="r.name"
|
|
22
|
-
:value="r.name">
|
|
23
|
-
{{r.labelRu}} ({{r.name}})
|
|
24
|
-
</b-form-select-option>
|
|
25
|
-
</b-form-select>
|
|
26
|
-
</b-form-group>
|
|
27
|
-
</b-col>
|
|
28
|
-
<b-col lg="12">
|
|
29
|
-
<b-form-group label="Название">
|
|
30
|
-
<template #description>
|
|
31
|
-
Задайте уникальное название, чтобы отличать правило в списке
|
|
32
|
-
</template>
|
|
33
|
-
<b-form-input v-model="innerRule.name"
|
|
34
|
-
:state="state.name"
|
|
35
|
-
:invalid-feedback="state.name_feedback"
|
|
36
|
-
></b-form-input>
|
|
37
|
-
</b-form-group>
|
|
38
|
-
</b-col>
|
|
39
|
-
<b-col lg="12">
|
|
40
|
-
<b-form-group label="Событие">
|
|
41
|
-
<template #description>
|
|
42
|
-
При возникновении этого события будет выполняться правило
|
|
43
|
-
</template>
|
|
44
|
-
<b-form-select v-model="innerRule.event"
|
|
45
|
-
:state="state.event"
|
|
46
|
-
:invalid-feedback="state.event_feedback">
|
|
47
|
-
<b-form-select-option :value="'input'">
|
|
48
|
-
Ввод значения
|
|
49
|
-
</b-form-select-option>
|
|
50
|
-
<b-form-select-option :value="'change'">
|
|
51
|
-
Изменение значения
|
|
52
|
-
</b-form-select-option>
|
|
53
|
-
<b-form-select-option :value="'click'">
|
|
54
|
-
Клик
|
|
55
|
-
</b-form-select-option>
|
|
56
|
-
<b-form-select-option :value="'validate'">
|
|
57
|
-
Валидация
|
|
58
|
-
</b-form-select-option>
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
<b-dropdown-item @click="addVariableToScript('
|
|
76
|
-
|
|
77
|
-
</b-dropdown-item>
|
|
78
|
-
<b-dropdown-item @click="addVariableToScript('
|
|
79
|
-
|
|
80
|
-
</b-dropdown-item>
|
|
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
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
</
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
import
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
return
|
|
148
|
-
},
|
|
149
|
-
|
|
150
|
-
return
|
|
151
|
-
}
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
this.state[field] =
|
|
175
|
-
this.state[`${field}_feedback`] =
|
|
176
|
-
}
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
},
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
|
|
215
|
-
|
|
216
|
-
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
this.innerRule.script =
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
this
|
|
259
|
-
this.
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
}
|
|
268
|
-
|
|
269
|
-
|
|
1
|
+
<template>
|
|
2
|
+
<b-modal :id="id"
|
|
3
|
+
:title="title"
|
|
4
|
+
modal-class="rb-field-rule-form-modal"
|
|
5
|
+
size="lg"
|
|
6
|
+
@ok.prevent="onOk"
|
|
7
|
+
ok-title="Сохранить правило"
|
|
8
|
+
cancel-variant="outline-gray"
|
|
9
|
+
cancel-title="Отмена">
|
|
10
|
+
<b-card no-body>
|
|
11
|
+
<b-tabs card @activate-tab="onActivateTab">
|
|
12
|
+
<b-tab title="Правило" active>
|
|
13
|
+
<b-form v-if="innerRule">
|
|
14
|
+
<b-form-row>
|
|
15
|
+
<b-col log="12">
|
|
16
|
+
<b-form-group label="Выбрать" v-if="rulePresets.length > 0">
|
|
17
|
+
<template #description>
|
|
18
|
+
Выберите готовое правило из списка и если нужно, измените
|
|
19
|
+
</template>
|
|
20
|
+
<b-form-select @input="onRuleSelected($event)">
|
|
21
|
+
<b-form-select-option v-for="r in rulePresets" :key="r.name"
|
|
22
|
+
:value="r.name">
|
|
23
|
+
{{r.labelRu}} ({{r.name}})
|
|
24
|
+
</b-form-select-option>
|
|
25
|
+
</b-form-select>
|
|
26
|
+
</b-form-group>
|
|
27
|
+
</b-col>
|
|
28
|
+
<b-col lg="12">
|
|
29
|
+
<b-form-group label="Название">
|
|
30
|
+
<template #description>
|
|
31
|
+
Задайте уникальное название, чтобы отличать правило в списке
|
|
32
|
+
</template>
|
|
33
|
+
<b-form-input v-model="innerRule.name"
|
|
34
|
+
:state="state.name"
|
|
35
|
+
:invalid-feedback="state.name_feedback"
|
|
36
|
+
></b-form-input>
|
|
37
|
+
</b-form-group>
|
|
38
|
+
</b-col>
|
|
39
|
+
<b-col lg="12">
|
|
40
|
+
<b-form-group label="Событие">
|
|
41
|
+
<template #description>
|
|
42
|
+
При возникновении этого события будет выполняться правило
|
|
43
|
+
</template>
|
|
44
|
+
<b-form-select v-model="innerRule.event"
|
|
45
|
+
:state="state.event"
|
|
46
|
+
:invalid-feedback="state.event_feedback">
|
|
47
|
+
<b-form-select-option :value="'input'">
|
|
48
|
+
Ввод значения
|
|
49
|
+
</b-form-select-option>
|
|
50
|
+
<b-form-select-option :value="'change'">
|
|
51
|
+
Изменение значения
|
|
52
|
+
</b-form-select-option>
|
|
53
|
+
<b-form-select-option :value="'click'">
|
|
54
|
+
Клик
|
|
55
|
+
</b-form-select-option>
|
|
56
|
+
<b-form-select-option :value="'validate'">
|
|
57
|
+
Валидация
|
|
58
|
+
</b-form-select-option>
|
|
59
|
+
<b-form-select-option :value="'defaultValue'">
|
|
60
|
+
Установить значение по умолчанию
|
|
61
|
+
</b-form-select-option>
|
|
62
|
+
</b-form-select>
|
|
63
|
+
</b-form-group>
|
|
64
|
+
</b-col>
|
|
65
|
+
<b-col lg="12">
|
|
66
|
+
<b-form-group label="Скрипт">
|
|
67
|
+
<template #description>
|
|
68
|
+
Здесь указывается скрипт правила. Скрипт должен быть написан на языке
|
|
69
|
+
javascript
|
|
70
|
+
</template>
|
|
71
|
+
<div class="rb-script-input">
|
|
72
|
+
<b-button-toolbar>
|
|
73
|
+
<b-dropdown text="Переменные" variant="outline-secondary"
|
|
74
|
+
size="sm" class="mx-1">
|
|
75
|
+
<b-dropdown-item @click="addVariableToScript('doc')">
|
|
76
|
+
Документ
|
|
77
|
+
</b-dropdown-item>
|
|
78
|
+
<b-dropdown-item @click="addVariableToScript('form')">
|
|
79
|
+
Форма
|
|
80
|
+
</b-dropdown-item>
|
|
81
|
+
<b-dropdown-item @click="addVariableToScript('event')">
|
|
82
|
+
Значение события
|
|
83
|
+
</b-dropdown-item>
|
|
84
|
+
</b-dropdown>
|
|
85
|
+
<b-dropdown text="Задать значение" variant="outline-secondary"
|
|
86
|
+
size="sm" class="mx-1">
|
|
87
|
+
<b-dropdown-item v-for="f in fields" :key="f.name"
|
|
88
|
+
v-if="fields" @click="addSetVariableToScript(f)">
|
|
89
|
+
{{f.labelRu}} ({{f.name}})
|
|
90
|
+
</b-dropdown-item>
|
|
91
|
+
</b-dropdown>
|
|
92
|
+
<b-dropdown text="Вызвать функцию инпута" variant="outline-secondary"
|
|
93
|
+
size="sm" class="mx-1">
|
|
94
|
+
<b-dropdown-item v-for="f in fields" :key="f.name"
|
|
95
|
+
v-if="fields" @click="addCallInputFunction(f)">
|
|
96
|
+
{{f.labelRu}} ({{f.name}})
|
|
97
|
+
</b-dropdown-item>
|
|
98
|
+
</b-dropdown>
|
|
99
|
+
</b-button-toolbar>
|
|
100
|
+
<b-form-textarea v-model="innerRule.script"
|
|
101
|
+
:state="state.script"
|
|
102
|
+
:invalid-feedback="state.script_feedback"
|
|
103
|
+
rows="8"
|
|
104
|
+
ref="scriptInput"
|
|
105
|
+
></b-form-textarea>
|
|
106
|
+
</div>
|
|
107
|
+
</b-form-group>
|
|
108
|
+
</b-col>
|
|
109
|
+
</b-form-row>
|
|
110
|
+
</b-form>
|
|
111
|
+
</b-tab>
|
|
112
|
+
<b-tab title="Протестировать правило" v-if="innerFormConfig">
|
|
113
|
+
<doc-form :form-config="innerFormConfig">
|
|
114
|
+
</doc-form>
|
|
115
|
+
</b-tab>
|
|
116
|
+
</b-tabs>
|
|
117
|
+
</b-card>
|
|
118
|
+
</b-modal>
|
|
119
|
+
</template>
|
|
120
|
+
|
|
121
|
+
<script>
|
|
122
|
+
import {UtFormConfig} from "../utils/UtFormConfig";
|
|
123
|
+
import {v4 as uuidv4} from 'uuid';
|
|
124
|
+
import {UtFormConstructor} from "../utils/UtFormConstructor";
|
|
125
|
+
import DocForm from "./DocForm";
|
|
126
|
+
|
|
127
|
+
export default {
|
|
128
|
+
name: 'FieldRuleFormModal',
|
|
129
|
+
components: {DocForm},
|
|
130
|
+
props: {
|
|
131
|
+
field: Object,
|
|
132
|
+
rule: Object,
|
|
133
|
+
formConfig: Object,
|
|
134
|
+
mode: {type: String, default: 'ins'},
|
|
135
|
+
onAfterOk: Function,
|
|
136
|
+
},
|
|
137
|
+
data() {
|
|
138
|
+
return {
|
|
139
|
+
id: 'rb-field-rule-form-modal',
|
|
140
|
+
state: this.getDefaultState(),
|
|
141
|
+
innerFormConfig: null,
|
|
142
|
+
innerRule: null,
|
|
143
|
+
}
|
|
144
|
+
},
|
|
145
|
+
computed: {
|
|
146
|
+
title() {
|
|
147
|
+
return this.mode === 'ins' ? 'Добавление правила' : 'Редактирование правила';
|
|
148
|
+
},
|
|
149
|
+
fields() {
|
|
150
|
+
return UtFormConfig.getFields(this.formConfig);
|
|
151
|
+
},
|
|
152
|
+
rulePresets() {
|
|
153
|
+
return UtFormConstructor.getAvailableFieldRules(this.field);
|
|
154
|
+
}
|
|
155
|
+
},
|
|
156
|
+
watch: {
|
|
157
|
+
formConfig() {
|
|
158
|
+
this.copyToInnerFormConfig();
|
|
159
|
+
},
|
|
160
|
+
rule() {
|
|
161
|
+
if (this.rule) {
|
|
162
|
+
this.innerRule = this.rule;
|
|
163
|
+
} else {
|
|
164
|
+
this.innerRule = this.getDefaultRule();
|
|
165
|
+
}
|
|
166
|
+
|
|
167
|
+
}
|
|
168
|
+
},
|
|
169
|
+
methods: {
|
|
170
|
+
validateFields(fieldName) {
|
|
171
|
+
let fields = fieldName ? [fieldName] : ['name', 'event', 'script'];
|
|
172
|
+
fields.forEach(field => {
|
|
173
|
+
if (!this.innerRule[field]) {
|
|
174
|
+
this.state[field] = false;
|
|
175
|
+
this.state[`${field}_feedback`] = 'Заполните название';
|
|
176
|
+
} else {
|
|
177
|
+
this.state[field] = true;
|
|
178
|
+
this.state[`${field}_feedback`] = null;
|
|
179
|
+
}
|
|
180
|
+
});
|
|
181
|
+
},
|
|
182
|
+
copyToInnerFormConfig() {
|
|
183
|
+
this.innerFormConfig = JSON.parse(JSON.stringify(this.formConfig));
|
|
184
|
+
},
|
|
185
|
+
applyRuleToInnerFormConfig() {
|
|
186
|
+
if (this.innerFormConfig) {
|
|
187
|
+
let foundRule = UtFormConfig.findRule(this.innerRule.id, this.innerFormConfig);
|
|
188
|
+
|
|
189
|
+
if (!foundRule) {
|
|
190
|
+
let foundField = UtFormConfig.findField(
|
|
191
|
+
this.field.name, this.innerFormConfig
|
|
192
|
+
);
|
|
193
|
+
|
|
194
|
+
if (foundField) {
|
|
195
|
+
foundField.rules = foundField.rules ? foundField.rules : [];
|
|
196
|
+
foundField.rules.push(this.rule);
|
|
197
|
+
}
|
|
198
|
+
} else {
|
|
199
|
+
Object.assign(foundRule, this.innerRule);
|
|
200
|
+
}
|
|
201
|
+
}
|
|
202
|
+
},
|
|
203
|
+
onActivateTab(index) {
|
|
204
|
+
if (index > 0) {
|
|
205
|
+
this.copyToInnerFormConfig();
|
|
206
|
+
this.applyRuleToInnerFormConfig();
|
|
207
|
+
}
|
|
208
|
+
},
|
|
209
|
+
getDefaultState() {
|
|
210
|
+
return {
|
|
211
|
+
name: null,
|
|
212
|
+
event: null,
|
|
213
|
+
script: null,
|
|
214
|
+
}
|
|
215
|
+
},
|
|
216
|
+
getDefaultRule() {
|
|
217
|
+
return {
|
|
218
|
+
id: uuidv4(),
|
|
219
|
+
name: null,
|
|
220
|
+
event: null,
|
|
221
|
+
script: null,
|
|
222
|
+
}
|
|
223
|
+
},
|
|
224
|
+
resetModal() {
|
|
225
|
+
this.state = this.getDefaultState();
|
|
226
|
+
this.innerRule = null;
|
|
227
|
+
},
|
|
228
|
+
addVariableToScript(varName) {
|
|
229
|
+
let caretPosition = this.$refs.scriptInput.selectionStart;
|
|
230
|
+
this.insertTextToScript(varName, caretPosition);
|
|
231
|
+
},
|
|
232
|
+
addSetVariableToScript(field) {
|
|
233
|
+
let caretPosition = this.$refs.scriptInput.selectionStart;
|
|
234
|
+
this.insertTextToScript(`doc['${field.name}'] = Значение;`, caretPosition);
|
|
235
|
+
},
|
|
236
|
+
addCallInputFunction(field) {
|
|
237
|
+
let caretPosition = this.$refs.scriptInput.selectionStart;
|
|
238
|
+
this.insertTextToScript(`form.$refs['${field.name}'][0].Название функции();`, caretPosition);
|
|
239
|
+
},
|
|
240
|
+
insertTextToScript(text, position) {
|
|
241
|
+
position = position != null? position: this.script.length;
|
|
242
|
+
this.innerRule.script = this.innerRule.script != null? this.innerRule.script: '';
|
|
243
|
+
let scriptSplit = this.innerRule.script.split('');
|
|
244
|
+
scriptSplit.splice(position, 0, text);
|
|
245
|
+
this.innerRule.script = scriptSplit.join('');
|
|
246
|
+
},
|
|
247
|
+
onRuleSelected(ruleName) {
|
|
248
|
+
let rule = this.rulePresets.find(rule => rule.name === ruleName);
|
|
249
|
+
if(rule) {
|
|
250
|
+
Object.assign(this.innerRule, rule);
|
|
251
|
+
this.innerRule.script = this.innerRule.script.trim();
|
|
252
|
+
}
|
|
253
|
+
},
|
|
254
|
+
onOk() {
|
|
255
|
+
this.validateFields();
|
|
256
|
+
|
|
257
|
+
if (this.state.name && this.state.script) {
|
|
258
|
+
if (this.onAfterOk) {
|
|
259
|
+
this.onAfterOk(this.innerRule);
|
|
260
|
+
}
|
|
261
|
+
this.$nextTick(() => {
|
|
262
|
+
this.resetModal();
|
|
263
|
+
this.$bvModal.hide(this.id);
|
|
264
|
+
});
|
|
265
|
+
}
|
|
266
|
+
}
|
|
267
|
+
},
|
|
268
|
+
created() {
|
|
269
|
+
this.copyToInnerFormConfig();
|
|
270
|
+
}
|
|
271
|
+
}
|
|
272
|
+
</script>
|
|
@@ -1,75 +0,0 @@
|
|
|
1
|
-
This webfont is generated by https://fontello.com open source project.
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
================================================================================
|
|
5
|
-
Please, note, that you should obey original font licenses, used to make this
|
|
6
|
-
webfont pack. Details available in LICENSE.txt file.
|
|
7
|
-
|
|
8
|
-
- Usually, it's enough to publish content of LICENSE.txt file somewhere on your
|
|
9
|
-
site in "About" section.
|
|
10
|
-
|
|
11
|
-
- If your project is open-source, usually, it will be ok to make LICENSE.txt
|
|
12
|
-
file publicly available in your repository.
|
|
13
|
-
|
|
14
|
-
- Fonts, used in Fontello, don't require a clickable link on your site.
|
|
15
|
-
But any kind of additional authors crediting is welcome.
|
|
16
|
-
================================================================================
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
Comments on archive content
|
|
20
|
-
---------------------------
|
|
21
|
-
|
|
22
|
-
- /font/* - fonts in different formats
|
|
23
|
-
|
|
24
|
-
- /css/* - different kinds of css, for all situations. Should be ok with
|
|
25
|
-
twitter bootstrap. Also, you can skip <i> style and assign icon classes
|
|
26
|
-
directly to text elements, if you don't mind about IE7.
|
|
27
|
-
|
|
28
|
-
- demo.html - demo file, to show your webfont content
|
|
29
|
-
|
|
30
|
-
- LICENSE.txt - license info about source fonts, used to build your one.
|
|
31
|
-
|
|
32
|
-
- config.json - keeps your settings. You can import it back into fontello
|
|
33
|
-
anytime, to continue your work
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
Why so many CSS files ?
|
|
37
|
-
-----------------------
|
|
38
|
-
|
|
39
|
-
Because we like to fit all your needs :)
|
|
40
|
-
|
|
41
|
-
- basic file, <your_font_name>.css - is usually enough, it contains @font-face
|
|
42
|
-
and character code definitions
|
|
43
|
-
|
|
44
|
-
- *-ie7.css - if you need IE7 support, but still don't wish to put char codes
|
|
45
|
-
directly into html
|
|
46
|
-
|
|
47
|
-
- *-codes.css and *-ie7-codes.css - if you like to use your own @font-face
|
|
48
|
-
rules, but still wish to benefit from css generation. That can be very
|
|
49
|
-
convenient for automated asset build systems. When you need to update font -
|
|
50
|
-
no need to manually edit files, just override old version with archive
|
|
51
|
-
content. See fontello source code for examples.
|
|
52
|
-
|
|
53
|
-
- *-embedded.css - basic css file, but with embedded WOFF font, to avoid
|
|
54
|
-
CORS issues in Firefox and IE9+, when fonts are hosted on the separate domain.
|
|
55
|
-
We strongly recommend to resolve this issue by `Access-Control-Allow-Origin`
|
|
56
|
-
server headers. But if you ok with dirty hack - this file is for you. Note,
|
|
57
|
-
that data url moved to separate @font-face to avoid problems with <IE9, when
|
|
58
|
-
string is too long.
|
|
59
|
-
|
|
60
|
-
- animate.css - use it to get ideas about spinner rotation animation.
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
Attention for server setup
|
|
64
|
-
--------------------------
|
|
65
|
-
|
|
66
|
-
You MUST setup server to reply with proper `mime-types` for font files -
|
|
67
|
-
otherwise some browsers will fail to show fonts.
|
|
68
|
-
|
|
69
|
-
Usually, `apache` already has necessary settings, but `nginx` and other
|
|
70
|
-
webservers should be tuned. Here is list of mime types for our file extensions:
|
|
71
|
-
|
|
72
|
-
- `application/vnd.ms-fontobject` - eot
|
|
73
|
-
- `application/x-font-woff` - woff
|
|
74
|
-
- `application/x-font-ttf` - ttf
|
|
75
|
-
- `image/svg+xml` - svg
|