testimonials 0.5.0 → 0.5.1
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/testimonials/version.rb +1 -1
- data/lib/testimonials/widget.js +7 -1
- 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: 49da88f23d3967043d08ff98641b737b357b67b1bffc65cf4ac2f5e9ffad181c
|
|
4
|
+
data.tar.gz: '091174dcf7d158e560f6c047593ef9d8b9dd7c1a4be3461f4cde4d1923c9ea84'
|
|
5
5
|
SHA512:
|
|
6
|
-
metadata.gz:
|
|
7
|
-
data.tar.gz:
|
|
6
|
+
metadata.gz: e45f348b081c38c7e85bcad7fa2823594c75100e4ace6be42390e793f7438e748a4048a0a753d5f246222333fc241ddd227e8059e6e94ea0f63c11899269335d
|
|
7
|
+
data.tar.gz: 17c9adb10e7922c9d32fc7931e809c3f398983571f109e1705e6f224f22328463d1d06ff8e7416ed210a802a841822bfa3d84d3f060f7cc9b01c7d1897d8aaa6
|
data/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,13 @@
|
|
|
1
1
|
# Changelog
|
|
2
2
|
|
|
3
|
+
## 0.5.1
|
|
4
|
+
|
|
5
|
+
- The widget's injected stylesheet now refreshes when its content changes
|
|
6
|
+
instead of once-and-never-again — so a shipped widget update takes effect on
|
|
7
|
+
the next Turbo visit instead of needing a full page reload (Turbo keeps
|
|
8
|
+
`<head>` across visits, which could otherwise pin old CSS while fresh
|
|
9
|
+
widget.js runs). Backported from livechat 0.4.5.
|
|
10
|
+
|
|
3
11
|
## 0.5.0
|
|
4
12
|
|
|
5
13
|
- **Multi-tenancy.** Scope testimonials to a tenant — each Organization (or
|
data/lib/testimonials/version.rb
CHANGED
data/lib/testimonials/widget.js
CHANGED
|
@@ -1052,7 +1052,6 @@
|
|
|
1052
1052
|
// --- styles -------------------------------------------------------------------
|
|
1053
1053
|
|
|
1054
1054
|
function injectStyles() {
|
|
1055
|
-
if (document.getElementById("tml-styles")) return;
|
|
1056
1055
|
var css = [
|
|
1057
1056
|
"#tml-overlay{position:fixed;inset:0;z-index:" + Z + ";background:rgba(0,0,0,.45);",
|
|
1058
1057
|
"display:flex;align-items:center;justify-content:center;padding:16px}",
|
|
@@ -1154,6 +1153,13 @@
|
|
|
1154
1153
|
"#tml-dialog .tml-actions{padding-bottom:calc(0px + env(safe-area-inset-bottom))}",
|
|
1155
1154
|
"}"
|
|
1156
1155
|
].join("");
|
|
1156
|
+
// Re-inject only when the CSS changed. Turbo keeps <head> across visits, so
|
|
1157
|
+
// a stale <style> would otherwise pin old CSS after a shipped update, even
|
|
1158
|
+
// while fresh widget.js runs — as self-freshening as the fingerprinted URL.
|
|
1159
|
+
var existing = document.getElementById("tml-styles");
|
|
1160
|
+
if (existing && existing.textContent === css) return;
|
|
1161
|
+
if (existing) existing.remove();
|
|
1162
|
+
|
|
1157
1163
|
var style = document.createElement("style");
|
|
1158
1164
|
style.id = "tml-styles";
|
|
1159
1165
|
style.textContent = css;
|