I am trying to attach an event handler for onpaste to the prometheus radeditor. The alert('client load') pops up as expected. However, I anticipate the attached event handler for onpaste to popup alert('paste') when a user pastes.
alert('paste') never appears to be executing. How can I get the following code to work with the prometheus editor control?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ContentFilterTest.aspx.cs" Inherits="Editor_ContentFilterTest" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager id="ScriptManager" runat="server"/>
<telerik:radeditor runat="server" ID="RadEditor1" SkinID="BasicSetOfTools" StripFormattingOnPaste="NoneSupressCleanMessage" OnClientLoad="OnClientLoad">
<Content>
<strong><br /> Switch to Html mode to run the content filter.<br /> You will see that the casing is changed to upper case.</strong>
</Content>
</telerik:radeditor>
<script type="text/javascript">
function OnClientLoad(editor)
{
alert('client load');
editor.AttachEventHandler ("onpaste", function ()
{
alert('paste');
//the event is called before the paste but we need to execute after that
window.setTimeout("cleanUpText()", 100);
});
}
function cleanUpText()
{
var text = editor.GetHtml();
alert('the text we have from edxitor is: ' + text);
var clean = text.replace(/<div[^>]*>(.*?)<\/div[^>]*>/ig, "$1")
editor.SetHtml(clean);
}
</script>
</form>
</body>
</html>
alert('paste') never appears to be executing. How can I get the following code to work with the prometheus editor control?
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="ContentFilterTest.aspx.cs" Inherits="Editor_ContentFilterTest" %>
<%@ Register TagPrefix="telerik" Namespace="Telerik.Web.UI" Assembly="Telerik.Web.UI" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>Untitled Page</title>
</head>
<body>
<form id="form1" runat="server">
<asp:ScriptManager id="ScriptManager" runat="server"/>
<telerik:radeditor runat="server" ID="RadEditor1" SkinID="BasicSetOfTools" StripFormattingOnPaste="NoneSupressCleanMessage" OnClientLoad="OnClientLoad">
<Content>
<strong><br /> Switch to Html mode to run the content filter.<br /> You will see that the casing is changed to upper case.</strong>
</Content>
</telerik:radeditor>
<script type="text/javascript">
function OnClientLoad(editor)
{
alert('client load');
editor.AttachEventHandler ("onpaste", function ()
{
alert('paste');
//the event is called before the paste but we need to execute after that
window.setTimeout("cleanUpText()", 100);
});
}
function cleanUpText()
{
var text = editor.GetHtml();
alert('the text we have from edxitor is: ' + text);
var clean = text.replace(/<div[^>]*>(.*?)<\/div[^>]*>/ig, "$1")
editor.SetHtml(clean);
}
</script>
</form>
</body>
</html>
