515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
|
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
|
-
+
|
return 0;
}
/*
** Generate code to load a single javascript file
*/
static void style_load_one_js_file(const char *zFile){
@ <script src='%R/builtin/%s(zFile)/%S(MANIFEST_UUID)'></script>
@ <script src='%R/builtin/%s(zFile)?id=%S(MANIFEST_UUID)'></script>
}
/*
** Generate code to load all required javascript files.
*/
static void style_load_all_js_files(void){
if( needHrefJs ){
|
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
|
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
|
-
+
-
-
-
-
-
-
-
-
-
-
-
-
-
-
+
-
|
/* Tell CGI that the content returned by this page is considered cacheable */
g.isConst = 1;
}
/*
** WEBPAGE: builtin
** URL: builtin/FILENAME/VERSION
** URL: builtin/FILENAME
**
** Return the built-in text given by FILENAME. This is used internally
** by many Fossil web pages to load built-in javascript files.
**
** The VERSION string at the end is ignored. Fossil web pages will
** typically put the current Fossil check-in hash as VERSION, to cause
** javascript files to be reloaded rather than sourcing a stale javascript
** file from cache.
*/
void page_builtin_text(void){
Blob out;
const char *zName = P("name");
const char *zTxt = 0;
if( zName ){
int i;
for(i=0; zName[i]; i++){
if( zName[i]=='/' ){
zName = mprintf("%.*s", i, zName);
break;
}
}
zTxt = builtin_text(zName);
if( zName ) zTxt = builtin_text(zName);
}
if( zTxt==0 ){
cgi_set_status(404, "Not Found");
@ File \"%h(zName)\" not found
return;
}
if( sqlite3_strglob("*.js", zName)==0 ){
cgi_set_content_type("application/javascript");
|