1
0
mirror of https://github.com/rkd77/elinks.git synced 2024-12-04 14:46:47 -05:00

current_link_evhook: return effaced

This commit is contained in:
2006-01-30 12:18:43 +01:00
parent 1dae2926fd
commit fa93d05b7e

View File

@ -63,12 +63,18 @@ current_link_evhook(struct document_view *doc_view, enum script_event_hook_type
if (!doc_view->vs->ecmascript) return -1;
foreach (evhook, *link->event_hooks) {
struct string src = INIT_STRING(evhook->src, strlen(evhook->src));
unsigned char *ret;
if (evhook->type != type) continue;
/* TODO: Some even handlers return a bool. */
if (!ecmascript_eval_boolback(doc_view->vs->ecmascript, &src))
return 0;
ret = evhook->src;
while ((ret = strstr(ret, "return ")))
while (*ret != ' ') *ret++ = ' ';
{
struct string src = INIT_STRING(evhook->src, strlen(evhook->src));
/* TODO: Some even handlers return a bool. */
if (!ecmascript_eval_boolback(doc_view->vs->ecmascript, &src))
return 0;
}
}
return 1;
@ -874,9 +880,9 @@ try_submit_given_form(struct session *ses, struct document_view *doc_view,
assert(interpreter);
/* SEE and SpiderMonkey do not like return outside
* functions. */
while ((ret = strstr(ret, "return "))) {
while ((ret = strstr(ret, "return ")))
while (*ret != ' ') *ret++ = ' ';
}
add_to_string(&code, form->onsubmit);
res = ecmascript_eval_boolback(interpreter, &code);
done_string(&code);