Fossil SCM
/chat: add pikchr click handlers to incoming messages.
Commit
326eccf24540c8d40b7e0cd126567b24078e82137ae4dc076145ed7a988c8411
Parent
408d584e21d1ae0…
2 files changed
+2
-1
+3
+2
-1
| --- src/chat.c | ||
| +++ src/chat.c | ||
| @@ -188,11 +188,12 @@ | ||
| 188 | 188 | @ <div id='chat-messages-wrapper'> |
| 189 | 189 | /* New chat messages get inserted immediately after this element */ |
| 190 | 190 | @ <span id='message-inject-point'></span> |
| 191 | 191 | @ </div> |
| 192 | 192 | fossil_free(zProjectName); |
| 193 | - builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch", NULL); | |
| 193 | + builtin_fossil_js_bundle_or("popupwidget", "storage", | |
| 194 | + "fetch", "pikchr", NULL); | |
| 194 | 195 | /* Always in-line the javascript for the chat page */ |
| 195 | 196 | @ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */ |
| 196 | 197 | /* We need an onload handler to ensure that window.fossil is |
| 197 | 198 | initialized before the chat init code runs. */ |
| 198 | 199 | @ window.addEventListener('load', function(){ |
| 199 | 200 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -188,11 +188,12 @@ | |
| 188 | @ <div id='chat-messages-wrapper'> |
| 189 | /* New chat messages get inserted immediately after this element */ |
| 190 | @ <span id='message-inject-point'></span> |
| 191 | @ </div> |
| 192 | fossil_free(zProjectName); |
| 193 | builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch", NULL); |
| 194 | /* Always in-line the javascript for the chat page */ |
| 195 | @ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */ |
| 196 | /* We need an onload handler to ensure that window.fossil is |
| 197 | initialized before the chat init code runs. */ |
| 198 | @ window.addEventListener('load', function(){ |
| 199 |
| --- src/chat.c | |
| +++ src/chat.c | |
| @@ -188,11 +188,12 @@ | |
| 188 | @ <div id='chat-messages-wrapper'> |
| 189 | /* New chat messages get inserted immediately after this element */ |
| 190 | @ <span id='message-inject-point'></span> |
| 191 | @ </div> |
| 192 | fossil_free(zProjectName); |
| 193 | builtin_fossil_js_bundle_or("popupwidget", "storage", |
| 194 | "fetch", "pikchr", NULL); |
| 195 | /* Always in-line the javascript for the chat page */ |
| 196 | @ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */ |
| 197 | /* We need an onload handler to ensure that window.fossil is |
| 198 | initialized before the chat init code runs. */ |
| 199 | @ window.addEventListener('load', function(){ |
| 200 |
+3
| --- src/chat.js | ||
| +++ src/chat.js | ||
| @@ -681,10 +681,13 @@ | ||
| 681 | 681 | if(m.xmsg instanceof Array){ |
| 682 | 682 | // Used by Chat.reportErrorAsMessage() |
| 683 | 683 | D.append(contentTarget, m.xmsg); |
| 684 | 684 | }else{ |
| 685 | 685 | contentTarget.innerHTML = m.xmsg; |
| 686 | + if(F.pikchr){ | |
| 687 | + F.pikchr.addSrcView(contentTarget.querySelectorAll('svg.pikchr')); | |
| 688 | + } | |
| 686 | 689 | } |
| 687 | 690 | } |
| 688 | 691 | this.e.tab.addEventListener('click', this._handleLegendClicked, false); |
| 689 | 692 | if(eXFrom){ |
| 690 | 693 | eXFrom.addEventListener('click', ()=>this.e.tab.click(), false); |
| 691 | 694 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -681,10 +681,13 @@ | |
| 681 | if(m.xmsg instanceof Array){ |
| 682 | // Used by Chat.reportErrorAsMessage() |
| 683 | D.append(contentTarget, m.xmsg); |
| 684 | }else{ |
| 685 | contentTarget.innerHTML = m.xmsg; |
| 686 | } |
| 687 | } |
| 688 | this.e.tab.addEventListener('click', this._handleLegendClicked, false); |
| 689 | if(eXFrom){ |
| 690 | eXFrom.addEventListener('click', ()=>this.e.tab.click(), false); |
| 691 |
| --- src/chat.js | |
| +++ src/chat.js | |
| @@ -681,10 +681,13 @@ | |
| 681 | if(m.xmsg instanceof Array){ |
| 682 | // Used by Chat.reportErrorAsMessage() |
| 683 | D.append(contentTarget, m.xmsg); |
| 684 | }else{ |
| 685 | contentTarget.innerHTML = m.xmsg; |
| 686 | if(F.pikchr){ |
| 687 | F.pikchr.addSrcView(contentTarget.querySelectorAll('svg.pikchr')); |
| 688 | } |
| 689 | } |
| 690 | } |
| 691 | this.e.tab.addEventListener('click', this._handleLegendClicked, false); |
| 692 | if(eXFrom){ |
| 693 | eXFrom.addEventListener('click', ()=>this.e.tab.click(), false); |
| 694 |