lynx-dev
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

lynx-dev verbose images with ISMAP/USEMAP


From: Laura Eaves
Subject: lynx-dev verbose images with ISMAP/USEMAP
Date: Thu, 10 Sep 1998 19:57:31 -0400 (EDT)

I noticed lynx does not print verbose images for ISMAPs or USEMAPs.
This info, I've found, can be very useful.
The following patch prints
        [ISMAP:gotcha.gif]
for ISMAP images without an alt string.
Similarly for USEMAP.

BTW -- I know what an ISMAP is but am not clear about USEMAPs.
I couldn't find it in the html refs on the help page.
Could someone enlighten me on USEMAPs?
Thanx!
--le

PS: This patch is applied to dev25 + leonids fix for the highlighting bug.
HTML.c is the only file changed.

--- old/HTML.c  Mon Sep  7 04:02:16 1998
+++ src/HTML.c  Thu Sep 10 19:48:19 1998
@@ -113,8 +113,9 @@
 #define VERBOSE_IMG(value,src_type,string) \
       ((verbose_img) ? (newtitle = MakeNewTitle(value,src_type)): string)
 
-PRIVATE char * MakeNewTitle PARAMS((CONST char ** value, int src_type));
-PRIVATE char * MakeNewImageValue PARAMS((CONST char ** value));
+PRIVATE char* MakeNewTitle PARAMS((CONST char ** value, int src_type));
+PRIVATE char* MakeNewImageValue PARAMS((CONST char ** value));
+PRIVATE char* MakeNewMapValue PARAMS((const char ** value, const char* 
mapstr));
 
 /*     Set an internal flag that the next call to a stack-affecting method
 **     is only internal and the stack manipulation should be skipped. - kw
@@ -2732,11 +2733,11 @@
                LYTrimTail(alt_string);
                if (*alt_string == '\0') {
                    if (map_href) {
-                       StrAllocCopy(alt_string, (title ?
-                                                 title : "[USEMAP]"));
+                       StrAllocCopy(alt_string, (title ? title :
+                               MakeNewMapValue(value,"USEMAP")));
                    } else if (dest_ismap) {
-                       StrAllocCopy(alt_string, (title ?
-                                                 title : "[ISMAP]"));
+                       StrAllocCopy(alt_string, (title ? title :
+                                       MakeNewMapValue(value,"ISMAP")));
 
                    } else if (me->inA == TRUE && dest) {
                        StrAllocCopy(alt_string, (title ?
@@ -2755,13 +2756,13 @@
            }
 
        } else if (map_href) {
-           StrAllocCopy(alt_string, (title ?
-                                     title : "[USEMAP]"));
+           StrAllocCopy(alt_string, (title ? title :
+                                     MakeNewMapValue(value,"USEMAP")));
 
        } else if ((dest_ismap == TRUE) ||
                   (me->inA && present && present[HTML_IMG_ISMAP])) {
-           StrAllocCopy(alt_string, (title ?
-                                     title : "[ISMAP]"));
+           StrAllocCopy(alt_string, (title ? title :
+                                       MakeNewMapValue(value,"ISMAP")));
 
        } else if (me->inA == TRUE && dest) {
            StrAllocCopy(alt_string, (title ?
@@ -2780,7 +2781,7 @@
                                          title : ""));
        }
        if (*alt_string == '\0' && map_href) {
-           StrAllocCopy(alt_string, "[USEMAP]");
+           StrAllocCopy(alt_string, MakeNewMapValue(value,"USEMAP"));
        }
 
        CTRACE(tfp, "HTML IMG: USEMAP=%d ISMAP=%d ANCHOR=%d PARA=%d\n",
@@ -2842,7 +2843,7 @@
                    if (dest_ismap) {
                        HTML_put_character(me, ' ');
                        me->in_word = NO;
-                       HTML_put_string(me, "[ISMAP]");
+                       HTML_put_string(me, MakeNewMapValue(value,"ISMAP"));
                    } else if (dest) {
                        HTML_put_character(me, ' ');
                        me->in_word = NO;
@@ -3010,7 +3011,7 @@
                if (dest_ismap) {
                    HTML_put_character(me, ' ');/* space char may be ignored */
                    me->in_word = NO;
-                   HTML_put_string(me, "[ISMAP]");
+                   HTML_put_string(me, MakeNewMapValue(value,"ISMAP"));
                } else if (dest) {
                    HTML_put_character(me, ' ');/* space char may be ignored */
                    me->in_word = NO;
@@ -7476,5 +7477,24 @@
        StrAllocCat(newtitle, ptr + 1);
     }
     StrAllocCat(newtitle, "]-Submit");
+    return newtitle;
+}
+PRIVATE char * MakeNewMapValue ARGS2(const char **, value, const char*, mapstr)
+{
+    char *ptr;
+    char *newtitle = NULL;
+
+    StrAllocCopy(newtitle, "[");
+    StrAllocCat(newtitle,mapstr); /* ISMAP or USEMAP */
+    if ( verbose_img ) {
+       StrAllocCat(newtitle,":");
+       ptr = strrchr(value[HTML_IMG_SRC], '/');
+       if (!ptr) {
+           StrAllocCat(newtitle, value[HTML_IMG_SRC]);
+       } else {
+           StrAllocCat(newtitle, ptr + 1);
+       }
+    }
+    StrAllocCat(newtitle, "]");
     return newtitle;
 }

reply via email to

[Prev in Thread] Current Thread [Next in Thread]