Hello Neda,
RadEditor does not offer the requested Right-To-Left and Left-To-Right buttons out-of-the box and it is up to the developer working with the control to enhance the provided in the forums sample code.
Another implementation of these commands could be found in the following forum:
http://www.telerik.com/community/forums/aspnet-ajax/editor/extra-div-gets-created-in-radhtmlfield-on-publishing-page.aspx
The custom commands are named MOSSRightToLeft and MOSSLeftToRight
<script type=
"text/javascript"
>
Telerik.Web.UI.Editor.CommandList[
"RTL"
] =
function
(commandName, editor, args) {
Telerk_MOSS_SetDirectionOfSelection(editor,
"rtl"
);
}
Telerik.Web.UI.Editor.CommandList[
"LTR"
] =
function
(commandName, editor, args) {
Telerk_MOSS_SetDirectionOfSelection(editor,
"ltr"
);
}
function
Telerk_MOSS_SetDirectionOfSelection(editor, strDirection) {
var
rngSelection = editor.getSelection();
var
strTagNames;
strTagNames =
"|H1|H2|H3|H4|H5|H6|P|PRE|TD|DIV|BLOCKQUOTE|DT|DD|TABLE|HR|IMG|BODY|TR|UL|OL|"
;
if
(rngSelection.getParentElement()) {
var
elemSelectionParent = rngSelection.getParentElement();
while
((elemSelectionParent !=
null
) && (strTagNames.indexOf(
"|"
+ elemSelectionParent.tagName +
"|"
) == -1)) {
elemSelectionParent = elemSelectionParent.parentNode;
}
if
(elemSelectionParent) {
Telerik_MOSS_SetDirectionOnElement(elemSelectionParent, strDirection);
}
}
}
function
Telerik_MOSS_SetDirectionOnElement(element, strDirection) {
if
(
"ltr"
== strDirection) {
element.dir =
"ltr"
;
element.align =
"left"
;
}
else
if
(
"rtl"
== strDirection) {
element.dir =
"rtl"
;
element.align =
"right"
;
}
}
</script>
Kind regards,
Rumen
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their
blog feed now