latest changes to image map editor (submitted by Dan Haddix; dan6992@hotmail.com)

This commit is contained in:
brade%netscape.com 2000-03-21 12:52:05 +00:00
parent 9cd675cfab
commit 38a5bbb22e
7 changed files with 309 additions and 182 deletions

View File

@ -19,14 +19,14 @@
- Rights Reserved.
-
- Contributor(s):
- Brian King
- Dan Haddix (dan6992@hotmail.com)
- Brian King
- Dan Haddix
-->
<?xml-stylesheet href="chrome://editor/skin/EdImageMap.css" type="text/css"?>
<!-- <?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?> -->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://editor/skin/" type="text/css"?>
<?xul-overlay href="chrome://global/content/dialogOverlay.xul"?>
@ -57,7 +57,9 @@
<keyset id="defaultKeySet">
<key id="mapclearkb" xulkey="true" key="a" observes="Map:Clear" />
<key id="deletespot" keycode="VK_DELETE" onkeypress="deleteElement(currentElement)" />
<key id="mapclearkb" xulkey="true" key="d" observes="Map:Clear" />
<key id="mapselectkb" xulkey="true" key="a" observes="Map:SelectAll" />
<key id="mapclosekb" xulkey="true" key="l" observes="Map:Close" />
<key id="mapcutkb" xulkey="true" key="x" observes="Map:Cut" />
<key id="mapcopykb" xulkey="true" key="c" observes="Map:Copy" />
@ -69,17 +71,19 @@
<broadcaster id="Map:Clear" value="&clearCmd.label;" oncommand=""/>
<broadcaster id="Map:Close" value="&closeCmd.label;" oncommand="exitImageMap()"/>
<broadcaster id="Map:Cut" value="&cutCmd.label;" oncommand=""/>
<broadcaster id="Map:Copy" value="&copyCmd.label;" oncommand=""/>
<broadcaster id="Map:Paste" value="&pasteCmd.label;" oncommand=""/>
<broadcaster id="Map:Copy" value="&copyCmd.label;" disabled="true" oncommand="cutCopy()"/>
<broadcaster id="Map:Cut" value="&cutCmd.label;" disabled="true" oncommand="cutCopy(true)"/>
<broadcaster id="Map:Paste" value="&pasteCmd.label;" disabled="true" oncommand="paste()"/>
<broadcaster id="Map:Props" value="&propsCmd.label;" oncommand="hotSpotProps(currentElement[0])"/>
<broadcaster id="Map:ViewToolbar" value="&showhideTbarCmd.label;" oncommand="hideToolbar()"/>
<broadcaster id="Map:Apercent" value="&apercentCmd.label;" oncommand=""/>
<broadcaster id="Map:Bpercent" value="&bpercentCmd.label;" oncommand=""/>
<broadcaster id="Map:Cpercent" value="&cpercentCmd.label;" oncommand=""/>
<broadcaster id="Map:Apercent" value="&apercentCmd.label;" checked="true" oncommand="zoom('', 1)"/>
<broadcaster id="Map:Bpercent" value="&bpercentCmd.label;" oncommand="zoom('', 2)"/>
<broadcaster id="Map:Cpercent" value="&cpercentCmd.label;" oncommand="zoom('', 4)"/>
<broadcaster id="Map:Contrast" value="&contrastCmd.label;" onaction=""/>
<broadcaster id="Map:About" value="&aboutCmd.label;" onaction=""/>
<broadcaster id="Map:ZoomIn" value="&zoominCmd.label;" oncommand="zoom('in')"/>
<broadcaster id="Map:ZoomOut" value="&zoomoutCmd.label;" disabled="true" oncommand="zoom('out')"/>
<broadcaster id="Map:SelectAll" value="&selectallCmd.label;" oncommand="selectAll()"/>
<!-- Interim hack to transition from nsIXULWindowCallbacks/ShowWindowWithArgs -->
<broadcaster id="dialog.start" ready="false"/>
@ -97,6 +101,7 @@
<!-- Edit menu -->
<menu id="mapeditMenu" value="&mapeditMenu.label;" accesskey="&mapeditmenu.accesskey;">
<menupopup>
<menuitem accesskey="&mapselectall.accesskey;" key="mapselectkb" observes="Map:SelectAll"/>
<menuitem accesskey="&mapeditcut.accesskey;" key="mapcutkb" observes="Map:Cut"/>
<menuitem accesskey="&mapeditcopy.accesskey;" key="mapcopykb" observes="Map:Copy"/>
<menuitem accesskey="&mapeditpaste.accesskey;" key="mappastekb" observes="Map:Paste"/>
@ -132,11 +137,11 @@
<toolbar id="toolbar" class="standard" persist="collapsed">
<titledbutton id="cutButton" class="button28" onclick=""/>
<titledbutton id="copyButton" class="button28" onclick=""/>
<titledbutton id="pasteButton" class="button28" onclick=""/>
<titledbutton id="zoomInButton" class="button28" onclick=""/>
<titledbutton id="zoomOutButton" class="button28" onclick=""/>
<titledbutton id="cutButton" class="button28" observes="Map:Cut"/>
<titledbutton id="copyButton" class="button28" observes="Map:Copy"/>
<titledbutton id="pasteButton" class="button28" observes="Map:Paste"/>
<titledbutton id="zoomInButton" class="button28" observes="Map:ZoomIn"/>
<titledbutton id="zoomOutButton" class="button28" observes="Map:ZoomOut"/>
<titledbutton id="contrastButton" class="button28" toggled="0" onclick="highContrast()"/>
<spring flex="100%"/>
</toolbar>
@ -145,10 +150,10 @@
<box align="horizontal" flex="100">
<toolbar id="toolbox" align="vertical">
<titledbutton id="pointer" class="other28" onclick="changeTool(event, 'pointer')"/>
<titledbutton id="rect" class="other28" onclick="changeTool(event, 'rect')"/>
<titledbutton id="cir" class="other28" onclick="changeTool(event, 'cir')"/>
<titledbutton id="poly" class="other28" onclick="changeTool(event, 'poly')"/>
<titledbutton id="pointerButton" class="tool" toggled="1" onclick="changeTool(event, 'pointer')"/>
<titledbutton id="rectButton" class="tool" onclick="changeTool(event, 'rect')"/>
<titledbutton id="cirButton" class="tool" onclick="changeTool(event, 'cir')"/>
<titledbutton id="polyButton" class="tool" onclick="changeTool(event, 'poly')"/>
<spring flex="100%"/>
</toolbar>
@ -163,12 +168,12 @@
<box align="horizontal">
<!-- Cheap hack untill I get key events hooked up -->
<!-- Cheap hack until I get key events hooked up
<titledbutton
class = "push dialog"
id = "DelButton"
value="&delSpotCmd.label;"
onclick="deleteElement(currentElement)"/>
onclick="deleteElement(currentElement)"/> -->
<spring flex="100%"/>

