Added "Default text editor" options (Html forced and Plain forced) (Closes #341)

This commit is contained in:
RainLoop Team 2014-10-30 03:07:48 +04:00
parent 5e8a57f6a3
commit 25c56937f6
29 changed files with 77 additions and 4 deletions

View file

@ -216,7 +216,9 @@
*/
Enums.EditorDefaultType = {
'Html': 'Html',
'Plain': 'Plain'
'Plain': 'Plain',
'HtmlForce': 'HtmlForce',
'PlainForce': 'PlainForce'
};
/**

View file

@ -60,6 +60,16 @@
this.mppTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
this.isAnimationSupported = Globals.bAnimationSupported;
this.editorDefaultTypes = ko.computed(function () {
Globals.langChangeTrigger();
return [
{'id': Enums.EditorDefaultType.Html, 'name': Utils.i18n('SETTINGS_GENERAL/LABEL_EDITOR_HTML_AS_DEFAULT')},
{'id': Enums.EditorDefaultType.Plain, 'name': Utils.i18n('SETTINGS_GENERAL/LABEL_EDITOR_PLAIN_AS_DEFAULT')},
{'id': Enums.EditorDefaultType.HtmlForce, 'name': Utils.i18n('SETTINGS_GENERAL/LABEL_EDITOR_HTML_FORCE_AS_DEFAULT')},
{'id': Enums.EditorDefaultType.PlainForce, 'name': Utils.i18n('SETTINGS_GENERAL/LABEL_EDITOR_PLAIN_FORCE_AS_DEFAULT')}
];
}, this);
}
GeneralUserSetting.prototype.toggleLayout = function ()

View file

@ -921,7 +921,8 @@
this.editor(function (oEditor) {
oEditor.setHtml(sText, false);
if (!oMessage.isHtml())
if (Enums.EditorDefaultType.PlainForce === Data.editorDefaultType() ||
(!oMessage.isHtml() && Enums.EditorDefaultType.HtmlForce !== Data.editorDefaultType()))
{
oEditor.modeToggle(false);
}
@ -940,7 +941,8 @@
this.editor(function (oEditor) {
oEditor.setHtml(sText, false);
if (Enums.EditorDefaultType.Html !== Data.editorDefaultType())
if (Enums.EditorDefaultType.Html !== Data.editorDefaultType() &&
Enums.EditorDefaultType.HtmlForce !== Data.editorDefaultType())
{
oEditor.modeToggle(false);
}