Adding RTL/LTR support to timymce

This commit is contained in:
Nicholas Mayne
2014-08-08 18:00:48 +01:00
parent 6f17bdad70
commit f36e03793c
2 changed files with 6 additions and 2 deletions

View File

@@ -20,5 +20,6 @@ tinyMCE.init({
extended_valid_elements: "script[type|defer|src|language]",
menubar: false,
statusbar: false,
skin: 'orchardlightgray'
skin: 'orchardlightgray',
directionality: directionality
});

View File

@@ -1,12 +1,15 @@
@using Orchard.Environment.Descriptor.Models
@using System.Globalization
@using Orchard.Environment.Descriptor.Models
@{
var shellDescriptor = WorkContext.Resolve<ShellDescriptor>();
var currentCulture = CultureInfo.GetCultureInfo(WorkContext.CurrentCulture);
}
<script type="text/javascript">
var mediaPickerEnabled = @(shellDescriptor.Features.Any(x => x.Name == "Orchard.MediaPicker") ? "true" : "false");
var mediaLibraryEnabled = @(shellDescriptor.Features.Any(x => x.Name == "Orchard.MediaLibrary") ? "true" : "false");
var directionality = @(currentCulture.TextInfo.IsRightToLeft ? "rtl" : "ltr");
</script>
@{