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.)
Commit
4dc879858364442f8be289d7810212f97345c8509de96acd4decb74e31b101aa
Parent
8a1ba49b73da1b5…
1 file changed
+8
-8
+8
-8
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -77,14 +77,14 @@ | ||
| 77 | 77 | |
| 78 | 78 | While we're here, we also use this to cap the max-height |
| 79 | 79 | of the input field so that pasting huge text does not scroll |
| 80 | 80 | the upper area of the input widget off-screen. */ |
| 81 | 81 | 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'), | |
| 84 | 84 | document.querySelector('body > #hbdrop'), |
| 85 | - document.querySelector('body > div.footer') | |
| 85 | + document.querySelector('body > footer') | |
| 86 | 86 | ]; |
| 87 | 87 | const contentArea = E1('div.content'); |
| 88 | 88 | const bcl = document.body.classList; |
| 89 | 89 | const resized = function f(){ |
| 90 | 90 | if(f.$disabled) return; |
| @@ -102,14 +102,14 @@ | ||
| 102 | 102 | /* ^^^^ this is a middle ground between having no size cap |
| 103 | 103 | on the input field and having a fixed arbitrary cap. */; |
| 104 | 104 | contentArea.style.height = |
| 105 | 105 | contentArea.style.maxHeight = [ |
| 106 | 106 | "calc(", (ht>=100 ? ht : 100), "px", |
| 107 | - " - 0.75em"/*fudge value*/,")" | |
| 107 | + " - 0.65em"/*fudge value*/,")" | |
| 108 | 108 | /* ^^^^ hypothetically not needed, but both Chrome/FF on |
| 109 | 109 | 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. */ | |
| 111 | 111 | ].join(''); |
| 112 | 112 | if(false){ |
| 113 | 113 | console.debug("resized.",wh, extra, ht, |
| 114 | 114 | window.getComputedStyle(contentArea).maxHeight, |
| 115 | 115 | contentArea); |
| @@ -325,13 +325,13 @@ | ||
| 325 | 325 | */ |
| 326 | 326 | chatOnlyMode: function f(yes){ |
| 327 | 327 | if(undefined === f.elemsToToggle){ |
| 328 | 328 | f.elemsToToggle = []; |
| 329 | 329 | document.querySelectorAll( |
| 330 | - ["body > div.header", | |
| 331 | - "body > div.mainmenu", | |
| 332 | - "body > div.footer", | |
| 330 | + ["body > header", | |
| 331 | + "body > nav.mainmenu", | |
| 332 | + "body > footer", | |
| 333 | 333 | "#debugMsg" |
| 334 | 334 | ].join(',') |
| 335 | 335 | ).forEach((e)=>f.elemsToToggle.push(e)); |
| 336 | 336 | } |
| 337 | 337 | if(!arguments.length) yes = true; |
| 338 | 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 > 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 |