Fossil SCM
In /chat preview mode, apply the click handlers to pikchrs in the preview.
Commit
133e6e59b97d118972c1cd4ffabdcedac16a7f2413d5f2cc8127b4540ace3e21
Parent
33fe72ca75bbd9d…
1 file changed
+5
-2
+5
-2
| --- src/fossil.page.chat.js | ||
| +++ src/fossil.page.chat.js | ||
| @@ -124,11 +124,11 @@ | ||
| 124 | 124 | window.addEventListener('resize', F.debounce(resized, 250), false); |
| 125 | 125 | return resized; |
| 126 | 126 | })(); |
| 127 | 127 | fossil.FRK = ForceResizeKludge/*for debugging*/; |
| 128 | 128 | const Chat = ForceResizeKludge.chat = (function(){ |
| 129 | - const cs = { | |
| 129 | + const cs = { // the "Chat" object (result of this function) | |
| 130 | 130 | verboseErrors: false /* if true then certain, mostly extraneous, |
| 131 | 131 | error messages may be sent to the console. */, |
| 132 | 132 | e:{/*map of certain DOM elements.*/ |
| 133 | 133 | messageInjectPoint: E1('#message-inject-point'), |
| 134 | 134 | pageTitle: E1('head title'), |
| @@ -1952,11 +1952,14 @@ | ||
| 1952 | 1952 | fd.append('filename','chat.md' |
| 1953 | 1953 | /*filename needed for mimetype determination*/); |
| 1954 | 1954 | fd.append('render_mode',F.page.previewModes.wiki); |
| 1955 | 1955 | F.fetch('ajax/preview-text',{ |
| 1956 | 1956 | payload: fd, |
| 1957 | - onload: (html)=>Chat.setPreviewText(html), | |
| 1957 | + onload: function(html){ | |
| 1958 | + Chat.setPreviewText(html); | |
| 1959 | + F.pikchr.addSrcView(Chat.e.viewPreview.querySelectorAll('svg.pikchr')); | |
| 1960 | + }, | |
| 1958 | 1961 | onerror: function(e){ |
| 1959 | 1962 | F.fetch.onerror(e); |
| 1960 | 1963 | Chat.setPreviewText("ERROR: "+( |
| 1961 | 1964 | e.message || 'Unknown error fetching preview!' |
| 1962 | 1965 | )); |
| 1963 | 1966 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -124,11 +124,11 @@ | |
| 124 | window.addEventListener('resize', F.debounce(resized, 250), false); |
| 125 | return resized; |
| 126 | })(); |
| 127 | fossil.FRK = ForceResizeKludge/*for debugging*/; |
| 128 | const Chat = ForceResizeKludge.chat = (function(){ |
| 129 | const cs = { |
| 130 | verboseErrors: false /* if true then certain, mostly extraneous, |
| 131 | error messages may be sent to the console. */, |
| 132 | e:{/*map of certain DOM elements.*/ |
| 133 | messageInjectPoint: E1('#message-inject-point'), |
| 134 | pageTitle: E1('head title'), |
| @@ -1952,11 +1952,14 @@ | |
| 1952 | fd.append('filename','chat.md' |
| 1953 | /*filename needed for mimetype determination*/); |
| 1954 | fd.append('render_mode',F.page.previewModes.wiki); |
| 1955 | F.fetch('ajax/preview-text',{ |
| 1956 | payload: fd, |
| 1957 | onload: (html)=>Chat.setPreviewText(html), |
| 1958 | onerror: function(e){ |
| 1959 | F.fetch.onerror(e); |
| 1960 | Chat.setPreviewText("ERROR: "+( |
| 1961 | e.message || 'Unknown error fetching preview!' |
| 1962 | )); |
| 1963 |
| --- src/fossil.page.chat.js | |
| +++ src/fossil.page.chat.js | |
| @@ -124,11 +124,11 @@ | |
| 124 | window.addEventListener('resize', F.debounce(resized, 250), false); |
| 125 | return resized; |
| 126 | })(); |
| 127 | fossil.FRK = ForceResizeKludge/*for debugging*/; |
| 128 | const Chat = ForceResizeKludge.chat = (function(){ |
| 129 | const cs = { // the "Chat" object (result of this function) |
| 130 | verboseErrors: false /* if true then certain, mostly extraneous, |
| 131 | error messages may be sent to the console. */, |
| 132 | e:{/*map of certain DOM elements.*/ |
| 133 | messageInjectPoint: E1('#message-inject-point'), |
| 134 | pageTitle: E1('head title'), |
| @@ -1952,11 +1952,14 @@ | |
| 1952 | fd.append('filename','chat.md' |
| 1953 | /*filename needed for mimetype determination*/); |
| 1954 | fd.append('render_mode',F.page.previewModes.wiki); |
| 1955 | F.fetch('ajax/preview-text',{ |
| 1956 | payload: fd, |
| 1957 | onload: function(html){ |
| 1958 | Chat.setPreviewText(html); |
| 1959 | F.pikchr.addSrcView(Chat.e.viewPreview.querySelectorAll('svg.pikchr')); |
| 1960 | }, |
| 1961 | onerror: function(e){ |
| 1962 | F.fetch.onerror(e); |
| 1963 | Chat.setPreviewText("ERROR: "+( |
| 1964 | e.message || 'Unknown error fetching preview!' |
| 1965 | )); |
| 1966 |