Fossil SCM

Added toggle for the recent activity timestamps.

stephan 2021-09-23 12:00 chat-user-filter
Commit 9938acb049e5ed879fcd6298b44ad76dcc2be9797e0b121a89e274ea793cfb93
2 files changed +23 -15 +4 -1
+23 -15
--- src/chat.js
+++ src/chat.js
@@ -406,11 +406,12 @@
406406
"images-inline": !!F.config.chat.imagesInline,
407407
"edit-multiline": false,
408408
"monospace-messages": false,
409409
"chat-only-mode": false,
410410
"audible-alert": true,
411
- "active-user-list": false
411
+ "active-user-list": false,
412
+ "active-user-list-timestamps": false
412413
}
413414
},
414415
/** Plays a new-message notification sound IF the audible-alert
415416
setting is true, else this is a no-op. Returns this.
416417
*/
@@ -1167,19 +1168,39 @@
11671168
? Chat.e.viewMessages : Chat.e.viewConfig);
11681169
return false;
11691170
};
11701171
D.attr(settingsButton, 'role', 'button').addEventListener('click', cbToggle, false);
11711172
Chat.e.viewConfig.querySelector('button').addEventListener('click', cbToggle, false);
1172
- /* Settings menu entries... */
1173
+ /* Settings menu entries... Remember that they will be rendered in reverse
1174
+ order and the most frequently-needed ones should be closer to the start
1175
+ of this list. */
11731176
const settingsOps = [{
11741177
label: "Multi-line input",
11751178
boolValue: ()=>Chat.inputElement()===Chat.e.inputMulti,
11761179
persistentSetting: 'edit-multiline',
11771180
callback: function(){
11781181
Chat.inputToggleSingleMulti();
11791182
}
11801183
},{
1184
+ label: "Left-align my posts",
1185
+ boolValue: ()=>!document.body.classList.contains('my-messages-right'),
1186
+ callback: function f(){
1187
+ document.body.classList.toggle('my-messages-right');
1188
+ }
1189
+ },{
1190
+ label: "Images inline",
1191
+ boolValue: ()=>Chat.settings.getBool('images-inline'),
1192
+ callback: function(){
1193
+ const v = Chat.settings.toggle('images-inline');
1194
+ F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+".");
1195
+ }
1196
+ },{
1197
+ label: "Show timestamps in recent user list",
1198
+ boolValue: ()=>!Chat.e.activeUserList.classList.contains('no-timestamps'),
1199
+ persistentSetting: 'active-user-list-timestamps',
1200
+ callback: ()=>D.toggleClass(Chat.e.activeUserList,'no-timestamps')
1201
+ },{
11811202
label: "Show recent user list",
11821203
boolValue: ()=>!Chat.e.activeUserListWrapper.classList.contains('hidden'),
11831204
persistentSetting: 'active-user-list',
11841205
callback: function(){
11851206
D.toggleClass(Chat.e.activeUserListWrapper,'hidden');
@@ -1197,23 +1218,10 @@
11971218
boolValue: ()=>document.body.classList.contains('monospace-messages'),
11981219
persistentSetting: 'monospace-messages',
11991220
callback: function(){
12001221
document.body.classList.toggle('monospace-messages');
12011222
}
1202
- },{
1203
- label: "Images inline",
1204
- boolValue: ()=>Chat.settings.getBool('images-inline'),
1205
- callback: function(){
1206
- const v = Chat.settings.toggle('images-inline');
1207
- F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+".");
1208
- }
1209
- },{
1210
- label: "Left-align my posts",
1211
- boolValue: ()=>!document.body.classList.contains('my-messages-right'),
1212
- callback: function f(){
1213
- document.body.classList.toggle('my-messages-right');
1214
- }
12151223
},{
12161224
label: "Chat-only mode",
12171225
boolValue: ()=>Chat.isChatOnlyMode(),
12181226
persistentSetting: 'chat-only-mode',
12191227
callback: function(){
12201228
--- src/chat.js
+++ src/chat.js
@@ -406,11 +406,12 @@
406 "images-inline": !!F.config.chat.imagesInline,
407 "edit-multiline": false,
408 "monospace-messages": false,
409 "chat-only-mode": false,
410 "audible-alert": true,
411 "active-user-list": false
 
412 }
413 },
414 /** Plays a new-message notification sound IF the audible-alert
415 setting is true, else this is a no-op. Returns this.
416 */
@@ -1167,19 +1168,39 @@
1167 ? Chat.e.viewMessages : Chat.e.viewConfig);
1168 return false;
1169 };
1170 D.attr(settingsButton, 'role', 'button').addEventListener('click', cbToggle, false);
1171 Chat.e.viewConfig.querySelector('button').addEventListener('click', cbToggle, false);
1172 /* Settings menu entries... */
 
 
1173 const settingsOps = [{
1174 label: "Multi-line input",
1175 boolValue: ()=>Chat.inputElement()===Chat.e.inputMulti,
1176 persistentSetting: 'edit-multiline',
1177 callback: function(){
1178 Chat.inputToggleSingleMulti();
1179 }
1180 },{
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1181 label: "Show recent user list",
1182 boolValue: ()=>!Chat.e.activeUserListWrapper.classList.contains('hidden'),
1183 persistentSetting: 'active-user-list',
1184 callback: function(){
1185 D.toggleClass(Chat.e.activeUserListWrapper,'hidden');
@@ -1197,23 +1218,10 @@
1197 boolValue: ()=>document.body.classList.contains('monospace-messages'),
1198 persistentSetting: 'monospace-messages',
1199 callback: function(){
1200 document.body.classList.toggle('monospace-messages');
1201 }
1202 },{
1203 label: "Images inline",
1204 boolValue: ()=>Chat.settings.getBool('images-inline'),
1205 callback: function(){
1206 const v = Chat.settings.toggle('images-inline');
1207 F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+".");
1208 }
1209 },{
1210 label: "Left-align my posts",
1211 boolValue: ()=>!document.body.classList.contains('my-messages-right'),
1212 callback: function f(){
1213 document.body.classList.toggle('my-messages-right');
1214 }
1215 },{
1216 label: "Chat-only mode",
1217 boolValue: ()=>Chat.isChatOnlyMode(),
1218 persistentSetting: 'chat-only-mode',
1219 callback: function(){
1220
--- src/chat.js
+++ src/chat.js
@@ -406,11 +406,12 @@
406 "images-inline": !!F.config.chat.imagesInline,
407 "edit-multiline": false,
408 "monospace-messages": false,
409 "chat-only-mode": false,
410 "audible-alert": true,
411 "active-user-list": false,
412 "active-user-list-timestamps": false
413 }
414 },
415 /** Plays a new-message notification sound IF the audible-alert
416 setting is true, else this is a no-op. Returns this.
417 */
@@ -1167,19 +1168,39 @@
1168 ? Chat.e.viewMessages : Chat.e.viewConfig);
1169 return false;
1170 };
1171 D.attr(settingsButton, 'role', 'button').addEventListener('click', cbToggle, false);
1172 Chat.e.viewConfig.querySelector('button').addEventListener('click', cbToggle, false);
1173 /* Settings menu entries... Remember that they will be rendered in reverse
1174 order and the most frequently-needed ones should be closer to the start
1175 of this list. */
1176 const settingsOps = [{
1177 label: "Multi-line input",
1178 boolValue: ()=>Chat.inputElement()===Chat.e.inputMulti,
1179 persistentSetting: 'edit-multiline',
1180 callback: function(){
1181 Chat.inputToggleSingleMulti();
1182 }
1183 },{
1184 label: "Left-align my posts",
1185 boolValue: ()=>!document.body.classList.contains('my-messages-right'),
1186 callback: function f(){
1187 document.body.classList.toggle('my-messages-right');
1188 }
1189 },{
1190 label: "Images inline",
1191 boolValue: ()=>Chat.settings.getBool('images-inline'),
1192 callback: function(){
1193 const v = Chat.settings.toggle('images-inline');
1194 F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+".");
1195 }
1196 },{
1197 label: "Show timestamps in recent user list",
1198 boolValue: ()=>!Chat.e.activeUserList.classList.contains('no-timestamps'),
1199 persistentSetting: 'active-user-list-timestamps',
1200 callback: ()=>D.toggleClass(Chat.e.activeUserList,'no-timestamps')
1201 },{
1202 label: "Show recent user list",
1203 boolValue: ()=>!Chat.e.activeUserListWrapper.classList.contains('hidden'),
1204 persistentSetting: 'active-user-list',
1205 callback: function(){
1206 D.toggleClass(Chat.e.activeUserListWrapper,'hidden');
@@ -1197,23 +1218,10 @@
1218 boolValue: ()=>document.body.classList.contains('monospace-messages'),
1219 persistentSetting: 'monospace-messages',
1220 callback: function(){
1221 document.body.classList.toggle('monospace-messages');
1222 }
 
 
 
 
 
 
 
 
 
 
 
 
 
1223 },{
1224 label: "Chat-only mode",
1225 boolValue: ()=>Chat.isChatOnlyMode(),
1226 persistentSetting: 'chat-only-mode',
1227 callback: function(){
1228
--- src/style.chat.css
+++ src/style.chat.css
@@ -378,13 +378,16 @@
378378
border-radius: 0.5em;
379379
cursor: pointer;
380380
text-align: center;
381381
white-space: pre;
382382
}
383
-body.chat #chat-user-list .chat-user > .timestamp {
383
+body.chat #chat-user-list .timestamp {
384384
font-size: 80%;
385385
font-family: monospace;
386
+}
387
+body.chat #chat-user-list.no-timestamps .timestamp {
388
+ display: none;
386389
}
387390
body.chat #chat-user-list .chat-user.selected {
388391
font-weight: bold;
389392
text-decoration: underline;
390393
}
391394
--- src/style.chat.css
+++ src/style.chat.css
@@ -378,13 +378,16 @@
378 border-radius: 0.5em;
379 cursor: pointer;
380 text-align: center;
381 white-space: pre;
382 }
383 body.chat #chat-user-list .chat-user > .timestamp {
384 font-size: 80%;
385 font-family: monospace;
 
 
 
386 }
387 body.chat #chat-user-list .chat-user.selected {
388 font-weight: bold;
389 text-decoration: underline;
390 }
391
--- src/style.chat.css
+++ src/style.chat.css
@@ -378,13 +378,16 @@
378 border-radius: 0.5em;
379 cursor: pointer;
380 text-align: center;
381 white-space: pre;
382 }
383 body.chat #chat-user-list .timestamp {
384 font-size: 80%;
385 font-family: monospace;
386 }
387 body.chat #chat-user-list.no-timestamps .timestamp {
388 display: none;
389 }
390 body.chat #chat-user-list .chat-user.selected {
391 font-weight: bold;
392 text-decoration: underline;
393 }
394

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button