Hi.
I have put two new buttons in, but when i hit them, nothing happens, only in IE. The buttons do the following:
Opens a new form (called getLink.aspx). On the form user chose a link, and close the form again. Then the link is insert into cuteeditor.
My code look like this:
<%
@ Page Language="vb" AutoEventWireup="false" CodeBehind="WebForm19.aspx.vb" Inherits="Aspergerforeningen.WebForm19" %>
<%@ Register Assembly="CuteEditor" Namespace="CuteEditor" TagPrefix="ce" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<script language="JavaScript" type="text/javascript">
function ShowMyDialog(button) {
var editor1 = document.getElementById('<%=Editor1.ClientID%>');
var editselection = editor1.GetSelection();
var r = editselection.createRange();
//use CuteEditor_GetEditor(elementinsidetheEditor) to get the cute editor instance
var editor = CuteEditor_GetEditor(button);
//show the dialog page , and pass the editor as newwin.dialogArguments
//(handler,url,args,feature)
var newwin = editor.ShowDialog(null, "getLink.aspx?link=" + r.htmlText, editor, "dialogWidth:530px;dialogHeight:330px");
}
function ShowMyDialog2(button2) {
var editor1 = document.getElementById('<%=Editor1.ClientID%>');
var editselection = editor1.GetSelection();
var r = editselection.createRange();
//use CuteEditor_GetEditor(elementinsidetheEditor) to get the cute editor instance
var editor = CuteEditor_GetEditor(button2);
//show the dialog page , and pass the editor as newwin.dialogArguments
//(handler,url,args,feature)
var newwin = editor.ShowDialog(null, "linksideOpret.aspx", editor, "dialogWidth:1000px;dialogHeight:600px");
}
</script>
<
html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title></title>
</head>
<body>
<form id="form1" runat="server">
<div>
<ce:Editor ID="Editor1" runat="server" DisableItemList="Save,linktree,codes,images,formatblock"
Height="750px" ThemeType="Office2007" Width="560px"></ce:Editor>
</div>
</form>
</body>
</html>
And the codebehind:
Protected Sub Page_Load(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
Dim pos As Integer
pos = Editor1.ToolControls.IndexOf("InsertLink") + 1
Dim ctrl As System.Web.UI.WebControls.WebControl
ctrl = Editor1.CreateCommandButton("MyButton", "list_links.gif", "Indst link til eksisterende side")
ctrl.Attributes("onclick") = "ShowMyDialog(this)"
Editor1.InsertToolControl(pos, "MyButton", ctrl)
pos = Editor1.ToolControls.IndexOf("InsertLink") + 2
ctrl = Editor1.CreateCommandButton("MyButton2", "linkSideOpret.gif", "Opret linkside")
ctrl.Attributes("onclick") = "ShowMyDialog2(this)"
Editor1.InsertToolControl(pos, "MyButton2", ctrl)
Editor1.EditorBodyStyle = "font-family: Verdana; font-size: 12px;color: #000000;"
Editor1.SecurityPolicyFile = "Admin.config"
Editor1.SetSecurityFilesGalleryPath("~/log/")
Editor1.SetSecurityImageGalleryPath("~/log/")
Editor1.SetSecurityGalleryPath("~/log/")
Editor1.SetSecurityFlashGalleryPath("~/log/")
Editor1.SetSecurityMaxImageSize("1000")
Editor1.SetSecurityTemplateGalleryPath("~/log/skabeloner")
End Sub
Kindly PeterDK