Location of RadWindow.js

2 posts, 1 answers
  1. Henrik
    Henrik avatar
    47 posts
    Member since:
    Dec 2010

    Posted 07 Apr 2011 Link to this post

    Hello Community,

    I want to add my customized dialog. I followed the instructions mentioned here.
    Unfortunately this doesn't work the way I want to. I guess the RadWindow.js is not available. Where do I find this file because an error occurs when I want to start the dialog and the editor.ShowDialog() throws the exception.
    Does anybody know this issue?

    Here are my files:

    MyCustomDialog.html

    <html>
        <head>
        <script type="text/javascript" src="./RadControls/Editor/Scripts/7_0_1/RadWindow.js"></script>
        <script type="text/javascript">
           InitializeRadWindow(); //this function is declared in the \RadControls\Editor\Scripts\<script_version>\RadWindow.js file
           alert(GetDialogArguments());
        </script>
        </head>
        <body>
            <table border="0" cellpadding="" cellspacing="0">
                <tr>
                    <td>
                        <input type="text" style="width: 156px;" id="LinkURL" />
                    </td>
                </tr>
            </table>
        </body>
    </html>

    ToolsFile.xml:

    <root>
      <modules>
        <!--<module name="RadEditorDomInspector" />-->
      </modules>
      <tools name="MainToolbar">
        <!--<tool name="Print" shortcut="CTRL+P"/>-->
        <tool name="AjaxSpellCheck"/>
        <tool name="FindAndReplace" shortcut="CTRL+F"/>
        <tool name="Cut" />
        <tool name="Copy" shortcut="CTRL+C"/>
        <tool name="Paste" shortcut="CTRL+V"/>
        <tool name="PasteStrip"/>
        <tool separator="true"/>
        <tool name="Undo" shortcut="CTRL+Z"/>
        <tool name="Redo" shortcut="CTRL+Y"/>
        <tool name="CustomDialog" IconUrl="~/RadControls/Editor/Skins/Default/Buttons/Custom.gif" />
      </tools>
      <tools name="InsertToolbar" >
        <tool name="MOSSImageManager" shortcut="CTRL+G"/>
        <tool name="AbsolutePosition" />
        <tool separator="true"/>
        <tool name="FlashManager" />
        <tool name="MediaManager" />
        <!--<tool name="DocumentManager" />
        <tool name="TemplateManager" />-->
        <tool separator="true"/>
        <tool name="LinkManager" shortcut="CTRL+K"/>
        <tool name="Unlink" shortcut="CTRL+SHIFT+K"/>
        <tool name="MOSSLinkManager"/>
      </tools>
     
      <tools>
        <tool name="FormatBlock"/>
        <tool name="FontName" shortcut="CTRL+SHIFT+F"/>
        <!--tool name="FontSize" shortcut="CTRL+SHIFT+P"/-->
        <tool name="RealFontSize" shortcut="CTRL+SHIFT+P"/>
      </tools>
     
      <tools>
        <tool name="Superscript" />
        <tool name="Subscript" />
        <tool name="InsertParagraph" />
        <!--<tool name="InsertGroupbox" />-->
        <tool name="InsertHorizontalRule" />
        <tool name="InsertDate" />
        <tool name="InsertTime" />
      </tools>
     
      <tools>
        <tool name="ForeColor"/>
        <tool name="BackColor"/>
        <!--<tool name="ApplyClass"/>-->
        <tool name="FormatStripper"/>
      </tools>
     
      <tools name="DropdownToolbar">
        <tool name="InsertSymbol"/>
        <tool name="InsertTable"/>
        <tool name="InsertFormElement" />
        <!--<tool name="InsertSnippet"/>-->
        <tool name="ImageMapDialog"/>
        <!--<tool name="InsertCustomLink" shortcut="CTRL+ALT+K"/>
        <tool separator="true"/>
        <tool name="ConvertToLower" />
        <tool name="ConvertToUpper" />-->
        <tool separator="true"/>
        <!--<tool name="AboutDialog" />-->
        <tool name="Help" shortcut="F1"/>
        <tool name="Zoom"/>
        <!--<tool name="ModuleManager" />-->
        <tool name="ToggleScreenMode" shortcut="F11"/>
      </tools>
     
      <tools>
        <tool name="Bold" shortcut="CTRL+B"/>
        <tool name="Italic" shortcut="CTRL+I"/>
        <tool name="Underline" shortcut="CTRL+U"/>
        <tool name="StrikeThrough" />
        <tool separator="true"/>
        <tool name="JustifyLeft" />
        <tool name="JustifyCenter" />
        <tool name="JustifyRight" />
        <tool name="JustifyFull" />
        <tool name="JustifyNone" />
        <tool separator="true"/>
        <tool name="LineDistance1" />
        <tool name="LineDistance15" />
        <tool name="LineDistance2" />
        <tool separator="true"/>
        <tool name="Indent" />
        <tool name="Outdent" />
        <tool separator="true"/>
        <tool name="InsertOrderedList" />
        <tool name="InsertUnorderedList" />
        <tool name="ToggleTableBorder" />
        <tool separator="true"/>
        <tool name="SelectAll" shortcut="CTRL+A"/>
      </tools>
     
      <contextMenus>
        <contextMenu forElement="*">
          <tool name="Cut"/>
          <tool name="Copy"/>
          <tool name="Paste"/>
        </contextMenu>
        <contextMenu forElement="IMG">
          <tool Name="SetImageProperties" />
          <tool Name="ImageMapDialog" />
        </contextMenu>
        <contextMenu forElement="TABLE">
          <tool Name="ToggleTableBorder" />
          <tool Name="SetTableProperties" />
          <tool Name="DeleteTable" />
        </contextMenu>
        <contextMenu forElement="TD">
          <tool Name="InsertRowAbove" />
          <tool Name="InsertRowBelow" />
          <tool Name="DeleteRow" />
          <tool Name="InsertColumnLeft" />
          <tool Name="InsertColumnRight" />
          <tool Name="MergeColumns" />
          <tool Name="MergeRows" />
          <tool Name="SplitCell" />
          <tool Name="DeleteCell" />
          <tool Name="SetCellProperties" />
        </contextMenu>
        <contextMenu forElement="A">
          <tool Name="SetLinkProperties" />
          <tool Name="Unlink" />
        </contextMenu>
        <contextMenu forElement="BODY">
          <tool name="ForeColor"/>
          <tool name="BackColor"/>
          <tool name="Bold" shortcut="CTRL+B"/>
          <tool name="Italic" shortcut="CTRL+I"/>
          <tool name="Underline" shortcut="CTRL+U"/>
          <tool name="StrikeThrough" />
          <tool Name="Cut" />
          <tool Name="Copy" />
          <tool Name="Paste" />
          <tool Name="PasteFromWord" />
          <tool Name="PastePlainText" />
          <tool Name="PasteAsHtml" />
        </contextMenu>
        <contextMenu forElement="P">
          <tool name="ForeColor"/>
          <tool name="BackColor"/>
          <tool name="Bold" shortcut="CTRL+B"/>
          <tool name="Italic" shortcut="CTRL+I"/>
          <tool name="Underline" shortcut="CTRL+U"/>
          <tool name="StrikeThrough" />
        </contextMenu>
      </contextMenus>
     
      <cssFiles>
        <item name="/_wpresources/RadEditorSharePoint/5.8.7.0__1f131a624888eeed/Resources/bmuStylesRAD.css" />
      </cssFiles>
     
      <dialogParameters>
        <dialog name="CustomDialog">
          <parameter name="Param1" value="Value1" />
        </dialog>
      </dialogParameters>
    </root>

    MOSSEditorTools.js:

    //...
    Telerik.Web.UI.Editor.CommandList["CustomDialog"] = function(commandName, editor, oTool) {
        var args = null; //editor.GetDialogParameters(commandName);
        var argStr = "";
        //for (var item in args) {
        //    argStr += "[" + item + "=" + args[item] + "] ";
        //}
        alert("Custom dialog was called with the following arguments: " + argStr);
     
        editor.ShowDialog(
            "~/_wpresources/RadEditorSharePoint/5.8.7.0__1f131a624888eeed/Resources/MyCustomDialog.html"
            , args
            , 180
            , 80
            , null
            , null
            , "Custom Dialog");
    }
  2. Answer
    Rumen
    Admin
    Rumen avatar
    13980 posts

    Posted 07 Apr 2011 Link to this post

    Hello Henrik,

    You have found an article for RadEditor Classic and the information provided in it is not applicable for RadEditor for ASP.NET AJAX. To create a custom dialog for RadEditor for ASP.NET AJAX please see this article:  Add Custom Dialogs.

    Regards,
    Rumen
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top