mirror of
https://github.com/rkd77/elinks.git
synced 2025-02-02 15:09:23 -05:00
Undo in favour of a nicer API...
This commit is contained in:
parent
054fb15ff0
commit
d44a24050c
@ -12,7 +12,6 @@
|
||||
#include "scripting/smjs/elinks_object.h"
|
||||
#include "scripting/smjs/global_object.h"
|
||||
#include "scripting/smjs/keybinding.h"
|
||||
#include "session/task.h"
|
||||
|
||||
|
||||
static JSBool
|
||||
@ -34,34 +33,6 @@ elinks_alert(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
static JSBool
|
||||
elinks_goto_url(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv,
|
||||
jsval *rval)
|
||||
{
|
||||
unsigned char *url;
|
||||
|
||||
if (argc != 1)
|
||||
goto ret_false;
|
||||
|
||||
url = jsval_to_string(ctx, &argv[0]);
|
||||
if (!*url)
|
||||
return JS_FALSE;
|
||||
|
||||
if (!smjs_ses)
|
||||
goto ret_false;
|
||||
|
||||
goto_url(smjs_ses, url);
|
||||
|
||||
*rval = JSVAL_TRUE;
|
||||
|
||||
return JS_TRUE;
|
||||
|
||||
ret_false:
|
||||
*rval = JSVAL_FALSE;
|
||||
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
static const JSClass elinks_class = {
|
||||
"elinks",
|
||||
0,
|
||||
@ -72,7 +43,6 @@ static const JSClass elinks_class = {
|
||||
|
||||
static const JSFunctionSpec elinks_funcs[] = {
|
||||
{ "alert", elinks_alert, 1 },
|
||||
{ "goto_url", elinks_goto_url, 1 },
|
||||
{ NULL }
|
||||
};
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user