This repository has been archived by the owner on Jan 11, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
example.html
134 lines (120 loc) · 5.5 KB
/
example.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8" />
<title>Adaptive Cards - Basic Example</title>
<script src="dist/adaptive-cards.js"></script>
</head>
<body>
<h1>Adaptive Cards - Basic Example</h1>
<div id="exampleDiv"></div>
<script>
var json = {
"$schema": "http://adaptivecards.io/schemas/adaptive-card.json",
"type": "AdaptiveCard",
"version": "0.5",
"speak": "<s>The forecast for Seattle January 20 is mostly clear with a High of 51 degrees and Low of 40 degrees</s>",
"body": [
{
"type": "Container",
"items": [
{
"type": "TextBlock",
"text": "Seattle, Washington - January 20, 7:30 AM",
"isSubtle": true
}
]
},
{
"type": "Container",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "Image",
"url": "http://messagecardplayground.azurewebsites.net/assets/Mostly Cloudy-Square.png",
"size": "small",
"horizontalAlignment": "center"
}
]
},
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "ColumnSet",
"columns": [
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "TextBlock",
"text": "42",
"size": "extraLarge"
}
]
},
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "TextBlock",
"text": "°F",
"weight": "bolder"
}
]
}
]
},
{
"type": "TextBlock",
"text": "Mostly Clear",
"isSubtle": true
}
]
},
{
"type": "Column",
"size": "auto",
"items": [
{
"type": "TextBlock",
"text": "Hi 51"
},
{
"type": "TextBlock",
"text": "Lo 40"
}
]
}
]
}
]
}
]
};
</script>
<script>
var adaptiveCard = new AdaptiveCards.AdaptiveCard();
adaptiveCard.parse(json);
var renderedCard = adaptiveCard.render();
var exampleDiv = document.getElementById('exampleDiv');
exampleDiv.appendChild(renderedCard);
AdaptiveCards.AdaptiveCard.onExecuteAction = function (action) {
alert(JSON.stringify(action));
};
</script>
<p>
This example requires a build of the Adaptive Cards library. From the command line, enter "npm run build" which will put
the built files in the /dist folder. Then refresh this page.
</p>
</body>
</html>