Changeset 13613
- Timestamp:
- 11/23/07 13:45:43 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.helper.imagepopup/static/functions.js
r12014 r13613 18 18 if (imageGuid) 19 19 { 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 20 31 image = new Array(); 21 32 image['guid'] = imageGuid; … … 58 69 imagepopup_images[imageGuid]['name'] = image['name']; 59 70 imagepopup_images[imageGuid]['type'] = 'image'; 71 imagepopup_images[imageGuid]['url'] = imageUrl; 60 72 } 61 73 } … … 73 85 if (imageGuid) 74 86 { 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 75 98 image = new Array(); 76 99 image['guid'] = imageGuid; … … 113 136 imagepopup_images[imageGuid]['name'] = image['name']; 114 137 imagepopup_images[imageGuid]['type'] = 'attachment'; 138 imagepopup_images[imageGuid]['url'] = imageUrl; 115 139 116 140 } … … 160 184 161 185 // Close the popup 162 window.close();186 //window.close(); 163 187 } 164 188 … … 175 199 176 200 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>'; 179 202 180 203 break; … … 182 205 case "image": 183 206 default: 184 html_code = '<img src="' + 185 imagepopup_images['prefix'] + 186 objId + '/' + iminfo['name'] + '" alt="' + 207 html_code = '<img src="' + iminfo['url'] + '" alt="' + 187 208 iminfo['title'] + '" title="' + 188 209 iminfo['title'] + '"/>'; … … 204 225 if (itemGuid) 205 226 { 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 206 238 item = new Array(); 207 239 item['guid'] = itemGuid; … … 235 267 imagepopup_images[itemGuid]['name'] = item['name']; 236 268 imagepopup_images[itemGuid]['type'] = itemType; 269 imagepopup_images[itemGuid]['url'] = imageUrl; 237 270 } 238 271 }
