Html Editor default font

This commit is contained in:
RainLoop Team 2014-08-12 16:32:08 +04:00
parent 2dd9b076fe
commit 6ad84283b7
7 changed files with 172 additions and 160 deletions

View file

@ -69,7 +69,7 @@ NewHtmlEditorWrapper.prototype.resetDirty = function ()
/**
* @return {string}
*/
NewHtmlEditorWrapper.prototype.getData = function ()
NewHtmlEditorWrapper.prototype.getData = function (bWrapIsHtml)
{
if (this.editor)
{
@ -78,7 +78,9 @@ NewHtmlEditorWrapper.prototype.getData = function ()
return this.editor.__plain.getRawData();
}
return this.editor.getData();
return bWrapIsHtml ?
'<div data-html-editor-font-wrapper="true" style="font-family: arial, sans-serif; font-size: 13px;">' +
this.editor.getData() + '</div>' : this.editor.getData();
}
return '';
@ -166,7 +168,7 @@ NewHtmlEditorWrapper.prototype.init = function ()
self.editor = window.CKEDITOR.appendTo(self.$element[0], oConfig);
self.editor.on('key', function(oEvent) {
if (oEvent && oEvent.data && 9 === oEvent.data.keyCode)
if (oEvent && oEvent.data && 9 /* Tab */ === oEvent.data.keyCode)
{
return false;
}
@ -177,6 +179,7 @@ NewHtmlEditorWrapper.prototype.init = function ()
});
self.editor.on('mode', function() {
self.blurTrigger();
if (self.fOnModeChange)

View file

@ -261,7 +261,7 @@ function PopupsComposeViewModel()
this.bcc(),
this.subject(),
this.oEditor ? this.oEditor.isHtml() : false,
this.oEditor ? this.oEditor.getData() : '',
this.oEditor ? this.oEditor.getData(true) : '',
this.prepearAttachmentsForSendOrSave(),
this.aDraftInfo,
this.sInReplyTo,
@ -298,7 +298,7 @@ function PopupsComposeViewModel()
this.bcc(),
this.subject(),
this.oEditor ? this.oEditor.isHtml() : false,
this.oEditor ? this.oEditor.getData() : '',
this.oEditor ? this.oEditor.getData(true) : '',
this.prepearAttachmentsForSendOrSave(),
this.aDraftInfo,
this.sInReplyTo,
@ -668,6 +668,7 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
sDate = '',
sSubject = '',
oText = null,
oSubText = null,
sText = '',
sReplyTitle = '',
aResplyAllParts = [],
@ -724,7 +725,9 @@ PopupsComposeViewModel.prototype.onShow = function (sType, oMessageOrArray, aToE
oText = $(oMessage.body).clone();
Utils.removeBlockquoteSwitcher(oText);
sText = oText.html();
oSubText = oText.find('[data-html-editor-font-wrapper=true]');
sText = oSubText && oSubText[0] ? oSubText.html() : oText.html();
switch (sComposeType)
{