Fossil SCM

/chat: removed the unused/unnecessary jump-to-top/bottom buttons.

stephan 2021-03-27 16:04 trunk
Commit a044fea7850b8372c40dda7884025c83034be33ea6989792c8383aa7ce35387a
2 files changed -2 +1 -28
-2
--- src/chat.c
+++ src/chat.c
@@ -163,12 +163,10 @@
163163
@ placeholder="Type message here." autocomplete="off">
164164
@ <textarea rows="8" id="chat-input-multi" \
165165
@ placeholder="Type message here. Ctrl-Enter sends it." \
166166
@ class="hidden"></textarea>
167167
@ <input type="submit" value="Send" id="chat-message-submit">
168
- @ <button id="chat-scroll-top" class="hidden">&uarr;</button>
169
- @ <button id="chat-scroll-bottom" class="hidden">&darr;</button>
170168
@ <span id="chat-settings-button" class="settings-icon" \
171169
@ aria-label="Settings..." aria-haspopup="true" ></span>
172170
@ </div>
173171
@ <div id='chat-input-file-area'>
174172
@ <div class='file-selection-wrapper'>
175173
--- 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">&uarr;</button>
169 @ <button id="chat-scroll-bottom" class="hidden">&darr;</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 @@
107107
btnSubmit: E1('#chat-message-submit'),
108108
inputSingle: E1('#chat-input-single'),
109109
inputMulti: E1('#chat-input-multi'),
110110
inputCurrent: undefined/*one of inputSingle or inputMulti*/,
111111
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')
115113
},
116114
me: F.user.name,
117115
mxMsg: F.config.chat.initSize ? -F.config.chat.initSize : -50,
118116
mnMsg: undefined/*lowest message ID we've seen so far (for history loading)*/,
119117
pageIsActive: 'visible'===document.visibilityState,
@@ -339,18 +337,10 @@
339337
}
340338
},
341339
toggleChatOnlyMode: function(){
342340
return this.chatOnlyMode(!this.isChatOnlyMode());
343341
},
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
- },
352342
messageIsInView: function(e){
353343
return e ? overlapsElemView(e, this.e.messagesWrapper) : false;
354344
},
355345
settings:{
356346
get: (k,dflt)=>F.storage.get(k,dflt),
@@ -965,14 +955,10 @@
965955
boolValue: ()=>Chat.settings.getBool('images-inline'),
966956
callback: function(){
967957
const v = Chat.settings.toggle('images-inline');
968958
F.toast.message("Image mode set to "+(v ? "inline" : "hyperlink")+".");
969959
}
970
- },{
971
- label: "Message home/end buttons",
972
- boolValue: ()=>!Chat.e.btnMsgHome.classList.contains('hidden'),
973
- callback: ()=>Chat.toggleNavButtons()
974960
}];
975961
976962
/** Set up selection list of notification sounds. */
977963
if(true/*flip this to false to enable selection of audio files*/){
978964
settingsOps.push({
@@ -1083,23 +1069,10 @@
10831069
settingsPopup.options.adjustY = function(y){
10841070
const rect = settingsButton.getBoundingClientRect();
10851071
return rect.top - popupSize.height -2;
10861072
};
10871073
})()/*#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
- })();
11011074
11021075
/** Callback for poll() to inject new content into the page. jx ==
11031076
the response from /chat-poll. If atEnd is true, the message is
11041077
appended to the end of the chat list (for loading older
11051078
messages), else the beginning (the default). */
11061079
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button