Skip to content

Commit 8746d59

Browse files
committed
v1.0.15
1 parent f728b52 commit 8746d59

File tree

8 files changed

+58
-44
lines changed

8 files changed

+58
-44
lines changed

README.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
1-
Welcome to [Watson Assistant](https://www.ibm.com/cloud/watson-assistant/) Web Chat. With just a few lines of code, you can add a Web Chat widget to your website and take advantage of all the best and newest that Watson Assistant has to offer.
1+
# Web Chat
22

3-
This repository is meant for developers who have deployed Web Chat from Watson Assistant and are looking to embed, configure, customize and extend their Web Chat instance. Web Chat is only available to Plus or Premium Watson Assistant plans.
3+
Welcome to [Watson Assistant](https://www.ibm.com/cloud/watson-assistant/) Web Chat. With just a few lines of code, you can add a Web Chat widget to your website and take advantage of all the best and newest that Watson Assistant has to offer.
44

5-
For documentation and coding examples, please visit https://watson-developer-cloud.github.io/assistant-web-chat/.
5+
This repository holds support assets for our documentation and coding example web site.
66

7+
## For documentation and coding examples, please visit https://integrations.us-south.assistant.watson.cloud.ibm.com/web/developer-documentation.

docs/404.html

Lines changed: 11 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>IBM Watson Assistant Web Chat</title>
4+
<title>IBM Watson Assistant Web Chat Documentation</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<link rel="stylesheet" href="carbon-components.min.css">
77
<link rel="stylesheet" href="style.css">
88
</head>
99
<body class="dark">
1010
<div class="container">
11-
<header aria-label="IBM Platform Name" class="bx--header" role="banner"><a class="bx--header__name" href="index.html"><span
11+
<header aria-label="IBM Platform Name" class="bx--header" role="banner"><a class="bx--header__name" href="https://integrations.us-south.assistant.watson.cloud.ibm.com/web/developer-documentation"><span
1212
class="bx--header__name--prefix">IBM</span>&nbsp;Watson Assistant Web Chat</a></header>
1313
<div class="hero">
1414
<div class="hero-image-background"></div>
1515
<div class="hero-background"></div>
1616
<div class="homepage--dots"></div>
1717
<div class="hero--content">
1818
<h2>Watson Assistant Web Chat</h2>
19-
<h3>404: The page you are looking for is missing.</h3>
19+
<h3>The page you are looking for does not exist, click the button below or you will be re-directed in 5 seconds.</h3>
2020
<div class="hero--content--buttons">
21-
<a href="documentation.html" class="bx--btn bx--btn--primary">Documentation</a> <a href="examples.html"
22-
class="bx--btn bx--btn--primary">Examples</a>
21+
<a href="https://integrations.us-south.assistant.watson.cloud.ibm.com/web/developer-documentation"
22+
class="bx--btn bx--btn--primary">Web Chat developer documentation.</a>
2323
</div>
2424
</div>
2525
</div>
2626
</div>
27+
<script>
28+
const redirectDomain = "https://integrations.us-south.assistant.watson.cloud.ibm.com/web/developer-documentation"
29+
setTimeout(function() {
30+
window.location.replace(redirectDomain);
31+
}, 5000);
32+
</script>
2733
</body>
2834
</html>

docs/README.md

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

docs/index.html

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,28 +1,34 @@
11
<!DOCTYPE html>
22
<html>
33
<head>
4-
<title>IBM Watson Assistant Web Chat</title>
4+
<title>IBM Watson Assistant Web Chat Documentation</title>
55
<meta name="viewport" content="width=device-width, initial-scale=1">
66
<link rel="stylesheet" href="carbon-components.min.css">
77
<link rel="stylesheet" href="style.css">
88
</head>
99
<body class="dark">
1010
<div class="container">
11-
<header aria-label="IBM Platform Name" class="bx--header" role="banner"><a class="bx--header__name" href="index.html"><span
11+
<header aria-label="IBM Platform Name" class="bx--header" role="banner"><a class="bx--header__name" href="https://integrations.us-south.assistant.watson.cloud.ibm.com/web/developer-documentation"><span
1212
class="bx--header__name--prefix">IBM</span>&nbsp;Watson Assistant Web Chat</a></header>
1313
<div class="hero">
1414
<div class="hero-image-background"></div>
1515
<div class="hero-background"></div>
1616
<div class="homepage--dots"></div>
1717
<div class="hero--content">
1818
<h2>Watson Assistant Web Chat</h2>
19-
<h3>Get the latest features and benefits from Watson Assistant easily and immediately.</h3>
19+
<h3>This page has moved, click the button below or you will be re-directed in 5 seconds.</h3>
2020
<div class="hero--content--buttons">
21-
<a href="documentation.html" class="bx--btn bx--btn--primary">Documentation</a> <a href="examples.html"
22-
class="bx--btn bx--btn--primary">Examples</a>
21+
<a href="https://integrations.us-south.assistant.watson.cloud.ibm.com/web/developer-documentation"
22+
class="bx--btn bx--btn--primary">Web Chat developer documentation.</a>
2323
</div>
2424
</div>
2525
</div>
2626
</div>
27+
<script>
28+
const redirectDomain = "https://integrations.us-south.assistant.watson.cloud.ibm.com/web/developer-documentation"
29+
setTimeout(function() {
30+
window.location.replace(redirectDomain);
31+
}, 5000);
32+
</script>
2733
</body>
28-
</html>
34+
</html>

languages/en.json

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
"errors_singleMessage": "There is an error with the message you just sent, but feel free to ask me something else.",
66
"errors_ariaMessageRetrying": "We are having some trouble sending your message but are still trying",
77
"errors_ariaMessageFailed": "Your message failed to be sent",
8+
"errors_noAgentsAvailable": "No agents are available.",
89
"input_placeholder": "Type something...",
910
"input_buttonLabel": "Click to send message",
1011
"window_title": "Chat window",
@@ -75,6 +76,9 @@
7576
"process_confirmModalYes": "Yes",
7677
"process_confirmModalNo": "No",
7778
"process_confirmNewThread": "Are you sure you want to start a new thread?",
79+
"process_ariaThreadClosedRunning": "Switched from the thread view to the main chat view. Click resume to reopen the thread or click cancel to cancel it.",
80+
"process_ariaThreadClosedEnded": "Switched from the thread view to the main chat view. Click the thread review button to view the thread.",
81+
"process_ariaThreadOpened": "Switched to the thread view. Click the close thread button to return to the main view.",
7882
"icon_ariaUnreadMessages": "There {count, plural, one {is} other {are}} {count, number} unread {count, plural, one {message} other {messages}}",
7983
"showMore": "Show more",
8084
"showLess": "Show less",

tutorials/user_defined_templates/carousel.css

Lines changed: 9 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,30 +1,28 @@
11
.carousel_container {
2-
display: block;
2+
display: block;
33
width: 100px;
44
position: relative;
55
margin: 1em;
66
overflow: hidden;
77
}
88

9-
.carousel_container .carousel_container_content {
9+
.carousel_container ol.carousel_container_content {
1010
margin: 0 0 1rem 0;
1111
padding: 0;
1212
}
1313

14-
.carousel_container .carousel_container_content li {
14+
.carousel_container ol.carousel_container_content li {
1515
margin: 0;
1616
padding: 0;
1717
width: 100%;
1818
list-style: none;
1919
}
2020

21-
.carousel_container.carousel_container_active li {
22-
padding: 24px 32px;
23-
background: #fff;
21+
.carousel_container.carousel_container_active ol li {
2422
display: none;
2523
}
2624

27-
.carousel_container.carousel_container_active li.carousel_container_current {
25+
.carousel_container.carousel_container_active ol li.carousel_container_current {
2826
display: block;
2927
}
3028

@@ -39,15 +37,15 @@
3937

4038
.carousel_container.carousel_container_active .carousel_container_buttons .carousel_container_next {
4139
position: absolute;
42-
right: -1rem;
40+
right: -1.6rem;
4341
top: 6rem;
4442
z-index: 10;
4543
display: none;
4644
}
4745

4846
.carousel_container.carousel_container_active .carousel_container_buttons .carousel_container_prev {
4947
position: absolute;
50-
left: -1rem;
48+
left: -1.6rem;
5149
top: 6rem;
5250
z-index: 10;
5351
display: none;
@@ -95,23 +93,13 @@
9593
outline-offset: 2px;
9694
}
9795

98-
.carousel_container.carousel_container_active .carousel_container_buttons .carousel_container_next.carousel_container_visible .carousel_container_label,
99-
.carousel_container.carousel_container_active .carousel_container_buttons .carousel_container_prev.carousel_container_visible .carousel_container_label {
100-
background: #000;
101-
cursor: pointer;
102-
padding: 4px 8px;
103-
font-size: 0.6rem;
104-
font-weight: bold;
105-
text-transform: uppercase;
106-
}
107-
108-
.carousel_container.carousel_container_active li img.carousel_slide_image {
96+
.carousel_container.carousel_container_active ol li img.carousel_slide_image {
10997
display: block;
11098
width: 100%;
11199
margin-bottom: 16px;
112100
}
113101

114-
.carousel_container.carousel_container_active li .carousel_slide_title {
102+
.carousel_container.carousel_container_active ol li .carousel_slide_title {
115103
font-weight: bold;
116104
margin-bottom: 4px;
117105
}

tutorials/user_defined_templates/carousel.js

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
/* eslint-disable header/header */
12
function MySimpleCarousel(event) {
23
this.event = event;
34
// Because we render Web Chat to Shadow DOM, we should use `style` tags rather than `link` tags to bring in our CSS.
@@ -95,18 +96,18 @@ MySimpleCarousel.prototype.writeHTML = function() {
9596
const element = document.createElement('div');
9697
element.classList.add('carousel_container');
9798
element.innerHTML =
98-
'<div class="carousel_container_buttons"><button class="carousel_container_prev"><div class="carousel_container_icon"><img src="user_defined_templates/left.svg" /></div><div class="carousel_container_label">Back</div></button><button class="carousel_container_next"><div class="carousel_container_icon"><img src="user_defined_templates/right.svg" /></div><div class="carousel_container_label">Next</div></button></div><ol class="carousel_container_content"></ol>';
99+
'<div class="carousel_container_buttons"><button class="carousel_container_prev"><div class="carousel_container_icon"><img src="user_defined_templates/left.svg" alt="previous" /></div></button><button class="carousel_container_next"><div class="carousel_container_icon"><img src="user_defined_templates/right.svg" alt="next" /></div></button></div><ol class="carousel_container_content"></ol>';
99100
const content = element.querySelector('.carousel_container_content');
100101
const message = this.event.data.message;
101102
message.user_defined.slides.forEach(function(slide) {
102103
content.innerHTML +=
103-
'<li><img class="carousel_slide_image" src="' +
104+
'<li><div class="ibm-web-chat-card"><img class="carousel_slide_image" src="' +
104105
slide.image +
105106
'"/><div class="carousel_slide_title">' +
106107
slide.title +
107108
'</div><div class="carousel_slide_description">' +
108109
slide.description +
109-
'</div></li>';
110+
'</div></div></li>';
110111
});
111112
this.event.data.element.appendChild(element);
112113
};

tutorials/user_defined_templates/color-box.js

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -159,11 +159,24 @@ function handleColorBoxTemplate(event) {
159159
'Yellow',
160160
'YellowGreen'
161161
];
162+
const parent = document.createElement('div');
163+
164+
// Create a element with the 'ibm-web-chat-card' class we will add our content to.
165+
// This class will make the element look like one of the cards used in Web Chat.
166+
const card = document.createElement('div');
167+
card.classList.add('ibm-web-chat-card');
168+
162169
const element = document.createElement('div');
163170
element.setAttribute('style', 'width:100%; height:100%; background-color: red; padding: 24px; text-align: center;');
164171
element.innerHTML = '<button>Make random background color!</button>';
165172
element.querySelector('button').addEventListener('click', function addBackgroundColor(e) {
166173
element.style.backgroundColor = colors[Math.floor(Math.random() * colors.length)];
167174
});
168-
event.data.element.appendChild(element);
175+
176+
// Add our color picker inside the card.
177+
card.innerHTML = '<p style="margin-top:0;"><strong>My Color Changing Card</strong></p>';
178+
card.appendChild(element);
179+
180+
parent.appendChild(card);
181+
event.data.element.appendChild(parent);
169182
}

0 commit comments

Comments
 (0)