Skip to content

Commit 825f5a2

Browse files
committed
docs(chat): Add screenshots
1 parent c3bcfce commit 825f5a2

18 files changed

+84
-56
lines changed

controls/chat/functionality/actions.md

Lines changed: 11 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -18,24 +18,29 @@ To display the **suggestedActions** propmt, you need to call the `renderSuggest
1818

1919
>caption **Figure 1**: A Chat with suggested actions.
2020
21-
![chat with suggested actions](images/suggested-actions.png)
21+
![chat with suggested actions](images/chat-suggested-actions.png)
2222

2323
````ASPX
24-
<telerik:RadChat runat="server" ID="RadChat1">
24+
<telerik:RadChat runat="server" ID="RadChat1" Width="350px" Height="300px">
25+
<ClientEvents OnLoad="renderSuggestedActions" />
2526
</telerik:RadChat>
2627
````
2728

2829
````JavaScript
29-
function renderSuggestedActions() {
30-
var chat = $find("<%= RadChat1.ClientID %>");
31-
30+
function renderSuggestedActions(sender) {
31+
var chat = sender;
32+
var chatBot = { id: 1, name: "SchedulerBot", iconUrl: "avatar.png" };
33+
34+
chat.renderMessage({ text: "Hello!" }, chatBot);
35+
chat.renderMessage({ text: "Please, select an option:" }, chatBot);
36+
3237
chat.renderSuggestedActions([{
3338
title: "Option 1",
3439
value: "Value 1"
3540
}, {
3641
title: "Option 2",
3742
value: "Value 2"
38-
}]);
43+
}], chatBot);
3944
}
4045
````
4146

controls/chat/functionality/cards.md

Lines changed: 15 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,14 +14,21 @@ Rich cards are complex attachment messages that can contain additional message s
1414

1515
>caption **Figure 1**: A Chat that uses the default HeroCard template.
1616
17-
![chat with heroCard template](images/herocard-template.png)
17+
![chat with heroCard template](images/chat-heroCard.png)
1818

1919
````ASPX
2020
<telerik:RadChat runat="server" ID="RadChat1">
21+
<ClientEvents OnLoad="OnLoad"/>
22+
<MessagesSettings Placeholder="Type your message here..." />
23+
<UserSettings Name="John" IconUrl="avatar.png" />
2124
</telerik:RadChat>
2225
````
2326

2427
````JavaScript
28+
function OnLoad(sender, args) {
29+
renderAttachments();
30+
}
31+
2532
function renderAttachments() {
2633
var chat = $find("<%= RadChat1.ClientID %>");
2734
chat.renderAttachments({
@@ -30,7 +37,11 @@ function renderAttachments() {
3037
content: {
3138
title: "Attachment Title",
3239
subtitle: "Attachment Subtitle",
33-
text: "Sample text"
40+
text: "Some sample text to be shown inside the attachment to illustrate the image above.",
41+
images: [{
42+
url: "mountain.png",
43+
alt: "mountain"
44+
}]
3445
}
3546
}],
3647
attachmentLayout: "carousel"
@@ -40,9 +51,9 @@ function renderAttachments() {
4051

4152
The layout of a collection of attachments can be:
4253
* **Carousel** - displays multiple cards *horizontally*;
43-
![Carousel](images/Carousel.png)
54+
![carousel](images/chat-card-carousel.png)
4455
* **List** - displays multiple cards *vertically*;
45-
![deck](images/deck.png)
56+
![deck](images/chat-card-list.png)
4657

4758
To further customize the appearance of a card, you can also use [Custom Templates]({%slug chat/functionality/templates%}) and [Custom Components]({%slug chat/functionality/components%}) articles.
4859

controls/chat/functionality/components.md

Lines changed: 24 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,37 @@ The following example demonstrates how to place a [Kendo UI Calendar](https://do
1717

1818
>caption **Figure 1**: A Chat renders a Kendo UI Calendar to facilitate date choosing.
1919
20-
![chat with custom components](images/custom-components.png)
20+
![chat with custom components](images/chat-custom-component-calendar.png)
2121

2222
````HTML
23-
<%-- load Kendo UI styles and scripts --%>
23+
<%-- load Kendo UI styles --%>
2424
<link rel="stylesheet" href="~/styles/kendo.common.min.css" />
2525
<link rel="stylesheet" href="~/styles/kendo.default.min.css" />
26+
<style>
27+
.t-card {
28+
max-width: none;
29+
}
30+
</style>
31+
````
32+
33+
````ASPX
34+
<telerik:RadScriptManager ID="RadScriptManager1" runat="server">
35+
<Scripts>
36+
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.Core.js" />
37+
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQuery.js" />
38+
<asp:ScriptReference Assembly="Telerik.Web.UI" Name="Telerik.Web.UI.Common.jQueryInclude.js" />
39+
</Scripts>
40+
</telerik:RadScriptManager>
41+
````
42+
43+
````HTML
44+
<%-- load Kendo UI scripts after the ScriptManager and before RadChat --%>
2645
<script src="~/scripts/kendo.all.min.js"></script>
2746
````
2847

2948
````ASPX
30-
<telerik:RadChat runat="server" ID="RadChat1">
49+
<telerik:RadChat runat="server" ID="RadChat1" Width="400px" Height="550px">
50+
<ClientEvents OnLoad="OnLoad" />
3151
</telerik:RadChat>
3252
````
3353

@@ -68,7 +88,7 @@ kendo.chat.registerComponent("CalendarComponent", CalendarComponent);
6888

6989
````JavaScript
7090
function addCustomComponent() {
71-
var chat = $find("<%= RadChat2.ClientID %>");
91+
var chat = $find("<%= RadChat1.ClientID %>");
7292

7393
chat.postMessage("Hello!");
7494
chat.postMessage("Please, select a date from the Calendar.");

controls/chat/functionality/templates.md

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,10 +17,11 @@ The following example demonstrates how to implement a simple [Kendo UI Template]
1717

1818
>caption **Figure 1**: A chat uses custom Kendo UI Templates.
1919
20-
![chat with custom template](images/custom-templates.png)
20+
![chat with custom template](images/chat-custom-template.png)
2121

2222
````ASPX
2323
<telerik:RadChat runat="server" ID="RadChat1">
24+
<ClientEvents OnLoad="renderSuggestedActions" />
2425
</telerik:RadChat>
2526
````
2627

@@ -54,12 +55,12 @@ The following example demonstrates how to implement a simple [Kendo UI Template]
5455
````
5556

5657
````JavaScript
57-
function renderCustomTemplate() {
58+
function renderCustomTemplate(sender) {
5859
// register template
5960
var QUOTE_CARD_TEMPLATE = kendo.template($('#quote-template').html());
6061
kendo.chat.registerTemplate("quote", QUOTE_CARD_TEMPLATE);
6162

62-
var chat = $find("<%= RadChat1.ClientID %>");
63+
var chat = sender;
6364
chat.renderAttachments({
6465
attachments: [{
6566
contentType: "quote",

controls/chat/getting-started.md

Lines changed: 17 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -14,43 +14,40 @@ The following tutorial demonstrates how you can add a simple **RadChat** control
1414

1515
>caption **Figure 1**: A RadChat configuration with a few shapes and connections
1616
17-
![chat-simple-setup](images/chat-simple-setup.png)
17+
![chat-getting-started](images/chat-getting-started.png)
1818

1919
1. Add a **ScriptManager** control on a Web Form.
2020

2121
1. Add a **RadChat** control on this Web Form:
2222

2323
>caption **Example 1**: Declaration of a **RadChat** control.
2424

25-
**ASP.NET**
26-
25+
````ASP.NET
2726
<asp:ScriptManager runat="server" ID="ScriptManager1" />
2827
<telerik:RadChat ID="RadChat1" runat="server">
2928
</telerik:RadChat>
30-
29+
````
3130

3231

3332
1. Set some of the messages and user settings like **Placeholder**, **Name** and **IconUrl**.
3433

3534
>caption **Example 2**: The chat now has a custom placeholder message, username and avatar
3635

37-
**ASP.NET**
38-
36+
````ASP.NET
3937
<asp:ScriptManager runat="server" ID="ScriptManager1" />
4038
<telerik:RadChat runat="server" ID="RadChat1">
4139
<MessagesSettings Placeholder="Type your message here..." />
4240
<UserSettings Name="John" IconUrl="avatar.png" />
4341
</telerik:RadChat>
44-
42+
````
4543

4644
1. Press F5 to run the application. You will see the chat that is displayed in **Figure 1**. From this point you can start interacting with the chat.
4745

4846
>caption **Example 3**: Assigning the client-side event handlers:
49-
50-
**ASP.NET**
51-
47+
48+
````ASP.NET
5249
<asp:ScriptManager runat="server" ID="ScriptManager1" />
53-
<telerik:RadChat runat="server" ID="RadChat1">
50+
<telerik:RadChat runat="server" ID="RadChat1" Width="300px" Height="300px">
5451
<ClientEvents
5552
OnActionClick="OnActionClick"
5653
OnInitialize="OnInitialize"
@@ -62,34 +59,29 @@ The following tutorial demonstrates how you can add a simple **RadChat** control
6259
<MessagesSettings Placeholder="Type your message here..." />
6360
<UserSettings Name="John" IconUrl="avatar.png" />
6461
</telerik:RadChat>
62+
````
6563

6664
````JavaScript
67-
function OnActionClick(sender, args) {
68-
65+
function OnActionClick(sender, args) {
6966
}
7067

71-
function OnInitialize(sender, args) {
72-
68+
function OnInitialize(sender, args) {
7369
}
7470

75-
function OnLoad(sender, args) {
76-
71+
function OnLoad(sender) {
72+
sender.postMessage("Hello!");
7773
}
7874

79-
function OnPost(sender, args) {
80-
75+
function OnPost(sender) {
8176
}
8277

83-
function OnSendMessage(sender, args) {
84-
78+
function OnSendMessage(sender, args) {
8579
}
8680

87-
function OnTypingEnd(sender, args) {
88-
81+
function OnTypingEnd(sender, args) {
8982
}
9083

91-
function OnTypingStart(sender, args) {
92-
84+
function OnTypingStart(sender, args) {
9385
}
9486
````
9587

90.3 KB
Loading
123 KB
Loading
183 KB
Loading
17.3 KB
Loading
6.08 KB
Loading

0 commit comments

Comments
 (0)