textbrowser 0.45.1 → 0.46.0
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/.eslintrc.cjs +3 -0
- package/CHANGES.md +13 -0
- package/README.md +19 -15
- package/dist/WorkInfo-es.js +2126 -3647
- package/dist/index-es.js +12425 -13756
- package/dist/index-es.min.js +11 -16
- package/locales/ar.json +211 -209
- package/locales/en-US.json +212 -209
- package/locales/fa.json +211 -209
- package/locales/ru.json +211 -209
- package/package.json +44 -45
- package/resources/index.js +72 -50
- package/resources/resultsDisplay.js +41 -31
- package/resources/templates/index.js +133 -120
- package/resources/templates/resultsDisplayClient.js +2 -0
- package/resources/templates/workDisplay.js +195 -174
- package/resources/templates/workSelect.js +7 -7
- package/resources/user-sample.js +0 -2
- package/resources/user.js +0 -2
- package/resources/utils/IntlURLSearchParams.js +1 -1
- package/resources/utils/Languages.js +9 -4
- package/resources/utils/Metadata.js +14 -9
- package/resources/utils/Params.js +11 -9
- package/resources/utils/Plugin.js +4 -4
- package/resources/utils/WorkInfo.js +28 -13
- package/resources/utils/dialogs.js +8 -6
- package/resources/utils/getLocaleFallbackResults.js +26 -0
- package/resources/vendor/json-refs-min.js +15 -0
- package/resources/workDisplay.js +52 -46
- package/resources/workSelect.js +44 -23
- package/server/main.js +45 -32
- package/sw-sample.js +1 -1
- package/resources/utils/getIMFFallbackResults.js +0 -47
|
@@ -21,7 +21,7 @@ export default {
|
|
|
21
21
|
// seemed to have issues in Firefox)
|
|
22
22
|
['div', {style: 'display: inline; direction: ' + fallbackDirection}, [message]],
|
|
23
23
|
columnsTable: ({
|
|
24
|
-
|
|
24
|
+
lDirectional, fieldInfo, $p, lElement, lIndexedParam, l,
|
|
25
25
|
metadataObj, preferredLocale, schemaItems,
|
|
26
26
|
fieldMatchesLocale
|
|
27
27
|
}) => ['table', {
|
|
@@ -29,25 +29,25 @@ export default {
|
|
|
29
29
|
}, [
|
|
30
30
|
['tr', [
|
|
31
31
|
['th', [
|
|
32
|
-
|
|
32
|
+
lDirectional('fieldno')
|
|
33
33
|
]],
|
|
34
34
|
['th', {align: 'left', width: '20'}, [
|
|
35
|
-
|
|
35
|
+
lDirectional('field_enabled')
|
|
36
36
|
]],
|
|
37
37
|
['th', [
|
|
38
|
-
|
|
38
|
+
lDirectional('field_title')
|
|
39
39
|
]],
|
|
40
40
|
['th', [
|
|
41
|
-
|
|
41
|
+
lDirectional('fieldinterlin')
|
|
42
42
|
]],
|
|
43
43
|
['th', [
|
|
44
|
-
|
|
44
|
+
lDirectional('fieldcss')
|
|
45
45
|
]]
|
|
46
46
|
/*
|
|
47
47
|
Todo: Support search?
|
|
48
48
|
,
|
|
49
49
|
['th', [
|
|
50
|
-
|
|
50
|
+
lDirectional('fieldsearch')
|
|
51
51
|
]]
|
|
52
52
|
*/
|
|
53
53
|
]],
|
|
@@ -60,18 +60,18 @@ export default {
|
|
|
60
60
|
// Todo: Get Jamilih to accept numbers and
|
|
61
61
|
// booleans (`toString` is too dangerous)
|
|
62
62
|
['td', [String(idx)]],
|
|
63
|
-
|
|
64
|
-
|
|
63
|
+
lElement('check-columns-to-browse', 'td', 'title', {}, [
|
|
64
|
+
lElement('yes', 'input', 'value', {
|
|
65
65
|
class: 'fieldSelector',
|
|
66
66
|
id: checkedIndex,
|
|
67
|
-
name:
|
|
67
|
+
name: lIndexedParam('checked') + idx,
|
|
68
68
|
checked: $p.get(checkedIndex) !== l('no') &&
|
|
69
69
|
($p.has(checkedIndex) || fieldInfoItem.onByDefault !== false),
|
|
70
70
|
type: 'checkbox'
|
|
71
71
|
})
|
|
72
72
|
]),
|
|
73
|
-
|
|
74
|
-
['select', {name:
|
|
73
|
+
lElement('check-sequence', 'td', 'title', {}, [
|
|
74
|
+
['select', {name: lIndexedParam('field') + idx, id: fieldIndex, size: '1'},
|
|
75
75
|
fieldInfo.map(({field, fieldAliasOrName}, j) => {
|
|
76
76
|
const matchedFieldParam = fieldParam && fieldParam === fieldAliasOrName;
|
|
77
77
|
return ['option', {
|
|
@@ -86,25 +86,25 @@ export default {
|
|
|
86
86
|
]
|
|
87
87
|
]),
|
|
88
88
|
['td', [ // Todo: Make as tag selector with fields as options
|
|
89
|
-
|
|
90
|
-
name:
|
|
89
|
+
lElement('interlinear-tips', 'input', 'title', {
|
|
90
|
+
name: lIndexedParam('interlin') + idx,
|
|
91
91
|
value: $p.get('interlin' + idx)
|
|
92
92
|
}) // Todo: Could allow i18n of numbers here
|
|
93
93
|
]],
|
|
94
94
|
['td', [ // Todo: Make as CodeMirror-highlighted CSS
|
|
95
|
-
['input', {name:
|
|
95
|
+
['input', {name: lIndexedParam('css') + idx, value: $p.get('css' + idx)}]
|
|
96
96
|
]]
|
|
97
97
|
/*
|
|
98
98
|
,
|
|
99
99
|
['td', [ // Todo: Allow plain or regexp searching
|
|
100
|
-
['input', {name:
|
|
100
|
+
['input', {name: lIndexedParam('search') + idx, value: $p.get('search' + idx)}]
|
|
101
101
|
]]
|
|
102
102
|
*/
|
|
103
103
|
]];
|
|
104
104
|
}),
|
|
105
105
|
['tr', [
|
|
106
106
|
['td', {colspan: 3}, [
|
|
107
|
-
|
|
107
|
+
lElement('check_all', 'input', 'value', {
|
|
108
108
|
type: 'button',
|
|
109
109
|
$on: {
|
|
110
110
|
click () {
|
|
@@ -114,7 +114,7 @@ export default {
|
|
|
114
114
|
}
|
|
115
115
|
}
|
|
116
116
|
}),
|
|
117
|
-
|
|
117
|
+
lElement('uncheck_all', 'input', 'value', {
|
|
118
118
|
type: 'button',
|
|
119
119
|
$on: {
|
|
120
120
|
click () {
|
|
@@ -124,7 +124,7 @@ export default {
|
|
|
124
124
|
}
|
|
125
125
|
}
|
|
126
126
|
}),
|
|
127
|
-
|
|
127
|
+
lElement('checkmark_locale_fields_only', 'input', 'value', {
|
|
128
128
|
type: 'button',
|
|
129
129
|
$on: {
|
|
130
130
|
click () {
|
|
@@ -141,25 +141,28 @@ export default {
|
|
|
141
141
|
]]
|
|
142
142
|
]]
|
|
143
143
|
]],
|
|
144
|
-
advancedFormatting: ({
|
|
144
|
+
advancedFormatting: ({lDirectional, lParam, l, lOption, lElement, $p, hideFormattingSection}) => ['td', {
|
|
145
145
|
id: 'advancedformatting', style: {display: (hideFormattingSection ? 'none' : 'block')}
|
|
146
146
|
}, [
|
|
147
|
-
['h3', [
|
|
147
|
+
['h3', [lDirectional('advancedformatting')]],
|
|
148
148
|
['label', [
|
|
149
|
-
|
|
150
|
-
['select', {name:
|
|
151
|
-
const atts = {
|
|
149
|
+
lDirectional('textcolor'), nbsp2,
|
|
150
|
+
['select', {name: lParam('colorName')}, colors.map((color, i) => {
|
|
151
|
+
const atts = {
|
|
152
|
+
value: l(['param_values', 'colors', color]),
|
|
153
|
+
selected: null
|
|
154
|
+
};
|
|
152
155
|
if ($p.get('colorName') === l(['param_values', 'colors', color]) ||
|
|
153
156
|
(i === 1 && !$p.has('colorName'))) {
|
|
154
157
|
atts.selected = 'selected';
|
|
155
158
|
}
|
|
156
|
-
return
|
|
159
|
+
return lOption(['param_values', 'colors', color], atts);
|
|
157
160
|
})]
|
|
158
161
|
]],
|
|
159
162
|
['label', [
|
|
160
|
-
nbsp,
|
|
163
|
+
nbsp, lDirectional('or_entercolor'), nbsp2,
|
|
161
164
|
['input', {
|
|
162
|
-
name:
|
|
165
|
+
name: lParam('color'),
|
|
163
166
|
type: 'text',
|
|
164
167
|
value: ($p.get('color') || '#'),
|
|
165
168
|
size: '7',
|
|
@@ -167,20 +170,23 @@ export default {
|
|
|
167
170
|
]],
|
|
168
171
|
['br'], ['br'],
|
|
169
172
|
['label', [
|
|
170
|
-
|
|
171
|
-
['select', {name:
|
|
172
|
-
const atts = {
|
|
173
|
+
lDirectional('backgroundcolor'), nbsp2,
|
|
174
|
+
['select', {name: lParam('bgcolorName')}, colors.map((color, i) => {
|
|
175
|
+
const atts = {
|
|
176
|
+
value: l(['param_values', 'colors', color]),
|
|
177
|
+
selected: null
|
|
178
|
+
};
|
|
173
179
|
if ($p.get('bgcolorName') === l(['param_values', 'colors', color]) ||
|
|
174
180
|
(i === 14 && !$p.has('bgcolorName'))) {
|
|
175
181
|
atts.selected = 'selected';
|
|
176
182
|
}
|
|
177
|
-
return
|
|
183
|
+
return lOption(['param_values', 'colors', color], atts);
|
|
178
184
|
})]
|
|
179
185
|
]],
|
|
180
186
|
['label', [
|
|
181
|
-
nbsp,
|
|
187
|
+
nbsp, lDirectional('or_entercolor'), nbsp2,
|
|
182
188
|
['input', {
|
|
183
|
-
name:
|
|
189
|
+
name: lParam('bgcolor'),
|
|
184
190
|
type: 'text',
|
|
185
191
|
value: ($p.get('bgcolor') || '#'),
|
|
186
192
|
size: '7',
|
|
@@ -188,10 +194,13 @@ export default {
|
|
|
188
194
|
]],
|
|
189
195
|
['br'], ['br'],
|
|
190
196
|
['label', [
|
|
191
|
-
|
|
197
|
+
lDirectional('text_font'), nbsp2,
|
|
192
198
|
// Todo: remove hard-coded direction if i81nizing; also i18nize fontSeq param
|
|
193
|
-
['select', {name:
|
|
194
|
-
const atts = {
|
|
199
|
+
['select', {name: lParam('fontSeq'), dir: 'ltr'}, fonts.map((fontSeq, i) => {
|
|
200
|
+
const atts = {
|
|
201
|
+
value: fontSeq,
|
|
202
|
+
selected: null
|
|
203
|
+
};
|
|
195
204
|
if ($p.get('fontSeq') === fontSeq || (i === 7 && !$p.has('fontSeq'))) {
|
|
196
205
|
atts.selected = 'selected';
|
|
197
206
|
}
|
|
@@ -200,50 +209,53 @@ export default {
|
|
|
200
209
|
]],
|
|
201
210
|
['br'], ['br'],
|
|
202
211
|
['label', [
|
|
203
|
-
|
|
204
|
-
['select', {name:
|
|
212
|
+
lDirectional('font_style'), nbsp2,
|
|
213
|
+
['select', {name: lParam('fontstyle')}, [
|
|
205
214
|
'italic',
|
|
206
215
|
'normal',
|
|
207
216
|
'oblique'
|
|
208
217
|
].map((fontstyle, i) => {
|
|
209
|
-
const atts = {
|
|
218
|
+
const atts = {
|
|
219
|
+
value: l(['param_values', 'fontstyle', fontstyle]),
|
|
220
|
+
selected: null
|
|
221
|
+
};
|
|
210
222
|
if ($p.get('fontstyle') === l(['param_values', 'fontstyle', fontstyle]) ||
|
|
211
223
|
(i === 1 && !$p.has('fontstyle'))) {
|
|
212
224
|
atts.selected = 'selected';
|
|
213
225
|
}
|
|
214
|
-
return
|
|
226
|
+
return lOption(['param_values', 'fontstyle', fontstyle], atts);
|
|
215
227
|
})]
|
|
216
228
|
]],
|
|
217
229
|
['br'],
|
|
218
230
|
['div', [
|
|
219
|
-
|
|
231
|
+
lDirectional('font_variant'), nbsp3,
|
|
220
232
|
['label', [
|
|
221
233
|
['input', {
|
|
222
|
-
name:
|
|
234
|
+
name: lParam('fontvariant'),
|
|
223
235
|
type: 'radio',
|
|
224
236
|
value: l(['param_values', 'fontvariant', 'normal']),
|
|
225
237
|
checked: $p.get('fontvariant') !==
|
|
226
|
-
|
|
238
|
+
lDirectional(['param_values', 'fontvariant', 'small-caps'])
|
|
227
239
|
}],
|
|
228
|
-
|
|
240
|
+
lDirectional(['param_values', 'fontvariant', 'normal']), nbsp
|
|
229
241
|
]],
|
|
230
242
|
['label', [
|
|
231
243
|
['input', {
|
|
232
|
-
name:
|
|
244
|
+
name: lParam('fontvariant'),
|
|
233
245
|
type: 'radio',
|
|
234
246
|
value: l(['param_values', 'fontvariant', 'small-caps']),
|
|
235
247
|
checked: $p.get('fontvariant') ===
|
|
236
|
-
|
|
248
|
+
lDirectional(['param_values', 'fontvariant', 'small-caps'])
|
|
237
249
|
}],
|
|
238
|
-
|
|
250
|
+
lDirectional(['param_values', 'fontvariant', 'small-caps']), nbsp
|
|
239
251
|
]]
|
|
240
252
|
]],
|
|
241
253
|
['br'],
|
|
242
254
|
['label', [
|
|
243
255
|
// Todo: i18n and allow for normal/bold pulldown and float input?
|
|
244
|
-
|
|
256
|
+
lDirectional('font_weight'), ' (normal, bold, 100-900, etc.):', nbsp2,
|
|
245
257
|
['input', {
|
|
246
|
-
name:
|
|
258
|
+
name: lParam('fontweight'),
|
|
247
259
|
type: 'text',
|
|
248
260
|
value: $p.has('fontweight') ? $p.get('fontweight') : 'normal',
|
|
249
261
|
size: '7',
|
|
@@ -251,9 +263,9 @@ export default {
|
|
|
251
263
|
]],
|
|
252
264
|
['br'],
|
|
253
265
|
['label', [
|
|
254
|
-
|
|
266
|
+
lDirectional('font_size'), ' (14pt, 14px, small, 75%, etc.):', nbsp2,
|
|
255
267
|
['input', {
|
|
256
|
-
name:
|
|
268
|
+
name: lParam('fontsize'),
|
|
257
269
|
type: 'text',
|
|
258
270
|
value: $p.get('fontsize'),
|
|
259
271
|
size: '7',
|
|
@@ -265,27 +277,30 @@ export default {
|
|
|
265
277
|
['label', {
|
|
266
278
|
dir: 'ltr'
|
|
267
279
|
}, [
|
|
268
|
-
|
|
269
|
-
['select', {name:
|
|
280
|
+
lDirectional('font_stretch'), nbsp,
|
|
281
|
+
['select', {name: lParam('fontstretch')},
|
|
270
282
|
[
|
|
271
283
|
'ultra-condensed', 'extra-condensed', 'condensed', 'semi-condensed',
|
|
272
284
|
'normal', 'semi-expanded', 'expanded', 'extra-expanded', 'ultra-expanded'
|
|
273
285
|
].map((stretch) => {
|
|
274
|
-
const atts = {
|
|
286
|
+
const atts = {
|
|
287
|
+
value: lDirectional(['param_values', 'font-stretch', stretch]),
|
|
288
|
+
selected: null
|
|
289
|
+
};
|
|
275
290
|
if ($p.get('fontstretch') === stretch ||
|
|
276
291
|
(!$p.has('fontstretch') && stretch === 'normal')) {
|
|
277
292
|
atts.selected = 'selected';
|
|
278
293
|
}
|
|
279
|
-
return ['option', atts, [
|
|
294
|
+
return ['option', atts, [lDirectional(['param_values', 'font-stretch', stretch])]];
|
|
280
295
|
})
|
|
281
296
|
]
|
|
282
297
|
]],
|
|
283
298
|
/**/
|
|
284
299
|
['br'], ['br'],
|
|
285
300
|
['label', [
|
|
286
|
-
|
|
301
|
+
lDirectional('letter_spacing'), ' (normal, .9em, -.05cm): ',
|
|
287
302
|
['input', {
|
|
288
|
-
name:
|
|
303
|
+
name: lParam('letterspacing'),
|
|
289
304
|
type: 'text',
|
|
290
305
|
value: $p.has('letterspacing') ? $p.get('letterspacing') : 'normal',
|
|
291
306
|
size: '7',
|
|
@@ -293,131 +308,131 @@ export default {
|
|
|
293
308
|
]],
|
|
294
309
|
['br'],
|
|
295
310
|
['label', [
|
|
296
|
-
|
|
311
|
+
lDirectional('line_height'), ' (normal, 1.5, 22px, 150%): ',
|
|
297
312
|
['input', {
|
|
298
|
-
name:
|
|
313
|
+
name: lParam('lineheight'),
|
|
299
314
|
type: 'text',
|
|
300
315
|
value: $p.has('lineheight') ? $p.get('lineheight') : 'normal',
|
|
301
316
|
size: '7',
|
|
302
317
|
maxlength: '12'}]
|
|
303
318
|
]],
|
|
304
319
|
['br'], ['br'],
|
|
305
|
-
|
|
306
|
-
|
|
320
|
+
lElement('tableformatting_tips', 'h3', 'title', {}, [
|
|
321
|
+
lDirectional('tableformatting')
|
|
307
322
|
]),
|
|
308
323
|
['div', [
|
|
309
|
-
|
|
324
|
+
lDirectional('header_wstyles'), nbsp2,
|
|
310
325
|
...([
|
|
311
|
-
['yes',
|
|
312
|
-
['no',
|
|
313
|
-
['none',
|
|
326
|
+
['yes', lDirectional(['param_values', 'y'])],
|
|
327
|
+
['no', lDirectional(['param_values', 'n'])],
|
|
328
|
+
['none', lDirectional(['param_values', '0'])]
|
|
314
329
|
].map(([key, val], i, arr) =>
|
|
315
330
|
['label', [
|
|
316
331
|
['input', {
|
|
317
|
-
name:
|
|
332
|
+
name: lParam('header'),
|
|
318
333
|
type: 'radio',
|
|
319
334
|
value: val,
|
|
320
335
|
checked: $p.get('header') === val ||
|
|
321
336
|
(!$p.has('header') && i === 1)
|
|
322
337
|
}],
|
|
323
|
-
|
|
338
|
+
lDirectional(key), (i === arr.length - 1 ? '' : nbsp3)
|
|
324
339
|
]]
|
|
325
340
|
))
|
|
326
341
|
]],
|
|
327
342
|
['div', [
|
|
328
|
-
|
|
343
|
+
lDirectional('footer_wstyles'), nbsp2,
|
|
329
344
|
...([
|
|
330
|
-
['yes',
|
|
331
|
-
['no',
|
|
332
|
-
['none',
|
|
345
|
+
['yes', lDirectional(['param_values', 'y'])],
|
|
346
|
+
['no', lDirectional(['param_values', 'n'])],
|
|
347
|
+
['none', lDirectional(['param_values', '0'])]
|
|
333
348
|
].map(([key, val], i, arr) =>
|
|
334
349
|
['label', [
|
|
335
350
|
['input', {
|
|
336
|
-
name:
|
|
351
|
+
name: lParam('footer'),
|
|
337
352
|
type: 'radio',
|
|
338
353
|
value: val,
|
|
339
354
|
checked: $p.get('footer') === val ||
|
|
340
355
|
(!$p.has('footer') && i === 2)
|
|
341
356
|
}],
|
|
342
|
-
|
|
357
|
+
lDirectional(key), (i === arr.length - 1 ? '' : nbsp3)
|
|
343
358
|
]]
|
|
344
359
|
))
|
|
345
360
|
]],
|
|
346
361
|
['label', [
|
|
347
362
|
['input', {
|
|
348
|
-
name:
|
|
363
|
+
name: lParam('headerfooterfixed'),
|
|
349
364
|
type: 'checkbox',
|
|
350
365
|
value: l('yes'),
|
|
351
366
|
checked: $p.get('headerfooterfixed') === l('yes')
|
|
352
367
|
}],
|
|
353
|
-
nbsp2,
|
|
368
|
+
nbsp2, lDirectional('headerfooterfixed-wishtoscroll')
|
|
354
369
|
]],
|
|
355
370
|
['br'],
|
|
356
371
|
['div', [
|
|
357
|
-
|
|
372
|
+
lDirectional('caption_wstyles'), nbsp2,
|
|
358
373
|
...([
|
|
359
|
-
['yes',
|
|
360
|
-
['no',
|
|
361
|
-
['none',
|
|
374
|
+
['yes', lDirectional(['param_values', 'y'])],
|
|
375
|
+
['no', lDirectional(['param_values', 'n'])],
|
|
376
|
+
['none', lDirectional(['param_values', '0'])]
|
|
362
377
|
].map(([key, val], i, arr) =>
|
|
363
378
|
['label', [
|
|
364
379
|
['input', {
|
|
365
|
-
name:
|
|
380
|
+
name: lParam('caption'),
|
|
366
381
|
type: 'radio',
|
|
367
382
|
value: val,
|
|
368
383
|
checked: $p.get('caption') === val ||
|
|
369
384
|
(!$p.has('caption') && i === 2)
|
|
370
385
|
}],
|
|
371
|
-
|
|
386
|
+
lDirectional(key), (i === arr.length - 1 ? '' : nbsp3)
|
|
372
387
|
]]
|
|
373
388
|
))
|
|
374
389
|
]],
|
|
375
390
|
['br'],
|
|
376
391
|
['div', [
|
|
377
|
-
|
|
392
|
+
lDirectional('table_wborder'), nbsp2,
|
|
378
393
|
['label', [
|
|
379
394
|
['input', {
|
|
380
|
-
name:
|
|
395
|
+
name: lParam('border'),
|
|
381
396
|
type: 'radio',
|
|
382
397
|
value: '1',
|
|
383
398
|
checked: $p.get('border') !== '0'
|
|
384
399
|
}],
|
|
385
|
-
|
|
400
|
+
lDirectional('yes'), nbsp3
|
|
386
401
|
]],
|
|
387
402
|
['label', [
|
|
388
403
|
['input', {
|
|
389
|
-
name:
|
|
404
|
+
name: lParam('border'),
|
|
390
405
|
type: 'radio',
|
|
391
406
|
value: '0',
|
|
392
407
|
checked: $p.get('border') === '0'}],
|
|
393
|
-
|
|
408
|
+
lDirectional('no')
|
|
394
409
|
]]
|
|
395
410
|
]],
|
|
396
411
|
['div', [
|
|
397
|
-
|
|
412
|
+
lDirectional('interlin_repeat_field_names'), nbsp2,
|
|
398
413
|
['label', [
|
|
399
414
|
['input', {
|
|
400
|
-
name:
|
|
415
|
+
name: lParam('interlintitle'),
|
|
401
416
|
type: 'radio',
|
|
402
417
|
value: '1',
|
|
403
418
|
checked: $p.get('interlintitle') !== '0'
|
|
404
419
|
}],
|
|
405
|
-
|
|
420
|
+
lDirectional('yes'), nbsp3
|
|
406
421
|
]],
|
|
407
422
|
['label', [
|
|
408
423
|
['input', {
|
|
409
|
-
name:
|
|
424
|
+
name: lParam('interlintitle'),
|
|
410
425
|
type: 'radio',
|
|
411
426
|
value: '0',
|
|
412
427
|
checked: $p.get('interlintitle') === '0'
|
|
413
428
|
}],
|
|
414
|
-
|
|
429
|
+
lDirectional('no')
|
|
415
430
|
]]
|
|
416
431
|
]],
|
|
417
432
|
['label', [
|
|
418
|
-
|
|
433
|
+
lDirectional('interlintitle_css'), nbsp2,
|
|
419
434
|
['input', {
|
|
420
|
-
name:
|
|
435
|
+
name: lParam('interlintitle_css'),
|
|
421
436
|
type: 'text',
|
|
422
437
|
value: $p.get('interlintitle_css') || '',
|
|
423
438
|
size: '12'
|
|
@@ -428,70 +443,73 @@ export default {
|
|
|
428
443
|
['br'],
|
|
429
444
|
['label', [
|
|
430
445
|
['input', {
|
|
431
|
-
name:
|
|
446
|
+
name: lParam('transpose'),
|
|
432
447
|
type: 'checkbox',
|
|
433
448
|
value: l('yes'),
|
|
434
449
|
checked: $p.get('transpose') === l('yes')
|
|
435
450
|
}],
|
|
436
|
-
nbsp2,
|
|
451
|
+
nbsp2, lDirectional('transpose')
|
|
437
452
|
]],
|
|
438
453
|
*/
|
|
439
454
|
['br'],
|
|
440
|
-
|
|
441
|
-
|
|
455
|
+
lElement('pageformatting_tips', 'h3', 'title', {}, [
|
|
456
|
+
lDirectional('pageformatting')
|
|
442
457
|
]),
|
|
443
458
|
/*
|
|
444
459
|
['label', [
|
|
445
|
-
|
|
460
|
+
lDirectional('speech_controls'), nbsp2,
|
|
446
461
|
['label', [
|
|
447
462
|
['input', {
|
|
448
|
-
name:
|
|
463
|
+
name: lParam('speech'),
|
|
449
464
|
type: 'radio',
|
|
450
465
|
value: '1',
|
|
451
466
|
checked: $p.get('speech') === '1'
|
|
452
467
|
}],
|
|
453
|
-
|
|
468
|
+
lDirectional('yes'), nbsp3
|
|
454
469
|
]],
|
|
455
470
|
['label', [
|
|
456
471
|
['input', {
|
|
457
|
-
name:
|
|
472
|
+
name: lParam('speech'),
|
|
458
473
|
type: 'radio',
|
|
459
474
|
value: '0',
|
|
460
475
|
checked: $p.get('speech') !== '1'
|
|
461
476
|
}],
|
|
462
|
-
|
|
477
|
+
lDirectional('no')
|
|
463
478
|
]]
|
|
464
479
|
]],
|
|
465
480
|
['br'],
|
|
466
481
|
*/
|
|
467
482
|
['label', [
|
|
468
|
-
|
|
483
|
+
lDirectional('page_css'), nbsp2,
|
|
469
484
|
['textarea', {
|
|
470
|
-
name:
|
|
485
|
+
name: lParam('pagecss'),
|
|
471
486
|
title: l('page_css_tips'),
|
|
472
487
|
value: $p.get('pagecss')
|
|
473
488
|
}]
|
|
474
489
|
]],
|
|
475
490
|
['br'],
|
|
476
|
-
|
|
477
|
-
|
|
491
|
+
lElement('outputmode_tips', 'label', 'title', {}, [
|
|
492
|
+
lDirectional('outputmode'), nbsp2,
|
|
478
493
|
// Todo: Could i18nize, but would need smaller values
|
|
479
|
-
['select', {name:
|
|
494
|
+
['select', {name: lParam('outputmode')}, [
|
|
480
495
|
'table',
|
|
481
496
|
'div'
|
|
482
497
|
// , 'json-array',
|
|
483
498
|
// 'json-object'
|
|
484
499
|
].map((mode) => {
|
|
485
|
-
const atts = {
|
|
500
|
+
const atts = {
|
|
501
|
+
value: mode,
|
|
502
|
+
selected: null
|
|
503
|
+
};
|
|
486
504
|
if ($p.get('outputmode') === mode) {
|
|
487
505
|
atts.selected = 'selected';
|
|
488
506
|
}
|
|
489
|
-
return
|
|
507
|
+
return lOption(['param_values', 'outputmode', mode], atts);
|
|
490
508
|
})]
|
|
491
509
|
])
|
|
492
510
|
]],
|
|
493
511
|
addRandomFormFields ({
|
|
494
|
-
|
|
512
|
+
lParam, lDirectional, l, lElement, $p, serializeParamsAsURL, content
|
|
495
513
|
}) {
|
|
496
514
|
const addRowContent = (rowContent) => {
|
|
497
515
|
if (!rowContent || !rowContent.length) { return; }
|
|
@@ -499,16 +517,16 @@ export default {
|
|
|
499
517
|
};
|
|
500
518
|
[
|
|
501
519
|
[
|
|
502
|
-
['td', {colspan: 12, align: 'center'}, [['br'],
|
|
520
|
+
['td', {colspan: 12, align: 'center'}, [['br'], lDirectional('or'), ['br'], ['br']]]
|
|
503
521
|
],
|
|
504
522
|
[
|
|
505
523
|
['td', {colspan: 12, align: 'center'}, [
|
|
506
524
|
// Todo: Could allow random with fixed starting and/or ending range
|
|
507
525
|
['label', [
|
|
508
|
-
|
|
526
|
+
lDirectional('rnd'), nbsp3,
|
|
509
527
|
['input', {
|
|
510
528
|
id: 'rand',
|
|
511
|
-
name:
|
|
529
|
+
name: lParam('rand'),
|
|
512
530
|
type: 'checkbox',
|
|
513
531
|
value: l('yes'),
|
|
514
532
|
checked: $p.get('rand') === l('yes')
|
|
@@ -516,9 +534,9 @@ export default {
|
|
|
516
534
|
]],
|
|
517
535
|
nbsp3,
|
|
518
536
|
['label', [
|
|
519
|
-
|
|
537
|
+
lDirectional('verses-context'), nbsp,
|
|
520
538
|
['input', {
|
|
521
|
-
name:
|
|
539
|
+
name: lParam('context'),
|
|
522
540
|
type: 'number',
|
|
523
541
|
min: 1,
|
|
524
542
|
size: 4,
|
|
@@ -526,7 +544,7 @@ export default {
|
|
|
526
544
|
}]
|
|
527
545
|
]],
|
|
528
546
|
nbsp3,
|
|
529
|
-
|
|
547
|
+
lElement('view-random-URL', 'input', 'value', {
|
|
530
548
|
type: 'button',
|
|
531
549
|
$on: {
|
|
532
550
|
click () {
|
|
@@ -544,9 +562,9 @@ export default {
|
|
|
544
562
|
].forEach(addRowContent);
|
|
545
563
|
},
|
|
546
564
|
getPreferences: ({
|
|
547
|
-
languageParam,
|
|
565
|
+
languageParam, workI18n, paramsSetter, replaceHash,
|
|
548
566
|
getFieldAliasOrNames, work,
|
|
549
|
-
langs,
|
|
567
|
+
langs, languageI18n, l, localizeParamNames, namespace,
|
|
550
568
|
hideFormattingSection, groups, preferencesPlugin
|
|
551
569
|
}) => ['div', {
|
|
552
570
|
style: {textAlign: 'left'}, id: 'preferences', hidden: 'true'
|
|
@@ -602,12 +620,15 @@ export default {
|
|
|
602
620
|
}, langs.map((lan) => {
|
|
603
621
|
let langCodes = localStorage.getItem(namespace + '-langCodes');
|
|
604
622
|
langCodes = langCodes && JSON.parse(langCodes);
|
|
605
|
-
const atts = {
|
|
623
|
+
const atts = {
|
|
624
|
+
value: lan.code,
|
|
625
|
+
selected: null
|
|
626
|
+
};
|
|
606
627
|
if (langCodes && langCodes.includes(lan.code)) {
|
|
607
628
|
atts.selected = 'selected';
|
|
608
629
|
}
|
|
609
630
|
return ['option', atts, [
|
|
610
|
-
|
|
631
|
+
languageI18n(lan.code)
|
|
611
632
|
]];
|
|
612
633
|
})]
|
|
613
634
|
]],
|
|
@@ -616,7 +637,7 @@ export default {
|
|
|
616
637
|
replaceHash, getFieldAliasOrNames
|
|
617
638
|
}) : '')
|
|
618
639
|
]],
|
|
619
|
-
addBrowseFields ({browseFields, fieldInfo,
|
|
640
|
+
addBrowseFields ({browseFields, fieldInfo, lDirectional, i, lIndexedParam, $p, content}) {
|
|
620
641
|
const work = $p.get('work');
|
|
621
642
|
const addRowContent = (rowContent) => {
|
|
622
643
|
if (!rowContent || !rowContent.length) { return; }
|
|
@@ -626,7 +647,7 @@ export default {
|
|
|
626
647
|
// Todo: Separate formatting to CSS
|
|
627
648
|
i > 0
|
|
628
649
|
? [
|
|
629
|
-
['td', {colspan: 12, align: 'center'}, [['br'],
|
|
650
|
+
['td', {colspan: 12, align: 'center'}, [['br'], lDirectional('or'), ['br'], ['br']]]
|
|
630
651
|
]
|
|
631
652
|
: '',
|
|
632
653
|
[
|
|
@@ -636,7 +657,7 @@ export default {
|
|
|
636
657
|
fieldName, aliases, fieldSchema: {minimum, maximum}
|
|
637
658
|
}, j) => {
|
|
638
659
|
// Namespace by work for sake of browser auto-complete caching
|
|
639
|
-
const name = work + '-' +
|
|
660
|
+
const name = work + '-' + lIndexedParam(setType) + (i + 1) + '-' + (j + 1);
|
|
640
661
|
const id = name;
|
|
641
662
|
rowContent['#'].push(
|
|
642
663
|
['td', [
|
|
@@ -676,14 +697,14 @@ export default {
|
|
|
676
697
|
return [
|
|
677
698
|
addBrowseFieldSet('start'),
|
|
678
699
|
['td', [
|
|
679
|
-
['b', [
|
|
700
|
+
['b', [lDirectional('to')]],
|
|
680
701
|
nbsp3
|
|
681
702
|
]],
|
|
682
703
|
addBrowseFieldSet('end')
|
|
683
704
|
];
|
|
684
705
|
})(),
|
|
685
706
|
['td', [
|
|
686
|
-
browseFields.length > 1 ?
|
|
707
|
+
browseFields.length > 1 ? lDirectional('versesendingdataoptional') : ''
|
|
687
708
|
]]
|
|
688
709
|
],
|
|
689
710
|
[
|
|
@@ -696,7 +717,7 @@ export default {
|
|
|
696
717
|
}, j
|
|
697
718
|
) => {
|
|
698
719
|
// Namespace by work for sake of browser auto-complete caching
|
|
699
|
-
const name = work + '-' +
|
|
720
|
+
const name = work + '-' + lIndexedParam('anchor') + (i + 1) + '-' + (j + 1);
|
|
700
721
|
const id = name;
|
|
701
722
|
rowContent['#'].push(
|
|
702
723
|
['td', [
|
|
@@ -725,15 +746,15 @@ export default {
|
|
|
725
746
|
return rowContent;
|
|
726
747
|
}, {'#': [
|
|
727
748
|
['td', {style: 'font-weight: bold; vertical-align: bottom;'}, [
|
|
728
|
-
|
|
749
|
+
lDirectional('anchored-at') + nbsp3
|
|
729
750
|
]]
|
|
730
751
|
]}),
|
|
731
752
|
['td', [
|
|
732
753
|
['label', [
|
|
733
|
-
|
|
734
|
-
['select', {name:
|
|
754
|
+
lDirectional('field') + nbsp2,
|
|
755
|
+
['select', {name: lIndexedParam('anchorfield') + (i + 1), size: '1'},
|
|
735
756
|
fieldInfo.map(({fieldAliasOrName}) => {
|
|
736
|
-
const val = $p.get(
|
|
757
|
+
const val = $p.get(lIndexedParam('anchorfield') + (i + 1), true);
|
|
737
758
|
if (val === fieldAliasOrName) {
|
|
738
759
|
return ['option', {selected: true}, [fieldAliasOrName]];
|
|
739
760
|
}
|
|
@@ -749,12 +770,12 @@ export default {
|
|
|
749
770
|
].forEach(addRowContent);
|
|
750
771
|
},
|
|
751
772
|
main ({
|
|
752
|
-
|
|
753
|
-
l, namespace, heading, fallbackDirection,
|
|
773
|
+
workI18n, languageParam,
|
|
774
|
+
l, namespace, heading, fallbackDirection, languageI18n, langs, fieldInfo, localizeParamNames,
|
|
754
775
|
serializeParamsAsURL, paramsSetter, replaceHash,
|
|
755
776
|
getFieldAliasOrNames,
|
|
756
777
|
hideFormattingSection, $p,
|
|
757
|
-
metadataObj,
|
|
778
|
+
metadataObj, lParam, lElement, lDirectional, lIndexedParam, fieldMatchesLocale,
|
|
758
779
|
preferredLocale, schemaItems, content, groups, preferencesPlugin
|
|
759
780
|
}) {
|
|
760
781
|
const work = $p.get('work');
|
|
@@ -763,15 +784,15 @@ export default {
|
|
|
763
784
|
{...getDataForSerializingParamsAsURL(), type}
|
|
764
785
|
);
|
|
765
786
|
};
|
|
766
|
-
const
|
|
787
|
+
const lOption = (key, atts) =>
|
|
767
788
|
['option', atts, [
|
|
768
|
-
l(
|
|
769
|
-
|
|
770
|
-
fallback ({message}) {
|
|
771
|
-
|
|
772
|
-
|
|
773
|
-
}
|
|
774
|
-
|
|
789
|
+
l(key
|
|
790
|
+
// Ensure `intl-dom` supports
|
|
791
|
+
// , fallback ({message}) {
|
|
792
|
+
// atts.dir = fallbackDirection;
|
|
793
|
+
// return message;
|
|
794
|
+
// }
|
|
795
|
+
)
|
|
775
796
|
]];
|
|
776
797
|
// Returns element with localized or fallback attribute value (as Jamilih);
|
|
777
798
|
// also adds direction
|
|
@@ -785,9 +806,9 @@ export default {
|
|
|
785
806
|
prefs.hidden = !prefs.hidden;
|
|
786
807
|
}}}, [l('Preferences')]],
|
|
787
808
|
Templates.workDisplay.getPreferences({
|
|
788
|
-
languageParam,
|
|
809
|
+
languageParam, workI18n, paramsSetter, replaceHash,
|
|
789
810
|
getFieldAliasOrNames, work,
|
|
790
|
-
langs,
|
|
811
|
+
langs, languageI18n, l, localizeParamNames, namespace,
|
|
791
812
|
groups, hideFormattingSection, preferencesPlugin
|
|
792
813
|
})
|
|
793
814
|
]],
|
|
@@ -819,7 +840,7 @@ export default {
|
|
|
819
840
|
e.preventDefault();
|
|
820
841
|
this.$submit();
|
|
821
842
|
}
|
|
822
|
-
}, name:
|
|
843
|
+
}, name: lParam('browse')}, [
|
|
823
844
|
['table', {align: 'center'}, content],
|
|
824
845
|
['br'],
|
|
825
846
|
['div', {style: 'margin-left: 20px'}, [
|
|
@@ -828,11 +849,11 @@ export default {
|
|
|
828
849
|
['tr', {valign: 'top'}, [
|
|
829
850
|
['td', [
|
|
830
851
|
Templates.workDisplay.columnsTable({
|
|
831
|
-
|
|
852
|
+
lDirectional, fieldInfo, $p, lElement, lIndexedParam, l,
|
|
832
853
|
metadataObj, preferredLocale, schemaItems,
|
|
833
854
|
fieldMatchesLocale
|
|
834
855
|
}),
|
|
835
|
-
|
|
856
|
+
lElement('save-settings-URL', 'input', 'value', {
|
|
836
857
|
type: 'button',
|
|
837
858
|
$on: {
|
|
838
859
|
click () {
|
|
@@ -865,40 +886,40 @@ export default {
|
|
|
865
886
|
}, [l('Copy_shortcut_URL')]]
|
|
866
887
|
]],
|
|
867
888
|
Templates.workDisplay.advancedFormatting({
|
|
868
|
-
|
|
889
|
+
lDirectional, lParam, l, lOption, lElement, $p, hideFormattingSection
|
|
869
890
|
})
|
|
870
891
|
/*
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
892
|
+
// Todo: Is this still the case? No way to control with CSS?
|
|
893
|
+
,arabicContent ?
|
|
894
|
+
// If there is Arabic content, a text box will be created for
|
|
895
|
+
// each field with such content to allow the user to choose
|
|
896
|
+
// how wide the field should be (since the Arabic is smaller).
|
|
897
|
+
// Todo: Allow naming of the field differently for Persian?
|
|
898
|
+
// Allowing any column to be resized would probably be most
|
|
899
|
+
// consistent with this project's aim to not make arbitrary
|
|
900
|
+
// decisions on what should be customizable, but rather make
|
|
901
|
+
// as much as possible customizable. It may also be helpful
|
|
902
|
+
// for Chinese, etc. If adding, also need $p.get() for
|
|
903
|
+
// defaulting behavior
|
|
904
|
+
{'#': arabicContent.map((item, i) =>
|
|
905
|
+
{'#': [
|
|
906
|
+
'Width of Arabic column: ', // Todo: i18n
|
|
907
|
+
['input', {
|
|
908
|
+
name: lParam('arw') + i,
|
|
909
|
+
type: 'text',
|
|
910
|
+
value: '',
|
|
911
|
+
size: '7',
|
|
912
|
+
maxlength: '12'
|
|
913
|
+
}]
|
|
914
|
+
]}
|
|
915
|
+
)} :
|
|
916
|
+
''
|
|
917
|
+
*/
|
|
897
918
|
]]
|
|
898
919
|
]]
|
|
899
920
|
]],
|
|
900
921
|
['p', {align: 'center'}, [
|
|
901
|
-
|
|
922
|
+
lElement('submitgo', 'input', 'value', {
|
|
902
923
|
type: 'submit'
|
|
903
924
|
})
|
|
904
925
|
]]
|