Fossil SCM

Reduce the number of jsmode options to three: inline, separate, bundled.

drh 2020-07-31 21:32 refactor-js-handling
Commit 38f3d9785b372d5a518b6e1ea04a0b481115ab31fbd60c26091d7286f2706388
+27 -36
--- src/builtin.c
+++ src/builtin.c
@@ -224,15 +224,14 @@
224224
} builtin;
225225
226226
#if INTERFACE
227227
/* Various delivery mechanisms. The 0 option is the default.
228228
*/
229
-#define JS_INLINE_BATCH 0 /* inline, batched together */
230
-#define JS_INLINE_IMM 1 /* inline, as soon as requested */
231
-#define JS_SEP_BATCH 2 /* Separate resources, batched */
232
-#define JS_SEP_IMM 3 /* Separate resources, as requested */
233
-#define JS_BUNDLED 4 /* Single separate resource */
229
+#define JS_INLINE 0 /* inline, batched together at end of file */
230
+#define JS_SEPARATE 1 /* Separate HTTP request for each JS file */
231
+#define JS_BUNDLED 2 /* One HTTP request to load all JS files */
232
+ /* concatenated together into a bundle */
234233
#endif /* INTERFACE */
235234
236235
/*
237236
** The argument is a request to change the javascript delivery mode.
238237
** The argument is a string which is a command-line option or CGI
@@ -241,27 +240,20 @@
241240
** bSilent is true.
242241
*/
243242
void builtin_set_js_delivery_mode(const char *zMode, int bSilent){
244243
if( zMode==0 ) return;
245244
if( strcmp(zMode, "inline")==0 ){
246
- builtin.eDelivery = JS_INLINE_BATCH;
247
- }else
248
- if( strcmp(zMode, "inline-imm")==0 ){
249
- builtin.eDelivery = JS_INLINE_IMM;
250
- }else
251
- if( strcmp(zMode, "sep")==0 ){
252
- builtin.eDelivery = JS_SEP_BATCH;
253
- }else
254
- if( strcmp(zMode, "sep-imm")==0 ){
255
- builtin.eDelivery = JS_SEP_IMM;
245
+ builtin.eDelivery = JS_INLINE;
246
+ }else
247
+ if( strcmp(zMode, "separate")==0 ){
248
+ builtin.eDelivery = JS_SEPARATE;
256249
}else
257250
if( strcmp(zMode, "bundled")==0 ){
258251
builtin.eDelivery = JS_BUNDLED;
259252
}else if( !bSilent ){
260253
fossil_fatal("unknown javascript delivery mode \"%s\" - should be"
261
- " one of: inline inline-immediate separate"
262
- " separate-immediate bundled", zMode);
254
+ " one of: inline separate bundled", zMode);
263255
}
264256
}
265257
266258
/*
267259
** The caller wants the Javascript file named by zFilename to be
@@ -294,15 +286,10 @@
294286
}
295287
if( builtin.nReq>=count(builtin.aReq) ){
296288
fossil_panic("too many javascript files requested");
297289
}
298290
builtin.aReq[builtin.nReq++] = i;
299
- if( builtin.eDelivery==JS_INLINE_IMM
300
- || builtin.eDelivery==JS_SEP_IMM
301
- ){
302
- builtin_fulfill_js_requests();
303
- }
304291
}
305292
306293
/*
307294
** Fulfill all pending requests for javascript files.
308295
**
@@ -311,12 +298,11 @@
311298
** might choose to deliver javascript as separate resources.
312299
*/
313300
void builtin_fulfill_js_requests(void){
314301
if( builtin.nSent>=builtin.nReq ) return; /* nothing to do */
315302
switch( builtin.eDelivery ){
316
- case JS_INLINE_BATCH:
317
- case JS_INLINE_IMM: {
303
+ case JS_INLINE: {
318304
CX("<script nonce='%h'>\n",style_nonce());
319305
do{
320306
int i = builtin.aReq[builtin.nSent++];
321307
CX("/* %s */\n", aBuiltinFiles[i].zName);
322308
cgi_append_content((const char*)aBuiltinFiles[i].pData,
@@ -323,27 +309,32 @@
323309
aBuiltinFiles[i].nByte);
324310
}while( builtin.nSent<builtin.nReq );
325311
CX("</script>\n");
326312
break;
327313
}
328
- case JS_SEP_BATCH:
329
- case JS_SEP_IMM: {
314
+ case JS_BUNDLED: {
315
+ if( builtin.nSent+1<builtin.nReq ){
316
+ Blob aList;
317
+ blob_init(&aList,0,0);
318
+ while( builtin.nSent<builtin.nReq ){
319
+ blob_appendf(&aList, ",%d", builtin.aReq[builtin.nSent++]+1);
320
+ }
321
+ CX("<script src='%R/builtin?m=%s&id=%.8s'></script>\n",
322
+ blob_str(&aList)+1, fossil_exe_id());
323
+ blob_reset(&aList);
324
+ break;
325
+ }
326
+ /* If there is only one JS file, fall through into the
327
+ ** JS_SEPARATE case below. */
328
+ /*FALLTHROUGH*/
329
+ }
330
+ case JS_SEPARATE: {
330331
/* Each JS file as a separate resource */
331332
while( builtin.nSent<builtin.nReq ){
332333
int i = builtin.aReq[builtin.nSent++];
333334
CX("<script src='%R/builtin?name=%t&id=%.8s'></script>\n",
334335
aBuiltinFiles[i].zName, fossil_exe_id());
335336
}
336337
break;
337338
}
338
- case JS_BUNDLED: {
339
- Blob aList;
340
- blob_init(&aList,0,0);
341
- while( builtin.nSent<builtin.nReq ){
342
- blob_appendf(&aList, ",%d", builtin.aReq[builtin.nSent++]+1);
343
- }
344
- CX("<script src='%R/builtin?m=%s&id=%.8s'></script>\n",
345
- blob_str(&aList)+1, fossil_exe_id());
346
- blob_reset(&aList);
347
- }
348339
}
349340
}
350341
--- src/builtin.c
+++ src/builtin.c
@@ -224,15 +224,14 @@
224 } builtin;
225
226 #if INTERFACE
227 /* Various delivery mechanisms. The 0 option is the default.
228 */
229 #define JS_INLINE_BATCH 0 /* inline, batched together */
230 #define JS_INLINE_IMM 1 /* inline, as soon as requested */
231 #define JS_SEP_BATCH 2 /* Separate resources, batched */
232 #define JS_SEP_IMM 3 /* Separate resources, as requested */
233 #define JS_BUNDLED 4 /* Single separate resource */
234 #endif /* INTERFACE */
235
236 /*
237 ** The argument is a request to change the javascript delivery mode.
238 ** The argument is a string which is a command-line option or CGI
@@ -241,27 +240,20 @@
241 ** bSilent is true.
242 */
243 void builtin_set_js_delivery_mode(const char *zMode, int bSilent){
244 if( zMode==0 ) return;
245 if( strcmp(zMode, "inline")==0 ){
246 builtin.eDelivery = JS_INLINE_BATCH;
247 }else
248 if( strcmp(zMode, "inline-imm")==0 ){
249 builtin.eDelivery = JS_INLINE_IMM;
250 }else
251 if( strcmp(zMode, "sep")==0 ){
252 builtin.eDelivery = JS_SEP_BATCH;
253 }else
254 if( strcmp(zMode, "sep-imm")==0 ){
255 builtin.eDelivery = JS_SEP_IMM;
256 }else
257 if( strcmp(zMode, "bundled")==0 ){
258 builtin.eDelivery = JS_BUNDLED;
259 }else if( !bSilent ){
260 fossil_fatal("unknown javascript delivery mode \"%s\" - should be"
261 " one of: inline inline-immediate separate"
262 " separate-immediate bundled", zMode);
263 }
264 }
265
266 /*
267 ** The caller wants the Javascript file named by zFilename to be
@@ -294,15 +286,10 @@
294 }
295 if( builtin.nReq>=count(builtin.aReq) ){
296 fossil_panic("too many javascript files requested");
297 }
298 builtin.aReq[builtin.nReq++] = i;
299 if( builtin.eDelivery==JS_INLINE_IMM
300 || builtin.eDelivery==JS_SEP_IMM
301 ){
302 builtin_fulfill_js_requests();
303 }
304 }
305
306 /*
307 ** Fulfill all pending requests for javascript files.
308 **
@@ -311,12 +298,11 @@
311 ** might choose to deliver javascript as separate resources.
312 */
313 void builtin_fulfill_js_requests(void){
314 if( builtin.nSent>=builtin.nReq ) return; /* nothing to do */
315 switch( builtin.eDelivery ){
316 case JS_INLINE_BATCH:
317 case JS_INLINE_IMM: {
318 CX("<script nonce='%h'>\n",style_nonce());
319 do{
320 int i = builtin.aReq[builtin.nSent++];
321 CX("/* %s */\n", aBuiltinFiles[i].zName);
322 cgi_append_content((const char*)aBuiltinFiles[i].pData,
@@ -323,27 +309,32 @@
323 aBuiltinFiles[i].nByte);
324 }while( builtin.nSent<builtin.nReq );
325 CX("</script>\n");
326 break;
327 }
328 case JS_SEP_BATCH:
329 case JS_SEP_IMM: {
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
330 /* Each JS file as a separate resource */
331 while( builtin.nSent<builtin.nReq ){
332 int i = builtin.aReq[builtin.nSent++];
333 CX("<script src='%R/builtin?name=%t&id=%.8s'></script>\n",
334 aBuiltinFiles[i].zName, fossil_exe_id());
335 }
336 break;
337 }
338 case JS_BUNDLED: {
339 Blob aList;
340 blob_init(&aList,0,0);
341 while( builtin.nSent<builtin.nReq ){
342 blob_appendf(&aList, ",%d", builtin.aReq[builtin.nSent++]+1);
343 }
344 CX("<script src='%R/builtin?m=%s&id=%.8s'></script>\n",
345 blob_str(&aList)+1, fossil_exe_id());
346 blob_reset(&aList);
347 }
348 }
349 }
350
--- src/builtin.c
+++ src/builtin.c
@@ -224,15 +224,14 @@
224 } builtin;
225
226 #if INTERFACE
227 /* Various delivery mechanisms. The 0 option is the default.
228 */
229 #define JS_INLINE 0 /* inline, batched together at end of file */
230 #define JS_SEPARATE 1 /* Separate HTTP request for each JS file */
231 #define JS_BUNDLED 2 /* One HTTP request to load all JS files */
232 /* concatenated together into a bundle */
 
