Fossil

Diff
Login

Diff

Differences From Artifact [d7490c0d31]:

To Artifact [7ab8e45630]:


1584
1585
1586
1587
1588
1589
1590
1591
1592



1593
1594
1595
1596

1597
1598
1599

1600
1601

1602
1603
1604
1605
1606
1607
1608
1584
1585
1586
1587
1588
1589
1590


1591
1592
1593
1594
1595
1596

1597
1598
1599

1600
1601

1602
1603
1604
1605
1606
1607
1608
1609







-
-
+
+
+



-
+


-
+

-
+







*/
void style_emit_script_builtin(int asInline, char const * zName){
  if(asInline){
    style_emit_script_tag(0,0);
    CX("%s", builtin_text(zName));
    style_emit_script_tag(1,0);
  }else{
    char * zFull = mprintf("builtin/%s",zName);
    const char * zBuiltin = builtin_text(zName);
    char * zFullName = mprintf("builtin/%s",zName);
    int nLen = 0;
    const char * zBuiltin = (const char *)builtin_file(zName, &nLen);
    const char * zHash = 0;
    if(zBuiltin!=0){
      md5sum_init();
      md5sum_step_text(zBuiltin,-1);
      md5sum_step_text(zBuiltin,nLen);
      zHash = md5sum_finish(0);
    }
    CX("<script src='%R/%T?cache=%.8s'></script>\n",zFull,
    CX("<script src='%R/%T?cache=%.8s'></script>\n",zFullName,
       zHash ? zHash : "MISSING");
    fossil_free(zFull);
    fossil_free(zFullName);
  }
}

/*
** The first time this is called it emits the JS code from the
** built-in file fossil.fossil.js. Subsequent calls are no-ops.
**