mirror of
https://github.com/rkd77/elinks.git
synced 2024-11-04 08:17:17 -05:00
Introduced ecmascript submodules
This commit is contained in:
parent
8782b01659
commit
b8126ea9de
@ -24,6 +24,12 @@
|
||||
#include "viewer/text/form.h" /* <-ecmascript_reset_state() */
|
||||
#include "viewer/text/vs.h"
|
||||
|
||||
#ifdef CONFIG_ECMASCRIPT_SEE
|
||||
#include "ecmascript/see.h"
|
||||
#elif defined(CONFIG_SPIDERMONKEY)
|
||||
#include "ecmascript/spidermonkey.h"
|
||||
#endif
|
||||
|
||||
|
||||
/* TODO: We should have some kind of ACL for the scripts - i.e. ability to
|
||||
* disallow the scripts to open new windows (or so that the windows are always
|
||||
@ -133,11 +139,21 @@ ecmascript_timeout_dialog(struct terminal *term, int max_exec_time)
|
||||
|
||||
}
|
||||
|
||||
static struct module *ecmascript_modules[] = {
|
||||
#ifdef CONFIG_ECMASCRIPT_SEE
|
||||
&see_module,
|
||||
#elif defined(CONFIG_SPIDERMONKEY)
|
||||
&spidermonkey_module,
|
||||
#endif
|
||||
NULL,
|
||||
};
|
||||
|
||||
|
||||
struct module ecmascript_module = struct_module(
|
||||
/* name: */ N_("ECMAScript"),
|
||||
/* options: */ ecmascript_options,
|
||||
/* events: */ NULL,
|
||||
/* submodules: */ NULL,
|
||||
/* submodules: */ ecmascript_modules,
|
||||
/* data: */ NULL,
|
||||
/* init: */ ecmascript_init,
|
||||
/* done: */ ecmascript_done
|
||||
|
@ -240,3 +240,13 @@ see_eval_boolback(struct ecmascript_interpreter *interpreter,
|
||||
}
|
||||
return res;
|
||||
}
|
||||
|
||||
struct module see_module = struct_module(
|
||||
/* name: */ "SEE",
|
||||
/* options: */ NULL,
|
||||
/* events: */ NULL,
|
||||
/* submodules: */ NULL,
|
||||
/* data: */ NULL,
|
||||
/* init: */ NULL,
|
||||
/* done: */ NULL
|
||||
);
|
||||
|
@ -14,4 +14,5 @@ void see_eval(struct ecmascript_interpreter *interpreter, struct string *code);
|
||||
unsigned char *see_eval_stringback(struct ecmascript_interpreter *interpreter, struct string *code);
|
||||
int see_eval_boolback(struct ecmascript_interpreter *interpreter, struct string *code);
|
||||
|
||||
extern struct module see_module;
|
||||
#endif
|
||||
|
@ -376,3 +376,13 @@ spidermonkey_eval_boolback(struct ecmascript_interpreter *interpreter,
|
||||
|
||||
return jsval_to_boolean(ctx, &rval);
|
||||
}
|
||||
|
||||
struct module spidermonkey_module = struct_module(
|
||||
/* name: */ "SpiderMonkey",
|
||||
/* options: */ NULL,
|
||||
/* events: */ NULL,
|
||||
/* submodules: */ NULL,
|
||||
/* data: */ NULL,
|
||||
/* init: */ NULL,
|
||||
/* done: */ NULL
|
||||
);
|
||||
|
@ -14,4 +14,5 @@ void spidermonkey_eval(struct ecmascript_interpreter *interpreter, struct string
|
||||
unsigned char *spidermonkey_eval_stringback(struct ecmascript_interpreter *interpreter, struct string *code);
|
||||
int spidermonkey_eval_boolback(struct ecmascript_interpreter *interpreter, struct string *code);
|
||||
|
||||
extern struct module spidermonkey_module;
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user