View File

@ -14,7 +14,7 @@
*
* The Initial Developer of the Original Code is Netscape
* Communications Corporation. Portions created by Netscape are
* Copyright (C) 1999-2000 Netscape Communications Corporation. All
* Copyright (C) 1998-2000 Netscape Communications Corporation. All
* Rights Reserved.
*
* Contributor(s):
@ -34,30 +34,54 @@ function Startup()
// Create dialog object to store controls for easy access
dialog = new Object;
dialog.urlInput = document.getElementById("urlInput");
dialog.targetInput = document.getElementById("targetInput");
dialog.altInput = document.getElementById("altInput");
dialog.commonInput = document.getElementById("commonInput");
dialog.url = window.arguments[0].getAttribute("href");
dialog.hsHref = window.arguments[0].getAttribute("hsHref");
if (dialog.hsHref != '')
dialog.urlInput.value = dialog.hsHref;
if (dialog.url != '')
dialog.urlInput.value = dialog.url;
dialog.hsAlt = window.arguments[0].getAttribute("hsAlt");
if (dialog.hsAlt != '')
dialog.altInput.value = dialog.hsAlt;
// Kinda clunky: Message was wrapped in a <p>,
// so actual message is a child text node
//dialog.srcMessage = (document.getElementById("srcMessage")).firstChild;
//if (null == dialog.srcInput ||
// null == dialog.srcMessage )
//{
// dump("Not all dialog controls were found!!!\n");
//}
// Set initial focus
dialog.hsTarget = window.arguments[0].getAttribute("hsTarget");
if (dialog.hsTarget != ''){
dialog.targetInput.value = dialog.hsTarget;
len = dialog.commonInput.length;
for (i=0; i<len; i++){
if (dialog.hsTarget == dialog.commonInput.options[i].value)
dialog.commonInput.options[i].selected = "true";
}
}
dialog.urlInput.focus();
dialog.urlInput.select();
}
function onOK()
{
dump(window.arguments[0].id+"\n");
window.arguments[0].setAttribute("href", dialog.urlInput.value);
window.arguments[0].setAttribute("hsHref", dialog.urlInput.value);
window.arguments[0].setAttribute("hsAlt", dialog.altInput.value);
window.arguments[0].setAttribute("hsTarget", dialog.targetInput.value);
window.close();
}
function changeTarget() {
dialog.targetInput.value = dialog.commonInput.options[dialog.commonInput.selectedIndex].value;
}
function chooseFile()
{
// Get a local file, converted into URL format
fileName = editorShell.GetLocalFileURL(window, "img");
if (fileName && fileName != "") {
dialog.urlInput.value = fileName;
}
// Put focus into the input field
dialog.urlInput.focus();
}

