diff --git a/mozilla/editor/ui/composer/locale/en-US/editor.properties b/mozilla/editor/ui/composer/locale/en-US/editor.properties index d9f9549938b..54fd873154e 100644 --- a/mozilla/editor/ui/composer/locale/en-US/editor.properties +++ b/mozilla/editor/ui/composer/locale/en-US/editor.properties @@ -86,6 +86,11 @@ PercentOfCell=% of cell PercentOfWindow=% of window PercentOfTable=% of table untitled=untitled +ShowToolbar=Show Toolbar +HideToolbar=Hide Toolbar +ImapError=Unable to load image +ImapCheck=\nPlease select a new location (URL) and try again. +ImapRelative=Relative URLs can only be used on documents which have been saveduntitled=untitled NoNamedAnchors=(No named anchors in this page) NoHeadings=(No headings without anchors) TextColor=Text Color diff --git a/mozilla/editor/ui/dialogs/content/EdImageMap.js b/mozilla/editor/ui/dialogs/content/EdImageMap.js index 6be3f8d39e4..7788e7dd11d 100644 --- a/mozilla/editor/ui/dialogs/content/EdImageMap.js +++ b/mozilla/editor/ui/dialogs/content/EdImageMap.js @@ -19,7 +19,7 @@ * * Contributor(s): * Dan Haddix (dan6992@hotmail.com) - * Brian King + * Brian King (briano9@yahoo.com) */ var tHide = false; @@ -29,6 +29,9 @@ var mapName = ''; var imageMap = null; var imageEl; var srcInputValue = null; +var marquee = null; +var frameDoc = null; +var buttonArray = new Array(); function Startup(){ if (!InitEditorShell()) @@ -57,7 +60,7 @@ function initDialog(){ //check for relative url if (!((srcInput.value.indexOf("http://") != -1) || (srcInput.value.indexOf("file://") != -1))){ if (editorShell.editorDocument.location == "about:blank"){ - alert("Relative URLs can only be used on documents which have been saved"); + alert(GetString("ImapRelative")); window.close(); //TODO: add option to save document now } @@ -120,7 +123,7 @@ function initDialog(){ } function imgError(){ - alert("Error loading image "+srcInputValue+"\nPlease check the URL and try again"); + alert(GetString("ImapError")+" " + srcInputValue+"."+GetString("ImapCheck")); } function fixBgDiv(){ @@ -139,23 +142,23 @@ function hideToolbar(){ // If it is show it document.getElementById("toolbar").setAttribute("collapsed", "false"); // Set the menu items text back to "Hide Toolbar" - document.getElementById("view_hidetoolbar").setAttribute("value", "Hide Toolbar"); + document.getElementById("view_hidetoolbar").setAttribute("value", GetString("HideToolbar")); tHide = false } else{ // If not hide it document.getElementById("toolbar").setAttribute("collapsed", "true"); //Set the menu items text to "Show Toolbar" - document.getElementById("view_hidetoolbar").setAttribute("value", "Show Toolbar"); + document.getElementById("view_hidetoolbar").setAttribute("value", GetString("ShowToolbar")); tHide = true; } } function highContrast(){ - if (highCont){ + if (highCont == true){ frameDoc.getElementById("bgDiv").style.background = "url('chrome://editor/skin/images/Map_checker.gif')"; frameDoc.getElementById("bgDiv").style.backgroundColor = "white"; - imageEl.style.opacity = "1.0"; + imageEl.style.setProperty("-moz-opacity", "1.0", true); document.getElementById("Map:Contrast").setAttribute("checked", "false"); document.getElementById("Map:Contrast").setAttribute("toggled", "false"); highCont = false; @@ -163,7 +166,7 @@ function highContrast(){ else{ frameDoc.getElementById("bgDiv").style.background = "url('')"; frameDoc.getElementById("bgDiv").style.backgroundColor = "#D2D2D2"; - imageEl.style.opacity = ".3"; + imageEl.style.setProperty("-moz-opacity", ".3", true); document.getElementById("Map:Contrast").setAttribute("checked", "true"); document.getElementById("Map:Contrast").setAttribute("toggled", "true"); highCont = true; @@ -171,9 +174,9 @@ function highContrast(){ } function recreateMap(){ - areaCollection = imageMap.childNodes; - areaColLen = areaCollection.length; - for(j=0; j 1){ + currentPoly.style.width = imageEl.offsetWidth+"px"; + currentPoly.style.height = imageEl.offsetHeight+"px"; + } if (!coords){ addPoint(null, startX, startY, true); //currentPoly.onclick = addPoint; currentPoly.style.cursor = "crosshair"; - currentPoly.addEventListener("click", addPoint, false); } else{ var coordArray = coords.split(','); @@ -195,8 +195,8 @@ function Poly(coords, href, target, alt, construct){ function addPoint(event, pointX, pointY, start){ if (event){ dump('addPoint Called with event\n'); - pointX = event.clientX; - pointY = event.clientY; + pointX = event.clientX+window.frames[0].pageXOffset; + pointY = event.clientY+window.frames[0].pageYOffset; event.preventBubble(); if (event.detail == 2){ polyFinish(); @@ -214,7 +214,7 @@ function addPoint(event, pointX, pointY, start){ newPoint.setAttribute("class", "pointStart"); newPoint.style.cursor = "pointer"; //newPoint.onclick = polyFinish; - newPoint.addEventListener("click", polyFinish, false); + //newPoint.addEventListener("click", polyFinish, false); } currentPoly.appendChild(newPoint); } @@ -258,8 +258,8 @@ function polyFinish(event, construct){ //currentPoly.childNodes[0].onclick = null; //currentPoly.onclick = null; currentPoly.style.cursor = "auto"; - currentPoly.childNodes[0].removeEventListener("click", polyFinish, false); - currentPoly.removeEventListener("click", addPoint, false); + //currentPoly.childNodes[0].removeEventListener("click", polyFinish, false); + //currentPoly.removeEventListener("click", addPoint, true); if (!construct) hotSpotProps(currentPoly); } @@ -416,8 +416,8 @@ function upMouse(event){ function moveMouse(event){ if (downTool){ - endX = event.clientX; - endY = event.clientY; + endX = event.clientX+window.frames[0].pageXOffset; + endY = event.clientY+window.frames[0].pageYOffset; if (dragActive){ if (currentElement.length > 0){ @@ -517,8 +517,8 @@ function downMouse(event){ dump(event.target.parentNode.id+"\n"); if (event.button == 1){ if (currentTool != "poly"){ - startX = event.clientX; - startY = event.clientY; + startX = event.clientX+window.frames[0].pageXOffset; + startY = event.clientY+window.frames[0].pageYOffset; downTool = true; if (currentTool == "pointer"){ if (event.target.getAttribute("name") == "hotspot"){ @@ -551,14 +551,14 @@ function downMouse(event){ if (isSelected){ var len = currentElement.length; for(i=0; i currentZoom){ imgEl.setAttribute("width", (parseInt(imgEl.offsetWidth)*(ratio/currentZoom))); - //imgEl.setAttribute("height", (parseInt(imgEl.offsetHeight)*(ratio/currentZoom)); + imgEl.setAttribute("height", (parseInt(imgEl.offsetHeight)*(ratio/currentZoom))); bgDiv.style.width = imgEl.offsetWidth; bgDiv.style.height = imgEl.offsetHeight; } else{ imgEl.setAttribute("width", (parseInt(imgEl.offsetWidth)/(currentZoom/ratio))); - //imgEl.setAttribute("height", (parseInt(imgEl.offsetHeight)/(currentZoom/ratio))); + imgEl.setAttribute("height", (parseInt(imgEl.offsetHeight)/(currentZoom/ratio))); bgDiv.style.width = imgEl.offsetWidth; bgDiv.style.height = imgEl.offsetHeight; }