@yuneta/gobj-ui 7.26.28 → 7.26.29
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/README.md +169 -40
- package/dist/gobj-ui.cjs.js +17 -13
- package/dist/gobj-ui.es.js +17 -13
- package/package.json +4 -2
- package/scripts/validate-locales.mjs +565 -177
- package/src/c_yui_form.js +5 -3
- package/src/c_yui_gobj_tree_js.js +1 -1
- package/src/c_yui_nav.js +12 -10
- package/src/c_yui_period.js +3 -3
- package/src/c_yui_schema_editor.js +22 -18
- package/src/c_yui_shell.js +4 -3
- package/src/c_yui_treedb_graph.js +3 -4
- package/src/c_yui_treedb_topic_with_form.js +15 -15
- package/src/c_yui_treedb_topics.js +8 -8
- package/src/c_yui_window_manager.js +5 -2
- package/src/i18n_key_functions.js +112 -23
- package/src/i18n_key_functions.test.js +329 -8
- package/src/shell_route_map.js +2 -2
- package/src/yui_gclass_view.js +1 -1
- package/src/yui_time.js +1 -1
package/src/c_yui_form.js
CHANGED
|
@@ -805,11 +805,13 @@ function build_html_form(gobj, $form, prefix, template)
|
|
|
805
805
|
}
|
|
806
806
|
|
|
807
807
|
/*
|
|
808
|
-
* Build the html field and add to form, if <tag> is not-null
|
|
808
|
+
* Build the html field and add to form, if <tag> is not-null.
|
|
809
|
+
* Its label and options are the schema's: column names and
|
|
810
|
+
* headers, data.
|
|
809
811
|
*/
|
|
810
812
|
if(html_field_conf.tag) {
|
|
811
|
-
let $field = create_form_field(gobj, $form, prefix, field_desc, html_field_conf);
|
|
812
|
-
name_form_control($field, html_field_conf);
|
|
813
|
+
let $field = create_form_field(gobj, $form, prefix, field_desc, /* i18n: data */ html_field_conf);
|
|
814
|
+
name_form_control($field, /* i18n: data */ html_field_conf);
|
|
813
815
|
$form.appendChild($field);
|
|
814
816
|
}
|
|
815
817
|
});
|
|
@@ -2862,7 +2862,7 @@ function ac_open_gclass(gobj, event, kw, src)
|
|
|
2862
2862
|
close_gclass_view(priv.gclass_view);
|
|
2863
2863
|
priv.gclass_view = null;
|
|
2864
2864
|
|
|
2865
|
-
priv.gclass_view = open_gclass_view(gobj, node_data.gclass, {
|
|
2865
|
+
priv.gclass_view = open_gclass_view(gobj, /* i18n: data */ node_data.gclass, {
|
|
2866
2866
|
title_prefix: gobj_yuno_name() || "",
|
|
2867
2867
|
/* Which state THIS gobj is in. The description describes the
|
|
2868
2868
|
* CLASS and cannot carry it, and the tree is the only party
|
package/src/c_yui_nav.js
CHANGED
|
@@ -230,17 +230,19 @@ function build_ui(gobj)
|
|
|
230
230
|
let menu_id = gobj_read_attr(gobj, "menu_id") || "nav";
|
|
231
231
|
let $container;
|
|
232
232
|
|
|
233
|
+
/* The items are the app's nav declaration: the keys of their names
|
|
234
|
+
* are read there (app_config.json), not here. */
|
|
233
235
|
switch(layout) {
|
|
234
|
-
case "vertical": $container = render_vertical(gobj, items); break;
|
|
235
|
-
case "icon-bar": $container = render_icon_bar(gobj, items); break;
|
|
236
|
-
case "tabs": $container = render_tabs(gobj, items); break;
|
|
237
|
-
case "drawer": $container = render_drawer(gobj, items); break;
|
|
238
|
-
case "submenu": $container = render_submenu(gobj, items); break;
|
|
239
|
-
case "accordion": $container = render_accordion(gobj, items); break;
|
|
240
|
-
case "cards": $container = render_cards(gobj, items); break;
|
|
241
|
-
case "backbar": $container = render_backbar(gobj);
|
|
242
|
-
case "breadcrumb": $container = render_breadcrumb(gobj, items); break;
|
|
243
|
-
default: $container = render_vertical(gobj, items);
|
|
236
|
+
case "vertical": $container = render_vertical(gobj, /* i18n: data */ items); break;
|
|
237
|
+
case "icon-bar": $container = render_icon_bar(gobj, /* i18n: data */ items); break;
|
|
238
|
+
case "tabs": $container = render_tabs(gobj, /* i18n: data */ items); break;
|
|
239
|
+
case "drawer": $container = render_drawer(gobj, /* i18n: data */ items); break;
|
|
240
|
+
case "submenu": $container = render_submenu(gobj, /* i18n: data */ items); break;
|
|
241
|
+
case "accordion": $container = render_accordion(gobj, /* i18n: data */ items); break;
|
|
242
|
+
case "cards": $container = render_cards(gobj, /* i18n: data */ items); break;
|
|
243
|
+
case "backbar": $container = render_backbar(gobj); break;
|
|
244
|
+
case "breadcrumb": $container = render_breadcrumb(gobj, /* i18n: data */ items); break;
|
|
245
|
+
default: $container = render_vertical(gobj, /* i18n: data */ items);
|
|
244
246
|
}
|
|
245
247
|
$container.setAttribute("data-nav-zone", zone);
|
|
246
248
|
$container.setAttribute("data-nav-layout", layout);
|
package/src/c_yui_period.js
CHANGED
|
@@ -386,7 +386,7 @@ function mode_name(mode)
|
|
|
386
386
|
return t(mode.roll.label || mode.id);
|
|
387
387
|
}
|
|
388
388
|
if(mode.kind === "bucket") {
|
|
389
|
-
return period_name(
|
|
389
|
+
return period_name(mode.spec, t);
|
|
390
390
|
}
|
|
391
391
|
return t(mode.id); /* span / custom */
|
|
392
392
|
}
|
|
@@ -482,7 +482,7 @@ function build_ui(gobj)
|
|
|
482
482
|
if(mode.overflow || mode.hidden) {
|
|
483
483
|
continue;
|
|
484
484
|
}
|
|
485
|
-
priv.$modes.appendChild(build_mode_button(gobj, mode));
|
|
485
|
+
priv.$modes.appendChild(build_mode_button(gobj, /* i18n: C_YUI_PERIOD_I18N_KEYS, YUI_TIME_I18N_KEYS */ mode));
|
|
486
486
|
}
|
|
487
487
|
|
|
488
488
|
/* Scroll plumbing, not an action: it changes nothing outside the strip.
|
|
@@ -572,7 +572,7 @@ function build_mode_button(gobj, mode)
|
|
|
572
572
|
{
|
|
573
573
|
/* The name is COMPOSED for a bucket (period_name), so it carries no
|
|
574
574
|
* key: ac_language_changed() rewrites the text and both names. */
|
|
575
|
-
let name = mode_name(
|
|
575
|
+
let name = mode_name(mode);
|
|
576
576
|
let $btn = createElement2(
|
|
577
577
|
["button", {class: `button YUI_PERIOD_MODE YUI_PERIOD_MODE_${mode.id.toUpperCase()}`,
|
|
578
578
|
type: "button", title: name, "aria-label": name},
|
|
@@ -383,7 +383,7 @@ function mt_destroy(gobj)
|
|
|
383
383
|
function refuse_bad_name(gobj, $message)
|
|
384
384
|
{
|
|
385
385
|
mark_name_field(gobj, true);
|
|
386
|
-
yui_shell_show_error(yui_shell_of(gobj),
|
|
386
|
+
yui_shell_show_error(yui_shell_of(gobj), $message, {t: t});
|
|
387
387
|
return -1;
|
|
388
388
|
}
|
|
389
389
|
|
|
@@ -1258,7 +1258,7 @@ function render(gobj)
|
|
|
1258
1258
|
}
|
|
1259
1259
|
if(state === "ST_IDLE") {
|
|
1260
1260
|
show_notice(gobj, priv.load_error ? "cannot load the schemas" : "not connected",
|
|
1261
|
-
priv.load_error, true);
|
|
1261
|
+
/* i18n: data */ priv.load_error, true);
|
|
1262
1262
|
destroy_diagram(gobj);
|
|
1263
1263
|
clear($body);
|
|
1264
1264
|
return;
|
|
@@ -1362,16 +1362,16 @@ function render_treedbs(gobj, $body)
|
|
|
1362
1362
|
let $cards = [];
|
|
1363
1363
|
|
|
1364
1364
|
for(let treedb of priv.model.treedbs) {
|
|
1365
|
-
|
|
1365
|
+
const from_c = treedb.c_schema_version !== undefined &&
|
|
1366
|
+
String(treedb.c_schema_version) !== String(treedb.schema_version);
|
|
1367
|
+
const tags = [
|
|
1366
1368
|
{i18n: "topics", text: treedb.topics.length},
|
|
1367
1369
|
{i18n: "version", text: treedb.schema_version === undefined
|
|
1368
|
-
? "?" : treedb.schema_version}
|
|
1370
|
+
? "?" : treedb.schema_version},
|
|
1371
|
+
...(from_c
|
|
1372
|
+
? [{i18n: "from c", text: treedb.c_schema_version, style: "is-warning is-light"}]
|
|
1373
|
+
: [])
|
|
1369
1374
|
];
|
|
1370
|
-
if(treedb.c_schema_version !== undefined &&
|
|
1371
|
-
String(treedb.c_schema_version) !== String(treedb.schema_version)
|
|
1372
|
-
) {
|
|
1373
|
-
tags.push({i18n: "from c", text: treedb.c_schema_version, style: "is-warning is-light"});
|
|
1374
|
-
}
|
|
1375
1375
|
$cards.push(open_card(gobj, "SCHEMA_TREEDB_CARD", treedb.id, "yi-database",
|
|
1376
1376
|
tags, "EV_SELECT_TREEDB", {treedb: treedb.id}));
|
|
1377
1377
|
}
|
|
@@ -1406,7 +1406,7 @@ function render_topics(gobj, $body)
|
|
|
1406
1406
|
let treedb = current_treedb(gobj);
|
|
1407
1407
|
|
|
1408
1408
|
if(!treedb) {
|
|
1409
|
-
show_notice(gobj, "that treedb is not here any more", priv.treedb_id);
|
|
1409
|
+
show_notice(gobj, "that treedb is not here any more", /* i18n: data */ priv.treedb_id);
|
|
1410
1410
|
return;
|
|
1411
1411
|
}
|
|
1412
1412
|
|
|
@@ -1554,7 +1554,7 @@ function render_columns(gobj, $body)
|
|
|
1554
1554
|
let topic = current_topic(gobj);
|
|
1555
1555
|
|
|
1556
1556
|
if(!topic) {
|
|
1557
|
-
show_notice(gobj, "that topic is not here any more", priv.topic_name);
|
|
1557
|
+
show_notice(gobj, "that topic is not here any more", /* i18n: data */ priv.topic_name);
|
|
1558
1558
|
return;
|
|
1559
1559
|
}
|
|
1560
1560
|
|
|
@@ -1815,7 +1815,7 @@ function render_diagram(gobj)
|
|
|
1815
1815
|
if(!treedb) {
|
|
1816
1816
|
destroy_diagram(gobj);
|
|
1817
1817
|
clear($body);
|
|
1818
|
-
show_notice(gobj, "that treedb is not here any more", priv.treedb_id);
|
|
1818
|
+
show_notice(gobj, "that treedb is not here any more", /* i18n: data */ priv.treedb_id);
|
|
1819
1819
|
return;
|
|
1820
1820
|
}
|
|
1821
1821
|
if(!gclass_find_by_name("C_YUI_TREEDB_SCHEMA")) {
|
|
@@ -1921,7 +1921,7 @@ function open_dialog(gobj, $content, title, logical, title_prefix)
|
|
|
1921
1921
|
priv.dialog_gen = priv.model_gen;
|
|
1922
1922
|
priv.dialog_kind = logical;
|
|
1923
1923
|
priv.dialog_content = $content;
|
|
1924
|
-
priv.dialog = yui_shell_show_modal(yui_shell_of(gobj),
|
|
1924
|
+
priv.dialog = yui_shell_show_modal(yui_shell_of(gobj), $content, {
|
|
1925
1925
|
dialog: true,
|
|
1926
1926
|
title: title,
|
|
1927
1927
|
title_prefix: title_prefix || "",
|
|
@@ -2435,8 +2435,8 @@ function open_report(gobj, findings, treedb_id)
|
|
|
2435
2435
|
return ["tr", {class: `SCHEMA_REPORT_ROW SCHEMA_REPORT_${finding.severity.toUpperCase()}`}, [
|
|
2436
2436
|
["td", {class: "SCHEMA_REPORT_SEVERITY"}, [
|
|
2437
2437
|
["span", {class: `tag ${finding.severity === "error" ? "is-danger" : "is-warning"}` +
|
|
2438
|
-
" is-light", i18n:
|
|
2439
|
-
t(
|
|
2438
|
+
" is-light", i18n: finding.severity},
|
|
2439
|
+
t(finding.severity)]
|
|
2440
2440
|
]],
|
|
2441
2441
|
["td", {class: "SCHEMA_REPORT_WHAT", i18n: finding.code}, t(finding.code)],
|
|
2442
2442
|
["td", {class: "SCHEMA_REPORT_TOPIC"}, text_node(finding.topic || "")],
|
|
@@ -4256,7 +4256,7 @@ function confirm_column_delete(gobj, verdict)
|
|
|
4256
4256
|
}
|
|
4257
4257
|
$warning = createElement2(["div", {class: "SCHEMA_COLUMN_DATA_WARNING"}, children]);
|
|
4258
4258
|
}
|
|
4259
|
-
confirm_then(gobj, $warning?
|
|
4259
|
+
confirm_then(gobj, $warning? $warning : message, `${c.topic}.${c.col}`,
|
|
4260
4260
|
{what: "column", topic: c.topic, col: c.col});
|
|
4261
4261
|
return 0;
|
|
4262
4262
|
}
|
|
@@ -4494,7 +4494,9 @@ function ac_validate(gobj, event, kw, src)
|
|
|
4494
4494
|
written_topics: Object.keys(priv.written),
|
|
4495
4495
|
baseline: priv.baseline
|
|
4496
4496
|
});
|
|
4497
|
-
|
|
4497
|
+
/* The severities are C_YUI_SCHEMA_EDITOR_I18N_KEYS; the codes are the
|
|
4498
|
+
* checks' own keys, read where schema_validate.js writes them. */
|
|
4499
|
+
open_report(gobj, /* i18n: C_YUI_SCHEMA_EDITOR_I18N_KEYS */ findings, treedb.id);
|
|
4498
4500
|
if(has_errors(findings)) {
|
|
4499
4501
|
log_warning(`${gobj_short_name(gobj)}: ${treedb.id} would be refused as it is`);
|
|
4500
4502
|
}
|
|
@@ -4578,7 +4580,9 @@ function ac_preview_import(gobj, event, kw, src)
|
|
|
4578
4580
|
|
|
4579
4581
|
let plan = plan_import(treedb, incoming, {prune: !!kw.prune});
|
|
4580
4582
|
priv.import_plan = plan;
|
|
4581
|
-
|
|
4583
|
+
/* Its writes are SCHEMA_IMPORT_I18N_KEYS; its conflicts are keys of
|
|
4584
|
+
* their own, read where schema_import.js writes them. */
|
|
4585
|
+
render_import_plan(gobj, /* i18n: SCHEMA_IMPORT_I18N_KEYS */ plan);
|
|
4582
4586
|
return 0;
|
|
4583
4587
|
}
|
|
4584
4588
|
|
package/src/c_yui_shell.js
CHANGED
|
@@ -281,7 +281,8 @@ function mt_start(gobj)
|
|
|
281
281
|
|
|
282
282
|
build_item_index(gobj, config);
|
|
283
283
|
instantiate_menus(gobj, config);
|
|
284
|
-
|
|
284
|
+
/* The app's shell declaration: its toolbar's keys are read there */
|
|
285
|
+
build_toolbar(gobj, /* i18n: data */ config);
|
|
285
286
|
|
|
286
287
|
/* lifecycle: "eager" — preinstantiate views that must exist from boot. */
|
|
287
288
|
preinstantiate_eager_views(gobj);
|
|
@@ -1781,7 +1782,7 @@ function safe_id(s)
|
|
|
1781
1782
|
************************************************************/
|
|
1782
1783
|
function build_toolbar(gobj, config)
|
|
1783
1784
|
{
|
|
1784
|
-
|
|
1785
|
+
const tb = config && config.toolbar;
|
|
1785
1786
|
if(!tb || !is_array(tb.items)) {
|
|
1786
1787
|
return;
|
|
1787
1788
|
}
|
|
@@ -2341,7 +2342,7 @@ function open_toolbar_dropdown(gobj, item, action, $trigger)
|
|
|
2341
2342
|
let raw_items = is_array(action.items) ? action.items : [];
|
|
2342
2343
|
for(let i = 0; i < raw_items.length; i++) {
|
|
2343
2344
|
let sub = raw_items[i];
|
|
2344
|
-
let $row = build_dropdown_row(gobj, sub, i);
|
|
2345
|
+
let $row = build_dropdown_row(gobj, /* i18n: data */ sub, i); // the app's shell declaration
|
|
2345
2346
|
if(!$row) {
|
|
2346
2347
|
continue;
|
|
2347
2348
|
}
|
|
@@ -1361,8 +1361,7 @@ function answer_print_tranger_refused(gobj, path, answer)
|
|
|
1361
1361
|
gobj_send_event(jv, "EV_SUBTREE_ERROR",
|
|
1362
1362
|
Object.assign({path: path}, answer), gobj);
|
|
1363
1363
|
} else {
|
|
1364
|
-
yui_shell_show_error(yui_shell_of(gobj),
|
|
1365
|
-
/* i18n: data */ answer.i18n || answer.error, {t: t});
|
|
1364
|
+
yui_shell_show_error(yui_shell_of(gobj), answer.i18n || answer.error, {t: t});
|
|
1366
1365
|
}
|
|
1367
1366
|
}
|
|
1368
1367
|
|
|
@@ -1413,7 +1412,7 @@ function request_print_tranger(gobj, path)
|
|
|
1413
1412
|
}, gobj);
|
|
1414
1413
|
if(ret) {
|
|
1415
1414
|
log_error(ret);
|
|
1416
|
-
answer_print_tranger_refused(gobj, path, {error: refusal_text(ret)});
|
|
1415
|
+
answer_print_tranger_refused(gobj, path, {error: /* i18n: data */ refusal_text(ret)});
|
|
1417
1416
|
return;
|
|
1418
1417
|
}
|
|
1419
1418
|
if(path) {
|
|
@@ -2193,7 +2192,7 @@ function ac_mt_command_answer(gobj, event, kw, src)
|
|
|
2193
2192
|
/* The schema couldn't load (not a treedb, no authz for it, backend
|
|
2194
2193
|
* down…). Show an inline banner in the view rather than a blocking
|
|
2195
2194
|
* app-modal that wedges the whole SPA behind an empty tab. */
|
|
2196
|
-
show_load_error(gobj, t(comment));
|
|
2195
|
+
show_load_error(gobj, t(/* i18n: data */ comment));
|
|
2197
2196
|
} else {
|
|
2198
2197
|
yui_shell_show_error(yui_shell_of(gobj), /* i18n: data */ comment, {t: t});
|
|
2199
2198
|
}
|
|
@@ -325,7 +325,7 @@ function present_json_popup(gobj, $box, opts)
|
|
|
325
325
|
|
|
326
326
|
if(is_mobile()) {
|
|
327
327
|
return {
|
|
328
|
-
modal: yui_shell_show_modal(shell,
|
|
328
|
+
modal: yui_shell_show_modal(shell, $box, {
|
|
329
329
|
dialog: true,
|
|
330
330
|
logical_class: opts.logical_class + "_SHEET",
|
|
331
331
|
title_prefix: opts.title_prefix,
|
|
@@ -1512,7 +1512,7 @@ function create_tabulator(gobj)
|
|
|
1512
1512
|
|
|
1513
1513
|
let colDef = {
|
|
1514
1514
|
title: col_label(col, gobj_read_str_attr(gobj, "topic_name")),
|
|
1515
|
-
titleFormatter: col_title_formatter(gobj, col),
|
|
1515
|
+
titleFormatter: col_title_formatter(gobj, /* i18n: data */ col), // a column of the schema
|
|
1516
1516
|
field: col.id,
|
|
1517
1517
|
sorter: sorter,
|
|
1518
1518
|
hozAlign: hozAlign,
|
|
@@ -2496,7 +2496,7 @@ function open_form_dialog(gobj, mode, record)
|
|
|
2496
2496
|
* are wired by the shell. `before_close` preserves the unsaved-changes
|
|
2497
2497
|
* guard — it vetoes the dismiss and, on confirm, closes the modal
|
|
2498
2498
|
* itself. `on_close` tears the hosted form child down. */
|
|
2499
|
-
priv.form_modal = yui_shell_show_modal(shell,
|
|
2499
|
+
priv.form_modal = yui_shell_show_modal(shell, $body, {
|
|
2500
2500
|
dialog: true,
|
|
2501
2501
|
logical_class: "TREEDB_FORM_SHEET",
|
|
2502
2502
|
title_prefix: title_prefix,
|
|
@@ -2676,7 +2676,7 @@ function open_schema_dialog(gobj)
|
|
|
2676
2676
|
/* Title split in two halves: the topic name is DATA (never
|
|
2677
2677
|
* translated) and "schema" is the kind (carries its i18n key), so
|
|
2678
2678
|
* the header re-translates on a language switch. */
|
|
2679
|
-
let presented = present_json_popup(gobj, $box, {
|
|
2679
|
+
let presented = present_json_popup(gobj, /* i18n: data */ $box, { // the viewer's own DOM
|
|
2680
2680
|
name: "schemawin_" + clean_name(gobj_name(gobj)),
|
|
2681
2681
|
logical_class: "TREEDB_SCHEMA",
|
|
2682
2682
|
title_prefix: gobj_read_str_attr(gobj, "topic_name"),
|
|
@@ -2803,11 +2803,11 @@ function open_cell_json_dialog(gobj, row_id, col_id)
|
|
|
2803
2803
|
* i18n key — the shared `col.id` one, so the header re-translates on a
|
|
2804
2804
|
* language switch and reads as the raw id where the app defines no key
|
|
2805
2805
|
* (exactly what an untranslated column header already shows). */
|
|
2806
|
-
let presented = present_json_popup(gobj, $box, {
|
|
2806
|
+
let presented = present_json_popup(gobj, /* i18n: data */ $box, { // the viewer's own DOM
|
|
2807
2807
|
name: "cellwin_" + clean_name(gobj_name(gobj)),
|
|
2808
2808
|
logical_class: "TREEDB_CELL_JSON",
|
|
2809
2809
|
title_prefix: String(row_id),
|
|
2810
|
-
title:
|
|
2810
|
+
title: col_id,
|
|
2811
2811
|
icon: "yi-js-square",
|
|
2812
2812
|
forget_window: function() {
|
|
2813
2813
|
priv.cell_json_win = null;
|
|
@@ -3019,7 +3019,7 @@ function open_cell_file_dialog(gobj, row_id, col_id)
|
|
|
3019
3019
|
name: "filewin_" + clean_name(gobj_name(gobj)),
|
|
3020
3020
|
logical_class: "TREEDB_CELL_FILE",
|
|
3021
3021
|
title_prefix: String(row_id),
|
|
3022
|
-
title:
|
|
3022
|
+
title: col_id,
|
|
3023
3023
|
icon: "yi-eye",
|
|
3024
3024
|
forget_window: function() {
|
|
3025
3025
|
priv.cell_file_win = null;
|
|
@@ -3167,7 +3167,7 @@ function open_hook_choice_dialog(gobj, targets, parent_id, hook)
|
|
|
3167
3167
|
}];
|
|
3168
3168
|
})]
|
|
3169
3169
|
);
|
|
3170
|
-
priv.hook_choice_modal = yui_shell_show_modal(shell,
|
|
3170
|
+
priv.hook_choice_modal = yui_shell_show_modal(shell, $body, {
|
|
3171
3171
|
dialog: true,
|
|
3172
3172
|
logical_class: "TREEDB_HOOK_CHOICE_SHEET",
|
|
3173
3173
|
title: "choose a topic",
|
|
@@ -4132,7 +4132,7 @@ function ac_delete_rows(gobj, event, kw, src)
|
|
|
4132
4132
|
return 0;
|
|
4133
4133
|
}
|
|
4134
4134
|
|
|
4135
|
-
confirm_then(gobj,
|
|
4135
|
+
confirm_then(gobj, build_delete_question(gobj, rows),
|
|
4136
4136
|
{what: "delete_selection", ids: yui_row_ids(tabulator, rows)});
|
|
4137
4137
|
|
|
4138
4138
|
} else {
|
|
@@ -4140,7 +4140,7 @@ function ac_delete_rows(gobj, event, kw, src)
|
|
|
4140
4140
|
* Delete one row
|
|
4141
4141
|
* {row: }
|
|
4142
4142
|
*----------------------------*/
|
|
4143
|
-
confirm_then(gobj,
|
|
4143
|
+
confirm_then(gobj, build_delete_question(gobj, kw.row),
|
|
4144
4144
|
{what: "delete_row", ids: yui_row_ids(tabulator, [kw.row])});
|
|
4145
4145
|
}
|
|
4146
4146
|
|
|
@@ -4599,7 +4599,7 @@ function ac_show_hook_data(gobj, event, kw, src)
|
|
|
4599
4599
|
String(kw.row_id), kw.col_id);
|
|
4600
4600
|
return 0;
|
|
4601
4601
|
}
|
|
4602
|
-
open_hook_choice_dialog(gobj, targets, String(kw.row_id), kw.col_id);
|
|
4602
|
+
open_hook_choice_dialog(gobj, /* i18n: data */ targets, String(kw.row_id), kw.col_id); // the schema's topics
|
|
4603
4603
|
return 0;
|
|
4604
4604
|
}
|
|
4605
4605
|
|
|
@@ -4681,7 +4681,7 @@ function ac_refresh(gobj, event, kw, src)
|
|
|
4681
4681
|
************************************************************/
|
|
4682
4682
|
function ac_show_cell_json(gobj, event, kw, src)
|
|
4683
4683
|
{
|
|
4684
|
-
open_cell_json_dialog(gobj, kw.row_id, kw.col_id);
|
|
4684
|
+
open_cell_json_dialog(gobj, kw.row_id, /* i18n: data */ kw.col_id);
|
|
4685
4685
|
|
|
4686
4686
|
return 0;
|
|
4687
4687
|
}
|
|
@@ -4695,7 +4695,7 @@ function ac_show_cell_json(gobj, event, kw, src)
|
|
|
4695
4695
|
************************************************************/
|
|
4696
4696
|
function ac_show_cell_file(gobj, event, kw, src)
|
|
4697
4697
|
{
|
|
4698
|
-
open_cell_file_dialog(gobj, kw.row_id, kw.col_id);
|
|
4698
|
+
open_cell_file_dialog(gobj, kw.row_id, /* i18n: data */ kw.col_id);
|
|
4699
4699
|
|
|
4700
4700
|
return 0;
|
|
4701
4701
|
}
|
|
@@ -5078,7 +5078,7 @@ function ac_open_columns(gobj, event, kw, src)
|
|
|
5078
5078
|
));
|
|
5079
5079
|
}
|
|
5080
5080
|
|
|
5081
|
-
yui_shell_show_modal(shell,
|
|
5081
|
+
yui_shell_show_modal(shell, $list, {
|
|
5082
5082
|
dialog: true,
|
|
5083
5083
|
logical_class: "TREEDB_COLUMNS_DIALOG",
|
|
5084
5084
|
title_prefix: gobj_read_str_attr(gobj, "topic_name"),
|
|
@@ -5291,7 +5291,7 @@ function open_table_json_dialog(gobj, records)
|
|
|
5291
5291
|
}
|
|
5292
5292
|
|
|
5293
5293
|
/* The topic is DATA (the prefix), the title carries its key. */
|
|
5294
|
-
let presented = present_json_popup(gobj, $box, {
|
|
5294
|
+
let presented = present_json_popup(gobj, /* i18n: data */ $box, { // the viewer's own DOM
|
|
5295
5295
|
name: "tablejsonwin_" + clean_name(gobj_name(gobj)),
|
|
5296
5296
|
logical_class: "TREEDB_TABLE_JSON",
|
|
5297
5297
|
title_prefix: gobj_read_str_attr(gobj, "topic_name"),
|
|
@@ -1368,8 +1368,9 @@ function process_treedb_descs(gobj)
|
|
|
1368
1368
|
);
|
|
1369
1369
|
|
|
1370
1370
|
// TODO get icon from remote config
|
|
1371
|
-
|
|
1372
|
-
|
|
1371
|
+
/* `key` is a topic of the backend's schema: data */
|
|
1372
|
+
add_tab(gobj, gobj_topic_form, id, /* i18n: data */ key, "yi-table");
|
|
1373
|
+
add_topic_card(gobj, id, /* i18n: data */ key, "yi-table", desc);
|
|
1373
1374
|
|
|
1374
1375
|
gobj_start(gobj_topic_form);
|
|
1375
1376
|
}
|
|
@@ -1390,7 +1391,7 @@ function process_treedb_descs(gobj)
|
|
|
1390
1391
|
if(gobj.priv._pending_info) {
|
|
1391
1392
|
let ti = gobj.priv._pending_info;
|
|
1392
1393
|
gobj.priv._pending_info = null;
|
|
1393
|
-
show_topic_info(gobj, ti);
|
|
1394
|
+
show_topic_info(gobj, /* i18n: data */ ti); // a topic name
|
|
1394
1395
|
} else if(href && href.indexOf("?") >= 0) {
|
|
1395
1396
|
gobj_send_event(gobj, "EV_SHOW", {href: href}, gobj);
|
|
1396
1397
|
} else {
|
|
@@ -2223,8 +2224,7 @@ function answer_print_tranger_refused(gobj, path, answer)
|
|
|
2223
2224
|
gobj_send_event(jv, "EV_SUBTREE_ERROR",
|
|
2224
2225
|
Object.assign({path: path}, answer), gobj);
|
|
2225
2226
|
} else {
|
|
2226
|
-
yui_shell_show_error(yui_shell_of(gobj),
|
|
2227
|
-
/* i18n: data */ answer.i18n || answer.error, {t: t});
|
|
2227
|
+
yui_shell_show_error(yui_shell_of(gobj), answer.i18n || answer.error, {t: t});
|
|
2228
2228
|
}
|
|
2229
2229
|
}
|
|
2230
2230
|
|
|
@@ -2274,7 +2274,7 @@ function request_print_tranger(gobj, path)
|
|
|
2274
2274
|
}, gobj);
|
|
2275
2275
|
if(ret) {
|
|
2276
2276
|
log_error(ret);
|
|
2277
|
-
answer_print_tranger_refused(gobj, path, {error: refusal_text(ret)});
|
|
2277
|
+
answer_print_tranger_refused(gobj, path, {error: /* i18n: data */ refusal_text(ret)});
|
|
2278
2278
|
return;
|
|
2279
2279
|
}
|
|
2280
2280
|
if(path) {
|
|
@@ -2459,7 +2459,7 @@ function ac_mt_command_answer(gobj, event, kw, src)
|
|
|
2459
2459
|
/* The schema couldn't load (not a treedb, no authz for it, backend
|
|
2460
2460
|
* down…). Show an inline banner in the view rather than a blocking
|
|
2461
2461
|
* app-modal that wedges the whole SPA behind an empty tab. */
|
|
2462
|
-
show_load_error(gobj, t(comment));
|
|
2462
|
+
show_load_error(gobj, t(/* i18n: data */ comment));
|
|
2463
2463
|
} else {
|
|
2464
2464
|
yui_shell_show_error(yui_shell_of(gobj), /* i18n: data */ comment, {t: t});
|
|
2465
2465
|
/* A refused write leaves the TABLE showing what the operator
|
|
@@ -2737,7 +2737,7 @@ function ac_show(gobj, event, kw, src)
|
|
|
2737
2737
|
************************************************************/
|
|
2738
2738
|
function ac_show_topic_info(gobj, event, kw, src)
|
|
2739
2739
|
{
|
|
2740
|
-
show_topic_info(gobj, kw && kw.topic);
|
|
2740
|
+
show_topic_info(gobj, /* i18n: data */ kw && kw.topic); // a topic name
|
|
2741
2741
|
return 0;
|
|
2742
2742
|
}
|
|
2743
2743
|
|
|
@@ -510,9 +510,12 @@ function ac_register_window(gobj, event, kw, src)
|
|
|
510
510
|
label_items.push(['span', {class: 'yui-dock-label-prefix'},
|
|
511
511
|
text_node(prefix)]); // data, not markup
|
|
512
512
|
}
|
|
513
|
+
/* An FSM action: what it is given is the kw of EV_REGISTER_WINDOW,
|
|
514
|
+
* which no reader can follow. `title_key` is the window's `title`,
|
|
515
|
+
* a key its HOST chose when it created the window. */
|
|
513
516
|
if(title_key) {
|
|
514
517
|
label_items.push(
|
|
515
|
-
['span', {class: 'yui-dock-label-kind', i18n: title_key},
|
|
518
|
+
['span', {class: 'yui-dock-label-kind', i18n: /* i18n: data */ title_key},
|
|
516
519
|
kind_text || title_key]
|
|
517
520
|
);
|
|
518
521
|
}
|
|
@@ -532,7 +535,7 @@ function ac_register_window(gobj, event, kw, src)
|
|
|
532
535
|
let $chip = createElement2(
|
|
533
536
|
['div', Object.assign(
|
|
534
537
|
{class: 'yui-dock-chip', role: 'button', tabindex: '0', title: title},
|
|
535
|
-
(!prefix && title_key) ? {'data-i18n-title': title_key} : {}
|
|
538
|
+
(!prefix && title_key) ? {'data-i18n-title': /* i18n: data */ title_key} : {}
|
|
536
539
|
), [
|
|
537
540
|
chip_lead(kw.icon),
|
|
538
541
|
['span', {class: 'yui-dock-label'}, label_items],
|