[dillo-patches] test

  • From: Paul Pelzl <pelzlpj@xxxxxxxxxxxxxx>
  • To: dillo-patches@xxxxxxxxxxxxx
  • Date: Wed, 3 Mar 2004 17:38:25 -0500

I changed a setting in the list manager; this is a test to see if
attachments will work properly now.

Paul

--- /tmp/dillo-0.8.0/src/html.c 2004-02-06 18:10:45.000000000 -0500
+++ dillo-0.8.0/src/html.c      2004-03-02 11:42:52.000000000 -0500
@@ -280,8 +280,9 @@ static void Html_handle_status(DwWidget 
    url = (link == -1) ? NULL : lb->links[link];
    if (url) {
       Html_set_link_coordinates(lb, link, x, y);
-      a_Interface_msg(lb->bw, "%s",
-                         URL_ALT_(url) ? URL_ALT_(url) : URL_STR_(url));
+      a_Interface_msg(lb->bw, "%s (%s)",
+                         URL_ALT_(url) ? URL_ALT_(url) : URL_STR_(url),
+                        URL_NW(url) ? "New Window" : "Same Window"); /* Nelson 
Rodriguez */
       a_Dw_widget_set_cursor (widget, Dw_cursor_hand);
       lb->bw->status_is_link = 1;
 
@@ -338,8 +339,12 @@ static gboolean Html_link_clicked(DwWidg
                                   GdkEventButton *event, DilloHtmlLB *lb)
 {
    Html_set_link_coordinates(lb, link, x, y);
-   if (event->button == 1)
-      a_Nav_push(lb->bw, lb->links[link]);
+   if (event->button == 1){
+      if(lb->links[link]->newwindow!=1) /* Condition to open in new window */
+         a_Nav_push(lb->bw, lb->links[link]);
+      else
+         a_Nav_push_nw(lb->bw, lb->links[link]);
+      }
    else if (event->button == 2) {
       a_Nav_push_nw(lb->bw, lb->links[link]);
    } else {
@@ -2231,7 +2236,6 @@ static void Html_tag_open_img(DilloHtml 
    if (!(attrbuf = Html_get_attr(html, tag, tagsize, "src")) ||
        !(url = Html_url_new(html, attrbuf, NULL, 0, 0, 0, 0)))
       return;
-
    page = DW_PAGE (html->dw);
 
 
@@ -2434,6 +2438,8 @@ static void Html_tag_open_a(DilloHtml *h
    if ( (attrbuf = Html_get_attr(html, tag, tagsize, "href"))) {
       url = Html_url_new(html, attrbuf, NULL, 0, 0, 0, 0);
       g_return_if_fail ( url != NULL );
+      if(attrbuf=Html_get_attr(html,tag,tagsize,"target")) /* Nelson Rodriguez 
*/
+         url->newwindow=(strcasecmp(attrbuf,"_blank") | 
strcasecmp(attrbuf,"_new")) ? 1 : 0;
 
       old_style = html->stack[html->stack_top].style;
       style_attrs = *old_style;
@@ -2802,6 +2808,8 @@ static void Html_tag_open_form(DilloHtml
       action = Html_url_new(html, attrbuf, NULL, 0, 0, 0, 0);
    else
       action = a_Url_dup(html->linkblock->base_url);
+   if(attrbuf=Html_get_attr(html,tag,tagsize,"target")) /* Nelson Rodriguez */
+      action->newwindow=(strcasecmp(attrbuf,"_blank") | 
strcasecmp(attrbuf,"_new")) ? 1 : 0 ;
    enc = DILLO_HTML_ENC_URLENCODING;
    if ( (attrbuf = Html_get_attr(html, tag, tagsize, "encoding")) ) {
       /* todo: maybe deal with unknown encodings? */
@@ -3228,7 +3236,11 @@ static void Html_submit_form(GtkWidget *
          g_free(url_str);
       }
 
-      a_Nav_push(html_lb->bw, new_url);
+      if(form->action->newwindow!=1) /* Nelson Rodriguez */
+         a_Nav_push(html_lb->bw, new_url);
+      else
+         a_Nav_push_nw(html_lb->bw, new_url);
+      
       g_free(action_str);
       g_string_free(DataStr, TRUE);
       a_Url_free(new_url);

Other related posts: