From c5ec364d23f9db99f51f51ca62565cfb1392d268 Mon Sep 17 00:00:00 2001 From: Fumitoshi UKAI Date: Fri, 10 Jan 2003 16:58:30 +0000 Subject: [w3m-dev 03631] display current form item * form.c (form2str): rewrite * istream.c (ssl_get_certificate): fix typo * map.c (follow_map_panel): valign=top (append_map_info): valign=top (append_link_info): valign=top (append_frame_info): html_quote ssl_certificate (page_info_panel): rewrite, html_quote From: Hironori SAKAMOTO --- map.c | 122 ++++++++++++++++++++++++++++++------------------------------------ 1 file changed, 55 insertions(+), 67 deletions(-) (limited to 'map.c') diff --git a/map.c b/map.c index 9d9f603..941f2a7 100644 --- a/map.c +++ b/map.c @@ -1,4 +1,4 @@ -/* $Id: map.c,v 1.22 2002/12/13 02:19:01 ukai Exp $ */ +/* $Id: map.c,v 1.23 2003/01/10 16:58:31 ukai Exp $ */ /* * client-side image maps */ @@ -271,7 +271,7 @@ follow_map_panel(Buffer *buf, char *name) continue; parseURL2(a->url, &pu, baseURL(buf)); url = html_quote(parsedURL2Str(&pu)->ptr); - Strcat_m_charp(mappage, "", + Strcat_m_charp(mappage, "", html_quote(*a->alt ? a->alt : mybasename(a->url)), "", url, NULL); } @@ -392,15 +392,17 @@ append_map_info(Buffer *buf, Str tmp, FormItemList *fi) if (ml == NULL) return; - Strcat_charp(tmp, "Links of current image map"); - Strcat_charp(tmp, ""); + Strcat_m_charp(tmp, + "
Links of current image map", + "
", NULL); for (al = ml->area->first; al != NULL; al = al->next) { a = (MapArea *) al->ptr; if (!a) continue; parseURL2(a->url, &pu, baseURL(buf)); url = html_quote(parsedURL2Str(&pu)->ptr); - Strcat_m_charp(tmp, "
  ", + Strcat_m_charp(tmp, "
  ", html_quote(*a->alt ? a->alt : mybasename(a->url)), "", html_quote(a->url), "\n", NULL); } @@ -418,8 +420,7 @@ append_link_info(Buffer *buf, Str html, LinkList * link) if (!link) return; - Strcat_charp(html, "

Link information

"); - Strcat_charp(html, "\n"); + Strcat_charp(html, "

Link information

\n"); for (l = link; l; l = l->next) { if (l->url) { parseURL2(l->url, &pu, baseURL(buf)); @@ -427,20 +428,20 @@ append_link_info(Buffer *buf, Str html, LinkList * link) } else url = "(empty)"; - Strcat_m_charp(html, "
", - l->title ? html_quote(l->title) : "(empty)", "", + Strcat_m_charp(html, "
", + l->title ? html_quote(l->title) : "(empty)", "", NULL); if (l->type == LINK_TYPE_REL) Strcat_charp(html, "[Rel]"); else if (l->type == LINK_TYPE_REV) Strcat_charp(html, "[Rev]"); - Strcat_m_charp(html, "", l->url ? html_quote(l->url) : "(empty)", + Strcat_m_charp(html, "", l->url ? html_quote(l->url) : "(empty)", NULL); if (l->ctype) Strcat_m_charp(html, " (", html_quote(l->ctype), ")", NULL); Strcat_charp(html, "\n"); } - Strcat_charp(html, "
\n"); + Strcat_charp(html, "
\n"); } /* append frame URL */ @@ -461,12 +462,11 @@ append_frame_info(Buffer *buf, Str html, struct frameset *set, int level) case F_BODY: if (frame.body->url == NULL) break; + Strcat_charp(html, ""); for (j = 0; j < level; j++) Strcat_charp(html, " "); q = html_quote(frame.body->url); - Strcat_charp(html, ""); + Strcat_m_charp(html, "", NULL); if (frame.body->name) { p = file_unquote(frame.body->name); #ifdef JP_CHARSET @@ -475,13 +475,11 @@ append_frame_info(Buffer *buf, Str html, struct frameset *set, int level) p = html_quote(p); Strcat_charp(html, p); } - Strcat_charp(html, " "); - Strcat_charp(html, q); - Strcat_charp(html, "\n"); + Strcat_m_charp(html, " ", q, "
\n", NULL); #ifdef USE_SSL if (frame.body->ssl_certificate) - Strcat_m_charp(html, "
\n",
-				   frame.body->ssl_certificate,
+		    Strcat_m_charp(html, "

SSL certificate

\n",
+				   html_quote(frame.body->ssl_certificate),
 				   "
\n", NULL); #endif break; @@ -507,34 +505,33 @@ page_info_panel(Buffer *buf) struct frameset *f_set = NULL; int all; - Strcat_charp(tmp, - "Information about current page"); - Strcat_charp(tmp, - "

Information about current page

"); + Strcat_charp(tmp, "\ +Information about current page\ +\ +

Information about current page

\n"); if (buf == NULL) goto end; - Strcat_charp(tmp, "
Title"); - Strcat_charp(tmp, html_quote(buf->buffername)); - Strcat_charp(tmp, "
Current URL"); - Strcat_charp(tmp, html_quote(parsedURL2Str(&buf->currentURL)->ptr)); - Strcat_charp(tmp, "
Document Type"); - if (buf->real_type) - Strcat_charp(tmp, buf->real_type); - else - Strcat_charp(tmp, "unknown"); - Strcat_charp(tmp, "
Last Modified"); - Strcat_charp(tmp, html_quote(last_modified(buf))); -#ifdef JP_CHARSET - Strcat_charp(tmp, "
Document Code"); - Strcat_charp(tmp, code_to_str(buf->document_code)); -#endif /* JP_CHARSET */ - Strcat_charp(tmp, "
Number of lines"); all = buf->allLine; if (all == 0 && buf->lastLine) all = buf->lastLine->linenumber; - Strcat(tmp, Sprintf("%d", all)); - Strcat_charp(tmp, "
Transferred bytes"); - Strcat(tmp, Sprintf("%d", buf->trbyte)); + Strcat_m_charp(tmp, "", + "
Title", + html_quote(buf->buffername), + "
Current URL", + html_quote(parsedURL2Str(&buf->currentURL)->ptr), + "
Document Type", + buf->real_type ? html_quote(buf->real_type) : "unknown", + "
Last Modified", + html_quote(last_modified(buf)), +#ifdef JP_CHARSET + "
Document Code", + code_to_str(buf->document_code), +#endif /* JP_CHARSET */ + "
Number of lines", + Sprintf("%d", all)->ptr, + "
Transferred bytes", + Sprintf("%d", buf->trbyte)->ptr, + NULL); a = retrieveCurrentAnchor(buf); if (a != NULL) { @@ -542,26 +539,22 @@ page_info_panel(Buffer *buf) parseURL2(a->url, &pu, baseURL(buf)); s = parsedURL2Str(&pu); aurl = html_quote(s->ptr); - Strcat_charp(tmp, "
URL of current anchor"); - Strcat_m_charp(tmp, "", aurl, "", NULL); + Strcat_m_charp(tmp, "
URL of current anchor", aurl, "", NULL); } a = retrieveCurrentImg(buf); if (a != NULL) { parseURL2(a->url, &pu, baseURL(buf)); s = parsedURL2Str(&pu); - Strcat_charp(tmp, "
URL of current image"); - Strcat_charp(tmp, "ptr)); - Strcat_charp(tmp, "\">"); - Strcat_charp(tmp, html_quote(s->ptr)); - Strcat_charp(tmp, ""); + Strcat_m_charp(tmp, "
URL of current imageptr), "\">", html_quote(s->ptr), + "", NULL); } a = retrieveCurrentForm(buf); if (a != NULL) { FormItemList *fi = (FormItemList *)a->url; - s = Strnew_charp(form2str(fi)); - Strcat_charp(tmp, "
Method/type of current form"); - Strcat_charp(tmp, html_quote(s->ptr)); + Strcat_m_charp(tmp, "
Method/type of current form ", + html_quote(form2str(fi)), NULL); if (fi->parent->method == FORM_METHOD_INTERNAL && !Strcmp_charp(fi->parent->action, "map")) append_map_info(buf, tmp, fi->parent->item); @@ -571,12 +564,11 @@ page_info_panel(Buffer *buf) append_link_info(buf, tmp, buf->linklist); if (buf->document_header != NULL) { - Strcat_charp(tmp, "
\n"); - Strcat_charp(tmp, "

Header information

\n"); - for (ti = buf->document_header->first; ti != NULL; ti = ti->next) { - Strcat_charp(tmp, html_quote(ti->ptr)); - Strcat_charp(tmp, "
"); - } + Strcat_charp(tmp, "

Header information

\n");
+	for (ti = buf->document_header->first; ti != NULL; ti = ti->next)
+	    Strcat_m_charp(tmp, "", html_quote(ti->ptr),
+			   "\n", NULL);
+	Strcat_charp(tmp, "
\n"); } if (buf->frameset != NULL) @@ -586,17 +578,13 @@ page_info_panel(Buffer *buf) f_set = buf->nextBuffer->frameset; if (f_set) { - Strcat_charp(tmp, "

Frame information

");
+	Strcat_charp(tmp, "

Frame information

\n"); append_frame_info(buf, tmp, f_set, 0); - Strcat_charp(tmp, "
"); } #ifdef USE_SSL - if (buf->ssl_certificate == NULL) - goto end; - Strcat_charp(tmp, "

SSL certificate

\n"); - Strcat_charp(tmp, "
\n");
-    Strcat_charp(tmp, buf->ssl_certificate);
-    Strcat_charp(tmp, "
\n"); + if (buf->ssl_certificate) + Strcat_m_charp(tmp, "

SSL certificate

\n",
+		       html_quote(buf->ssl_certificate), "
\n", NULL); #endif end: Strcat_charp(tmp, ""); -- cgit v1.2.3