i18n_proofreading 0.9.6 → 0.9.7
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.
- checksums.yaml +4 -4
- data/CHANGELOG.md +8 -0
- data/lib/i18n_proofreading/version.rb +1 -1
- data/lib/i18n_proofreading/widget.js +12 -4
- metadata +1 -1
checksums.yaml
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
---
|
|
2
2
|
SHA256:
|
|
3
|
-
metadata.gz:
|
|
4
|
-
data.tar.gz:
|
|
3
|
+
metadata.gz: 71c3ef13d9eb7688953deaa41e98490084aef787abe305c4cac15bcad61cfe6d
|
|
4
|
+
data.tar.gz: 7c8d967ece7913135833ca2848e02851a3f54487e380ec6add21002373fca9bc
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: 140f6f111eb68a553b1bc394b76e198e855dd55d742dcb77008282610634bc95135a6a4a41406c029d3d58a0fd0c538cb8ff2370cd6d478c5b9e8567342d2063
|
|
7
|
+
data.tar.gz: 999d1079f6e426fe8b92a9ffc37f3779621992ff40cd28c3f36b76999581506bbfaa89ec613b5792ef26ebb76852d1c1361280dd7411a232f6245343ec1e3713
|
data/CHANGELOG.md
CHANGED
|
@@ -2,6 +2,14 @@
|
|
|
2
2
|
|
|
3
3
|
## [Unreleased]
|
|
4
4
|
|
|
5
|
+
## [0.9.7]
|
|
6
|
+
|
|
7
|
+
- The widget's injected stylesheet now refreshes when its content changes
|
|
8
|
+
instead of once-and-never-again — so a shipped widget update takes effect on
|
|
9
|
+
the next Turbo visit instead of needing a full page reload (Turbo keeps
|
|
10
|
+
`<head>` across visits, which could otherwise pin old CSS while fresh
|
|
11
|
+
widget.js runs). Backported from livechat 0.4.5.
|
|
12
|
+
|
|
5
13
|
## [0.9.6]
|
|
6
14
|
|
|
7
15
|
- No more flash of raw `⟦key⟧` markers when entering suggest mode: the widget
|
|
@@ -446,10 +446,7 @@
|
|
|
446
446
|
// --- styles ---------------------------------------------------------------
|
|
447
447
|
|
|
448
448
|
function injectStyles() {
|
|
449
|
-
|
|
450
|
-
var style = document.createElement("style");
|
|
451
|
-
style.id = "i18np-styles";
|
|
452
|
-
style.textContent = [
|
|
449
|
+
var css = [
|
|
453
450
|
// Only the strings that actually resolve to a key are editable, so only
|
|
454
451
|
// those are highlighted. `outline` (not `border`) avoids any layout shift.
|
|
455
452
|
".i18np-active [data-i18n-key] { cursor: copy; outline: 1px dashed rgba(37, 99, 235, 0.5); outline-offset: 2px; }",
|
|
@@ -523,6 +520,17 @@
|
|
|
523
520
|
" .i18np-panel .i18np-actions { padding-bottom: calc(0px + env(safe-area-inset-bottom)); }",
|
|
524
521
|
"}",
|
|
525
522
|
].join("\n");
|
|
523
|
+
|
|
524
|
+
// Re-inject only when the CSS changed. Turbo keeps <head> across visits, so
|
|
525
|
+
// a stale <style> would otherwise pin old CSS after a shipped update, even
|
|
526
|
+
// while fresh widget.js runs — as self-freshening as the fingerprinted URL.
|
|
527
|
+
var existing = document.getElementById("i18np-styles");
|
|
528
|
+
if (existing && existing.textContent === css) return;
|
|
529
|
+
if (existing) existing.remove();
|
|
530
|
+
|
|
531
|
+
var style = document.createElement("style");
|
|
532
|
+
style.id = "i18np-styles";
|
|
533
|
+
style.textContent = css;
|
|
526
534
|
document.head.appendChild(style);
|
|
527
535
|
}
|
|
528
536
|
})();
|