[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): <pre_int>
			html_quote ssl_certificate
	(page_info_panel): rewrite, html_quote
From: Hironori SAKAMOTO <hsaka@mth.biglobe.ne.jp>
This commit is contained in:
Fumitoshi UKAI
2003-01-10 16:58:30 +00:00
parent ce8abe2b7c
commit c5ec364d23
4 changed files with 86 additions and 83 deletions

29
form.c
View File

@@ -1,4 +1,4 @@
/* $Id: form.c,v 1.26 2003/01/10 16:48:49 ukai Exp $ */
/* $Id: form.c,v 1.27 2003/01/10 16:58:31 ukai Exp $ */
/*
* HTML forms
*/
@@ -160,8 +160,8 @@ formList_addInput(struct form_list *fl, struct parsed_tag *tag)
}
static char *_formtypetbl[] = {
"text", "password", "checkbox", "radio", "submit",
"reset", "hidden", "image", "select", "textarea", "button", "file", 0,
"text", "password", "checkbox", "radio", "submit", "reset", "hidden",
"image", "select", "textarea", "button", "file", NULL
};
static char *_formmethodtbl[] = {
@@ -171,16 +171,19 @@ static char *_formmethodtbl[] = {
char *
form2str(FormItemList *fi)
{
Str tmp;
if (fi->type == FORM_INPUT_SUBMIT ||
fi->type == FORM_INPUT_IMAGE || fi->type == FORM_INPUT_BUTTON) {
tmp = Strnew_charp(_formmethodtbl[fi->parent->method]);
Strcat_char(tmp, ' ');
Strcat(tmp, fi->parent->action);
return tmp->ptr;
}
else
return _formtypetbl[fi->type];
Str tmp = Strnew();
if (fi->type != FORM_SELECT && fi->type != FORM_TEXTAREA)
Strcat_charp(tmp, "input type=");
Strcat_charp(tmp, _formtypetbl[fi->type]);
if (fi->name && fi->name->length)
Strcat_m_charp(tmp, " name=\"", fi->name->ptr, "\"", NULL);
if ((fi->type == FORM_INPUT_RADIO || fi->type == FORM_INPUT_CHECKBOX ||
fi->type == FORM_SELECT) && fi->value)
Strcat_m_charp(tmp, " value=\"", fi->value->ptr, "\"", NULL);
Strcat_m_charp(tmp, " (", _formmethodtbl[fi->parent->method], " ",
fi->parent->action->ptr, ")", NULL);
return tmp->ptr;
}
int