233 #endif /* INTERFACE */
234
235 /*
236 ** The argument is a request to change the javascript delivery mode.
237 ** The argument is a string which is a command-line option or CGI
@@ -241,27 +240,20 @@
240 ** bSilent is true.
241 */
242 void builtin_set_js_delivery_mode(const char *zMode, int bSilent){
243 if( zMode==0 ) return;
244 if( strcmp(zMode, "inline")==0 ){
245 builtin.eDelivery = JS_INLINE;
246 }else
247 if( strcmp(zMode, "separate")==0 ){
248 builtin.eDelivery = JS_SEPARATE;
 
 
 
 
 
 
249 }else
250 if( strcmp(zMode, "bundled")==0 ){
251 builtin.eDelivery = JS_BUNDLED;
252 }else if( !bSilent ){
253 fossil_fatal("unknown javascript delivery mode \"%s\" - should be"
254 " one of: inline separate bundled", zMode);
 
255 }
256 }
257
258 /*
259 ** The caller wants the Javascript file named by zFilename to be
@@ -294,15 +286,10 @@
286 }
287 if( builtin.nReq>=count(builtin.aReq) ){
288 fossil_panic("too many javascript files requested");
289 }
290 builtin.aReq[builtin.nReq++] = i;
 
 
 
 
 
291 }
292
293 /*
294 ** Fulfill all pending requests for javascript files.
295 **
@@ -311,12 +298,11 @@
298 ** might choose to deliver javascript as separate resources.
299 */
300 void builtin_fulfill_js_requests(void){
301 if( builtin.nSent>=builtin.nReq ) return; /* nothing to do */
302 switch( builtin.eDelivery ){
303 case JS_INLINE: {
 
304 CX("<script nonce='%h'>\n",style_nonce());
305 do{
306 int i = builtin.aReq[builtin.nSent++];
307 CX("/* %s */\n", aBuiltinFiles[i].zName);
308 cgi_append_content((const char*)aBuiltinFiles[i].pData,
@@ -323,27 +309,32 @@
309 aBuiltinFiles[i].nByte);
310 }while( builtin.nSent<builtin.nReq );
311 CX("</script>\n");
312 break;
313 }
314 case JS_BUNDLED: {
315 if( builtin.nSent+1<builtin.nReq ){
316 Blob aList;
317 blob_init(&aList,0,0);
318 while( builtin.nSent<builtin.nReq ){
319 blob_appendf(&aList, ",%d", builtin.aReq[builtin.nSent++]+1);
320 }
321 CX("<script src='%R/builtin?m=%s&id=%.8s'></script>\n",
322 blob_str(&aList)+1, fossil_exe_id());
323 blob_reset(&aList);
324 break;
325 }
326 /* If there is only one JS file, fall through into the
327 ** JS_SEPARATE case below. */
328 /*FALLTHROUGH*/
329 }
330 case JS_SEPARATE: {
331 /* Each JS file as a separate resource */
332 while( builtin.nSent<builtin.nReq ){
333 int i = builtin.aReq[builtin.nSent++];
334 CX("<script src='%R/builtin?name=%t&id=%.8s'></script>\n",
335 aBuiltinFiles[i].zName, fossil_exe_id());
336 }
337 break;
338 }
 
 
 
 
 
 
 
 
 
 
339 }
340 }
341
--- src/codecheck1.c
+++ src/codecheck1.c
@@ -407,11 +407,10 @@
407407
{ "smtp_send_line", 2, FMT_SAFE },
408408
{ "smtp_server_send", 2, FMT_SAFE },
409409
{ "socket_set_errmsg", 1, FMT_SAFE },
410410
{ "ssl_set_errmsg", 1, FMT_SAFE },
411411
{ "style_header", 1, FMT_HTML },
412
- { "style_js_onload", 1, FMT_HTML },
413412
{ "style_set_current_page", 1, FMT_URL },
414413
{ "style_submenu_element", 2, FMT_URL },
415414
{ "style_submenu_sql", 3, FMT_SQL },
416415
{ "webpage_error", 1, FMT_SAFE },
417416
{ "xhref", 2, FMT_URL },
418417
--- src/codecheck1.c
+++ src/codecheck1.c
@@ -407,11 +407,10 @@
407 { "smtp_send_line", 2, FMT_SAFE },
408 { "smtp_server_send", 2, FMT_SAFE },
409 { "socket_set_errmsg", 1, FMT_SAFE },
410 { "ssl_set_errmsg", 1, FMT_SAFE },
411 { "style_header", 1, FMT_HTML },
412 { "style_js_onload", 1, FMT_HTML },
413 { "style_set_current_page", 1, FMT_URL },
414 { "style_submenu_element", 2, FMT_URL },
415 { "style_submenu_sql", 3, FMT_SQL },
416 { "webpage_error", 1, FMT_SAFE },
417 { "xhref", 2, FMT_URL },
418
--- src/codecheck1.c
+++ src/codecheck1.c
@@ -407,11 +407,10 @@
407 { "smtp_send_line", 2, FMT_SAFE },
408 { "smtp_server_send", 2, FMT_SAFE },
409 { "socket_set_errmsg", 1, FMT_SAFE },
410 { "ssl_set_errmsg", 1, FMT_SAFE },
411 { "style_header", 1, FMT_HTML },
 
