@yuneta/gobj-ui 5.2.0 → 5.3.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/README.md +165 -0
- package/dist/gobj-ui.cjs.js +386 -43
- package/dist/gobj-ui.es.js +520 -177
- package/package.json +1 -1
- package/src/c_yui_json.css +23 -3
- package/src/c_yui_json.js +17 -3
- package/src/c_yui_nav.js +63 -3
- package/src/c_yui_node.css +77 -0
- package/src/c_yui_node.js +1567 -0
- package/src/c_yui_shell.css +18 -0
- package/src/c_yui_shell.js +206 -4
- package/src/c_yui_treedb_schema.js +1 -0
- package/src/c_yui_window.js +8 -3
- package/src/node_tree_model.js +463 -0
- package/src/node_tree_model.test.js +282 -0
- package/src/route_map_model.js +48 -0
- package/src/route_map_model.test.js +70 -0
- package/src/route_resolver.js +11 -0
- package/src/shell_route_map.css +36 -2
- package/src/shell_route_map.js +194 -45
- package/src/yui_dev.js +3 -3
- package/src/yui_icons.css +13 -0
package/dist/gobj-ui.es.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { SDATA, SDATA_END, clean_name, createElement2, createOneHtml, create_template_record, data_type_t, debounce, duplicate_objects, empty_string, escapeHtml, event_flag_t, gclass_create, gclass_find_by_name, gclass_flag_t, getPositionRelativeToBody, gobj_change_state, gobj_command, gobj_create, gobj_create_pure_child, gobj_create_service, gobj_current_state, gobj_destroy, gobj_find_child, gobj_find_service, gobj_full_name, gobj_gclass_name, gobj_is_destroying, gobj_is_playing, gobj_is_pure_child, gobj_is_running, gobj_is_service, gobj_is_volatil, gobj_match_children, gobj_name, gobj_parent, gobj_publish_event, gobj_read_attr, gobj_read_bool_attr, gobj_read_integer_attr, gobj_read_pointer_attr, gobj_read_str_attr, gobj_save_persistent_attrs, gobj_send_event
|
|
1
|
+
import { SDATA, SDATA_END, clean_name, createElement2, createOneHtml, create_template_record, data_type_t, debounce, duplicate_objects, empty_string, escapeHtml, event_flag_t, gclass_create, gclass_find_by_name, gclass_flag_t, getPositionRelativeToBody, gobj_change_state, gobj_command, gobj_create, gobj_create_pure_child, gobj_create_service, gobj_current_state, gobj_destroy, gobj_find_child, gobj_find_service, gobj_full_name, gobj_gclass_name, gobj_is_destroying, gobj_is_playing, gobj_is_pure_child, gobj_is_running, gobj_is_service, gobj_is_volatil, gobj_match_children, gobj_name, gobj_parent, gobj_publish_event, gobj_read_attr, gobj_read_bool_attr, gobj_read_integer_attr, gobj_read_pointer_attr, gobj_read_str_attr, gobj_save_persistent_attrs, gobj_send_event, gobj_set_trace_machine_format, gobj_short_name, gobj_start, gobj_start_tree, gobj_stop, gobj_stop_children, gobj_subscribe_event, gobj_unsubscribe_event, gobj_write_attr, gobj_write_bool_attr, gobj_write_integer_attr, gobj_write_str_attr, gobj_yuno, is_array, is_boolean, is_date, is_gobj, is_null, is_number, is_object, is_string, json_deep_copy, json_object_size, json_object_update, json_object_update_missing, json_size, kw_clone_by_keys, kw_flag_t, kw_get_dict, kw_get_dict_value, kw_get_int, kw_get_local_storage_value, kw_get_str, kw_has_key, kw_set_dict_value, kw_set_local_storage_value, kwid_find_one_record, kwid_get_ids, kwid_new_dict, log_error, log_warning, msg_iev_get_stack, parseBoolean, parseSVG, refresh_language, safeSrc, sdata_flag_t, set_console_log_enabled, set_log_callback, sprintf, str_in_list, template_get_field_desc, trace_msg, treedb_decoder_fkey, treedb_encoder_fkey, treedb_get_field_desc, treedb_hook_data_size } from "@yuneta/gobj-js";
|
|
2
2
|
import i18next, { t } from "i18next";
|
|
3
3
|
import TomSelect from "tom-select";
|
|
4
4
|
import { createJSONEditor } from "vanilla-jsoneditor";
|
|
@@ -339,6 +339,11 @@ function _is_non_empty_string(v) {
|
|
|
339
339
|
* - root `/` is NEVER an ancestor catch-all (it only matches
|
|
340
340
|
* exactly): otherwise every typo route would silently mount
|
|
341
341
|
* the home view and the unknown-route diagnostic would die.
|
|
342
|
+
* ONE exception, opt-in: an entry whose target declares
|
|
343
|
+
* `owns_subtree` is a view that resolves the tail ITSELF and
|
|
344
|
+
* says so when a segment names nothing — a C_YUI_NODE tree
|
|
345
|
+
* rooted at `/`. The diagnostic is not lost there, it moves
|
|
346
|
+
* one layer down to whoever actually knows the names.
|
|
342
347
|
* - nothing matched → entry as found (may be
|
|
343
348
|
* null or a targetless submenu parent), subpath "".
|
|
344
349
|
************************************************************/
|
|
@@ -366,7 +371,15 @@ function resolve_route(item_index, route) {
|
|
|
366
371
|
while (parts.length > 0 && (!entry || !entry.target)) {
|
|
367
372
|
parts.pop();
|
|
368
373
|
let cand = "/" + parts.join("/");
|
|
369
|
-
if (cand === "/")
|
|
374
|
+
if (cand === "/") {
|
|
375
|
+
let root = item_index["/"];
|
|
376
|
+
if (root && root.target && root.target.owns_subtree) {
|
|
377
|
+
entry = root;
|
|
378
|
+
matched_route = "/";
|
|
379
|
+
subpath = route.replace(/^\/+/, "");
|
|
380
|
+
}
|
|
381
|
+
break;
|
|
382
|
+
}
|
|
370
383
|
let e = item_index[cand];
|
|
371
384
|
if (e && e.target) {
|
|
372
385
|
entry = e;
|
|
@@ -483,6 +496,38 @@ function collect_routes(nodes, into) {
|
|
|
483
496
|
}
|
|
484
497
|
}
|
|
485
498
|
/************************************************************
|
|
499
|
+
* A route can be reached from more than one surface: the primary
|
|
500
|
+
* menu, a drawer, an account dropdown. Each occurrence rendered
|
|
501
|
+
* its whole SUBTREE, so a branch reachable three ways was drawn
|
|
502
|
+
* three times — bearable when a section had four children, noise
|
|
503
|
+
* once a node tree hangs there with fourteen.
|
|
504
|
+
*
|
|
505
|
+
* Exactly one occurrence owns the subtree; the others become
|
|
506
|
+
* references (`ref: true`, no children) — still real, clickable
|
|
507
|
+
* routes, just not repeated structure.
|
|
508
|
+
*
|
|
509
|
+
* Who owns it: the first occurrence in the NAV, then in `other`,
|
|
510
|
+
* then in the toolbar. The nav is where the app's structure
|
|
511
|
+
* lives; a toolbar entry pointing at the same route is a
|
|
512
|
+
* shortcut — a non-structural edge — and hanging the tree off it
|
|
513
|
+
* would bury the whole structure inside the account menu.
|
|
514
|
+
************************************************************/
|
|
515
|
+
function dedupe_subtrees(groups) {
|
|
516
|
+
let owner = {};
|
|
517
|
+
let visit = (node) => {
|
|
518
|
+
if (node.route) {
|
|
519
|
+
if (owner[node.route] === void 0) owner[node.route] = node;
|
|
520
|
+
else if (owner[node.route] !== node) {
|
|
521
|
+
node.ref = true;
|
|
522
|
+
node.children = [];
|
|
523
|
+
return;
|
|
524
|
+
}
|
|
525
|
+
}
|
|
526
|
+
if (Array.isArray(node.children)) node.children.forEach(visit);
|
|
527
|
+
};
|
|
528
|
+
for (let group of groups) group.forEach(visit);
|
|
529
|
+
}
|
|
530
|
+
/************************************************************
|
|
486
531
|
* Mark "you are here": the node whose route best matches
|
|
487
532
|
* current_route — exact hit wins, else the LONGEST declared
|
|
488
533
|
* route that is a path-prefix of it (the base view of a deep
|
|
@@ -492,6 +537,7 @@ function mark_current(groups, current_route) {
|
|
|
492
537
|
if (!current_route) return;
|
|
493
538
|
let best = null;
|
|
494
539
|
let visit = (n) => {
|
|
540
|
+
if (n.ref) return;
|
|
495
541
|
if (n.route) {
|
|
496
542
|
if (n.route === current_route) {
|
|
497
543
|
if (!best || best.node.route !== current_route) best = {
|
|
@@ -609,6 +655,11 @@ function build_nav_map(input) {
|
|
|
609
655
|
});
|
|
610
656
|
}
|
|
611
657
|
other.forEach(enrich);
|
|
658
|
+
dedupe_subtrees([
|
|
659
|
+
nav,
|
|
660
|
+
other,
|
|
661
|
+
toolbar
|
|
662
|
+
]);
|
|
612
663
|
mark_current([
|
|
613
664
|
toolbar,
|
|
614
665
|
nav,
|
|
@@ -770,6 +821,7 @@ var attrs_table$17 = [
|
|
|
770
821
|
SDATA(data_type_t.DTP_JSON, "config", 0, null, "Shell declarative config (zones, menu, stages, toolbar)"),
|
|
771
822
|
SDATA(data_type_t.DTP_STRING, "default_route", 0, "", "Fallback route if hash is empty"),
|
|
772
823
|
SDATA(data_type_t.DTP_STRING, "current_route", 0, "", "Current active route"),
|
|
824
|
+
SDATA(data_type_t.DTP_BOOLEAN, "remember_section_position", 0, false, "A menu click returns to the last position visited inside that section"),
|
|
773
825
|
SDATA(data_type_t.DTP_BOOLEAN, "use_hash", 0, true, "Bind navigation to window.location.hash"),
|
|
774
826
|
SDATA(data_type_t.DTP_POINTER, "mount_element", 0, null, "HTMLElement to mount shell into (default: document.body)"),
|
|
775
827
|
SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Root HTMLElement of the shell"),
|
|
@@ -781,6 +833,7 @@ var PRIVATE_DATA$17 = {
|
|
|
781
833
|
stages: {},
|
|
782
834
|
navs: [],
|
|
783
835
|
item_index: {},
|
|
836
|
+
section_pos: {},
|
|
784
837
|
sub_routes: {},
|
|
785
838
|
event_handlers: {},
|
|
786
839
|
hash_handler: null,
|
|
@@ -828,6 +881,8 @@ function mt_start$14(gobj) {
|
|
|
828
881
|
]));
|
|
829
882
|
return;
|
|
830
883
|
}
|
|
884
|
+
let shell_cfg = config.shell || {};
|
|
885
|
+
if (typeof shell_cfg.remember_section_position === "boolean") gobj_write_attr(gobj, "remember_section_position", shell_cfg.remember_section_position);
|
|
831
886
|
build_item_index(gobj, config);
|
|
832
887
|
instantiate_menus(gobj, config);
|
|
833
888
|
build_toolbar(gobj, config);
|
|
@@ -1187,6 +1242,59 @@ function build_item_index(gobj, config) {
|
|
|
1187
1242
|
menu_id: prev && prev.menu_id || ""
|
|
1188
1243
|
};
|
|
1189
1244
|
}
|
|
1245
|
+
index_node_tree(gobj, config);
|
|
1246
|
+
}
|
|
1247
|
+
/************************************************************
|
|
1248
|
+
* config.shell.tree — the navigation is a TREE OF NODES and
|
|
1249
|
+
* its root is where the shell's own root used to be.
|
|
1250
|
+
*
|
|
1251
|
+
* The shell keeps what it is good at, the SPACE: zones, layers,
|
|
1252
|
+
* stages, toolbar, overlays, theme, breakpoints. It stops being
|
|
1253
|
+
* the owner of the menu: the root C_YUI_NODE holds the primary
|
|
1254
|
+
* options as its children and projects them into zones (a left
|
|
1255
|
+
* rail, a bottom bar) exactly as `menu.primary.render` used to
|
|
1256
|
+
* say — a per-zone projection is still a projection.
|
|
1257
|
+
*
|
|
1258
|
+
* All this does is synthesize ONE route entry. `owns_subtree`
|
|
1259
|
+
* lets it match as the ancestor of everything (route_resolver),
|
|
1260
|
+
* so the whole url space below it is the tree's `subpath` and no
|
|
1261
|
+
* route table grows. The unknown-route diagnostic is not lost:
|
|
1262
|
+
* it moves to the node that knows the names of its children.
|
|
1263
|
+
*
|
|
1264
|
+
* `menu` and `tree` are not exclusive — an app may declare both
|
|
1265
|
+
* while it migrates — but a tree at "/" owns every route no
|
|
1266
|
+
* other entry claims, which is the point.
|
|
1267
|
+
************************************************************/
|
|
1268
|
+
function index_node_tree(gobj, config) {
|
|
1269
|
+
let priv = gobj.priv;
|
|
1270
|
+
let tree = config.shell && config.shell.tree || null;
|
|
1271
|
+
if (!tree) return;
|
|
1272
|
+
if (!is_object(tree)) {
|
|
1273
|
+
log_error("C_YUI_SHELL: config.shell.tree must be an object");
|
|
1274
|
+
return;
|
|
1275
|
+
}
|
|
1276
|
+
let base_route = normalize_route(tree.base_route || "/");
|
|
1277
|
+
let kw = {};
|
|
1278
|
+
for (let key of Object.keys(tree)) {
|
|
1279
|
+
if (key.charAt(0) === "_" || key === "stage") continue;
|
|
1280
|
+
kw[key] = tree[key];
|
|
1281
|
+
}
|
|
1282
|
+
kw.base_route = base_route;
|
|
1283
|
+
if (!kw.node_id) kw.node_id = "root";
|
|
1284
|
+
let prev = priv.item_index[base_route];
|
|
1285
|
+
priv.item_index[base_route] = {
|
|
1286
|
+
item: prev && prev.item || null,
|
|
1287
|
+
parent_item: prev && prev.parent_item || null,
|
|
1288
|
+
stage: tree.stage || "main",
|
|
1289
|
+
menu_id: prev && prev.menu_id || "",
|
|
1290
|
+
target: {
|
|
1291
|
+
stage: tree.stage || "main",
|
|
1292
|
+
gclass: "C_YUI_NODE",
|
|
1293
|
+
lifecycle: "keep_alive",
|
|
1294
|
+
owns_subtree: true,
|
|
1295
|
+
kw
|
|
1296
|
+
}
|
|
1297
|
+
};
|
|
1190
1298
|
}
|
|
1191
1299
|
/************************************************************
|
|
1192
1300
|
* For each menu declared: for each zone hosting it, create
|
|
@@ -1431,6 +1539,7 @@ function navigate_to(gobj, route, depth, no_drain) {
|
|
|
1431
1539
|
if ($c) $c.classList.remove("is-hidden");
|
|
1432
1540
|
stage.active_route = matched_route;
|
|
1433
1541
|
gobj_write_attr(gobj, "current_route", route);
|
|
1542
|
+
remember_position(gobj, route);
|
|
1434
1543
|
update_secondary_nav_visibility(gobj, entry);
|
|
1435
1544
|
close_all_drawers(gobj);
|
|
1436
1545
|
close_toolbar_dropdown(gobj);
|
|
@@ -2055,7 +2164,11 @@ function pop_escape(gobj, handler) {
|
|
|
2055
2164
|
* - navigate_to() drains (closes) every registered overlay when the
|
|
2056
2165
|
* RESTING route changes — overlays are transient and do not
|
|
2057
2166
|
* outlive the view they float above. An action route or a
|
|
2058
|
-
* subpath-only move keeps them open.
|
|
2167
|
+
* subpath-only move keeps them open. An overlay registered with
|
|
2168
|
+
* `keep_on_navigate` opts OUT of the drain: it is a NAVIGATION
|
|
2169
|
+
* PANEL, not a thing floating above one view — the site map is
|
|
2170
|
+
* the reference case, where every row click is meant to move the
|
|
2171
|
+
* user with the panel still up.
|
|
2059
2172
|
* - a drained/buried entry is left INERT: overlay_dismissed only
|
|
2060
2173
|
* history.back()s when the marker is the CURRENT history entry
|
|
2061
2174
|
* (adjacent, so the back() is invisible) — never over real route
|
|
@@ -2068,14 +2181,20 @@ function pop_escape(gobj, handler) {
|
|
|
2068
2181
|
function drain_overlays(gobj) {
|
|
2069
2182
|
let priv = gobj.priv;
|
|
2070
2183
|
if (!priv || !priv.overlay_stack) return;
|
|
2184
|
+
let kept = [];
|
|
2071
2185
|
while (priv.overlay_stack.length > 0) {
|
|
2072
2186
|
let entry = priv.overlay_stack.pop();
|
|
2187
|
+
if (entry.keep_on_navigate) {
|
|
2188
|
+
kept.unshift(entry);
|
|
2189
|
+
continue;
|
|
2190
|
+
}
|
|
2073
2191
|
try {
|
|
2074
2192
|
entry.close();
|
|
2075
2193
|
} catch (e) {
|
|
2076
2194
|
log_warning(`C_YUI_SHELL: overlay close on navigation failed: ${e}`);
|
|
2077
2195
|
}
|
|
2078
2196
|
}
|
|
2197
|
+
for (let entry of kept) priv.overlay_stack.push(entry);
|
|
2079
2198
|
}
|
|
2080
2199
|
function retag_overlay_hash(gobj, st, hash) {
|
|
2081
2200
|
let priv = gobj.priv;
|
|
@@ -2083,7 +2202,7 @@ function retag_overlay_hash(gobj, st, hash) {
|
|
|
2083
2202
|
let entry = priv.overlay_stack.find((e) => e.id === st.__yui_overlay__);
|
|
2084
2203
|
if (entry) entry.hash = hash;
|
|
2085
2204
|
}
|
|
2086
|
-
function push_overlay_history(gobj, close) {
|
|
2205
|
+
function push_overlay_history(gobj, close, opts) {
|
|
2087
2206
|
let priv = gobj.priv;
|
|
2088
2207
|
if (!priv || !priv.overlay_stack || !gobj_read_attr(gobj, "use_hash")) return null;
|
|
2089
2208
|
let entry = {
|
|
@@ -2214,6 +2333,7 @@ function update_secondary_nav_visibility(gobj, entry) {
|
|
|
2214
2333
|
function ac_nav_clicked(gobj, event, kw, src) {
|
|
2215
2334
|
let route = kw && kw.route || "";
|
|
2216
2335
|
if (empty_string(route)) return 0;
|
|
2336
|
+
route = remembered_position(gobj, route);
|
|
2217
2337
|
if (gobj_read_attr(gobj, "use_hash") && !route_restores_url(gobj, route)) {
|
|
2218
2338
|
let target_hash = route_to_hash(route);
|
|
2219
2339
|
if (window.location.hash !== target_hash) window.location.hash = target_hash;
|
|
@@ -2297,6 +2417,48 @@ function register_c_yui_shell() {
|
|
|
2297
2417
|
* bottom of the file to keep the skeleton layout intact.
|
|
2298
2418
|
***************************************************************/
|
|
2299
2419
|
/************************************************************
|
|
2420
|
+
* Last position inside each section — the routes a MENU CLICK
|
|
2421
|
+
* returns to (`remember_section_position`).
|
|
2422
|
+
*
|
|
2423
|
+
* A section is a menu item's route; anything under it is a
|
|
2424
|
+
* position inside it. The memory MIRRORS the url and is never
|
|
2425
|
+
* the authority for it (ROUTING.md §3): it lives for the page,
|
|
2426
|
+
* not on disk, and only a click on the section's own menu item
|
|
2427
|
+
* consults it. Typing the url, a deep link, Back/Forward and
|
|
2428
|
+
* programmatic navigation all land exactly where they say —
|
|
2429
|
+
* which is the property that would be lost if this were stored
|
|
2430
|
+
* and applied everywhere.
|
|
2431
|
+
************************************************************/
|
|
2432
|
+
function remember_position(gobj, route) {
|
|
2433
|
+
let priv = gobj.priv;
|
|
2434
|
+
if (!gobj_read_attr(gobj, "remember_section_position")) return;
|
|
2435
|
+
for (let section of Object.keys(priv.item_index)) {
|
|
2436
|
+
if (section === "/") continue;
|
|
2437
|
+
if (route === section || route.indexOf(section + "/") === 0) priv.section_pos[section] = route;
|
|
2438
|
+
}
|
|
2439
|
+
}
|
|
2440
|
+
/************************************************************
|
|
2441
|
+
* Where a click on `route` should actually land: the last
|
|
2442
|
+
* position inside it, when there is one and it still resolves.
|
|
2443
|
+
* A remembered route whose node has since disappeared is
|
|
2444
|
+
* dropped rather than followed — the tree is allowed to change
|
|
2445
|
+
* under a memory.
|
|
2446
|
+
************************************************************/
|
|
2447
|
+
function remembered_position(gobj, route) {
|
|
2448
|
+
let priv = gobj.priv;
|
|
2449
|
+
if (!gobj_read_attr(gobj, "remember_section_position")) return route;
|
|
2450
|
+
let current = gobj_read_attr(gobj, "current_route") || "";
|
|
2451
|
+
if (current === route || current.indexOf(route + "/") === 0) return route;
|
|
2452
|
+
let last = priv.section_pos[route];
|
|
2453
|
+
if (!last || last === route) return route;
|
|
2454
|
+
let r = resolve_route(priv.item_index, last);
|
|
2455
|
+
if (!r || !r.entry || !r.entry.target) {
|
|
2456
|
+
delete priv.section_pos[route];
|
|
2457
|
+
return route;
|
|
2458
|
+
}
|
|
2459
|
+
return last;
|
|
2460
|
+
}
|
|
2461
|
+
/************************************************************
|
|
2300
2462
|
* Resolve the shell that governs `gobj`: the nearest
|
|
2301
2463
|
* C_YUI_SHELL ancestor, else the last shell created on the
|
|
2302
2464
|
* page (apps have exactly one). Null when no shell exists —
|
|
@@ -2398,8 +2560,8 @@ function yui_shell_push_escape(shell_gobj, layer, handler) {
|
|
|
2398
2560
|
function yui_shell_pop_escape(shell_gobj, handler) {
|
|
2399
2561
|
pop_escape(shell_gobj, handler);
|
|
2400
2562
|
}
|
|
2401
|
-
function yui_shell_register_overlay(shell_gobj, close_fn) {
|
|
2402
|
-
return push_overlay_history(shell_gobj, close_fn);
|
|
2563
|
+
function yui_shell_register_overlay(shell_gobj, close_fn, opts) {
|
|
2564
|
+
return push_overlay_history(shell_gobj, close_fn, opts);
|
|
2403
2565
|
}
|
|
2404
2566
|
function yui_shell_overlay_dismissed(shell_gobj, overlay) {
|
|
2405
2567
|
overlay_dismissed(shell_gobj, overlay);
|
|
@@ -3003,6 +3165,7 @@ var attrs_table$16 = [
|
|
|
3003
3165
|
SDATA(data_type_t.DTP_BOOLEAN, "modal", 0, false, "Enable modal mode"),
|
|
3004
3166
|
SDATA(data_type_t.DTP_BOOLEAN, "keyboard", 0, true, "Close window on ESC if not modal"),
|
|
3005
3167
|
SDATA(data_type_t.DTP_BOOLEAN, "back_dismissable", 0, true, "Browser Back closes this window (floating overlays only; ignored when it has a `manager`)"),
|
|
3168
|
+
SDATA(data_type_t.DTP_BOOLEAN, "keep_on_navigate", 0, false, "This window is a navigation PANEL: a route change does not close it"),
|
|
3006
3169
|
SDATA(data_type_t.DTP_POINTER, "back_overlay", 0, null, "Internal: overlay-history entry (Back-button integration)"),
|
|
3007
3170
|
SDATA(data_type_t.DTP_POINTER, "$container", 0, null, "Internal: Window container element"),
|
|
3008
3171
|
SDATA(data_type_t.DTP_STRING, "window_id", 0, "", "Internal: Window ID"),
|
|
@@ -3027,10 +3190,10 @@ function mt_create$16(gobj) {
|
|
|
3027
3190
|
let $c = gobj_read_attr(gobj, "$container");
|
|
3028
3191
|
if ($c) $c.addEventListener("pointerdown", function() {
|
|
3029
3192
|
let m = gobj_read_pointer_attr(gobj, "manager");
|
|
3030
|
-
if (m) gobj_send_event
|
|
3193
|
+
if (m) gobj_send_event(m, "EV_FOCUS_WINDOW", { window: gobj }, gobj);
|
|
3031
3194
|
}, true);
|
|
3032
3195
|
let chip_title = composed_title(gobj);
|
|
3033
|
-
gobj_send_event
|
|
3196
|
+
gobj_send_event(manager, "EV_REGISTER_WINDOW", {
|
|
3034
3197
|
window: gobj,
|
|
3035
3198
|
title: chip_title ? chip_title : gobj_short_name(gobj),
|
|
3036
3199
|
title_key: gobj_read_str_attr(gobj, "title") || "",
|
|
@@ -3042,7 +3205,7 @@ function mt_create$16(gobj) {
|
|
|
3042
3205
|
let shell = yui_shell_of(gobj);
|
|
3043
3206
|
if (shell) gobj_write_attr(gobj, "back_overlay", yui_shell_register_overlay(shell, function() {
|
|
3044
3207
|
close_window(gobj);
|
|
3045
|
-
}));
|
|
3208
|
+
}, { keep_on_navigate: gobj_read_bool_attr(gobj, "keep_on_navigate") }));
|
|
3046
3209
|
}
|
|
3047
3210
|
let on_win_resize = function() {
|
|
3048
3211
|
handleResize(gobj);
|
|
@@ -3055,7 +3218,7 @@ function mt_create$16(gobj) {
|
|
|
3055
3218
|
***************************************************************/
|
|
3056
3219
|
function mt_destroy$16(gobj) {
|
|
3057
3220
|
let manager = gobj_read_pointer_attr(gobj, "manager");
|
|
3058
|
-
if (manager) gobj_send_event
|
|
3221
|
+
if (manager) gobj_send_event(manager, "EV_UNREGISTER_WINDOW", { window: gobj }, gobj);
|
|
3059
3222
|
let back_overlay = gobj_read_attr(gobj, "back_overlay");
|
|
3060
3223
|
if (back_overlay) {
|
|
3061
3224
|
let shell = yui_shell_of(gobj);
|
|
@@ -3219,7 +3382,7 @@ function do_minimize(gobj) {
|
|
|
3219
3382
|
log_error(`${gobj_short_name(gobj)}: minimize without a window manager`);
|
|
3220
3383
|
return;
|
|
3221
3384
|
}
|
|
3222
|
-
gobj_send_event
|
|
3385
|
+
gobj_send_event(manager, "EV_MINIMIZE_WINDOW", { window: gobj }, gobj);
|
|
3223
3386
|
}
|
|
3224
3387
|
/************************************************************
|
|
3225
3388
|
* Build UI
|
|
@@ -4219,7 +4382,7 @@ function ac_register_window(gobj, event, kw, src) {
|
|
|
4219
4382
|
WC_X,
|
|
4220
4383
|
{ click: (evt) => {
|
|
4221
4384
|
evt.stopPropagation();
|
|
4222
|
-
gobj_send_event
|
|
4385
|
+
gobj_send_event(entry.gobj, "EV_CLOSE_WINDOW", {}, gobj);
|
|
4223
4386
|
} }
|
|
4224
4387
|
]
|
|
4225
4388
|
],
|
|
@@ -4486,7 +4649,7 @@ function build_ui$13(gobj) {
|
|
|
4486
4649
|
]],
|
|
4487
4650
|
{ click: function(evt) {
|
|
4488
4651
|
evt.stopPropagation();
|
|
4489
|
-
gobj_send_event
|
|
4652
|
+
gobj_send_event(gobj, "EV_POP_PAGE", {}, gobj);
|
|
4490
4653
|
} }
|
|
4491
4654
|
],
|
|
4492
4655
|
[
|
|
@@ -4517,7 +4680,7 @@ function build_ui$13(gobj) {
|
|
|
4517
4680
|
]],
|
|
4518
4681
|
{ click: function(evt) {
|
|
4519
4682
|
evt.stopPropagation();
|
|
4520
|
-
gobj_send_event
|
|
4683
|
+
gobj_send_event(gobj, "EV_DISCARD_PAGE", {}, gobj);
|
|
4521
4684
|
} }
|
|
4522
4685
|
]
|
|
4523
4686
|
]
|
|
@@ -4596,7 +4759,7 @@ function render_header(gobj) {
|
|
|
4596
4759
|
function forward_top(gobj, event, kw) {
|
|
4597
4760
|
let priv = gobj.priv;
|
|
4598
4761
|
let top = priv.stack[priv.stack.length - 1];
|
|
4599
|
-
if (top && top.gobj) gobj_send_event
|
|
4762
|
+
if (top && top.gobj) gobj_send_event(top.gobj, event, kw || {}, gobj);
|
|
4600
4763
|
}
|
|
4601
4764
|
/***************************
|
|
4602
4765
|
* Actions
|
|
@@ -5055,7 +5218,7 @@ function build_ui$12(gobj) {
|
|
|
5055
5218
|
]],
|
|
5056
5219
|
{ click: function(evt) {
|
|
5057
5220
|
evt.stopPropagation();
|
|
5058
|
-
gobj_send_event
|
|
5221
|
+
gobj_send_event(gobj, "EV_PREV", {}, gobj);
|
|
5059
5222
|
} }
|
|
5060
5223
|
], [
|
|
5061
5224
|
"button",
|
|
@@ -5073,7 +5236,7 @@ function build_ui$12(gobj) {
|
|
|
5073
5236
|
]],
|
|
5074
5237
|
{ click: function(evt) {
|
|
5075
5238
|
evt.stopPropagation();
|
|
5076
|
-
gobj_send_event
|
|
5239
|
+
gobj_send_event(gobj, "EV_NEXT", {}, gobj);
|
|
5077
5240
|
} }
|
|
5078
5241
|
]]
|
|
5079
5242
|
]
|
|
@@ -5146,7 +5309,7 @@ function render_chrome(gobj) {
|
|
|
5146
5309
|
function forward_current(gobj, event, kw) {
|
|
5147
5310
|
let priv = gobj.priv;
|
|
5148
5311
|
let s = priv.steps[priv.idx];
|
|
5149
|
-
if (s && s.gobj) gobj_send_event
|
|
5312
|
+
if (s && s.gobj) gobj_send_event(s.gobj, event, kw || {}, gobj);
|
|
5150
5313
|
}
|
|
5151
5314
|
/************************************************************
|
|
5152
5315
|
* Accumulate the current step's kw, then advance or finish
|
|
@@ -5233,7 +5396,7 @@ function ac_next$1(gobj, event, kw, src) {
|
|
|
5233
5396
|
if (wizard_should_validate(gobj_read_attr(gobj, "linear"), !!(cur && cur.gobj))) {
|
|
5234
5397
|
if (priv.awaiting) return 0;
|
|
5235
5398
|
priv.awaiting = true;
|
|
5236
|
-
gobj_send_event
|
|
5399
|
+
gobj_send_event(cur.gobj, "EV_STEP_VALIDATE", {}, gobj);
|
|
5237
5400
|
return 0;
|
|
5238
5401
|
}
|
|
5239
5402
|
advance(gobj, {});
|
|
@@ -5564,7 +5727,7 @@ function yui_watch_theme(gobj, event = "EV_THEME") {
|
|
|
5564
5727
|
if (theme === last) return;
|
|
5565
5728
|
last = theme;
|
|
5566
5729
|
if (gobj_is_destroying(gobj)) return;
|
|
5567
|
-
gobj_send_event
|
|
5730
|
+
gobj_send_event(gobj, event, { theme }, gobj);
|
|
5568
5731
|
};
|
|
5569
5732
|
let mo = new MutationObserver(notify);
|
|
5570
5733
|
mo.observe($html, {
|
|
@@ -5658,7 +5821,7 @@ function mt_destroy$12(gobj) {
|
|
|
5658
5821
|
************************************************************/
|
|
5659
5822
|
function mt_start$11(gobj) {
|
|
5660
5823
|
let record = gobj_read_attr(gobj, "record");
|
|
5661
|
-
if (record) gobj_send_event
|
|
5824
|
+
if (record) gobj_send_event(gobj, "EV_LOAD_RECORD", record, gobj);
|
|
5662
5825
|
}
|
|
5663
5826
|
/************************************************************
|
|
5664
5827
|
* Framework Method stop
|
|
@@ -5704,12 +5867,12 @@ function set_changed_stated(gobj, changed) {
|
|
|
5704
5867
|
$form.querySelectorAll(".yui-tabulator-table").forEach(($table) => {
|
|
5705
5868
|
if (isEventSet($table.tabulator, "dataChanged")) $table.tabulator.off("dataChanged");
|
|
5706
5869
|
$table.tabulator.on("dataChanged", function(data) {
|
|
5707
|
-
gobj_send_event
|
|
5870
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
5708
5871
|
});
|
|
5709
5872
|
$table.querySelectorAll(".yui-tabulator-table-nested").forEach(($table_nested) => {
|
|
5710
5873
|
if (isEventSet($table_nested.tabulator, "dataChanged")) $table_nested.tabulator.off("dataChanged");
|
|
5711
5874
|
$table_nested.tabulator.on("dataChanged", function(data) {
|
|
5712
|
-
gobj_send_event
|
|
5875
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
5713
5876
|
});
|
|
5714
5877
|
});
|
|
5715
5878
|
});
|
|
@@ -5722,7 +5885,7 @@ function set_changed_stated(gobj, changed) {
|
|
|
5722
5885
|
async function readClipboard$1(gobj) {
|
|
5723
5886
|
try {
|
|
5724
5887
|
const text = await navigator.clipboard.readText();
|
|
5725
|
-
gobj_send_event
|
|
5888
|
+
gobj_send_event(gobj, "EV_PASTE_RECORD", JSON.parse(text), gobj);
|
|
5726
5889
|
} catch (error) {
|
|
5727
5890
|
log_error(`Failed to read clipboard contents: ${error}`);
|
|
5728
5891
|
}
|
|
@@ -5779,7 +5942,7 @@ function build_ui$11(gobj) {
|
|
|
5779
5942
|
]],
|
|
5780
5943
|
{ click: function(evt) {
|
|
5781
5944
|
evt.stopPropagation();
|
|
5782
|
-
gobj_send_event
|
|
5945
|
+
gobj_send_event(gobj, "EV_SAVE_RECORD", {}, gobj);
|
|
5783
5946
|
} }
|
|
5784
5947
|
],
|
|
5785
5948
|
[
|
|
@@ -5804,7 +5967,7 @@ function build_ui$11(gobj) {
|
|
|
5804
5967
|
]],
|
|
5805
5968
|
{ click: function(evt) {
|
|
5806
5969
|
evt.stopPropagation();
|
|
5807
|
-
gobj_send_event
|
|
5970
|
+
gobj_send_event(gobj, "EV_UNDO_RECORD", {}, gobj);
|
|
5808
5971
|
} }
|
|
5809
5972
|
],
|
|
5810
5973
|
[
|
|
@@ -5828,7 +5991,7 @@ function build_ui$11(gobj) {
|
|
|
5828
5991
|
]],
|
|
5829
5992
|
{ click: function(evt) {
|
|
5830
5993
|
evt.stopPropagation();
|
|
5831
|
-
gobj_send_event
|
|
5994
|
+
gobj_send_event(gobj, "EV_CLEAR_RECORD", {}, gobj);
|
|
5832
5995
|
} }
|
|
5833
5996
|
]
|
|
5834
5997
|
]
|
|
@@ -5859,7 +6022,7 @@ function build_ui$11(gobj) {
|
|
|
5859
6022
|
]],
|
|
5860
6023
|
{ click: function(evt) {
|
|
5861
6024
|
evt.stopPropagation();
|
|
5862
|
-
gobj_send_event
|
|
6025
|
+
gobj_send_event(gobj, "EV_COPY_RECORD", {}, gobj);
|
|
5863
6026
|
} }
|
|
5864
6027
|
], [
|
|
5865
6028
|
"button",
|
|
@@ -6436,7 +6599,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6436
6599
|
{ click: function(evt) {
|
|
6437
6600
|
evt.stopPropagation();
|
|
6438
6601
|
evt.preventDefault();
|
|
6439
|
-
gobj_send_event
|
|
6602
|
+
gobj_send_event(gobj, "EV_ADD_TABLE_ROW", kw_add_table_row, gobj);
|
|
6440
6603
|
} }
|
|
6441
6604
|
]]
|
|
6442
6605
|
]]
|
|
@@ -6536,7 +6699,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6536
6699
|
$h.style.display = "block";
|
|
6537
6700
|
},
|
|
6538
6701
|
"input": function(evt) {
|
|
6539
|
-
gobj_send_event
|
|
6702
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6540
6703
|
},
|
|
6541
6704
|
"blur": function(evt) {
|
|
6542
6705
|
if (!this.checkValidity()) {
|
|
@@ -6591,7 +6754,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6591
6754
|
option
|
|
6592
6755
|
]),
|
|
6593
6756
|
{ "change": function(evt) {
|
|
6594
|
-
gobj_send_event
|
|
6757
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6595
6758
|
} }
|
|
6596
6759
|
]
|
|
6597
6760
|
]);
|
|
@@ -6634,7 +6797,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6634
6797
|
}
|
|
6635
6798
|
});
|
|
6636
6799
|
$extend.tom_select.on("change", function() {
|
|
6637
|
-
gobj_send_event
|
|
6800
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6638
6801
|
});
|
|
6639
6802
|
break;
|
|
6640
6803
|
}
|
|
@@ -6650,7 +6813,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6650
6813
|
},
|
|
6651
6814
|
"",
|
|
6652
6815
|
{ "change": function(evt) {
|
|
6653
|
-
gobj_send_event
|
|
6816
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6654
6817
|
} }
|
|
6655
6818
|
]
|
|
6656
6819
|
]);
|
|
@@ -6683,7 +6846,7 @@ function create_form_field(gobj, $form, prefix, field_desc, { tag, inputType, na
|
|
|
6683
6846
|
props: {
|
|
6684
6847
|
readOnly: !!readonly,
|
|
6685
6848
|
onChange: function() {
|
|
6686
|
-
gobj_send_event
|
|
6849
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6687
6850
|
},
|
|
6688
6851
|
timestampTag: function({ field, value, path }) {
|
|
6689
6852
|
return field === "__t__" || field === "__tm__" || field === "tm" || field === "t" || field === "time" || field === "from_t" || field === "to_t" || field === "t_input" || field === "t_output" || field === "from_tm" || field === "to_tm";
|
|
@@ -6759,7 +6922,7 @@ function create_coordinates(gobj, attrs) {
|
|
|
6759
6922
|
let $h = $input.closest(".xcontrol").parentNode.querySelector(".help");
|
|
6760
6923
|
$h.textContent = "";
|
|
6761
6924
|
$h.style.display = "none";
|
|
6762
|
-
gobj_send_event
|
|
6925
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6763
6926
|
}
|
|
6764
6927
|
function showError(error) {
|
|
6765
6928
|
let errorMsg = "";
|
|
@@ -6805,7 +6968,7 @@ function create_coordinates(gobj, attrs) {
|
|
|
6805
6968
|
},
|
|
6806
6969
|
"",
|
|
6807
6970
|
{ "input": function(evt) {
|
|
6808
|
-
gobj_send_event
|
|
6971
|
+
gobj_send_event(gobj, "EV_RECORD_CHANGED", {}, gobj);
|
|
6809
6972
|
} }
|
|
6810
6973
|
], [
|
|
6811
6974
|
"span",
|
|
@@ -6935,7 +7098,7 @@ function template2columns(gobj, columns, template, sub_elements) {
|
|
|
6935
7098
|
cellClick: function(evt, cell) {
|
|
6936
7099
|
evt.stopPropagation();
|
|
6937
7100
|
let $row = cell.getRow().getElement();
|
|
6938
|
-
gobj_send_event
|
|
7101
|
+
gobj_send_event(gobj, "EV_ADD_TABLE_ROW", {
|
|
6939
7102
|
$row,
|
|
6940
7103
|
$table: $row.querySelector(`[name="${field_desc.name}"]`),
|
|
6941
7104
|
record: {},
|
|
@@ -7313,14 +7476,14 @@ function load_tabulator_data(gobj, $table, value) {
|
|
|
7313
7476
|
return;
|
|
7314
7477
|
}
|
|
7315
7478
|
let tabulator = $table.tabulator;
|
|
7316
|
-
if (tabulator.initialized) for (let row of value) gobj_send_event
|
|
7479
|
+
if (tabulator.initialized) for (let row of value) gobj_send_event(gobj, "EV_ADD_TABLE_ROW", {
|
|
7317
7480
|
$row: null,
|
|
7318
7481
|
$table,
|
|
7319
7482
|
record: row,
|
|
7320
7483
|
loading: true
|
|
7321
7484
|
}, gobj);
|
|
7322
7485
|
else tabulator.on("tableBuilt", function() {
|
|
7323
|
-
for (let row of value) gobj_send_event
|
|
7486
|
+
for (let row of value) gobj_send_event(gobj, "EV_ADD_TABLE_ROW", {
|
|
7324
7487
|
$row: null,
|
|
7325
7488
|
$table,
|
|
7326
7489
|
record: row,
|
|
@@ -7854,7 +8017,7 @@ var EditControl = class {
|
|
|
7854
8017
|
this.$btn_marker_drag.querySelector("svg").style.fill = "blue";
|
|
7855
8018
|
this._enable_moving_markers = true;
|
|
7856
8019
|
}
|
|
7857
|
-
gobj_send_event
|
|
8020
|
+
gobj_send_event(this.gobj, "EV_EDIT_MAP", { enable_moving_markers: this._enable_moving_markers }, this.gobj);
|
|
7858
8021
|
}
|
|
7859
8022
|
};
|
|
7860
8023
|
var MarkerControl = class {
|
|
@@ -7924,7 +8087,7 @@ var MarkerControl = class {
|
|
|
7924
8087
|
}
|
|
7925
8088
|
_toggle_center_map() {
|
|
7926
8089
|
if (this._enable_center_map) {}
|
|
7927
|
-
gobj_send_event
|
|
8090
|
+
gobj_send_event(this.gobj, "EV_CONTROL_MAP", { center_map: true }, this.gobj);
|
|
7928
8091
|
}
|
|
7929
8092
|
_toggle_user_location() {
|
|
7930
8093
|
if (this._enable_user_location) {
|
|
@@ -7934,7 +8097,7 @@ var MarkerControl = class {
|
|
|
7934
8097
|
this.$btn_user_location.querySelector("svg").style.fill = "blue";
|
|
7935
8098
|
this._enable_user_location = true;
|
|
7936
8099
|
}
|
|
7937
|
-
gobj_send_event
|
|
8100
|
+
gobj_send_event(this.gobj, "EV_CONTROL_MAP", { user_location: this._enable_user_location }, this.gobj);
|
|
7938
8101
|
}
|
|
7939
8102
|
};
|
|
7940
8103
|
//#endregion
|
|
@@ -8026,7 +8189,7 @@ function mt_create$11(gobj) {
|
|
|
8026
8189
|
});
|
|
8027
8190
|
map.addControl(priv.marker_user_position, "top-right");
|
|
8028
8191
|
map.on("load", () => {
|
|
8029
|
-
gobj_send_event
|
|
8192
|
+
gobj_send_event(gobj, "EV_MAP_ON_LOAD", {}, gobj);
|
|
8030
8193
|
});
|
|
8031
8194
|
map.on("zoomend", () => {});
|
|
8032
8195
|
if (gobj_read_bool_attr(gobj, "dimensions_with_parent_observer")) {
|
|
@@ -8339,7 +8502,7 @@ function onMove(gobj, e) {
|
|
|
8339
8502
|
let device = find_device(gobj, priv.draggedFeature.properties.id);
|
|
8340
8503
|
if (device) {
|
|
8341
8504
|
device.settings.coordinates = [coords.lng, coords.lat];
|
|
8342
|
-
gobj_send_event
|
|
8505
|
+
gobj_send_event(gobj, "EV_REFRESH", {}, gobj);
|
|
8343
8506
|
}
|
|
8344
8507
|
}
|
|
8345
8508
|
function onUp(gobj, e) {
|
|
@@ -8352,7 +8515,7 @@ function onUp(gobj, e) {
|
|
|
8352
8515
|
coordinates.latitude = coords.lat;
|
|
8353
8516
|
coordinates.longitude = coords.lng;
|
|
8354
8517
|
const gobj_service = gobj_find_service(priv.draggedFeature.properties.gobj_service_name, true);
|
|
8355
|
-
if (gobj_service) gobj_send_event
|
|
8518
|
+
if (gobj_service) gobj_send_event(gobj_service, "EV_SET_COORDINATES", coordinates, gobj);
|
|
8356
8519
|
}
|
|
8357
8520
|
function xmouseDown(gobj, e) {
|
|
8358
8521
|
let priv = gobj.priv;
|
|
@@ -9272,7 +9435,7 @@ function make_toolbar$3(gobj) {
|
|
|
9272
9435
|
}],
|
|
9273
9436
|
{ click: (evt) => {
|
|
9274
9437
|
evt.stopPropagation();
|
|
9275
|
-
gobj_send_event
|
|
9438
|
+
gobj_send_event(gobj, event_name, { evt }, gobj);
|
|
9276
9439
|
} }
|
|
9277
9440
|
]);
|
|
9278
9441
|
}
|
|
@@ -9320,7 +9483,7 @@ function build_graph$3(gobj) {
|
|
|
9320
9483
|
});
|
|
9321
9484
|
if (priv.theme) graph.setTheme(priv.theme);
|
|
9322
9485
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
9323
|
-
gobj_send_event
|
|
9486
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", { evt }, gobj);
|
|
9324
9487
|
});
|
|
9325
9488
|
graph.on(CanvasEvent.CLICK, (evt) => {});
|
|
9326
9489
|
if (typeof ResizeObserver !== "undefined") {
|
|
@@ -9330,7 +9493,7 @@ function build_graph$3(gobj) {
|
|
|
9330
9493
|
if (priv._resize_raf) cancelAnimationFrame(priv._resize_raf);
|
|
9331
9494
|
priv._resize_raf = requestAnimationFrame(() => {
|
|
9332
9495
|
priv._resize_raf = 0;
|
|
9333
|
-
if (priv.graph) gobj_send_event
|
|
9496
|
+
if (priv.graph) gobj_send_event(gobj, "EV_RESIZE", {}, gobj);
|
|
9334
9497
|
});
|
|
9335
9498
|
});
|
|
9336
9499
|
ro.observe($canvas);
|
|
@@ -10135,7 +10298,7 @@ function make_toolbar$2(gobj) {
|
|
|
10135
10298
|
},
|
|
10136
10299
|
[],
|
|
10137
10300
|
{ input: function(evt) {
|
|
10138
|
-
gobj_send_event
|
|
10301
|
+
gobj_send_event(gobj, "EV_SEARCH", { text: evt.target.value }, gobj);
|
|
10139
10302
|
} }
|
|
10140
10303
|
]);
|
|
10141
10304
|
let $search_control = createElement2([
|
|
@@ -10204,7 +10367,7 @@ function icon_button(gobj, icon, event_name, label_key) {
|
|
|
10204
10367
|
]],
|
|
10205
10368
|
{ click: function(evt) {
|
|
10206
10369
|
evt.stopPropagation();
|
|
10207
|
-
gobj_send_event
|
|
10370
|
+
gobj_send_event(gobj, event_name, {}, gobj);
|
|
10208
10371
|
} }
|
|
10209
10372
|
];
|
|
10210
10373
|
}
|
|
@@ -10355,7 +10518,7 @@ function push_collapsed_row(ctx, value, segments, depth, key, rows) {
|
|
|
10355
10518
|
};
|
|
10356
10519
|
let events = is_pending ? void 0 : { click: function(evt) {
|
|
10357
10520
|
evt.stopPropagation();
|
|
10358
|
-
gobj_send_event
|
|
10521
|
+
gobj_send_event(ctx.gobj, "EV_EXPAND_COLLAPSED", {
|
|
10359
10522
|
path,
|
|
10360
10523
|
size
|
|
10361
10524
|
}, ctx.gobj);
|
|
@@ -10420,7 +10583,7 @@ function toggle_row(gobj, key, size, is_object, depth, path, open) {
|
|
|
10420
10583
|
]],
|
|
10421
10584
|
{ click: function(evt) {
|
|
10422
10585
|
evt.stopPropagation();
|
|
10423
|
-
gobj_send_event
|
|
10586
|
+
gobj_send_event(gobj, "EV_TOGGLE_NODE", { path }, gobj);
|
|
10424
10587
|
} }
|
|
10425
10588
|
];
|
|
10426
10589
|
}
|
|
@@ -10488,10 +10651,19 @@ function leaf_row(key, value, depth) {
|
|
|
10488
10651
|
];
|
|
10489
10652
|
}
|
|
10490
10653
|
/************************************************************
|
|
10491
|
-
* Depth indentation (inline style keeps it CSS-framework free)
|
|
10654
|
+
* Depth indentation (inline style keeps it CSS-framework free).
|
|
10655
|
+
*
|
|
10656
|
+
* FOUR characters per level, house rule: structure is read as
|
|
10657
|
+
* indentation, and it has to be the same four everywhere — this
|
|
10658
|
+
* viewer, the raw dump behind it, the site map's tree. `ch` is
|
|
10659
|
+
* the character width of the row's own font, so the rows line up
|
|
10660
|
+
* with the monospace text they carry instead of drifting from it
|
|
10661
|
+
* at some zoom level.
|
|
10492
10662
|
************************************************************/
|
|
10663
|
+
var INDENT_CH = 4;
|
|
10664
|
+
var INDENT_PAD = .4;
|
|
10493
10665
|
function row_indent(depth) {
|
|
10494
|
-
return "padding-left:" + (
|
|
10666
|
+
return "padding-left:" + (INDENT_PAD + depth * INDENT_CH) + "ch;background-size:" + depth * INDENT_CH + "ch 100%;";
|
|
10495
10667
|
}
|
|
10496
10668
|
/************************************************************
|
|
10497
10669
|
* String() that never throws on a non-primitive
|
|
@@ -10631,7 +10803,7 @@ function ac_collapse_all$1(gobj, event, kw, src) {
|
|
|
10631
10803
|
function ac_copy_all(gobj, event, kw, src) {
|
|
10632
10804
|
let priv = gobj.priv;
|
|
10633
10805
|
if (priv.root === null || priv.root === void 0) return 0;
|
|
10634
|
-
let text = JSON.stringify(priv.root, null,
|
|
10806
|
+
let text = JSON.stringify(priv.root, null, 4);
|
|
10635
10807
|
if (navigator.clipboard && navigator.clipboard.writeText) navigator.clipboard.writeText(text).catch(function(e) {
|
|
10636
10808
|
log_error(`${GCLASS_NAME$8}: clipboard write failed: ${e}`);
|
|
10637
10809
|
});
|
|
@@ -11132,7 +11304,7 @@ function build_ui$7(gobj) {
|
|
|
11132
11304
|
evt.stopImmediatePropagation();
|
|
11133
11305
|
evt.preventDefault();
|
|
11134
11306
|
let node_id = $toggle.getAttribute("data-node-id");
|
|
11135
|
-
if (node_id) gobj_send_event
|
|
11307
|
+
if (node_id) gobj_send_event(gobj, "EV_TOGGLE_COLLAPSE", { node_id }, gobj);
|
|
11136
11308
|
}, true);
|
|
11137
11309
|
refresh_language($container, t);
|
|
11138
11310
|
}
|
|
@@ -11299,7 +11471,7 @@ function make_toolbar$1(gobj) {
|
|
|
11299
11471
|
}],
|
|
11300
11472
|
{ click: (evt) => {
|
|
11301
11473
|
evt.stopPropagation();
|
|
11302
|
-
gobj_send_event
|
|
11474
|
+
gobj_send_event(gobj, event_name, { evt }, gobj);
|
|
11303
11475
|
} }
|
|
11304
11476
|
]);
|
|
11305
11477
|
}
|
|
@@ -11326,7 +11498,7 @@ function make_toolbar$1(gobj) {
|
|
|
11326
11498
|
options,
|
|
11327
11499
|
{ change: (evt) => {
|
|
11328
11500
|
let value = evt.target.value;
|
|
11329
|
-
gobj_send_event
|
|
11501
|
+
gobj_send_event(gobj, "EV_CHANGE_LAYOUT", { layout: value }, gobj);
|
|
11330
11502
|
} }
|
|
11331
11503
|
]);
|
|
11332
11504
|
priv.$layout_select = $select;
|
|
@@ -11376,7 +11548,7 @@ function build_graph$2(gobj) {
|
|
|
11376
11548
|
});
|
|
11377
11549
|
if (priv.theme) graph.setTheme(priv.theme);
|
|
11378
11550
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
11379
|
-
gobj_send_event
|
|
11551
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", { evt }, gobj);
|
|
11380
11552
|
});
|
|
11381
11553
|
graph.on(CanvasEvent.CLICK, (evt) => {
|
|
11382
11554
|
hide_popover(gobj);
|
|
@@ -11388,7 +11560,7 @@ function build_graph$2(gobj) {
|
|
|
11388
11560
|
if (priv._resize_raf) cancelAnimationFrame(priv._resize_raf);
|
|
11389
11561
|
priv._resize_raf = requestAnimationFrame(() => {
|
|
11390
11562
|
priv._resize_raf = 0;
|
|
11391
|
-
if (priv.graph) gobj_send_event
|
|
11563
|
+
if (priv.graph) gobj_send_event(gobj, "EV_RESIZE", {}, gobj);
|
|
11392
11564
|
});
|
|
11393
11565
|
});
|
|
11394
11566
|
ro.observe($canvas);
|
|
@@ -12488,6 +12660,13 @@ function cards_grid_descriptor(items, show_label) {
|
|
|
12488
12660
|
* "cards" — grid of tappable cards (section-index landing;
|
|
12489
12661
|
* mounted as a stage view by C_YUI_SHELL when a
|
|
12490
12662
|
* primary item declares submenu.index)
|
|
12663
|
+
* "breadcrumb" — the PATH as one line ("Cards › Energy › South
|
|
12664
|
+
* hall › Meter 3"), each crumb a link to that
|
|
12665
|
+
* level. Unlike every other layout its items
|
|
12666
|
+
* are not a node's children but the trail down
|
|
12667
|
+
* to where the user is: the second way to show
|
|
12668
|
+
* depth, for when stacking one strip per level
|
|
12669
|
+
* costs more vertical room than it is worth.
|
|
12491
12670
|
* "backbar" — single "← <section>" link back to the section
|
|
12492
12671
|
* index; the mobile replacement of the tab strip
|
|
12493
12672
|
* for submenu.index sections (the shell collapses
|
|
@@ -12535,7 +12714,8 @@ var SUPPORTED_LAYOUTS = [
|
|
|
12535
12714
|
"submenu",
|
|
12536
12715
|
"accordion",
|
|
12537
12716
|
"cards",
|
|
12538
|
-
"backbar"
|
|
12717
|
+
"backbar",
|
|
12718
|
+
"breadcrumb"
|
|
12539
12719
|
];
|
|
12540
12720
|
function is_decorative(it) {
|
|
12541
12721
|
return !!(it && (it.type === "header" || it.type === "divider"));
|
|
@@ -12641,6 +12821,9 @@ function build_ui$6(gobj) {
|
|
|
12641
12821
|
case "backbar":
|
|
12642
12822
|
$container = render_backbar(gobj);
|
|
12643
12823
|
break;
|
|
12824
|
+
case "breadcrumb":
|
|
12825
|
+
$container = render_breadcrumb(gobj, items);
|
|
12826
|
+
break;
|
|
12644
12827
|
default: $container = render_vertical(gobj, items);
|
|
12645
12828
|
}
|
|
12646
12829
|
$container.setAttribute("data-nav-zone", zone);
|
|
@@ -12661,6 +12844,7 @@ function build_ui$6(gobj) {
|
|
|
12661
12844
|
}
|
|
12662
12845
|
wire_clicks(gobj, $container);
|
|
12663
12846
|
gobj_write_attr(gobj, "$container", $container);
|
|
12847
|
+
apply_active_route(gobj);
|
|
12664
12848
|
}
|
|
12665
12849
|
/************************************************************
|
|
12666
12850
|
* Rebuild the nav DOM in place from the current menu_items.
|
|
@@ -12679,7 +12863,6 @@ function rebuild(gobj) {
|
|
|
12679
12863
|
if ($new && was_hidden) $new.classList.add("is-hidden");
|
|
12680
12864
|
if (parent && $new) parent.insertBefore($new, next);
|
|
12681
12865
|
if ($old && $old.parentNode) $old.parentNode.removeChild($old);
|
|
12682
|
-
apply_active_route(gobj);
|
|
12683
12866
|
}
|
|
12684
12867
|
/************************************************************
|
|
12685
12868
|
* Re-apply the active-route highlight after a rebuild (the
|
|
@@ -12833,6 +13016,74 @@ function render_cards(gobj, items) {
|
|
|
12833
13016
|
* collapses the whole secondary zone (tabs and cards never
|
|
12834
13017
|
* coexist), so the bar needs no self-hiding logic.
|
|
12835
13018
|
************************************************************/
|
|
13019
|
+
/************************************************************
|
|
13020
|
+
* breadcrumb: the trail to here, one line.
|
|
13021
|
+
*
|
|
13022
|
+
* Bulma's own markup (nav.breadcrumb > ul > li, separators drawn by
|
|
13023
|
+
* CSS), with the SAME data-route/data-item-id contract as every
|
|
13024
|
+
* other layout — so the delegated click handler and the active
|
|
13025
|
+
* highlight work unchanged, and the last crumb marks itself through
|
|
13026
|
+
* `active_route` like a tab does.
|
|
13027
|
+
************************************************************/
|
|
13028
|
+
function render_breadcrumb(gobj, items) {
|
|
13029
|
+
let show_label = gobj_read_attr(gobj, "show_label");
|
|
13030
|
+
let lis = [];
|
|
13031
|
+
for (let it of items || []) {
|
|
13032
|
+
if (is_decorative(it)) continue;
|
|
13033
|
+
let children = [];
|
|
13034
|
+
if (it.icon) children.push([
|
|
13035
|
+
"span",
|
|
13036
|
+
{ class: "icon is-small" },
|
|
13037
|
+
["i", {
|
|
13038
|
+
class: it.icon,
|
|
13039
|
+
"aria-hidden": "true"
|
|
13040
|
+
}]
|
|
13041
|
+
]);
|
|
13042
|
+
if (show_label !== false) {
|
|
13043
|
+
let label = it.name || it.id || "";
|
|
13044
|
+
children.push([
|
|
13045
|
+
"span",
|
|
13046
|
+
{
|
|
13047
|
+
class: "yui-nav-label",
|
|
13048
|
+
i18n: label
|
|
13049
|
+
},
|
|
13050
|
+
label
|
|
13051
|
+
]);
|
|
13052
|
+
}
|
|
13053
|
+
let a_attrs = {
|
|
13054
|
+
class: "yui-nav-item yui-nav-crumb",
|
|
13055
|
+
href: it.route ? "#" + it.route : "#",
|
|
13056
|
+
"data-item-id": it.id,
|
|
13057
|
+
"data-route": it.route || "",
|
|
13058
|
+
"data-disabled": it.disabled ? "1" : "0"
|
|
13059
|
+
};
|
|
13060
|
+
if (it.name) {
|
|
13061
|
+
a_attrs["aria-label"] = it.name;
|
|
13062
|
+
a_attrs["data-i18n-aria-label"] = it.name;
|
|
13063
|
+
}
|
|
13064
|
+
lis.push([
|
|
13065
|
+
"li",
|
|
13066
|
+
{},
|
|
13067
|
+
[[
|
|
13068
|
+
"a",
|
|
13069
|
+
a_attrs,
|
|
13070
|
+
children
|
|
13071
|
+
]]
|
|
13072
|
+
]);
|
|
13073
|
+
}
|
|
13074
|
+
return createElement2([
|
|
13075
|
+
"nav",
|
|
13076
|
+
{
|
|
13077
|
+
class: "breadcrumb is-small",
|
|
13078
|
+
"aria-label": "breadcrumbs"
|
|
13079
|
+
},
|
|
13080
|
+
[[
|
|
13081
|
+
"ul",
|
|
13082
|
+
{},
|
|
13083
|
+
lis
|
|
13084
|
+
]]
|
|
13085
|
+
]);
|
|
13086
|
+
}
|
|
12836
13087
|
function render_backbar(gobj) {
|
|
12837
13088
|
let back_route = gobj_read_attr(gobj, "back_route") || "";
|
|
12838
13089
|
let label = gobj_read_attr(gobj, "nav_label") || "";
|
|
@@ -13238,6 +13489,7 @@ function register_c_yui_nav() {
|
|
|
13238
13489
|
//#endregion
|
|
13239
13490
|
//#region src/shell_route_map.js
|
|
13240
13491
|
var WIN_NAME$1 = "shell-route-map-window";
|
|
13492
|
+
var __show_refs__ = true;
|
|
13241
13493
|
var __open_modal__ = null;
|
|
13242
13494
|
function scroll_to_current($body) {
|
|
13243
13495
|
let $cur = $body.querySelector(".ROUTEMAP_CURRENT");
|
|
@@ -13283,6 +13535,16 @@ function render_node(node) {
|
|
|
13283
13535
|
{ class: "ROUTEMAP_EVENT" },
|
|
13284
13536
|
node.event
|
|
13285
13537
|
]);
|
|
13538
|
+
if (node.ref) row.push([
|
|
13539
|
+
"span",
|
|
13540
|
+
{
|
|
13541
|
+
class: "ROUTEMAP_REF",
|
|
13542
|
+
i18n: "shown above",
|
|
13543
|
+
title: "shown above",
|
|
13544
|
+
"data-i18n-title": "shown above"
|
|
13545
|
+
},
|
|
13546
|
+
"shown above"
|
|
13547
|
+
]);
|
|
13286
13548
|
if (node.current) row.push([
|
|
13287
13549
|
"span",
|
|
13288
13550
|
{
|
|
@@ -13291,7 +13553,7 @@ function render_node(node) {
|
|
|
13291
13553
|
},
|
|
13292
13554
|
"you are here"
|
|
13293
13555
|
]);
|
|
13294
|
-
let row_class = node.current ? " ROUTEMAP_CURRENT" : "";
|
|
13556
|
+
let row_class = (node.current ? " ROUTEMAP_CURRENT" : "") + (node.ref ? " ROUTEMAP_IS_REF" : "");
|
|
13295
13557
|
let $row;
|
|
13296
13558
|
if (node.route) $row = createElement2([
|
|
13297
13559
|
"a",
|
|
@@ -13324,21 +13586,37 @@ function render_node(node) {
|
|
|
13324
13586
|
* descendant matches (keep the ancestor path). Empty `q` shows all.
|
|
13325
13587
|
* Matches against the visible row text (name + route + event), so it
|
|
13326
13588
|
* honours the current translation. Returns whether the <li> is shown.
|
|
13589
|
+
*
|
|
13590
|
+
* `show_refs` off hides the reference rows — the second and third
|
|
13591
|
+
* place a route is reachable from, which carry no structure. They are
|
|
13592
|
+
* hidden by DEFAULT: in an app with a drawer and an account menu they
|
|
13593
|
+
* are a third of the map, and what a reader comes here for is the
|
|
13594
|
+
* structure. A ref stays hidden even inside a matched subtree — an
|
|
13595
|
+
* ancestor match must not smuggle it back in — and a group left with
|
|
13596
|
+
* nothing but refs collapses with them, since a group is only ever
|
|
13597
|
+
* shown by what it contains.
|
|
13327
13598
|
***************************************************************/
|
|
13328
|
-
function filter_li($li, q, ancestor_match) {
|
|
13599
|
+
function filter_li($li, q, ancestor_match, show_refs) {
|
|
13329
13600
|
let $row = $li.querySelector(":scope > .ROUTEMAP_ROW");
|
|
13330
13601
|
let text = $row ? ($row.textContent || "").toLowerCase() : "";
|
|
13602
|
+
let hidden_ref = !show_refs && !!($row && $row.classList.contains("ROUTEMAP_IS_REF"));
|
|
13331
13603
|
let self_match = q === "" || text.indexOf(q) >= 0;
|
|
13332
|
-
let show_all = ancestor_match || self_match;
|
|
13604
|
+
let show_all = (ancestor_match || self_match) && !hidden_ref;
|
|
13333
13605
|
let any_child = false;
|
|
13334
13606
|
let $ul = $li.querySelector(":scope > ul");
|
|
13335
13607
|
if ($ul) {
|
|
13336
13608
|
let kids = $ul.children;
|
|
13337
|
-
for (let i = 0; i < kids.length; i++) if (filter_li(kids[i], q, show_all)) any_child = true;
|
|
13609
|
+
for (let i = 0; i < kids.length; i++) if (filter_li(kids[i], q, show_all, show_refs)) any_child = true;
|
|
13338
13610
|
}
|
|
13339
|
-
let
|
|
13611
|
+
let is_group = !!($row && $row.classList.contains("ROUTEMAP_STRUCT"));
|
|
13612
|
+
let had_children = !!($ul && $ul.children.length);
|
|
13613
|
+
if (is_group && had_children && !any_child && !show_refs) {
|
|
13614
|
+
let kids = $ul.children;
|
|
13615
|
+
for (let i = 0; i < kids.length; i++) if (filter_li(kids[i], q, show_all, true)) any_child = true;
|
|
13616
|
+
}
|
|
13617
|
+
let visible = is_group && had_children ? any_child || q !== "" && self_match : (show_all || any_child) && !hidden_ref;
|
|
13340
13618
|
$li.style.display = visible ? "" : "none";
|
|
13341
|
-
if ($row) $row.classList.toggle("ROUTEMAP_MATCH", q !== "" && self_match);
|
|
13619
|
+
if ($row) $row.classList.toggle("ROUTEMAP_MATCH", q !== "" && self_match && visible);
|
|
13342
13620
|
return visible;
|
|
13343
13621
|
}
|
|
13344
13622
|
/***************************************************************
|
|
@@ -13348,16 +13626,17 @@ function filter_li($li, q, ancestor_match) {
|
|
|
13348
13626
|
* on a resting-route change. `on_jump()` closes the host for the
|
|
13349
13627
|
* one click that navigates nowhere (the current route).
|
|
13350
13628
|
***************************************************************/
|
|
13351
|
-
function build_body(shell, t
|
|
13629
|
+
function build_body(shell, t) {
|
|
13352
13630
|
let map = yui_shell_nav_map(shell);
|
|
13353
|
-
let children = [
|
|
13631
|
+
let children = [].concat(map.nav);
|
|
13632
|
+
if (Array.isArray(map.toolbar) && map.toolbar.length) children.push({
|
|
13354
13633
|
label: "toolbar",
|
|
13355
13634
|
icon: "",
|
|
13356
13635
|
route: "",
|
|
13357
13636
|
event: "",
|
|
13358
13637
|
kind: "group",
|
|
13359
13638
|
children: map.toolbar
|
|
13360
|
-
}
|
|
13639
|
+
});
|
|
13361
13640
|
if (Array.isArray(map.other) && map.other.length) children.push({
|
|
13362
13641
|
label: "other routes",
|
|
13363
13642
|
icon: "",
|
|
@@ -13410,21 +13689,53 @@ function build_body(shell, t, on_jump) {
|
|
|
13410
13689
|
"matches"
|
|
13411
13690
|
]]
|
|
13412
13691
|
]);
|
|
13692
|
+
let $refs_input = createElement2(["input", {
|
|
13693
|
+
class: "ROUTEMAP_REFS_INPUT",
|
|
13694
|
+
type: "checkbox"
|
|
13695
|
+
}]);
|
|
13696
|
+
if (__show_refs__) $refs_input.checked = true;
|
|
13697
|
+
let $refs_toggle = createElement2([
|
|
13698
|
+
"label",
|
|
13699
|
+
{
|
|
13700
|
+
class: "checkbox is-size-7 ROUTEMAP_REFS_TOGGLE",
|
|
13701
|
+
title: "show references",
|
|
13702
|
+
"data-i18n-title": "show references"
|
|
13703
|
+
},
|
|
13704
|
+
[$refs_input, [
|
|
13705
|
+
"span",
|
|
13706
|
+
{
|
|
13707
|
+
class: "ml-1",
|
|
13708
|
+
i18n: "show references"
|
|
13709
|
+
},
|
|
13710
|
+
"show references"
|
|
13711
|
+
]]
|
|
13712
|
+
]);
|
|
13413
13713
|
let $search_row = createElement2([
|
|
13414
13714
|
"div",
|
|
13415
13715
|
{ class: "ROUTEMAP_SEARCH_ROW mb-2" },
|
|
13416
|
-
[
|
|
13716
|
+
[
|
|
13717
|
+
$search_ctrl,
|
|
13718
|
+
$count,
|
|
13719
|
+
$refs_toggle
|
|
13720
|
+
]
|
|
13417
13721
|
]);
|
|
13418
|
-
|
|
13722
|
+
let apply_filter = function() {
|
|
13419
13723
|
let q = ($search.value || "").trim().toLowerCase();
|
|
13420
13724
|
let $root_li = $tree.querySelector(".ROUTEMAP_ROOT > li");
|
|
13421
|
-
if ($root_li) filter_li($root_li, q, false);
|
|
13725
|
+
if ($root_li) filter_li($root_li, q, false, __show_refs__);
|
|
13422
13726
|
if (q === "") $count.classList.add("is-hidden");
|
|
13423
13727
|
else {
|
|
13424
13728
|
$count_n.textContent = $tree.querySelectorAll(".ROUTEMAP_MATCH").length;
|
|
13425
13729
|
$count.classList.remove("is-hidden");
|
|
13426
13730
|
}
|
|
13731
|
+
};
|
|
13732
|
+
$search.addEventListener("input", apply_filter);
|
|
13733
|
+
$refs_input.addEventListener("change", function() {
|
|
13734
|
+
__show_refs__ = !!$refs_input.checked;
|
|
13735
|
+
apply_filter();
|
|
13427
13736
|
});
|
|
13737
|
+
if ($tree.querySelectorAll(".ROUTEMAP_IS_REF").length === 0) $refs_toggle.classList.add("is-hidden");
|
|
13738
|
+
apply_filter();
|
|
13428
13739
|
let $body = createElement2([
|
|
13429
13740
|
"div",
|
|
13430
13741
|
{ class: "C_YUI_SHELL_ROUTEMAP ROUTEMAP_BODY" },
|
|
@@ -13467,26 +13778,62 @@ function build_body(shell, t, on_jump) {
|
|
|
13467
13778
|
if ($area.parentNode) $area.parentNode.removeChild($area);
|
|
13468
13779
|
}
|
|
13469
13780
|
});
|
|
13470
|
-
|
|
13471
|
-
|
|
13472
|
-
|
|
13473
|
-
|
|
13474
|
-
if (href && typeof window !== "undefined" && window.location.hash === href && typeof on_jump === "function") {
|
|
13475
|
-
ev.preventDefault();
|
|
13476
|
-
on_jump();
|
|
13781
|
+
let on_hash = function() {
|
|
13782
|
+
if (typeof document === "undefined" || !$body.isConnected) {
|
|
13783
|
+
if (typeof window !== "undefined") window.removeEventListener("hashchange", on_hash);
|
|
13784
|
+
return;
|
|
13477
13785
|
}
|
|
13478
|
-
|
|
13786
|
+
mark_current_row($body, window.location.hash, t);
|
|
13787
|
+
};
|
|
13788
|
+
if (typeof window !== "undefined") window.addEventListener("hashchange", on_hash);
|
|
13479
13789
|
refresh_language($body, t);
|
|
13480
13790
|
return $body;
|
|
13481
13791
|
}
|
|
13482
13792
|
/***************************************************************
|
|
13793
|
+
* Move the "you are here" mark to the row that best matches
|
|
13794
|
+
* `hash`: an exact route wins, else the LONGEST declared route
|
|
13795
|
+
* that is a path-prefix of it (the base view of a deep subpath
|
|
13796
|
+
* position). Same rule as the model's mark_current(), applied
|
|
13797
|
+
* to the rendered rows so the open panel stays truthful.
|
|
13798
|
+
***************************************************************/
|
|
13799
|
+
function mark_current_row($body, hash, t) {
|
|
13800
|
+
let route = String(hash || "").replace(/^#/, "");
|
|
13801
|
+
let $best = null;
|
|
13802
|
+
let best_len = -1;
|
|
13803
|
+
for (let $a of $body.querySelectorAll(".ROUTEMAP_LINK")) {
|
|
13804
|
+
let r = String($a.getAttribute("href") || "").replace(/^#/, "");
|
|
13805
|
+
if (!r) continue;
|
|
13806
|
+
if (r === route) {
|
|
13807
|
+
$best = $a;
|
|
13808
|
+
break;
|
|
13809
|
+
}
|
|
13810
|
+
if (route.indexOf(r + "/") === 0 && r.length > best_len) {
|
|
13811
|
+
$best = $a;
|
|
13812
|
+
best_len = r.length;
|
|
13813
|
+
}
|
|
13814
|
+
}
|
|
13815
|
+
for (let $marked of $body.querySelectorAll(".ROUTEMAP_CURRENT")) $marked.classList.remove("ROUTEMAP_CURRENT");
|
|
13816
|
+
if (!$best) return;
|
|
13817
|
+
$best.classList.add("ROUTEMAP_CURRENT");
|
|
13818
|
+
let $badge = $body.querySelector(".ROUTEMAP_HERE");
|
|
13819
|
+
if (!$badge) $badge = createElement2([
|
|
13820
|
+
"span",
|
|
13821
|
+
{
|
|
13822
|
+
class: "ROUTEMAP_HERE",
|
|
13823
|
+
i18n: "you are here"
|
|
13824
|
+
},
|
|
13825
|
+
t ? t("you are here") : "you are here"
|
|
13826
|
+
]);
|
|
13827
|
+
$best.appendChild($badge);
|
|
13828
|
+
}
|
|
13829
|
+
/***************************************************************
|
|
13483
13830
|
* Show the site map. Toggles: a second call closes the open one.
|
|
13484
13831
|
***************************************************************/
|
|
13485
13832
|
function yui_shell_show_route_map(shell, opts) {
|
|
13486
13833
|
let t = opts && opts.t || i18next.t.bind(i18next);
|
|
13487
13834
|
let existing = gobj_find_service(WIN_NAME$1, false);
|
|
13488
13835
|
if (existing && is_gobj(existing)) {
|
|
13489
|
-
gobj_send_event
|
|
13836
|
+
gobj_send_event(existing, "EV_CLOSE_WINDOW", {}, shell);
|
|
13490
13837
|
return null;
|
|
13491
13838
|
}
|
|
13492
13839
|
if (__open_modal__) {
|
|
@@ -13497,9 +13844,7 @@ function yui_shell_show_route_map(shell, opts) {
|
|
|
13497
13844
|
}
|
|
13498
13845
|
if (gclass_find_by_name("C_YUI_WINDOW") !== null) {
|
|
13499
13846
|
let win_ref = { gobj: null };
|
|
13500
|
-
let $body = build_body(shell, t
|
|
13501
|
-
if (win_ref.gobj && is_gobj(win_ref.gobj)) gobj_send_event$1(win_ref.gobj, "EV_CLOSE_WINDOW", {}, shell);
|
|
13502
|
-
});
|
|
13847
|
+
let $body = build_body(shell, t);
|
|
13503
13848
|
let win = gobj_create_service(WIN_NAME$1, "C_YUI_WINDOW", {
|
|
13504
13849
|
$parent: yui_shell_popup_layer(shell) || typeof document !== "undefined" && document.getElementById("top-layer") || null,
|
|
13505
13850
|
subscriber: null,
|
|
@@ -13515,7 +13860,8 @@ function yui_shell_show_route_map(shell, opts) {
|
|
|
13515
13860
|
title: "site map",
|
|
13516
13861
|
icon: "yi-bars",
|
|
13517
13862
|
body: $body,
|
|
13518
|
-
manager:
|
|
13863
|
+
manager: gobj_find_service("__window_manager__", false),
|
|
13864
|
+
keep_on_navigate: true
|
|
13519
13865
|
}, shell);
|
|
13520
13866
|
if (!win) {
|
|
13521
13867
|
log_error("C_YUI_SHELL: cannot create the site-map window");
|
|
@@ -13527,9 +13873,7 @@ function yui_shell_show_route_map(shell, opts) {
|
|
|
13527
13873
|
return win;
|
|
13528
13874
|
}
|
|
13529
13875
|
let modal_ref = { modal: null };
|
|
13530
|
-
let $body = build_body(shell, t
|
|
13531
|
-
if (modal_ref.modal && typeof modal_ref.modal.close === "function") modal_ref.modal.close();
|
|
13532
|
-
});
|
|
13876
|
+
let $body = build_body(shell, t);
|
|
13533
13877
|
modal_ref.modal = yui_shell_show_modal(shell, $body, {
|
|
13534
13878
|
dialog: true,
|
|
13535
13879
|
logical_class: "ROUTEMAP_SHEET",
|
|
@@ -13713,7 +14057,7 @@ function build_ui$5(gobj) {
|
|
|
13713
14057
|
]],
|
|
13714
14058
|
{ click: (evt) => {
|
|
13715
14059
|
evt.stopPropagation();
|
|
13716
|
-
gobj_send_event
|
|
14060
|
+
gobj_send_event(gobj, "EV_BACK_TO_TOPICS", {}, gobj);
|
|
13717
14061
|
} }
|
|
13718
14062
|
],
|
|
13719
14063
|
[
|
|
@@ -13736,7 +14080,7 @@ function build_ui$5(gobj) {
|
|
|
13736
14080
|
]],
|
|
13737
14081
|
{ click: (evt) => {
|
|
13738
14082
|
evt.stopPropagation();
|
|
13739
|
-
gobj_send_event
|
|
14083
|
+
gobj_send_event(gobj, "EV_TOGGLE_LANDING_VIEW", {}, gobj);
|
|
13740
14084
|
} }
|
|
13741
14085
|
],
|
|
13742
14086
|
[
|
|
@@ -13760,7 +14104,7 @@ function build_ui$5(gobj) {
|
|
|
13760
14104
|
]],
|
|
13761
14105
|
{ click: (evt) => {
|
|
13762
14106
|
evt.stopPropagation();
|
|
13763
|
-
gobj_send_event
|
|
14107
|
+
gobj_send_event(gobj, "EV_OPEN_JSON", {}, gobj);
|
|
13764
14108
|
} }
|
|
13765
14109
|
]
|
|
13766
14110
|
]
|
|
@@ -13915,7 +14259,7 @@ function add_tab(gobj, gobj2, id, text, icon) {
|
|
|
13915
14259
|
* standalone use stays quiet.
|
|
13916
14260
|
************************************************************/
|
|
13917
14261
|
function select_topic_by_id(gobj, id) {
|
|
13918
|
-
gobj_send_event
|
|
14262
|
+
gobj_send_event(gobj, "EV_SHOW", { href: id }, gobj);
|
|
13919
14263
|
gobj_publish_event(gobj, "EV_TOPIC_SELECTED", { topic: id.indexOf("?") >= 0 ? id.split("?")[1] : id });
|
|
13920
14264
|
}
|
|
13921
14265
|
/************************************************************
|
|
@@ -14016,7 +14360,7 @@ function add_topic_card(gobj, id, text, icon) {
|
|
|
14016
14360
|
]);
|
|
14017
14361
|
if (gobj.priv._selected_card_topic === topic) $card.classList.add("is-selected");
|
|
14018
14362
|
$card.addEventListener("click", function() {
|
|
14019
|
-
gobj_send_event
|
|
14363
|
+
gobj_send_event(gobj, "EV_SELECT_TOPIC_CARD", { topic }, gobj);
|
|
14020
14364
|
});
|
|
14021
14365
|
$grid.appendChild($card);
|
|
14022
14366
|
refresh_language($card, t);
|
|
@@ -14049,7 +14393,7 @@ function show_topics_landing(gobj) {
|
|
|
14049
14393
|
if ($landing) $landing.classList.add("is-hidden");
|
|
14050
14394
|
if ($schema) $schema.classList.remove("is-hidden");
|
|
14051
14395
|
build_schema_child(gobj);
|
|
14052
|
-
if (gobj.priv.schema_gobj) gobj_send_event
|
|
14396
|
+
if (gobj.priv.schema_gobj) gobj_send_event(gobj.priv.schema_gobj, "EV_SHOW", {}, gobj);
|
|
14053
14397
|
} else {
|
|
14054
14398
|
if ($schema) $schema.classList.add("is-hidden");
|
|
14055
14399
|
if ($landing) $landing.classList.remove("is-hidden");
|
|
@@ -14368,14 +14712,14 @@ function process_treedb_descs$1(gobj) {
|
|
|
14368
14712
|
let ti = gobj.priv._pending_info;
|
|
14369
14713
|
gobj.priv._pending_info = null;
|
|
14370
14714
|
show_topic_info(gobj, ti);
|
|
14371
|
-
} else if (href && href.indexOf("?") >= 0) gobj_send_event
|
|
14715
|
+
} else if (href && href.indexOf("?") >= 0) gobj_send_event(gobj, "EV_SHOW", { href }, gobj);
|
|
14372
14716
|
else show_topics_landing(gobj);
|
|
14373
14717
|
else {
|
|
14374
14718
|
if (!href) try {
|
|
14375
14719
|
let topic = window.localStorage.getItem(`yui_treedb_topics:${gobj_name(gobj)}`);
|
|
14376
14720
|
if (topic) href = `${gobj_name(gobj)}?${topic}`;
|
|
14377
14721
|
} catch (e) {}
|
|
14378
|
-
gobj_send_event
|
|
14722
|
+
gobj_send_event(gobj, "EV_SHOW", { href }, gobj);
|
|
14379
14723
|
}
|
|
14380
14724
|
let kids = gobj_match_children(gobj, { __gclass_name__: "C_YUI_TREEDB_TOPIC_WITH_FORM" });
|
|
14381
14725
|
for (let i = 0; i < kids.length; i++) {
|
|
@@ -14565,7 +14909,7 @@ function open_json_viewer$1(gobj) {
|
|
|
14565
14909
|
t,
|
|
14566
14910
|
on_close: () => {
|
|
14567
14911
|
if (gobj_is_destroying(gobj)) return;
|
|
14568
|
-
gobj_send_event
|
|
14912
|
+
gobj_send_event(gobj, "EV_JSON_CLOSED", {}, gobj);
|
|
14569
14913
|
}
|
|
14570
14914
|
});
|
|
14571
14915
|
} else {
|
|
@@ -14589,7 +14933,7 @@ function open_json_viewer$1(gobj) {
|
|
|
14589
14933
|
manager: null,
|
|
14590
14934
|
on_close: () => {
|
|
14591
14935
|
if (gobj_is_destroying(gobj)) return;
|
|
14592
|
-
gobj_send_event
|
|
14936
|
+
gobj_send_event(gobj, "EV_JSON_CLOSED", {}, gobj);
|
|
14593
14937
|
}
|
|
14594
14938
|
}, gobj);
|
|
14595
14939
|
if (!priv.json_win) {
|
|
@@ -14641,7 +14985,7 @@ function request_print_tranger$1(gobj, path) {
|
|
|
14641
14985
|
if (!remote) {
|
|
14642
14986
|
log_error(`${gobj_short_name(gobj)}: No gobj_remote_yuno defined`);
|
|
14643
14987
|
let jv = priv.json_gobj;
|
|
14644
|
-
if (path && jv && is_gobj(jv) && !gobj_is_destroying(jv)) gobj_send_event
|
|
14988
|
+
if (path && jv && is_gobj(jv) && !gobj_is_destroying(jv)) gobj_send_event(jv, "EV_SUBTREE_ERROR", {
|
|
14645
14989
|
path,
|
|
14646
14990
|
error: t("no session")
|
|
14647
14991
|
}, gobj);
|
|
@@ -14684,18 +15028,18 @@ function ac_mt_command_answer$1(gobj, event, kw, src) {
|
|
|
14684
15028
|
if (!jv || !is_gobj(jv) || gobj_is_destroying(jv)) return 0;
|
|
14685
15029
|
let path = kw_get_str(gobj, kw_command, "path", "", 0);
|
|
14686
15030
|
if (result < 0) {
|
|
14687
|
-
if (path) gobj_send_event
|
|
15031
|
+
if (path) gobj_send_event(jv, "EV_SUBTREE_ERROR", {
|
|
14688
15032
|
path,
|
|
14689
15033
|
error: comment || "print-tranger failed"
|
|
14690
15034
|
}, gobj);
|
|
14691
15035
|
else yui_shell_show_error(yui_shell_of(gobj), comment || "print-tranger failed", { t });
|
|
14692
15036
|
return 0;
|
|
14693
15037
|
}
|
|
14694
|
-
if (path) gobj_send_event
|
|
15038
|
+
if (path) gobj_send_event(jv, "EV_SUBTREE_LOADED", {
|
|
14695
15039
|
path,
|
|
14696
15040
|
json: data
|
|
14697
15041
|
}, gobj);
|
|
14698
|
-
else gobj_send_event
|
|
15042
|
+
else gobj_send_event(jv, "EV_SET_JSON", { json: data }, gobj);
|
|
14699
15043
|
return 0;
|
|
14700
15044
|
}
|
|
14701
15045
|
if (result < 0) {
|
|
@@ -14712,7 +15056,7 @@ function ac_mt_command_answer$1(gobj, event, kw, src) {
|
|
|
14712
15056
|
break;
|
|
14713
15057
|
case "nodes":
|
|
14714
15058
|
let topic_name = kw_get_str(gobj, kw_command, "topic_name", "", kw_flag_t.KW_REQUIRED);
|
|
14715
|
-
if (result >= 0) gobj_send_event
|
|
15059
|
+
if (result >= 0) gobj_send_event(gobj_find_child(gobj, { __gobj_name__: `${gobj_name(gobj)}?${topic_name}` }), "EV_LOAD_NODES", data, gobj);
|
|
14716
15060
|
break;
|
|
14717
15061
|
case "create-node":
|
|
14718
15062
|
case "update-node":
|
|
@@ -14773,7 +15117,7 @@ function ac_show$4(gobj, event, kw, src) {
|
|
|
14773
15117
|
if (gobj2) {
|
|
14774
15118
|
let $sub_container = gobj_read_attr(gobj2, "$container");
|
|
14775
15119
|
if ($sub_container) $sub_container.classList.remove("is-hidden");
|
|
14776
|
-
gobj_send_event
|
|
15120
|
+
gobj_send_event(gobj2, "EV_SHOW", kw, gobj);
|
|
14777
15121
|
}
|
|
14778
15122
|
show_topic_detail(gobj);
|
|
14779
15123
|
}
|
|
@@ -14866,7 +15210,7 @@ function ac_hide$3(gobj, event, kw, src) {
|
|
|
14866
15210
|
if (gobj2) {
|
|
14867
15211
|
let $sub_container = gobj_read_attr(gobj2, "$container");
|
|
14868
15212
|
if ($sub_container) $sub_container.classList.add("is-hidden");
|
|
14869
|
-
gobj_send_event
|
|
15213
|
+
gobj_send_event(gobj2, "EV_HIDE", {}, gobj);
|
|
14870
15214
|
}
|
|
14871
15215
|
}
|
|
14872
15216
|
return 0;
|
|
@@ -14878,7 +15222,7 @@ function ac_treedb_node_created$1(gobj, event, kw, src) {
|
|
|
14878
15222
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
14879
15223
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
14880
15224
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
14881
|
-
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) gobj_send_event
|
|
15225
|
+
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) gobj_send_event(get_gobj_formtable(gobj, topic_name), "EV_LOAD_NODE_CREATED", [node], gobj);
|
|
14882
15226
|
return 0;
|
|
14883
15227
|
}
|
|
14884
15228
|
/********************************************
|
|
@@ -14888,7 +15232,7 @@ function ac_treedb_node_updated$1(gobj, event, kw, src) {
|
|
|
14888
15232
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
14889
15233
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
14890
15234
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
14891
|
-
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) gobj_send_event
|
|
15235
|
+
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) gobj_send_event(get_gobj_formtable(gobj, topic_name), "EV_LOAD_NODE_UPDATED", [node], gobj);
|
|
14892
15236
|
return 0;
|
|
14893
15237
|
}
|
|
14894
15238
|
/********************************************
|
|
@@ -14898,7 +15242,7 @@ function ac_treedb_node_deleted$1(gobj, event, kw, src) {
|
|
|
14898
15242
|
let treedb_name = kw_get_str(gobj, kw, "treedb_name", "", 0);
|
|
14899
15243
|
let topic_name = kw_get_str(gobj, kw, "topic_name", "", 0);
|
|
14900
15244
|
let node = kw_get_dict_value(gobj, kw, "node", null, 0);
|
|
14901
|
-
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) gobj_send_event
|
|
15245
|
+
if (treedb_name === gobj_read_str_attr(gobj, "treedb_name")) gobj_send_event(get_gobj_formtable(gobj, topic_name), "EV_NODE_DELETED", [node], gobj);
|
|
14902
15246
|
return 0;
|
|
14903
15247
|
}
|
|
14904
15248
|
/********************************************
|
|
@@ -15389,7 +15733,7 @@ function cmd_get_topic_data(gobj, cmd, kw, src) {
|
|
|
15389
15733
|
async function readClipboard(gobj) {
|
|
15390
15734
|
try {
|
|
15391
15735
|
const text = await navigator.clipboard.readText();
|
|
15392
|
-
gobj_send_event
|
|
15736
|
+
gobj_send_event(gobj, "EV_PASTE_ROWS", JSON.parse(text), gobj);
|
|
15393
15737
|
} catch (error) {
|
|
15394
15738
|
log_error(`Failed to read clipboard contents: ${error}`);
|
|
15395
15739
|
}
|
|
@@ -15428,7 +15772,7 @@ function build_ui$4(gobj) {
|
|
|
15428
15772
|
]],
|
|
15429
15773
|
{ "click": (event) => {
|
|
15430
15774
|
event.stopPropagation();
|
|
15431
|
-
gobj_send_event
|
|
15775
|
+
gobj_send_event(gobj, "EV_EDITION_MODE", {}, gobj);
|
|
15432
15776
|
} }
|
|
15433
15777
|
]);
|
|
15434
15778
|
$table_toolbar.appendChild($edit_button);
|
|
@@ -15451,7 +15795,7 @@ function build_ui$4(gobj) {
|
|
|
15451
15795
|
]],
|
|
15452
15796
|
{ "click": (event) => {
|
|
15453
15797
|
event.stopPropagation();
|
|
15454
|
-
gobj_send_event
|
|
15798
|
+
gobj_send_event(gobj, "EV_NEW_ROW", {}, gobj);
|
|
15455
15799
|
} }
|
|
15456
15800
|
]);
|
|
15457
15801
|
$table_toolbar.appendChild($new_button);
|
|
@@ -15475,7 +15819,7 @@ function build_ui$4(gobj) {
|
|
|
15475
15819
|
]],
|
|
15476
15820
|
{ "click": (event) => {
|
|
15477
15821
|
event.stopPropagation();
|
|
15478
|
-
gobj_send_event
|
|
15822
|
+
gobj_send_event(gobj, "EV_DELETE_ROWS", {}, gobj);
|
|
15479
15823
|
} }
|
|
15480
15824
|
]);
|
|
15481
15825
|
$table_toolbar.appendChild($delete_button);
|
|
@@ -15499,7 +15843,7 @@ function build_ui$4(gobj) {
|
|
|
15499
15843
|
]],
|
|
15500
15844
|
{ "click": (event) => {
|
|
15501
15845
|
event.stopPropagation();
|
|
15502
|
-
gobj_send_event
|
|
15846
|
+
gobj_send_event(gobj, "EV_COPY_ROWS", {}, gobj);
|
|
15503
15847
|
} }
|
|
15504
15848
|
]);
|
|
15505
15849
|
$table_toolbar.appendChild($copy_button);
|
|
@@ -15588,7 +15932,7 @@ function build_ui$4(gobj) {
|
|
|
15588
15932
|
]],
|
|
15589
15933
|
{ "click": (event) => {
|
|
15590
15934
|
event.stopPropagation();
|
|
15591
|
-
gobj_send_event
|
|
15935
|
+
gobj_send_event(gobj, "EV_REFRESH", {}, gobj);
|
|
15592
15936
|
} }
|
|
15593
15937
|
]);
|
|
15594
15938
|
$view_toolbar.appendChild($refresh);
|
|
@@ -15739,7 +16083,7 @@ function create_tabulator(gobj) {
|
|
|
15739
16083
|
click_y: pos.top
|
|
15740
16084
|
};
|
|
15741
16085
|
}
|
|
15742
|
-
gobj_send_event
|
|
16086
|
+
gobj_send_event(gobj, "EV_SHOW_HOOK_DATA", kw_hook, gobj);
|
|
15743
16087
|
};
|
|
15744
16088
|
break;
|
|
15745
16089
|
case "image":
|
|
@@ -15813,7 +16157,7 @@ function create_tabulator(gobj) {
|
|
|
15813
16157
|
show_edit_form(gobj, row, index);
|
|
15814
16158
|
} else if (e.target.closest(".remove")) {
|
|
15815
16159
|
e.stopPropagation();
|
|
15816
|
-
gobj_send_event
|
|
16160
|
+
gobj_send_event(gobj, "EV_DELETE_ROWS", {
|
|
15817
16161
|
index,
|
|
15818
16162
|
row
|
|
15819
16163
|
}, gobj);
|
|
@@ -15868,10 +16212,10 @@ function create_tabulator(gobj) {
|
|
|
15868
16212
|
tabulator.on("dataProcessed", update_rowcount);
|
|
15869
16213
|
tabulator.on("dataChanged", update_rowcount);
|
|
15870
16214
|
tabulator.on("rowSelected", function(row) {
|
|
15871
|
-
gobj_send_event
|
|
16215
|
+
gobj_send_event(gobj, "EV_SELECT_ROWS", { rows: [row.getData()] }, gobj);
|
|
15872
16216
|
});
|
|
15873
16217
|
tabulator.on("rowDeselected", function(row) {
|
|
15874
|
-
gobj_send_event
|
|
16218
|
+
gobj_send_event(gobj, "EV_UNSELECT_ROWS", { rows: [row.getData()] }, gobj);
|
|
15875
16219
|
});
|
|
15876
16220
|
gobj_write_attr(gobj, "tabulator", tabulator);
|
|
15877
16221
|
refresh_language(gobj_read_attr(gobj, "$container"), t);
|
|
@@ -16094,7 +16438,7 @@ function form_may_close(gobj) {
|
|
|
16094
16438
|
let priv = gobj.priv;
|
|
16095
16439
|
if (priv.form) {
|
|
16096
16440
|
let kw = {};
|
|
16097
|
-
gobj_send_event
|
|
16441
|
+
gobj_send_event(priv.form, "EV_WINDOW_TO_CLOSE", kw, gobj);
|
|
16098
16442
|
if (kw.abort_close) {
|
|
16099
16443
|
yui_shell_confirm_yesnocancel(yui_shell_of(gobj), "All changes will be lost. Are you sure?", {
|
|
16100
16444
|
t,
|
|
@@ -17260,7 +17604,7 @@ function make_toolbar(gobj) {
|
|
|
17260
17604
|
[["select", { class: "GRAPH_LAYOUT_SELECT" }]],
|
|
17261
17605
|
{ change: (evt) => {
|
|
17262
17606
|
evt.stopPropagation();
|
|
17263
|
-
gobj_send_event
|
|
17607
|
+
gobj_send_event(gobj, "EV_SET_LAYOUT", { layout: evt.target.value }, gobj);
|
|
17264
17608
|
} }
|
|
17265
17609
|
],
|
|
17266
17610
|
[
|
|
@@ -17286,7 +17630,7 @@ function make_toolbar(gobj) {
|
|
|
17286
17630
|
]],
|
|
17287
17631
|
{ change: (evt) => {
|
|
17288
17632
|
evt.stopPropagation();
|
|
17289
|
-
gobj_send_event
|
|
17633
|
+
gobj_send_event(gobj, "EV_SET_OPERATION_MODE", { operation_mode: evt.target.value }, gobj);
|
|
17290
17634
|
} }
|
|
17291
17635
|
],
|
|
17292
17636
|
[
|
|
@@ -17303,7 +17647,7 @@ function make_toolbar(gobj) {
|
|
|
17303
17647
|
]],
|
|
17304
17648
|
{ click: (evt) => {
|
|
17305
17649
|
evt.stopPropagation();
|
|
17306
|
-
gobj_send_event
|
|
17650
|
+
gobj_send_event(gobj, "EV_REFRESH_TREEDB", { evt }, gobj);
|
|
17307
17651
|
} }
|
|
17308
17652
|
],
|
|
17309
17653
|
[
|
|
@@ -17326,7 +17670,7 @@ function make_toolbar(gobj) {
|
|
|
17326
17670
|
]],
|
|
17327
17671
|
{ click: (evt) => {
|
|
17328
17672
|
evt.stopPropagation();
|
|
17329
|
-
gobj_send_event
|
|
17673
|
+
gobj_send_event(gobj, "EV_OPEN_JSON", {}, gobj);
|
|
17330
17674
|
} }
|
|
17331
17675
|
]
|
|
17332
17676
|
]
|
|
@@ -17440,7 +17784,7 @@ function open_json_viewer(gobj) {
|
|
|
17440
17784
|
t,
|
|
17441
17785
|
on_close: () => {
|
|
17442
17786
|
if (gobj_is_destroying(gobj)) return;
|
|
17443
|
-
gobj_send_event
|
|
17787
|
+
gobj_send_event(gobj, "EV_JSON_CLOSED", {}, gobj);
|
|
17444
17788
|
}
|
|
17445
17789
|
});
|
|
17446
17790
|
} else {
|
|
@@ -17464,7 +17808,7 @@ function open_json_viewer(gobj) {
|
|
|
17464
17808
|
manager: null,
|
|
17465
17809
|
on_close: () => {
|
|
17466
17810
|
if (gobj_is_destroying(gobj)) return;
|
|
17467
|
-
gobj_send_event
|
|
17811
|
+
gobj_send_event(gobj, "EV_JSON_CLOSED", {}, gobj);
|
|
17468
17812
|
}
|
|
17469
17813
|
}, gobj);
|
|
17470
17814
|
if (!priv.json_win) {
|
|
@@ -17516,7 +17860,7 @@ function request_print_tranger(gobj, path) {
|
|
|
17516
17860
|
if (!priv.gobj_remote_yuno) {
|
|
17517
17861
|
log_error(`${gobj_short_name(gobj)}: No gobj_remote_yuno defined`);
|
|
17518
17862
|
let jv = priv.json_gobj;
|
|
17519
|
-
if (path && jv && is_gobj(jv) && !gobj_is_destroying(jv)) gobj_send_event
|
|
17863
|
+
if (path && jv && is_gobj(jv) && !gobj_is_destroying(jv)) gobj_send_event(jv, "EV_SUBTREE_ERROR", {
|
|
17520
17864
|
path,
|
|
17521
17865
|
error: t("no session")
|
|
17522
17866
|
}, gobj);
|
|
@@ -17725,7 +18069,7 @@ function request_treedb_descs(gobj) {
|
|
|
17725
18069
|
function process_treedb_descs(gobj, descs) {
|
|
17726
18070
|
let priv = gobj.priv;
|
|
17727
18071
|
gobj_write_attr(gobj, "descs", descs);
|
|
17728
|
-
if (priv.gobj_nodes_tree) gobj_send_event
|
|
18072
|
+
if (priv.gobj_nodes_tree) gobj_send_event(priv.gobj_nodes_tree, "EV_DESCS", descs, gobj);
|
|
17729
18073
|
for (const topic_name of Object.keys(descs)) if (topic_name.substring(0, 2) === "__") {
|
|
17730
18074
|
if (topic_name === "__graphs__") get_nodes(gobj, topic_name);
|
|
17731
18075
|
}
|
|
@@ -17827,7 +18171,7 @@ function subscribe_treedb(gobj, topic_name) {
|
|
|
17827
18171
|
********************************************/
|
|
17828
18172
|
function refresh_data(gobj) {
|
|
17829
18173
|
let priv = gobj.priv;
|
|
17830
|
-
if (priv.gobj_nodes_tree) gobj_send_event
|
|
18174
|
+
if (priv.gobj_nodes_tree) gobj_send_event(priv.gobj_nodes_tree, "EV_CLEAR_DATA", {}, gobj);
|
|
17831
18175
|
request_treedb_descs(gobj);
|
|
17832
18176
|
}
|
|
17833
18177
|
/***************************
|
|
@@ -17859,18 +18203,18 @@ function ac_mt_command_answer(gobj, event, kw, src) {
|
|
|
17859
18203
|
if (!jv || !is_gobj(jv) || gobj_is_destroying(jv)) return 0;
|
|
17860
18204
|
let path = kw_get_str(gobj, kw_command, "path", "", 0);
|
|
17861
18205
|
if (result < 0) {
|
|
17862
|
-
if (path) gobj_send_event
|
|
18206
|
+
if (path) gobj_send_event(jv, "EV_SUBTREE_ERROR", {
|
|
17863
18207
|
path,
|
|
17864
18208
|
error: comment || "print-tranger failed"
|
|
17865
18209
|
}, gobj);
|
|
17866
18210
|
else yui_shell_show_error(yui_shell_of(gobj), comment || "print-tranger failed", { t });
|
|
17867
18211
|
return 0;
|
|
17868
18212
|
}
|
|
17869
|
-
if (path) gobj_send_event
|
|
18213
|
+
if (path) gobj_send_event(jv, "EV_SUBTREE_LOADED", {
|
|
17870
18214
|
path,
|
|
17871
18215
|
json: data
|
|
17872
18216
|
}, gobj);
|
|
17873
|
-
else gobj_send_event
|
|
18217
|
+
else gobj_send_event(jv, "EV_SET_JSON", { json: data }, gobj);
|
|
17874
18218
|
return 0;
|
|
17875
18219
|
}
|
|
17876
18220
|
if (result < 0) if (command === "descs") show_load_error(gobj, t(comment));
|
|
@@ -17880,14 +18224,14 @@ function ac_mt_command_answer(gobj, event, kw, src) {
|
|
|
17880
18224
|
if (result >= 0) process_treedb_descs(gobj, data);
|
|
17881
18225
|
break;
|
|
17882
18226
|
case "nodes":
|
|
17883
|
-
if (result >= 0) gobj_send_event
|
|
18227
|
+
if (result >= 0) gobj_send_event(priv.gobj_nodes_tree, "EV_LOAD_DATA", {
|
|
17884
18228
|
kw_command,
|
|
17885
18229
|
schema,
|
|
17886
18230
|
data
|
|
17887
18231
|
}, gobj);
|
|
17888
18232
|
break;
|
|
17889
18233
|
case "node":
|
|
17890
|
-
if (result >= 0) gobj_send_event
|
|
18234
|
+
if (result >= 0) gobj_send_event(priv.gobj_nodes_tree, "EV_NODE_UPDATED", {
|
|
17891
18235
|
topic_name: kw_get_str(gobj, kw_command, "topic_name", "", 0),
|
|
17892
18236
|
node: data
|
|
17893
18237
|
}, gobj);
|
|
@@ -17914,7 +18258,7 @@ function ac_treedb_node_created(gobj, event, kw, src) {
|
|
|
17914
18258
|
return 0;
|
|
17915
18259
|
}
|
|
17916
18260
|
let schema = priv.descs[topic_name];
|
|
17917
|
-
if (priv.gobj_nodes_tree) gobj_send_event
|
|
18261
|
+
if (priv.gobj_nodes_tree) gobj_send_event(priv.gobj_nodes_tree, "EV_NODE_CREATED", {
|
|
17918
18262
|
schema,
|
|
17919
18263
|
topic_name,
|
|
17920
18264
|
node
|
|
@@ -17933,7 +18277,7 @@ function ac_treedb_node_updated(gobj, event, kw, src) {
|
|
|
17933
18277
|
log_error("It's not my treedb_name: " + treedb_name);
|
|
17934
18278
|
return 0;
|
|
17935
18279
|
}
|
|
17936
|
-
if (priv.gobj_nodes_tree) gobj_send_event
|
|
18280
|
+
if (priv.gobj_nodes_tree) gobj_send_event(priv.gobj_nodes_tree, "EV_NODE_UPDATED", {
|
|
17937
18281
|
topic_name,
|
|
17938
18282
|
node
|
|
17939
18283
|
}, gobj);
|
|
@@ -17987,7 +18331,7 @@ function ac_treedb_node_deleted(gobj, event, kw, src) {
|
|
|
17987
18331
|
log_error("It's not my treedb_name: " + treedb_name);
|
|
17988
18332
|
return 0;
|
|
17989
18333
|
}
|
|
17990
|
-
if (priv.gobj_nodes_tree) gobj_send_event
|
|
18334
|
+
if (priv.gobj_nodes_tree) gobj_send_event(priv.gobj_nodes_tree, "EV_NODE_DELETED", {
|
|
17991
18335
|
topic_name,
|
|
17992
18336
|
node
|
|
17993
18337
|
}, gobj);
|
|
@@ -18062,7 +18406,7 @@ function ac_show_hook_data(gobj, event, kw, src) {
|
|
|
18062
18406
|
if (!found_gobj) {
|
|
18063
18407
|
found_gobj = gobj_create_service(name, priv.hook_data_viewer, kw, gobj);
|
|
18064
18408
|
gobj_start(found_gobj);
|
|
18065
|
-
} else gobj_send_event
|
|
18409
|
+
} else gobj_send_event(found_gobj, "EV_TOGGLE", {}, gobj);
|
|
18066
18410
|
return 0;
|
|
18067
18411
|
}
|
|
18068
18412
|
/********************************************
|
|
@@ -18075,8 +18419,8 @@ function ac_show_treedb_topic(gobj, event, kw, src) {
|
|
|
18075
18419
|
log_error("gobj_treedb_tables not available");
|
|
18076
18420
|
return 0;
|
|
18077
18421
|
}
|
|
18078
|
-
let gobj_topic_formtable = gobj_send_event
|
|
18079
|
-
if (gobj_topic_formtable) gobj_send_event
|
|
18422
|
+
let gobj_topic_formtable = gobj_send_event(priv.gobj_treedb_tables, "EV_GET_TOPIC_FORMTABLE", { topic_name }, gobj);
|
|
18423
|
+
if (gobj_topic_formtable) gobj_send_event(gobj_topic_formtable, "EV_TOGGLE", {}, gobj);
|
|
18080
18424
|
else log_error("Topic Formtable not found: " + topic_name);
|
|
18081
18425
|
return 0;
|
|
18082
18426
|
}
|
|
@@ -18206,7 +18550,7 @@ function ac_set_layout$1(gobj, event, kw, src) {
|
|
|
18206
18550
|
gobj_save_persistent_attrs(gobj, "layout");
|
|
18207
18551
|
let $layout_select = priv.$container.querySelector(".GRAPH_LAYOUT_SELECT");
|
|
18208
18552
|
$layout_select.value = priv.layout;
|
|
18209
|
-
gobj_send_event
|
|
18553
|
+
gobj_send_event(priv.gobj_nodes_tree, "EV_SET_LAYOUT", { layout }, gobj);
|
|
18210
18554
|
return 0;
|
|
18211
18555
|
}
|
|
18212
18556
|
/************************************************************
|
|
@@ -18219,7 +18563,7 @@ function ac_set_operation_mode$1(gobj, event, kw, src) {
|
|
|
18219
18563
|
gobj_save_persistent_attrs(gobj, "operation_mode");
|
|
18220
18564
|
let $operation_mode_select = priv.$container.querySelector(".GRAPH_MODE_SELECT");
|
|
18221
18565
|
$operation_mode_select.value = priv.operation_mode;
|
|
18222
|
-
gobj_send_event
|
|
18566
|
+
gobj_send_event(priv.gobj_nodes_tree, "EV_SET_OPERATION_MODE", { operation_mode }, gobj);
|
|
18223
18567
|
gobj_publish_event(gobj, "EV_OPERATION_MODE_CHANGED", { operation_mode });
|
|
18224
18568
|
return 0;
|
|
18225
18569
|
}
|
|
@@ -18231,7 +18575,7 @@ function ac_set_operation_mode$1(gobj, event, kw, src) {
|
|
|
18231
18575
|
************************************************************/
|
|
18232
18576
|
function ac_set_focus_topic(gobj, event, kw, src) {
|
|
18233
18577
|
let priv = gobj.priv;
|
|
18234
|
-
if (priv.gobj_nodes_tree) gobj_send_event
|
|
18578
|
+
if (priv.gobj_nodes_tree) gobj_send_event(priv.gobj_nodes_tree, "EV_FOCUS_TOPIC", { topic: kw && kw.topic }, gobj);
|
|
18235
18579
|
return 0;
|
|
18236
18580
|
}
|
|
18237
18581
|
/************************************************************
|
|
@@ -18246,14 +18590,14 @@ function ac_set_focus_topic(gobj, event, kw, src) {
|
|
|
18246
18590
|
************************************************************/
|
|
18247
18591
|
function ac_show$2(gobj, event, kw, src) {
|
|
18248
18592
|
let priv = gobj.priv;
|
|
18249
|
-
return gobj_send_event
|
|
18593
|
+
return gobj_send_event(priv.gobj_nodes_tree, event, kw, gobj);
|
|
18250
18594
|
}
|
|
18251
18595
|
/************************************************************
|
|
18252
18596
|
* Parent (routing) inform us that we go hidden
|
|
18253
18597
|
************************************************************/
|
|
18254
18598
|
function ac_hide$1(gobj, event, kw, src) {
|
|
18255
18599
|
let priv = gobj.priv;
|
|
18256
|
-
return gobj_send_event
|
|
18600
|
+
return gobj_send_event(priv.gobj_nodes_tree, event, kw, gobj);
|
|
18257
18601
|
}
|
|
18258
18602
|
/***************************
|
|
18259
18603
|
* FSM
|
|
@@ -18650,8 +18994,7 @@ function build_graph$1(gobj) {
|
|
|
18650
18994
|
priv.graph = graph;
|
|
18651
18995
|
graph.setTheme(dark ? "dark" : "light");
|
|
18652
18996
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
18653
|
-
|
|
18654
|
-
gobj_send_event(gobj, "EV_NODE_CLICK", { node_id }, gobj);
|
|
18997
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", { node_id: evt && evt.target && evt.target.id }, gobj);
|
|
18655
18998
|
});
|
|
18656
18999
|
graph.render().then(() => {
|
|
18657
19000
|
try {
|
|
@@ -45557,7 +45900,7 @@ function mt_create$1(gobj) {
|
|
|
45557
45900
|
if (priv._resize_raf) cancelAnimationFrame(priv._resize_raf);
|
|
45558
45901
|
priv._resize_raf = requestAnimationFrame(() => {
|
|
45559
45902
|
priv._resize_raf = 0;
|
|
45560
|
-
if (priv.graph && priv.graph_rendered) gobj_send_event
|
|
45903
|
+
if (priv.graph && priv.graph_rendered) gobj_send_event(gobj, "EV_RESIZE", {}, gobj);
|
|
45561
45904
|
});
|
|
45562
45905
|
});
|
|
45563
45906
|
ro.observe(priv.$container);
|
|
@@ -45723,7 +46066,7 @@ function configure_events(gobj) {
|
|
|
45723
46066
|
let priv = gobj.priv;
|
|
45724
46067
|
let graph = priv.graph;
|
|
45725
46068
|
graph.on(CanvasEvent.CLICK, (evt) => {
|
|
45726
|
-
gobj_send_event
|
|
46069
|
+
gobj_send_event(gobj, "EV_CANVAS_CLICK", { evt }, gobj);
|
|
45727
46070
|
});
|
|
45728
46071
|
graph.on(NodeEvent.DRAG, (evt) => {
|
|
45729
46072
|
update_resize_handles_position(gobj);
|
|
@@ -45733,16 +46076,16 @@ function configure_events(gobj) {
|
|
|
45733
46076
|
update_link_icon_position(gobj);
|
|
45734
46077
|
});
|
|
45735
46078
|
graph.on(NodeEvent.DRAG_END, (evt) => {
|
|
45736
|
-
gobj_send_event
|
|
46079
|
+
gobj_send_event(gobj, "EV_NODE_DRAG_END", { evt }, gobj);
|
|
45737
46080
|
});
|
|
45738
46081
|
graph.on(NodeEvent.CLICK, (evt) => {
|
|
45739
|
-
gobj_send_event
|
|
46082
|
+
gobj_send_event(gobj, "EV_NODE_CLICK", { evt }, gobj);
|
|
45740
46083
|
});
|
|
45741
46084
|
graph.on(NodeEvent.CONTEXT_MENU, (evt) => {
|
|
45742
|
-
gobj_send_event
|
|
46085
|
+
gobj_send_event(gobj, "EV_NODE_CONTEXT_MENU", { evt }, gobj);
|
|
45743
46086
|
});
|
|
45744
46087
|
graph.on(EdgeEvent.CLICK, (evt) => {
|
|
45745
|
-
gobj_send_event
|
|
46088
|
+
gobj_send_event(gobj, "EV_EDGE_CLICK", { evt }, gobj);
|
|
45746
46089
|
});
|
|
45747
46090
|
graph.on("aftertransform", () => {
|
|
45748
46091
|
update_resize_handles_position(gobj);
|
|
@@ -45878,25 +46221,25 @@ function configure_toolbar(gobj) {
|
|
|
45878
46221
|
onClick: (value) => {
|
|
45879
46222
|
switch (value) {
|
|
45880
46223
|
case "zoom-in":
|
|
45881
|
-
gobj_send_event
|
|
46224
|
+
gobj_send_event(gobj, "EV_ZOOM_IN", {}, gobj);
|
|
45882
46225
|
break;
|
|
45883
46226
|
case "zoom-out":
|
|
45884
|
-
gobj_send_event
|
|
46227
|
+
gobj_send_event(gobj, "EV_ZOOM_OUT", {}, gobj);
|
|
45885
46228
|
break;
|
|
45886
46229
|
case "reset":
|
|
45887
|
-
gobj_send_event
|
|
46230
|
+
gobj_send_event(gobj, "EV_ZOOM_RESET", {}, gobj);
|
|
45888
46231
|
break;
|
|
45889
46232
|
case "auto-fit":
|
|
45890
|
-
gobj_send_event
|
|
46233
|
+
gobj_send_event(gobj, "EV_AUTO_FIT", {}, gobj);
|
|
45891
46234
|
break;
|
|
45892
46235
|
case "center":
|
|
45893
|
-
gobj_send_event
|
|
46236
|
+
gobj_send_event(gobj, "EV_CENTER", {}, gobj);
|
|
45894
46237
|
break;
|
|
45895
46238
|
case "request-fullscreen":
|
|
45896
|
-
gobj_send_event
|
|
46239
|
+
gobj_send_event(gobj, "EV_REQUEST_FULLSCREEN", {}, gobj);
|
|
45897
46240
|
break;
|
|
45898
46241
|
case "exit-fullscreen":
|
|
45899
|
-
gobj_send_event
|
|
46242
|
+
gobj_send_event(gobj, "EV_EXIT_FULLSCREEN", {}, gobj);
|
|
45900
46243
|
break;
|
|
45901
46244
|
}
|
|
45902
46245
|
}
|
|
@@ -45963,13 +46306,13 @@ function configure_toolbar_edit(gobj) {
|
|
|
45963
46306
|
toggle_create_popover(gobj);
|
|
45964
46307
|
break;
|
|
45965
46308
|
case "undo":
|
|
45966
|
-
gobj_send_event
|
|
46309
|
+
gobj_send_event(gobj, "EV_HISTORY_UNDO", {}, gobj);
|
|
45967
46310
|
break;
|
|
45968
46311
|
case "redo":
|
|
45969
|
-
gobj_send_event
|
|
46312
|
+
gobj_send_event(gobj, "EV_HISTORY_REDO", {}, gobj);
|
|
45970
46313
|
break;
|
|
45971
46314
|
case "save":
|
|
45972
|
-
gobj_send_event
|
|
46315
|
+
gobj_send_event(gobj, "EV_SAVE_GRAPH", {}, gobj);
|
|
45973
46316
|
break;
|
|
45974
46317
|
}
|
|
45975
46318
|
}
|
|
@@ -50542,10 +50885,10 @@ function build_ui(gobj) {
|
|
|
50542
50885
|
[priv.$modes]
|
|
50543
50886
|
]);
|
|
50544
50887
|
if (priv.modes.some((m) => m.overflow)) $modes_row.appendChild(build_more_menu(gobj));
|
|
50545
|
-
priv.$first = nav_button(gobj, "YUI_PERIOD_FIRST", "yi-backward-step", "oldest period", () => gobj_send_event
|
|
50546
|
-
priv.$prev = nav_button(gobj, "YUI_PERIOD_PREV", "yi-chevron-left", "previous period", () => gobj_send_event
|
|
50547
|
-
priv.$next = nav_button(gobj, "YUI_PERIOD_NEXT", "yi-chevron-right", "next period", () => gobj_send_event
|
|
50548
|
-
priv.$latest = nav_button(gobj, "YUI_PERIOD_LATEST", "yi-forward-step", "latest period", () => gobj_send_event
|
|
50888
|
+
priv.$first = nav_button(gobj, "YUI_PERIOD_FIRST", "yi-backward-step", "oldest period", () => gobj_send_event(gobj, "EV_FIRST", {}, gobj));
|
|
50889
|
+
priv.$prev = nav_button(gobj, "YUI_PERIOD_PREV", "yi-chevron-left", "previous period", () => gobj_send_event(gobj, "EV_PREV", {}, gobj));
|
|
50890
|
+
priv.$next = nav_button(gobj, "YUI_PERIOD_NEXT", "yi-chevron-right", "next period", () => gobj_send_event(gobj, "EV_NEXT", {}, gobj));
|
|
50891
|
+
priv.$latest = nav_button(gobj, "YUI_PERIOD_LATEST", "yi-forward-step", "latest period", () => gobj_send_event(gobj, "EV_LATEST", {}, gobj));
|
|
50549
50892
|
priv.$label = createElement2([
|
|
50550
50893
|
"button",
|
|
50551
50894
|
{
|
|
@@ -50567,7 +50910,7 @@ function build_ui(gobj) {
|
|
|
50567
50910
|
]]
|
|
50568
50911
|
]);
|
|
50569
50912
|
priv.$label.addEventListener("click", () => {
|
|
50570
|
-
gobj_send_event
|
|
50913
|
+
gobj_send_event(gobj, "EV_PICK_DATE", {}, gobj);
|
|
50571
50914
|
});
|
|
50572
50915
|
if (gobj_read_bool_attr(gobj, "with_resolved")) priv.$resolved = createElement2([
|
|
50573
50916
|
"p",
|
|
@@ -50609,7 +50952,7 @@ function build_mode_button(gobj, mode) {
|
|
|
50609
50952
|
]]
|
|
50610
50953
|
]);
|
|
50611
50954
|
$btn.addEventListener("click", () => {
|
|
50612
|
-
gobj_send_event
|
|
50955
|
+
gobj_send_event(gobj, "EV_SET_MODE", { mode: mode.id }, gobj);
|
|
50613
50956
|
});
|
|
50614
50957
|
mode.$btn = $btn;
|
|
50615
50958
|
return $btn;
|
|
@@ -50642,7 +50985,7 @@ function build_more_menu(gobj) {
|
|
|
50642
50985
|
$item.addEventListener("click", (ev) => {
|
|
50643
50986
|
ev.preventDefault();
|
|
50644
50987
|
close_more(gobj);
|
|
50645
|
-
gobj_send_event
|
|
50988
|
+
gobj_send_event(gobj, "EV_SET_MODE", { mode: mode.id }, gobj);
|
|
50646
50989
|
});
|
|
50647
50990
|
mode.$btn = $item;
|
|
50648
50991
|
$items.appendChild($item);
|
|
@@ -50936,7 +51279,7 @@ function render_calendar(gobj) {
|
|
|
50936
51279
|
]]
|
|
50937
51280
|
]);
|
|
50938
51281
|
$today.addEventListener("click", () => {
|
|
50939
|
-
gobj_send_event
|
|
51282
|
+
gobj_send_event(gobj, "EV_DATE_PICKED", { anchor: Date.now() }, gobj);
|
|
50940
51283
|
});
|
|
50941
51284
|
priv.$calendar.replaceChildren($head, $grid, $today);
|
|
50942
51285
|
}
|
|
@@ -50953,7 +51296,7 @@ function cell_button(gobj, label, anchor_ms, selected, logical, aria) {
|
|
|
50953
51296
|
String(label)
|
|
50954
51297
|
]);
|
|
50955
51298
|
$btn.addEventListener("click", () => {
|
|
50956
|
-
gobj_send_event
|
|
51299
|
+
gobj_send_event(gobj, "EV_DATE_PICKED", { anchor: anchor_ms }, gobj);
|
|
50957
51300
|
});
|
|
50958
51301
|
return $btn;
|
|
50959
51302
|
}
|
|
@@ -51034,7 +51377,7 @@ function build_days_grid(gobj, view, locale) {
|
|
|
51034
51377
|
String(wk)
|
|
51035
51378
|
]);
|
|
51036
51379
|
$wk.addEventListener("click", () => {
|
|
51037
|
-
gobj_send_event
|
|
51380
|
+
gobj_send_event(gobj, "EV_DATE_PICKED", { anchor: monday.getTime() }, gobj);
|
|
51038
51381
|
});
|
|
51039
51382
|
$cells.push($wk);
|
|
51040
51383
|
}
|
|
@@ -51998,7 +52341,7 @@ function render_full(e) {
|
|
|
51998
52341
|
let payload = full_sections(e.kw ? e.kw : e.jn);
|
|
51999
52342
|
let text;
|
|
52000
52343
|
try {
|
|
52001
|
-
text = JSON.stringify(payload, null,
|
|
52344
|
+
text = JSON.stringify(payload, null, 4);
|
|
52002
52345
|
} catch (err) {
|
|
52003
52346
|
text = String(payload);
|
|
52004
52347
|
}
|
|
@@ -52261,7 +52604,7 @@ function info_log(level, msg, hora) {
|
|
|
52261
52604
|
let text;
|
|
52262
52605
|
if (lvl === "json") {
|
|
52263
52606
|
try {
|
|
52264
|
-
text = JSON.stringify(msg, null,
|
|
52607
|
+
text = JSON.stringify(msg, null, 4);
|
|
52265
52608
|
} catch (e) {
|
|
52266
52609
|
text = String(msg);
|
|
52267
52610
|
}
|
|
@@ -52435,7 +52778,7 @@ function traffic_to_text() {
|
|
|
52435
52778
|
out.push(head);
|
|
52436
52779
|
let payload = e.kw ? e.kw : e.jn;
|
|
52437
52780
|
try {
|
|
52438
|
-
out.push(JSON.stringify(payload, null,
|
|
52781
|
+
out.push(JSON.stringify(payload, null, 4));
|
|
52439
52782
|
} catch (err) {
|
|
52440
52783
|
out.push(String(payload));
|
|
52441
52784
|
}
|