Fossil SCM
On Windows, forward the --jsmode option to individual HTTP requests.
Commit
1142db3091bbb7d2b6f5d21b581c66f910f017b07329df9076cf5d7ea43cc37d
Parent
d9bd5603ae59c98…
2 files changed
+13
+4
+13
| --- src/builtin.c | ||
| +++ src/builtin.c | ||
| @@ -267,10 +267,23 @@ | ||
| 267 | 267 | ** JS_SEPARATE, JS_BUNDLED. |
| 268 | 268 | */ |
| 269 | 269 | int builtin_get_js_delivery_mode(void){ |
| 270 | 270 | return builtin.eDelivery; |
| 271 | 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 | +} | |
| 272 | 285 | |
| 273 | 286 | /* |
| 274 | 287 | ** The caller wants the Javascript file named by zFilename to be |
| 275 | 288 | ** included in the generated page. Add the file to the queue of |
| 276 | 289 | ** requested javascript resources, if it is not there already. |
| 277 | 290 |
| --- 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 |
+4
| --- src/winhttp.c | ||
| +++ src/winhttp.c | ||
| @@ -616,10 +616,14 @@ | ||
| 616 | 616 | } |
| 617 | 617 | if( g.zMainMenuFile ){ |
| 618 | 618 | blob_appendf(&options, " --mainmenu "); |
| 619 | 619 | blob_append_escaped_arg(&options, g.zMainMenuFile, 1); |
| 620 | 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 | + } | |
| 621 | 625 | #if USE_SEE |
| 622 | 626 | zSavedKey = db_get_saved_encryption_key(); |
| 623 | 627 | savedKeySize = db_get_saved_encryption_key_size(); |
| 624 | 628 | if( zSavedKey!=0 && savedKeySize>0 ){ |
| 625 | 629 | blob_appendf(&options, " --usepidkey %lu:%p:%u", GetCurrentProcessId(), |
| 626 | 630 |
| --- 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 |