aumera-on-screen-widget 0.0.5 → 0.0.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.
- package/df-btn.js +9 -5
- package/package.json +1 -1
package/df-btn.js
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
const wrapper = document.querySelector("#df-btn");
|
|
2
2
|
const config = {
|
|
3
3
|
src: wrapper.getAttribute("src"),
|
|
4
|
-
|
|
4
|
+
orgId: wrapper.getAttribute("orgId"),
|
|
5
5
|
width: wrapper.getAttribute("width"),
|
|
6
6
|
height: wrapper.getAttribute("height"),
|
|
7
7
|
openText: wrapper.getAttribute("openText"),
|
|
@@ -21,8 +21,8 @@ const config = {
|
|
|
21
21
|
|
|
22
22
|
const origin = config.src.substring(0, config.src.lastIndexOf("/"));
|
|
23
23
|
|
|
24
|
-
if (!config.
|
|
25
|
-
console.warn("Please specify your
|
|
24
|
+
if (!config.orgId) {
|
|
25
|
+
console.warn("Please specify your organization ID in attributes!");
|
|
26
26
|
} else {
|
|
27
27
|
const style = document.createElement("style");
|
|
28
28
|
style.innerHTML = `
|
|
@@ -126,8 +126,10 @@ if (!config.project) {
|
|
|
126
126
|
.df-btn-content {
|
|
127
127
|
display: block;
|
|
128
128
|
border: 0;
|
|
129
|
-
height: ${config.height || "
|
|
129
|
+
height: ${config.height || "75vh"};
|
|
130
|
+
max-height: 75vh;
|
|
130
131
|
width: ${config.width || "414px"};
|
|
132
|
+
max-width: 414px;
|
|
131
133
|
transition: all .45s cubic-bezier(.4, 0, .2, 1);
|
|
132
134
|
${config.position === "left" ? "float: left;" : "float: right;"}
|
|
133
135
|
opacity: 1;
|
|
@@ -280,7 +282,9 @@ if (!config.project) {
|
|
|
280
282
|
<div class="df-btn-header">
|
|
281
283
|
<div class="df-btn-text">${config.openText || "Chat"}</div>
|
|
282
284
|
</div>
|
|
283
|
-
<iframe class="df-btn-content" src="https://chat.dev.aumera.ai/${detectedLang}/?orgId
|
|
285
|
+
<iframe class="df-btn-content" src="https://chat.dev.aumera.ai/${detectedLang}/?orgId=${
|
|
286
|
+
config.orgId
|
|
287
|
+
}" allow="microphone *"></iframe>
|
|
284
288
|
</button>
|
|
285
289
|
`);
|
|
286
290
|
|