<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default.aspx.cs" Inherits="_Default" %>

<%@ Register Assembly="Telerik.Web.UI" Namespace="Telerik.Web.UI" TagPrefix="telerik" %>
<!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">
	    <style type="text/css">
        .reTool .RichEditor
        {
            background: url(Icons/Open.gif) no-repeat center;
        }
    </style>
</head>
<body>
	<form id="form1" runat="server">
	<asp:ScriptManager ID="Sc1" runat="server"></asp:ScriptManager>
<telerik:RadWindow OnClientShow="SetDialogContent" OnClientPageLoad="SetDialogContent"
        NavigateUrl="EditorInWindow.aspx" runat="server" Behaviors="Maximize,Close,Move"
        ID="DialogWindow" VisibleStatusbar="false" Width="800px" Modal="true" Height="700px" />
    <telerik:RadEditor ID="RadEditor1" EnableResize="false" runat="server" Width="460px"
        Height="200px">
        <Tools>
            <telerik:EditorToolGroup>
                <telerik:EditorTool Name="RichEditor" Text="Open Advanced Editor" />
                <telerik:EditorTool Name="Bold" />
                <telerik:EditorTool Name="Italic" />
                <telerik:EditorTool Name="Underline" />
                <telerik:EditorTool Name="Cut" />
                <telerik:EditorTool Name="Copy" />
                <telerik:EditorTool Name="Paste" />
                <telerik:EditorTool Name="FontName" />
                <telerik:EditorTool Name="RealFontSize" />
            </telerik:EditorToolGroup>
        </Tools>
        <Content>
                <img src="../../Img/productLogoLight.gif" alt="product logo" />is the successor of the well known industry standard Editor for ASP.NET. The tight integration with ASP.NET AJAX and the powerful new capabilities make Telerik's WYSIWYG Editor a flexible and lightweight component, turning it into the fastest loading Web Editor. Among the hottest features are:
                <ul>
                    <li><em>Single-file, drag-and-drop deployment</em></li>
                    <li><em>Built on top of ASP.NET AJAX</em></li>
                    <li><em>Unmatched loading speed with new semantic rendering </em></li>
                    <li><em>Full keyboard accessibility</em></li>
                    <li><em>Flexible Skinning mechanism</em></li>
                    <li><em>Simplified and intuitive toolbar configuration</em></li>
                    <li><em>Out-of-the-box XHTML-enabled output</em></li>
                </ul>
        </Content>
    </telerik:RadEditor>

    <script type="text/javascript">
        //<![CDATA[
    	var editorContent = null;

    	Telerik.Web.UI.Editor.CommandList["RichEditor"] = function (commandName, editor, args) {
    		editorContent = editor.get_html(true); //get RadEditor content
    		$find("<%=DialogWindow.ClientID%>").show(); //open RadWindow
    	};


    	function SetEditorContent(content) {
    		//set content to RadEditor on the mane page from RadWindow
    		$find("<%=RadEditor1.ClientID%>").set_html(content);
    	}


    	function SetDialogContent(oWnd) {
    		var contentWindow = oWnd.get_contentFrame().contentWindow;
    		if (contentWindow && contentWindow.setContent) {
    			window.setTimeout(function () {
    				//pass and set the content from the mane page to RadEditor in RadWindow
    				contentWindow.setContent(editorContent);
    			}, 500);
    		}
    	}
        //]]>
    </script>

	</form>
</body>
</html>