View File

@ -19,8 +19,8 @@
- Rights Reserved.
-
- Contributor(s):
- Brian King
- Dan Haddix (dan6992@hotmail.com)
- Brian King
- Dan Haddix
-->
<?xml-stylesheet href="chrome://global/skin/" type="text/css"?>
<?xml-stylesheet href="chrome://navigator/skin/" type="text/css"?>
@ -31,100 +31,62 @@
<!DOCTYPE window SYSTEM "chrome://editor/locale/EditorImageMapHotSpot.dtd">
<window class="dialog" title="&windowTitle.label;"
xmlns ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns:html="http://www.w3.org/TR/REC-html40"
<xul:window class="dialog" title="&windowTitle.label;"
xmlns:xul ="http://www.mozilla.org/keymaster/gatekeeper/there.is.only.xul"
xmlns="http://www.w3.org/TR/REC-html40"
onload = "Startup()"
align="vertical">
<!-- Methods common to all editor dialogs -->
<html:script language="JavaScript" src="chrome://editor/content/EdDialogCommon.js" />
<html:script language="JavaScript" src="chrome://global/content/dialogOverlay.js" />
<script language="JavaScript" src="chrome://editor/content/EdDialogCommon.js"/>
<script language="JavaScript" src="chrome://global/content/dialogOverlay.js"/>
<script language="JavaScript" src="chrome://editor/content/EdImageMapHotSpot.js"/>
<html:script language="JavaScript" src="chrome://editor/content/EdImageMapHotSpot.js" />
<xul:broadcaster id="args" value=""/>
<broadcaster id="args" value=""/>
<html:table>
<html:tr>
<html:td>
<html:label for="urlInput" id="urlLabel">&urlFieldset.label;</html:label>
<table border="1" cellspacing="0" cellpadding="0">
<tr>
<td>
<label for="urlInput" id="urlLabel">&urlFieldset.label;</label>
<br/>
<input type="text" id="urlInput" value="http://" size="30"/>
</td>
<td valign="bottom">
<xul:titledbutton class="push dialog" id="Browse" onclick = "chooseFile()" value="&browseButton.label;"/>
</td>
</tr>
<tr>
<td>
<label for="altInput" id="titleLabel">&altFieldset.label;</label>
<br/>
<input type="text" id="altInput" size="30"/>
</td>
</tr>
<tr>
<td valign="middle">
<fieldset style="height:100%; padding:5">
<legend class="dialog" id="targetLabel" align="left">&targetFieldset.label;</legend>
<label for="targetInput" id="targetLabel">&target.label;</label>
<br/>
<input type="text" id="targetInput" size="20"/>
</fieldset>
</td>
<td>
<fieldset style="height:100%; padding:5">
<legend class="dialog" id="commonLabel" align="center">&commonFieldset.label;</legend>
<select name="common_targets" id="commonInput" size="4" onclick="changeTarget()" onchange="changeTarget()">
<option value="_self">Same Frame</option>
<option value="_top">Whole Page</option>
<option value="_blank">New Window</option>
<option value="_parent">Parent Frame</option>
</select>
</fieldset>
</td>
</tr>
</table>
<html:br/>
<html:td valign="left">
<html:input
type="text"
id="urlInput"
size="30"/>
</html:td>
<html:td valign="right">
<titledbutton
class = "push dialog"
id = "Browse"
onclick = "chooseFile()"
value = "&browseButton.label;"/>
</html:td>
</html:td>
</html:tr>
<html:tr>
<html:td>
<html:label for="titleInput" id="titleLabel">&titleFieldset.label;</html:label>
<html:br/>
<html:input type="text" id="titleInput" size="30"/>
</html:td>
</html:tr>
<html:tr>
<html:td>
<html:fieldset>
<html:legend
class = "dialog"
id = "targetLabel"
align = "left">
&targetFieldset.label;
</html:legend>
<html:label for="targetInput" id="targetLabel">&target.label;</html:label>
<html:br/>
<html:input type="text" id="targetInput" size="20"/>
</html:fieldset>
</html:td>
<html:td>
<html:fieldset>
<html:legend
class = "dialog"
id = "commonLabel"
align = "center">
&commonFieldset.label;
</html:legend>
<html:select name="common_targets" id="commonInput" size="4">
<html:option selected="true">Same Frame</html:option>
<html:option>Whole Page</html:option>
<html:option>New Window</html:option>
<html:option>Parent Frame</html:option>
</html:select>
</html:fieldset>
</html:td>
</html:tr>
</html:table>
<box align="horizontal">
<!-- from global dialogOverlay -->
<box id="okCancelButtons"/>
</box>
</window>
<xul:box align="horizontal">
<xul:box id="okCancelButtons"/>
</xul:box>
</xul:window>

