mirror of
https://github.com/rkd77/elinks.git
synced 2025-06-30 22:19:29 -04:00
Support document refresh in frames
Introduce reload_frame, which takes a frame @name argument in addition to the arguments that reload takes.
This commit is contained in:
parent
2676fcc2cd
commit
dbacc9ead2
@ -84,10 +84,11 @@ do_document_refresh(void *data)
|
||||
|
||||
if (compare_uri(refresh->uri, doc_view->document->uri, 0)) {
|
||||
/* If the refreshing is for the current URI, force a reload. */
|
||||
reload(doc_view->session, CACHE_MODE_FORCE_RELOAD);
|
||||
reload_frame(doc_view->session, doc_view->name,
|
||||
CACHE_MODE_FORCE_RELOAD);
|
||||
} else {
|
||||
/* This makes sure that we send referer. */
|
||||
goto_uri_frame(doc_view->session, refresh->uri, NULL, CACHE_MODE_NORMAL);
|
||||
goto_uri_frame(doc_view->session, refresh->uri, doc_view->name, CACHE_MODE_NORMAL);
|
||||
/* XXX: A possible very wrong work-around for refreshing used when
|
||||
* downloading files. */
|
||||
refresh->restart = 0;
|
||||
@ -130,9 +131,24 @@ start_document_refreshes(struct session *ses)
|
||||
|
||||
if (!ses->doc_view
|
||||
|| !ses->doc_view->document
|
||||
|| !ses->doc_view->document->refresh
|
||||
|| !get_opt_bool("document.browse.refresh", ses))
|
||||
return;
|
||||
|
||||
if (document_has_frames(ses->doc_view->document)) {
|
||||
struct document_view *doc_view;
|
||||
|
||||
foreach (doc_view, ses->scrn_frames) {
|
||||
if (!doc_view->document
|
||||
|| !doc_view->document->refresh)
|
||||
continue;
|
||||
|
||||
start_document_refresh(doc_view->document->refresh,
|
||||
doc_view);
|
||||
}
|
||||
}
|
||||
|
||||
if (!ses->doc_view->document->refresh)
|
||||
return;
|
||||
|
||||
start_document_refresh(ses->doc_view->document->refresh, ses->doc_view);
|
||||
}
|
||||
|
@ -1179,6 +1179,13 @@ destroy_session(struct session *ses)
|
||||
|
||||
void
|
||||
reload(struct session *ses, enum cache_mode cache_mode)
|
||||
{
|
||||
reload_frame(ses, NULL, cache_mode);
|
||||
}
|
||||
|
||||
void
|
||||
reload_frame(struct session *ses, unsigned char *name,
|
||||
enum cache_mode cache_mode)
|
||||
{
|
||||
abort_loading(ses, 0);
|
||||
|
||||
@ -1206,6 +1213,8 @@ reload(struct session *ses, enum cache_mode cache_mode)
|
||||
loc->download.data = ses;
|
||||
loc->download.callback = (download_callback_T *) doc_loading_callback;
|
||||
|
||||
ses->task.target.frame = name;
|
||||
|
||||
load_uri(loc->vs.uri, ses->referrer, &loc->download, PRI_MAIN, cache_mode, -1);
|
||||
|
||||
foreach (ftl, ses->more_files) {
|
||||
|
@ -255,6 +255,7 @@ struct session *init_session(struct session *ses, struct terminal *term,
|
||||
void doc_loading_callback(struct download *, struct session *);
|
||||
|
||||
void abort_loading(struct session *, int);
|
||||
void reload_frame(struct session *, unsigned char *, enum cache_mode);
|
||||
void reload(struct session *, enum cache_mode);
|
||||
void load_frames(struct session *, struct document_view *);
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user