Fossil SCM

On Windows, forward the --jsmode option to individual HTTP requests.

florian 2022-06-14 06:58 trunk
Commit 1142db3091bbb7d2b6f5d21b581c66f910f017b07329df9076cf5d7ea43cc37d
--- src/builtin.c
+++ src/builtin.c
@@ -267,10 +267,23 @@
267267
** JS_SEPARATE, JS_BUNDLED.
268268
*/
269269
int builtin_get_js_delivery_mode(void){
270270
return builtin.eDelivery;
271271
}
272
+
273
+/*
274
+** Returns the name of the current JS delivery mode for reuse with the --jsmode
275
+** option, i.e. the other way around than builtin_set_js_delivery_mode().
276
+*/
277
+const char *builtin_get_js_delivery_mode_name(void){
278
+ switch( builtin.eDelivery ){
279
+ case JS_INLINE: return "inline";
280
+ case JS_BUNDLED: return "bundled";
281
+ case JS_SEPARATE: return "separate";
282
+ }
283
+ return ""; /* builtin_set_js_delivery_mode() handles invalid names. */
284
+}
272285
273286
/*
274287
** The caller wants the Javascript file named by zFilename to be
275288
** included in the generated page. Add the file to the queue of
276289
** requested javascript resources, if it is not there already.
277290
--- src/builtin.c
+++ src/builtin.c
@@ -267,10 +267,23 @@
267 ** JS_SEPARATE, JS_BUNDLED.
268 */
269 int builtin_get_js_delivery_mode(void){
270 return builtin.eDelivery;
271 }
 
 
 
 
 
 
 
 
 
 
 
 
 
272
273 /*
274 ** The caller wants the Javascript file named by zFilename to be
275 ** included in the generated page. Add the file to the queue of
276 ** requested javascript resources, if it is not there already.
277
--- src/builtin.c
+++ src/builtin.c
@@ -267,10 +267,23 @@
267 ** JS_SEPARATE, JS_BUNDLED.
268 */
269 int builtin_get_js_delivery_mode(void){
270 return builtin.eDelivery;
271 }
272
273 /*
274 ** Returns the name of the current JS delivery mode for reuse with the --jsmode
275 ** option, i.e. the other way around than builtin_set_js_delivery_mode().
276 */
277 const char *builtin_get_js_delivery_mode_name(void){
278 switch( builtin.eDelivery ){
279 case JS_INLINE: return "inline";
280 case JS_BUNDLED: return "bundled";
281 case JS_SEPARATE: return "separate";
282 }
283 return ""; /* builtin_set_js_delivery_mode() handles invalid names. */
284 }
285
286 /*
287 ** The caller wants the Javascript file named by zFilename to be
288 ** included in the generated page. Add the file to the queue of
289 ** requested javascript resources, if it is not there already.
290
--- src/winhttp.c
+++ src/winhttp.c
@@ -616,10 +616,14 @@
616616
}
617617
if( g.zMainMenuFile ){
618618
blob_appendf(&options, " --mainmenu ");
619619
blob_append_escaped_arg(&options, g.zMainMenuFile, 1);
620620
}
621
+ if( builtin_get_js_delivery_mode()!=0 /* JS_INLINE==0 may change? */ ){
622
+ blob_appendf(&options, " --jsmode ");
623
+ blob_append_escaped_arg(&options, builtin_get_js_delivery_mode_name(), 0);
624
+ }
621625
#if USE_SEE
622626
zSavedKey = db_get_saved_encryption_key();
623627
savedKeySize = db_get_saved_encryption_key_size();
624628
if( zSavedKey!=0 && savedKeySize>0 ){
625629
blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(),
626630
--- src/winhttp.c
+++ src/winhttp.c
@@ -616,10 +616,14 @@
616 }
617 if( g.zMainMenuFile ){
618 blob_appendf(&options, " --mainmenu ");
619 blob_append_escaped_arg(&options, g.zMainMenuFile, 1);
620 }
 
 
 
 
621 #if USE_SEE
622 zSavedKey = db_get_saved_encryption_key();
623 savedKeySize = db_get_saved_encryption_key_size();
624 if( zSavedKey!=0 && savedKeySize>0 ){
625 blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(),
626
--- src/winhttp.c
+++ src/winhttp.c
@@ -616,10 +616,14 @@
616 }
617 if( g.zMainMenuFile ){
618 blob_appendf(&options, " --mainmenu ");
619 blob_append_escaped_arg(&options, g.zMainMenuFile, 1);
620 }
621 if( builtin_get_js_delivery_mode()!=0 /* JS_INLINE==0 may change? */ ){
622 blob_appendf(&options, " --jsmode ");
623 blob_append_escaped_arg(&options, builtin_get_js_delivery_mode_name(), 0);
624 }
625 #if USE_SEE
626 zSavedKey = db_get_saved_encryption_key();
627 savedKeySize = db_get_saved_encryption_key_size();
628 if( zSavedKey!=0 && savedKeySize>0 ){
629 blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(),
630

Keyboard Shortcuts

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