473,394 Members | 1,734 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,394 software developers and data experts.

Problems with WYSIWYG.

Hi! I have a anoying problem with my editor!

What i want to do is make a popup that holds a string for the "hyperlink"
window...

I have a popup to do this before, and it works perfecty, but in order to
make it work, I have to know the adress of the box I wanna put the value
back in to...

I have this so far :)

window.opener.idLinkURL.value;

But it will not work.
Guess it is wrong adress for my input box.
maby some strange adresses since i'm using a editor...

Can anyone help me figure out the adress for my 'idLinkURL' input
box?????????????????????

Christopher Brandsdal
Here is a cut from my ace.htc:
My problem is marked with:

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
code i have problem with
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX


<!-- Link box -->
<script language=javascript>
var oSelStore;
var sTypeStore;

var oElStore;
var isLayerActive;

function DisplayLinkBox()
{
PopupHide()
linkbox.style.display='block';
setPosition()
var sURL;
var oSel = document.selection.createRange()
var sType = document.selection.type

oSelStore = oSel
sTypeStore = sType

if (oSel.parentElement)//If text is selected on a layer
{
oEl = GetElement(oSel.parentElement(),"DIV")//!
oElStore = oEl;//Store the active layer, so we can activate it after
editing links
isLayerActive=true;
}
else//If control is selected
{
isLayerActive=false;
}
/************************************************** *************************
**/
/* idLinkImage & idLinkImageBorder

/************************************************** *************************
**/
//Is the selection image or not ?
if (oSel.parentElement)//If not an image (such as text)
{
oEl = GetElement(oSel.parentElement(),"A")//Get A element if any
idLinkImage.style.display = "none";//do not display Image features on the
Link Dialog
idLinkImage1.style.display = "none";//do not display Image features on the
Link Dialog
}
else //If a control
{
oEl = GetElement(oSel.item(0),"A")//Get A element if any
if ((oSel.item) && (oSel.item(0).tagName=="IMG")) //If an image
{
idLinkImage.style.display = "block"; //display Image features on the Link
Dialog
idLinkImage1.style.display = "block"; //display Image features on the
Link Dialog
idLinkImageBorder.value = oSel.item(0).border; //get image border
}
}
/************************************************** *************************
**/
/* idLinkTarget & idLinkType & idLinkURL

/************************************************** *************************
**/
//Is there an A element ?
if (oEl)//If Yes
{
btnLinkAction.value = "Update"
sURL = oEl.href //get image url
idLinkTarget.value = oEl.target;//get image target
if(sURL.indexOf(":")!=-1)
{
switch(sURL.split(":")[0])
{
case "http":
idLinkType.value = "http://";
idLinkURL.value = sURL.substr(7);
break;
case "https":
idLinkType.value = "https://";
idLinkURL.value = sURL.substr(8);
break;
case "mailto":
idLinkType.value = "mailto:";
idLinkURL.value = sURL.split(":")[1];
break;
case "ftp":
idLinkType.value = "ftp://";
idLinkURL.value = sURL.substr(6);
break;
case "news":
idLinkType.value = "news:";
idLinkURL.value = sURL.split(":")[1];
break;
}
}
else
{
idLinkType.value = "";
idLinkURL.value = sURL;
}
}
else //If No A element
{
btnLinkAction.value = "Insert";

idLinkTarget.value = ""
idLinkType.value = ""
idLinkURL.value = ""
idLinkImageBorder.value = 0
}

idLinkURL.focus();//tambahan
}

function CreateHyperlink()
{
//idContent.focus()

PopupHide()//Hide Link Dialog

//Get URL typed by user
var inpURL = idLinkURL.value
var inpURLType = idLinkType.value
var sURL = inpURLType + inpURL

//Use the previous active selection
var oSel = oSelStore;// document.selection.createRange()
var sType = sTypeStore;// document.selection.type

/************************************************** *********************/
/* idLinkImageBorder
/************************************************** *********************/
if ((oSel.item) && (oSel.item(0).tagName=="IMG")) //If image is selected
{
oSel.item(0).width = oSel.item(0).offsetWidth //kasih attribute width
oSel.item(0).height = oSel.item(0).offsetHeight //kasih attribute height
oSel.item(0).border = idLinkImageBorder.value
}

if(inpURL!="")//If there is URL typed by user
{
if (oSel.parentElement) //If text selection
{
if(btnLinkAction.value == "Insert")
{
if(oSel.text!="")
{
//noop
}
else
{
var oSelTmp = oSel.duplicate()
oSel.text = sURL //displayed text = sURL
oSel.setEndPoint("StartToStart",oSelTmp)
oSel.select()
sType="Text"
}
}
if(btnLinkAction.value == "Update") //pasti ada A element
{
if(oSel.text!="")
{
//noop
//oEl = GetElement(oSel.parentElement(),"A")
//oEl.innerText = sURL
}
else
{
//noop
//oEl = GetElement(oSel.parentElement(),"A")
//oEl.innerText = sURL
}
}
}

/************************************************** *********************/
/* idLinkType & idLinkURL (sURL)
/************************************************** *********************/
oSel.execCommand("CreateLink",false,sURL)

//After A element created, then add the Target
//oSel = document.selection.createRange()
if (oSel.parentElement)
{
oEl = GetElement(oSel.parentElement(),"A")
}
else
{
oEl = GetElement(oSel.item(0),"A")
}
if(oEl)
{
if(idLinkTarget.value=="")
{
oEl.removeAttribute("target",0)
}
else
{
oEl.target = idLinkTarget.value;
}
}
idContent.focus()
oSel.select()//tambahan
}

//Activate layer again
if(isLayerActive)oElStore.setActive();
}
</script>
<SCRIPT ID=clientEventHandlersJS LANGUAGE="javascript">

