This is my code ,
<telerik:RadEditor runat="server" OnClientSubmit="OnClientSubmit" ID="RadEditor1"
ContentFilters="None">
<Content>
<table width="100%" cellspacing="0" cellpadding="0" border="0" align="left" style="background-color: #ffffff; margin: 0px;"><tbody><tr><td valign="top" align="right"> <img alt="" src="/editorQ2SP12008/Images/Deisy.jpg" align="left" /></td></tr></tbody></table>
</Content>
</telerik:RadEditor>
------------------------------------------------------------------------------------------------------------------
Facing Issue :
1 ] When i change ContentFilters="None" ---- > in browser Firefox Changing the Hex colour(style="COLOR: #000000") to RGB(style="color: rgb(0, 0, 0)).
2 ] When i change ContentFilters="ConvertToXhtml" ---- > align="left" (inside Img Tag name) converting to style="float: left;".
Please help me out as soon as possible.
Thanks
Anand
6 Answers, 1 is accepted
Try the following ContentFilters="ConvertInlineStylesToAttributes,ConvertToXhtml".
The ConvertInlineStylesToAttributes filter will convert the inline styles to attributes.
Regards,
Rumen
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Getting below error :
Cannot create an object of type 'Telerik.Web.UI.EditorFilters' from its string representation 'ConvertInlineStylesToAttributes,ConvertToXhtml' for the 'ContentFilters' property
Thanks
Anand
Regards,
Rumen
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>
Another doubt:
This works fine on IE for windows. Nothing happens in Firefox.
function OnClientLoad(editor) {
//debugger;
var tree = $find('RadTreeView1');
makeUnselectable(tree.get_element());
editor.attachEventHandler("oncontrolselect", function() {
window.setTimeout(function() {
var selElem = editor.getSelection().getParentElement();
if (selElem.tagName == "IMG") {
curWidth = selElem.offsetWidth;
curHeight = selElem.offsetHeight;
selElem.onresizeend = function(e) {
radalert('Image cannot be resize', 330, 100, 'Message');
selElem.style.width = curWidth;
selElem.style.height = curHeight;
};
}
}, 100);
});
}
Please help me out
Thanks
Anand
Please find attached screenshot (DLL Version used).
Thanks
Anand
) Yes, the oncontrolselect event is supported and offered by IE only. You can see whether the editor's OnClientselectionChange event could be helpful for your scenario:
<script type="text/javascript"> |
function OnClientSelectionChange(editor, args) |
{ |
alert("The tag of the selected Element is: " + editor.getSelectedElement().tagName); |
} |
</script> |
<telerik:radeditor runat="server" ID="RadEditor1" |
OnClientSelectionChange="OnClientSelectionChange"> |
<Content> |
<strong>Sample Content <img src="aaa.jpg"/></strong> |
</Content> |
You can also see how to attach to the content area events in this article and try to implement your own solution.
If you would like you can disable the image resizing in IE by setting the unselectable="on" attribute to all IMG tags in the content area, then the browser will not display the image handlers, e.g.
<script type="text/javascript">
function OnClientSelectionChange(editor)
{
var images = editor.get_document().getElementsByTagName("IMG");
for (var i = 0; i < images.length; i++)
{
var image = images[i];
image.setAttribute("unselectable", "on");
}
}
</script>
<telerik:RadEditor ID="RadEditor1"
OnClientSelectionChange="OnClientSelectionChange"
runat="server" Width="100%" Height="345px">
<Content>
<img src="http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/CustomDialog.gif"/>
<a href="www.telerik.com">telerik</a>
<img src="http://www.telerik.com/DEMOS/ASPNET/RadControls/Editor/Skins/Default/buttons/CustomDialog.gif"/>
</Content>
</telerik:RadEditor>
The unselectable attribute is supported by IE. Opera, Chrome and Safari do not offer resize handlers for the images.
Regards,
Rumen
the Telerik team
Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>