diff options
author | Jorge Arellano Cid <jcid@dillo.org> | 2015-05-27 11:07:04 -0300 |
---|---|---|
committer | Jorge Arellano Cid <jcid@dillo.org> | 2015-05-27 11:07:04 -0300 |
commit | af2f4800e97d5f9ae3a43062cdac0425362cccba (patch) | |
tree | 8a10f4263780b0f86e7fa18b7d1ce14dd5dfdf65 | |
parent | 3240d7de54558ba7c91abe346f2420377c8ce685 (diff) |
Made view-source dpi use CSS formatting (it's shorter and cleaner)
BTW, is there a point in using a monospaced font?
Besides it looks like code printing (which is good),
a proportional-spaced font may be easier to read.
-rw-r--r-- | ChangeLog | 1 | ||||
-rw-r--r-- | dpi/vsource.c | 14 |
2 files changed, 8 insertions, 7 deletions
@@ -26,6 +26,7 @@ dillo-3.1 [not released yet] +- Image buffer/cache improvements. - Fix for segfault when there's no dpid and view source is requested. - Fix view-source dpi to handle null characters correctly. + - Made view-source dpi use CSS formatting (it's shorter and cleaner). Patches: Jorge Arellano Cid +- Crosscompile/buildroot-friendly fltk-config test. Patch: Peter Seiderer diff --git a/dpi/vsource.c b/dpi/vsource.c index c28e7b49..9d5694b5 100644 --- a/dpi/vsource.c +++ b/dpi/vsource.c @@ -118,7 +118,10 @@ void send_html_text(Dsh *sh, const char *url, int data_size) "\n" "<html><head>\n" "<title>Source for %s</title>\n" - "<style type=\"text/css\">PRE {white-space: pre-wrap}\n" + "<style type=\"text/css\">\n" + " body {white-space: pre-wrap; font-family: monospace}\n" + " td.r1 {background-color:#B87333}\n" + " td.r2 {background-color:#DD7F32}\n" "</style>\n" "</head>\n" "<body id=\"dillo_vs\">\n<table cellpadding='0'>\n", url); @@ -131,10 +134,9 @@ void send_html_text(Dsh *sh, const char *url, int data_size) while (*p) { if (line > old_line) { snprintf(line_str, 128, - "%s<tr><td bgcolor='%s'>%d%s<td><pre>", - (line > 1) ? "</pre>" : "", - (line & 1) ? "#B87333" : "#DD7F32", line, - (line == 1 || (line % 10) == 0) ? " " : ""); + "<tr><td class='%s'>%d%s<td>", + (line & 1) ? "r1" : "r2", line, + (line == 1 || (line % 10) == 0) ? " " : ""); a_Dpip_dsh_write_str(sh, 0, line_str); old_line = line; } @@ -158,8 +160,6 @@ void send_html_text(Dsh *sh, const char *url, int data_size) dFree(token); } - if (data_size > 0) - a_Dpip_dsh_write_str(sh, 0, "</pre>"); a_Dpip_dsh_write_str(sh, 1, "</table></body></html>"); } |