function InsertBransje(sField)
{
var ie4 = (document.all && !document.getElementById);
var ie5 = (document.all && document.getElementById);
var ns6 = (!document.all && document.getElementById);

if(ie4 || ie5)
window.open("selectLink.asp?fld=" + sField ,
"SelectImage","scrollbars=Yes,width=506,height=480 ", true);
else
window.open("selectLink.asp?fld=" + sField ,
"SelectImage","scrollbars=Yes,width=506,height=510 ", true);
return false;
}

function popUp(URL) {
day = new Date();
id = day.getTime();
eval("page" + id + " = window.open(URL, '" + id + "',
'scrollbars=Yes,width=506,height=480');");
}

</script>

<div id="linkbox" style="position:absolute;display:none">
<table border="0" cellpadding="0" cellspacing="0" style="table-layout:
fixed" bgcolor=Gainsboro ID="Table1">
<col width=310><col width=13>
<tr>
<td>
<div class="bar" style="padding-left: 5px;">
<font size=2 face=tahoma color=white><b>Sett inn/endre link</b></font>
</div>
</td>
<td style="cursor:hand"
onclick="linkbox.style.display='none';if(isLayerAc tive)oElStore.setActive();
">
<div class="bar">
<font size=2 face=tahoma color=white><b>X</b></font>
</div>
</td>
</tr>
<tr>
<td colspan=2 style="border-left: #336699 1px solid;border-right: #336699
1px solid;border-bottom: #336699 1px solid;">
<br>
<table cellpadding="0" width=310 cellspacing="3" align=center
ID="Table2">
<col width=135><col width=175>
<tr>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
<td class=normalSmall colspan=2><strong><A HREF="#"
LANGUAGE="javascript" onclick="InsertBransje('idLinkURL');">add a link from
another page!!!</a></strong></td>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
</tr>
<tr>
<td class=normalSmall>
<select id="idLinkType" NAME="idLinkType" class=control01
style="width:130">
<option value="" selected></option>
<option value="http://" selected>http://</option>
<option value="https://">https://</option>
<option value="mailto:">mailto:</option>
<option value="ftp://">ftp://</option>
<option value="news:">news:</option>
</select>
</td>
<td class=normalSmall>
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX
<input type=text size=10 id="idLinkURL" value="" class=control01
NAME="idLinkURL" style="width:175">
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX XXXXXXXXXXXXXXXXX

</td>
</tr>
<tr>
<td class=normalSmall>Mål:</td>
<td class=normalSmall>
<select id="idLinkTarget" NAME="idLinkTarget" class=control01
style="width:175">
<option value="" selected>ingen</option>
<option value="_self" selected>i samme rute</option>
<option value="_top" selected>topp</option>
<option value="_blank">blank</option>
<option value="_parent">foreldre</option>
</select>

</td>
</tr>

<tr>
<td class=normalSmall><div id="idLinkImage" style="display:none"><font
class=normalSmall>Bilderamme:</font></div></td>
<td class=normalSmall>
<div id="idLinkImage1" style="display:none">
<select id="idLinkImageBorder" NAME="idLinkImageBorder" class=control01
style="width:175">
<option value="0" selected>0</option>
<option value="1">1</option>
<option value="2">2</option>
<option value="3">3</option>
<option value="4">4</option>
<option value="5">5</option>
</select>
</div>
</td>
</tr>

<tr><td colspan=2 height=6><img
src="images/1px_transparent.gif"></td></tr>
<tr>
<td colspan=2 align=center class=normalSmall>
<input type="button" value="Avbryt"
onclick="linkbox.style.display='none';if(isLayerAc tive)oElStore.setActive();
" ID="Button1" NAME="Button1" class=control01>
<input type="button" id="btnLinkAction" name="btnLinkAction"
value="Sett inn" onclick="CreateHyperlink();linkbox.style.display=' none'"
class=control01>
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- /Link box -->

Jul 19 '05 #1
0 1609

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

3
by: Martin | last post by:
Thanks to all those who assisted me with my last question re: What is the best way to produce WYSIWYG pages for viewing and printing. I think that I have mastered the form with scrolling picture...
6
by: lb | last post by:
Hi I'm looking for a wysiwyg XSTL editor, that actually is wysiwyg. So far every product I have tried out seems to have the idea that wysiwyg is just showing the result of an XML - XSL...
12
by: Justin Koivisto | last post by:
I am having a problem with Internet Explorer and javascript on a WYSIWYG editor I am creating. It all works in Mozilla, but IE returns flase for queryCommandEnabled('forecol'). JS isn't my strong...
19
by: Bill Davidson | last post by:
My wife's friend had a website built for his company, and it looks great using a PC. When viewed on a Mac using either Safari or Explorer the formatting is terrible. The home page is not too...
12
by: Michael Peters | last post by:
für einen Enduser, der kein HTML kann und nur die Contents auf statischen Seiten ändern will, brauche ich einen einfach zu bedienenden WYSIWYG-Editor. Wäre dankbar für Empfehlungen! -m
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: nemocccc | last post by:
hello, everyone, I want to develop a software for my android phone for daily needs, any suggestions?
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.