mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Fix compile errors in call_onsubmit_or_submit #ifdef CONFIG_ECMASCRIPT.
The errors were caused by commit b623decfb5626b95924e8cc22538083df234970f. Also, rename call_onsubmit_or_submit to call_onsubmit_and_submit.
This commit is contained in:
parent
b623decfb5
commit
262d592d23
@ -861,7 +861,7 @@ get_link_uri(struct session *ses, struct document_view *doc_view,
|
|||||||
}
|
}
|
||||||
|
|
||||||
static int
|
static int
|
||||||
call_onsubmit_or_submit(struct session *ses, struct document_view *doc_view,
|
call_onsubmit_and_submit(struct session *ses, struct document_view *doc_view,
|
||||||
struct form_control *fc, int do_reload)
|
struct form_control *fc, int do_reload)
|
||||||
{
|
{
|
||||||
struct uri *uri = NULL;
|
struct uri *uri = NULL;
|
||||||
@ -881,7 +881,7 @@ call_onsubmit_or_submit(struct session *ses, struct document_view *doc_view,
|
|||||||
if (init_string(&code)) {
|
if (init_string(&code)) {
|
||||||
struct view_state *vs = doc_view->vs;
|
struct view_state *vs = doc_view->vs;
|
||||||
struct ecmascript_interpreter *interpreter;
|
struct ecmascript_interpreter *interpreter;
|
||||||
unsigned char *ret = form->onsubmit;
|
unsigned char *ret = fc->form->onsubmit;
|
||||||
int res;
|
int res;
|
||||||
|
|
||||||
if (vs->ecmascript_fragile)
|
if (vs->ecmascript_fragile)
|
||||||
@ -893,7 +893,7 @@ call_onsubmit_or_submit(struct session *ses, struct document_view *doc_view,
|
|||||||
while ((ret = strstr(ret, "return ")))
|
while ((ret = strstr(ret, "return ")))
|
||||||
while (*ret != ' ') *ret++ = ' ';
|
while (*ret != ' ') *ret++ = ' ';
|
||||||
|
|
||||||
add_to_string(&code, form->onsubmit);
|
add_to_string(&code, fc->form->onsubmit);
|
||||||
res = ecmascript_eval_boolback(interpreter, &code);
|
res = ecmascript_eval_boolback(interpreter, &code);
|
||||||
done_string(&code);
|
done_string(&code);
|
||||||
/* If the user presses Enter in a text field,
|
/* If the user presses Enter in a text field,
|
||||||
@ -928,7 +928,7 @@ goto_current_link(struct session *ses, struct document_view *doc_view, int do_re
|
|||||||
if (link_is_form(link)) {
|
if (link_is_form(link)) {
|
||||||
struct form_control *fc = link->data.form_control;
|
struct form_control *fc = link->data.form_control;
|
||||||
|
|
||||||
if (!call_onsubmit_or_submit(ses, doc_view, fc, do_reload))
|
if (!call_onsubmit_and_submit(ses, doc_view, fc, do_reload))
|
||||||
return NULL;
|
return NULL;
|
||||||
else
|
else
|
||||||
return link;
|
return link;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user