-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
113 lines (104 loc) · 3.47 KB
/
index.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>The Card Yard</title>
<link rel="stylesheet" href="./assets/style.css"></link>
<script src="./src/cardHelper.js" defer></script>
<script src="./src/webex.js" defer></script>
<script src="./src/main.js" defer></script>
<script defer src="https://cdn.jsdelivr.net/npm/[email protected]/dist/cdn.min.js"></script>
</head>
<body
x-cloak
x-data="model"
>
<header>
Card Yard
</header>
<main>
<section>
<textarea
class="card-json"
:placeholder="jsonHint"
:value="currentJson"
@input="setJson($event.target.value)"
@change="reformat()"
:class="validJson ? '' : 'invalid'"
></textarea>
<div style="display: flex; justify-content: space-between; align-items: center">
<div>
<!-- <span class="tip">Ctrl+Enter to paste and send</span> -->
<button @click="paste()">Paste from clipboard</button>
</div>
<div class="size">
<span x-text="messageSize"></span> / <span x-text="maxSize"></span> bytes
</div>
</div>
</section>
<section class="form">
<div>Test your adaptive card designs by sending them on Webex using a bot.
</div>
<select @change="setToken($event.target.value)" x-show="recentTokens?.length > 1">
<template x-for="entry in recentTokens">
<option
x-text="tokenName(entry)"
:value="entry.token"
:selected="entry.token === botToken"
></option>
</template>
</select>
<label>Access token (bot or <a href="https://developer.webex.com/docs/getting-started" target="_blank">your own</a>):</label>
<textarea
placeholder="Bot token"
x-model="botToken"
x-show="!sender"
@change="checkToken()"
@blur="checkToken()"
rows="3"
></textarea>
<div x-show="sender" class="row field">
<span class="avatar" x-show="sender" :style="{ 'background-image': `url(${sender?.avatar})`}"></span>
<div x-text="sender?.displayName" class="grow"></div>
<button @click="sender = null">Edit</button>
</div>
<label>Recipient (email or room id):</label>
<textarea
placeholder="Recipient email"
:value="recipient"
x-show="!receiver"
@input="setRecipient($event.target.value)"
@change="checkRecipient()"
@blur="checkRecipient()"
rows="3"
></textarea>
<div class="row field" x-show="receiver">
<span
class="avatar"
x-show="receiver?.avatar"
:style="{ 'background-image': `url(${receiver?.avatar})`}"
></span>
<div x-text="receiver?.name" class="grow"></div>
<button @click="receiver = null">Edit</button>
</div>
<div x-text="error || success" x-show="error || success" :class="error ? 'error' : 'success'"></div>
<div style="text-align: center">
<button
:disabled="!canSend || sending"
@click="send()"
class="primary"
x-text="sending ? 'Sending...' : 'Send card'"
></button>
</div>
</section>
</main>
<footer>
Links:
<a href="https://developer.webex.com/docs/api/guides/cards" target="_blank">Intro to buttons and cards</a>
<a href="https://adaptivecards.io/designer/" target="_blank">Card designer</a>
<a href="https://github.com/cisco-ce/cardyard" target="_blank" title="Pull Requests welcome!">Github</a>
</footer>
</body>
</html>