Fossil SCM

Consolidated /wikiedit, /pikchrshow, /fileedit, and /chat to use shift-enter to run preview mode. The former 3 previously used ctrl-enter but it was poorly documented and probably not widely used like ctrl-enter is in chat (to send a message).

stephan 2021-09-29 16:45 trunk
Commit 13fabf3f4d87d0016fc97bb0035273c1e0f8785fe433db74ba63c083d6c49aef
+12 -4
--- src/chat.c
+++ src/chat.c
@@ -142,35 +142,42 @@
142142
** send new chat message, delete older messages, or poll for changes.
143143
*/
144144
void chat_webpage(void){
145145
char *zAlert;
146146
char *zProjectName;
147
+ const char * zInputPlaceholder1 = /* Placeholder for 1-line input */
148
+ "Enter sends and Shift-Enter previews.";
149
+ const char * zInputPlaceholder2 = /* Placeholder for textarea input*/
150
+ "Ctrl-Enter sends and Shift-Enter previews.";
151
+ char * zInputPlaceholder0; /* Common text input placeholder value */
147152
login_check_credentials();
148153
if( !g.perm.Chat ){
149154
login_needed(g.anon.Chat);
150155
return;
151156
}
152157
zAlert = mprintf("%s/builtin/%s", g.zBaseURL,
153158
db_get("chat-alert-sound","alerts/plunk.wav"));
154159
zProjectName = db_get("project-name","Unnamed project");
160
+ zInputPlaceholder0 =
161
+ mprintf("Type markdown-formatted message for %h.", zProjectName);
155162
style_set_current_feature("chat");
156163
style_header("Chat");
157164
@ <div id='chat-input-area'>
158165
@ <div id='chat-input-line' class='single-line'>
159166
@ <input type="text" name="msg" id="chat-input-single" \
160
- @ placeholder="Type markdown-formatted message for %h(zProjectName)." \
167
+ @ placeholder="%h(zInputPlaceholder0) %h(zInputPlaceholder1)" \
161168
@ autocomplete="off">
162169
@ <textarea rows="8" id="chat-input-multi" \
163
- @ placeholder="Type markdown-formatted message for %h(zProjectName). Ctrl-Enter sends it." \
170
+ @ placeholder="%h(zInputPlaceholder0) %h(zInputPlaceholder2)" \
164171
@ class="hidden"></textarea>
165172
@ <div id='chat-edit-buttons'>
166173
@ <button id="chat-preview-button" \
167
- @ title="Preview message">&#128065;</button>
174
+ @ title="Preview message (Shift-Enter)">&#128065;</button>
168175
@ <button id="chat-settings-button" \
169176
@ title="Configure chat">&#9881;</button>
170177
@ <button id="chat-message-submit" \
171
- @ title="Send message">&#128228;</button>
178
+ @ title="Send message (Ctrl-Enter)">&#128228;</button>
172179
@ </div>
173180
@ </div>
174181
@ <div id='chat-input-file-area'>
175182
@ <div class='file-selection-wrapper'>
176183
@ <div class='help-buttonlet'>
@@ -209,10 +216,11 @@
209216
@ <div id='chat-messages-wrapper' class='chat-view'>
210217
/* New chat messages get inserted immediately after this element */
211218
@ <span id='message-inject-point'></span>
212219
@ </div>
213220
fossil_free(zProjectName);
221
+ fossil_free(zInputPlaceholder0);
214222
builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch",
215223
"pikchr", "confirmer", NULL);
216224
/* Always in-line the javascript for the chat page */
217225
@ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */
218226
/* We need an onload handler to ensure that window.fossil is
219227
--- src/chat.c
+++ src/chat.c
@@ -142,35 +142,42 @@
142 ** send new chat message, delete older messages, or poll for changes.
143 */
144 void chat_webpage(void){
145 char *zAlert;
146 char *zProjectName;
 
 
 
 
 
147 login_check_credentials();
148 if( !g.perm.Chat ){
149 login_needed(g.anon.Chat);
150 return;
151 }
152 zAlert = mprintf("%s/builtin/%s", g.zBaseURL,
153 db_get("chat-alert-sound","alerts/plunk.wav"));
154 zProjectName = db_get("project-name","Unnamed project");
 
 
155 style_set_current_feature("chat");
156 style_header("Chat");
157 @ <div id='chat-input-area'>
158 @ <div id='chat-input-line' class='single-line'>
159 @ <input type="text" name="msg" id="chat-input-single" \
160 @ placeholder="Type markdown-formatted message for %h(zProjectName)." \
161 @ autocomplete="off">
162 @ <textarea rows="8" id="chat-input-multi" \
163 @ placeholder="Type markdown-formatted message for %h(zProjectName). Ctrl-Enter sends it." \
164 @ class="hidden"></textarea>
165 @ <div id='chat-edit-buttons'>
166 @ <button id="chat-preview-button" \
167 @ title="Preview message">&#128065;</button>
168 @ <button id="chat-settings-button" \
169 @ title="Configure chat">&#9881;</button>
170 @ <button id="chat-message-submit" \
171 @ title="Send message">&#128228;</button>
172 @ </div>
173 @ </div>
174 @ <div id='chat-input-file-area'>
175 @ <div class='file-selection-wrapper'>
176 @ <div class='help-buttonlet'>
@@ -209,10 +216,11 @@
209 @ <div id='chat-messages-wrapper' class='chat-view'>
210 /* New chat messages get inserted immediately after this element */
211 @ <span id='message-inject-point'></span>
212 @ </div>
213 fossil_free(zProjectName);
 
214 builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch",
215 "pikchr", "confirmer", NULL);
216 /* Always in-line the javascript for the chat page */
217 @ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */
218 /* We need an onload handler to ensure that window.fossil is
219
--- src/chat.c
+++ src/chat.c
@@ -142,35 +142,42 @@
142 ** send new chat message, delete older messages, or poll for changes.
143 */
144 void chat_webpage(void){
145 char *zAlert;
146 char *zProjectName;
147 const char * zInputPlaceholder1 = /* Placeholder for 1-line input */
148 "Enter sends and Shift-Enter previews.";
149 const char * zInputPlaceholder2 = /* Placeholder for textarea input*/
150 "Ctrl-Enter sends and Shift-Enter previews.";
151 char * zInputPlaceholder0; /* Common text input placeholder value */
152 login_check_credentials();
153 if( !g.perm.Chat ){
154 login_needed(g.anon.Chat);
155 return;
156 }
157 zAlert = mprintf("%s/builtin/%s", g.zBaseURL,
158 db_get("chat-alert-sound","alerts/plunk.wav"));
159 zProjectName = db_get("project-name","Unnamed project");
160 zInputPlaceholder0 =
161 mprintf("Type markdown-formatted message for %h.", zProjectName);
162 style_set_current_feature("chat");
163 style_header("Chat");
164 @ <div id='chat-input-area'>
165 @ <div id='chat-input-line' class='single-line'>
166 @ <input type="text" name="msg" id="chat-input-single" \
167 @ placeholder="%h(zInputPlaceholder0) %h(zInputPlaceholder1)" \
168 @ autocomplete="off">
169 @ <textarea rows="8" id="chat-input-multi" \
170 @ placeholder="%h(zInputPlaceholder0) %h(zInputPlaceholder2)" \
171 @ class="hidden"></textarea>
172 @ <div id='chat-edit-buttons'>
173 @ <button id="chat-preview-button" \
174 @ title="Preview message (Shift-Enter)">&#128065;</button>
175 @ <button id="chat-settings-button" \
176 @ title="Configure chat">&#9881;</button>
177 @ <button id="chat-message-submit" \
178 @ title="Send message (Ctrl-Enter)">&#128228;</button>
179 @ </div>
180 @ </div>
181 @ <div id='chat-input-file-area'>
182 @ <div class='file-selection-wrapper'>
183 @ <div class='help-buttonlet'>
@@ -209,10 +216,11 @@
216 @ <div id='chat-messages-wrapper' class='chat-view'>
217 /* New chat messages get inserted immediately after this element */
218 @ <span id='message-inject-point'></span>
219 @ </div>
220 fossil_free(zProjectName);
221 fossil_free(zInputPlaceholder0);
222 builtin_fossil_js_bundle_or("popupwidget", "storage", "fetch",
223 "pikchr", "confirmer", NULL);
224 /* Always in-line the javascript for the chat page */
225 @ <script nonce="%h(style_nonce())">/* chat.c:%d(__LINE__) */
226 /* We need an onload handler to ensure that window.fossil is
227
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -202,11 +202,10 @@
202202
D.removeClass(this.e.inputCurrent, 'hidden');
203203
const mh2 = m.clientHeight;
204204
m.scrollTo(0, sTop + (mh1-mh2));
205205
this.e.inputCurrent.value = old.value;
206206
old.value = '';
207
- this.animate(this.e.inputCurrent, "anim-flip-v");
208207
return this;
209208
},
210209
/**
211210
If passed true or no arguments, switches to multi-line mode
212211
if currently in single-line mode. If passed false, switches
@@ -1195,26 +1194,32 @@
11951194
});
11961195
BlobXferState.clear();
11971196
Chat.inputValue("").inputFocus();
11981197
};
11991198
1200
- Chat.e.inputSingle.addEventListener('keydown',function(ev){
1201
- if(13===ev.keyCode/*ENTER*/){
1202
- ev.preventDefault();
1203
- ev.stopPropagation();
1204
- Chat.submitMessage();
1205
- return false;
1206
- }
1207
- }, false);
1208
- Chat.e.inputMulti.addEventListener('keydown',function(ev){
1209
- if(ev.ctrlKey && 13 === ev.keyCode){
1210
- ev.preventDefault();
1211
- ev.stopPropagation();
1212
- Chat.submitMessage();
1213
- return false;
1214
- }
1215
- }, false);
1199
+ const inputWidgetKeydown = function(ev){
1200
+ if(13 === ev.keyCode){
1201
+ if(ev.shiftKey){
1202
+ ev.preventDefault();
1203
+ ev.stopPropagation();
1204
+ Chat.e.btnPreview.click();
1205
+ return false;
1206
+ }else if((Chat.e.inputSingle===ev.target)
1207
+ || (ev.ctrlKey && Chat.e.inputMulti===ev.target)){
1208
+ /* ^^^ note that it is intended that both ctrl-enter and enter
1209
+ work for single-line input mode. */
1210
+ ev.preventDefault();
1211
+ ev.stopPropagation();
1212
+ Chat.submitMessage();
1213
+ return false;
1214
+ }
1215
+ }
1216
+ };
1217
+ Chat.e.inputSingle
1218
+ .addEventListener('keydown', inputWidgetKeydown, false);
1219
+ Chat.e.inputMulti
1220
+ .addEventListener('keydown', inputWidgetKeydown, false);
12161221
Chat.e.btnSubmit.addEventListener('click',(e)=>{
12171222
e.preventDefault();
12181223
Chat.submitMessage();
12191224
return false;
12201225
});
12211226
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -202,11 +202,10 @@
202 D.removeClass(this.e.inputCurrent, 'hidden');
203 const mh2 = m.clientHeight;
204 m.scrollTo(0, sTop + (mh1-mh2));
205 this.e.inputCurrent.value = old.value;
206 old.value = '';
207 this.animate(this.e.inputCurrent, "anim-flip-v");
208 return this;
209 },
210 /**
211 If passed true or no arguments, switches to multi-line mode
212 if currently in single-line mode. If passed false, switches
@@ -1195,26 +1194,32 @@
1195 });
1196 BlobXferState.clear();
1197 Chat.inputValue("").inputFocus();
1198 };
1199
1200 Chat.e.inputSingle.addEventListener('keydown',function(ev){
1201 if(13===ev.keyCode/*ENTER*/){
1202 ev.preventDefault();
1203 ev.stopPropagation();
1204 Chat.submitMessage();
1205 return false;
1206 }
1207 }, false);
1208 Chat.e.inputMulti.addEventListener('keydown',function(ev){
1209 if(ev.ctrlKey && 13 === ev.keyCode){
1210 ev.preventDefault();
1211 ev.stopPropagation();
1212 Chat.submitMessage();
1213 return false;
1214 }
1215 }, false);
 
 
 
 
 
 
1216 Chat.e.btnSubmit.addEventListener('click',(e)=>{
1217 e.preventDefault();
1218 Chat.submitMessage();
1219 return false;
1220 });
1221
--- src/fossil.page.chat.js
+++ src/fossil.page.chat.js
@@ -202,11 +202,10 @@
202 D.removeClass(this.e.inputCurrent, 'hidden');
203 const mh2 = m.clientHeight;
204 m.scrollTo(0, sTop + (mh1-mh2));
205 this.e.inputCurrent.value = old.value;
206 old.value = '';
 
