Changeset 13613

Show
Ignore:
Timestamp:
11/23/07 13:45:43 (1 year ago)
Author:
w_i
Message:

Correct image url for folder objects

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/midcom/midcom.helper.imagepopup/static/functions.js

    r12014 r13613  
    1818            if (imageGuid) 
    1919            { 
     20                var links = imageRows[i].getElementsByTagName('a'); 
     21                var imageUrl = ''; 
     22                for (var li = 0; li < links.length; li++) 
     23                { 
     24                    if (   Element.hasClassName(links[li], 'download') 
     25                        && imageUrl == '') 
     26                    { 
     27                        imageUrl = links[li].getAttribute('href'); 
     28                    } 
     29                } 
     30 
    2031                image = new Array(); 
    2132                image['guid'] = imageGuid; 
     
    5869                imagepopup_images[imageGuid]['name'] = image['name']; 
    5970                imagepopup_images[imageGuid]['type'] = 'image'; 
     71                imagepopup_images[imageGuid]['url'] = imageUrl; 
    6072            } 
    6173        } 
     
    7385            if (imageGuid) 
    7486            { 
     87                var links = imageRows[i].getElementsByTagName('a'); 
     88                var imageUrl = ''; 
     89                for (var li = 0; li < links.length; li++) 
     90                { 
     91                    if (   Element.hasClassName(links[li], 'download') 
     92                        && imageUrl == '') 
     93                    { 
     94                        imageUrl = links[li].getAttribute('href'); 
     95                    } 
     96                } 
     97                 
    7598                image = new Array(); 
    7699                image['guid'] = imageGuid; 
     
    113136                imagepopup_images[imageGuid]['name'] = image['name']; 
    114137                imagepopup_images[imageGuid]['type'] = 'attachment'; 
     138                imagepopup_images[imageGuid]['url'] = imageUrl; 
    115139                 
    116140            } 
     
    160184     
    161185    // Close the popup 
    162         window.close(); 
     186        //window.close(); 
    163187} 
    164188 
     
    175199                 
    176200                case "attachment": 
    177                 html_code = '<a href="' + imagepopup_images['prefix'] +  
    178                                             objId +"/" + iminfo['name'] + '" >' + iminfo['title'] + '</a>'; 
     201                html_code = '<a href="' + iminfo['url'] + '" >' + iminfo['title'] + '</a>'; 
    179202                 
    180203                break; 
     
    182205                case "image": 
    183206                default: 
    184                 html_code = '<img src="' + 
    185                                             imagepopup_images['prefix'] +  
    186                                             objId + '/' + iminfo['name'] + '" alt="' + 
     207                html_code = '<img src="' + iminfo['url'] + '" alt="' + 
    187208                                            iminfo['title'] + '" title="' + 
    188209                                            iminfo['title'] + '"/>'; 
     
    204225            if (itemGuid) 
    205226            { 
     227                var links = imageRows[i].getElementsByTagName('a'); 
     228                var imageUrl = ''; 
     229                for (var li = 0; li < links.length; li++) 
     230                { 
     231                    if (   Element.hasClassName(links[li], 'download') 
     232                        && imageUrl == '') 
     233                    { 
     234                        imageUrl = links[li].getAttribute('href'); 
     235                    } 
     236                } 
     237                 
    206238                item = new Array(); 
    207239                item['guid'] = itemGuid; 
     
    235267                imagepopup_images[itemGuid]['name'] = item['name']; 
    236268                imagepopup_images[itemGuid]['type'] = itemType; 
     269                imagepopup_images[itemGuid]['url'] = imageUrl; 
    237270            } 
    238271        }