add an error check to reduce output to console; comment out an alert; uncomment insertion to reproduce bug; add a dump line

git-svn-id: svn://10.0.0.236/trunk@63603 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
brade%netscape.com
2000-03-21 20:55:56 +00:00
parent 09020054b2
commit 2fcbb3d484

View File

@@ -110,24 +110,26 @@ function recreateMap(){
map = imageElement.getAttribute("usemap"); map = imageElement.getAttribute("usemap");
map = map.substring(1, map.length); map = map.substring(1, map.length);
mapCollection = imageElement.ownerDocument.getElementsByName(map); mapCollection = imageElement.ownerDocument.getElementsByName(map);
areaCollection = mapCollection[0].childNodes; if (mapCollection){
var len = areaCollection.length; areaCollection = mapCollection[0].childNodes;
for(j=0; j<len; j++){ var len = areaCollection.length;
area = areaCollection[j]; for(j=0; j<len; j++){
shape = area.getAttribute("shape"); area = areaCollection[j];
shape = shape.toLowerCase(); shape = area.getAttribute("shape");
coords = area.getAttribute("coords"); shape = shape.toLowerCase();
href = area.getAttribute("href"); coords = area.getAttribute("coords");
target = area.getAttribute("target"); href = area.getAttribute("href");
alt = area.getAttribute("alt"); target = area.getAttribute("target");
if (shape == "rect") alt = area.getAttribute("alt");
Rect(coords, href, target, alt, true); if (shape == "rect")
else if (shape == "circle") Rect(coords, href, target, alt, true);
Circle(coords, href, target, alt, true); else if (shape == "circle")
else Circle(coords, href, target, alt, true);
Poly(coords, href, target, alt, true); else
Poly(coords, href, target, alt, true);
}
imageElement.ownerDocument.removeChild(mapCollection[0]);
} }
imageElement.ownerDocument.removeChild(mapCollection[0]);
} }
function finishMap(){ function finishMap(){
@@ -145,8 +147,9 @@ function finishMap(){
createPoly(curSpot); createPoly(curSpot);
} }
imageElement.setAttribute("usemap", ("#"+mapName)); imageElement.setAttribute("usemap", ("#"+mapName));
alert(imageMap); // alert(imageMap);
//editorShell.InsertElementAtSelection(imageMap, false); editorShell.InsertElementAtSelection(imageMap, false);
dump("image map element inserted\n");
} }
return true; return true;
} }