@yuneta/gobj-js 7.3.1 → 7.3.3

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.
@@ -514,7 +514,8 @@ var gobjJs = (function(exports) {
514
514
  let jn_value2;
515
515
  switch (it.type) {
516
516
  case data_type_t.DTP_STRING:
517
- if (is_string(jn_value_)) jn_value2 = String(jn_value_);
517
+ if (jn_value_ === null || jn_value_ === void 0) jn_value2 = "";
518
+ else if (is_string(jn_value_)) jn_value2 = String(jn_value_);
518
519
  else {
519
520
  let s = JSON.stringify(jn_value_);
520
521
  if (s) jn_value2 = String(s);
@@ -4391,8 +4392,10 @@ var gobjJs = (function(exports) {
4391
4392
  el.style.cssText = styleString;
4392
4393
  } else if (attr === "style") el.style.cssText = attrs[attr];
4393
4394
  else if (attr === "i18n" || attr === "data-i18n" || attr === "data_i18next" || attr === "data-i18next") {
4394
- data_i18next = attrs[attr];
4395
- el.setAttribute("data-i18n", data_i18next);
4395
+ if (attrs[attr] !== null && attrs[attr] !== void 0) {
4396
+ data_i18next = attrs[attr];
4397
+ el.setAttribute("data-i18n", data_i18next);
4398
+ }
4396
4399
  } else el.setAttribute(attr, attrs[attr]);
4397
4400
  if (is_string(content)) {
4398
4401
  content = content.trim();
@@ -4465,6 +4468,14 @@ var gobjJs = (function(exports) {
4465
4468
  break;
4466
4469
  }
4467
4470
  });
4471
+ element.querySelectorAll("[data-i18n-title]").forEach(function(elem) {
4472
+ let value = elem.getAttribute("data-i18n-title");
4473
+ if (value) elem.setAttribute("title", t(value));
4474
+ });
4475
+ element.querySelectorAll("[data-i18n-aria-label]").forEach(function(elem) {
4476
+ let value = elem.getAttribute("data-i18n-aria-label");
4477
+ if (value) elem.setAttribute("aria-label", t(value));
4478
+ });
4468
4479
  }
4469
4480
  /************************************************************
4470
4481
  * Example Usage
@@ -5845,6 +5856,17 @@ var gobjJs = (function(exports) {
5845
5856
  remote_yuno_role: priv.remote_yuno_role,
5846
5857
  remote_yuno_service: priv.remote_yuno_service
5847
5858
  });
5859
+ } else {
5860
+ log_warning(`${gobj_short_name(gobj)}: EV_ON_OPEN_ERROR cannot open ${url} (Code: ${e.code}, Reason: "${e.reason}", Clean: ${e.wasClean})`);
5861
+ gobj_publish_event(gobj, "EV_ON_OPEN_ERROR", {
5862
+ url,
5863
+ remote_yuno_name: priv.remote_yuno_name,
5864
+ remote_yuno_role: priv.remote_yuno_role,
5865
+ remote_yuno_service: priv.remote_yuno_service,
5866
+ code: e.code,
5867
+ reason: e.reason,
5868
+ was_clean: e.wasClean
5869
+ });
5848
5870
  }
5849
5871
  if (gobj_is_running(gobj)) set_timeout(priv.gobj_timer, gobj_read_integer_attr(gobj, "timeout_retry"));
5850
5872
  return 0;
@@ -6075,6 +6097,7 @@ var gobjJs = (function(exports) {
6075
6097
  ["EV_MT_COMMAND", event_flag_t.EVF_PUBLIC_EVENT],
6076
6098
  ["EV_ON_OPEN", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
6077
6099
  ["EV_ON_CLOSE", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
6100
+ ["EV_ON_OPEN_ERROR", event_flag_t.EVF_OUTPUT_EVENT | event_flag_t.EVF_NO_WARN_SUBS],
6078
6101
  ["EV_TIMEOUT", 0],
6079
6102
  [null, 0]
6080
6103
  ], states, gmt, 0, attrs_table, PRIVATE_DATA, 0, 0, 0, gclass_flag_t.gcflag_no_check_output_events);