HI All,
I want to hide the All properties button in Insert Link dialogue and default target to new window in the Insert Link dialogue of radedior.Can you please give me idea how to do this? I can see when I create the is post on the forum I found the Insert Link dialogue doesn't have all properties button.
How can I do this?
I have used below code
<telerik:radeditor runat="server" ID="RadEditor1" >
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="InsertLink" Text="Insert Special Link" Enabled="true" />
</telerik:EditorToolGroup>
</Tools>
</telerik:radeditor>
When I use the custom dialogue it show the command hasn't implemented. e.g
<telerik:radeditor runat="server" ID="RadEditor1" >
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="InsertSpecialLink" Text="Insert Special Link" Enabled="true" />
</telerik:EditorToolGroup>
</Tools>
</telerik:radeditor>
<style type="text/css">
.reToolbar.Default .InsertSpecialLink
{
background-image: url(http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/Custom.gif);
}
</style>
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["InsertSpecialLink"] = function (commandName, editor, args) {
alert("1");
var elem = editor.getSelectedElement(); //returns the selected element.
if (elem.tagName == "A") {
editor.selectElement(elem);
argument = elem;
}
else {
//remove links if present from the current selection - because of JS error thrown in IE
editor.fire("Unlink");
//remove Unlink command from the undo/redo list
var commandsManager = editor.get_commandsManager();
var commandIndex = commandsManager.getCommandsToUndo().length - 1;
commandsManager.removeCommandAt(commandIndex);
var content = editor.getSelectionHtml();
var link = editor.get_document().createElement("A");
link.innerHTML = content;
argument = link;
}
var myCallbackFunction = function (sender, args) {
editor.pasteHtml(String.format("<a href={0} target='{1}' class='{2}'>{3}</a> ", args.href, args.target, args.className, args.name))
}
editor.showExternalDialog(
'InsertLink.aspx',
argument,
270,
300,
myCallbackFunction,
null,
'Insert Link',
true,
Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
false,
false);
};
</script>
I want to hide the All properties button in Insert Link dialogue and default target to new window in the Insert Link dialogue of radedior.Can you please give me idea how to do this? I can see when I create the is post on the forum I found the Insert Link dialogue doesn't have all properties button.
How can I do this?
I have used below code
<telerik:radeditor runat="server" ID="RadEditor1" >
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="InsertLink" Text="Insert Special Link" Enabled="true" />
</telerik:EditorToolGroup>
</Tools>
</telerik:radeditor>
When I use the custom dialogue it show the command hasn't implemented. e.g
<telerik:radeditor runat="server" ID="RadEditor1" >
<Tools>
<telerik:EditorToolGroup>
<telerik:EditorTool Name="InsertSpecialLink" Text="Insert Special Link" Enabled="true" />
</telerik:EditorToolGroup>
</Tools>
</telerik:radeditor>
<style type="text/css">
.reToolbar.Default .InsertSpecialLink
{
background-image: url(http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/Custom.gif);
}
</style>
<script type="text/javascript">
Telerik.Web.UI.Editor.CommandList["InsertSpecialLink"] = function (commandName, editor, args) {
alert("1");
var elem = editor.getSelectedElement(); //returns the selected element.
if (elem.tagName == "A") {
editor.selectElement(elem);
argument = elem;
}
else {
//remove links if present from the current selection - because of JS error thrown in IE
editor.fire("Unlink");
//remove Unlink command from the undo/redo list
var commandsManager = editor.get_commandsManager();
var commandIndex = commandsManager.getCommandsToUndo().length - 1;
commandsManager.removeCommandAt(commandIndex);
var content = editor.getSelectionHtml();
var link = editor.get_document().createElement("A");
link.innerHTML = content;
argument = link;
}
var myCallbackFunction = function (sender, args) {
editor.pasteHtml(String.format("<a href={0} target='{1}' class='{2}'>{3}</a> ", args.href, args.target, args.className, args.name))
}
editor.showExternalDialog(
'InsertLink.aspx',
argument,
270,
300,
myCallbackFunction,
null,
'Insert Link',
true,
Telerik.Web.UI.WindowBehaviors.Close + Telerik.Web.UI.WindowBehaviors.Move,
false,
false);
};
</script>