mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
[iframes] added document.html.display_iframes option
This commit is contained in:
parent
83a359005b
commit
0ef0470191
@ -796,6 +796,10 @@ static union option_info config_options_info[] = {
|
|||||||
"display_frames", 0, 1,
|
"display_frames", 0, 1,
|
||||||
N_("Display frames.")),
|
N_("Display frames.")),
|
||||||
|
|
||||||
|
INIT_OPT_BOOL("document.html", N_("Display iframes"),
|
||||||
|
"display_iframes", 0, 1,
|
||||||
|
N_("Display iframes.")),
|
||||||
|
|
||||||
INIT_OPT_BOOL("document.html", N_("Display tables"),
|
INIT_OPT_BOOL("document.html", N_("Display tables"),
|
||||||
"display_tables", 0, 1,
|
"display_tables", 0, 1,
|
||||||
N_("Display tables.")),
|
N_("Display tables.")),
|
||||||
|
@ -468,9 +468,8 @@ html_iframe_do(char *a, char *object_src,
|
|||||||
struct html_context *html_context)
|
struct html_context *html_context)
|
||||||
{
|
{
|
||||||
char *name, *url = NULL;
|
char *name, *url = NULL;
|
||||||
char *hstr, *wstr;
|
int height = 0;
|
||||||
int height;
|
int width = 0;
|
||||||
int width;
|
|
||||||
|
|
||||||
url = null_or_stracpy(object_src);
|
url = null_or_stracpy(object_src);
|
||||||
if (!url) url = get_url_val(a, "src", html_context->doc_cp);
|
if (!url) url = get_url_val(a, "src", html_context->doc_cp);
|
||||||
@ -483,23 +482,26 @@ html_iframe_do(char *a, char *object_src,
|
|||||||
mem_free(url);
|
mem_free(url);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
hstr = get_attr_val(a, "height", html_context->doc_cp);
|
|
||||||
wstr = get_attr_val(a, "width", html_context->doc_cp);
|
|
||||||
|
|
||||||
html_focusable(html_context, a);
|
html_focusable(html_context, a);
|
||||||
|
|
||||||
if (!hstr) {
|
if (html_context->options->iframes) {
|
||||||
height = (150 + HTML_CHAR_HEIGHT - 1) / HTML_CHAR_HEIGHT;
|
char *hstr = get_attr_val(a, "height", html_context->doc_cp);
|
||||||
} else {
|
char *wstr = get_attr_val(a, "width", html_context->doc_cp);
|
||||||
height = (atoi(hstr) + HTML_CHAR_HEIGHT - 1) / HTML_CHAR_HEIGHT;
|
|
||||||
mem_free(hstr);
|
|
||||||
}
|
|
||||||
|
|
||||||
if (!wstr) {
|
if (!hstr) {
|
||||||
width = (300 + HTML_CHAR_WIDTH - 1) / HTML_CHAR_WIDTH;
|
height = (150 + HTML_CHAR_HEIGHT - 1) / HTML_CHAR_HEIGHT;
|
||||||
} else {
|
} else {
|
||||||
width = (atoi(wstr) + HTML_CHAR_WIDTH - 1) / HTML_CHAR_WIDTH;
|
height = (atoi(hstr) + HTML_CHAR_HEIGHT - 1) / HTML_CHAR_HEIGHT;
|
||||||
mem_free(wstr);
|
mem_free(hstr);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!wstr) {
|
||||||
|
width = (300 + HTML_CHAR_WIDTH - 1) / HTML_CHAR_WIDTH;
|
||||||
|
} else {
|
||||||
|
width = (atoi(wstr) + HTML_CHAR_WIDTH - 1) / HTML_CHAR_WIDTH;
|
||||||
|
mem_free(wstr);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (height > 0) {
|
if (height > 0) {
|
||||||
|
@ -95,6 +95,7 @@ init_document_options(struct session *ses, struct document_options *doo)
|
|||||||
doo->table_order = get_opt_bool("document.browse.table_move_order", ses);
|
doo->table_order = get_opt_bool("document.browse.table_move_order", ses);
|
||||||
doo->tables = get_opt_bool("document.html.display_tables", ses);
|
doo->tables = get_opt_bool("document.html.display_tables", ses);
|
||||||
doo->frames = get_opt_bool("document.html.display_frames", ses);
|
doo->frames = get_opt_bool("document.html.display_frames", ses);
|
||||||
|
doo->iframes = get_opt_bool("document.html.display_iframes", ses);
|
||||||
doo->images = get_opt_bool("document.browse.images.show_as_links", ses);
|
doo->images = get_opt_bool("document.browse.images.show_as_links", ses);
|
||||||
doo->display_subs = get_opt_bool("document.html.display_subs", ses);
|
doo->display_subs = get_opt_bool("document.html.display_subs", ses);
|
||||||
doo->display_sups = get_opt_bool("document.html.display_sups", ses);
|
doo->display_sups = get_opt_bool("document.html.display_sups", ses);
|
||||||
|
@ -90,6 +90,7 @@ struct document_options {
|
|||||||
unsigned int table_order:1;
|
unsigned int table_order:1;
|
||||||
unsigned int frames:1;
|
unsigned int frames:1;
|
||||||
unsigned int images:1;
|
unsigned int images:1;
|
||||||
|
unsigned int iframes:1;
|
||||||
|
|
||||||
unsigned int display_subs:1;
|
unsigned int display_subs:1;
|
||||||
unsigned int display_sups:1;
|
unsigned int display_sups:1;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user