mirror of
https://github.com/ether/etherpad-lite.git
synced 2025-04-26 02:16:16 -04:00
Merge pull request #1593 from marcelklehr/feature/rtl-pad-setting
Add a setting for RTL text direction (integrating the url paramter)
This commit is contained in:
commit
2a8038b9fe
5 changed files with 32 additions and 3 deletions
|
@ -313,7 +313,7 @@ function handshake()
|
|||
|
||||
if (settings.rtlIsTrue == true)
|
||||
{
|
||||
pad.changeViewOption('rtl', true);
|
||||
pad.changeViewOption('rtlIsTrue', true);
|
||||
}
|
||||
|
||||
// If the Monospacefont value is set to true then change it to monospace.
|
||||
|
|
|
@ -62,20 +62,36 @@ var padeditor = (function()
|
|||
},
|
||||
initViewOptions: function()
|
||||
{
|
||||
// Line numbers
|
||||
padutils.bindCheckboxChange($("#options-linenoscheck"), function()
|
||||
{
|
||||
pad.changeViewOption('showLineNumbers', padutils.getCheckbox($("#options-linenoscheck")));
|
||||
});
|
||||
|
||||
// Author colors
|
||||
padutils.bindCheckboxChange($("#options-colorscheck"), function()
|
||||
{
|
||||
padcookie.setPref('showAuthorshipColors', padutils.getCheckbox("#options-colorscheck"));
|
||||
pad.changeViewOption('showAuthorColors', padutils.getCheckbox("#options-colorscheck"));
|
||||
});
|
||||
|
||||
// Right to left
|
||||
padutils.bindCheckboxChange($("#options-rtlcheck"), function()
|
||||
{
|
||||
pad.changeViewOption('rtlIsTrue', padutils.getCheckbox($("#options-rtlcheck")))
|
||||
});
|
||||
html10n.bind('localized', function() {
|
||||
pad.changeViewOption('rtlIsTrue', ('rtl' == html10n.getDirection()));
|
||||
padutils.setCheckbox($("#options-rtlcheck"), ('rtl' == html10n.getDirection()));
|
||||
})
|
||||
|
||||
// font face
|
||||
$("#viewfontmenu").change(function()
|
||||
{
|
||||
pad.changeViewOption('useMonospaceFont', $("#viewfontmenu").val() == 'monospace');
|
||||
});
|
||||
|
||||
// Language
|
||||
html10n.bind('localized', function() {
|
||||
$("#languagemenu").val(html10n.getLanguage());
|
||||
// translate the value of 'unnamed' and 'Enter your name' textboxes in the userlist
|
||||
|
@ -104,12 +120,14 @@ var padeditor = (function()
|
|||
if (value == "false") return false;
|
||||
return defaultValue;
|
||||
}
|
||||
self.ace.setProperty("rtlIsTrue", settings.rtlIsTrue);
|
||||
|
||||
var v;
|
||||
|
||||
v = getOption('rtlIsTrue', false);
|
||||
v = getOption('rtlIsTrue', ('rtl' == html10n.getDirection()));
|
||||
// Override from parameters if true
|
||||
if(settings.rtlIsTrue === true) v = true;
|
||||
self.ace.setProperty("rtlIsTrue", v);
|
||||
padutils.setCheckbox($("#options-rtlcheck"), v);
|
||||
|
||||
v = getOption('showLineNumbers', true);
|
||||
self.ace.setProperty("showslinenumbers", v);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue