Fossil SCM
/chat: removed the unused/unnecessary jump-to-top/bottom buttons.
Commit
a044fea7850b8372c40dda7884025c83034be33ea6989792c8383aa7ce35387a
Parent
fb39f02b774f455…
2 files changed
-2
+1
-28
-2
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -163,12 +163,10 @@ | ||
| 163 | 163 | @ placeholder="Type message here." autocomplete="off"> |
| 164 | 164 | @ <textarea rows="8" id="chat-input-multi" \ |
| 165 | 165 | @ placeholder="Type message here. Ctrl-Enter sends it." \ |
| 166 | 166 | @ class="hidden"></textarea> |
| 167 | 167 | @ <input type="submit" value="Send" id="chat-message-submit"> |
| 168 | - @ <button id="chat-scroll-top" class="hidden">↑</button> | |
| 169 | - @ <button id="chat-scroll-bottom" class="hidden">↓</button> | |
| 170 | 168 | @ <span id="chat-settings-button" class="settings-icon" \ |
| 171 | 169 | @ aria-label="Settings..." aria-haspopup="true" ></span> |
| 172 | 170 | @ </div> |
| 173 | 171 | @ <div id='chat-input-file-area'> |
| 174 | 172 | @ <div class='file-selection-wrapper'> |
| 175 | 173 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -163,12 +163,10 @@ | |
| 163 | @ placeholder="Type message here." autocomplete="off"> |
| 164 | @ <textarea rows="8" id="chat-input-multi" \ |
| 165 | @ placeholder="Type message here. Ctrl-Enter sends it." \ |
| 166 | @ class="hidden"></textarea> |
| 167 | @ <input type="submit" value="Send" id="chat-message-submit"> |
| 168 | @ <button id="chat-scroll-top" class="hidden">↑</button> |
| 169 | @ <button id="chat-scroll-bottom" class="hidden">↓</button> |
| 170 | @ <span id="chat-settings-button" class="settings-icon" \ |
| 171 | @ aria-label="Settings..." aria-haspopup="true" ></span> |
| 172 | @ </div> |
| 173 | @ <div id='chat-input-file-area'> |
| 174 | @ <div class='file-selection-wrapper'> |
| 175 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -163,12 +163,10 @@ | |
| 163 | @ placeholder="Type message here." autocomplete="off"> |
| 164 | @ <textarea rows="8" id="chat-input-multi" \ |
| 165 | @ placeholder="Type message here. Ctrl-Enter sends it." \ |
| 166 | @ class="hidden"></textarea> |
| 167 | @ <input type="submit" value="Send" id="chat-message-submit"> |
| 168 | @ <span id="chat-settings-button" class="settings-icon" \ |
| 169 | @ aria-label="Settings..." aria-haspopup="true" ></span> |
| 170 | @ </div> |
| 171 | @ <div id='chat-input-file-area'> |
| 172 | @ <div class='file-selection-wrapper'> |
| 173 |
+1
-28
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -107,13 +107,11 @@ | ||
| 107 | 107 | btnSubmit: E1('#chat-message-submit'), |
| 108 | 108 | inputSingle: E1('#chat-input-single'), |
| 109 | 109 | inputMulti: E1('#chat-input-multi'), |
| 110 | 110 | inputCurrent: undefined/*one of inputSingle or inputMulti*/, |
| 111 | 111 | inputFile: E1('#chat-input-file'), |
| 112 | - contentDiv: E1('div.content'), | |
| 113 | - btnMsgHome: E1('#chat-scroll-top'), | |
| 114 | - btnMsgEnd: E1('#chat-scroll-bottom') | |
| 112 | + contentDiv: E1('div.content') | |
| 115 | 113 | }, |
| 116 | 114 | me: F.user.name, |
| 117 | 115 | mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50, |
| 118 | 116 | mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/, |
| 119 | 117 | pageIsActive: 'visible'===document.visibilityState, |
| @@ -339,18 +337,10 @@ | ||
| 339 | 337 | } |
| 340 | 338 | }, |
| 341 | 339 | toggleChatOnlyMode: function(){ |
| 342 | 340 | return this.chatOnlyMode(!this.isChatOnlyMode()); |
| 343 | 341 | }, |
| 344 | - /* Turn the message area top/bottom buttons on (yes===true), off | |
| 345 | - (yes==false), or toggle them (no arguments). Returns this. */ | |
| 346 | - toggleNavButtons: function(yes){ | |
| 347 | - const e = [this.e.btnMsgHome, this.e.btnMsgEnd], c = 'hidden'; | |
| 348 | - if(0===arguments.length) D.toggleClass(e, c); | |
| 349 | - else if(!arguments[0]) D.addClass(e, c); | |
| 350 | - else D.removeClass(e, c); | |
| 351 | - }, | |
| 352 | 342 | messageIsInView: function(e){ |
| 353 | 343 | return e ? overlapsElemView(e, this.e.messagesWrapper) : false; |
| 354 | 344 | }, |
| 355 | 345 | settings:{ |
| 356 | 346 | get: (k,dflt)=>F.storage.get(k,dflt), |
| @@ -965,14 +955,10 @@ | ||
| 965 | 955 | boolValue: ()=>Chat.settings.getBool('images-inline'), |
| 966 | 956 | callback: function(){ |
| 967 | 957 | const v = Chat.settings.toggle('images-inline'); |
| 968 | 958 | F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+"."); |
| 969 | 959 | } |
| 970 | - },{ | |
| 971 | - label: "Message home/end buttons", | |
| 972 | - boolValue: ()=>!Chat.e.btnMsgHome.classList.contains('hidden'), | |
| 973 | - callback: ()=>Chat.toggleNavButtons() | |
| 974 | 960 | }]; |
| 975 | 961 | |
| 976 | 962 | /** Set up selection list of notification sounds. */ |
| 977 | 963 | if(true/*flip this to false to enable selection of audio files*/){ |
| 978 | 964 | settingsOps.push({ |
| @@ -1083,23 +1069,10 @@ | ||
| 1083 | 1069 | settingsPopup.options.adjustY = function(y){ |
| 1084 | 1070 | const rect = settingsButton.getBoundingClientRect(); |
| 1085 | 1071 | return rect.top - popupSize.height -2; |
| 1086 | 1072 | }; |
| 1087 | 1073 | })()/*#chat-settings-button setup*/; |
| 1088 | - | |
| 1089 | - (function(){ /* buttons to scroll to the begin/end of the messages. */ | |
| 1090 | - Chat.e.btnMsgEnd.addEventListener('click',function(ev){ | |
| 1091 | - ev.preventDefault(); | |
| 1092 | - Chat.scrollMessagesTo(1); | |
| 1093 | - return false; | |
| 1094 | - }); | |
| 1095 | - Chat.e.btnMsgHome.addEventListener('click',function(ev){ | |
| 1096 | - ev.preventDefault(); | |
| 1097 | - Chat.scrollMessagesTo(-1); | |
| 1098 | - return false; | |
| 1099 | - }); | |
| 1100 | - })(); | |
| 1101 | 1074 | |
| 1102 | 1075 | /** Callback for poll() to inject new content into the page. jx == |
| 1103 | 1076 | the response from /chat-poll. If atEnd is true, the message is |
| 1104 | 1077 | appended to the end of the chat list (for loading older |
| 1105 | 1078 | messages), else the beginning (the default). */ |
| 1106 | 1079 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -107,13 +107,11 @@ | |
| 107 | btnSubmit: E1('#chat-message-submit'), |
| 108 | inputSingle: E1('#chat-input-single'), |
| 109 | inputMulti: E1('#chat-input-multi'), |
| 110 | inputCurrent: undefined/*one of inputSingle or inputMulti*/, |
| 111 | inputFile: E1('#chat-input-file'), |
| 112 | contentDiv: E1('div.content'), |
| 113 | btnMsgHome: E1('#chat-scroll-top'), |
| 114 | btnMsgEnd: E1('#chat-scroll-bottom') |
| 115 | }, |
| 116 | me: F.user.name, |
| 117 | mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50, |
| 118 | mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/, |
| 119 | pageIsActive: 'visible'===document.visibilityState, |
| @@ -339,18 +337,10 @@ | |
| 339 | } |
| 340 | }, |
| 341 | toggleChatOnlyMode: function(){ |
| 342 | return this.chatOnlyMode(!this.isChatOnlyMode()); |
| 343 | }, |
| 344 | /* Turn the message area top/bottom buttons on (yes===true), off |
| 345 | (yes==false), or toggle them (no arguments). Returns this. */ |
| 346 | toggleNavButtons: function(yes){ |
| 347 | const e = [this.e.btnMsgHome, this.e.btnMsgEnd], c = 'hidden'; |
| 348 | if(0===arguments.length) D.toggleClass(e, c); |
| 349 | else if(!arguments[0]) D.addClass(e, c); |
| 350 | else D.removeClass(e, c); |
| 351 | }, |
| 352 | messageIsInView: function(e){ |
| 353 | return e ? overlapsElemView(e, this.e.messagesWrapper) : false; |
| 354 | }, |
| 355 | settings:{ |
| 356 | get: (k,dflt)=>F.storage.get(k,dflt), |
| @@ -965,14 +955,10 @@ | |
| 965 | boolValue: ()=>Chat.settings.getBool('images-inline'), |
| 966 | callback: function(){ |
| 967 | const v = Chat.settings.toggle('images-inline'); |
| 968 | F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+"."); |
| 969 | } |
| 970 | },{ |
| 971 | label: "Message home/end buttons", |
| 972 | boolValue: ()=>!Chat.e.btnMsgHome.classList.contains('hidden'), |
| 973 | callback: ()=>Chat.toggleNavButtons() |
| 974 | }]; |
| 975 | |
| 976 | /** Set up selection list of notification sounds. */ |
| 977 | if(true/*flip this to false to enable selection of audio files*/){ |
| 978 | settingsOps.push({ |
| @@ -1083,23 +1069,10 @@ | |
| 1083 | settingsPopup.options.adjustY = function(y){ |
| 1084 | const rect = settingsButton.getBoundingClientRect(); |
| 1085 | return rect.top - popupSize.height -2; |
| 1086 | }; |
| 1087 | })()/*#chat-settings-button setup*/; |
| 1088 | |
| 1089 | (function(){ /* buttons to scroll to the begin/end of the messages. */ |
| 1090 | Chat.e.btnMsgEnd.addEventListener('click',function(ev){ |
| 1091 | ev.preventDefault(); |
| 1092 | Chat.scrollMessagesTo(1); |
| 1093 | return false; |
| 1094 | }); |
| 1095 | Chat.e.btnMsgHome.addEventListener('click',function(ev){ |
| 1096 | ev.preventDefault(); |
| 1097 | Chat.scrollMessagesTo(-1); |
| 1098 | return false; |
| 1099 | }); |
| 1100 | })(); |
| 1101 | |
| 1102 | /** Callback for poll() to inject new content into the page. jx == |
| 1103 | the response from /chat-poll. If atEnd is true, the message is |
| 1104 | appended to the end of the chat list (for loading older |
| 1105 | messages), else the beginning (the default). */ |
| 1106 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -107,13 +107,11 @@ | |
| 107 | btnSubmit: E1('#chat-message-submit'), |
| 108 | inputSingle: E1('#chat-input-single'), |
| 109 | inputMulti: E1('#chat-input-multi'), |
| 110 | inputCurrent: undefined/*one of inputSingle or inputMulti*/, |
| 111 | inputFile: E1('#chat-input-file'), |
| 112 | contentDiv: E1('div.content') |
| 113 | }, |
| 114 | me: F.user.name, |
| 115 | mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50, |
| 116 | mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/, |
| 117 | pageIsActive: 'visible'===document.visibilityState, |
| @@ -339,18 +337,10 @@ | |
| 337 | } |
| 338 | }, |
| 339 | toggleChatOnlyMode: function(){ |
| 340 | return this.chatOnlyMode(!this.isChatOnlyMode()); |
| 341 | }, |
| 342 | messageIsInView: function(e){ |
| 343 | return e ? overlapsElemView(e, this.e.messagesWrapper) : false; |
| 344 | }, |
| 345 | settings:{ |
| 346 | get: (k,dflt)=>F.storage.get(k,dflt), |
| @@ -965,14 +955,10 @@ | |
| 955 | boolValue: ()=>Chat.settings.getBool('images-inline'), |
| 956 | callback: function(){ |
| 957 | const v = Chat.settings.toggle('images-inline'); |
| 958 | F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+"."); |
| 959 | } |
| 960 | }]; |
| 961 | |
| 962 | /** Set up selection list of notification sounds. */ |
| 963 | if(true/*flip this to false to enable selection of audio files*/){ |
| 964 | settingsOps.push({ |
| @@ -1083,23 +1069,10 @@ | |
| 1069 | settingsPopup.options.adjustY = function(y){ |
| 1070 | const rect = settingsButton.getBoundingClientRect(); |
| 1071 | return rect.top - popupSize.height -2; |
| 1072 | }; |
| 1073 | })()/*#chat-settings-button setup*/; |
| 1074 | |
| 1075 | /** Callback for poll() to inject new content into the page. jx == |
| 1076 | the response from /chat-poll. If atEnd is true, the message is |
| 1077 | appended to the end of the chat list (for loading older |
| 1078 | messages), else the beginning (the default). */ |
| 1079 |