Many interface improvements, optimizations

This commit is contained in:
RainLoop Team 2014-05-07 20:04:32 +04:00
parent 40d2548a53
commit 53dc509d79
42 changed files with 686 additions and 461 deletions

View file

@ -1,5 +1,5 @@
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, _) {
/*! RainLoop Webmail Admin Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, _) {
'use strict';
@ -69,20 +69,22 @@ var
I18n = window['rainloopI18N'] || {},
$html = $('html'),
// $body = $('body'),
$window = $(window),
$document = $(window.document),
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
;
/*jshint onevar: false*/
/**
* @type {?AdminApp}
*/
var RL = null;
/*jshint onevar: true*/
/**
* @type {?}
*/
@ -231,7 +233,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
Consts.Defaults = {};
Consts.Values = {};
Consts.DataImages = {};
@ -349,7 +351,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/**
* @enum {string}
*/
@ -405,6 +407,7 @@ Enums.FolderType = {
'Trash': 13,
'Spam': 14,
'Archive': 15,
'NotSpam': 80,
'User': 99
};
@ -723,7 +726,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
Utils.trim = $.trim;
Utils.inArray = $.inArray;
Utils.isArray = _.isArray;
@ -2061,7 +2064,7 @@ Utils.convertPlainTextToHtml = function (sPlain)
Utils.draggeblePlace = function ()
{
return $('<div class="draggablePlace"><span class="text"></span>&nbsp;<i class="icon-mail icon-white"></i></div>').appendTo('#rl-hidden');
return $('<div class="draggablePlace"><span class="text"></span>&nbsp;<i class="icon-copy icon-white visible-on-ctrl"></i><i class="icon-mail icon-white hidden-on-ctrl"></i></div>').appendTo('#rl-hidden');
};
Utils.defautOptionsAfterRender = function (oOption, oItem)
@ -2466,7 +2469,7 @@ Utils.detectDropdownVisibility = _.debounce(function () {
Globals.dropdownVisibility(!!_.find(BootstrapDropdowns, function (oItem) {
return oItem.hasClass('open');
}));
}, 50);
}, 50);
// Base64 encode / decode
// http://www.webtoolkit.info/
@ -2629,7 +2632,7 @@ Base64 = {
}
};
/*jslint bitwise: false*/
/*jslint bitwise: false*/
ko.bindingHandlers.tooltip = {
'init': function (oElement, fValueAccessor) {
if (!Globals.bMobileDevice)
@ -3016,7 +3019,7 @@ ko.bindingHandlers.draggable = {
}
oConf['helper'] = function (oEvent) {
return fValueAccessor()(oEvent && oEvent.target ? ko.dataFor(oEvent.target) : null, !!oEvent.shiftKey);
return fValueAccessor()(oEvent && oEvent.target ? ko.dataFor(oEvent.target) : null);
};
$(oElement).draggable(oConf).on('mousedown', function () {
@ -3374,7 +3377,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
/**
* @constructor
*/
@ -3686,7 +3689,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
/**
* @type {Object}
*/
@ -3780,7 +3783,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
/**
* @constructor
*/
@ -3854,7 +3857,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
/**
* @constructor
*/
@ -3925,7 +3928,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
/**
* @constructor
*/
@ -3968,7 +3971,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
/**
* @constructor
*/
@ -3981,7 +3984,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
/**
* @param {string=} sPosition = ''
* @param {string=} sTemplate = ''
@ -4067,7 +4070,7 @@ KnoinAbstractViewModel.prototype.registerPopupEscapeKey = function ()
return true;
});
};
/**
* @param {string} sScreenName
* @param {?=} aViewModels = []
@ -4143,7 +4146,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
/**
* @constructor
*/
@ -4254,6 +4257,7 @@ Knoin.prototype.buildViewModel = function (ViewModelClass, oScreen)
this.storeAndSetKeyScope();
RL.popupVisibilityNames.push(this.viewModelName);
oViewModel.viewModelDom.css('z-index', 3000 + RL.popupVisibilityNames().length + 10);
Utils.delegateRun(this, 'onFocus', [], 500);
}
@ -4263,6 +4267,7 @@ Knoin.prototype.buildViewModel = function (ViewModelClass, oScreen)
this.restoreKeyScope();
RL.popupVisibilityNames.remove(this.viewModelName);
oViewModel.viewModelDom.css('z-index', 2000);
_.delay(function () {
self.viewModelDom.hide();
@ -4541,7 +4546,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
/**
* @param {string=} sEmail
* @param {string=} sName
@ -4905,7 +4910,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5200,7 +5205,7 @@ PopupsDomainViewModel.prototype.clearForm = function ()
this.smtpAuth(true);
this.whiteList('');
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5337,7 +5342,7 @@ PopupsPluginViewModel.prototype.onBuild = function ()
}
}, this));
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5453,7 +5458,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
{
var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
};
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5513,7 +5518,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5619,7 +5624,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this));
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5706,7 +5711,7 @@ AdminLoginViewModel.prototype.onHide = function ()
{
this.loginFocus(false);
};
/**
* @param {?} oScreen
*
@ -5728,7 +5733,7 @@ AdminMenuViewModel.prototype.link = function (sRoute)
{
return '#/' + sRoute;
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -5753,7 +5758,7 @@ AdminPaneViewModel.prototype.logoutClick = function ()
RL.remote().adminLogout(function () {
RL.loginAndLogoutReload();
});
};
};
/**
* @constructor
*/
@ -5853,7 +5858,7 @@ AdminGeneral.prototype.selectLanguage = function ()
{
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/**
* @constructor
*/
@ -5905,7 +5910,7 @@ AdminLogin.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -5974,7 +5979,7 @@ AdminBranding.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -6194,7 +6199,7 @@ AdminContacts.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -6283,7 +6288,7 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
{
RL.reloadDomainList();
};
/**
* @constructor
*/
@ -6395,7 +6400,7 @@ AdminSecurity.prototype.phpInfoLink = function ()
{
return RL.link().phpInfo();
};
/**
* @constructor
*/
@ -6511,7 +6516,7 @@ AdminSocial.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -6608,7 +6613,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
RL.reloadPluginList();
};
/**
* @constructor
*/
@ -6706,7 +6711,7 @@ AdminPackages.prototype.installPackage = function (oPackage)
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
}
};
/**
* @constructor
*/
@ -6757,7 +6762,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function ()
{
var oDate = moment.unix(this.licenseExpired());
return oDate.format('LL') + ' (' + oDate.from(moment()) + ')';
};
};
/**
* @constructor
*/
@ -6887,7 +6892,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
/**
* @constructor
* @extends AbstractData
@ -6929,7 +6934,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype);
AdminDataStorage.prototype.populateDataOnStart = function()
{
AbstractData.prototype.populateDataOnStart.call(this);
};
};
/**
* @constructor
*/
@ -7203,7 +7208,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
/**
* @constructor
* @extends AbstractAjaxRemoteStorage
@ -7448,7 +7453,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
{
this.defaultRequest(fCallback, 'AdminPing');
};
/**
* @constructor
*/
@ -7531,7 +7536,7 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{
this.oEmailsPicsHashes = oData;
};
/**
* @constructor
* @extends AbstractCacheStorage
@ -7542,7 +7547,7 @@ function AdminCacheStorage()
}
_.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype);
/**
* @param {Array} aViewModels
* @constructor
@ -7720,7 +7725,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
/**
* @constructor
* @extends KnoinAbstractScreen
@ -7735,7 +7740,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype);
AdminLoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/**
* @constructor
* @extends AbstractSettings
@ -7755,7 +7760,7 @@ AdminSettingsScreen.prototype.onShow = function ()
// AbstractSettings.prototype.onShow.call(this);
RL.setTitle('');
};
};
/**
* @constructor
* @extends KnoinAbstractBoot
@ -7797,6 +7802,18 @@ function AbstractApp()
);
}
});
$document.on('keydown', function (oEvent) {
if (oEvent && oEvent.ctrlKey)
{
$html.addClass('rl-ctrl-key-pressed');
}
}).on('keyup', function (oEvent) {
if (oEvent && !oEvent.ctrlKey)
{
$html.removeClass('rl-ctrl-key-pressed');
}
});
}
_.extend(AbstractApp.prototype, KnoinAbstractBoot.prototype);
@ -8091,7 +8108,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
/**
* @constructor
* @extends AbstractApp
@ -8330,7 +8347,7 @@ AdminApp.prototype.bootstart = function ()
* @type {AdminApp}
*/
RL = new AdminApp();
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
$window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
@ -8381,9 +8398,9 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null;
});
};
if (window.SimplePace) {
window.SimplePace.add(10);
}
}
}(window, jQuery, ko, crossroads, hasher, _));

