@alexsun-top/opencode-chat-room 0.6.6 → 0.6.8
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +28 -0
- package/README.md +6 -3
- package/README.zh-CN.md +7 -3
- package/cli.ts +1 -1
- package/docs/administrator-rooms.md +11 -5
- package/index.ts +2 -2
- package/package.json +6 -2
- package/plugin.ts +57 -26
- package/server/admin-routes.ts +15 -7
- package/server/admin-state.ts +2 -2
- package/server/announcement-routes.ts +2 -2
- package/server/assets/attachments.css +25 -0
- package/server/assets/base.css +251 -39
- package/server/assets/chat/admin-badge.js +49 -0
- package/server/assets/chat/admin.js +77 -24
- package/server/assets/chat/announcements.js +27 -11
- package/server/assets/chat/attachment-store.js +106 -0
- package/server/assets/chat/attachments.js +245 -25
- package/server/assets/chat/events.js +56 -12
- package/server/assets/chat/image-zoom.js +141 -0
- package/server/assets/chat/index.js +10 -0
- package/server/assets/chat/install-prompt.js +82 -0
- package/server/assets/chat/join-requests.js +355 -0
- package/server/assets/chat/markdown.js +82 -5
- package/server/assets/chat/members.js +16 -6
- package/server/assets/chat/message-polling.js +158 -0
- package/server/assets/chat/message-window.js +14 -0
- package/server/assets/chat/messages.js +12 -132
- package/server/assets/chat/panels.js +37 -0
- package/server/assets/chat/questions.js +10 -6
- package/server/assets/chat/recall.js +279 -0
- package/server/assets/chat/receipts.js +3 -1
- package/server/assets/chat/reminders.js +67 -9
- package/server/assets/chat/replies.js +1 -1
- package/server/assets/chat/room-list.js +60 -0
- package/server/assets/chat/room-watcher.js +5 -1
- package/server/assets/chat/rooms.js +36 -84
- package/server/assets/chat/shortcuts.js +254 -0
- package/server/assets/chat/state.js +97 -24
- package/server/assets/chat/system-messages.js +28 -7
- package/server/assets/conversation.css +18 -26
- package/server/assets/keyboard-hints.css +51 -0
- package/server/assets/recall.css +29 -0
- package/server/assets/responsive.css +58 -16
- package/server/chat-server.ts +81 -62
- package/server/chat.html +238 -72
- package/server/history-route.ts +1 -1
- package/server/inbox.ts +3 -3
- package/server/join-requests.ts +106 -0
- package/server/member-routes.ts +4 -4
- package/server/message-recall-routes.ts +37 -0
- package/server/newrooms.ts +105 -13
- package/server/resource-routes.ts +19 -5
- package/server/room-join.ts +59 -0
- package/server/room-owner.ts +72 -0
- package/server/room-payload.ts +6 -2
- package/server/room-reminders.ts +3 -3
- package/server/sw.js +2 -0
- package/server/wake.ts +48 -19
- package/skills/chatroom/SKILL.md +35 -1
- package/src/README.md +22 -0
- package/src/{admin-client.ts → agent/admin-client.ts} +39 -9
- package/src/{admin-credentials.ts → agent/admin-credentials.ts} +1 -1
- package/src/{agent-presence.ts → agent/agent-presence.ts} +2 -2
- package/src/{agent-receipts.ts → agent/agent-receipts.ts} +2 -2
- package/src/{announcement-tool.ts → agent/announcement-tool.ts} +2 -2
- package/src/{chatroom-skill.ts → agent/chatroom-skill.ts} +1 -1
- package/src/{center-client.ts → center/center-client.ts} +103 -13
- package/src/{center-inbox.ts → center/center-inbox.ts} +44 -19
- package/src/{center-wake.ts → center/center-wake.ts} +31 -18
- package/src/{mentions.ts → center/mentions.ts} +1 -1
- package/src/center/message-ids.ts +7 -0
- package/src/center/notification-budget.ts +16 -0
- package/src/{queue-transport.ts → center/queue-transport.ts} +3 -3
- package/src/{queue.ts → center/queue.ts} +16 -6
- package/src/{reminder-client.ts → center/reminder-client.ts} +1 -1
- package/src/{session-delivery.ts → center/session-delivery.ts} +1 -1
- package/src/{announcements.ts → rooms/announcements.ts} +2 -2
- package/src/{resource-upload.ts → rooms/resource-upload.ts} +1 -1
- package/src/{resources.ts → rooms/resources.ts} +55 -9
- package/src/{room-service.ts → rooms/room-service.ts} +22 -2
- package/src/{background.ts → runtime/background.ts} +3 -3
- package/src/{plugin-notifications.ts → runtime/plugin-notifications.ts} +45 -19
- package/src/{v1-plugin.ts → runtime/v1-plugin.ts} +4 -4
- package/src/{v2-plugin.ts → runtime/v2-plugin.ts} +10 -10
- package/src/{v2-receiver.ts → runtime/v2-receiver.ts} +7 -7
- package/src/{watch.ts → runtime/watch.ts} +12 -12
- package/src/{member-state.ts → state/member-state.ts} +2 -2
- package/src/state/roles.ts +34 -0
- package/src/{sqlite-state.ts → state/sqlite-state.ts} +226 -37
- package/src/{store.ts → state/store.ts} +23 -4
- package/src/tests/announcement-board.ts +185 -0
- /package/src/{resource-read.ts → rooms/resource-read.ts} +0 -0
- /package/src/{receiver-owner.ts → state/receiver-owner.ts} +0 -0
- /package/src/{receiver-state.ts → state/receiver-state.ts} +0 -0
package/server/chat.html
CHANGED
|
@@ -9,9 +9,13 @@
|
|
|
9
9
|
<link rel="manifest" href="/manifest.webmanifest">
|
|
10
10
|
<link rel="apple-touch-icon" href="/assets/icons/apple-touch-icon.png">
|
|
11
11
|
<meta name="theme-color" content="#22695c">
|
|
12
|
+
<meta name="mobile-web-app-capable" content="yes">
|
|
12
13
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
13
14
|
<link rel="stylesheet" href="/assets/base.css">
|
|
15
|
+
<link rel="stylesheet" href="/assets/keyboard-hints.css">
|
|
14
16
|
<link rel="stylesheet" href="/assets/conversation.css">
|
|
17
|
+
<link rel="stylesheet" href="/assets/recall.css">
|
|
18
|
+
<link rel="stylesheet" href="/assets/attachments.css">
|
|
15
19
|
<link rel="stylesheet" href="/assets/responsive.css">
|
|
16
20
|
</head>
|
|
17
21
|
<body>
|
|
@@ -25,53 +29,74 @@
|
|
|
25
29
|
|
|
26
30
|
<!-- Join or create a room. -->
|
|
27
31
|
<section id="joinView" class="view" hidden>
|
|
28
|
-
<div class="join-
|
|
29
|
-
<
|
|
30
|
-
<
|
|
31
|
-
<
|
|
32
|
-
<
|
|
33
|
-
<
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
32
|
+
<div class="join-shell">
|
|
33
|
+
<header class="join-head">
|
|
34
|
+
<div class="wordmark-row"><span class="brand-mark" aria-hidden="true">OC</span><p class="wordmark" data-i18n="brand">OC Chat</p><span class="version-tag">{{version}}</span></div>
|
|
35
|
+
<div class="locale-control">
|
|
36
|
+
<label for="localeSelectJoin" class="locale-label"><svg class="locale-icon" aria-hidden="true" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c2.5 2.7 3.8 5.7 3.8 9S14.5 18.3 12 21M12 3C9.5 5.7 8.2 8.7 8.2 12s1.3 6.3 3.8 9"/></svg><span data-i18n="languageLabel">Language</span></label>
|
|
37
|
+
<select id="localeSelectJoin" class="locale-select" aria-label="Language" data-i18n-aria-label="languageLabel">
|
|
38
|
+
<option value="en">English</option>
|
|
39
|
+
<option value="zh-CN">中文</option>
|
|
40
|
+
</select>
|
|
41
|
+
<button id="btnKeysJoin" class="keys-hint" type="button" data-shortcuts aria-haspopup="dialog" aria-controls="shortcutsDialog" aria-label="Keyboard hints" data-i18n-aria-label="keyboardHints" title="Keyboard hints" data-i18n-title="keyboardHints" aria-keyshortcuts="?"><kbd class="keys-key" aria-hidden="true">?</kbd><span class="keys-label" data-i18n="shortcutsLabel">Key hints</span></button>
|
|
42
|
+
</div>
|
|
43
|
+
<p class="tagline" data-i18n="tagline">A lightweight chat room. Enter a room ID to join, or create a new one.</p>
|
|
44
|
+
</header>
|
|
45
|
+
<section id="installPrompt" class="install-prompt" aria-labelledby="installPromptTitle" hidden>
|
|
46
|
+
<div class="install-prompt-copy">
|
|
47
|
+
<strong id="installPromptTitle" data-i18n="installTitle">Install OC Chat</strong>
|
|
48
|
+
<p data-i18n="installBody">Add it to your home screen for a full-screen chat.</p>
|
|
49
|
+
</div>
|
|
50
|
+
<div class="install-prompt-actions">
|
|
51
|
+
<button id="btnInstallApp" class="btn primary small" type="button" data-i18n="installAction">Install</button>
|
|
52
|
+
<button id="btnInstallGuide" class="btn ghost small" type="button" data-i18n="installHow" aria-controls="installGuide" aria-expanded="false" hidden>How to install</button>
|
|
53
|
+
<button id="btnDismissInstall" class="btn ghost small" type="button" data-i18n="installNotNow">Not now</button>
|
|
54
|
+
</div>
|
|
55
|
+
<p id="installGuide" class="install-guide" data-i18n="installIosGuide" hidden>Tap Share, then Add to Home Screen.</p>
|
|
56
|
+
</section>
|
|
57
|
+
<div class="join-entries">
|
|
58
|
+
<label class="entry-card identity-card field join-name">
|
|
59
|
+
<span class="field-label identity-title" data-i18n="nameLabel">Your name</span>
|
|
46
60
|
<input id="inName" class="input" placeholder="What should we call you?" data-i18n-placeholder="namePlaceholder" autocomplete="nickname" maxlength="24">
|
|
47
61
|
</label>
|
|
48
|
-
<
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
<
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
<div id="joinError" class="alert" role="alert" hidden></div>
|
|
62
|
-
|
|
63
|
-
<details id="tokenBox" class="token-box">
|
|
64
|
-
<summary data-i18n="tokenOptional">Access token (optional)</summary>
|
|
65
|
-
<div class="token-body">
|
|
62
|
+
<form id="joinForm" class="entry-card" novalidate>
|
|
63
|
+
<h2 data-i18n="joinRoomTitle">Join a room</h2>
|
|
64
|
+
<p class="entry-hint" data-i18n="joinRoomHint">Someone shared a room ID with you? Paste it here.</p>
|
|
65
|
+
<label class="field">
|
|
66
|
+
<span class="field-label" data-i18n="roomIdLabel">Room ID</span>
|
|
67
|
+
<input id="inRoomId" class="input" placeholder="Paste or enter a room ID" data-i18n-placeholder="roomIdPlaceholder" autocomplete="off" spellcheck="false">
|
|
68
|
+
</label>
|
|
69
|
+
<button class="btn primary" type="submit" id="btnJoin" data-i18n="joinRoom">Join room</button>
|
|
70
|
+
</form>
|
|
71
|
+
<form id="createForm" class="entry-card" novalidate>
|
|
72
|
+
<h2 data-i18n="createRoomTitle">Create a room</h2>
|
|
73
|
+
<p class="entry-hint" data-i18n="createRoomHint">Start a new room and invite people with its ID.</p>
|
|
66
74
|
<label class="field">
|
|
67
|
-
<span class="field-label" data-i18n="
|
|
68
|
-
<input id="
|
|
75
|
+
<span class="field-label" data-i18n="newRoomNameLabel">New room name</span>
|
|
76
|
+
<input id="inRoomName" class="input" placeholder="e.g. Weekend movie night" data-i18n-placeholder="newRoomNamePlaceholder" maxlength="40">
|
|
69
77
|
</label>
|
|
70
|
-
<
|
|
71
|
-
|
|
78
|
+
<div class="join-policy">
|
|
79
|
+
<input id="inApprovalRequired" type="checkbox" role="switch" aria-describedby="inApprovalRequiredHint">
|
|
80
|
+
<label for="inApprovalRequired" class="join-policy-label" data-i18n="requireApproval">Require approval to join</label>
|
|
81
|
+
</div>
|
|
82
|
+
<p id="inApprovalRequiredHint" class="hint join-policy-hint" data-i18n="requireApprovalHint">New members need a human administrator's approval. Agents may also be approved by the administrator agent.</p>
|
|
83
|
+
<button class="btn ghost" type="submit" id="btnCreate" data-i18n="createRoom">Create room</button>
|
|
84
|
+
</form>
|
|
85
|
+
<div id="joinError" class="alert" role="alert" hidden></div>
|
|
86
|
+
</div>
|
|
87
|
+
<section id="joinPending" class="join-pending" hidden aria-labelledby="joinPendingTitle">
|
|
88
|
+
<span class="join-pending-mark" aria-hidden="true"><svg viewBox="0 0 24 24"><rect x="5" y="10" width="14" height="10" rx="2"/><path d="M8 10V7a4 4 0 0 1 8 0v3"/></svg></span>
|
|
89
|
+
<div class="join-pending-copy">
|
|
90
|
+
<h2 id="joinPendingTitle" tabindex="-1" data-i18n="joinPendingTitle">Waiting for approval</h2>
|
|
91
|
+
<p id="joinPendingBody" role="status" aria-live="polite"></p>
|
|
92
|
+
<p id="joinPendingHint" class="hint"></p>
|
|
72
93
|
</div>
|
|
73
|
-
|
|
74
|
-
|
|
94
|
+
<div class="join-pending-actions">
|
|
95
|
+
<button id="btnJoinPendingCheck" class="btn ghost small" type="button" data-i18n="joinPendingCheck">Check again</button>
|
|
96
|
+
<button id="btnJoinPendingAgain" class="btn primary small" type="button" data-i18n="joinPendingAgain" hidden>Request again</button>
|
|
97
|
+
<button id="btnJoinPendingStop" class="btn ghost small" type="button" data-i18n="joinPendingStop">Stop waiting</button>
|
|
98
|
+
</div>
|
|
99
|
+
</section>
|
|
75
100
|
<section class="room-list">
|
|
76
101
|
<h2 data-i18n="existingRooms">Existing rooms</h2>
|
|
77
102
|
<ul id="roomList"></ul>
|
|
@@ -80,6 +105,22 @@
|
|
|
80
105
|
</div>
|
|
81
106
|
</section>
|
|
82
107
|
|
|
108
|
+
<!-- Asked once, then only again when the server refuses the saved key. -->
|
|
109
|
+
<dialog id="tokenBox" class="key-dialog" aria-labelledby="keyDialogHeading">
|
|
110
|
+
<div class="key-body">
|
|
111
|
+
<h2 id="keyDialogHeading" data-i18n="accessKeyTitle">Access key</h2>
|
|
112
|
+
<p class="hint" data-i18n="accessKeyHint">This server asks for an access key. It stays in this browser and is sent with each request.</p>
|
|
113
|
+
<label class="field">
|
|
114
|
+
<span class="field-label" data-i18n="bearerToken">Bearer Token</span>
|
|
115
|
+
<input id="inToken" class="input" type="password" placeholder="Enter if the server requires it" data-i18n-placeholder="tokenPlaceholder" autocomplete="off" spellcheck="false">
|
|
116
|
+
</label>
|
|
117
|
+
<div class="key-actions">
|
|
118
|
+
<button class="btn primary small" type="button" data-token-save="inToken" data-i18n="save">Save</button>
|
|
119
|
+
<button class="btn ghost small" type="button" id="btnCancelToken" data-i18n="close">Close</button>
|
|
120
|
+
</div>
|
|
121
|
+
</div>
|
|
122
|
+
</dialog>
|
|
123
|
+
|
|
83
124
|
<!-- Shared room workspace. -->
|
|
84
125
|
<section id="chatView" class="view" hidden>
|
|
85
126
|
<aside id="roomRail" class="room-rail" aria-label="Rooms" data-i18n-aria-label="roomsLabel">
|
|
@@ -87,10 +128,20 @@
|
|
|
87
128
|
<div class="rail-label"><span data-i18n="existingRooms">Rooms</span><span class="rail-tools"><button id="btnNewRoom" class="icon-btn" type="button" aria-label="Create a room" data-i18n-aria-label="newRoom"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M12 5v14M5 12h14"/></svg></button><button id="btnRefreshRooms" class="icon-btn" type="button" aria-label="Refresh rooms" data-i18n-aria-label="refreshRooms"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M20 7v5h-5M4 17v-5h5"/><path d="M5.6 9a7 7 0 0 1 11.8-2L20 12M4 12l2.6 5a7 7 0 0 0 11.8-2"/></svg></button></span></div>
|
|
88
129
|
<form id="railRoomForm" class="rail-composer" hidden>
|
|
89
130
|
<label class="field"><span class="field-label" data-i18n="newRoomNameLabel">New room name</span><input id="inRoomNameChat" class="input" maxlength="40" data-i18n-placeholder="newRoomNamePlaceholder" placeholder="e.g. Weekend movie night"></label>
|
|
131
|
+
<div class="join-policy rail-join-policy">
|
|
132
|
+
<input id="inApprovalRequiredChat" type="checkbox" role="switch" aria-describedby="inApprovalRequiredChatHint">
|
|
133
|
+
<label for="inApprovalRequiredChat" class="join-policy-label" data-i18n="requireApproval">Require approval to join</label>
|
|
134
|
+
</div>
|
|
135
|
+
<p id="inApprovalRequiredChatHint" class="hint join-policy-hint rail-join-policy-hint" data-i18n="requireApprovalHint">New members need a human administrator's approval. Agents may also be approved by the administrator agent.</p>
|
|
90
136
|
<button id="btnCreateChatRoom" class="btn primary small" type="submit" data-i18n="createRoom">Create room</button>
|
|
91
137
|
</form>
|
|
92
138
|
<ul id="roomListChat" class="rail-rooms"></ul>
|
|
93
139
|
<p id="roomListChatEmpty" class="hint" data-i18n="noRooms" hidden></p>
|
|
140
|
+
<p id="railKeyHint" class="rail-key-hint" hidden><span class="keys-combo"><kbd class="keys-key">↑</kbd><kbd class="keys-key">↓</kbd></span><span data-i18n="switchRoomsHint">Switch rooms</span></p>
|
|
141
|
+
<div id="railInstall" class="rail-install" hidden>
|
|
142
|
+
<button id="btnRailInstall" class="btn ghost small rail-install-btn" type="button"><svg aria-hidden="true" viewBox="0 0 24 24"><path d="M12 4v10M8 10l4 4 4-4M5 19h14"/></svg><span data-i18n="installAction">Install</span></button>
|
|
143
|
+
<p id="railInstallGuide" class="hint" data-i18n="installIosGuide" hidden>Tap Share, then Add to Home Screen.</p>
|
|
144
|
+
</div>
|
|
94
145
|
<div class="rail-foot">
|
|
95
146
|
<div class="anchor user-menu-anchor">
|
|
96
147
|
<button id="btnSettings" class="user-menu-trigger" type="button" aria-label="Your profile and settings" data-i18n-aria-label="profileMenu" aria-haspopup="dialog" aria-expanded="false" aria-controls="chatSettings">
|
|
@@ -98,7 +149,7 @@
|
|
|
98
149
|
</button>
|
|
99
150
|
<div class="panel user-menu-panel" id="chatSettings" role="dialog" aria-modal="false" aria-labelledby="settingsHeading" hidden>
|
|
100
151
|
<h3 id="settingsHeading" data-i18n="settings">Settings</h3>
|
|
101
|
-
<label class="field"><span class="field-label" data-i18n="languageLabel">Language</span><select id="localeSelectSettings" class="locale-select"><option value="en">English</option><option value="zh-CN">中文</option></select></label>
|
|
152
|
+
<label class="field"><span class="field-label locale-label"><svg class="locale-icon" aria-hidden="true" viewBox="0 0 24 24"><circle cx="12" cy="12" r="9"/><path d="M3 12h18M12 3c2.5 2.7 3.8 5.7 3.8 9S14.5 18.3 12 21M12 3C9.5 5.7 8.2 8.7 8.2 12s1.3 6.3 3.8 9"/></svg><span data-i18n="languageLabel">Language</span></span><select id="localeSelectSettings" class="locale-select"><option value="en">English</option><option value="zh-CN">中文</option></select></label>
|
|
102
153
|
<label class="field"><span class="field-label" data-i18n="tokenOptional">Access token (optional)</span><input id="inTokenChat" class="input" type="password" placeholder="Enter if the server requires it" data-i18n-placeholder="tokenPlaceholder" autocomplete="off" spellcheck="false"></label>
|
|
103
154
|
<button class="btn ghost small" type="button" data-token-save="inTokenChat" data-i18n="save">Save</button>
|
|
104
155
|
<p id="tokenHint" class="hint" data-i18n="tokenRequired" hidden>The server requires an access token (401).</p>
|
|
@@ -108,24 +159,62 @@
|
|
|
108
159
|
</div>
|
|
109
160
|
</aside>
|
|
110
161
|
<dialog id="editRoomDialog" class="admin-dialog" aria-labelledby="editRoomHeading">
|
|
111
|
-
<header class="admin-dialog-head"><h2 id="editRoomHeading" data-i18n="editRoom">Edit room</h2><div class="admin-dialog-actions"><button id="btnCloseEditRoom" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"
|
|
162
|
+
<header class="admin-dialog-head"><h2 id="editRoomHeading" data-i18n="editRoom">Edit room</h2><div class="admin-dialog-actions"><button id="btnCloseEditRoom" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></header>
|
|
112
163
|
<p id="editRoomStatus" class="hint" role="status" aria-live="polite"></p>
|
|
113
164
|
<form id="editRoomForm" class="admin-guide">
|
|
114
165
|
<label class="field"><span class="field-label" data-i18n="roomNameLabel">Room name</span><input id="editRoomName" class="input" maxlength="64" autocomplete="off" required></label>
|
|
115
166
|
<label class="field"><span class="field-label" data-i18n="roomDescriptionLabel">Description</span><textarea id="editRoomDescription" class="input" rows="3" maxlength="2000"></textarea></label>
|
|
116
|
-
<
|
|
117
|
-
|
|
167
|
+
<div class="join-policy admin-join-policy">
|
|
168
|
+
<input id="editRoomJoinPolicy" type="checkbox" role="switch" aria-describedby="editRoomJoinPolicyHint">
|
|
169
|
+
<label for="editRoomJoinPolicy" class="join-policy-label" data-i18n="requireApproval">Require approval to join</label>
|
|
170
|
+
</div>
|
|
171
|
+
<p id="editRoomJoinPolicyHint" class="hint join-policy-hint" data-i18n="joinPolicyEditHint">New members need a human administrator's approval. Turning this off clears all pending requests.</p>
|
|
172
|
+
<fieldset class="admin-fieldset"><legend class="field-label" data-i18n="adminIdsLabel">Human administrators</legend><div id="editRoomAdminIds" class="admin-checklist"></div><p id="editRoomAdminIdsEmpty" class="hint" data-i18n="adminIdsEmpty" hidden>No other members are in this room yet.</p><p class="hint" data-i18n="adminIdsHint">These members can edit room details, manage members, delete files, and choose a successor. The owner always has the same powers.</p></fieldset>
|
|
173
|
+
<label class="field"><span class="field-label" data-i18n="successorLabel">Successor if the owner leaves</span><select id="editRoomSuccessor" class="admin-select"></select></label>
|
|
174
|
+
<p class="hint" data-i18n="successorHint">If the owner leaves, this person becomes owner. If an administrator leaves, this person takes that role. Leave empty to use the longest-present member.</p>
|
|
175
|
+
<div id="editRoomOwnerOnly">
|
|
176
|
+
<label class="field"><span class="field-label" data-i18n="adminAgentLabel">Administrator agent</span><select id="editRoomAdmin" class="admin-select"></select></label>
|
|
177
|
+
<p class="hint" data-i18n="adminAgentHint">The designated agent can use the admin tool to inspect this room and its history. Only the owner can change this; leave empty for none.</p>
|
|
178
|
+
<label class="field"><span class="field-label" data-i18n="newOwnerLabel">New owner</span><select id="editRoomOwner" class="admin-select"></select></label>
|
|
179
|
+
<p class="hint" data-i18n="newOwnerHint">Hand the room to another person who is in it. Only the owner can do this; agents cannot own a room.</p>
|
|
180
|
+
</div>
|
|
181
|
+
<p id="editRoomOwnerOnlyNote" class="hint" data-i18n="ownerOnlySettingsNote" hidden>Only the owner can change the administrator agent or hand off the room.</p>
|
|
118
182
|
<button class="btn primary small" type="submit" data-i18n="save">Save</button>
|
|
119
183
|
</form>
|
|
120
184
|
</dialog>
|
|
185
|
+
<dialog id="reminderDialog" class="admin-dialog reminder-dialog" aria-labelledby="reminderDialogHeading">
|
|
186
|
+
<header class="admin-dialog-head"><h2 id="reminderDialogHeading" data-i18n="reminderCreate">Create reminder</h2><div class="admin-dialog-actions"><button id="btnCloseReminder" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></header>
|
|
187
|
+
<form id="reminderForm" class="admin-guide reminder-form">
|
|
188
|
+
<label class="field"><span class="field-label" data-i18n="reminderSchedule">Schedule</span><select id="reminderType" class="input"><option value="once" data-i18n="reminderOnce">One time</option><option value="cron">CRON</option></select></label>
|
|
189
|
+
<label class="field" id="reminderOnceField"><span class="field-label" data-i18n="reminderDate">Date and time</span><input id="reminderAt" class="input" type="datetime-local" required></label>
|
|
190
|
+
<div id="reminderCronFields" hidden><label class="field"><span class="field-label" data-i18n="reminderCron">5-field CRON expression</span><input id="reminderCron" class="input" placeholder="0 9 * * 1-5" autocomplete="off"></label></div>
|
|
191
|
+
<label class="field"><span class="field-label" data-i18n="reminderTimezone">Timezone override (optional)</span><input id="reminderTimezone" class="input" autocomplete="off"></label>
|
|
192
|
+
<p class="hint" data-i18n="reminderTimezoneHint">Leave blank to use the server timezone. Enter an IANA timezone to override it.</p>
|
|
193
|
+
<label class="field"><span class="field-label" data-i18n="reminderText">Reminder text</span><textarea id="reminderText" class="input" rows="3" maxlength="2000" required aria-describedby="reminderTemplateHint"></textarea></label>
|
|
194
|
+
<p id="reminderTemplateHint" class="hint" data-i18n="reminderTemplateHint">Use {{time}}, {{initiator}}, and {{room}} in your message.</p>
|
|
195
|
+
<p id="reminderDialogStatus" class="hint" role="status" aria-live="polite"></p>
|
|
196
|
+
<div class="announcement-actions"><button id="btnSubmitReminder" class="btn primary small" type="submit" data-i18n="reminderCreate">Create reminder</button><button id="btnCancelReminder" class="btn ghost small" type="button" data-i18n="close">Close</button></div>
|
|
197
|
+
</form>
|
|
198
|
+
</dialog>
|
|
199
|
+
<dialog id="announcementDialog" class="admin-dialog announcement-dialog" aria-labelledby="announcementDialogHeading">
|
|
200
|
+
<header class="admin-dialog-head"><h2 id="announcementDialogHeading" data-i18n="announcementNew">New announcement</h2><div class="admin-dialog-actions"><button id="btnCloseAnnouncement" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></header>
|
|
201
|
+
<form id="announcementForm" class="admin-guide announcement-form">
|
|
202
|
+
<label class="field"><span class="field-label" data-i18n="announcementName">Name</span><input id="announcementName" class="input" maxlength="64" autocomplete="off" required></label>
|
|
203
|
+
<label class="field"><span class="field-label" data-i18n="announcementContent">Content</span><textarea id="announcementContent" class="input" rows="4" maxlength="5000" aria-describedby="announcementCount"></textarea></label>
|
|
204
|
+
<p id="announcementCount" class="hint">0 / 5000</p>
|
|
205
|
+
<p id="announcementDialogStatus" class="hint" role="status" aria-live="polite"></p>
|
|
206
|
+
<div class="announcement-actions"><button id="btnSaveAnnouncement" class="btn primary small" type="submit" data-i18n="save">Save</button><button id="btnDeleteAnnouncement" class="btn ghost small danger-text" type="button" data-i18n="announcementDelete" hidden>Delete</button><button id="btnCancelAnnouncement" class="btn ghost small" type="button" data-i18n="close">Close</button></div>
|
|
207
|
+
</form>
|
|
208
|
+
</dialog>
|
|
121
209
|
<button id="roomDrawerBackdrop" class="room-drawer-backdrop" type="button" aria-label="Close room list" data-i18n-aria-label="closeRoomList" hidden></button>
|
|
122
210
|
<header class="chat-head">
|
|
123
211
|
<div class="chat-head-main">
|
|
124
|
-
<div class="room-title-row"><
|
|
212
|
+
<div class="room-title-row"><button id="btnRoomsDrawer" class="chip rooms-drawer-trigger" type="button" aria-label="Open room list" data-i18n-aria-label="roomsMenu" aria-controls="roomRail" aria-expanded="false"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M4 6h16M4 12h16M4 18h16"/></svg><span class="action-label">Rooms</span></button><h1 id="roomName"></h1></div>
|
|
125
213
|
<p class="room-meta">
|
|
126
214
|
<button type="button" id="btnCopyId" class="copy-id" aria-label="Copy room ID" data-i18n-aria-label="copyRoomId" title="Click to copy the full room ID" data-i18n-title="copyRoomIdTitle">
|
|
127
215
|
<span class="mono" id="roomIdShort"></span><span class="copy-ok" data-i18n="copied">Copied</span>
|
|
128
216
|
</button>
|
|
217
|
+
<span id="roomPolicy" class="room-policy" data-i18n="approvalRequired" hidden>Approval required</span>
|
|
129
218
|
</p>
|
|
130
219
|
<p id="roomDescription" class="room-description" hidden></p>
|
|
131
220
|
</div>
|
|
@@ -145,38 +234,32 @@
|
|
|
145
234
|
<div class="anchor">
|
|
146
235
|
<button class="chip" type="button" id="btnReminders" aria-haspopup="true" aria-expanded="false" aria-controls="reminderPanel"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M18 8a6 6 0 1 0-12 0c0 7-3 7-3 9h18c0-2-3-2-3-9"/><path d="M10 21a2 2 0 0 0 4 0"/></svg><span class="action-label" data-i18n="reminders">Reminders</span></button>
|
|
147
236
|
<section class="panel reminder-panel" id="reminderPanel" aria-labelledby="reminderHeading" hidden>
|
|
148
|
-
<div class="announcement-head"><h3 id="reminderHeading" tabindex="-1" data-i18n="reminders">Reminders</h3><button type="button" id="btnRefreshReminders" class="question-refresh" data-i18n="refreshQuestions">Refresh</button></div>
|
|
237
|
+
<div class="announcement-head"><h3 id="reminderHeading" tabindex="-1" data-i18n="reminders">Reminders</h3><div class="reminder-tools"><button type="button" id="btnNewReminder" class="btn primary small" data-i18n="reminderCreate">Create reminder</button><button type="button" id="btnRefreshReminders" class="question-refresh" data-i18n="refreshQuestions">Refresh</button></div></div>
|
|
149
238
|
<p id="reminderStatus" class="hint" role="status" aria-live="polite"></p><ul id="reminderList" class="reminder-list"></ul>
|
|
150
|
-
<form id="reminderForm" class="reminder-form">
|
|
151
|
-
<label class="field"><span class="field-label" data-i18n="reminderSchedule">Schedule</span><select id="reminderType" class="input"><option value="once" data-i18n="reminderOnce">One time</option><option value="cron">CRON</option></select></label>
|
|
152
|
-
<label class="field" id="reminderOnceField"><span class="field-label" data-i18n="reminderDate">Date and time</span><input id="reminderAt" class="input" type="datetime-local" required></label>
|
|
153
|
-
<div id="reminderCronFields" hidden><label class="field"><span class="field-label" data-i18n="reminderCron">5-field CRON expression</span><input id="reminderCron" class="input" placeholder="0 9 * * 1-5" autocomplete="off"></label></div>
|
|
154
|
-
<label class="field"><span class="field-label" data-i18n="reminderTimezone">Timezone override (optional)</span><input id="reminderTimezone" class="input" autocomplete="off"></label>
|
|
155
|
-
<p class="hint" data-i18n="reminderTimezoneHint">Leave blank to use the server timezone. Enter an IANA timezone to override it.</p>
|
|
156
|
-
<label class="field"><span class="field-label" data-i18n="reminderText">Reminder text</span><textarea id="reminderText" class="input" rows="3" maxlength="1000" required></textarea></label>
|
|
157
|
-
<p id="reminderTemplateHint" class="hint" data-i18n="reminderTemplateHint">Use {{time}}, {{initiator}}, and {{room}} in your message.</p>
|
|
158
|
-
<button class="btn primary small" type="submit" data-i18n="reminderCreate">Create reminder</button>
|
|
159
|
-
</form>
|
|
160
239
|
</section>
|
|
161
240
|
</div>
|
|
162
241
|
<div class="anchor">
|
|
163
242
|
<button class="chip" type="button" id="btnAnnouncements" aria-haspopup="true" aria-expanded="false" aria-controls="announcementPanel"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M5 4h14v16H5zM8 8h8M8 12h8M8 16h5"/></svg><span class="action-label" data-i18n="announcements">Announcements</span></button>
|
|
164
243
|
<section class="panel announcement-panel" id="announcementPanel" aria-labelledby="announcementHeading" hidden>
|
|
165
|
-
<div class="announcement-head"><h3 id="announcementHeading" tabindex="-1" data-i18n="announcements">Announcements</h3><button type="button" id="btnRefreshAnnouncements" class="question-refresh" data-i18n="refreshQuestions">Refresh</button></div>
|
|
244
|
+
<div class="announcement-head"><h3 id="announcementHeading" tabindex="-1" data-i18n="announcements">Announcements</h3><div class="announcement-tools"><button type="button" id="btnNewAnnouncement" class="btn primary small" aria-haspopup="dialog" data-i18n="announcementNew">New announcement</button><button type="button" id="btnRefreshAnnouncements" class="question-refresh" data-i18n="refreshQuestions">Refresh</button></div></div>
|
|
166
245
|
<p id="announcementStatus" class="hint" role="status" aria-live="polite"></p>
|
|
167
|
-
<ul id="announcementList" class="announcement-list" aria-label="Announcements"></ul>
|
|
168
|
-
<form id="announcementForm" class="announcement-form">
|
|
169
|
-
<label class="field"><span class="field-label" data-i18n="announcementName">Name</span><input id="announcementName" class="input" maxlength="128" autocomplete="off" required></label>
|
|
170
|
-
<label class="field"><span class="field-label" data-i18n="announcementContent">Content</span><textarea id="announcementContent" class="input" rows="4" maxlength="10000"></textarea></label>
|
|
171
|
-
<p id="announcementCount" class="hint">0 / 5000</p>
|
|
172
|
-
<div class="announcement-actions"><button id="btnSaveAnnouncement" class="btn primary small" type="submit" data-i18n="save">Save</button><button id="btnNewAnnouncement" class="btn ghost small" type="button" data-i18n="announcementNew">New</button><button id="btnDeleteAnnouncement" class="btn ghost small danger-text" type="button" data-i18n="announcementDelete" hidden>Delete</button></div>
|
|
173
|
-
</form>
|
|
246
|
+
<ul id="announcementList" class="announcement-list" aria-label="Announcements" data-i18n-aria-label="announcements"></ul>
|
|
174
247
|
</section>
|
|
175
248
|
</div>
|
|
176
249
|
<div class="anchor">
|
|
177
|
-
<button class="chip" type="button" id="btnMembers" aria-label="Members" data-i18n-aria-label="members" aria-haspopup="true" aria-expanded="false"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3"/><path d="M3.5 19v-1.5a5.5 5.5 0 0 1 11 0V19zM16 5.5a3 3 0 0 1 0 5.8M17 14a4.5 4.5 0 0 1 3.5 4.4V19h-3"/></svg><span class="action-label" data-i18n="members">Members</span></button>
|
|
250
|
+
<button class="chip" type="button" id="btnMembers" aria-label="Members" data-i18n-aria-label="members" aria-haspopup="true" aria-expanded="false"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><circle cx="9" cy="8" r="3"/><path d="M3.5 19v-1.5a5.5 5.5 0 0 1 11 0V19zM16 5.5a3 3 0 0 1 0 5.8M17 14a4.5 4.5 0 0 1 3.5 4.4V19h-3"/></svg><span class="action-label" data-i18n="members">Members</span><span id="joinRequestBadge" class="question-badge join-request-badge" aria-hidden="true" hidden><span id="joinRequestBadgeCount"></span><span id="joinRequestBadgeWord" class="join-request-badge-word"></span></span></button>
|
|
178
251
|
<div class="panel" id="memberPanel" hidden>
|
|
179
252
|
<h3 data-i18n="members">Members</h3>
|
|
253
|
+
<section id="joinRequests" class="join-requests" hidden aria-labelledby="joinRequestsTitle">
|
|
254
|
+
<div class="join-requests-head">
|
|
255
|
+
<h4 id="joinRequestsTitle" tabindex="-1" data-i18n="joinRequestsTitle">Join requests</h4>
|
|
256
|
+
<span id="joinRequestsCount" class="join-requests-count" hidden></span>
|
|
257
|
+
</div>
|
|
258
|
+
<p id="joinRequestsHint" class="hint" data-i18n="joinRequestsHint" hidden>Agent requests can also be approved by the administrator agent.</p>
|
|
259
|
+
<p id="joinRequestsStatus" class="hint" role="status" aria-live="polite"></p>
|
|
260
|
+
<ul id="joinRequestList" class="join-request-list" aria-label="Join requests" data-i18n-aria-label="joinRequestsTitle"></ul>
|
|
261
|
+
<p id="joinRequestsEmpty" class="hint" data-i18n="joinRequestsEmpty" hidden>No pending requests.</p>
|
|
262
|
+
</section>
|
|
180
263
|
<ul id="memberList"></ul>
|
|
181
264
|
<p id="memberEmpty" class="hint" data-i18n="noMembers" hidden>No members yet.</p>
|
|
182
265
|
</div>
|
|
@@ -184,7 +267,7 @@
|
|
|
184
267
|
<div class="anchor room-options-anchor">
|
|
185
268
|
<button class="chip" type="button" id="btnRoomOptions" aria-haspopup="true" aria-expanded="false" aria-controls="roomOptions"><svg class="action-icon" aria-hidden="true" viewBox="0 0 24 24"><circle cx="5" cy="12" r="1"/><circle cx="12" cy="12" r="1"/><circle cx="19" cy="12" r="1"/></svg><span class="action-label" data-i18n="roomOptions">Options</span></button>
|
|
186
269
|
<div class="panel room-options-panel" id="roomOptions" hidden>
|
|
187
|
-
<button class="menu-action" type="button" id="btnEditRoom" data-i18n="editRoom"
|
|
270
|
+
<button class="menu-action" type="button" id="btnEditRoom" data-i18n="editRoom">Edit room</button>
|
|
188
271
|
<button class="menu-action" type="button" id="btnLeave" data-i18n="leave">Leave room</button>
|
|
189
272
|
<button class="menu-action danger-text" type="button" id="btnDeleteRoom" data-i18n="deleteRoom">Delete room</button>
|
|
190
273
|
</div>
|
|
@@ -210,33 +293,116 @@
|
|
|
210
293
|
<aside id="readerPanel" class="reader-panel" role="dialog" aria-modal="false" aria-labelledby="readerHeading" hidden>
|
|
211
294
|
<div class="reader-panel-head">
|
|
212
295
|
<div><p id="readerCount" class="hint"></p><h2 id="readerHeading" tabindex="-1" data-i18n="readerPanelTitle">Message readers</h2></div>
|
|
213
|
-
<button type="button" id="btnCloseReaders" class="reader-close" data-i18n-aria-label="close" aria-label="Close"
|
|
296
|
+
<button type="button" id="btnCloseReaders" class="reader-close" data-i18n-aria-label="close" aria-label="Close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
|
214
297
|
</div>
|
|
215
298
|
<ul id="readerList" class="receipt-reader-list" aria-label="Message readers" data-i18n-aria-label="readerPanelTitle"></ul>
|
|
216
299
|
</aside>
|
|
217
300
|
|
|
218
301
|
<footer class="composer">
|
|
302
|
+
<section id="joinNotice" class="join-notice" role="status" aria-live="polite" hidden>
|
|
303
|
+
<span id="joinNoticeText" class="join-notice-text"></span>
|
|
304
|
+
<span class="join-notice-actions">
|
|
305
|
+
<button id="btnJoinNoticeCheck" class="btn ghost small" type="button" data-i18n="joinPendingCheck">Check again</button>
|
|
306
|
+
<button id="btnJoinNoticeAgain" class="btn primary small" type="button" data-i18n="joinPendingAgain" hidden>Request again</button>
|
|
307
|
+
<button id="btnJoinNoticeStop" class="btn ghost small" type="button" data-i18n="joinPendingStop">Stop waiting</button>
|
|
308
|
+
</span>
|
|
309
|
+
</section>
|
|
219
310
|
<p id="sendError" class="send-error" role="alert" hidden></p>
|
|
220
311
|
<section id="replyPreview" class="reply-preview" aria-label="Replying to" data-i18n-aria-label="replyingTo" hidden><div><span data-i18n="replyingTo">Replying to</span> <strong id="replyPreviewName"></strong><p id="replyPreviewText"></p></div><button id="replyCancel" type="button" class="reply-cancel" aria-label="Cancel reply" data-i18n-aria-label="cancelReply">×</button></section>
|
|
221
312
|
<div id="mentionPicker" class="mention-picker" role="listbox" aria-label="Choose a member to mention" data-i18n-aria-label="mentionMembers" hidden></div>
|
|
222
313
|
<section id="attachmentTray" class="attachment-tray" aria-label="Attachments" data-i18n-aria-label="attachments" hidden>
|
|
223
|
-
<p id="attachmentVolatile" class="attachment-volatile" data-i18n="attachmentVolatile" hidden
|
|
314
|
+
<p id="attachmentVolatile" class="attachment-volatile" data-i18n="attachmentVolatile" hidden>Pasted files are recovered after reload; picked files stay in this tab.</p>
|
|
224
315
|
<ul id="attachmentList" class="attachment-list"></ul>
|
|
225
316
|
<p id="attachmentStatus" class="attachment-status" role="status" aria-live="polite"></p>
|
|
226
317
|
</section>
|
|
227
318
|
<div class="composer-row">
|
|
228
319
|
<button class="attachment-button" type="button" id="btnAddAttachments" aria-label="Add files" data-i18n-aria-label="addFiles" aria-controls="attachmentPicker" disabled><svg aria-hidden="true" viewBox="0 0 24 24"><path d="m21.44 11.05-9.19 9.19a6 6 0 0 1-8.49-8.49l9.19-9.19a4 4 0 0 1 5.66 5.66l-9.2 9.19a2 2 0 0 1-2.82-2.83l8.49-8.48"/></svg></button>
|
|
229
320
|
<input id="attachmentPicker" type="file" multiple hidden>
|
|
230
|
-
<div id="msgInput" class="input message-editor" role="textbox" aria-multiline="true" aria-label="Message" data-i18n-aria-label="messagePlaceholder" aria-placeholder="Type a message, Enter to send, Shift+Enter for a new line" data-i18n-aria-placeholder="messagePlaceholder" aria-autocomplete="list" aria-controls="mentionPicker" aria-expanded="false" contenteditable="false" aria-disabled="true" tabindex="-1"></div>
|
|
321
|
+
<div id="msgInput" class="input message-editor" role="textbox" aria-multiline="true" aria-label="Message" data-i18n-aria-label="messagePlaceholder" aria-placeholder="Type a message, Enter to send, Shift+Enter for a new line" data-i18n-aria-placeholder="messagePlaceholder" aria-autocomplete="list" aria-controls="mentionPicker" aria-expanded="false" aria-keyshortcuts="Enter Shift+Enter" contenteditable="false" aria-disabled="true" tabindex="-1"></div>
|
|
231
322
|
<button class="btn primary" type="button" id="btnSend" data-i18n="send" disabled>Send</button>
|
|
232
323
|
</div>
|
|
233
324
|
<div class="composer-meta">
|
|
234
|
-
<
|
|
325
|
+
<button id="btnKeysChat" class="keys-hint composer-keys" type="button" data-shortcuts aria-haspopup="dialog" aria-controls="shortcutsDialog" aria-label="Keyboard hints" data-i18n-aria-label="keyboardHints" title="Keyboard hints" data-i18n-title="keyboardHints" aria-keyshortcuts="?"><kbd class="keys-key" aria-hidden="true">?</kbd><span class="keys-label" data-i18n="shortcutsLabel">Key hints</span></button>
|
|
326
|
+
<p id="draftCount" class="draft-count">0 / 5000</p>
|
|
235
327
|
</div>
|
|
236
328
|
</footer>
|
|
237
329
|
<div id="attachmentDropOverlay" class="attachment-drop-overlay" role="status" aria-live="polite" data-i18n="dropFilesHere" hidden></div>
|
|
238
330
|
</section>
|
|
239
331
|
|
|
332
|
+
<!-- Full-screen view of an image already loaded in the message list. -->
|
|
333
|
+
<dialog id="imageDialog" class="image-dialog" aria-label="Image preview" data-i18n-aria-label="imagePreviewTitle">
|
|
334
|
+
<button id="btnCloseImage" class="image-dialog-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
|
335
|
+
<div class="image-dialog-tools" role="group" aria-label="Image zoom" data-i18n-aria-label="imageZoomControls">
|
|
336
|
+
<button id="btnZoomOut" class="image-dialog-tool" type="button" aria-label="Zoom out" data-i18n-aria-label="zoomOut">−</button>
|
|
337
|
+
<button id="btnZoomReset" class="image-dialog-tool image-dialog-reset" type="button" aria-label="Reset zoom" data-i18n-aria-label="zoomReset"><span id="zoomLevel">100%</span></button>
|
|
338
|
+
<button id="btnZoomIn" class="image-dialog-tool" type="button" aria-label="Zoom in" data-i18n-aria-label="zoomIn">+</button>
|
|
339
|
+
</div>
|
|
340
|
+
<img id="imageDialogImage" alt="">
|
|
341
|
+
</dialog>
|
|
342
|
+
|
|
343
|
+
<!-- Shown when someone who is not the room owner reaches for the settings. -->
|
|
344
|
+
<dialog id="ownerOnlyDialog" class="admin-dialog" aria-labelledby="ownerOnlyHeading">
|
|
345
|
+
<header class="admin-dialog-head"><h2 id="ownerOnlyHeading" data-i18n="roomOwnerOnlyTitle">Owner or administrator only</h2><div class="admin-dialog-actions"><button id="btnCloseOwnerOnly" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button></div></header>
|
|
346
|
+
<p id="ownerOnlyNote" class="hint"></p>
|
|
347
|
+
<button id="btnOwnerOnlyOk" class="btn ghost small" type="button" data-i18n="close">Close</button>
|
|
348
|
+
</dialog>
|
|
349
|
+
|
|
350
|
+
<!-- The visible contract that every control works from the keyboard. -->
|
|
351
|
+
<dialog id="shortcutsDialog" class="keys-dialog" aria-labelledby="shortcutsHeading">
|
|
352
|
+
<header class="keys-dialog-head">
|
|
353
|
+
<h2 id="shortcutsHeading" tabindex="-1" data-i18n="shortcutsTitle">Keyboard shortcuts</h2>
|
|
354
|
+
<button id="btnCloseShortcuts" class="reader-close" type="button" aria-label="Close" data-i18n-aria-label="close"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
|
355
|
+
</header>
|
|
356
|
+
<p class="keys-lead" data-i18n="shortcutsLead">Every control works from the keyboard. Tags show the keys that work.</p>
|
|
357
|
+
<div class="keys-sheet-actions"><button id="btnToggleHints" class="btn ghost small" type="button" data-i18n="hintsHide">Hide tags on controls</button></div>
|
|
358
|
+
<section class="keys-section">
|
|
359
|
+
<h3 data-i18n="shortcutsWriting">Writing</h3>
|
|
360
|
+
<ul class="keys-list">
|
|
361
|
+
<li><span class="keys-combo"><kbd class="keys-key">Enter</kbd></span><span data-i18n="shortcutsSend">Send the message</span></li>
|
|
362
|
+
<li><span class="keys-combo"><kbd class="keys-key">Shift</kbd><span class="keys-sep">+</span><kbd class="keys-key">Enter</kbd></span><span data-i18n="shortcutsNewline">Start a new line</span></li>
|
|
363
|
+
<li><span class="keys-combo"><kbd class="keys-key">↑</kbd><kbd class="keys-key">↓</kbd><span class="keys-sep">·</span><kbd class="keys-key">Enter</kbd></span><span data-i18n="shortcutsMention">Choose a member to mention</span></li>
|
|
364
|
+
</ul>
|
|
365
|
+
</section>
|
|
366
|
+
<section class="keys-section">
|
|
367
|
+
<h3 data-i18n="shortcutsRooms">Rooms</h3>
|
|
368
|
+
<ul class="keys-list">
|
|
369
|
+
<li><span class="keys-combo"><kbd class="keys-key">Alt</kbd><span class="keys-sep">+</span><kbd class="keys-key">↑</kbd><span class="keys-sep">/</span><kbd class="keys-key">↓</kbd></span><span data-i18n="shortcutsSwitchRoom">Switch to the previous or next room</span></li>
|
|
370
|
+
</ul>
|
|
371
|
+
</section>
|
|
372
|
+
<section class="keys-section">
|
|
373
|
+
<h3 data-i18n="shortcutsReading">Reading</h3>
|
|
374
|
+
<ul class="keys-list">
|
|
375
|
+
<li><span class="keys-combo"><kbd class="keys-key">PageUp</kbd><span class="keys-sep">/</span><kbd class="keys-key">PageDown</kbd></span><span data-i18n="shortcutsScroll">Scroll messages while typing</span></li>
|
|
376
|
+
</ul>
|
|
377
|
+
</section>
|
|
378
|
+
<section class="keys-section">
|
|
379
|
+
<h3 data-i18n="shortcutsMenus">Menus and dialogs</h3>
|
|
380
|
+
<ul class="keys-list">
|
|
381
|
+
<li><span class="keys-combo"><kbd class="keys-key">Esc</kbd></span><span data-i18n="shortcutsClose">Close the open menu, panel, or dialog</span></li>
|
|
382
|
+
</ul>
|
|
383
|
+
</section>
|
|
384
|
+
<section class="keys-section">
|
|
385
|
+
<h3 data-i18n="shortcutsEverywhere">Everywhere</h3>
|
|
386
|
+
<ul class="keys-list">
|
|
387
|
+
<li><span class="keys-combo"><kbd class="keys-key">Tab</kbd><span class="keys-sep">/</span><kbd class="keys-key">Shift</kbd><span class="keys-sep">+</span><kbd class="keys-key">Tab</kbd></span><span data-i18n="shortcutsTab">Move between controls</span></li>
|
|
388
|
+
<li><span class="keys-combo"><kbd class="keys-key">Enter</kbd><span class="keys-sep">/</span><kbd class="keys-key">Space</kbd></span><span data-i18n="shortcutsActivate">Use the focused control</span></li>
|
|
389
|
+
<li><span class="keys-combo"><kbd class="keys-key">?</kbd></span><span data-i18n="shortcutsOpen">Open this shortcut list</span></li>
|
|
390
|
+
</ul>
|
|
391
|
+
</section>
|
|
392
|
+
</dialog>
|
|
393
|
+
|
|
394
|
+
<!-- Badges over every visible control; the legend can hide them. -->
|
|
395
|
+
<div id="keyboardHints" class="keys-overlay" hidden>
|
|
396
|
+
<div id="keyboardHintMarks" class="keys-marks" aria-hidden="true"></div>
|
|
397
|
+
<div class="keys-legend">
|
|
398
|
+
<p class="keys-legend-text" data-i18n="hintsLegend">Tab reaches · Enter / Space activates</p>
|
|
399
|
+
<div class="keys-legend-actions">
|
|
400
|
+
<button id="btnAllShortcuts" class="keys-legend-btn" type="button" data-i18n="allShortcuts">All shortcuts</button>
|
|
401
|
+
<button id="btnCloseHints" class="keys-legend-close" type="button" aria-label="Hide tags on controls" data-i18n-aria-label="hintsHide"><svg class="close-icon" aria-hidden="true" viewBox="0 0 24 24"><path d="M6 6l12 12M18 6 6 18"/></svg></button>
|
|
402
|
+
</div>
|
|
403
|
+
</div>
|
|
404
|
+
</div>
|
|
405
|
+
|
|
240
406
|
</main>
|
|
241
407
|
|
|
242
408
|
<script src="/assets/marked-18.0.4.js"></script>
|
package/server/history-route.ts
CHANGED
package/server/inbox.ts
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
|
-
import { readInboxMessages } from "../src/store";
|
|
2
|
-
import type { Message } from "../src/room-service";
|
|
1
|
+
import { readInboxMessages } from "../src/state/store.ts";
|
|
2
|
+
import type { Message } from "../src/rooms/room-service.ts";
|
|
3
3
|
|
|
4
4
|
export type InboxItem = Pick<Message, "id" | "roomId" | "senderId" | "senderSessionID" | "text" | "createdAt"> & {
|
|
5
5
|
roomName: string;
|
|
6
6
|
roomKind?: "group" | "direct";
|
|
7
7
|
answerQuestionExcerpt?: string;
|
|
8
8
|
};
|
|
9
|
-
export type InboxResult = { member: boolean; items: InboxItem[]; queuedTs: Record<string, number>; hasMore: boolean };
|
|
9
|
+
export type InboxResult = { member: boolean; items: InboxItem[]; queuedTs: Record<string, number>; hasMore: boolean; recallVersion: number };
|
|
10
10
|
|
|
11
11
|
export async function readInbox(sessionID: string, roomFilter: string | null, excludeSelf: boolean, afterTs?: number): Promise<InboxResult> {
|
|
12
12
|
return readInboxMessages(sessionID, roomFilter, excludeSelf, excludeSelf ? 20 : 100, afterTs);
|