comparison src/c/urweb.c @ 695:500e93aa436f

sleep and better Scriptcheck
author Adam Chlipala <adamc@hcoop.net>
date Sat, 04 Apr 2009 15:56:47 -0400
parents 7ea0df9e56b6
children 79a49c509007
comparison
equal deleted inserted replaced
694:7ea0df9e56b6 695:500e93aa436f
691 691
692 const char *uw_Basis_get_script(uw_context ctx, uw_unit u) { 692 const char *uw_Basis_get_script(uw_context ctx, uw_unit u) {
693 if (ctx->script_header[0] == 0) 693 if (ctx->script_header[0] == 0)
694 return ""; 694 return "";
695 else { 695 else {
696 char *r = uw_malloc(ctx, strlen(ctx->script_header) + 18 + buf_used(&ctx->script)); 696 char *r = uw_malloc(ctx, strlen(ctx->script_header) + 42 + buf_used(&ctx->script));
697 sprintf(r, "%s<script>%s</script>", 697 sprintf(r, "%s<script type=\"text/javascript\">%s</script>",
698 ctx->script_header, 698 ctx->script_header,
699 ctx->script.start); 699 ctx->script.start);
700 return r;
701 }
702 }
703
704 uw_Basis_string uw_Basis_maybe_onload(uw_context ctx, uw_Basis_string s) {
705 if (s[0] == 0)
706 return "";
707 else {
708 char *r = uw_malloc(ctx, 11 + strlen(s));
709 sprintf(r, " onload='%s'", s);
700 return r; 710 return r;
701 } 711 }
702 } 712 }
703 713
704 const char *uw_Basis_get_settings(uw_context ctx, uw_unit u) { 714 const char *uw_Basis_get_settings(uw_context ctx, uw_unit u) {