mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-08 00:47:04 +03:00
OpenPGP - part 2 - unstable (#53)
This commit is contained in:
parent
d181974127
commit
0bb69d4494
23 changed files with 600 additions and 339 deletions
|
|
@ -1,5 +1,5 @@
|
|||
/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
(function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible) {
|
||||
/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
|
||||
(function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible) {
|
||||
|
||||
'use strict';
|
||||
|
||||
|
|
@ -70,14 +70,14 @@ var
|
|||
$document = $(window.document),
|
||||
|
||||
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
|
||||
;
|
||||
;
|
||||
/*jshint onevar: false*/
|
||||
/**
|
||||
* @type {?RainLoopApp}
|
||||
*/
|
||||
var RL = null;
|
||||
/*jshint onevar: true*/
|
||||
|
||||
|
||||
/**
|
||||
* @type {?}
|
||||
*/
|
||||
|
|
@ -143,6 +143,11 @@ Globals.bDisableNanoScroll = Globals.bMobileDevice;
|
|||
*/
|
||||
Globals.bAllowPdfPreview = !Globals.bMobileDevice;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
Globals.bAllowOpenPGP = false;
|
||||
|
||||
/**
|
||||
* @type {boolean}
|
||||
*/
|
||||
|
|
@ -159,7 +164,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
|
|||
return oType && 'application/pdf' === oType.type;
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Consts.Defaults = {};
|
||||
Consts.Values = {};
|
||||
Consts.DataImages = {};
|
||||
|
|
@ -277,7 +282,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
|
|||
* @type {string}
|
||||
*/
|
||||
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
|
||||
|
||||
|
||||
/**
|
||||
* @enum {string}
|
||||
*/
|
||||
|
|
@ -613,7 +618,7 @@ Enums.Notification = {
|
|||
'UnknownNotification': 999,
|
||||
'UnknownError': 999
|
||||
};
|
||||
|
||||
|
||||
Utils.trim = $.trim;
|
||||
Utils.inArray = $.inArray;
|
||||
Utils.isArray = _.isArray;
|
||||
|
|
@ -2179,7 +2184,7 @@ Utils.computedPagenatorHelper = function (koCurrentPage, koPageCount)
|
|||
return aResult;
|
||||
};
|
||||
};
|
||||
|
||||
|
||||
// Base64 encode / decode
|
||||
// http://www.webtoolkit.info/
|
||||
|
||||
|
|
@ -2342,7 +2347,7 @@ Base64 = {
|
|||
}
|
||||
};
|
||||
|
||||
/*jslint bitwise: false*/
|
||||
/*jslint bitwise: false*/
|
||||
ko.bindingHandlers.tooltip = {
|
||||
'init': function (oElement, fValueAccessor) {
|
||||
if (!Globals.bMobileDevice)
|
||||
|
|
@ -2964,7 +2969,7 @@ ko.observable.fn.validateFunc = function (fFunc)
|
|||
return this;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -3254,7 +3259,7 @@ LinkBuilder.prototype.socialFacebook = function ()
|
|||
{
|
||||
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @type {Object}
|
||||
*/
|
||||
|
|
@ -3348,7 +3353,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
|
|||
};
|
||||
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -4244,7 +4249,7 @@ HtmlEditor.htmlFunctions = {
|
|||
}, this), this.toolbar);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {koProperty} oKoList
|
||||
|
|
@ -4785,7 +4790,7 @@ Selector.prototype.on = function (sEventName, fCallback)
|
|||
{
|
||||
this.oCallbacks[sEventName] = fCallback;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -4859,7 +4864,7 @@ CookieDriver.prototype.get = function (sKey)
|
|||
|
||||
return mResult;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -4931,7 +4936,7 @@ LocalStorageDriver.prototype.get = function (sKey)
|
|||
|
||||
return mResult;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -4974,7 +4979,7 @@ LocalStorage.prototype.get = function (iKey)
|
|||
{
|
||||
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -4987,7 +4992,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
|
|||
{
|
||||
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string=} sPosition = ''
|
||||
* @param {string=} sTemplate = ''
|
||||
|
|
@ -5047,7 +5052,7 @@ KnoinAbstractViewModel.prototype.viewModelPosition = function ()
|
|||
KnoinAbstractViewModel.prototype.cancelCommand = KnoinAbstractViewModel.prototype.closeCommand = function ()
|
||||
{
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} sScreenName
|
||||
* @param {?=} aViewModels = []
|
||||
|
|
@ -5123,7 +5128,7 @@ KnoinAbstractScreen.prototype.__start = function ()
|
|||
this.oCross = oRoute;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -5514,7 +5519,7 @@ Knoin.prototype.bootstart = function ()
|
|||
};
|
||||
|
||||
kn = new Knoin();
|
||||
|
||||
|
||||
/**
|
||||
* @param {string=} sEmail
|
||||
* @param {string=} sName
|
||||
|
|
@ -5878,7 +5883,7 @@ EmailModel.prototype.inputoTagLine = function ()
|
|||
{
|
||||
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -6000,7 +6005,7 @@ ContactModel.prototype.lineAsCcc = function ()
|
|||
|
||||
return aResult.join(' ');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {number=} iType = Enums.ContactPropertyType.Unknown
|
||||
* @param {string=} sValue = ''
|
||||
|
|
@ -6022,7 +6027,7 @@ function ContactPropertyModel(iType, sValue, bFocused, sPlaceholder)
|
|||
return sPlaceholder ? Utils.i18n(sPlaceholder) : '';
|
||||
}, this);
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -6258,7 +6263,7 @@ AttachmentModel.prototype.iconClass = function ()
|
|||
|
||||
return sClass;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @param {string} sId
|
||||
|
|
@ -6319,7 +6324,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
|
|||
}
|
||||
|
||||
return bResult;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -6402,11 +6407,16 @@ function MessageModel()
|
|||
}, this);
|
||||
|
||||
this.body = null;
|
||||
this.plainRaw = '';
|
||||
this.isRtl = ko.observable(false);
|
||||
this.isHtml = ko.observable(false);
|
||||
this.hasImages = ko.observable(false);
|
||||
this.attachments = ko.observableArray([]);
|
||||
|
||||
this.isPgpSigned = ko.observable(false);
|
||||
this.isPgpEncrypted = ko.observable(false);
|
||||
this.pgpSignature = ko.observable('');
|
||||
|
||||
this.priority = ko.observable(Enums.MessagePriority.Normal);
|
||||
this.readReceipt = ko.observable('');
|
||||
|
||||
|
|
@ -6573,6 +6583,10 @@ MessageModel.prototype.clear = function ()
|
|||
this.isHtml(false);
|
||||
this.hasImages(false);
|
||||
this.attachments([]);
|
||||
|
||||
this.isPgpSigned(false);
|
||||
this.isPgpEncrypted(false);
|
||||
this.pgpSignature('');
|
||||
|
||||
this.priority(Enums.MessagePriority.Normal);
|
||||
this.readReceipt('');
|
||||
|
|
@ -6667,6 +6681,13 @@ MessageModel.prototype.initUpdateByMessageJson = function (oJsonMessage)
|
|||
this.sInReplyTo = oJsonMessage.InReplyTo;
|
||||
this.sReferences = oJsonMessage.References;
|
||||
|
||||
if (Globals.bAllowOpenPGP)
|
||||
{
|
||||
this.isPgpSigned(!!oJsonMessage.PgpSigned);
|
||||
this.isPgpEncrypted(!!oJsonMessage.PgpEncrypted);
|
||||
this.pgpSignature(oJsonMessage.PgpSignature);
|
||||
}
|
||||
|
||||
this.hasAttachments(!!oJsonMessage.HasAttachments);
|
||||
this.attachmentsMainType(oJsonMessage.AttachmentsMainType);
|
||||
|
||||
|
|
@ -7128,6 +7149,10 @@ MessageModel.prototype.populateByMessageListItem = function (oMessage)
|
|||
// this.hasImages(false);
|
||||
// this.attachments([]);
|
||||
|
||||
// this.isPgpSigned(false);
|
||||
// this.isPgpEncrypted(false);
|
||||
// this.pgpSignature('');
|
||||
|
||||
this.priority(Enums.MessagePriority.Normal);
|
||||
this.aDraftInfo = [];
|
||||
this.sMessageId = '';
|
||||
|
|
@ -7277,7 +7302,7 @@ MessageModel.prototype.showInternalImages = function (bLazy)
|
|||
Utils.windowResize(500);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -7611,7 +7636,7 @@ FolderModel.prototype.printableFullName = function ()
|
|||
{
|
||||
return this.fullName.split(this.delimiter).join(' / ');
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {string} sEmail
|
||||
* @param {boolean=} bCanBeDelete = true
|
||||
|
|
@ -7632,7 +7657,7 @@ AccountModel.prototype.email = '';
|
|||
AccountModel.prototype.changeAccountLink = function ()
|
||||
{
|
||||
return RL.link().change(this.email);
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @param {string} sId
|
||||
* @param {string} sEmail
|
||||
|
|
@ -7668,7 +7693,7 @@ IdentityModel.prototype.formattedNameForEmail = function ()
|
|||
var sName = this.name();
|
||||
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -7778,7 +7803,7 @@ PopupsFolderClearViewModel.prototype.onBuild = function ()
|
|||
return bResult;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -7902,7 +7927,7 @@ PopupsFolderCreateViewModel.prototype.onBuild = function ()
|
|||
return bResult;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -8021,7 +8046,7 @@ PopupsFolderSystemViewModel.prototype.onBuild = function ()
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -9469,7 +9494,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function ()
|
|||
this.resizer(!this.resizer());
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -10109,7 +10134,7 @@ PopupsContactsViewModel.prototype.onHide = function ()
|
|||
oItem.checked(false);
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -10253,7 +10278,7 @@ PopupsAdvancedSearchViewModel.prototype.onBuild = function ()
|
|||
return bResult;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -10381,7 +10406,7 @@ PopupsAddAccountViewModel.prototype.onBuild = function ()
|
|||
return bResult;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -10543,7 +10568,7 @@ PopupsIdentityViewModel.prototype.onBuild = function ()
|
|||
return bResult;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -10617,7 +10642,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
|
|||
RL.data().mainLanguage(sLang);
|
||||
this.cancelCommand();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -10735,7 +10760,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
|
|||
});
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -11007,7 +11032,7 @@ LoginViewModel.prototype.selectLanguage = function ()
|
|||
kn.showScreenPopup(PopupsLanguagesViewModel);
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -11074,7 +11099,7 @@ AbstractSystemDropDownViewModel.prototype.logoutClick = function ()
|
|||
|
||||
RL.loginAndLogoutReload(true, RL.settingsGet('ParentEmail') && 0 < RL.settingsGet('ParentEmail').length);
|
||||
});
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractSystemDropDownViewModel
|
||||
|
|
@ -11086,7 +11111,7 @@ function MailBoxSystemDropDownViewModel()
|
|||
}
|
||||
|
||||
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractSystemDropDownViewModel
|
||||
|
|
@ -11098,7 +11123,7 @@ function SettingsSystemDropDownViewModel()
|
|||
}
|
||||
|
||||
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -11213,7 +11238,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function ()
|
|||
kn.showScreenPopup(PopupsContactsViewModel);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -12127,7 +12152,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
|
|||
;
|
||||
|
||||
return !!oJua;
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -12212,7 +12237,7 @@ function MailBoxMessageViewViewModel()
|
|||
this.viewDownloadLink = ko.observable('');
|
||||
this.viewUserPic = ko.observable(Consts.DataImages.UserDotPic);
|
||||
this.viewUserPicVisible = ko.observable(false);
|
||||
|
||||
|
||||
this.message.subscribe(function (oMessage) {
|
||||
|
||||
this.messageActiveDom(null);
|
||||
|
|
@ -12476,7 +12501,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
|
|||
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {?} oScreen
|
||||
*
|
||||
|
|
@ -12503,7 +12528,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function ()
|
|||
{
|
||||
kn.setHash(RL.link().inbox());
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractViewModel
|
||||
|
|
@ -12526,7 +12551,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function ()
|
|||
{
|
||||
kn.setHash(RL.link().inbox());
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -12680,7 +12705,7 @@ SettingsGeneral.prototype.selectLanguage = function ()
|
|||
{
|
||||
kn.showScreenPopup(PopupsLanguagesViewModel);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -12718,7 +12743,7 @@ SettingsContacts.prototype.onShow = function ()
|
|||
{
|
||||
this.showPassword(false);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -12784,7 +12809,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
|
|||
}
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -12842,7 +12867,7 @@ SettingsIdentity.prototype.onBuild = function ()
|
|||
|
||||
}, 50);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -12970,7 +12995,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
|
|||
});
|
||||
|
||||
}, 50);
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -13037,7 +13062,7 @@ function SettingsSocialScreen()
|
|||
}
|
||||
|
||||
Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -13101,7 +13126,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes
|
|||
this.passwordUpdateError(true);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -13296,7 +13321,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
|
|||
|
||||
oFolder.subScribed(false);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -13513,7 +13538,7 @@ SettingsThemes.prototype.initCustomThemeUploader = function ()
|
|||
return false;
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -13582,7 +13607,7 @@ AbstractData.prototype.populateDataOnStart = function()
|
|||
|
||||
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractData
|
||||
|
|
@ -14292,6 +14317,10 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
|
|||
oBody = null,
|
||||
oTextBody = null,
|
||||
sId = '',
|
||||
sPlain = '',
|
||||
bPgpSigned = false,
|
||||
bPgpEncrypted = false,
|
||||
mPgpMessage = null,
|
||||
oMessagesBodiesDom = this.messagesBodiesDom(),
|
||||
oMessage = this.message()
|
||||
;
|
||||
|
|
@ -14330,7 +14359,57 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
|
|||
else if (Utils.isNormal(oData.Result.Plain) && '' !== oData.Result.Plain)
|
||||
{
|
||||
bIsHtml = false;
|
||||
oBody.html(oData.Result.Plain.toString()).addClass('b-text-part plain');
|
||||
sPlain = oData.Result.Plain.toString();
|
||||
|
||||
if (Globals.bAllowOpenPGP && (oMessage.isPgpSigned() || oMessage.isPgpEncrypted()) &&
|
||||
Utils.isNormal(oData.Result.PlainRaw))
|
||||
{
|
||||
bPgpEncrypted = /---BEGIN PGP MESSAGE---/.test(oData.Result.PlainRaw);
|
||||
if (!bPgpEncrypted)
|
||||
{
|
||||
bPgpSigned = /-----BEGIN PGP SIGNED MESSAGE-----/.test(oData.Result.PlainRaw) &&
|
||||
/-----BEGIN PGP SIGNATURE-----/.test(oData.Result.PlainRaw);
|
||||
}
|
||||
|
||||
if (bPgpSigned && oMessage.isPgpSigned() && oMessage.pgpSignature())
|
||||
{
|
||||
sPlain = '<pre class="b-plain-openpgp signed">' + oData.Result.PlainRaw + '</pre>';
|
||||
|
||||
try
|
||||
{
|
||||
mPgpMessage = window.openpgp.cleartext.readArmored(oData.Result.PlainRaw);
|
||||
}
|
||||
catch (oExc) {}
|
||||
|
||||
if (mPgpMessage && mPgpMessage.getText)
|
||||
{
|
||||
sPlain = mPgpMessage.getText();
|
||||
}
|
||||
else
|
||||
{
|
||||
bPgpSigned = false;
|
||||
}
|
||||
}
|
||||
else if (bPgpEncrypted && oMessage.isPgpEncrypted())
|
||||
{
|
||||
try
|
||||
{
|
||||
mPgpMessage = window.openpgp.message.readArmored(oData.Result.PlainRaw);
|
||||
}
|
||||
catch (oExc) {}
|
||||
|
||||
sPlain = '<pre class="b-plain-openpgp encrypted">' + oData.Result.PlainRaw + '</pre>';
|
||||
}
|
||||
|
||||
if (bPgpSigned || bPgpEncrypted)
|
||||
{
|
||||
oBody.data('rl-plain-raw', oData.Result.PlainRaw);
|
||||
oBody.data('rl-plain-pgp-encrypted', bPgpEncrypted);
|
||||
oBody.data('rl-plain-pgp-signed', bPgpSigned);
|
||||
}
|
||||
}
|
||||
|
||||
oBody.html(sPlain).addClass('b-text-part plain');
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -14343,15 +14422,19 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
|
|||
oBody.addClass('rtl-text-part');
|
||||
}
|
||||
|
||||
oMessagesBodiesDom.append(oBody);
|
||||
|
||||
oBody.data('rl-is-html', bIsHtml);
|
||||
oBody.data('rl-has-images', bHasExternals);
|
||||
|
||||
oMessage.isRtl(!!oBody.data('rl-is-rtl'));
|
||||
oMessage.isHtml(!!oBody.data('rl-is-html'));
|
||||
oMessage.hasImages(!!oBody.data('rl-has-images'));
|
||||
oMessage.body = oBody;
|
||||
if (oMessage.body)
|
||||
{
|
||||
oMessagesBodiesDom.append(oMessage.body);
|
||||
|
||||
oMessage.body.data('rl-is-html', bIsHtml);
|
||||
oMessage.body.data('rl-has-images', bHasExternals);
|
||||
|
||||
oMessage.isRtl(!!oMessage.body.data('rl-is-rtl'));
|
||||
oMessage.isHtml(!!oMessage.body.data('rl-is-html'));
|
||||
oMessage.hasImages(!!oMessage.body.data('rl-has-images'));
|
||||
oMessage.plainRaw = Utils.pString(oMessage.body.data('rl-plain-raw'));
|
||||
}
|
||||
|
||||
if (bHasInternals)
|
||||
{
|
||||
|
|
@ -14367,12 +14450,26 @@ WebMailDataStorage.prototype.setMessage = function (oData, bCached)
|
|||
}
|
||||
else
|
||||
{
|
||||
oTextBody.data('rl-cache-count', ++Globals.iMessageBodyCacheCount);
|
||||
|
||||
oMessage.isRtl(!!oTextBody.data('rl-is-rtl'));
|
||||
oMessage.isHtml(!!oTextBody.data('rl-is-html'));
|
||||
oMessage.hasImages(!!oTextBody.data('rl-has-images'));
|
||||
oMessage.body = oTextBody;
|
||||
if (oMessage.body)
|
||||
{
|
||||
oMessage.body.data('rl-cache-count', ++Globals.iMessageBodyCacheCount);
|
||||
oMessage.isRtl(!!oMessage.body.data('rl-is-rtl'));
|
||||
oMessage.isHtml(!!oMessage.body.data('rl-is-html'));
|
||||
oMessage.hasImages(!!oMessage.body.data('rl-has-images'));
|
||||
oMessage.plainRaw = Utils.pString(oMessage.body.data('rl-plain-raw'));
|
||||
}
|
||||
}
|
||||
|
||||
if (Globals.bAllowOpenPGP && oMessage.body)
|
||||
{
|
||||
oMessage.isPgpSigned(!!oMessage.body.data('rl-plain-pgp-signed'));
|
||||
oMessage.isPgpEncrypted(!!oMessage.body.data('rl-plain-pgp-encrypted'));
|
||||
}
|
||||
else
|
||||
{
|
||||
oMessage.isPgpSigned(false);
|
||||
oMessage.isPgpEncrypted(false);
|
||||
}
|
||||
|
||||
this.messageActiveDom(oMessage.body);
|
||||
|
|
@ -14532,7 +14629,7 @@ WebMailDataStorage.prototype.setMessageList = function (oData, bCached)
|
|||
));
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -14806,7 +14903,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
|
|||
'Version': sVersion
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractAjaxRemoteStorage
|
||||
|
|
@ -15506,7 +15603,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
|
|||
this.defaultRequest(fCallback, 'SocialUsers');
|
||||
};
|
||||
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
*/
|
||||
|
|
@ -15572,7 +15669,7 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
|
|||
{
|
||||
this.oEmailsPicsHashes = oData;
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractCacheStorage
|
||||
|
|
@ -15890,7 +15987,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function
|
|||
this.setMessageFlagsToCache(sFolder, sUid, aFlags);
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @param {Array} aViewModels
|
||||
* @constructor
|
||||
|
|
@ -16067,7 +16164,7 @@ AbstractSettings.prototype.routes = function ()
|
|||
['', oRules]
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractScreen
|
||||
|
|
@ -16082,7 +16179,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype);
|
|||
LoginScreen.prototype.onShow = function ()
|
||||
{
|
||||
RL.setTitle('');
|
||||
};
|
||||
};
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractScreen
|
||||
|
|
@ -16247,7 +16344,7 @@ MailBoxScreen.prototype.routes = function ()
|
|||
[/^([^\/]*)$/, {'normalize_': fNormS}]
|
||||
];
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractSettings
|
||||
|
|
@ -16275,7 +16372,7 @@ SettingsScreen.prototype.onShow = function ()
|
|||
|
||||
RL.setTitle(this.sSettingsTitle);
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends KnoinAbstractBoot
|
||||
|
|
@ -16514,6 +16611,7 @@ AbstractApp.prototype.sub = function (sName, fFunc, oContext)
|
|||
*/
|
||||
AbstractApp.prototype.pub = function (sName, aArgs)
|
||||
{
|
||||
Plugins.runHook('rl-pub', [sName, aArgs]);
|
||||
if (!Utils.isUnd(this.oSubs[sName]))
|
||||
{
|
||||
_.each(this.oSubs[sName], function (aItem) {
|
||||
|
|
@ -16585,7 +16683,7 @@ AbstractApp.prototype.bootstart = function ()
|
|||
|
||||
ssm.ready();
|
||||
};
|
||||
|
||||
|
||||
/**
|
||||
* @constructor
|
||||
* @extends AbstractApp
|
||||
|
|
@ -17289,6 +17387,7 @@ RainLoopApp.prototype.mailToHelper = function (sMailToUrl)
|
|||
|
||||
RainLoopApp.prototype.bootstart = function ()
|
||||
{
|
||||
RL.pub('rl.bootstart');
|
||||
AbstractApp.prototype.bootstart.call(this);
|
||||
|
||||
RL.data().populateDataOnStart();
|
||||
|
|
@ -17371,17 +17470,26 @@ RainLoopApp.prototype.bootstart = function ()
|
|||
|
||||
if (bValue)
|
||||
{
|
||||
// if (window.crypto && window.crypto.getRandomValues)
|
||||
// {
|
||||
// $.ajax({
|
||||
// 'url': RL.link().openPgpJs(),
|
||||
// 'dataType': 'script',
|
||||
// 'cache': true,
|
||||
// 'success': function () {
|
||||
// window.console.log('openPgpJs');
|
||||
// }
|
||||
// });
|
||||
// }
|
||||
if (window.crypto && window.crypto.getRandomValues && RL.settingsGet('OpenPGP'))
|
||||
{
|
||||
$.ajax({
|
||||
'url': RL.link().openPgpJs(),
|
||||
'dataType': 'script',
|
||||
'cache': true,
|
||||
'success': function () {
|
||||
if (window.openpgp)
|
||||
{
|
||||
// window.console.log(window.openpgp);
|
||||
Globals.bAllowOpenPGP = true;
|
||||
RL.pub('openpgp.init');
|
||||
}
|
||||
}
|
||||
});
|
||||
}
|
||||
else
|
||||
{
|
||||
Globals.bAllowOpenPGP = false;
|
||||
}
|
||||
|
||||
kn.startScreens([MailBoxScreen, SettingsScreen]);
|
||||
|
||||
|
|
@ -17432,13 +17540,15 @@ RainLoopApp.prototype.bootstart = function ()
|
|||
|
||||
}, 2000);
|
||||
|
||||
|
||||
Plugins.runHook('rl-start-user-screens');
|
||||
RL.pub('rl.bootstart-user-screens');
|
||||
}
|
||||
else
|
||||
{
|
||||
kn.startScreens([LoginScreen]);
|
||||
|
||||
Plugins.runHook('rl-start-login-screens');
|
||||
RL.pub('rl.bootstart-login-screens');
|
||||
}
|
||||
|
||||
if (window.SimplePace)
|
||||
|
|
@ -17464,6 +17574,7 @@ RainLoopApp.prototype.bootstart = function ()
|
|||
kn.startScreens([LoginScreen]);
|
||||
|
||||
Plugins.runHook('rl-start-login-screens');
|
||||
RL.pub('rl.bootstart-login-screens');
|
||||
|
||||
if (window.SimplePace)
|
||||
{
|
||||
|
|
@ -17511,13 +17622,14 @@ RainLoopApp.prototype.bootstart = function ()
|
|||
});
|
||||
|
||||
Plugins.runHook('rl-start-screens');
|
||||
RL.pub('rl.bootstart-end');
|
||||
};
|
||||
|
||||
/**
|
||||
* @type {RainLoopApp}
|
||||
*/
|
||||
RL = new RainLoopApp();
|
||||
|
||||
|
||||
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
|
||||
|
||||
$window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
|
||||
|
|
@ -17564,9 +17676,9 @@ window['__RLBOOT'] = function (fCall) {
|
|||
window['__RLBOOT'] = null;
|
||||
});
|
||||
};
|
||||
|
||||
|
||||
if (window.SimplePace) {
|
||||
window.SimplePace.add(10);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
}(window, jQuery, ko, crossroads, hasher, moment, Jua, _, ifvisible));
|
||||
Loading…
Add table
Add a link
Reference in a new issue