412 { "style_set_current_page", 1, FMT_URL },
413 { "style_submenu_element", 2, FMT_URL },
414 { "style_submenu_sql", 3, FMT_SQL },
415 { "webpage_error", 1, FMT_SAFE },
416 { "xhref", 2, FMT_URL },
417
+28 -7
--- src/main.c
+++ src/main.c
@@ -2270,10 +2270,23 @@
22702270
** this directive is a silent no-op.
22712271
*/
22722272
skin_use_alternative(blob_str(&value));
22732273
blob_reset(&value);
22742274
continue;
2275
+ }
2276
+ if( blob_eq(&key, "jsmode:") && blob_token(&line, &value) ){
2277
+ /* jsmode: MODE
2278
+ **
2279
+ ** Change how javascript resources are delivered with each HTML
2280
+ ** page. MODE is "inline" to put all JS inline, or "separate" to
2281
+ ** cause each JS file to be requested using a separate HTTP request,
2282
+ ** or "bundled" to have all JS files to be fetched with a single
2283
+ ** auxiliary HTTP request.
2284
+ */
2285
+ builtin_set_js_delivery_mode(blob_str(&value),0);
2286
+ blob_reset(&value);
2287
+ continue;
22752288
}
22762289
if( blob_eq(&key, "cgi-debug:") && blob_token(&line, &value) ){
22772290
/* cgi-debug: FILENAME
22782291
**
22792292
** Causes output from cgi_debug() and CGIDEBUG(()) calls to go
@@ -2455,10 +2468,18 @@
24552468
** --files GLOB comma-separate glob patterns for static file to serve
24562469
** --host NAME specify hostname of the server
24572470
** --https signal a request coming in via https
24582471
** --in FILE Take input from FILE instead of standard input
24592472
** --ipaddr ADDR Assume the request comes from the given IP address
2473
+** --jsmode MODE Determine how javascript is delivered with pages.
2474
+** Mode can be one of:
2475
+** inline All javascript is inserted inline at
2476
+** the end of the HTML file.
2477
+** separate Separate HTTP requests are made for
2478
+** each javascript file.
2479
+** bundled One single separate HTTP fetches all
2480
+** javascript concatenated together.
24602481
** --localauth enable automatic login for local connections
24612482
** --nocompress do not compress HTTP replies
24622483
** --nodelay omit backoffice processing if it would delay process exit
24632484
** --nojail drop root privilege but do not enter the chroot jail
24642485
** --nossl signal that no SSL connections are available
@@ -2484,10 +2505,11 @@
24842505
int useSCGI;
24852506
int noJail;
24862507
int allowRepoList;
24872508
24882509
Th_InitTraceLog();
2510
+ builtin_set_js_delivery_mode(find_option("jsmode",0,1),0);
24892511
24902512
/* The winhttp module passes the --files option as --files-urlenc with
24912513
** the argument being URL encoded, to avoid wildcard expansion in the
24922514
** shell. This option is for internal use and is undocumented.
24932515
*/
@@ -2716,17 +2738,16 @@
27162738
** --localhost listen on 127.0.0.1 only (always true for "ui")
27172739
** --https Indicates that the input is coming through a reverse
27182740
** proxy that has already translated HTTPS into HTTP.
27192741
** --jsmode MODE Determine how javascript is delivered with pages.
27202742
** Mode can be one of:
2721
-** inline JS inline at the end of the file
2722
-** inline-imm JS inline at point of need
2723
-** sep Separate HTTP requests for JS
2724
-** sep-imm Separate HTTP requests each issued
2725
-** at the need
2726
-** bundled One single separate HTTP for all
2727
-** JS resources
2743
+** inline All javascript is inserted inline at
2744
+** the end of the HTML file.
2745
+** separate Separate HTTP requests are made for
2746
+** each javascript file.
2747
+** bundled One single separate HTTP fetches all
2748
+** javascript concatenated together.
27282749
** --max-latency N Do not let any single HTTP request run for more than N
27292750
** seconds (only works on unix)
27302751
** --nocompress Do not compress HTTP replies
27312752
** --nojail Drop root privileges but do not enter the chroot jail
27322753
** --nossl signal that no SSL connections are available (Always
27332754
--- src/main.c
+++ src/main.c
@@ -2270,10 +2270,23 @@
2270 ** this directive is a silent no-op.
2271 */
2272 skin_use_alternative(blob_str(&value));
2273 blob_reset(&value);
2274 continue;
 
 
 
 
 
 
 
 
 
 
 
 
 
2275 }
2276 if( blob_eq(&key, "cgi-debug:") && blob_token(&line, &value) ){
2277 /* cgi-debug: FILENAME
2278 **
2279 ** Causes output from cgi_debug() and CGIDEBUG(()) calls to go
@@ -2455,10 +2468,18 @@
2455 ** --files GLOB comma-separate glob patterns for static file to serve
2456 ** --host NAME specify hostname of the server
2457 ** --https signal a request coming in via https
2458 ** --in FILE Take input from FILE instead of standard input
2459 ** --ipaddr ADDR Assume the request comes from the given IP address
 
 
 
 
 
 
 
 
2460 ** --localauth enable automatic login for local connections
2461 ** --nocompress do not compress HTTP replies
2462 ** --nodelay omit backoffice processing if it would delay process exit
2463 ** --nojail drop root privilege but do not enter the chroot jail
2464 ** --nossl signal that no SSL connections are available
@@ -2484,10 +2505,11 @@
2484 int useSCGI;
2485 int noJail;
2486 int allowRepoList;
2487
2488 Th_InitTraceLog();
 
2489
2490 /* The winhttp module passes the --files option as --files-urlenc with
2491 ** the argument being URL encoded, to avoid wildcard expansion in the
2492 ** shell. This option is for internal use and is undocumented.
2493 */
@@ -2716,17 +2738,16 @@
2716 ** --localhost listen on 127.0.0.1 only (always true for "ui")
2717 ** --https Indicates that the input is coming through a reverse
2718 ** proxy that has already translated HTTPS into HTTP.
2719 ** --jsmode MODE Determine how javascript is delivered with pages.
2720 ** Mode can be one of:
2721 ** inline JS inline at the end of the file
2722 ** inline-imm JS inline at point of need
2723 ** sep Separate HTTP requests for JS
2724 ** sep-imm Separate HTTP requests each issued
2725 ** at the need
2726 ** bundled One single separate HTTP for all
2727 ** JS resources
2728 ** --max-latency N Do not let any single HTTP request run for more than N
2729 ** seconds (only works on unix)
2730 ** --nocompress Do not compress HTTP replies
2731 ** --nojail Drop root privileges but do not enter the chroot jail
2732 ** --nossl signal that no SSL connections are available (Always
2733
--- src/main.c
+++ src/main.c
@@ -2270,10 +2270,23 @@
2270 ** this directive is a silent no-op.
2271 */
2272 skin_use_alternative(blob_str(&value));
2273 blob_reset(&value);
2274 continue;
2275 }
2276 if( blob_eq(&key, "jsmode:") && blob_token(&line, &value) ){
2277 /* jsmode: MODE
2278 **
2279 ** Change how javascript resources are delivered with each HTML
2280 ** page. MODE is "inline" to put all JS inline, or "separate" to
2281 ** cause each JS file to be requested using a separate HTTP request,
2282 ** or "bundled" to have all JS files to be fetched with a single
2283 ** auxiliary HTTP request.
2284 */
2285 builtin_set_js_delivery_mode(blob_str(&value),0);
2286 blob_reset(&value);
2287 continue;
2288 }
2289 if( blob_eq(&key, "cgi-debug:") && blob_token(&line, &value) ){
2290 /* cgi-debug: FILENAME
2291 **
2292 ** Causes output from cgi_debug() and CGIDEBUG(()) calls to go
@@ -2455,10 +2468,18 @@
2468 ** --files GLOB comma-separate glob patterns for static file to serve
2469 ** --host NAME specify hostname of the server
2470 ** --https signal a request coming in via https
2471 ** --in FILE Take input from FILE instead of standard input
2472 ** --ipaddr ADDR Assume the request comes from the given IP address
2473 ** --jsmode MODE Determine how javascript is delivered with pages.
2474 ** Mode can be one of:
2475 ** inline All javascript is inserted inline at
2476 ** the end of the HTML file.
2477 ** separate Separate HTTP requests are made for
2478 ** each javascript file.
2479 ** bundled One single separate HTTP fetches all
2480 ** javascript concatenated together.
2481 ** --localauth enable automatic login for local connections
2482 ** --nocompress do not compress HTTP replies
2483 ** --nodelay omit backoffice processing if it would delay process exit
2484 ** --nojail drop root privilege but do not enter the chroot jail
2485 ** --nossl signal that no SSL connections are available
@@ -2484,10 +2505,11 @@
2505 int useSCGI;
2506 int noJail;
2507 int allowRepoList;
2508
2509 Th_InitTraceLog();
2510 builtin_set_js_delivery_mode(find_option("jsmode",0,1),0);
2511
2512 /* The winhttp module passes the --files option as --files-urlenc with
2513 ** the argument being URL encoded, to avoid wildcard expansion in the
2514 ** shell. This option is for internal use and is undocumented.
2515 */
@@ -2716,17 +2738,16 @@
2738 ** --localhost listen on 127.0.0.1 only (always true for "ui")
2739 ** --https Indicates that the input is coming through a reverse
2740 ** proxy that has already translated HTTPS into HTTP.
2741 ** --jsmode MODE Determine how javascript is delivered with pages.
2742 ** Mode can be one of:
2743 ** inline All javascript is inserted inline at
2744 ** the end of the HTML file.
2745 ** separate Separate HTTP requests are made for
2746 ** each javascript file.
2747 ** bundled One single separate HTTP fetches all
2748 ** javascript concatenated together.
 
2749 ** --max-latency N Do not let any single HTTP request run for more than N
2750 ** seconds (only works on unix)
2751 ** --nocompress Do not compress HTTP replies
2752 ** --nojail Drop root privileges but do not enter the chroot jail
2753 ** --nossl signal that no SSL connections are available (Always
2754
-10
--- src/style.c
+++ src/style.c
@@ -721,20 +721,10 @@
721721
}
722722
@ </script>
723723
builtin_fulfill_js_requests();
724724
}
725725
726
-/*
727
-** Extra JS to run after all content is loaded.
728
-*/
729
-void style_js_onload(const char *zFormat, ...){
730
- va_list ap;
731
- va_start(ap, zFormat);
732
- blob_vappendf(&blobOnLoad, zFormat, ap);
733
- va_end(ap);
734
-}
735
-
736726
/*
737727
** Draw the footer at the bottom of the page.
738728
*/
739729
void style_footer(void){
740730
const char *zFooter;
741731
--- src/style.c
+++ src/style.c
@@ -721,20 +721,10 @@
721 }
722 @ </script>
723 builtin_fulfill_js_requests();
724 }
725
726 /*
727 ** Extra JS to run after all content is loaded.
728 */
729 void style_js_onload(const char *zFormat, ...){
730 va_list ap;
731 va_start(ap, zFormat);
732 blob_vappendf(&blobOnLoad, zFormat, ap);
733 va_end(ap);
734 }
735
736 /*
737 ** Draw the footer at the bottom of the page.
738 */
739 void style_footer(void){
740 const char *zFooter;
741
--- src/style.c
+++ src/style.c
@@ -721,20 +721,10 @@
721 }
722 @ </script>
723 builtin_fulfill_js_requests();
724 }
725
 
 
 
 
 
 
 
 
 
 
726 /*
727 ** Draw the footer at the bottom of the page.
728 */
729 void style_footer(void){
730 const char *zFooter;
731

Keyboard Shortcuts

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