-
Notifications
You must be signed in to change notification settings - Fork 49
Expand file tree
/
Copy pathindex.html
More file actions
201 lines (185 loc) · 6.06 KB
/
Copy pathindex.html
File metadata and controls
201 lines (185 loc) · 6.06 KB
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
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
<!doctype html>
{{> license}}
<html>
<head>
{{> meta title='PubNub Client Test'}}
{{> header-scripts}}
{{> header-stylesheets}}
<style>
.radio-group {
display: flex;
flex-direction: column;
}
.input-field {
margin-left: 10px;
}
.input-field:disabled {
cursor: not-allowed;
opacity: 0.5;
}
.settings-field {
margin: 0.5rem !important;
}
.loading-indicator {
cursor: progress;
opacity: 0.5;
animation: pulse 1s infinite;
}
.form-section.connected {
display: none;
}
.settings-header {
font-size: 1.2em;
text-align: left;
padding: 10px;
background-color: aliceblue;
cursor: pointer;
}
.settings-header::before {
content: '▼';
margin-right: 10px;
color: #666;
}
.settings-header.collapsed::before {
content: '▶';
margin-right: 10px;
color: #666;
}
.message-container {
padding: 20px;
background-color: #eeee;
display: flex;
flex-direction: column;
gap: 16px;
}
.message-input {
margin: 0;
display: block;
height: calc(1.5em + 0.75rem + 2px);
padding: 0.375rem 0.75rem;
font-size: 1rem;
font-weight: 400;
line-height: 1.5;
color: #495057;
background-color: #fff;
background-clip: padding-box;
border: 1px solid #ced4da;
border-radius: 0.25rem;
transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
.message-list {
list-style: none;
padding: 0;
padding: 16px;
border: 1px solid #ced4da;
border-radius: 10px;
display: flex;
flex-direction: column;
gap: 10px;
}
.message-item {
background-color: white;
border-radius: 10px;
padding: 16px;
}
.message-item.user-message {
text-align: right;
color: #000;
}
.message-item.other-message {
text-align: left;
color: #666;
}
@keyframes pulse {
0% {
opacity: 0.5;
}
50% {
opacity: 1;
}
100% {
opacity: 0.5;
}
}
</style>
<script src="https://cdn.pubnub.com/sdk/javascript/pubnub.10.2.5.min.js"></script>
</head>
<body>
{{> top-bar }}
<div id="app">
{{> settings-link}}
<div class="ice-background">
<div class="test-notification">
<p>The PubNub Client requires a valid authentication token to connect to the PubNub system. If you know the authentication token, you can enter it below. Otherwise, you can select an authentication service option to test.</p>
</div>
</div>
<div class="test-info">
<h1 class="centered test-title red-text">PubNub Client Test</h1>
</div>
<div class="stream-section">
<p class="settings-header">PubNub Client Settings:</p>
<div class="form-section centered">
<div class="instructions-block radio-group">
<p style="margin-bottom: 12px !important;">Select an authentication option to test:</p>
<p class="settings-field settings-collapsable">
<label class="settings-label">
Backend Service URL:
<input type="radio" name="options" value="backendURL">
</label>
<input id="backendURL" type="text" class="auth-option input-field" disabled placeholder="https://your-backend-service.com/api/get-chat-token">
</p>
<p class="settings-field settings-collapsable">
<label class="settings-label">
Auth Token:
<input type="radio" name="options" value="authToken">
</label>
<input id="authToken" type="text" class="auth-option input-field" disabled placeholder="XXXX=">
</p>
<hr class="paddedHR">
<p class="settings-field settings-collapsable">
<label class="settings-label">
Channel ID:
</label>
<input id="channel-id-input" type="text" class="option-field input-field" placeholder="Channel ID">
</p>
<p class="settings-field settings-collapsable">
<label class="settings-label">
User ID:
</label>
<input id="user-id-input" type="text" class="option-field input-field" placeholder="User ID">
</p>
<p class="settings-field settings-collapsable">
<label class="settings-label">
Publish Key:
</label>
<input id="publish-key-input" type="text" class="option-field input-field" placeholder="Publish Key">
</p>
<p class="settings-field settings-collapsable">
<label class="settings-label">
Subscribe Key:
</label>
<input id="subscribe-key-input" type="text" class="option-field input-field" placeholder="Subscribe Key">
</p>
<hr class="paddedHR">
<p class="settings-controls">
<button id="connect-button" class="control ui-button" disabled>Connect</button>
</p>
</div>
</div>
<div class="pubnub-section stream-section">
<p id="status-field" class="centered status-field">STATUS: Idle.</p>
<div class="message-container">
<p>Send Message:</p>
<input id="message-input" type="text" class="message-input input-field" placeholder="Message">
<button id="send-button" class="control ui-button">Send</button>
<hr class="paddedHR">
<p>Received Messages:</p>
<ul id="received-messages" class="message-list"></ul>
</div>
</div>
</div>
{{> footer}}
{{> body-scripts}}
<script src="index.js"></script>
</body>
</html>