Fossil SCM
CSS tweaks to attempt to counter some Safari message spacing problems - cannot test locally. Also limit the chat image preview to 40% of the viewport width/height, to avoid it taking up the whole screen for a large image.
Commit
670732a68ffb57eb650a474de0aa81d7e1ae55e248804e58d7af028a4ec97fb1
Parent
a6650eb776e82b6…
2 files changed
+4
-2
+9
-2
+4
-2
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -656,20 +656,21 @@ | ||
| 656 | 656 | label: "Left-align my posts", |
| 657 | 657 | boolValue: ()=>!document.body.classList.contains('my-messages-right'), |
| 658 | 658 | callback: function f(){ |
| 659 | 659 | document.body.classList.toggle('my-messages-right'); |
| 660 | 660 | } |
| 661 | - }/**,{ | |
| 661 | + },{ | |
| 662 | 662 | label: "Bottom-up chat", |
| 663 | + disable: true, | |
| 663 | 664 | boolValue: ()=>document.body.classList.contains('chat-bottom-up'), |
| 664 | 665 | callback: function(){ |
| 665 | 666 | document.body.classList.toggle('chat-bottom-up'); |
| 666 | 667 | Chat.settings.set('bottom-up', |
| 667 | 668 | document.body.classList.contains('chat-bottom-up')); |
| 668 | 669 | setTimeout(()=>Chat.e.inputWrapper.scrollIntoView(), 0); |
| 669 | 670 | } |
| 670 | - }*/,{ | |
| 671 | + },{ | |
| 671 | 672 | label: "Images inline", |
| 672 | 673 | boolValue: ()=>Chat.settings.getBool('images-inline'), |
| 673 | 674 | callback: function(){ |
| 674 | 675 | const v = Chat.settings.getBool('images-inline',true); |
| 675 | 676 | Chat.settings.set('images-inline', !v); |
| @@ -682,10 +683,11 @@ | ||
| 682 | 683 | show their current values. |
| 683 | 684 | */ |
| 684 | 685 | settingsPopup.options.refresh = function(){ |
| 685 | 686 | D.clearElement(this.e); |
| 686 | 687 | settingsOps.forEach(function(op){ |
| 688 | + if(op.disable) return; | |
| 687 | 689 | const line = D.addClass(D.span(), 'menu-entry'); |
| 688 | 690 | const btn = D.append(D.addClass(D.span(), 'button'), op.label); |
| 689 | 691 | D.attr(btn, 'role', 'button'); |
| 690 | 692 | const callback = function(ev){ |
| 691 | 693 | settingsPopup.hide(); |
| 692 | 694 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -656,20 +656,21 @@ | |
| 656 | label: "Left-align my posts", |
| 657 | boolValue: ()=>!document.body.classList.contains('my-messages-right'), |
| 658 | callback: function f(){ |
| 659 | document.body.classList.toggle('my-messages-right'); |
| 660 | } |
| 661 | }/**,{ |
| 662 | label: "Bottom-up chat", |
| 663 | boolValue: ()=>document.body.classList.contains('chat-bottom-up'), |
| 664 | callback: function(){ |
| 665 | document.body.classList.toggle('chat-bottom-up'); |
| 666 | Chat.settings.set('bottom-up', |
| 667 | document.body.classList.contains('chat-bottom-up')); |
| 668 | setTimeout(()=>Chat.e.inputWrapper.scrollIntoView(), 0); |
| 669 | } |
| 670 | }*/,{ |
| 671 | label: "Images inline", |
| 672 | boolValue: ()=>Chat.settings.getBool('images-inline'), |
| 673 | callback: function(){ |
| 674 | const v = Chat.settings.getBool('images-inline',true); |
| 675 | Chat.settings.set('images-inline', !v); |
| @@ -682,10 +683,11 @@ | |
| 682 | show their current values. |
| 683 | */ |
| 684 | settingsPopup.options.refresh = function(){ |
| 685 | D.clearElement(this.e); |
| 686 | settingsOps.forEach(function(op){ |
| 687 | const line = D.addClass(D.span(), 'menu-entry'); |
| 688 | const btn = D.append(D.addClass(D.span(), 'button'), op.label); |
| 689 | D.attr(btn, 'role', 'button'); |
| 690 | const callback = function(ev){ |
| 691 | settingsPopup.hide(); |
| 692 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -656,20 +656,21 @@ | |
| 656 | label: "Left-align my posts", |
| 657 | boolValue: ()=>!document.body.classList.contains('my-messages-right'), |
| 658 | callback: function f(){ |
| 659 | document.body.classList.toggle('my-messages-right'); |
| 660 | } |
| 661 | },{ |
| 662 | label: "Bottom-up chat", |
| 663 | disable: true, |
| 664 | boolValue: ()=>document.body.classList.contains('chat-bottom-up'), |
| 665 | callback: function(){ |
| 666 | document.body.classList.toggle('chat-bottom-up'); |
| 667 | Chat.settings.set('bottom-up', |
| 668 | document.body.classList.contains('chat-bottom-up')); |
| 669 | setTimeout(()=>Chat.e.inputWrapper.scrollIntoView(), 0); |
| 670 | } |
| 671 | },{ |
| 672 | label: "Images inline", |
| 673 | boolValue: ()=>Chat.settings.getBool('images-inline'), |
| 674 | callback: function(){ |
| 675 | const v = Chat.settings.getBool('images-inline',true); |
| 676 | Chat.settings.set('images-inline', !v); |
| @@ -682,10 +683,11 @@ | |
| 683 | show their current values. |
| 684 | */ |
| 685 | settingsPopup.options.refresh = function(){ |
| 686 | D.clearElement(this.e); |
| 687 | settingsOps.forEach(function(op){ |
| 688 | if(op.disable) return; |
| 689 | const line = D.addClass(D.span(), 'menu-entry'); |
| 690 | const btn = D.append(D.addClass(D.span(), 'button'), op.label); |
| 691 | D.attr(btn, 'role', 'button'); |
| 692 | const callback = function(ev){ |
| 693 | settingsPopup.hide(); |
| 694 |
+9
-2
| --- src/default.css | ||
| +++ src/default.css | ||
| @@ -1497,20 +1497,21 @@ | ||
| 1497 | 1497 | padding: 0.25em 0.5em; |
| 1498 | 1498 | margin-top: 0; |
| 1499 | 1499 | min-width: 9em /*avoid unsightly "underlap" with the neighboring |
| 1500 | 1500 | .message-widget-tab element*/; |
| 1501 | 1501 | white-space: pre-wrap/*needed for multi-line edits*/; |
| 1502 | + flex: 1 1 auto; | |
| 1502 | 1503 | } |
| 1503 | 1504 | body.chat.monospace-messages .message-widget-content, |
| 1504 | 1505 | body.chat.monospace-messages textarea, |
| 1505 | 1506 | body.chat.monospace-messages input[type=text]{ |
| 1506 | 1507 | font-family: monospace; |
| 1507 | 1508 | } |
| 1508 | 1509 | /* User name and timestamp (a LEGEND-like element) */ |
| 1509 | 1510 | body.chat .message-widget .message-widget-tab { |
| 1510 | 1511 | border-radius: 0.25em 0.25em 0 0; |
| 1511 | - margin: 0 0.25em 0em 0.15em; | |
| 1512 | + margin: 0.25em 0.25em 0em 0.15em; | |
| 1512 | 1513 | padding: 0 0.5em 0.15em 0.5em; |
| 1513 | 1514 | cursor: pointer; |
| 1514 | 1515 | white-space: nowrap; |
| 1515 | 1516 | } |
| 1516 | 1517 | body.chat .fossil-tooltip.help-buttonlet-content { |
| @@ -1641,10 +1642,11 @@ | ||
| 1641 | 1642 | display: flex; |
| 1642 | 1643 | flex-direction: column; |
| 1643 | 1644 | overflow: auto; |
| 1644 | 1645 | width: 100%; |
| 1645 | 1646 | flex: 1 1 auto; |
| 1647 | + justify-content: flex-start; | |
| 1646 | 1648 | } |
| 1647 | 1649 | body.chat.chat-bottom-up #chat-messages-wrapper { |
| 1648 | 1650 | flex-direction: column-reverse; |
| 1649 | 1651 | z-index: 99 /* so that it scrolls under input area. If it's |
| 1650 | 1652 | lower than div.content then mouse events to it |
| @@ -1653,11 +1655,10 @@ | ||
| 1653 | 1655 | body.chat.chat-only-mode #chat-message-wrapper { |
| 1654 | 1656 | } |
| 1655 | 1657 | |
| 1656 | 1658 | body.chat div.content { |
| 1657 | 1659 | padding: 0; |
| 1658 | - position: relative; | |
| 1659 | 1660 | display: flex; |
| 1660 | 1661 | flex-direction: column; |
| 1661 | 1662 | align-items: stretch; |
| 1662 | 1663 | max-height: 85vh /* rough approximate */; |
| 1663 | 1664 | } |
| @@ -1741,6 +1742,12 @@ | ||
| 1741 | 1742 | flex: 0 1 auto; |
| 1742 | 1743 | padding: 0.5em 1em; |
| 1743 | 1744 | margin-left: 0.5em; |
| 1744 | 1745 | white-space: pre; |
| 1745 | 1746 | font-family: monospace; |
| 1747 | +} | |
| 1748 | +body.chat #chat-drop-details img { | |
| 1749 | + /* If we don't artificially limit the img preview size, they can be | |
| 1750 | + so big that the user cannot navigate to the buttons. */ | |
| 1751 | + max-height: 40vh; | |
| 1752 | + max-width: 40vw; | |
| 1746 | 1753 | } |
| 1747 | 1754 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -1497,20 +1497,21 @@ | |
| 1497 | padding: 0.25em 0.5em; |
| 1498 | margin-top: 0; |
| 1499 | min-width: 9em /*avoid unsightly "underlap" with the neighboring |
| 1500 | .message-widget-tab element*/; |
| 1501 | white-space: pre-wrap/*needed for multi-line edits*/; |
| 1502 | } |
| 1503 | body.chat.monospace-messages .message-widget-content, |
| 1504 | body.chat.monospace-messages textarea, |
| 1505 | body.chat.monospace-messages input[type=text]{ |
| 1506 | font-family: monospace; |
| 1507 | } |
| 1508 | /* User name and timestamp (a LEGEND-like element) */ |
| 1509 | body.chat .message-widget .message-widget-tab { |
| 1510 | border-radius: 0.25em 0.25em 0 0; |
| 1511 | margin: 0 0.25em 0em 0.15em; |
| 1512 | padding: 0 0.5em 0.15em 0.5em; |
| 1513 | cursor: pointer; |
| 1514 | white-space: nowrap; |
| 1515 | } |
| 1516 | body.chat .fossil-tooltip.help-buttonlet-content { |
| @@ -1641,10 +1642,11 @@ | |
| 1641 | display: flex; |
| 1642 | flex-direction: column; |
| 1643 | overflow: auto; |
| 1644 | width: 100%; |
| 1645 | flex: 1 1 auto; |
| 1646 | } |
| 1647 | body.chat.chat-bottom-up #chat-messages-wrapper { |
| 1648 | flex-direction: column-reverse; |
| 1649 | z-index: 99 /* so that it scrolls under input area. If it's |
| 1650 | lower than div.content then mouse events to it |
| @@ -1653,11 +1655,10 @@ | |
| 1653 | body.chat.chat-only-mode #chat-message-wrapper { |
| 1654 | } |
| 1655 | |
| 1656 | body.chat div.content { |
| 1657 | padding: 0; |
| 1658 | position: relative; |
| 1659 | display: flex; |
| 1660 | flex-direction: column; |
| 1661 | align-items: stretch; |
| 1662 | max-height: 85vh /* rough approximate */; |
| 1663 | } |
| @@ -1741,6 +1742,12 @@ | |
| 1741 | flex: 0 1 auto; |
| 1742 | padding: 0.5em 1em; |
| 1743 | margin-left: 0.5em; |
| 1744 | white-space: pre; |
| 1745 | font-family: monospace; |
| 1746 | } |
| 1747 |
| --- src/default.css | |
| +++ src/default.css | |
| @@ -1497,20 +1497,21 @@ | |
| 1497 | padding: 0.25em 0.5em; |
| 1498 | margin-top: 0; |
| 1499 | min-width: 9em /*avoid unsightly "underlap" with the neighboring |
| 1500 | .message-widget-tab element*/; |
| 1501 | white-space: pre-wrap/*needed for multi-line edits*/; |
| 1502 | flex: 1 1 auto; |
| 1503 | } |
| 1504 | body.chat.monospace-messages .message-widget-content, |
| 1505 | body.chat.monospace-messages textarea, |
| 1506 | body.chat.monospace-messages input[type=text]{ |
| 1507 | font-family: monospace; |
| 1508 | } |
| 1509 | /* User name and timestamp (a LEGEND-like element) */ |
| 1510 | body.chat .message-widget .message-widget-tab { |
| 1511 | border-radius: 0.25em 0.25em 0 0; |
| 1512 | margin: 0.25em 0.25em 0em 0.15em; |
| 1513 | padding: 0 0.5em 0.15em 0.5em; |
| 1514 | cursor: pointer; |
| 1515 | white-space: nowrap; |
| 1516 | } |
| 1517 | body.chat .fossil-tooltip.help-buttonlet-content { |
| @@ -1641,10 +1642,11 @@ | |
| 1642 | display: flex; |
| 1643 | flex-direction: column; |
| 1644 | overflow: auto; |
| 1645 | width: 100%; |
| 1646 | flex: 1 1 auto; |
| 1647 | justify-content: flex-start; |
| 1648 | } |
| 1649 | body.chat.chat-bottom-up #chat-messages-wrapper { |
| 1650 | flex-direction: column-reverse; |
| 1651 | z-index: 99 /* so that it scrolls under input area. If it's |
| 1652 | lower than div.content then mouse events to it |
| @@ -1653,11 +1655,10 @@ | |
| 1655 | body.chat.chat-only-mode #chat-message-wrapper { |
| 1656 | } |
| 1657 | |
| 1658 | body.chat div.content { |
| 1659 | padding: 0; |
| 1660 | display: flex; |
| 1661 | flex-direction: column; |
| 1662 | align-items: stretch; |
| 1663 | max-height: 85vh /* rough approximate */; |
| 1664 | } |
| @@ -1741,6 +1742,12 @@ | |
| 1742 | flex: 0 1 auto; |
| 1743 | padding: 0.5em 1em; |
| 1744 | margin-left: 0.5em; |
| 1745 | white-space: pre; |
| 1746 | font-family: monospace; |
| 1747 | } |
| 1748 | body.chat #chat-drop-details img { |
| 1749 | /* If we don't artificially limit the img preview size, they can be |
| 1750 | so big that the user cannot navigate to the buttons. */ |
| 1751 | max-height: 40vh; |
| 1752 | max-width: 40vw; |
| 1753 | } |
| 1754 |