mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
parent
320f92b1a8
commit
f9c7de2920
74 changed files with 5731 additions and 2282 deletions
|
|
@ -12,6 +12,8 @@ function SettingsIdentities()
|
|||
this.signatureToAll = oData.signatureToAll;
|
||||
this.replyTo = oData.replyTo;
|
||||
|
||||
this.signatureDom = ko.observable(null);
|
||||
|
||||
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
|
|
@ -79,6 +81,41 @@ SettingsIdentities.prototype.deleteIdentity = function (oIdentityToRemove)
|
|||
}
|
||||
};
|
||||
|
||||
SettingsIdentities.prototype.onFocus = function ()
|
||||
{
|
||||
if (!this.editor && this.signatureDom())
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
sSignature = RL.data().signature()
|
||||
;
|
||||
|
||||
this.editor = new HtmlEditorWrapper(self.signatureDom(), function () {
|
||||
RL.data().signature(
|
||||
(self.editor.isHtml() ? ':HTML:' : '') + self.editor.getData()
|
||||
);
|
||||
}, function () {
|
||||
if (':HTML:' === sSignature.substr(0, 6))
|
||||
{
|
||||
self.editor.setHtml(sSignature.substr(6), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.editor.setPlain(sSignature, false);
|
||||
}
|
||||
});
|
||||
|
||||
this.editor.addInputFormatStyle();
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
self.editor.setupLang(
|
||||
Utils.i18n('EDITOR/TEXT_SWITCHER_RICH_FORMATTING'),
|
||||
Utils.i18n('EDITOR/TEXT_SWITCHER_PLAINT_TEXT')
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
SettingsIdentities.prototype.onBuild = function (oDom)
|
||||
{
|
||||
var self = this;
|
||||
|
|
@ -91,7 +128,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
|
|||
self.editIdentity(oIdentityItem);
|
||||
}
|
||||
})
|
||||
;
|
||||
;
|
||||
|
||||
_.delay(function () {
|
||||
|
||||
|
|
|
|||
|
|
@ -12,6 +12,8 @@ function SettingsIdentity()
|
|||
this.signatureToAll = oData.signatureToAll;
|
||||
this.replyTo = oData.replyTo;
|
||||
|
||||
this.signatureDom = ko.observable(null);
|
||||
|
||||
this.displayNameTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.replyTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||
|
|
@ -19,6 +21,41 @@ function SettingsIdentity()
|
|||
|
||||
Utils.addSettingsViewModel(SettingsIdentity, 'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
|
||||
|
||||
SettingsIdentity.prototype.onFocus = function ()
|
||||
{
|
||||
if (!this.editor && this.signatureDom())
|
||||
{
|
||||
var
|
||||
self = this,
|
||||
sSignature = RL.data().signature()
|
||||
;
|
||||
|
||||
this.editor = new HtmlEditorWrapper(self.signatureDom(), function () {
|
||||
RL.data().signature(
|
||||
(self.editor.isHtml() ? ':HTML:' : '') + self.editor.getData()
|
||||
);
|
||||
}, function () {
|
||||
if (':HTML:' === sSignature.substr(0, 6))
|
||||
{
|
||||
self.editor.setHtml(sSignature.substr(6), false);
|
||||
}
|
||||
else
|
||||
{
|
||||
self.editor.setPlain(sSignature, false);
|
||||
}
|
||||
});
|
||||
|
||||
this.editor.addInputFormatStyle();
|
||||
|
||||
Utils.initOnStartOrLangChange(function () {
|
||||
self.editor.setupLang(
|
||||
Utils.i18n('EDITOR/TEXT_SWITCHER_RICH_FORMATTING'),
|
||||
Utils.i18n('EDITOR/TEXT_SWITCHER_PLAINT_TEXT')
|
||||
);
|
||||
});
|
||||
}
|
||||
};
|
||||
|
||||
SettingsIdentity.prototype.onBuild = function ()
|
||||
{
|
||||
var self = this;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue