Fossil SCM
Added file attachment widget toggle (on by default) and reversed order of config options (top-down instead of bottom-up) because that simply seems more intuitive.
Commit
40cdaeecd48dd7aaa5360a37a321e3a0454025f71f3440edaab91b229f6d708d
Parent
e7e2e5e3c063503…
2 files changed
+23
-14
+1
-1
+23
-14
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -381,11 +381,12 @@ | ||
| 381 | 381 | "edit-compact-mode": true, |
| 382 | 382 | "monospace-messages": true, |
| 383 | 383 | "chat-only-mode": false, |
| 384 | 384 | "audible-alert": true, |
| 385 | 385 | "active-user-list": false, |
| 386 | - "active-user-list-timestamps": false | |
| 386 | + "active-user-list-timestamps": false, | |
| 387 | + "hide-attachment-widget": false | |
| 387 | 388 | } |
| 388 | 389 | }, |
| 389 | 390 | /** Plays a new-message notification sound IF the audible-alert |
| 390 | 391 | setting is true, else this is a no-op. Returns this. |
| 391 | 392 | */ |
| @@ -1330,14 +1331,12 @@ | ||
| 1330 | 1331 | if(!Chat.e.activeUserListWrapper.classList.contains('collapsed')){ |
| 1331 | 1332 | Chat.animate(optAu.theList,'anim-flip-v'); |
| 1332 | 1333 | } |
| 1333 | 1334 | }, false); |
| 1334 | 1335 | }/*namedOptions.activeUsers additional setup*/ |
| 1335 | - /* Settings menu entries... Remember that they will be rendered in | |
| 1336 | - reverse order and the most frequently-needed ones "should" | |
| 1337 | - (arguably) be closer to the start of this list so that they | |
| 1338 | - will be rendered within easier reach of the settings button. */ | |
| 1336 | + /* Settings menu entries... the most frequently-needed ones "should" | |
| 1337 | + (arguably) be closer to the start of this list. */ | |
| 1339 | 1338 | /** |
| 1340 | 1339 | Settings ops structure: |
| 1341 | 1340 | |
| 1342 | 1341 | label: string for the UI |
| 1343 | 1342 | |
| @@ -1379,19 +1378,10 @@ | ||
| 1379 | 1378 | document.body.classList[ |
| 1380 | 1379 | this.checkbox.checked ? 'remove' : 'add' |
| 1381 | 1380 | ]('my-messages-right'); |
| 1382 | 1381 | } |
| 1383 | 1382 | },{ |
| 1384 | - label: "Show images inline", | |
| 1385 | - hint: "Whether to show images inline or as a hyperlink.", | |
| 1386 | - boolValue: 'images-inline' | |
| 1387 | - },{ | |
| 1388 | - label: "Timestamps in active users list", | |
| 1389 | - hint: "Whether to show last-message timestamps.", | |
| 1390 | - boolValue: 'active-user-list-timestamps' | |
| 1391 | - }, | |
| 1392 | - namedOptions.activeUsers,{ | |
| 1393 | 1383 | label: "Monospace message font", |
| 1394 | 1384 | hint: "Use monospace font for message text?", |
| 1395 | 1385 | boolValue: 'monospace-messages', |
| 1396 | 1386 | callback: function(setting){ |
| 1397 | 1387 | document.body.classList[ |
| @@ -1400,10 +1390,24 @@ | ||
| 1400 | 1390 | } |
| 1401 | 1391 | },{ |
| 1402 | 1392 | label: "Chat-only mode", |
| 1403 | 1393 | hint: "Toggle the page between normal fossil view and chat-only view.", |
| 1404 | 1394 | boolValue: 'chat-only-mode' |
| 1395 | + },{ | |
| 1396 | + label: "Show images inline", | |
| 1397 | + hint: "Whether to show images inline or as a hyperlink.", | |
| 1398 | + boolValue: 'images-inline' | |
| 1399 | + },{ | |
| 1400 | + label: "Timestamps in active users list", | |
| 1401 | + hint: "Whether to show last-message timestamps.", | |
| 1402 | + boolValue: 'active-user-list-timestamps' | |
| 1403 | + }, | |
| 1404 | + namedOptions.activeUsers,{ | |
| 1405 | + label: "Hide file attachment widget", | |
| 1406 | + boolValue: "hide-attachment-widget", | |
| 1407 | + hint: "Hides the file attachment widget, gaining more "+ | |
| 1408 | + "screen space for messages." | |
| 1405 | 1409 | }]; |
| 1406 | 1410 | |
| 1407 | 1411 | /** Set up selection list of notification sounds. */ |
| 1408 | 1412 | if(1){ |
| 1409 | 1413 | const selectSound = D.select(); |
| @@ -1526,10 +1530,15 @@ | ||
| 1526 | 1530 | Chat.settings.addListener('edit-compact-mode',function(s){ |
| 1527 | 1531 | Chat.e.inputLine.classList[ |
| 1528 | 1532 | s.value ? 'add' : 'remove' |
| 1529 | 1533 | ]('compact'); |
| 1530 | 1534 | }); |
| 1535 | + Chat.settings.addListener('hide-attachment-widget',function(s){ | |
| 1536 | + Chat.e.fileSelectWrapper.classList[ | |
| 1537 | + s.value ? 'add' : 'remove' | |
| 1538 | + ]('hidden'); | |
| 1539 | + }); | |
| 1531 | 1540 | Chat.settings.addListener('edit-ctrl-send',function(s){ |
| 1532 | 1541 | const label = (s.value ? "Ctrl-" : "")+"Enter submits messages."; |
| 1533 | 1542 | const eInput = Chat.inputElement(); |
| 1534 | 1543 | eInput.dataset.placeholder = eInput.dataset.placeholder0 + " " +label; |
| 1535 | 1544 | Chat.e.btnSubmit.title = label; |
| 1536 | 1545 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -381,11 +381,12 @@ | |
| 381 | "edit-compact-mode": true, |
| 382 | "monospace-messages": true, |
| 383 | "chat-only-mode": false, |
| 384 | "audible-alert": true, |
| 385 | "active-user-list": false, |
| 386 | "active-user-list-timestamps": false |
| 387 | } |
| 388 | }, |
| 389 | /** Plays a new-message notification sound IF the audible-alert |
| 390 | setting is true, else this is a no-op. Returns this. |
| 391 | */ |
| @@ -1330,14 +1331,12 @@ | |
| 1330 | if(!Chat.e.activeUserListWrapper.classList.contains('collapsed')){ |
| 1331 | Chat.animate(optAu.theList,'anim-flip-v'); |
| 1332 | } |
| 1333 | }, false); |
| 1334 | }/*namedOptions.activeUsers additional setup*/ |
| 1335 | /* Settings menu entries... Remember that they will be rendered in |
| 1336 | reverse order and the most frequently-needed ones "should" |
| 1337 | (arguably) be closer to the start of this list so that they |
| 1338 | will be rendered within easier reach of the settings button. */ |
| 1339 | /** |
| 1340 | Settings ops structure: |
| 1341 | |
| 1342 | label: string for the UI |
| 1343 | |
| @@ -1379,19 +1378,10 @@ | |
| 1379 | document.body.classList[ |
| 1380 | this.checkbox.checked ? 'remove' : 'add' |
| 1381 | ]('my-messages-right'); |
| 1382 | } |
| 1383 | },{ |
| 1384 | label: "Show images inline", |
| 1385 | hint: "Whether to show images inline or as a hyperlink.", |
| 1386 | boolValue: 'images-inline' |
| 1387 | },{ |
| 1388 | label: "Timestamps in active users list", |
| 1389 | hint: "Whether to show last-message timestamps.", |
| 1390 | boolValue: 'active-user-list-timestamps' |
| 1391 | }, |
| 1392 | namedOptions.activeUsers,{ |
| 1393 | label: "Monospace message font", |
| 1394 | hint: "Use monospace font for message text?", |
| 1395 | boolValue: 'monospace-messages', |
| 1396 | callback: function(setting){ |
| 1397 | document.body.classList[ |
| @@ -1400,10 +1390,24 @@ | |
| 1400 | } |
| 1401 | },{ |
| 1402 | label: "Chat-only mode", |
| 1403 | hint: "Toggle the page between normal fossil view and chat-only view.", |
| 1404 | boolValue: 'chat-only-mode' |
| 1405 | }]; |
| 1406 | |
| 1407 | /** Set up selection list of notification sounds. */ |
| 1408 | if(1){ |
| 1409 | const selectSound = D.select(); |
| @@ -1526,10 +1530,15 @@ | |
| 1526 | Chat.settings.addListener('edit-compact-mode',function(s){ |
| 1527 | Chat.e.inputLine.classList[ |
| 1528 | s.value ? 'add' : 'remove' |
| 1529 | ]('compact'); |
| 1530 | }); |
| 1531 | Chat.settings.addListener('edit-ctrl-send',function(s){ |
| 1532 | const label = (s.value ? "Ctrl-" : "")+"Enter submits messages."; |
| 1533 | const eInput = Chat.inputElement(); |
| 1534 | eInput.dataset.placeholder = eInput.dataset.placeholder0 + " " +label; |
| 1535 | Chat.e.btnSubmit.title = label; |
| 1536 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -381,11 +381,12 @@ | |
| 381 | "edit-compact-mode": true, |
| 382 | "monospace-messages": true, |
| 383 | "chat-only-mode": false, |
| 384 | "audible-alert": true, |
| 385 | "active-user-list": false, |
| 386 | "active-user-list-timestamps": false, |
| 387 | "hide-attachment-widget": false |
| 388 | } |
| 389 | }, |
| 390 | /** Plays a new-message notification sound IF the audible-alert |
| 391 | setting is true, else this is a no-op. Returns this. |
| 392 | */ |
| @@ -1330,14 +1331,12 @@ | |
| 1331 | if(!Chat.e.activeUserListWrapper.classList.contains('collapsed')){ |
| 1332 | Chat.animate(optAu.theList,'anim-flip-v'); |
| 1333 | } |
| 1334 | }, false); |
| 1335 | }/*namedOptions.activeUsers additional setup*/ |
| 1336 | /* Settings menu entries... the most frequently-needed ones "should" |
| 1337 | (arguably) be closer to the start of this list. */ |
| 1338 | /** |
| 1339 | Settings ops structure: |
| 1340 | |
| 1341 | label: string for the UI |
| 1342 | |
| @@ -1379,19 +1378,10 @@ | |
| 1378 | document.body.classList[ |
| 1379 | this.checkbox.checked ? 'remove' : 'add' |
| 1380 | ]('my-messages-right'); |
| 1381 | } |
| 1382 | },{ |
| 1383 | label: "Monospace message font", |
| 1384 | hint: "Use monospace font for message text?", |
| 1385 | boolValue: 'monospace-messages', |
| 1386 | callback: function(setting){ |
| 1387 | document.body.classList[ |
| @@ -1400,10 +1390,24 @@ | |
| 1390 | } |
| 1391 | },{ |
| 1392 | label: "Chat-only mode", |
| 1393 | hint: "Toggle the page between normal fossil view and chat-only view.", |
| 1394 | boolValue: 'chat-only-mode' |
| 1395 | },{ |
| 1396 | label: "Show images inline", |
| 1397 | hint: "Whether to show images inline or as a hyperlink.", |
| 1398 | boolValue: 'images-inline' |
| 1399 | },{ |
| 1400 | label: "Timestamps in active users list", |
| 1401 | hint: "Whether to show last-message timestamps.", |
| 1402 | boolValue: 'active-user-list-timestamps' |
| 1403 | }, |
| 1404 | namedOptions.activeUsers,{ |
| 1405 | label: "Hide file attachment widget", |
| 1406 | boolValue: "hide-attachment-widget", |
| 1407 | hint: "Hides the file attachment widget, gaining more "+ |
| 1408 | "screen space for messages." |
| 1409 | }]; |
| 1410 | |
| 1411 | /** Set up selection list of notification sounds. */ |
| 1412 | if(1){ |
| 1413 | const selectSound = D.select(); |
| @@ -1526,10 +1530,15 @@ | |
| 1530 | Chat.settings.addListener('edit-compact-mode',function(s){ |
| 1531 | Chat.e.inputLine.classList[ |
| 1532 | s.value ? 'add' : 'remove' |
| 1533 | ]('compact'); |
| 1534 | }); |
| 1535 | Chat.settings.addListener('hide-attachment-widget',function(s){ |
| 1536 | Chat.e.fileSelectWrapper.classList[ |
| 1537 | s.value ? 'add' : 'remove' |
| 1538 | ]('hidden'); |
| 1539 | }); |
| 1540 | Chat.settings.addListener('edit-ctrl-send',function(s){ |
| 1541 | const label = (s.value ? "Ctrl-" : "")+"Enter submits messages."; |
| 1542 | const eInput = Chat.inputElement(); |
| 1543 | eInput.dataset.placeholder = eInput.dataset.placeholder0 + " " +label; |
| 1544 | Chat.e.btnSubmit.title = label; |
| 1545 |
+1
-1
| --- src/style.chat.css | ||
| +++ src/style.chat.css | ||
| @@ -357,11 +357,11 @@ | ||
| 357 | 357 | } |
| 358 | 358 | body.chat #chat-config #chat-config-options { |
| 359 | 359 | /* /chat config options go here */ |
| 360 | 360 | flex: 1 1 auto; |
| 361 | 361 | display: flex; |
| 362 | - flex-direction: column-reverse; | |
| 362 | + flex-direction: column; | |
| 363 | 363 | overflow: auto; |
| 364 | 364 | } |
| 365 | 365 | body.chat #chat-config #chat-config-options .menu-entry { |
| 366 | 366 | display: flex; |
| 367 | 367 | align-items: baseline; |
| 368 | 368 |
| --- src/style.chat.css | |
| +++ src/style.chat.css | |
| @@ -357,11 +357,11 @@ | |
| 357 | } |
| 358 | body.chat #chat-config #chat-config-options { |
| 359 | /* /chat config options go here */ |
| 360 | flex: 1 1 auto; |
| 361 | display: flex; |
| 362 | flex-direction: column-reverse; |
| 363 | overflow: auto; |
| 364 | } |
| 365 | body.chat #chat-config #chat-config-options .menu-entry { |
| 366 | display: flex; |
| 367 | align-items: baseline; |
| 368 |
| --- src/style.chat.css | |
| +++ src/style.chat.css | |
| @@ -357,11 +357,11 @@ | |
| 357 | } |
| 358 | body.chat #chat-config #chat-config-options { |
| 359 | /* /chat config options go here */ |
| 360 | flex: 1 1 auto; |
| 361 | display: flex; |
| 362 | flex-direction: column; |
| 363 | overflow: auto; |
| 364 | } |
| 365 | body.chat #chat-config #chat-config-options .menu-entry { |
| 366 | display: flex; |
| 367 | align-items: baseline; |
| 368 |