Hi dbots,
How to execute code after paste command
<%@ Page Language="C#" %>
<%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>
<!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 id="Head1" runat="server">
<title>example</title>
</head>
<body>
<form id="form1" runat="server">
<div>
<CE:Editor ID="Editor1" runat="server">
</CE:Editor>
</div>
</form>
</body>
</html>
<script>
function CuteEditor_OnCommand(editor,command,ui,value)
{
//Paste
//PasteText
//PasteWord
//PasteAsHTML
if(command=="PasteWord")
{
//execute your own code
}
}
</script>
How to catch hot key Ctrl + V
<%@ Page Language="C#" %>
<%@ Register Namespace="CuteEditor" Assembly="CuteEditor" TagPrefix="CE" %>
<!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 id="Head1" runat="server">
<title>example</title>
</head>
<script runat="server">
protected override void OnLoad(EventArgs e)
{
Editor1.Text = "use hot key ctrl+v";
base.OnLoad(e);
}
</script>
<body>
<form id="form1" runat="server">
<CE:Editor ID="Editor1" runat="server">
</CE:Editor>
<p>Try hot key Ctrl + V</p>
</form>
</body>
</html>
<script>
function CuteEditor_OnInitialized(editor) {
var editwin = editor.GetWindow();
var editdoc = editor.GetDocument();
function forFirefox(oEvent) {
if (oEvent.ctrlKey && oEvent.keyCode == 86) {
alert("ctrl + v");
}
}
if (window.attachEvent) {
editdoc.onkeydown = function () {
if (editwin.event.ctrlKey && editwin.event.keyCode == 86) {
alert("ctrl + v");
}
}
}
else if (window.addEventListener) {
editdoc.addEventListener("keydown", forFirefox, false)
}
}
</script>
Regards,
Ken