473,386 Members | 1,712 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,386 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 1608

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: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
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...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
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...

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.