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

Merge with git+ssh://pasky.or.cz/srv/git/elinks.git

This commit is contained in:
Miciah Dashiel Butler Masters 2006-02-07 03:05:38 +00:00 committed by Miciah Dashiel Butler Masters
commit 2b3f6cf6a9
5 changed files with 34 additions and 11 deletions

View File

@ -36,6 +36,9 @@ def pre_format_html_hook(url, html):
if re.search("cygwin\.com", url):
html2 = re.sub("<body bgcolor=\"#000000\" color=\"#000000\"", "<body bgcolor=\"#ffffff\" color=\"#000000\"", html)
return html2
if re.search("https://www.mbank.com.pl/ib_navibar_3.asp", url):
html2 = re.sub("<td valign=\"top\"><img", "<tr><td valign=\"top\"><img", html)
return html2
return None
def proxy_for_hook(url):

View File

@ -723,7 +723,16 @@ static struct option_info config_options_info[] = {
INIT_OPT_TREE("document", N_("URI passing"),
"uri_passing", OPT_SORT | OPT_AUTOCREATE,
N_("Rules for passing URIs to external commands.")),
N_("Rules for passing URIs to external commands. When one rule\n"
"is defined the link and tab menu will have a menu item that\n"
"makes it possible to pass the the link, frame or tab URI to\n"
"an external command. If several rules are defined the link and\n"
"tab menu will have a submenu of items for each rule. Note, this\n"
"is mostly useful for launching graphical viewers, since there\n"
"is not support for releasing the terminal while the command runs.\n"
"The action and submenus are also available by binding keys to\n"
"the frame-external-command, the link-external-command, and\n"
"the tab-external-command actions.")),
INIT_OPT_STRING("document.uri_passing", NULL,
"_template_", 0, "",

View File

@ -1021,7 +1021,7 @@ void
move_download(struct download *old, struct download *new,
enum connection_priority newpri)
{
struct connection *conn = old->conn;
struct connection *conn;
assert(old);
@ -1029,7 +1029,9 @@ move_download(struct download *old, struct download *new,
* example the file protocol loads it's object immediately. This is
* catched by the result state check below. */
new->conn = old->conn;
conn = old->conn;
new->conn = conn;
new->cached = old->cached;
new->prev_error = old->prev_error;
new->progress = old->progress;
@ -1037,8 +1039,12 @@ move_download(struct download *old, struct download *new,
new->pri = newpri;
if (is_in_result_state(old->state)) {
if (new->callback)
/* Ensure that new->conn is always "valid", that is NULL if the
* connection has been detached and non-NULL otherwise. */
if (new->callback) {
new->conn = NULL;
new->callback(new, new->data);
}
return;
}

View File

@ -967,10 +967,7 @@ tp_display(struct type_query *type_query)
new->callback = (download_callback_T *) doc_loading_callback;
new->data = ses;
if (is_in_progress_state(old->state))
move_download(old, new, PRI_MAIN);
else
new->state = old->state;
move_download(old, new, PRI_MAIN);
}
display_timer(ses);

View File

@ -604,11 +604,19 @@ doc_loading_callback(struct download *download, struct session *ses)
print_screen_status(ses);
#ifdef CONFIG_GLOBHIST
if (download->conn && download->pri != PRI_CSS) {
if (download->pri != PRI_CSS) {
unsigned char *title = ses->doc_view->document->title;
struct uri *uri = download->conn->proxied_uri;
struct uri *uri;
add_global_history_item(struri(uri), title, time(NULL));
if (download->conn)
uri = download->conn->proxied_uri;
else if (download->cached)
uri = download->cached->uri;
else
uri = NULL;
if (uri)
add_global_history_item(struri(uri), title, time(NULL));
}
#endif