Fossil

Check-in [139db4c5]
Login

Many hyperlinks are disabled.
Use anonymous login to enable hyperlinks.

Overview
Comment:Fix caching for bundled access to /builtin. Add a missing semicolon to the end of graph.js.
Downloads: Tarball | ZIP archive
Timelines: family | ancestors | descendants | both | trunk
Files: files | file ages | folders
SHA3-256: 139db4c54e0b42d72dce66e391fa5b421e60d0e343c36ea4734260c77334f769
User & Date: drh 2020-07-31 23:54:54.361
Context
2020-08-01
04:30
Remove an unused variable in mkindex.c ... (check-in: bf198442 user: ashepilko tags: trunk)
2020-07-31
23:54
Fix caching for bundled access to /builtin. Add a missing semicolon to the end of graph.js. ... (check-in: 139db4c5 user: drh tags: trunk)
22:04
Simplify the internal interfaces used for injecting built-in Javascript files onto a web page. ... (check-in: 036a9d5c user: drh tags: trunk)
Changes
Unified Diff Ignore Whitespace Patch
Changes to src/builtin.c.
142
143
144
145
146
147
148

149
150
151
152
153
154
155
  Blob *pOut;
  if( zType==0 ) zType = "application/javascript";
  cgi_set_content_type(zType);
  pOut = cgi_output_blob();
  while( zList[0] ){
    int i = atoi(zList);
    if( i>0 && i<=count(aBuiltinFiles) ){

      blob_append(pOut, (const char*)aBuiltinFiles[i-1].pData,
                  aBuiltinFiles[i-1].nByte);
    }
    while( fossil_isdigit(zList[0]) ) zList++;
    if( zList[0]==',' ) zList++;
  }
  return;







>







142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
  Blob *pOut;
  if( zType==0 ) zType = "application/javascript";
  cgi_set_content_type(zType);
  pOut = cgi_output_blob();
  while( zList[0] ){
    int i = atoi(zList);
    if( i>0 && i<=count(aBuiltinFiles) ){
      blob_appendf(pOut, "/* %s */\n", aBuiltinFiles[i-1].zName);
      blob_append(pOut, (const char*)aBuiltinFiles[i-1].pData,
                  aBuiltinFiles[i-1].nByte);
    }
    while( fossil_isdigit(zList[0]) ) zList++;
    if( zList[0]==',' ) zList++;
  }
  return;
183
184
185
186
187
188
189







190
191
192
193
194
195
196
  const char *zId = P("id");
  const char *zType = P("mimetype");
  int nId;
  if( zName ) zTxt = builtin_text(zName);
  if( zTxt==0 ){
    const char *zM = P("m");
    if( zM ){







      builtin_deliver_multiple_js_files(zM, zType);
      return;
    }
    cgi_set_status(404, "Not Found");
    @ File "%h(zName)" not found
    return;
  }







>
>
>
>
>
>
>







184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
  const char *zId = P("id");
  const char *zType = P("mimetype");
  int nId;
  if( zName ) zTxt = builtin_text(zName);
  if( zTxt==0 ){
    const char *zM = P("m");
    if( zM ){
      if( zId && (nId = (int)strlen(zId))>=8
       && strncmp(zId,fossil_exe_id(),nId)==0
      ){
        g.isConst = 1;
      }else{
        etag_check(0,0);
      }
      builtin_deliver_multiple_js_files(zM, zType);
      return;
    }
    cgi_set_status(404, "Not Found");
    @ File "%h(zName)" not found
    return;
  }
Changes to src/graph.js.
777
778
779
780
781
782
783
784
  for(i=0; 1; i++){
    var dataObj = document.getElementById("timeline-data-"+i);
    if(!dataObj) break;
    var txJson = dataObj.textContent || dataObj.innerText;
    var tx = JSON.parse(txJson);
    TimelineGraph(tx);
  }
}())







|
777
778
779
780
781
782
783
784
  for(i=0; 1; i++){
    var dataObj = document.getElementById("timeline-data-"+i);
    if(!dataObj) break;
    var txJson = dataObj.textContent || dataObj.innerText;
    var tx = JSON.parse(txJson);
    TimelineGraph(tx);
  }
}());