473,769 Members | 2,120 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.i dLinkURL.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:

XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXX
code i have problem with
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXX


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

var oElStore;
var isLayerActive;

function DisplayLinkBox( )
{
PopupHide()
linkbox.style.d isplay='block';
setPosition()
var sURL;
var oSel = document.select ion.createRange ()
var sType = document.select ion.type

oSelStore = oSel
sTypeStore = sType

if (oSel.parentEle ment)//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=t rue;
}
else//If control is selected
{
isLayerActive=f alse;
}
/*************** *************** *************** *************** ***************
**/
/* idLinkImage & idLinkImageBord er

/*************** *************** *************** *************** ***************
**/
//Is the selection image or not ?
if (oSel.parentEle ment)//If not an image (such as text)
{
oEl = GetElement(oSel .parentElement( ),"A")//Get A element if any
idLinkImage.sty le.display = "none";//do not display Image features on the
Link Dialog
idLinkImage1.st yle.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).t agName=="IMG")) //If an image
{
idLinkImage.sty le.display = "block"; //display Image features on the Link
Dialog
idLinkImage1.st yle.display = "block"; //display Image features on the
Link Dialog
idLinkImageBord er.value = oSel.item(0).bo rder; //get image border
}
}
/*************** *************** *************** *************** ***************
**/
/* idLinkTarget & idLinkType & idLinkURL

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

idLinkTarget.va lue = ""
idLinkType.valu e = ""
idLinkURL.value = ""
idLinkImageBord er.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.valu e
var sURL = inpURLType + inpURL

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

/*************** *************** *************** *************** ***********/
/* idLinkImageBord er
/*************** *************** *************** *************** ***********/
if ((oSel.item) && (oSel.item(0).t agName=="IMG")) //If image is selected
{
oSel.item(0).wi dth = oSel.item(0).of fsetWidth //kasih attribute width
oSel.item(0).he ight = oSel.item(0).of fsetHeight //kasih attribute height
oSel.item(0).bo rder = idLinkImageBord er.value
}

if(inpURL!="")//If there is URL typed by user
{
if (oSel.parentEle ment) //If text selection
{
if(btnLinkActio n.value == "Insert")
{
if(oSel.text!=" ")
{
//noop
}
else
{
var oSelTmp = oSel.duplicate( )
oSel.text = sURL //displayed text = sURL
oSel.setEndPoin t("StartToStart ",oSelTmp)
oSel.select()
sType="Text"
}
}
if(btnLinkActio n.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.execComman d("CreateLink", false,sURL)

//After A element created, then add the Target
//oSel = document.select ion.createRange ()
if (oSel.parentEle ment)
{
oEl = GetElement(oSel .parentElement( ),"A")
}
else
{
oEl = GetElement(oSel .item(0),"A")
}
if(oEl)
{
if(idLinkTarget .value=="")
{
oEl.removeAttri bute("target",0 )
}
else
{
oEl.target = idLinkTarget.va lue;
}
}
idContent.focus ()
oSel.select()//tambahan
}

//Activate layer again
if(isLayerActiv e)oElStore.setA ctive();
}
</script>
<SCRIPT ID=clientEventH andlersJS LANGUAGE="javas cript">

function InsertBransje(s Field)
{
var ie4 = (document.all && !document.getEl ementById);
var ie5 = (document.all && document.getEle mentById);
var ns6 = (!document.all && document.getEle mentById);

if(ie4 || ie5)
window.open("se lectLink.asp?fl d=" + sField ,
"SelectImage"," scrollbars=Yes, width=506,heigh t=480", true);
else
window.open("se lectLink.asp?fl d=" + sField ,
"SelectImage"," scrollbars=Yes, width=506,heigh t=510", true);
return false;
}

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

</script>

<div id="linkbox" style="position :absolute;displ ay:none">
<table border="0" cellpadding="0" cellspacing="0" style="table-layout:
fixed" bgcolor=Gainsbo ro 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:h and"
onclick="linkbo x.style.display ='none';if(isLa yerActive)oElSt ore.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>
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXX
<td class=normalSma ll colspan=2><stro ng><A HREF="#"
LANGUAGE="javas cript" onclick="Insert Bransje('idLink URL');">add a link from
another page!!!</a></strong></td>
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXX
</tr>
<tr>
<td class=normalSma ll>
<select id="idLinkType " NAME="idLinkTyp e" class=control01
style="width:13 0">
<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:">n ews:</option>
</select>
</td>
<td class=normalSma ll>
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXX
<input type=text size=10 id="idLinkURL" value="" class=control01
NAME="idLinkURL " style="width:17 5">
XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXXXXXXXXXX XXXXXXX

</td>
</tr>
<tr>
<td class=normalSma ll>Mål:</td>
<td class=normalSma ll>
<select id="idLinkTarge t" NAME="idLinkTar get" class=control01
style="width:17 5">
<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=normalSma ll><div id="idLinkImage " style="display: none"><font
class=normalSma ll>Bilderamme:</font></div></td>
<td class=normalSma ll>
<div id="idLinkImage 1" style="display: none">
<select id="idLinkImage Border" NAME="idLinkIma geBorder" class=control01
style="width:17 5">
<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=normalSma ll>
<input type="button" value="Avbryt"
onclick="linkbo x.style.display ='none';if(isLa yerActive)oElSt ore.setActive() ;
" ID="Button1" NAME="Button1" class=control01 >
<input type="button" id="btnLinkActi on" name="btnLinkAc tion"
value="Sett inn" onclick="Create Hyperlink();lin kbox.style.disp lay='none'"
class=control01 >
</td>
</tr>
</table>
</td>
</tr>
</table>
</div>
<!-- /Link box -->

Jul 19 '05 #1
0 1620

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

Similar topics

3
3275
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 box method, it looks fine but still lacks that windows application feel. I was advised not to go the MDI form root at the time but no reason was given. Could someone explain why not MDI form for the same purpose, I understand that most MS...
6
2013
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 trans-formation. What I'm looking for is an editor that lets me design how I want the result to look, based on a XML file, and automatically generates the XSL needed to obtain the result. Does such a product exist?
12
5944
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 suit, so I am turning to all you experts for help. What am I missing here? Other commands like formatblock, fontsize and fontname all work fine, so I assume that it has something to do with not getting the correct selection because of the iframe....
19
5241
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 bad, however, any of the other pages selected have large spaces between paragraphs. I know to compare different browers when building a website but what can I suggest to him for PC/Mac problems.
12
2373
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
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
9422
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
9987
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9857
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8867
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
0
5294
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in the same network. But I'm wondering if it's possible to do the same thing, with 2 Pfsense firewalls...
0
5444
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
3952
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
3
2812
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.