View File

@ -50,8 +50,9 @@ var frameDoc = null;
var buttonArray = new Array();
var resize = false;
var currentZoom = 1;
var clipBoard = new Array();
function Rect(coords, href, target, title, construct){
function Rect(coords, href, target, alt, construct){
newRect = frameDoc.createElement("div");
newRect.setAttribute("class", "rect");
newRect.setAttribute("id", "rect"+rectCount++);
@ -106,17 +107,17 @@ function Rect(coords, href, target, title, construct){
currentRect.style.width = (parseInt(coordArray[2])-parseInt(coordArray[0]))+"px";
currentRect.style.height = (parseInt(coordArray[3])-parseInt(coordArray[1]))+"px";
if (href)
currentRect.setAttribute("href", href);
currentRect.setAttribute("hsHref", href);
if (target)
currentRect.setAttribute("target", target);
if (title)
currentRect.setAttribute("title", title);
currentRect.setAttribute("hsTarget", target);
if (alt)
currentRect.setAttribute("hsAlt", alt);
}
if (construct)
currentRect = null;
}
function Circle(coords, href, target, title, construct){
function Circle(coords, href, target, alt, construct){
newCir = frameDoc.createElement("div");
newCir.setAttribute("class", "cir");
newCir.setAttribute("id", "cir"+cirCount++);
@ -155,25 +156,25 @@ function Circle(coords, href, target, title, construct){
currentCir.style.width = (radius*2)+"px";
currentCir.style.height = (radius*2)+"px";
if (href)
currentCir.setAttribute("href", href);
currentCir.setAttribute("hsHref", href);
if (target)
currentCir.setAttribute("target", target);
if (title)
currentCir.setAttribute("title", title);
currentCir.setAttribute("hsTarget", target);
if (alt)
currentCir.setAttribute("hsAlt", alt);
}
if (construct)
currentCir = null;
/*cirImg = frameDoc.createElement("img");
cirImg.setAttribute("src", "circleobject.gif");
cirImg.setAttribute("name", "hotspot");
cirImg.setAttribute("cir", "true");
cirImg.style.width = "100%";
cirImg.style.height = "100%";
currentCir.appendChild(cirImg);*/
//cirImg = frameDoc.createElement("img");
//cirImg.setAttribute("src", "chrome://editor/skin/images/Map_circleObject.gif");
//cirImg.setAttribute("name", "hotspot");
//cirImg.setAttribute("cir", "true");
//cirImg.style.width = "100%";
//cirImg.style.height = "100%";
//currentCir.appendChild(cirImg);
}
function Poly(coords, href, target, title, construct){
function Poly(coords, href, target, alt, construct){
dump('Poly Called\n');
newPoly = frameDoc.createElement("div");
newPoly.setAttribute("class", "poly");
@ -193,11 +194,11 @@ function Poly(coords, href, target, title, construct){
i++;
}
if (href)
currentPoly.setAttribute("href", href);
currentPoly.setAttribute("hsHref", href);
if (target)
currentPoly.setAttribute("target", target);
if (title)
currentPoly.setAttribute("title", title);
currentPoly.setAttribute("hsTarget", target);
if (alt)
currentPoly.setAttribute("hsAlt", alt);
polyFinish(null, construct);
}
}
@ -291,6 +292,16 @@ function deleteElement(el){
}
}
function selectAll(){
objList = frameDoc.getElementsByName("hotspot");
listLen = objList.length;
var objCount = 0;
for(a=0; a<listLen; a++){
selectElement(objList[a], objCount);
objCount++;
}
}
function selectElement(el, add){
if (add){
if (currentElement[0].getAttribute("class") != "poly"){
@ -299,6 +310,8 @@ function selectElement(el, add){
currentElement[0].childNodes[i].style.visibility = "hidden";
}
currentElement.push(el);
document.getElementById("Map:Cut").setAttribute("disabled", "false");
document.getElementById("Map:Copy").setAttribute("disabled", "false");
return currentElement[currentElement.length-1];
}
else{
@ -312,13 +325,21 @@ function selectElement(el, add){
currentElement = null;
currentElement = new Array();
currentElement[0] = el;
if (el != null){
if (currentElement[0].getAttribute("class") != "poly"){
len = currentElement[0].childNodes.length;
for(i=0; i<len; i++)
currentElement[0].childNodes[i].style.visibility = "visible";
}
document.getElementById("Map:Cut").setAttribute("disabled", "false");
document.getElementById("Map:Copy").setAttribute("disabled", "false");
return currentElement[0];
}
else{
document.getElementById("Map:Cut").setAttribute("disabled", "true");
document.getElementById("Map:Copy").setAttribute("disabled", "true");
}
}
}
function deSelectElement(el){
@ -331,7 +352,14 @@ function deSelectElement(el){
j++;
}
currentElement.pop();
dump(currentElement.length+"\n");
if (currentElement.length >= 1){
document.getElementById("Map:Cut").setAttribute("disabled", "false");
document.getElementById("Map:Copy").setAttribute("disabled", "false");
}
else{
document.getElementById("Map:Cut").setAttribute("disabled", "true");
document.getElementById("Map:Copy").setAttribute("disabled", "true");
}
}
function marqueeSelect(){
@ -340,22 +368,22 @@ function marqueeSelect(){
marRight = parseInt(marquee.style.width)+marLeft;
marBottom = parseInt(marquee.style.height)+marTop;
marquee.style.visibility = "hidden";
marquee.style.top = "1px";
marquee.style.left = "1px";
marquee.style.top = "-5px";
marquee.style.left = "-5px";
marquee.style.width = "1px";
marquee.style.height = "1px";
marquee = null;
objList = frameDoc.getElementsByName("hotspot");
len = objList.length;
listLen = objList.length;
var objCount = 0;
for(i=0; i<len; i++){
objTop = parseInt(objList[i].style.top);
objLeft = parseInt(objList[i].style.left);
objRight = parseInt(objList[i].style.width)+objLeft;
objBottom = parseInt(objList[i].style.height)+objTop;
for(a=0; a<listLen; a++){
objTop = parseInt(objList[a].style.top);
objLeft = parseInt(objList[a].style.left);
objRight = parseInt(objList[a].style.width)+objLeft;
objBottom = parseInt(objList[a].style.height)+objTop;
if ((objTop >= marTop) && (objLeft >= marLeft) && (objBottom <= marBottom) && (objRight <= marRight)){
//objList[i].style.borderColor = "#ffff00";
selectElement(objList[i], objCount);
selectElement(objList[a], objCount);
objCount++;
}
}
@ -482,7 +510,7 @@ function moveMouse(event){
}
else{
marquee = frameDoc.getElementById("marquee");
marquee.style.visibility = "inherit";
marquee.style.visibility = "visible";
dragActive = true;
}
}
@ -610,7 +638,7 @@ function downMouse(event){
function clickMouse(event){
if (event.button == 1){
dump("body clicked\n");
dump(window.frames[0].pageXOffset+'\n');
//alert(frameDoc.+'\n');
startX = event.clientX;
startY = event.clientY;
if (currentTool == "poly"){
@ -631,6 +659,13 @@ function changeTool(event, what){
currentTool = what;
dump(what+" selected\n");
}
else {
for(i=0; i<4; i++){
if (event.target == buttonArray[i]){
buttonArray[i].setAttribute("toggled", 1);
}
}
}
}
function zoom(direction, ratio){
@ -643,6 +678,28 @@ function zoom(direction, ratio){
if (ratio > 4 || ratio < 1 || ratio == currentZoom)
return;
if (ratio == 1){
document.getElementById('Map:ZoomIn').setAttribute('disabled', 'false');
document.getElementById('Map:ZoomOut').setAttribute('disabled', 'true');
document.getElementById('Map:Apercent').setAttribute('checked', 'true');
document.getElementById('Map:Bpercent').setAttribute('checked', 'false');
document.getElementById('Map:Cpercent').setAttribute('checked', 'false');
}
else if (ratio == 4){
document.getElementById('Map:ZoomIn').setAttribute('disabled', 'true');
document.getElementById('Map:ZoomOut').setAttribute('disabled', 'false');
document.getElementById('Map:Apercent').setAttribute('checked', 'false');
document.getElementById('Map:Bpercent').setAttribute('checked', 'false');
document.getElementById('Map:Cpercent').setAttribute('checked', 'true');
}
else {
document.getElementById('Map:ZoomIn').setAttribute('disabled', 'false');
document.getElementById('Map:ZoomOut').setAttribute('disabled', 'false');
document.getElementById('Map:Apercent').setAttribute('checked', 'false');
document.getElementById('Map:Bpercent').setAttribute('checked', 'true');
document.getElementById('Map:Cpercent').setAttribute('checked', 'false');
}
objList = frameDoc.getElementsByName("hotspot");
len = objList.length;
for(i=0; i<len; i++){
@ -685,10 +742,63 @@ function zoom(direction, ratio){
if (ratio > currentZoom){
imgEl.setAttribute("width", (parseInt(imgEl.getAttribute("width"))*(ratio/currentZoom)));
imgEl.setAttribute("height", (parseInt(imgEl.getAttribute("height"))*(ratio/currentZoom)));
frameDoc.getElementById("bgDiv").style.width = (parseInt(frameDoc.getElementById("bgDiv").style.width)*(ratio/currentZoom));
}
else{
imgEl.setAttribute("width", (parseInt(imgEl.getAttribute("width"))/(currentZoom/ratio)));
imgEl.setAttribute("height", (parseInt(imgEl.getAttribute("height"))/(currentZoom/ratio)));
frameDoc.getElementById("bgDiv").style.width = (parseInt(frameDoc.getElementById("bgDiv").style.width)*(ratio/currentZoom));
}
currentZoom = ratio;
}
}
function cutCopy(cut){
len = currentElement.length;
if (len >= 1){
clipBoard = new Array();
for (i=0; i<len; i++){
el = currentElement[i];
if (el.className == 'rect'){
coords = parseInt(el.style.left)+","+parseInt(el.style.top)+","+(parseInt(el.style.left)+parseInt(el.style.width))+","+(parseInt(el.style.top)+parseInt(el.style.height));
href = el.getAttribute('hsHref');
target = el.getAttribute('hsTarget');
alt = el.getAttribute('hsAlt');
clipBoard[i] = 'Rect(\"'+coords+'\", \"'+href+'\", \"'+target+'\", \"'+alt+'\", true)';
}
else if (el.className == 'cir'){
radius = Math.floor(parseInt(el.style.width)/2);
coords = (parseInt(el.style.left)+radius)+","+(parseInt(el.style.top)+radius)+","+radius;
href = el.getAttribute('href');
target = el.getAttribute('hsTarget');
alt = el.getAttribute('hsAlt');
clipBoard[i] = 'Circle(\"'+coords+'\", \"'+href+'\", \"'+target+'\", \"'+alt+'\", true)';
}
else{
var coords = '';
var pointlen = el.childNodes.length;
for(j=0; j<pointlen; j++){
coords += (parseInt(el.style.left)+parseInt(el.childNodes[j].style.left))+","+(parseInt(el.style.top)+parseInt(el.childNodes[j].style.top))+",";
}
coords = coords.substring(0, (coords.length-1));
href = el.getAttribute('href');
target = el.getAttribute('hsTarget');
alt = el.getAttribute('hsAlt');
clipBoard[i] = 'Poly(\"'+coords+'\", \"'+href+'\", \"'+target+'\", \"'+alt+'\", true)';
}
if (cut){
deleteElement(el);
}
}
document.getElementById('Map:Paste').setAttribute('disabled', 'false');
}
}
function paste(){
len = clipBoard.length;
func = '';
for (i=0; i<len; i++){
func += clipBoard[i]+'\;';
}
eval(func);
}

View File

@ -44,6 +44,8 @@
<!ENTITY mapeditcopy.accesskey "c">
<!ENTITY pasteCmd.label "Paste">
<!ENTITY mapeditpaste.accesskey "p">
<!ENTITY selectallCmd.label "Select All">
<!ENTITY mapselectall.accesskey "s">
<!ENTITY propsCmd.label "Hotspot Properties">
<!ENTITY mapeditprops.accesskey "h">
@ -54,13 +56,13 @@
<!ENTITY mapviewtbar.accesskey "t">
<!-- Scaling -->
<!ENTITY mapviewScale.label "Scale">
<!ENTITY mapviewscale.accesskey "v">
<!ENTITY mapviewscale.accesskey "S">
<!ENTITY apercentCmd.label "100">
<!ENTITY zoomone.accesskey "1">
<!ENTITY bpercentCmd.label "200">
<!ENTITY zoomtwo.accesskey "2">
<!ENTITY cpercentCmd.label "400">
<!ENTITY zoomthree.accesskey "3">
<!ENTITY zoomthree.accesskey "4">
<!-- end scaling-->
<!ENTITY contrastCmd.label "Contrast">
<!ENTITY contrast.accesskey "n">
@ -71,4 +73,6 @@
<!ENTITY aboutCmd.label "About">
<!ENTITY about.accesskey "b">
<!ENTITY zoominCmd.label "Zoom In">
<!ENTITY zoomoutCmd.label "Zoom Out">
<!ENTITY delSpotCmd.label "Delete Spot">

View File

@ -21,42 +21,64 @@
* Dan Haddix
*/
titledbutton#pointer {
toolbar#toolbox {
margin :0px;
padding: 4px; 0px; 0px; 0px;
}
toolbar#toolbox titledbutton.tool:active {
margin: 2px 0px 0px 2px;
}
toolbar#toolbox titledbutton.tool[toggled="1"] {
margin: 2px 0px 0px 2px;
border: 1px white inset;
}
toolbar#toolbox titledbutton.tool {
border: 1px solid transparent;
margin: 1px 1px 1px 1px;
padding: 2px;
text-decoration: none;
color: inherit;
}
toolbar#toolbox titledbutton#pointerButton {
list-style-image:url("chrome://editor/skin/images/Map_pointerTool.gif");
}
titledbutton#rect {
toolbar#toolbox titledbutton#rectButton {
list-style-image:url("chrome://editor/skin/images/Map_rectangleTool.gif");
}
titledbutton#cir {
toolbar#toolbox titledbutton#cirButton {
list-style-image:url("chrome://editor/skin/images/Map_circleTool.gif");
}
titledbutton#poly {
toolbar#toolbox titledbutton#polyButton {
list-style-image:url("chrome://editor/skin/images/Map_polygonTool.gif");
}
titledbutton#cutButton {
toolbar#toolbar titledbutton#cutButton {
list-style-image:url("chrome://editor/skin/images/Map_Cut.gif");
}
titledbutton#copyButton {
toolbar#toolbar titledbutton#copyButton {
list-style-image:url("chrome://editor/skin/images/Map_Copy.gif");
}
titledbutton#pasteButton {
toolbar#toolbar titledbutton#pasteButton {
list-style-image:url("chrome://editor/skin/images/Map_Paste.gif");
}
titledbutton#zoomInButton {
toolbar#toolbar titledbutton#zoomInButton {
list-style-image:url("chrome://editor/skin/images/Map_zoomIn.gif");
}
titledbutton#zoomOutButton {
toolbar#toolbar titledbutton#zoomOutButton {
list-style-image:url("chrome://editor/skin/images/Map_zoomOut.gif");
}
titledbutton#contrastButton {
toolbar#toolbar titledbutton#contrastButton {
list-style-image:url("chrome://editor/skin/images/Map_contrast.gif");
}
}