207 return this;
208 },
209 /**
210 If passed true or no arguments, switches to multi-line mode
211 if currently in single-line mode. If passed false, switches
@@ -1195,26 +1194,32 @@
1194 });
1195 BlobXferState.clear();
1196 Chat.inputValue("").inputFocus();
1197 };
1198
1199 const inputWidgetKeydown = function(ev){
1200 if(13 === ev.keyCode){
1201 if(ev.shiftKey){
1202 ev.preventDefault();
1203 ev.stopPropagation();
1204 Chat.e.btnPreview.click();
1205 return false;
1206 }else if((Chat.e.inputSingle===ev.target)
1207 || (ev.ctrlKey && Chat.e.inputMulti===ev.target)){
1208 /* ^^^ note that it is intended that both ctrl-enter and enter
1209 work for single-line input mode. */
1210 ev.preventDefault();
1211 ev.stopPropagation();
1212 Chat.submitMessage();
1213 return false;
1214 }
1215 }
1216 };
1217 Chat.e.inputSingle
1218 .addEventListener('keydown', inputWidgetKeydown, false);
1219 Chat.e.inputMulti
1220 .addEventListener('keydown', inputWidgetKeydown, false);
1221 Chat.e.btnSubmit.addEventListener('click',(e)=>{
1222 e.preventDefault();
1223 Chat.submitMessage();
1224 return false;
1225 });
1226
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -724,11 +724,11 @@
724724
);
725725
////////////////////////////////////////////////////////////
726726
// Trigger preview on Ctrl-Enter. This only works on the built-in
727727
// editor widget, not a client-provided one.
728728
P.e.taEditor.addEventListener('keydown',function(ev){
729
- if(ev.ctrlKey && 13 === ev.keyCode){
729
+ if(ev.shiftKey && 13 === ev.keyCode){
730730
ev.preventDefault();
731731
ev.stopPropagation();
732732
P.e.taEditor.blur(/*force change event, if needed*/);
733733
P.tabs.switchToTab(P.e.tabs.preview);
734734
if(!P.e.cbAutoPreview.checked){/* If NOT in auto-preview mode, trigger an update. */
@@ -737,11 +737,11 @@
737737
return false;
738738
}
739739
}, false);
740740
// If we're in the preview tab, have ctrl-enter switch back to the editor.
741741
document.body.addEventListener('keydown',function(ev){
742
- if(ev.ctrlKey && 13 === ev.keyCode){
742
+ if(ev.shiftKey && 13 === ev.keyCode){
743743
if(currentTab === P.e.tabs.preview){
744744
ev.preventDefault();
745745
ev.stopPropagation();
746746
P.tabs.switchToTab(P.e.tabs.content);
747747
P.e.taEditor.focus(/*doesn't work for client-supplied editor widget!
748748
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -724,11 +724,11 @@
724 );
725 ////////////////////////////////////////////////////////////
726 // Trigger preview on Ctrl-Enter. This only works on the built-in
727 // editor widget, not a client-provided one.
728 P.e.taEditor.addEventListener('keydown',function(ev){
729 if(ev.ctrlKey && 13 === ev.keyCode){
730 ev.preventDefault();
731 ev.stopPropagation();
732 P.e.taEditor.blur(/*force change event, if needed*/);
733 P.tabs.switchToTab(P.e.tabs.preview);
734 if(!P.e.cbAutoPreview.checked){/* If NOT in auto-preview mode, trigger an update. */
@@ -737,11 +737,11 @@
737 return false;
738 }
739 }, false);
740 // If we're in the preview tab, have ctrl-enter switch back to the editor.
741 document.body.addEventListener('keydown',function(ev){
742 if(ev.ctrlKey && 13 === ev.keyCode){
743 if(currentTab === P.e.tabs.preview){
744 ev.preventDefault();
745 ev.stopPropagation();
746 P.tabs.switchToTab(P.e.tabs.content);
747 P.e.taEditor.focus(/*doesn't work for client-supplied editor widget!
748
--- src/fossil.page.fileedit.js
+++ src/fossil.page.fileedit.js
@@ -724,11 +724,11 @@
724 );
725 ////////////////////////////////////////////////////////////
726 // Trigger preview on Ctrl-Enter. This only works on the built-in
727 // editor widget, not a client-provided one.
728 P.e.taEditor.addEventListener('keydown',function(ev){
729 if(ev.shiftKey && 13 === ev.keyCode){
730 ev.preventDefault();
731 ev.stopPropagation();
732 P.e.taEditor.blur(/*force change event, if needed*/);
733 P.tabs.switchToTab(P.e.tabs.preview);
734 if(!P.e.cbAutoPreview.checked){/* If NOT in auto-preview mode, trigger an update. */
@@ -737,11 +737,11 @@
737 return false;
738 }
739 }, false);
740 // If we're in the preview tab, have ctrl-enter switch back to the editor.
741 document.body.addEventListener('keydown',function(ev){
742 if(ev.shiftKey && 13 === ev.keyCode){
743 if(currentTab === P.e.tabs.preview){
744 ev.preventDefault();
745 ev.stopPropagation();
746 P.tabs.switchToTab(P.e.tabs.content);
747 P.e.taEditor.focus(/*doesn't work for client-supplied editor widget!
748
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -98,13 +98,13 @@
9898
P.e.previewCopyButton,
9999
P.e.previewModeLabel,
100100
P.e.markupAlignWrapper );
101101
102102
////////////////////////////////////////////////////////////
103
- // Trigger preview on Ctrl-Enter.
103
+ // Trigger preview on Shift-Enter.
104104
P.e.taContent.addEventListener('keydown',function(ev){
105
- if(ev.ctrlKey && 13 === ev.keyCode){
105
+ if(ev.shiftKey && 13 === ev.keyCode){
106106
ev.preventDefault();
107107
ev.stopPropagation();
108108
P.preview();
109109
return false;
110110
}
@@ -390,10 +390,11 @@
390390
}
391391
D.append(D.clearElement(preTgt), this.e.taPreviewText);
392392
break;
393393
}
394394
this.e.previewModeLabel.innerText = label;
395
+ this.e.taContent.focus(/*not sure why this gets lost on preview!*/);
395396
};
396397
397398
/**
398399
Fetches the preview from the server and updates the preview to
399400
the rendered SVG content or error report.
400401
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -98,13 +98,13 @@
98 P.e.previewCopyButton,
99 P.e.previewModeLabel,
100 P.e.markupAlignWrapper );
101
102 ////////////////////////////////////////////////////////////
103 // Trigger preview on Ctrl-Enter.
104 P.e.taContent.addEventListener('keydown',function(ev){
105 if(ev.ctrlKey && 13 === ev.keyCode){
106 ev.preventDefault();
107 ev.stopPropagation();
108 P.preview();
109 return false;
110 }
@@ -390,10 +390,11 @@
390 }
391 D.append(D.clearElement(preTgt), this.e.taPreviewText);
392 break;
393 }
394 this.e.previewModeLabel.innerText = label;
 
395 };
396
397 /**
398 Fetches the preview from the server and updates the preview to
399 the rendered SVG content or error report.
400
--- src/fossil.page.pikchrshow.js
+++ src/fossil.page.pikchrshow.js
@@ -98,13 +98,13 @@
98 P.e.previewCopyButton,
99 P.e.previewModeLabel,
100 P.e.markupAlignWrapper );
101
102 ////////////////////////////////////////////////////////////
103 // Trigger preview on Shift-Enter.
104 P.e.taContent.addEventListener('keydown',function(ev){
105 if(ev.shiftKey && 13 === ev.keyCode){
106 ev.preventDefault();
107 ev.stopPropagation();
108 P.preview();
109 return false;
110 }
@@ -390,10 +390,11 @@
390 }
391 D.append(D.clearElement(preTgt), this.e.taPreviewText);
392 break;
393 }
394 this.e.previewModeLabel.innerText = label;
395 this.e.taContent.focus(/*not sure why this gets lost on preview!*/);
396 };
397
398 /**
399 Fetches the preview from the server and updates the preview to
400 the rendered SVG content or error report.
401
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -914,11 +914,11 @@
914914
);
915915
////////////////////////////////////////////////////////////
916916
// Trigger preview on Ctrl-Enter. This only works on the built-in
917917
// editor widget, not a client-provided one.
918918
P.e.taEditor.addEventListener('keydown',function(ev){
919
- if(ev.ctrlKey && 13 === ev.keyCode){
919
+ if(ev.shiftKey && 13 === ev.keyCode){
920920
ev.preventDefault();
921921
ev.stopPropagation();
922922
P.e.taEditor.blur(/*force change event, if needed*/);
923923
P.tabs.switchToTab(P.e.tabs.preview);
924924
if(!P.e.cbAutoPreview.checked){/* If NOT in auto-preview mode, trigger an update. */
@@ -926,11 +926,11 @@
926926
}
927927
}
928928
}, false);
929929
// If we're in the preview tab, have ctrl-enter switch back to the editor.
930930
document.body.addEventListener('keydown',function(ev){
931
- if(ev.ctrlKey && 13 === ev.keyCode){
931
+ if(ev.shiftKey && 13 === ev.keyCode){
932932
if(currentTab === P.e.tabs.preview){
933933
ev.preventDefault();
934934
ev.stopPropagation();
935935
P.tabs.switchToTab(P.e.tabs.content);
936936
P.e.taEditor.focus(/*doesn't work for client-supplied editor widget!
937937
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -914,11 +914,11 @@
914 );
915 ////////////////////////////////////////////////////////////
916 // Trigger preview on Ctrl-Enter. This only works on the built-in
917 // editor widget, not a client-provided one.
918 P.e.taEditor.addEventListener('keydown',function(ev){
919 if(ev.ctrlKey && 13 === ev.keyCode){
920 ev.preventDefault();
921 ev.stopPropagation();
922 P.e.taEditor.blur(/*force change event, if needed*/);
923 P.tabs.switchToTab(P.e.tabs.preview);
924 if(!P.e.cbAutoPreview.checked){/* If NOT in auto-preview mode, trigger an update. */
@@ -926,11 +926,11 @@
926 }
927 }
928 }, false);
929 // If we're in the preview tab, have ctrl-enter switch back to the editor.
930 document.body.addEventListener('keydown',function(ev){
931 if(ev.ctrlKey && 13 === ev.keyCode){
932 if(currentTab === P.e.tabs.preview){
933 ev.preventDefault();
934 ev.stopPropagation();
935 P.tabs.switchToTab(P.e.tabs.content);
936 P.e.taEditor.focus(/*doesn't work for client-supplied editor widget!
937
--- src/fossil.page.wikiedit.js
+++ src/fossil.page.wikiedit.js
@@ -914,11 +914,11 @@
914 );
915 ////////////////////////////////////////////////////////////
916 // Trigger preview on Ctrl-Enter. This only works on the built-in
917 // editor widget, not a client-provided one.
918 P.e.taEditor.addEventListener('keydown',function(ev){
919 if(ev.shiftKey && 13 === ev.keyCode){
920 ev.preventDefault();
921 ev.stopPropagation();
922 P.e.taEditor.blur(/*force change event, if needed*/);
923 P.tabs.switchToTab(P.e.tabs.preview);
924 if(!P.e.cbAutoPreview.checked){/* If NOT in auto-preview mode, trigger an update. */
@@ -926,11 +926,11 @@
926 }
927 }
928 }, false);
929 // If we're in the preview tab, have ctrl-enter switch back to the editor.
930 document.body.addEventListener('keydown',function(ev){
931 if(ev.shiftKey && 13 === ev.keyCode){
932 if(currentTab === P.e.tabs.preview){
933 ev.preventDefault();
934 ev.stopPropagation();
935 P.tabs.switchToTab(P.e.tabs.content);
936 P.e.taEditor.focus(/*doesn't work for client-supplied editor widget!
937
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -335,11 +335,11 @@
335335
CX("body.pikchrshow .v-align-middle{"
336336
"vertical-align: middle"
337337
"}\n");
338338
CX(".dragover {border: 3px dotted rgba(0,255,0,0.6)}\n");
339339
} CX("</style>");
340
- CX("<div>Input pikchr code and tap Preview (or Ctrl-Enter) to render "
340
+ CX("<div>Input pikchr code and tap Preview (or Shift-Enter) to render "
341341
"it:</div>");
342342
CX("<div id='sbs-wrapper'>"); {
343343
CX("<div id='pikchrshow-form'>"); {
344344
CX("<textarea id='content' name='content' rows='15'>"
345345
"%s</textarea>",zContent/*safe-for-%s*/);
346346
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -335,11 +335,11 @@
335 CX("body.pikchrshow .v-align-middle{"
336 "vertical-align: middle"
337 "}\n");
338 CX(".dragover {border: 3px dotted rgba(0,255,0,0.6)}\n");
339 } CX("</style>");
340 CX("<div>Input pikchr code and tap Preview (or Ctrl-Enter) to render "
341 "it:</div>");
342 CX("<div id='sbs-wrapper'>"); {
343 CX("<div id='pikchrshow-form'>"); {
344 CX("<textarea id='content' name='content' rows='15'>"
345 "%s</textarea>",zContent/*safe-for-%s*/);
346
--- src/pikchrshow.c
+++ src/pikchrshow.c
@@ -335,11 +335,11 @@
335 CX("body.pikchrshow .v-align-middle{"
336 "vertical-align: middle"
337 "}\n");
338 CX(".dragover {border: 3px dotted rgba(0,255,0,0.6)}\n");
339 } CX("</style>");
340 CX("<div>Input pikchr code and tap Preview (or Shift-Enter) to render "
341 "it:</div>");
342 CX("<div id='sbs-wrapper'>"); {
343 CX("<div id='pikchrshow-form'>"); {
344 CX("<textarea id='content' name='content' rows='15'>"
345 "%s</textarea>",zContent/*safe-for-%s*/);
346
--- src/style.fileedit.css
+++ src/style.fileedit.css
@@ -70,10 +70,13 @@
7070
body.fileedit #fileedit-tabs {
7171
margin: 0.5em 0 0 0;
7272
}
7373
body.fileedit #fileedit-tab-preview-wrapper {
7474
overflow: auto;
75
+}
76
+body.fileedit #fileedit-tab-preview-wrapper > pre {
77
+ margin: 0;
7578
}
7679
body.fileedit #fileedit-tab-fileselect > h1 {
7780
margin: 0;
7881
}
7982
body.fileedit .fileedit-options.commit-message > div {
8083
--- src/style.fileedit.css
+++ src/style.fileedit.css
@@ -70,10 +70,13 @@
70 body.fileedit #fileedit-tabs {
71 margin: 0.5em 0 0 0;
72 }
73 body.fileedit #fileedit-tab-preview-wrapper {
74 overflow: auto;
 
 
 
75 }
76 body.fileedit #fileedit-tab-fileselect > h1 {
77 margin: 0;
78 }
79 body.fileedit .fileedit-options.commit-message > div {
80
--- src/style.fileedit.css
+++ src/style.fileedit.css
@@ -70,10 +70,13 @@
70 body.fileedit #fileedit-tabs {
71 margin: 0.5em 0 0 0;
72 }
73 body.fileedit #fileedit-tab-preview-wrapper {
74 overflow: auto;
75 }
76 body.fileedit #fileedit-tab-preview-wrapper > pre {
77 margin: 0;
78 }
79 body.fileedit #fileedit-tab-fileselect > h1 {
80 margin: 0;
81 }
82 body.fileedit .fileedit-options.commit-message > div {
83
--- www/changes.wiki
+++ www/changes.wiki
@@ -45,10 +45,15 @@
4545
markdown features, instead of the prior small subset of markup it
4646
previously supported. This retroactively applies to all chat messages,
4747
as they are markdown-processed when they are sent instead of when they
4848
are saved. Added a preview mode so messages can be previewed before
4949
being sent. See [./chat.md#usage|the chat docs] for more details.
50
+ * The hotkey to activate preview mode in [/help?cmd=/wikiedit|/wikiedit],
51
+ [/help?cmd=/fileedit|/fileedit], and [/help?cmd=/pikchrshow|/pikchrshow]
52
+ was changed from ctrl-enter to shift-enter in order to align with
53
+ [/help?cmd=/chat|/chat]'s new preview feature and related future
54
+ changes.
5055
5156
<h2 id='v2_16'>Changes for Version 2.16 (2021-07-02)</h2>
5257
* <b>Security:</b> Fix the client-side TLS so that it verifies that the
5358
server hostname matches its certificate.
5459
* The default "ssh" command on Windows is changed to "ssh" instead of the
5560
--- www/changes.wiki
+++ www/changes.wiki
@@ -45,10 +45,15 @@
45 markdown features, instead of the prior small subset of markup it
46 previously supported. This retroactively applies to all chat messages,
47 as they are markdown-processed when they are sent instead of when they
48 are saved. Added a preview mode so messages can be previewed before
49 being sent. See [./chat.md#usage|the chat docs] for more details.
 
 
 
 
 
50
51 <h2 id='v2_16'>Changes for Version 2.16 (2021-07-02)</h2>
52 * <b>Security:</b> Fix the client-side TLS so that it verifies that the
53 server hostname matches its certificate.
54 * The default "ssh" command on Windows is changed to "ssh" instead of the
55
--- www/changes.wiki
+++ www/changes.wiki
@@ -45,10 +45,15 @@
45 markdown features, instead of the prior small subset of markup it
46 previously supported. This retroactively applies to all chat messages,
47 as they are markdown-processed when they are sent instead of when they
48 are saved. Added a preview mode so messages can be previewed before
49 being sent. See [./chat.md#usage|the chat docs] for more details.
50 * The hotkey to activate preview mode in [/help?cmd=/wikiedit|/wikiedit],
51 [/help?cmd=/fileedit|/fileedit], and [/help?cmd=/pikchrshow|/pikchrshow]
52 was changed from ctrl-enter to shift-enter in order to align with
53 [/help?cmd=/chat|/chat]'s new preview feature and related future
54 changes.
55
56 <h2 id='v2_16'>Changes for Version 2.16 (2021-07-02)</h2>
57 * <b>Security:</b> Fix the client-side TLS so that it verifies that the
58 server hostname matches its certificate.
59 * The default "ssh" command on Windows is changed to "ssh" instead of the
60

Keyboard Shortcuts

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