File diff suppressed because one or more lines are too long

View file

@ -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, key) {
/*! RainLoop Webmail Main Module (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
(function (window, $, ko, crossroads, hasher, moment, Jua, _, ifvisible, key) {
'use strict';
@ -69,13 +69,15 @@ var
I18n = window['rainloopI18N'] || {},
$html = $('html'),
// $body = $('body'),
$window = $(window),
$document = $(window.document),
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
;
/*jshint onevar: false*/
/**
* @type {?RainLoopApp}
@ -86,7 +88,7 @@ var
$proxyDiv = $('<div></div>')
;
/*jshint onevar: true*/
/**
* @type {?}
*/
@ -235,7 +237,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
Consts.Defaults = {};
Consts.Values = {};
Consts.DataImages = {};
@ -353,7 +355,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/**
* @enum {string}
*/
@ -409,6 +411,7 @@ Enums.FolderType = {
'Trash': 13,
'Spam': 14,
'Archive': 15,
'NotSpam': 80,
'User': 99
};
@ -727,7 +730,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
Utils.trim = $.trim;
Utils.inArray = $.inArray;
Utils.isArray = _.isArray;
@ -2065,7 +2068,7 @@ Utils.convertPlainTextToHtml = function (sPlain)
Utils.draggeblePlace = function ()
{
return $('<div class="draggablePlace"><span class="text"></span>&nbsp;<i class="icon-mail icon-white"></i></div>').appendTo('#rl-hidden');
return $('<div class="draggablePlace"><span class="text"></span>&nbsp;<i class="icon-copy icon-white visible-on-ctrl"></i><i class="icon-mail icon-white hidden-on-ctrl"></i></div>').appendTo('#rl-hidden');
};
Utils.defautOptionsAfterRender = function (oOption, oItem)
@ -2470,7 +2473,7 @@ Utils.detectDropdownVisibility = _.debounce(function () {
Globals.dropdownVisibility(!!_.find(BootstrapDropdowns, function (oItem) {
return oItem.hasClass('open');
}));
}, 50);
}, 50);
// Base64 encode / decode
// http://www.webtoolkit.info/
@ -2633,7 +2636,7 @@ Base64 = {
}
};
/*jslint bitwise: false*/
/*jslint bitwise: false*/
ko.bindingHandlers.tooltip = {
'init': function (oElement, fValueAccessor) {
if (!Globals.bMobileDevice)
@ -3020,7 +3023,7 @@ ko.bindingHandlers.draggable = {
}
oConf['helper'] = function (oEvent) {
return fValueAccessor()(oEvent && oEvent.target ? ko.dataFor(oEvent.target) : null, !!oEvent.shiftKey);
return fValueAccessor()(oEvent && oEvent.target ? ko.dataFor(oEvent.target) : null);
};
$(oElement).draggable(oConf).on('mousedown', function () {
@ -3378,7 +3381,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
/**
* @constructor
*/
@ -3690,7 +3693,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
/**
* @type {Object}
*/
@ -3784,7 +3787,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
function NewHtmlEditorWrapper(oElement, fOnBlur, fOnReady, fOnModeChange)
{
var self = this;
@ -4004,7 +4007,7 @@ NewHtmlEditorWrapper.prototype.clear = function (bFocus)
this.setHtml('', bFocus);
};
/**
* @constructor
* @param {koProperty} oKoList
@ -4713,7 +4716,7 @@ Selector.prototype.on = function (sEventName, fCallback)
{
this.oCallbacks[sEventName] = fCallback;
};
/**
* @constructor
*/
@ -4787,7 +4790,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
/**
* @constructor
*/
@ -4858,7 +4861,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
/**
* @constructor
*/
@ -4901,7 +4904,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
/**
* @constructor
*/
@ -4914,7 +4917,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
/**
* @param {string=} sPosition = ''
* @param {string=} sTemplate = ''
@ -5000,7 +5003,7 @@ KnoinAbstractViewModel.prototype.registerPopupEscapeKey = function ()
return true;
});
};
/**
* @param {string} sScreenName
* @param {?=} aViewModels = []
@ -5076,7 +5079,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
/**
* @constructor
*/
@ -5187,6 +5190,7 @@ Knoin.prototype.buildViewModel = function (ViewModelClass, oScreen)
this.storeAndSetKeyScope();
RL.popupVisibilityNames.push(this.viewModelName);
oViewModel.viewModelDom.css('z-index', 3000 + RL.popupVisibilityNames().length + 10);
Utils.delegateRun(this, 'onFocus', [], 500);
}
@ -5196,6 +5200,7 @@ Knoin.prototype.buildViewModel = function (ViewModelClass, oScreen)
this.restoreKeyScope();
RL.popupVisibilityNames.remove(this.viewModelName);
oViewModel.viewModelDom.css('z-index', 2000);
_.delay(function () {
self.viewModelDom.hide();
@ -5474,7 +5479,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
/**
* @param {string=} sEmail
* @param {string=} sName
@ -5838,7 +5843,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
/**
* @constructor
*/
@ -5955,7 +5960,7 @@ ContactModel.prototype.lineAsCcc = function ()
return aResult.join(' ');
};
/**
* @param {number=} iType = Enums.ContactPropertyType.Unknown
* @param {string=} sTypeStr = ''
@ -5984,7 +5989,7 @@ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
}, this);
}
/**
* @constructor
*/
@ -6220,7 +6225,7 @@ AttachmentModel.prototype.iconClass = function ()
return sClass;
};
/**
* @constructor
* @param {string} sId
@ -6281,7 +6286,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
}
return bResult;
};
};
/**
* @constructor
*/
@ -7475,7 +7480,7 @@ MessageModel.prototype.flagHash = function ()
return [this.deleted(), this.unseen(), this.flagged(), this.answered(), this.forwarded(),
this.isReadReceipt()].join('');
};
/**
* @constructor
*/
@ -7807,7 +7812,7 @@ FolderModel.prototype.printableFullName = function ()
{
return this.fullName.split(this.delimiter).join(' / ');
};
/**
* @param {string} sEmail
* @param {boolean=} bCanBeDelete = true
@ -7828,7 +7833,7 @@ AccountModel.prototype.email = '';
AccountModel.prototype.changeAccountLink = function ()
{
return RL.link().change(this.email);
};
};
/**
* @param {string} sId
* @param {string} sEmail
@ -7864,7 +7869,7 @@ IdentityModel.prototype.formattedNameForEmail = function ()
var sName = this.name();
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
};
/**
* @param {string} iIndex
* @param {string} sGuID
@ -7895,7 +7900,7 @@ OpenPgpKeyModel.prototype.user = '';
OpenPgpKeyModel.prototype.email = '';
OpenPgpKeyModel.prototype.armor = '';
OpenPgpKeyModel.prototype.isPrivate = false;
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -7991,7 +7996,7 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
this.selectedFolder(oFolder);
}
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -8101,7 +8106,7 @@ PopupsFolderCreateViewModel.prototype.onFocus = function ()
{
this.folderName.focused(true);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -8214,7 +8219,7 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType)
this.notification(sNotification);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -9702,7 +9707,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function ()
this.editorResizeThrottle();
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10402,7 +10407,7 @@ PopupsContactsViewModel.prototype.onHide = function ()
oItem.checked(false);
});
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10538,7 +10543,7 @@ PopupsAdvancedSearchViewModel.prototype.onFocus = function ()
{
this.fromFocus(true);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10650,7 +10655,7 @@ PopupsAddAccountViewModel.prototype.onFocus = function ()
{
this.emailFocus(true);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10736,7 +10741,7 @@ PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function ()
{
this.key.focus(true);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10776,7 +10781,7 @@ PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey)
this.key(oOpenPgpKey.armor);
}
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -10864,7 +10869,7 @@ PopupsGenerateNewOpenPgpKeyViewModel.prototype.onFocus = function ()
{
this.email.focus(true);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11104,7 +11109,7 @@ PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFr
this.to(aRec);
this.text(sText);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11252,7 +11257,7 @@ PopupsIdentityViewModel.prototype.onFocus = function ()
this.email.focused(true);
}
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11312,7 +11317,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11366,7 +11371,7 @@ PopupsTwoFactorTestViewModel.prototype.onFocus = function ()
{
this.code.focused(true);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11472,7 +11477,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this));
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11517,7 +11522,7 @@ PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom)
}
}, this));
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11829,7 +11834,7 @@ LoginViewModel.prototype.selectLanguage = function ()
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -11925,7 +11930,7 @@ AbstractSystemDropDownViewModel.prototype.onBuild = function ()
}
});
};
/**
* @constructor
* @extends AbstractSystemDropDownViewModel
@ -11937,7 +11942,7 @@ function MailBoxSystemDropDownViewModel()
}
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/**
* @constructor
* @extends AbstractSystemDropDownViewModel
@ -11949,7 +11954,7 @@ function SettingsSystemDropDownViewModel()
}
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -12066,6 +12071,22 @@ MailBoxFolderListViewModel.prototype.onBuild = function (oDom)
return false;
});
key('space', Enums.KeyState.FolderList, function () {
var bCollapsed = true, oFolder = null, $items = $('.b-folders .e-item .e-link:not(.hidden).focused', oDom);
if ($items.length && $items[0])
{
oFolder = ko.dataFor($items[0]);
if (oFolder)
{
bCollapsed = oFolder.collapsed();
Utils.setExpandedFolder(oFolder.fullNameHash, bCollapsed);
oFolder.collapsed(!bCollapsed);
}
}
return false;
});
key('esc, tab, shift+tab, right', Enums.KeyState.FolderList, function () {
self.folderList.focused(false);
return false;
@ -12109,7 +12130,7 @@ MailBoxFolderListViewModel.prototype.messagesDrop = function (oToFolder, oUi)
{
var
sFromFolderFullNameRaw = oUi.helper.data('rl-folder'),
bCopy = '1' === oUi.helper.data('rl-copy'),
bCopy = $html.hasClass('rl-ctrl-key-pressed'),
aUids = oUi.helper.data('rl-uids')
;
@ -12142,7 +12163,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function ()
kn.showScreenPopup(PopupsContactsViewModel);
}
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -12315,6 +12336,12 @@ function MailBoxMessageListViewModel()
RL.data().messageListCheckedOrSelectedUidsWithSubMails(), true);
}, this.canBeMoved);
this.notSpamCommand = Utils.createCommand(this, function () {
RL.deleteMessagesFromFolder(Enums.FolderType.NotSpam,
RL.data().currentFolderFullNameRaw(),
RL.data().messageListCheckedOrSelectedUidsWithSubMails(), true);
}, this.canBeMoved);
this.moveCommand = Utils.createCommand(this, Utils.emptyFunction, this.canBeMoved);
this.reloadCommand = Utils.createCommand(this, function () {
@ -12406,30 +12433,40 @@ MailBoxMessageListViewModel.prototype.cancelSearch = function ()
* @param {string} sToFolderFullNameRaw
* @return {boolean}
*/
MailBoxMessageListViewModel.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw)
MailBoxMessageListViewModel.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy)
{
if (this.canBeMoved())
{
RL.moveMessagesToFolder(
RL.data().currentFolderFullNameRaw(),
RL.data().messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw);
RL.data().messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy);
}
return false;
};
MailBoxMessageListViewModel.prototype.dragAndDronHelper = function (oMessageListItem, bCopy)
MailBoxMessageListViewModel.prototype.dragAndDronHelper = function (oMessageListItem)
{
if (oMessageListItem)
{
oMessageListItem.checked(true);
}
var oEl = Utils.draggeblePlace();
var
oEl = Utils.draggeblePlace(),
aUids = RL.data().messageListCheckedOrSelectedUidsWithSubMails()
;
oEl.data('rl-folder', RL.data().currentFolderFullNameRaw());
oEl.data('rl-uids', RL.data().messageListCheckedOrSelectedUidsWithSubMails());
oEl.data('rl-copy', bCopy ? '1' : '0');
oEl.find('.text').text((bCopy ? '+' : '') + '' + RL.data().messageListCheckedOrSelectedUidsWithSubMails().length);
oEl.data('rl-uids', aUids);
oEl.find('.text').text('' + aUids.length);
_.defer(function () {
var aUids = RL.data().messageListCheckedOrSelectedUidsWithSubMails();
oEl.data('rl-uids', aUids);
oEl.find('.text').text('' + aUids.length);
});
return oEl;
};
@ -13030,7 +13067,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
;
return !!oJua;
};
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -13057,6 +13094,7 @@ function MailBoxMessageViewViewModel()
this.currentMessage = oData.currentMessage;
this.messageListChecked = oData.messageListChecked;
this.hasCheckedMessages = oData.hasCheckedMessages;
this.messageListCheckedOrSelectedUidsWithSubMails = oData.messageListCheckedOrSelectedUidsWithSubMails;
this.messageLoading = oData.messageLoading;
this.messageLoadingThrottle = oData.messageLoadingThrottle;
this.messagesBodiesDom = oData.messagesBodiesDom;
@ -13118,7 +13156,7 @@ function MailBoxMessageViewViewModel()
{
RL.deleteMessagesFromFolder(Enums.FolderType.Trash,
RL.data().currentFolderFullNameRaw(),
RL.data().messageListCheckedOrSelectedUidsWithSubMails(), false);
[this.message().uid], false);
}
}, this.messageVisibility);
@ -13140,6 +13178,15 @@ function MailBoxMessageViewViewModel()
}
}, this.messageVisibility);
this.notSpamCommand = Utils.createCommand(this, function () {
if (this.message())
{
RL.deleteMessagesFromFolder(Enums.FolderType.NotSpam,
this.message().folderFullNameRaw,
[this.message().uid], true);
}
}, this.messageVisibility);
// viewer
this.viewSubject = ko.observable('');
this.viewFromShort = ko.observable('');
@ -13654,6 +13701,16 @@ MailBoxMessageViewViewModel.prototype.showImages = function (oMessage)
}
};
/**
* @returns {string}
*/
MailBoxMessageViewViewModel.prototype.printableCheckedMessageCount = function ()
{
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : '';
};
/**
* @param {MessageModel} oMessage
*/
@ -13694,7 +13751,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
}
};
/**
* @param {?} oScreen
*
@ -13721,7 +13778,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
/**
* @constructor
* @extends KnoinAbstractViewModel
@ -13754,7 +13811,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
/**
* @constructor
*/
@ -13914,7 +13971,7 @@ SettingsGeneral.prototype.selectLanguage = function ()
{
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/**
* @constructor
*/
@ -13964,7 +14021,7 @@ SettingsContacts.prototype.onBuild = function ()
//{
//
//};
/**
* @constructor
*/
@ -14045,7 +14102,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
}
}
};
/**
* @constructor
*/
@ -14133,7 +14190,7 @@ SettingsIdentity.prototype.onBuild = function ()
}, 50);
};
/**
* @constructor
*/
@ -14291,7 +14348,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
});
}, 50);
};
};
/**
* @constructor
*/
@ -14441,7 +14498,7 @@ SettingsSecurity.prototype.onBuild = function ()
this.processing(true);
RL.remote().getTwoFactor(this.onResult);
};
/**
* @constructor
*/
@ -14508,7 +14565,7 @@ function SettingsSocialScreen()
}
Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
/**
* @constructor
*/
@ -14613,7 +14670,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes
Utils.getNotification(Enums.Notification.CouldNotSaveNewPassword));
}
};
/**
* @constructor
*/
@ -14808,7 +14865,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
oFolder.subScribed(false);
};
/**
* @constructor
*/
@ -14922,7 +14979,7 @@ SettingsThemes.prototype.onBuild = function ()
};
}));
};
/**
* @constructor
*/
@ -14990,7 +15047,7 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
RL.reloadOpenPgpKeys();
}
}
};
};
/**
* @constructor
*/
@ -15120,7 +15177,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
/**
* @constructor
* @extends AbstractData
@ -16373,7 +16430,7 @@ WebMailDataStorage.prototype.findSelfPrivateKey = function (sPassword)
{
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
};
/**
* @constructor
*/
@ -16647,7 +16704,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
/**
* @constructor
* @extends AbstractAjaxRemoteStorage
@ -17260,13 +17317,15 @@ WebMailAjaxRemoteStorage.prototype.folderSetSubscribe = function (fCallback, sFo
* @param {string} sFolder
* @param {string} sToFolder
* @param {Array} aUids
* @param {string=} sLearning
*/
WebMailAjaxRemoteStorage.prototype.messagesMove = function (fCallback, sFolder, sToFolder, aUids)
WebMailAjaxRemoteStorage.prototype.messagesMove = function (fCallback, sFolder, sToFolder, aUids, sLearning)
{
this.defaultRequest(fCallback, 'MessageMove', {
'FromFolder': sFolder,
'ToFolder': sToFolder,
'Uids': aUids.join(',')
'Uids': aUids.join(','),
'Learning': sLearning || ''
}, null, '', ['MessageList']);
};
@ -17437,7 +17496,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
this.defaultRequest(fCallback, 'SocialUsers');
};
/**
* @constructor
*/
@ -17520,7 +17579,7 @@ AbstractCacheStorage.prototype.setEmailsPicsHashesData = function (oData)
{
this.oEmailsPicsHashes = oData;
};
/**
* @constructor
* @extends AbstractCacheStorage
@ -17838,7 +17897,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function
this.setMessageFlagsToCache(sFolder, sUid, aFlags);
}
};
/**
* @param {Array} aViewModels
* @constructor
@ -18016,7 +18075,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
/**
* @constructor
* @extends KnoinAbstractScreen
@ -18031,7 +18090,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype);
LoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/**
* @constructor
* @extends KnoinAbstractScreen
@ -18202,7 +18261,7 @@ MailBoxScreen.prototype.routes = function ()
[/^([^\/]*)$/, {'normalize_': fNormS}]
];
};
/**
* @constructor
* @extends AbstractSettings
@ -18231,7 +18290,7 @@ SettingsScreen.prototype.onShow = function ()
RL.setTitle(this.sSettingsTitle);
RL.data().keyScope(Enums.KeyState.Settings);
};
/**
* @constructor
* @extends KnoinAbstractBoot
@ -18273,6 +18332,18 @@ function AbstractApp()
);
}
});
$document.on('keydown', function (oEvent) {
if (oEvent && oEvent.ctrlKey)
{
$html.addClass('rl-ctrl-key-pressed');
}
}).on('keyup', function (oEvent) {
if (oEvent && !oEvent.ctrlKey)
{
$html.removeClass('rl-ctrl-key-pressed');
}
});
}
_.extend(AbstractApp.prototype, KnoinAbstractBoot.prototype);
@ -18567,7 +18638,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
/**
* @constructor
* @extends AbstractApp
@ -18775,10 +18846,20 @@ RainLoopApp.prototype.contactsSync = function (fResultFunc)
RainLoopApp.prototype.messagesMoveTrigger = function ()
{
var self = this;
var
self = this,
sSpamFolder = RL.data().spamFolder()
;
_.each(this.oMoveCache, function (oItem) {
RL.remote().messagesMove(self.moveOrDeleteResponseHelper, oItem['From'], oItem['To'], oItem['Uid']);
var
bSpam = sSpamFolder === oItem['To'],
bHam = !bSpam && sSpamFolder === oItem['From'] && 'INBOX' === oItem['To']
;
RL.remote().messagesMove(self.moveOrDeleteResponseHelper, oItem['From'], oItem['To'], oItem['Uid'],
bSpam ? 'SPAM' : (bHam ? 'HAM' : ''));
});
this.oMoveCache = {};
@ -18875,6 +18956,9 @@ RainLoopApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFol
oMoveFolder = oCache.getFolderFromCacheList(oData.spamFolder());
nSetSystemFoldersNotification = Enums.SetSystemFoldersNotification.Spam;
break;
case Enums.FolderType.NotSpam:
oMoveFolder = oCache.getFolderFromCacheList('INBOX');
break;
case Enums.FolderType.Trash:
oMoveFolder = oCache.getFolderFromCacheList(oData.trashFolder());
nSetSystemFoldersNotification = Enums.SetSystemFoldersNotification.Trash;
@ -19845,7 +19929,7 @@ RainLoopApp.prototype.bootstart = function ()
* @type {RainLoopApp}
*/
RL = new RainLoopApp();
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
$window.keydown(Utils.killCtrlAandS).keyup(Utils.killCtrlAandS);
@ -19896,9 +19980,9 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null;
});
};
if (window.SimplePace) {
window.SimplePace.add(10);
}
}
}(window, jQuery, ko, crossroads, hasher, moment, Jua, _, ifvisible, key));

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long