Fossil SCM

chat: removed some dead code. If URL parameter ping=### is seen, assuming we're running from the 'chat' CLI command and automatically start up in chat-only mode.

stephan 2020-12-28 02:55 trunk
Commit b111d1ca743e0c606a0e23cff69a4bbbce471f7a24201feaed03665b5ad9957a
1 file changed +8 -17
+8 -17
--- src/chat.js
+++ src/chat.js
@@ -364,27 +364,10 @@
364364
document.body.classList.add('monospace-messages');
365365
}
366366
cs.e.inputCurrent = cs.e.inputSingle;
367367
cs.pageTitleOrig = cs.e.pageTitle.innerText;
368368
369
- if(true){
370
- /* In order to make the input area opaque, such that the message
371
- list scrolls under it without being visible, we have to
372
- ensure that the input area has a non-transparent background
373
- color. Ideally we'd select the color of div.content, but that
374
- is not necessarily set, so we fall back to using the body's
375
- background color and hope it's been explicitly set
376
- somewhere. If we rely on the input area having its own color
377
- specified in CSS then all skins would have to define an
378
- appropriate color. Thus our selection of the body color,
379
- while slightly unfortunate, is in the interest of keeping
380
- skins from being forced to define an opaque bg color.
381
- */
382
- const bodyStyle = window.getComputedStyle(document.body);
383
- cs.e.inputWrapper.style.backgroundColor = bodyStyle.backgroundColor;
384
- }
385
-
386369
const qs = (e)=>document.querySelector(e);
387370
const argsToArray = function(args){
388371
return Array.prototype.slice.call(args,0);
389372
};
390373
cs.reportError = function(/*msg args*/){
@@ -1037,7 +1020,15 @@
10371020
});
10381021
}
10391022
poll.running = false;
10401023
poll(true);
10411024
setInterval(poll, 1000);
1025
+
1026
+ if(/\bping=\d+/.test(window.location.search)){
1027
+ /* If we see the 'ping' parameter we're certain this was run via
1028
+ the 'fossil chat' CLI command, in which case we start up in
1029
+ chat-only mode. */
1030
+ Chat.chatOnlyMode(true);
1031
+ }
1032
+
10421033
F.page.chat = Chat/* enables testing the APIs via the dev tools */;
10431034
})();
10441035
--- src/chat.js
+++ src/chat.js
@@ -364,27 +364,10 @@
364 document.body.classList.add('monospace-messages');
365 }
366 cs.e.inputCurrent = cs.e.inputSingle;
367 cs.pageTitleOrig = cs.e.pageTitle.innerText;
368
369 if(true){
370 /* In order to make the input area opaque, such that the message
371 list scrolls under it without being visible, we have to
372 ensure that the input area has a non-transparent background
373 color. Ideally we'd select the color of div.content, but that
374 is not necessarily set, so we fall back to using the body's
375 background color and hope it's been explicitly set
376 somewhere. If we rely on the input area having its own color
377 specified in CSS then all skins would have to define an
378 appropriate color. Thus our selection of the body color,
379 while slightly unfortunate, is in the interest of keeping
380 skins from being forced to define an opaque bg color.
381 */
382 const bodyStyle = window.getComputedStyle(document.body);
383 cs.e.inputWrapper.style.backgroundColor = bodyStyle.backgroundColor;
384 }
385
386 const qs = (e)=>document.querySelector(e);
387 const argsToArray = function(args){
388 return Array.prototype.slice.call(args,0);
389 };
390 cs.reportError = function(/*msg args*/){
@@ -1037,7 +1020,15 @@
1037 });
1038 }
1039 poll.running = false;
1040 poll(true);
1041 setInterval(poll, 1000);
 
 
 
 
 
 
 
 
1042 F.page.chat = Chat/* enables testing the APIs via the dev tools */;
1043 })();
1044
--- src/chat.js
+++ src/chat.js
@@ -364,27 +364,10 @@
364 document.body.classList.add('monospace-messages');
365 }
366 cs.e.inputCurrent = cs.e.inputSingle;
367 cs.pageTitleOrig = cs.e.pageTitle.innerText;
368
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
369 const qs = (e)=>document.querySelector(e);
370 const argsToArray = function(args){
371 return Array.prototype.slice.call(args,0);
372 };
373 cs.reportError = function(/*msg args*/){
@@ -1037,7 +1020,15 @@
1020 });
1021 }
1022 poll.running = false;
1023 poll(true);
1024 setInterval(poll, 1000);
1025
1026 if(/\bping=\d+/.test(window.location.search)){
1027 /* If we see the 'ping' parameter we're certain this was run via
1028 the 'fossil chat' CLI command, in which case we start up in
1029 chat-only mode. */
1030 Chat.chatOnlyMode(true);
1031 }
1032
1033 F.page.chat = Chat/* enables testing the APIs via the dev tools */;
1034 })();
1035

Keyboard Shortcuts

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