Fossil SCM
Added toggle for the recent activity timestamps.
Commit
9938acb049e5ed879fcd6298b44ad76dcc2be9797e0b121a89e274ea793cfb93
Parent
7aea432a4786882…
2 files changed
+23
-15
+4
-1
+23
-15
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -406,11 +406,12 @@ | ||
| 406 | 406 | "images-inline": !!F.config.chat.imagesInline, |
| 407 | 407 | "edit-multiline": false, |
| 408 | 408 | "monospace-messages": false, |
| 409 | 409 | "chat-only-mode": false, |
| 410 | 410 | "audible-alert": true, |
| 411 | - "active-user-list": false | |
| 411 | + "active-user-list": false, | |
| 412 | + "active-user-list-timestamps": false | |
| 412 | 413 | } |
| 413 | 414 | }, |
| 414 | 415 | /** Plays a new-message notification sound IF the audible-alert |
| 415 | 416 | setting is true, else this is a no-op. Returns this. |
| 416 | 417 | */ |
| @@ -1167,19 +1168,39 @@ | ||
| 1167 | 1168 | ? Chat.e.viewMessages : Chat.e.viewConfig); |
| 1168 | 1169 | return false; |
| 1169 | 1170 | }; |
| 1170 | 1171 | D.attr(settingsButton, 'role', 'button').addEventListener('click', cbToggle, false); |
| 1171 | 1172 | 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. */ | |
| 1173 | 1176 | const settingsOps = [{ |
| 1174 | 1177 | label: "Multi-line input", |
| 1175 | 1178 | boolValue: ()=>Chat.inputElement()===Chat.e.inputMulti, |
| 1176 | 1179 | persistentSetting: 'edit-multiline', |
| 1177 | 1180 | callback: function(){ |
| 1178 | 1181 | Chat.inputToggleSingleMulti(); |
| 1179 | 1182 | } |
| 1180 | 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 | + },{ | |
| 1181 | 1202 | label: "Show recent user list", |
| 1182 | 1203 | boolValue: ()=>!Chat.e.activeUserListWrapper.classList.contains('hidden'), |
| 1183 | 1204 | persistentSetting: 'active-user-list', |
| 1184 | 1205 | callback: function(){ |
| 1185 | 1206 | D.toggleClass(Chat.e.activeUserListWrapper,'hidden'); |
| @@ -1197,23 +1218,10 @@ | ||
| 1197 | 1218 | boolValue: ()=>document.body.classList.contains('monospace-messages'), |
| 1198 | 1219 | persistentSetting: 'monospace-messages', |
| 1199 | 1220 | callback: function(){ |
| 1200 | 1221 | document.body.classList.toggle('monospace-messages'); |
| 1201 | 1222 | } |
| 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 | 1223 | },{ |
| 1216 | 1224 | label: "Chat-only mode", |
| 1217 | 1225 | boolValue: ()=>Chat.isChatOnlyMode(), |
| 1218 | 1226 | persistentSetting: 'chat-only-mode', |
| 1219 | 1227 | callback: function(){ |
| 1220 | 1228 |
| --- 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 |
+4
-1
| --- src/style.chat.css | ||
| +++ src/style.chat.css | ||
| @@ -378,13 +378,16 @@ | ||
| 378 | 378 | border-radius: 0.5em; |
| 379 | 379 | cursor: pointer; |
| 380 | 380 | text-align: center; |
| 381 | 381 | white-space: pre; |
| 382 | 382 | } |
| 383 | -body.chat #chat-user-list .chat-user > .timestamp { | |
| 383 | +body.chat #chat-user-list .timestamp { | |
| 384 | 384 | font-size: 80%; |
| 385 | 385 | font-family: monospace; |
| 386 | +} | |
| 387 | +body.chat #chat-user-list.no-timestamps .timestamp { | |
| 388 | + display: none; | |
| 386 | 389 | } |
| 387 | 390 | body.chat #chat-user-list .chat-user.selected { |
| 388 | 391 | font-weight: bold; |
| 389 | 392 | text-decoration: underline; |
| 390 | 393 | } |
| 391 | 394 |
| --- 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 |