Topbar
Topbar
Sign in
|
Join
|
Client Center
Home
Products
Client Center
Contact
Purchase
Support forums
»
Products
»
Cute Editor for .NET
»
Re: This only works in IE, not in Firefox etc.
Re: This only works in IE, not in Firefox etc.
11-22-2009, 11:08 PM
Kenneth
Joined on 02-13-2008
Posts 3,886
Re: This only works in IE, not in Firefox etc.
Reply
Quote
Hi PeterDK,
Try this way
function
ShowMyDialog(button)
{
var
editor1 = document.getElementById(
'<%=Editor1.ClientID%>'
);
var
editwin = editor1.GetWindow();
var
editdoc = editor1.GetDocument();
var
editor = CuteEditor_GetEditor(button);
var
r=
null
;
//for ie
if
(document.selection && document.selection.createRange)
{
var
editselection = editor1.GetSelection();
r = editselection.createRange();
var
newwin = editor.ShowDialog(
null
,
"getLink.aspx?link="
+ r.htmlText, editor,
"dialogWidth:530px;dialogHeight:330px"
);
}
//for firefox safari chrome
else
if
(window.getSelection)
{
r=editwin.getSelection();
if
(r.rangeCount > 0 && window.XMLSerializer)
{
r=r.getRangeAt(0);
var
newwin = editor.ShowDialog(
null
,
"getLink.aspx?link="
+ r.htmlText, editor,
"dialogWidth:530px;dialogHeight:330px"
);
}
else
{
alert(
"type something in editor and try again"
)
}
}
}
Regards,
ken
View Complete Thread