Fossil SCM

Fixes to /chat's js to allow for the new skin changes. (Mea culpa; didn't even think to try /chat while working on all this.)

wyoung 2024-02-10 22:12 trunk
Commit 4dc879858364442f8be289d7810212f97345c8509de96acd4decb74e31b101aa
1 file changed +8 -8
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -77,14 +77,14 @@
7777
7878
While we're here, we also use this to cap the max-height
7979
of the input field so that pasting huge text does not scroll
8080
the upper area of the input widget off-screen. */
8181
const elemsToCount = [
82
- document.querySelector('body > div.header'),
83
- document.querySelector('body > div.mainmenu'),
82
+ document.querySelector('body > header'),
83
+ document.querySelector('body > nav.mainmenu'),
8484
document.querySelector('body > #hbdrop'),
85
- document.querySelector('body > div.footer')
85
+ document.querySelector('body > footer')
8686
];
8787
const contentArea = E1('div.content');
8888
const bcl = document.body.classList;
8989
const resized = function f(){
9090
if(f.$disabled) return;
@@ -102,14 +102,14 @@
102102
/* ^^^^ this is a middle ground between having no size cap
103103
on the input field and having a fixed arbitrary cap. */;
104104
contentArea.style.height =
105105
contentArea.style.maxHeight = [
106106
"calc(", (ht>=100 ? ht : 100), "px",
107
- " - 0.75em"/*fudge value*/,")"
107
+ " - 0.65em"/*fudge value*/,")"
108108
/* ^^^^ hypothetically not needed, but both Chrome/FF on
109109
Linux will force scrollbars on the body if this value is
110
- too small (<0.75em in my tests). */
110
+ too small; current value is empirically selected. */
111111
].join('');
112112
if(false){
113113
console.debug("resized.",wh, extra, ht,
114114
window.getComputedStyle(contentArea).maxHeight,
115115
contentArea);
@@ -325,13 +325,13 @@
325325
*/
326326
chatOnlyMode: function f(yes){
327327
if(undefined === f.elemsToToggle){
328328
f.elemsToToggle = [];
329329
document.querySelectorAll(
330
- ["body > div.header",
331
- "body > div.mainmenu",
332
- "body > div.footer",
330
+ ["body > header",
331
+ "body > nav.mainmenu",
332
+ "body > footer",
333333
"#debugMsg"
334334
].join(',')
335335
).forEach((e)=>f.elemsToToggle.push(e));
336336
}
337337
if(!arguments.length) yes = true;
338338
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -77,14 +77,14 @@
77
78 While we're here, we also use this to cap the max-height
79 of the input field so that pasting huge text does not scroll
80 the upper area of the input widget off-screen. */
81 const elemsToCount = [
82 document.querySelector('body > div.header'),
83 document.querySelector('body > div.mainmenu'),
84 document.querySelector('body > #hbdrop'),
85 document.querySelector('body > div.footer')
86 ];
87 const contentArea = E1('div.content');
88 const bcl = document.body.classList;
89 const resized = function f(){
90 if(f.$disabled) return;
@@ -102,14 +102,14 @@
102 /* ^^^^ this is a middle ground between having no size cap
103 on the input field and having a fixed arbitrary cap. */;
104 contentArea.style.height =
105 contentArea.style.maxHeight = [
106 "calc(", (ht>=100 ? ht : 100), "px",
107 " - 0.75em"/*fudge value*/,")"
108 /* ^^^^ hypothetically not needed, but both Chrome/FF on
109 Linux will force scrollbars on the body if this value is
110 too small (<0.75em in my tests). */
111 ].join('');
112 if(false){
113 console.debug("resized.",wh, extra, ht,
114 window.getComputedStyle(contentArea).maxHeight,
115 contentArea);
@@ -325,13 +325,13 @@
325 */
326 chatOnlyMode: function f(yes){
327 if(undefined === f.elemsToToggle){
328 f.elemsToToggle = [];
329 document.querySelectorAll(
330 ["body > div.header",
331 "body > div.mainmenu",
332 "body > div.footer",
333 "#debugMsg"
334 ].join(',')
335 ).forEach((e)=>f.elemsToToggle.push(e));
336 }
337 if(!arguments.length) yes = true;
338
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -77,14 +77,14 @@
77
78 While we're here, we also use this to cap the max-height
79 of the input field so that pasting huge text does not scroll
80 the upper area of the input widget off-screen. */
81 const elemsToCount = [
82 document.querySelector('body > header'),
83 document.querySelector('body > nav.mainmenu'),
84 document.querySelector('body > #hbdrop'),
85 document.querySelector('body > footer')
86 ];
87 const contentArea = E1('div.content');
88 const bcl = document.body.classList;
89 const resized = function f(){
90 if(f.$disabled) return;
@@ -102,14 +102,14 @@
102 /* ^^^^ this is a middle ground between having no size cap
103 on the input field and having a fixed arbitrary cap. */;
104 contentArea.style.height =
105 contentArea.style.maxHeight = [
106 "calc(", (ht>=100 ? ht : 100), "px",
107 " - 0.65em"/*fudge value*/,")"
108 /* ^^^^ hypothetically not needed, but both Chrome/FF on
109 Linux will force scrollbars on the body if this value is
110 too small; current value is empirically selected. */
111 ].join('');
112 if(false){
113 console.debug("resized.",wh, extra, ht,
114 window.getComputedStyle(contentArea).maxHeight,
115 contentArea);
@@ -325,13 +325,13 @@
325 */
326 chatOnlyMode: function f(yes){
327 if(undefined === f.elemsToToggle){
328 f.elemsToToggle = [];
329 document.querySelectorAll(
330 ["body > header",
331 "body > nav.mainmenu",
332 "body > footer",
333 "#debugMsg"
334 ].join(',')
335 ).forEach((e)=>f.elemsToToggle.push(e));
336 }
337 if(!arguments.length) yes = true;
338

Keyboard Shortcuts

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