mirror of
https://github.com/netsurf-browser/netsurf
synced 2025-01-03 17:54:33 +03:00
More work on about:imagecache entry listing table.
svn path=/trunk/netsurf/; revision=13855
This commit is contained in:
parent
e2e69d29bb
commit
cdee9e985e
@ -181,24 +181,28 @@ body#configlist .null-content {
|
|||||||
* about:imagecache
|
* about:imagecache
|
||||||
*/
|
*/
|
||||||
|
|
||||||
table.imagecachelist {
|
p.imagecachelist {
|
||||||
border-spacing: 0px;
|
border-spacing: 0px;
|
||||||
margin-top: 1.2em;
|
margin-top: 1.2em;
|
||||||
margin-bottom: 1.2em;
|
margin-bottom: 1.2em;
|
||||||
|
display: table;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.imagecachelist tr:nth-child(2n+3) {
|
p.imagecachelist a:nth-child(2n+3) {
|
||||||
background: #e8edff;
|
background: #e8edff;
|
||||||
}
|
}
|
||||||
|
|
||||||
table.imagecachelist th {
|
p.imagecachelist strong, p.imagecachelist a {
|
||||||
|
display: table-row;
|
||||||
|
}
|
||||||
|
|
||||||
|
p.imagecachelist strong span {
|
||||||
background: #c8d5ff;
|
background: #c8d5ff;
|
||||||
padding: 2px;
|
|
||||||
text-align: left;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
table.imagecachelist td {
|
p.imagecachelist span {
|
||||||
border-top: 1px solid #bcf;
|
border-top: 1px solid #bcf;
|
||||||
padding: 2px;
|
padding: 2px 0.5em;
|
||||||
|
display: table-cell;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -242,29 +242,30 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
|
|||||||
|
|
||||||
/* image cache entry table */
|
/* image cache entry table */
|
||||||
slen = snprintf(buffer, sizeof buffer,
|
slen = snprintf(buffer, sizeof buffer,
|
||||||
"<table class=\"imagecachelist\">\n"
|
"<p class=\"imagecachelist\">\n"
|
||||||
"<tr>"
|
"<strong>"
|
||||||
"<th>Entry</th>"
|
"<span>Entry</span>"
|
||||||
"<th>Content Key</th>"
|
"<span>Content Key</span>"
|
||||||
"<th>Redraw<br>Count</th>"
|
"<span>Redraw Count</span>"
|
||||||
"<th>Conversion<br>Count</th>"
|
"<span>Conversion Count</span>"
|
||||||
"<th>Last Redraw</th>"
|
"<span>Last Redraw</span>"
|
||||||
"<th>Bitmap Age</th>"
|
"<span>Bitmap Age</span>"
|
||||||
"<th>Bitmap Size</th>"
|
"<span>Bitmap Size</span>"
|
||||||
"<th>Source URL</th>"
|
"<span>Source</span>"
|
||||||
"</tr>\n");
|
"</strong>\n");
|
||||||
do {
|
do {
|
||||||
res = image_cache_snentryf(buffer + slen, sizeof buffer - slen,
|
res = image_cache_snentryf(buffer + slen, sizeof buffer - slen,
|
||||||
cent_loop,
|
cent_loop,
|
||||||
"<tr><td>%e</td>"
|
"<a href=\"%U\">"
|
||||||
"<td>%k</td>"
|
"<span>%e</span>"
|
||||||
"<td>%r</td>"
|
"<span>%k</span>"
|
||||||
"<td>%c</td>"
|
"<span>%r</span>"
|
||||||
"<td>%a</td>"
|
"<span>%c</span>"
|
||||||
"<td>%g</td>"
|
"<span>%a</span>"
|
||||||
"<td>%s</td>"
|
"<span>%g</span>"
|
||||||
"<td><a href=\"%U\">%U</a></td>"
|
"<span>%s</span>"
|
||||||
"</tr>\n");
|
"<span>%o</span>"
|
||||||
|
"</a>\n");
|
||||||
if (res <= 0)
|
if (res <= 0)
|
||||||
break; /* last option */
|
break; /* last option */
|
||||||
|
|
||||||
@ -282,7 +283,7 @@ static bool fetch_about_imagecache_handler(struct fetch_about_context *ctx)
|
|||||||
} while (res > 0);
|
} while (res > 0);
|
||||||
|
|
||||||
slen += snprintf(buffer + slen, sizeof buffer - slen,
|
slen += snprintf(buffer + slen, sizeof buffer - slen,
|
||||||
"</table>\n</body>\n</html>\n");
|
"</p>\n</body>\n</html>\n");
|
||||||
|
|
||||||
msg.data.header_or_data.len = slen;
|
msg.data.header_or_data.len = slen;
|
||||||
if (fetch_about_send_callback(&msg, ctx))
|
if (fetch_about_send_callback(&msg, ctx))
|
||||||
|
@ -637,6 +637,7 @@ int image_cache_snentryf(char *string, size_t size, unsigned int entryn,
|
|||||||
struct image_cache_entry_s *centry;
|
struct image_cache_entry_s *centry;
|
||||||
size_t slen = 0; /* current output string length */
|
size_t slen = 0; /* current output string length */
|
||||||
int fmtc = 0; /* current index into format string */
|
int fmtc = 0; /* current index into format string */
|
||||||
|
lwc_string *origin; /* current entry's origin */
|
||||||
|
|
||||||
centry = image_cache__findn(entryn);
|
centry = image_cache__findn(entryn);
|
||||||
if (centry == NULL)
|
if (centry == NULL)
|
||||||
@ -682,6 +683,29 @@ int image_cache_snentryf(char *string, size_t size, unsigned int entryn,
|
|||||||
"%s", nsurl_access(llcache_handle_get_url(centry->content->llcache)));
|
"%s", nsurl_access(llcache_handle_get_url(centry->content->llcache)));
|
||||||
break;
|
break;
|
||||||
|
|
||||||
|
case 'o':
|
||||||
|
if (nsurl_has_component(llcache_handle_get_url(
|
||||||
|
centry->content->llcache),
|
||||||
|
NSURL_HOST)) {
|
||||||
|
origin = nsurl_get_component(
|
||||||
|
llcache_handle_get_url(
|
||||||
|
centry->content->
|
||||||
|
llcache),
|
||||||
|
NSURL_HOST);
|
||||||
|
|
||||||
|
slen += snprintf(string + slen,
|
||||||
|
size - slen, "%s",
|
||||||
|
lwc_string_data(
|
||||||
|
origin));
|
||||||
|
|
||||||
|
lwc_string_unref(origin);
|
||||||
|
} else {
|
||||||
|
slen += snprintf(string + slen,
|
||||||
|
size - slen, "%s",
|
||||||
|
"localhost");
|
||||||
|
}
|
||||||
|
break;
|
||||||
|
|
||||||
case 's':
|
case 's':
|
||||||
if (centry->bitmap != NULL) {
|
if (centry->bitmap != NULL) {
|
||||||
slen += snprintf(string + slen,
|
slen += snprintf(string + slen,
|
||||||
|
Loading…
Reference in New Issue
Block a user