mirror of
https://github.com/rkd77/elinks.git
synced 2024-10-13 05:43:37 -04:00
Move delayed_open to src/terminal/tab.c
The two copies of delayed_open in src/ecmascript/spidermonkey/window.c and in src/ecmascript/see/window.c are identical, so move them to src/terminal/tab.c and eliminate the duplication.
This commit is contained in:
parent
1f68492d57
commit
466bb18be0
@ -48,7 +48,6 @@
|
||||
|
||||
static struct js_window_object *js_get_global_object(void *);
|
||||
static struct js_window_object *js_try_resolve_frame(struct document_view *, unsigned char *);
|
||||
static void delayed_open(void *);
|
||||
static void window_get(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *, struct SEE_value *);
|
||||
static void window_put(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *, struct SEE_value *, int);
|
||||
static int window_canput(struct SEE_interpreter *, struct SEE_object *, struct SEE_string *);
|
||||
@ -95,18 +94,6 @@ js_try_resolve_frame(struct document_view *doc_view, unsigned char *id)
|
||||
}
|
||||
|
||||
|
||||
static void
|
||||
delayed_open(void *data)
|
||||
{
|
||||
struct delayed_open *deo = data;
|
||||
|
||||
assert(deo);
|
||||
open_uri_in_new_tab(deo->ses, deo->uri, 0, 0);
|
||||
done_uri(deo->uri);
|
||||
mem_free(deo);
|
||||
}
|
||||
|
||||
|
||||
|
||||
static void
|
||||
window_get(struct SEE_interpreter *interp, struct SEE_object *o,
|
||||
|
@ -289,17 +289,6 @@ window_alert(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval
|
||||
return JS_TRUE;
|
||||
}
|
||||
|
||||
static void
|
||||
delayed_open(void *data)
|
||||
{
|
||||
struct delayed_open *deo = data;
|
||||
|
||||
assert(deo);
|
||||
open_uri_in_new_tab(deo->ses, deo->uri, 0, 0);
|
||||
done_uri(deo->uri);
|
||||
mem_free(deo);
|
||||
}
|
||||
|
||||
static JSBool
|
||||
window_open(JSContext *ctx, JSObject *obj, uintN argc, jsval *argv, jsval *rval)
|
||||
{
|
||||
|
@ -239,6 +239,17 @@ open_uri_in_new_tab(struct session *ses, struct uri *uri, int in_background,
|
||||
init_session(based ? ses : NULL, ses->tab->term, uri, in_background);
|
||||
}
|
||||
|
||||
void
|
||||
delayed_open(void *data)
|
||||
{
|
||||
struct delayed_open *deo = data;
|
||||
|
||||
assert(deo);
|
||||
open_uri_in_new_tab(deo->ses, deo->uri, 0, 0);
|
||||
done_uri(deo->uri);
|
||||
mem_free(deo);
|
||||
}
|
||||
|
||||
void
|
||||
open_current_link_in_new_tab(struct session *ses, int in_background)
|
||||
{
|
||||
|
@ -25,6 +25,7 @@ void close_all_tabs_but_current(struct session *ses);
|
||||
((win)->type != WINDOW_NORMAL && (win) != get_current_tab((win->term)))
|
||||
|
||||
void open_uri_in_new_tab(struct session *ses, struct uri *uri, int in_background, int based);
|
||||
void delayed_open(void *);
|
||||
void open_current_link_in_new_tab(struct session *ses, int in_background);
|
||||
|
||||
void move_current_tab(struct session *ses, int direction);
|
||||
|
Loading…
Reference in New Issue
Block a user