Fossil SCM
Minor cosmetic tweaks to the poll-in-distress indicator. Make it yellow in dark-mode skins, as red blends in too well. No functional changes.
Commit
160d26923b0d6370feb5a991d8e79ca456a38860bd49d82086d6ffc20a857b8a
Parent
e3eb83997b9dfba…
2 files changed
+2
-5
+7
-2
+2
-5
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -159,11 +159,11 @@ | ||
| 159 | 159 | btnPreview: E1('#chat-button-preview'), |
| 160 | 160 | views: document.querySelectorAll('.chat-view'), |
| 161 | 161 | activeUserListWrapper: E1('#chat-user-list-wrapper'), |
| 162 | 162 | activeUserList: E1('#chat-user-list'), |
| 163 | 163 | eMsgPollError: undefined /* current connection error MessageMidget */, |
| 164 | - pollErrorMarker: undefined /* element to toggle 'connection-error' CSS class on */ | |
| 164 | + pollErrorMarker: document.body /* element to toggle 'connection-error' CSS class on */ | |
| 165 | 165 | }, |
| 166 | 166 | me: F.user.name, |
| 167 | 167 | mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50, |
| 168 | 168 | mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/, |
| 169 | 169 | pageIsActive: 'visible'===document.visibilityState, |
| @@ -206,12 +206,10 @@ | ||
| 206 | 206 | minDelay: 5000 /* minimum delay time */, |
| 207 | 207 | tidReconnect: undefined /*timer id for reconnection determination*/, |
| 208 | 208 | errCount: 0 /* Current poller connection error count */, |
| 209 | 209 | minErrForNotify: 4 /* Don't warn for connection errors until this |
| 210 | 210 | many have occurred */, |
| 211 | - skipErrDelay: 3500 /* time to wait/retry for the first minErrForNotify'th | |
| 212 | - connection errors. */, | |
| 213 | 211 | randomInterval: function(factor){ |
| 214 | 212 | return Math.floor(Math.random() * factor); |
| 215 | 213 | }, |
| 216 | 214 | incrDelay: function(){ |
| 217 | 215 | if( this.maxDelay > this.currentDelay ){ |
| @@ -676,11 +674,10 @@ | ||
| 676 | 674 | }else{ |
| 677 | 675 | /* Only the Chrome family supports contenteditable=plaintext-only */ |
| 678 | 676 | cs.$browserHasPlaintextOnly = false; |
| 679 | 677 | D.attr(cs.e.inputX,'contenteditable','true'); |
| 680 | 678 | } |
| 681 | - cs.e.pollErrorMarker = cs.e.viewMessages; | |
| 682 | 679 | cs.animate.$disabled = true; |
| 683 | 680 | F.fetch.beforesend = ()=>cs.ajaxStart(); |
| 684 | 681 | F.fetch.aftersend = ()=>cs.ajaxEnd(); |
| 685 | 682 | cs.pageTitleOrig = cs.e.pageTitle.innerText; |
| 686 | 683 | const qs = (e)=>document.querySelector(e); |
| @@ -2655,11 +2652,11 @@ | ||
| 2655 | 2652 | D.addClass(Chat.e.pollErrorMarker, 'connection-error'); |
| 2656 | 2653 | if( ++Chat.timer.errCount < Chat.timer.minErrForNotify ){ |
| 2657 | 2654 | if(Chat.beVerbose){ |
| 2658 | 2655 | console.warn("Ignoring polling error #", Chat.timer.errCount); |
| 2659 | 2656 | } |
| 2660 | - delay = Chat.timer.resetDelay(Chat.timer.skipErrDelay); | |
| 2657 | + delay = Chat.timer.resetDelay(Chat.timer.minDelay); | |
| 2661 | 2658 | } else { |
| 2662 | 2659 | delay = Chat.timer.incrDelay(); |
| 2663 | 2660 | //console.warn("afterPollFetch Chat.e.eMsgPollError",Chat.e.eMsgPollError); |
| 2664 | 2661 | const msg = "Poller connection error. Retrying in "+delay+ " ms."; |
| 2665 | 2662 | /* Replace the current/newest connection error widget. We could also |
| 2666 | 2663 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -159,11 +159,11 @@ | |
| 159 | btnPreview: E1('#chat-button-preview'), |
| 160 | views: document.querySelectorAll('.chat-view'), |
| 161 | activeUserListWrapper: E1('#chat-user-list-wrapper'), |
| 162 | activeUserList: E1('#chat-user-list'), |
| 163 | eMsgPollError: undefined /* current connection error MessageMidget */, |
| 164 | pollErrorMarker: undefined /* element to toggle 'connection-error' CSS class on */ |
| 165 | }, |
| 166 | me: F.user.name, |
| 167 | mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50, |
| 168 | mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/, |
| 169 | pageIsActive: 'visible'===document.visibilityState, |
| @@ -206,12 +206,10 @@ | |
| 206 | minDelay: 5000 /* minimum delay time */, |
| 207 | tidReconnect: undefined /*timer id for reconnection determination*/, |
| 208 | errCount: 0 /* Current poller connection error count */, |
| 209 | minErrForNotify: 4 /* Don't warn for connection errors until this |
| 210 | many have occurred */, |
| 211 | skipErrDelay: 3500 /* time to wait/retry for the first minErrForNotify'th |
| 212 | connection errors. */, |
| 213 | randomInterval: function(factor){ |
| 214 | return Math.floor(Math.random() * factor); |
| 215 | }, |
| 216 | incrDelay: function(){ |
| 217 | if( this.maxDelay > this.currentDelay ){ |
| @@ -676,11 +674,10 @@ | |
| 676 | }else{ |
| 677 | /* Only the Chrome family supports contenteditable=plaintext-only */ |
| 678 | cs.$browserHasPlaintextOnly = false; |
| 679 | D.attr(cs.e.inputX,'contenteditable','true'); |
| 680 | } |
| 681 | cs.e.pollErrorMarker = cs.e.viewMessages; |
| 682 | cs.animate.$disabled = true; |
| 683 | F.fetch.beforesend = ()=>cs.ajaxStart(); |
| 684 | F.fetch.aftersend = ()=>cs.ajaxEnd(); |
| 685 | cs.pageTitleOrig = cs.e.pageTitle.innerText; |
| 686 | const qs = (e)=>document.querySelector(e); |
| @@ -2655,11 +2652,11 @@ | |
| 2655 | D.addClass(Chat.e.pollErrorMarker, 'connection-error'); |
| 2656 | if( ++Chat.timer.errCount < Chat.timer.minErrForNotify ){ |
| 2657 | if(Chat.beVerbose){ |
| 2658 | console.warn("Ignoring polling error #", Chat.timer.errCount); |
| 2659 | } |
| 2660 | delay = Chat.timer.resetDelay(Chat.timer.skipErrDelay); |
| 2661 | } else { |
| 2662 | delay = Chat.timer.incrDelay(); |
| 2663 | //console.warn("afterPollFetch Chat.e.eMsgPollError",Chat.e.eMsgPollError); |
| 2664 | const msg = "Poller connection error. Retrying in "+delay+ " ms."; |
| 2665 | /* Replace the current/newest connection error widget. We could also |
| 2666 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -159,11 +159,11 @@ | |
| 159 | btnPreview: E1('#chat-button-preview'), |
| 160 | views: document.querySelectorAll('.chat-view'), |
| 161 | activeUserListWrapper: E1('#chat-user-list-wrapper'), |
| 162 | activeUserList: E1('#chat-user-list'), |
| 163 | eMsgPollError: undefined /* current connection error MessageMidget */, |
| 164 | pollErrorMarker: document.body /* element to toggle 'connection-error' CSS class on */ |
| 165 | }, |
| 166 | me: F.user.name, |
| 167 | mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50, |
| 168 | mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/, |
| 169 | pageIsActive: 'visible'===document.visibilityState, |
| @@ -206,12 +206,10 @@ | |
| 206 | minDelay: 5000 /* minimum delay time */, |
| 207 | tidReconnect: undefined /*timer id for reconnection determination*/, |
| 208 | errCount: 0 /* Current poller connection error count */, |
| 209 | minErrForNotify: 4 /* Don't warn for connection errors until this |
| 210 | many have occurred */, |
| 211 | randomInterval: function(factor){ |
| 212 | return Math.floor(Math.random() * factor); |
| 213 | }, |
| 214 | incrDelay: function(){ |
| 215 | if( this.maxDelay > this.currentDelay ){ |
| @@ -676,11 +674,10 @@ | |
| 674 | }else{ |
| 675 | /* Only the Chrome family supports contenteditable=plaintext-only */ |
| 676 | cs.$browserHasPlaintextOnly = false; |
| 677 | D.attr(cs.e.inputX,'contenteditable','true'); |
| 678 | } |
| 679 | cs.animate.$disabled = true; |
| 680 | F.fetch.beforesend = ()=>cs.ajaxStart(); |
| 681 | F.fetch.aftersend = ()=>cs.ajaxEnd(); |
| 682 | cs.pageTitleOrig = cs.e.pageTitle.innerText; |
| 683 | const qs = (e)=>document.querySelector(e); |
| @@ -2655,11 +2652,11 @@ | |
| 2652 | D.addClass(Chat.e.pollErrorMarker, 'connection-error'); |
| 2653 | if( ++Chat.timer.errCount < Chat.timer.minErrForNotify ){ |
| 2654 | if(Chat.beVerbose){ |
| 2655 | console.warn("Ignoring polling error #", Chat.timer.errCount); |
| 2656 | } |
| 2657 | delay = Chat.timer.resetDelay(Chat.timer.minDelay); |
| 2658 | } else { |
| 2659 | delay = Chat.timer.incrDelay(); |
| 2660 | //console.warn("afterPollFetch Chat.e.eMsgPollError",Chat.e.eMsgPollError); |
| 2661 | const msg = "Poller connection error. Retrying in "+delay+ " ms."; |
| 2662 | /* Replace the current/newest connection error widget. We could also |
| 2663 |
+7
-2
| --- src/style.chat.css | ||
| +++ src/style.chat.css | ||
| @@ -213,12 +213,17 @@ | ||
| 213 | 213 | } |
| 214 | 214 | body.chat #chat-messages-wrapper.loading > * { |
| 215 | 215 | /* An attempt at reducing flicker when loading lots of messages. */ |
| 216 | 216 | visibility: hidden; |
| 217 | 217 | } |
| 218 | -body.chat #chat-messages-wrapper.connection-error { | |
| 219 | - border-bottom: thin dotted red; | |
| 218 | + | |
| 219 | +/* Provide a visual cue when polling is offline. */ | |
| 220 | +body.chat.connection-error #chat-input-line-wrapper { | |
| 221 | + border-top: medium dotted red; | |
| 222 | +} | |
| 223 | +body.chat.fossil-dark-style.connection-error #chat-input-line-wrapper { | |
| 224 | + border-color: yellow; | |
| 220 | 225 | } |
| 221 | 226 | |
| 222 | 227 | body.chat div.content { |
| 223 | 228 | margin: 0; |
| 224 | 229 | padding: 0; |
| 225 | 230 |
| --- src/style.chat.css | |
| +++ src/style.chat.css | |
| @@ -213,12 +213,17 @@ | |
| 213 | } |
| 214 | body.chat #chat-messages-wrapper.loading > * { |
| 215 | /* An attempt at reducing flicker when loading lots of messages. */ |
| 216 | visibility: hidden; |
| 217 | } |
| 218 | body.chat #chat-messages-wrapper.connection-error { |
| 219 | border-bottom: thin dotted red; |
| 220 | } |
| 221 | |
| 222 | body.chat div.content { |
| 223 | margin: 0; |
| 224 | padding: 0; |
| 225 |
| --- src/style.chat.css | |
| +++ src/style.chat.css | |
| @@ -213,12 +213,17 @@ | |
| 213 | } |
| 214 | body.chat #chat-messages-wrapper.loading > * { |
| 215 | /* An attempt at reducing flicker when loading lots of messages. */ |
| 216 | visibility: hidden; |
| 217 | } |
| 218 | |
| 219 | /* Provide a visual cue when polling is offline. */ |
| 220 | body.chat.connection-error #chat-input-line-wrapper { |
| 221 | border-top: medium dotted red; |
| 222 | } |
| 223 | body.chat.fossil-dark-style.connection-error #chat-input-line-wrapper { |
| 224 | border-color: yellow; |
| 225 | } |
| 226 | |
| 227 | body.chat div.content { |
| 228 | margin: 0; |
| 229 | padding: 0; |
| 230 |