generated from edrys-org/module-template
-
Notifications
You must be signed in to change notification settings - Fork 1
/
index.html
162 lines (148 loc) · 6.87 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
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
<!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" />
<meta name="description" content="A reference module to help with development" />
<meta name="show-in" content="*" />
<title>Edrys Reference Module</title>
<script src="https://edrys-org.github.io/edrys/module/edrys.js"></script>
<script defer src="https://edrys-org.github.io/edrys/module/vendor/alpine.min.js"></script>
<link rel="stylesheet" href="https://edrys-org.github.io/edrys/module/vendor/water.min.css" />
<link rel="stylesheet" href="https://edrys-org.github.io/edrys/module/vendor/open-iconic/css/open-iconic.min.css" />
</head>
<body>
<template x-if="!!edrys" x-data="{ edrys: undefined }" x-init="Edrys.onUpdate((e) => { edrys = {...e} })">
<div>
<h1>Edrys Reference Module</h1>
<hr />
<h2>Room Data</h2>
<hr />
<ul>
<li><b>Username:</b> <code x-text="edrys.username"></code></li>
<li><b>User Display Name:</b><code x-text="edrys.liveUser.displayName"></code></li>
<li><b>Current Room:</b><code x-text="edrys.liveRoom.name"></code></li>
<li><b>Role:</b> <code x-text="edrys.role"></code></li>
<li>
<b>Module Metadata:</b>
<ul>
<li>
<b>URL:</b>
<code x-text="edrys.module.url"></code>
</li>
<li>
<b>Config:</b>
<code x-text="JSON.stringify(edrys.module.config)"></code>
</li>
<li x-show="edrys.role == 'student'">
<b>Student Config:</b>
<code x-text="JSON.stringify(edrys.module.studentConfig)"></code>
</li>
<li x-show="edrys.role == 'teacher'">
<b>Teacher Config:</b>
<code x-text="JSON.stringify(edrys.module.teacherConfig)"></code>
</li>
<li x-show="edrys.role == 'station'">
<b>Station Config:</b>
<code x-text="JSON.stringify(edrys.module.stationConfig)"></code>
</li>
<li>
<b>Module Shown In:</b>
<code x-text="edrys.module.shownIn"></code>
</li>
</ul>
</li>
</li>
</ul>
<h2>Room Messaging</h2>
<hr />
<h3>Send Messages</h3>
<form x-data="{ subject: '' ,message: '' }" x-on:submit.prevent="Edrys.sendMessage(subject, message)">
<input type="text" required minlength="1" placeholder="Subject" x-model="subject" />
<input type="text" required minlength="1" placeholder="Body" x-model="message" />
<button type="submit">
<span class="oi" data-glyph="arrow-thick-right" aria-hidden="true"></span>
Send message
</button>
</form>
<h3>Received Messages</h3>
<div x-data="{ messages: [], promiscuous: true }"
x-init="Edrys.onMessage((m) => { messages.push(m) }, promiscuous=promiscuous)">
<em x-show="!messages.length">No messages received yet...</em>
<template x-for="message in messages">
<details>
<summary>
<span x-text="message.from"></span> -
<span x-text="message.subject"></span>
</summary>
<ul>
<li><b>From:</b> <code x-text="message.from"></code></li>
<li><b>Subject:</b> <code x-text="message.subject"></code></li>
<li><b>Body:</b> <code x-text="message.body"></code></li>
<li><b>Module:</b> <code x-text="message.module"></code></li>
<li>
<b>Date Received:</b>
<code x-text="new Date(message.date).toISOString()"></code>
</li>
</ul>
</details>
</template>
</div>
<h2>Other Class Data</h2>
<hr />
<h3>Live Rooms</h3>
<template x-for="room in edrys.liveClass.rooms">
<details>
<summary x-text="room.name"></summary>
<ul>
<li>
<b>Student State:</b>
<span x-text="room.studentPublicState"></span>
</li>
<li>
<b>Teacher State:</b>
<span x-text="room.teacherPublicState"></span>
</li>
<li x-show="edrys.role == 'teacher'">
<b>Private State:</b>
<span x-text="room.teacherPrivateState"></span>
</li>
</ul>
</details>
</template>
<h3>Live Users</h3>
<template x-for="user in edrys.liveClass.users">
<details>
<summary>
<em x-show="!user.name.includes('@')">Station:</em>
<em x-show="user.role == 'teacher'">Teacher:</em>
<em x-show="user.role == 'student'">Student:</em>
<span x-text="user.displayName"></span>
</summary>
<ul>
<li><b>Username:</b> <span x-text="user.name"></span></li>
<li><b>Room:</b> <span x-text="user.room"></span></li>
<li><b>Role:</b> <span x-text="user.role"></span></li>
<li>
<b>Date Joined:</b> <span x-text="user.dateJoined"></span>
</li>
<li>
<b>Hand Raised:</b> <span x-text="user.handRaised"></span>
</li>
<li>
<b>Connections:</b>
<span x-text="user.connections.length"></span>
</li>
</ul>
</details>
</template>
</div>
</template>
<style>
.oi {
padding-right: 5px;
}
</style>
</body>
</html>