Fossil SCM
Remove some stray debug output. Make fossil.dom.remove() a bit more robust against passed-in elements which have already been removed from the DOM.
Commit
040a7d45037f08060ef8bd2141b0cad4da3cbeb680ffc6547224ee715460d78a
Parent
8da1269599aba81…
2 files changed
+4
-4
+4
-3
+4
-4
| --- src/fossil.dom.js | ||
| +++ src/fossil.dom.js | ||
| @@ -17,16 +17,16 @@ | ||
| 17 | 17 | return function(){ |
| 18 | 18 | return document.createElement(eType); |
| 19 | 19 | }; |
| 20 | 20 | }, |
| 21 | 21 | remove: function(e){ |
| 22 | - if(e.forEach){ | |
| 22 | + if(e?.forEach){ | |
| 23 | 23 | e.forEach( |
| 24 | - (x)=>x.parentNode.removeChild(x) | |
| 24 | + (x)=>x?.parentNode?.removeChild(x) | |
| 25 | 25 | ); |
| 26 | - }else if(e.parentNode){ | |
| 27 | - e.parentNode.removeChild(e); | |
| 26 | + }else{ | |
| 27 | + e?.parentNode?.removeChild(e); | |
| 28 | 28 | } |
| 29 | 29 | return e; |
| 30 | 30 | }, |
| 31 | 31 | /** |
| 32 | 32 | Removes all child DOM elements from the given element |
| 33 | 33 |
| --- src/fossil.dom.js | |
| +++ src/fossil.dom.js | |
| @@ -17,16 +17,16 @@ | |
| 17 | return function(){ |
| 18 | return document.createElement(eType); |
| 19 | }; |
| 20 | }, |
| 21 | remove: function(e){ |
| 22 | if(e.forEach){ |
| 23 | e.forEach( |
| 24 | (x)=>x.parentNode.removeChild(x) |
| 25 | ); |
| 26 | }else if(e.parentNode){ |
| 27 | e.parentNode.removeChild(e); |
| 28 | } |
| 29 | return e; |
| 30 | }, |
| 31 | /** |
| 32 | Removes all child DOM elements from the given element |
| 33 |
| --- src/fossil.dom.js | |
| +++ src/fossil.dom.js | |
| @@ -17,16 +17,16 @@ | |
| 17 | return function(){ |
| 18 | return document.createElement(eType); |
| 19 | }; |
| 20 | }, |
| 21 | remove: function(e){ |
| 22 | if(e?.forEach){ |
| 23 | e.forEach( |
| 24 | (x)=>x?.parentNode?.removeChild(x) |
| 25 | ); |
| 26 | }else{ |
| 27 | e?.parentNode?.removeChild(e); |
| 28 | } |
| 29 | return e; |
| 30 | }, |
| 31 | /** |
| 32 | Removes all child DOM elements from the given element |
| 33 |
+4
-3
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -2666,11 +2666,11 @@ | ||
| 2666 | 2666 | event, but a lot less explicable. |
| 2667 | 2667 | */ |
| 2668 | 2668 | ()=>{ |
| 2669 | 2669 | if( Chat.aPollErr.length ){ |
| 2670 | 2670 | if(Chat.aPollErr.length>1){ |
| 2671 | - console.warn('aPollErr',Chat.aPollErr); | |
| 2671 | + //console.warn('aPollErr',Chat.aPollErr); | |
| 2672 | 2672 | if(Chat.aPollErr[1].name='timeout'){ |
| 2673 | 2673 | /* mysterious pairs of HTTP 0 followed immediately |
| 2674 | 2674 | by timeout response; ignore the former in that case. */ |
| 2675 | 2675 | Chat.aPollErr.shift(); |
| 2676 | 2676 | } |
| @@ -2681,12 +2681,13 @@ | ||
| 2681 | 2681 | 1000 |
| 2682 | 2682 | ); |
| 2683 | 2683 | } |
| 2684 | 2684 | let nErr = 0; |
| 2685 | 2685 | F.fetch("chat-poll",{ |
| 2686 | - timeout: 420 * 1000/*FIXME: get the value from the server*/, | |
| 2687 | - //15000, | |
| 2686 | + timeout: 1 | |
| 2687 | + ? 420 * 1000/*FIXME: get the value from the server*/ | |
| 2688 | + : 15000, | |
| 2688 | 2689 | urlParams:{ |
| 2689 | 2690 | name: Chat.mxMsg |
| 2690 | 2691 | }, |
| 2691 | 2692 | responseType: "json", |
| 2692 | 2693 | // Disable the ajax start/end handling for this long-polling op: |
| 2693 | 2694 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -2666,11 +2666,11 @@ | |
| 2666 | event, but a lot less explicable. |
| 2667 | */ |
| 2668 | ()=>{ |
| 2669 | if( Chat.aPollErr.length ){ |
| 2670 | if(Chat.aPollErr.length>1){ |
| 2671 | console.warn('aPollErr',Chat.aPollErr); |
| 2672 | if(Chat.aPollErr[1].name='timeout'){ |
| 2673 | /* mysterious pairs of HTTP 0 followed immediately |
| 2674 | by timeout response; ignore the former in that case. */ |
| 2675 | Chat.aPollErr.shift(); |
| 2676 | } |
| @@ -2681,12 +2681,13 @@ | |
| 2681 | 1000 |
| 2682 | ); |
| 2683 | } |
| 2684 | let nErr = 0; |
| 2685 | F.fetch("chat-poll",{ |
| 2686 | timeout: 420 * 1000/*FIXME: get the value from the server*/, |
| 2687 | //15000, |
| 2688 | urlParams:{ |
| 2689 | name: Chat.mxMsg |
| 2690 | }, |
| 2691 | responseType: "json", |
| 2692 | // Disable the ajax start/end handling for this long-polling op: |
| 2693 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -2666,11 +2666,11 @@ | |
| 2666 | event, but a lot less explicable. |
| 2667 | */ |
| 2668 | ()=>{ |
| 2669 | if( Chat.aPollErr.length ){ |
| 2670 | if(Chat.aPollErr.length>1){ |
| 2671 | //console.warn('aPollErr',Chat.aPollErr); |
| 2672 | if(Chat.aPollErr[1].name='timeout'){ |
| 2673 | /* mysterious pairs of HTTP 0 followed immediately |
| 2674 | by timeout response; ignore the former in that case. */ |
| 2675 | Chat.aPollErr.shift(); |
| 2676 | } |
| @@ -2681,12 +2681,13 @@ | |
| 2681 | 1000 |
| 2682 | ); |
| 2683 | } |
| 2684 | let nErr = 0; |
| 2685 | F.fetch("chat-poll",{ |
| 2686 | timeout: 1 |
| 2687 | ? 420 * 1000/*FIXME: get the value from the server*/ |
| 2688 | : 15000, |
| 2689 | urlParams:{ |
| 2690 | name: Chat.mxMsg |
| 2691 | }, |
| 2692 | responseType: "json", |
| 2693 | // Disable the ajax start/end handling for this long-polling op: |
| 2694 |