Skip to content

Commit de7aea0

Browse files
authored
Rename wsi.html to wsi1.html
1 parent 40a9d29 commit de7aea0

File tree

2 files changed

+78
-60
lines changed

2 files changed

+78
-60
lines changed

npachpande/cwc/sdb3/wsi.html

Lines changed: 0 additions & 60 deletions
This file was deleted.

npachpande/cwc/sdb3/wsi1.html

Lines changed: 78 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,78 @@
1+
<html>
2+
<head>
3+
<title>Williams Sonoma</title>
4+
<meta name="viewport" content="width=device-width, initial-scale=1, minimum-scale=1">
5+
</head>
6+
<body>
7+
8+
<style>
9+
body {
10+
/*overflow: hidden*/
11+
}
12+
.background-container {
13+
width: 100%;
14+
}
15+
16+
.background-container img {
17+
display: block;
18+
width: 100%;
19+
height: 200%;
20+
}
21+
</style>
22+
23+
24+
<div class="background-container">
25+
<!-- <img src="https://esw1234.github.io/wsi.png" alt="Background"> -->
26+
</div>
27+
28+
<input type="text" id="nudgeInput"><br><br>
29+
<button type="button" onclick="sendNudge()">send nudge</button>
30+
<script type='text/javascript'>
31+
let oliveReadyPromise, oliveReadyPromiseResolve;
32+
33+
window.addEventListener("onEmbeddedMessagingReady", () => {
34+
oliveReadyPromise = new Promise((resolve) => {
35+
oliveReadyPromiseResolve = resolve;
36+
});
37+
});
38+
39+
window.addEventListener("onEmbeddedMessagingConversationOpened", () => {
40+
resolveOliveReadyPromise();
41+
});
42+
43+
function resolveOliveReadyPromise() {
44+
if (oliveReadyPromiseResolve) {
45+
oliveReadyPromiseResolve();
46+
}
47+
}
48+
49+
function sendNudge() {
50+
const nudgeText = document.getElementById("nudgeInput").value;
51+
embeddedservice_bootstrap.utilAPI.launchChat();
52+
oliveReadyPromise.then(() => {
53+
embeddedservice_bootstrap.utilAPI.sendTextMessage(nudgeText);
54+
});
55+
}
56+
57+
function initEmbeddedMessaging() {
58+
try {
59+
embeddedservice_bootstrap.settings.language = 'en_US'; // For example, enter 'en' or 'en-US'
60+
embeddedservice_bootstrap.settings.devMode = true;
61+
62+
embeddedservice_bootstrap.init(
63+
'00DSB00000aGFJL',
64+
'CWC_5',
65+
'https://orgfarm-cd97985f87.my.site-com.f1f9h67w8lzd1bmxa00yv89dt.wc.crm.dev:6101/ESWCWC11768329220029',
66+
{
67+
scrt2URL: 'https://orgfarm-d585323017.test1.my.pc-rnd.salesforce-scrt.com'
68+
}
69+
);
70+
} catch (err) {
71+
console.error('Error loading Embedded Messaging: ', err);
72+
}
73+
};
74+
</script>
75+
<script type='text/javascript' src='https://orgfarm-cd97985f87.my.site-com.f1f9h67w8lzd1bmxa00yv89dt.wc.crm.dev:6101/ESWCWC11768329220029/assets/js/bootstrap.js' onload='initEmbeddedMessaging()'></script>
76+
77+
</body>
78+
</html>

0 commit comments

Comments
 (0)