View File

@ -23,7 +23,7 @@
*/
.rect {position:absolute; top:1px; left:1px; height:1px; width:1px; border: 1 solid #0000ff;}
.cir {position:absolute; top:1px; left:1px; height:1px; width:1px; border: 1 solid #00ff00;}
.cir {position:absolute; top:1px; left:1px; height:1px; width:1px; border: 1 solid #00ff00; -moz-border-radius: 50%;}
.poly {position:absolute; top:0px; left:0px; height:1000; width:100%;}
.point {position:absolute; top:1px; left:1px; height:3px; width:3px; background-color:#ff0000;}
.pointStart {position:absolute; top:1px; left:1px; height:3px; width:3px; background-color:#8000ff;}
@ -35,6 +35,6 @@
.handler {position:absolute; top:48%; left:100%; height:5px; width:5px; background-color:#ff00ff;}
.handlet {position:absolute; top:-5px; left:48%; height:5px; width:5px; background-color:#ff00ff;}
.handleb {position:absolute; top:100%; left:48%; height:5px; width:5px; background-color:#ff00ff;}
#marquee {position:absolute; top:1px; left:1px; height:1px; width:1px; border: 1 dashed #0000ff; z-index:10000}
#bgDiv {position:absolute; top:0px; left:0px; width:inherit; background: url("chrome://editor/skin/images/Map_checker.gif");}
BODY {background-color:grey;}
#marquee {position:absolute; top:1px; left:-5px; height:-5px; width:1px; border: 1 dashed #0000ff; z-index:10000; visibility: hidden;}
#bgDiv {position:absolute; top:0px; left:0px; width:1; background:url("chrome://editor/skin/images/Map_checker.gif");}
BODY {background-color:appworkspace;}