mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-07-13 03:27:39 +03:00
Code refactoring
This commit is contained in:
parent
345e7c58af
commit
8cf8b94d39
103 changed files with 664 additions and 659 deletions
|
|
@ -22,9 +22,9 @@
|
||||||
|
|
||||||
Local = require('Storage/Local'),
|
Local = require('Storage/Local'),
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
EmailModel = require('Model/Email'),
|
EmailModel = require('Model/Email'),
|
||||||
FolderModel = require('Model/Folder'),
|
FolderModel = require('Model/Folder'),
|
||||||
|
|
@ -40,7 +40,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractApp
|
* @extends AbstractApp
|
||||||
*/
|
*/
|
||||||
function AppApp()
|
function AppUser()
|
||||||
{
|
{
|
||||||
AbstractApp.call(this, Remote);
|
AbstractApp.call(this, Remote);
|
||||||
|
|
||||||
|
|
@ -103,19 +103,19 @@
|
||||||
this.socialUsers = _.bind(this.socialUsers, this);
|
this.socialUsers = _.bind(this.socialUsers, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(AppApp.prototype, AbstractApp.prototype);
|
_.extend(AppUser.prototype, AbstractApp.prototype);
|
||||||
|
|
||||||
AppApp.prototype.remote = function ()
|
AppUser.prototype.remote = function ()
|
||||||
{
|
{
|
||||||
return Remote;
|
return Remote;
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.data = function ()
|
AppUser.prototype.data = function ()
|
||||||
{
|
{
|
||||||
return Data;
|
return Data;
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function ()
|
AppUser.prototype.reloadFlagsCurrentMessageListAndMessageFromCache = function ()
|
||||||
{
|
{
|
||||||
_.each(Data.messageList(), function (oMessage) {
|
_.each(Data.messageList(), function (oMessage) {
|
||||||
Cache.initMessageFlagsFromCache(oMessage);
|
Cache.initMessageFlagsFromCache(oMessage);
|
||||||
|
|
@ -128,7 +128,7 @@
|
||||||
* @param {boolean=} bDropPagePosition = false
|
* @param {boolean=} bDropPagePosition = false
|
||||||
* @param {boolean=} bDropCurrenFolderCache = false
|
* @param {boolean=} bDropCurrenFolderCache = false
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.reloadMessageList = function (bDropPagePosition, bDropCurrenFolderCache)
|
AppUser.prototype.reloadMessageList = function (bDropPagePosition, bDropCurrenFolderCache)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
self = this,
|
self = this,
|
||||||
|
|
@ -172,12 +172,12 @@
|
||||||
}, Data.currentFolderFullNameRaw(), iOffset, Data.messagesPerPage(), Data.messageListSearch());
|
}, Data.currentFolderFullNameRaw(), iOffset, Data.messagesPerPage(), Data.messageListSearch());
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.recacheInboxMessageList = function ()
|
AppUser.prototype.recacheInboxMessageList = function ()
|
||||||
{
|
{
|
||||||
Remote.messageList(Utils.emptyFunction, Cache.getFolderInboxName(), 0, Data.messagesPerPage(), '', true);
|
Remote.messageList(Utils.emptyFunction, Cache.getFolderInboxName(), 0, Data.messagesPerPage(), '', true);
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.reloadMessageListHelper = function (bEmptyList)
|
AppUser.prototype.reloadMessageListHelper = function (bEmptyList)
|
||||||
{
|
{
|
||||||
this.reloadMessageList(bEmptyList);
|
this.reloadMessageList(bEmptyList);
|
||||||
};
|
};
|
||||||
|
|
@ -186,7 +186,7 @@
|
||||||
* @param {Function} fResultFunc
|
* @param {Function} fResultFunc
|
||||||
* @returns {boolean}
|
* @returns {boolean}
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.contactsSync = function (fResultFunc)
|
AppUser.prototype.contactsSync = function (fResultFunc)
|
||||||
{
|
{
|
||||||
var oContacts = Data.contacts;
|
var oContacts = Data.contacts;
|
||||||
if (oContacts.importing() || oContacts.syncing() || !Data.enableContactsSync() || !Data.allowContactsSync())
|
if (oContacts.importing() || oContacts.syncing() || !Data.enableContactsSync() || !Data.allowContactsSync())
|
||||||
|
|
@ -209,7 +209,7 @@
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.messagesMoveTrigger = function ()
|
AppUser.prototype.messagesMoveTrigger = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
self = this,
|
self = this,
|
||||||
|
|
@ -230,7 +230,7 @@
|
||||||
this.oMoveCache = {};
|
this.oMoveCache = {};
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove)
|
AppUser.prototype.messagesMoveHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForMove)
|
||||||
{
|
{
|
||||||
var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$';
|
var sH = '$$' + sFromFolderFullNameRaw + '$$' + sToFolderFullNameRaw + '$$';
|
||||||
if (!this.oMoveCache[sH])
|
if (!this.oMoveCache[sH])
|
||||||
|
|
@ -246,7 +246,7 @@
|
||||||
this.messagesMoveTrigger();
|
this.messagesMoveTrigger();
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy)
|
AppUser.prototype.messagesCopyHelper = function (sFromFolderFullNameRaw, sToFolderFullNameRaw, aUidForCopy)
|
||||||
{
|
{
|
||||||
Remote.messagesCopy(
|
Remote.messagesCopy(
|
||||||
this.moveOrDeleteResponseHelper,
|
this.moveOrDeleteResponseHelper,
|
||||||
|
|
@ -256,7 +256,7 @@
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove)
|
AppUser.prototype.messagesDeleteHelper = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||||
{
|
{
|
||||||
Remote.messagesDelete(
|
Remote.messagesDelete(
|
||||||
this.moveOrDeleteResponseHelper,
|
this.moveOrDeleteResponseHelper,
|
||||||
|
|
@ -265,7 +265,7 @@
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
AppUser.prototype.moveOrDeleteResponseHelper = function (sResult, oData)
|
||||||
{
|
{
|
||||||
if (Enums.StorageResultType.Success === sResult && Data.currentFolder())
|
if (Enums.StorageResultType.Success === sResult && Data.currentFolder())
|
||||||
{
|
{
|
||||||
|
|
@ -293,7 +293,7 @@
|
||||||
* @param {string} sFromFolderFullNameRaw
|
* @param {string} sFromFolderFullNameRaw
|
||||||
* @param {Array} aUidForRemove
|
* @param {Array} aUidForRemove
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove)
|
AppUser.prototype.deleteMessagesFromFolderWithoutCheck = function (sFromFolderFullNameRaw, aUidForRemove)
|
||||||
{
|
{
|
||||||
this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
this.messagesDeleteHelper(sFromFolderFullNameRaw, aUidForRemove);
|
||||||
Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
|
Data.removeMessagesFromList(sFromFolderFullNameRaw, aUidForRemove);
|
||||||
|
|
@ -305,7 +305,7 @@
|
||||||
* @param {Array} aUidForRemove
|
* @param {Array} aUidForRemove
|
||||||
* @param {boolean=} bUseFolder = true
|
* @param {boolean=} bUseFolder = true
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFolderFullNameRaw, aUidForRemove, bUseFolder)
|
AppUser.prototype.deleteMessagesFromFolder = function (iDeleteType, sFromFolderFullNameRaw, aUidForRemove, bUseFolder)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
self = this,
|
self = this,
|
||||||
|
|
@ -370,7 +370,7 @@
|
||||||
* @param {string} sToFolderFullNameRaw
|
* @param {string} sToFolderFullNameRaw
|
||||||
* @param {boolean=} bCopy = false
|
* @param {boolean=} bCopy = false
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.moveMessagesToFolder = function (sFromFolderFullNameRaw, aUidForMove, sToFolderFullNameRaw, bCopy)
|
AppUser.prototype.moveMessagesToFolder = function (sFromFolderFullNameRaw, aUidForMove, sToFolderFullNameRaw, bCopy)
|
||||||
{
|
{
|
||||||
if (sFromFolderFullNameRaw !== sToFolderFullNameRaw && Utils.isArray(aUidForMove) && 0 < aUidForMove.length)
|
if (sFromFolderFullNameRaw !== sToFolderFullNameRaw && Utils.isArray(aUidForMove) && 0 < aUidForMove.length)
|
||||||
{
|
{
|
||||||
|
|
@ -401,7 +401,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {Function=} fCallback
|
* @param {Function=} fCallback
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.folders = function (fCallback)
|
AppUser.prototype.folders = function (fCallback)
|
||||||
{
|
{
|
||||||
Data.foldersLoading(true);
|
Data.foldersLoading(true);
|
||||||
|
|
||||||
|
|
@ -424,7 +424,7 @@
|
||||||
}, this));
|
}, this));
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.reloadOpenPgpKeys = function ()
|
AppUser.prototype.reloadOpenPgpKeys = function ()
|
||||||
{
|
{
|
||||||
if (Data.capaOpenPGP())
|
if (Data.capaOpenPGP())
|
||||||
{
|
{
|
||||||
|
|
@ -468,7 +468,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.accountsAndIdentities = function ()
|
AppUser.prototype.accountsAndIdentities = function ()
|
||||||
{
|
{
|
||||||
Data.accountsLoading(true);
|
Data.accountsLoading(true);
|
||||||
Data.identitiesLoading(true);
|
Data.identitiesLoading(true);
|
||||||
|
|
@ -517,7 +517,7 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.quota = function ()
|
AppUser.prototype.quota = function ()
|
||||||
{
|
{
|
||||||
Remote.quota(function (sResult, oData) {
|
Remote.quota(function (sResult, oData) {
|
||||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result &&
|
if (Enums.StorageResultType.Success === sResult && oData && oData.Result &&
|
||||||
|
|
@ -534,7 +534,7 @@
|
||||||
* @param {string} sFolder
|
* @param {string} sFolder
|
||||||
* @param {Array=} aList = []
|
* @param {Array=} aList = []
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.folderInformation = function (sFolder, aList)
|
AppUser.prototype.folderInformation = function (sFolder, aList)
|
||||||
{
|
{
|
||||||
if ('' !== Utils.trim(sFolder))
|
if ('' !== Utils.trim(sFolder))
|
||||||
{
|
{
|
||||||
|
|
@ -638,7 +638,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {boolean=} bBoot = false
|
* @param {boolean=} bBoot = false
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.folderInformationMultiply = function (bBoot)
|
AppUser.prototype.folderInformationMultiply = function (bBoot)
|
||||||
{
|
{
|
||||||
bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
|
bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
|
||||||
|
|
||||||
|
|
@ -724,7 +724,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.setMessageSeen = function (oMessage)
|
AppUser.prototype.setMessageSeen = function (oMessage)
|
||||||
{
|
{
|
||||||
if (oMessage.unseen())
|
if (oMessage.unseen())
|
||||||
{
|
{
|
||||||
|
|
@ -744,17 +744,17 @@
|
||||||
Remote.messageSetSeen(Utils.emptyFunction, oMessage.folderFullNameRaw, [oMessage.uid], true);
|
Remote.messageSetSeen(Utils.emptyFunction, oMessage.folderFullNameRaw, [oMessage.uid], true);
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.googleConnect = function ()
|
AppUser.prototype.googleConnect = function ()
|
||||||
{
|
{
|
||||||
window.open(Links.socialGoogle(), 'Google', 'left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
window.open(Links.socialGoogle(), 'Google', 'left=200,top=100,width=650,height=600,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.twitterConnect = function ()
|
AppUser.prototype.twitterConnect = function ()
|
||||||
{
|
{
|
||||||
window.open(Links.socialTwitter(), 'Twitter', 'left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
window.open(Links.socialTwitter(), 'Twitter', 'left=200,top=100,width=650,height=350,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.facebookConnect = function ()
|
AppUser.prototype.facebookConnect = function ()
|
||||||
{
|
{
|
||||||
window.open(Links.socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
window.open(Links.socialFacebook(), 'Facebook', 'left=200,top=100,width=650,height=335,menubar=no,status=no,resizable=yes,scrollbars=yes');
|
||||||
};
|
};
|
||||||
|
|
@ -762,7 +762,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {boolean=} bFireAllActions
|
* @param {boolean=} bFireAllActions
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.socialUsers = function (bFireAllActions)
|
AppUser.prototype.socialUsers = function (bFireAllActions)
|
||||||
{
|
{
|
||||||
if (bFireAllActions)
|
if (bFireAllActions)
|
||||||
{
|
{
|
||||||
|
|
@ -796,19 +796,19 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.googleDisconnect = function ()
|
AppUser.prototype.googleDisconnect = function ()
|
||||||
{
|
{
|
||||||
Data.googleActions(true);
|
Data.googleActions(true);
|
||||||
Remote.googleDisconnect(this.socialUsers);
|
Remote.googleDisconnect(this.socialUsers);
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.facebookDisconnect = function ()
|
AppUser.prototype.facebookDisconnect = function ()
|
||||||
{
|
{
|
||||||
Data.facebookActions(true);
|
Data.facebookActions(true);
|
||||||
Remote.facebookDisconnect(this.socialUsers);
|
Remote.facebookDisconnect(this.socialUsers);
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.twitterDisconnect = function ()
|
AppUser.prototype.twitterDisconnect = function ()
|
||||||
{
|
{
|
||||||
Data.twitterActions(true);
|
Data.twitterActions(true);
|
||||||
Remote.twitterDisconnect(this.socialUsers);
|
Remote.twitterDisconnect(this.socialUsers);
|
||||||
|
|
@ -818,7 +818,7 @@
|
||||||
* @param {string} sQuery
|
* @param {string} sQuery
|
||||||
* @param {Function} fCallback
|
* @param {Function} fCallback
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.getAutocomplete = function (sQuery, fCallback)
|
AppUser.prototype.getAutocomplete = function (sQuery, fCallback)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
aData = []
|
aData = []
|
||||||
|
|
@ -841,7 +841,7 @@
|
||||||
}, sQuery);
|
}, sQuery);
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.setMessageList = function (oData, bCached)
|
AppUser.prototype.setMessageList = function (oData, bCached)
|
||||||
{
|
{
|
||||||
if (oData && oData.Result && 'Collection/MessageCollection' === oData.Result['@Object'] &&
|
if (oData && oData.Result && 'Collection/MessageCollection' === oData.Result['@Object'] &&
|
||||||
oData.Result['@Collection'] && Utils.isArray(oData.Result['@Collection']))
|
oData.Result['@Collection'] && Utils.isArray(oData.Result['@Collection']))
|
||||||
|
|
@ -976,7 +976,7 @@
|
||||||
* @param {Array} aFolders
|
* @param {Array} aFolders
|
||||||
* @return {Array}
|
* @return {Array}
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.folderResponseParseRec = function (sNamespace, aFolders)
|
AppUser.prototype.folderResponseParseRec = function (sNamespace, aFolders)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
self = this,
|
self = this,
|
||||||
|
|
@ -1048,7 +1048,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {*} oData
|
* @param {*} oData
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.setFolders = function (oData)
|
AppUser.prototype.setFolders = function (oData)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
aList = [],
|
aList = [],
|
||||||
|
|
@ -1113,7 +1113,7 @@
|
||||||
* @param {string} sFullNameHash
|
* @param {string} sFullNameHash
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.isFolderExpanded = function (sFullNameHash)
|
AppUser.prototype.isFolderExpanded = function (sFullNameHash)
|
||||||
{
|
{
|
||||||
var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
|
var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
|
||||||
return Utils.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash);
|
return Utils.isArray(aExpandedList) && -1 !== _.indexOf(aExpandedList, sFullNameHash);
|
||||||
|
|
@ -1123,7 +1123,7 @@
|
||||||
* @param {string} sFullNameHash
|
* @param {string} sFullNameHash
|
||||||
* @param {boolean} bExpanded
|
* @param {boolean} bExpanded
|
||||||
*/
|
*/
|
||||||
AppApp.prototype.setExpandedFolder = function (sFullNameHash, bExpanded)
|
AppUser.prototype.setExpandedFolder = function (sFullNameHash, bExpanded)
|
||||||
{
|
{
|
||||||
var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
|
var aExpandedList = Local.get(Enums.ClientSideKeyName.ExpandedFolders);
|
||||||
if (!Utils.isArray(aExpandedList))
|
if (!Utils.isArray(aExpandedList))
|
||||||
|
|
@ -1144,7 +1144,7 @@
|
||||||
Local.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList);
|
Local.set(Enums.ClientSideKeyName.ExpandedFolders, aExpandedList);
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName)
|
AppUser.prototype.initLayoutResizer = function (sLeft, sRight, sClientSideKeyName)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
iDisabledWidth = 60,
|
iDisabledWidth = 60,
|
||||||
|
|
@ -1215,7 +1215,7 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.bootstartLoginScreen = function ()
|
AppUser.prototype.bootstartLoginScreen = function ()
|
||||||
{
|
{
|
||||||
var sCustomLoginLink = Utils.pString(Settings.settingsGet('CustomLoginLink'));
|
var sCustomLoginLink = Utils.pString(Settings.settingsGet('CustomLoginLink'));
|
||||||
if (!sCustomLoginLink)
|
if (!sCustomLoginLink)
|
||||||
|
|
@ -1223,7 +1223,7 @@
|
||||||
kn.hideLoading();
|
kn.hideLoading();
|
||||||
|
|
||||||
kn.startScreens([
|
kn.startScreens([
|
||||||
require('Screen/App/Login')
|
require('Screen/User/Login')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Plugins.runHook('rl-start-login-screens');
|
Plugins.runHook('rl-start-login-screens');
|
||||||
|
|
@ -1241,7 +1241,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AppApp.prototype.bootstart = function ()
|
AppUser.prototype.bootstart = function ()
|
||||||
{
|
{
|
||||||
AbstractApp.prototype.bootstart.call(this);
|
AbstractApp.prototype.bootstart.call(this);
|
||||||
|
|
||||||
|
|
@ -1318,9 +1318,9 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.startScreens([
|
kn.startScreens([
|
||||||
require('Screen/App/MailBox'),
|
require('Screen/User/MailBox'),
|
||||||
require('Screen/App/Settings'),
|
require('Screen/User/Settings'),
|
||||||
require('Screen/App/About')
|
require('Screen/User/About')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
if (bGoogle || bFacebook || bTwitter)
|
if (bGoogle || bFacebook || bTwitter)
|
||||||
|
|
@ -1447,6 +1447,6 @@
|
||||||
Events.pub('rl.bootstart-end');
|
Events.pub('rl.bootstart-end');
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = new AppApp();
|
module.exports = new AppUser();
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
Events = require('Common/Events'),
|
Events = require('Common/Events'),
|
||||||
|
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
|
|
||||||
AbstractModel = require('Knoin/AbstractModel')
|
AbstractModel = require('Knoin/AbstractModel')
|
||||||
;
|
;
|
||||||
|
|
|
||||||
|
|
@ -361,7 +361,7 @@
|
||||||
MessageModel.prototype.computeSenderEmail = function ()
|
MessageModel.prototype.computeSenderEmail = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
sSent = Data.sentFolder(),
|
sSent = Data.sentFolder(),
|
||||||
sDraft = Data.draftFolder()
|
sDraft = Data.draftFolder()
|
||||||
;
|
;
|
||||||
|
|
@ -440,7 +440,7 @@
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
bResult = false,
|
bResult = false,
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
iPriority = Enums.MessagePriority.Normal
|
iPriority = Enums.MessagePriority.Normal
|
||||||
;
|
;
|
||||||
|
|
||||||
|
|
@ -1096,7 +1096,7 @@
|
||||||
|
|
||||||
this.body.data('rl-plain-raw', this.plainRaw);
|
this.body.data('rl-plain-raw', this.plainRaw);
|
||||||
|
|
||||||
var Data = require('Storage/App/Data');
|
var Data = require('Storage/User/Data');
|
||||||
if (Data.capaOpenPGP())
|
if (Data.capaOpenPGP())
|
||||||
{
|
{
|
||||||
this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned());
|
this.body.data('rl-plain-pgp-signed', !!this.isPgpSigned());
|
||||||
|
|
@ -1109,7 +1109,7 @@
|
||||||
|
|
||||||
MessageModel.prototype.storePgpVerifyDataToDom = function ()
|
MessageModel.prototype.storePgpVerifyDataToDom = function ()
|
||||||
{
|
{
|
||||||
var Data = require('Storage/App/Data');
|
var Data = require('Storage/User/Data');
|
||||||
if (this.body && Data.capaOpenPGP())
|
if (this.body && Data.capaOpenPGP())
|
||||||
{
|
{
|
||||||
this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
|
this.body.data('rl-pgp-verify-status', this.pgpSignedVerifyStatus());
|
||||||
|
|
@ -1126,7 +1126,7 @@
|
||||||
|
|
||||||
this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
|
this.plainRaw = Utils.pString(this.body.data('rl-plain-raw'));
|
||||||
|
|
||||||
var Data = require('Storage/App/Data');
|
var Data = require('Storage/User/Data');
|
||||||
if (Data.capaOpenPGP())
|
if (Data.capaOpenPGP())
|
||||||
{
|
{
|
||||||
this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
|
this.isPgpSigned(!!this.body.data('rl-plain-pgp-signed'));
|
||||||
|
|
@ -1151,7 +1151,7 @@
|
||||||
var
|
var
|
||||||
aRes = [],
|
aRes = [],
|
||||||
mPgpMessage = null,
|
mPgpMessage = null,
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
|
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
|
||||||
aPublicKeys = Data.findPublicKeysByEmail(sFrom),
|
aPublicKeys = Data.findPublicKeysByEmail(sFrom),
|
||||||
oValidKey = null,
|
oValidKey = null,
|
||||||
|
|
@ -1215,7 +1215,7 @@
|
||||||
aRes = [],
|
aRes = [],
|
||||||
mPgpMessage = null,
|
mPgpMessage = null,
|
||||||
mPgpMessageDecrypted = null,
|
mPgpMessageDecrypted = null,
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
|
sFrom = this.from && this.from[0] && this.from[0].email ? this.from[0].email : '',
|
||||||
aPublicKey = Data.findPublicKeysByEmail(sFrom),
|
aPublicKey = Data.findPublicKeysByEmail(sFrom),
|
||||||
oPrivateKey = Data.findSelfPrivateKey(sPassword),
|
oPrivateKey = Data.findSelfPrivateKey(sPassword),
|
||||||
|
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
|
|
||||||
(function () {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var
|
|
||||||
_ = require('_'),
|
|
||||||
|
|
||||||
AbstractScreen = require('Knoin/AbstractScreen')
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
* @extends AbstractScreen
|
|
||||||
*/
|
|
||||||
function AboutAppScreen()
|
|
||||||
{
|
|
||||||
AbstractScreen.call(this, 'about', [
|
|
||||||
require('View/App/About')
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
_.extend(AboutAppScreen.prototype, AbstractScreen.prototype);
|
|
||||||
|
|
||||||
AboutAppScreen.prototype.onShow = function ()
|
|
||||||
{
|
|
||||||
require('App/App').setTitle('RainLoop');
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = AboutAppScreen;
|
|
||||||
|
|
||||||
}());
|
|
||||||
|
|
@ -1,32 +0,0 @@
|
||||||
|
|
||||||
(function () {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var
|
|
||||||
_ = require('_'),
|
|
||||||
|
|
||||||
AbstractScreen = require('Knoin/AbstractScreen')
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
* @extends AbstractScreen
|
|
||||||
*/
|
|
||||||
function LoginAppScreen()
|
|
||||||
{
|
|
||||||
AbstractScreen.call(this, 'login', [
|
|
||||||
require('View/App/Login')
|
|
||||||
]);
|
|
||||||
}
|
|
||||||
|
|
||||||
_.extend(LoginAppScreen.prototype, AbstractScreen.prototype);
|
|
||||||
|
|
||||||
LoginAppScreen.prototype.onShow = function ()
|
|
||||||
{
|
|
||||||
require('App/App').setTitle('');
|
|
||||||
};
|
|
||||||
|
|
||||||
module.exports = LoginAppScreen;
|
|
||||||
|
|
||||||
}());
|
|
||||||
32
dev/Screen/User/About.js
Normal file
32
dev/Screen/User/About.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var
|
||||||
|
_ = require('_'),
|
||||||
|
|
||||||
|
AbstractScreen = require('Knoin/AbstractScreen')
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @extends AbstractScreen
|
||||||
|
*/
|
||||||
|
function AboutUserScreen()
|
||||||
|
{
|
||||||
|
AbstractScreen.call(this, 'about', [
|
||||||
|
require('View/User/About')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
_.extend(AboutUserScreen.prototype, AbstractScreen.prototype);
|
||||||
|
|
||||||
|
AboutUserScreen.prototype.onShow = function ()
|
||||||
|
{
|
||||||
|
require('App/User').setTitle('RainLoop');
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = AboutUserScreen;
|
||||||
|
|
||||||
|
}());
|
||||||
32
dev/Screen/User/Login.js
Normal file
32
dev/Screen/User/Login.js
Normal file
|
|
@ -0,0 +1,32 @@
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var
|
||||||
|
_ = require('_'),
|
||||||
|
|
||||||
|
AbstractScreen = require('Knoin/AbstractScreen')
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @extends AbstractScreen
|
||||||
|
*/
|
||||||
|
function LoginUserScreen()
|
||||||
|
{
|
||||||
|
AbstractScreen.call(this, 'login', [
|
||||||
|
require('View/User/Login')
|
||||||
|
]);
|
||||||
|
}
|
||||||
|
|
||||||
|
_.extend(LoginUserScreen.prototype, AbstractScreen.prototype);
|
||||||
|
|
||||||
|
LoginUserScreen.prototype.onShow = function ()
|
||||||
|
{
|
||||||
|
require('App/User').setTitle('');
|
||||||
|
};
|
||||||
|
|
||||||
|
module.exports = LoginUserScreen;
|
||||||
|
|
||||||
|
}());
|
||||||
|
|
@ -12,9 +12,9 @@
|
||||||
Events = require('Common/Events'),
|
Events = require('Common/Events'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
AbstractScreen = require('Knoin/AbstractScreen')
|
AbstractScreen = require('Knoin/AbstractScreen')
|
||||||
;
|
;
|
||||||
|
|
@ -23,37 +23,37 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractScreen
|
* @extends AbstractScreen
|
||||||
*/
|
*/
|
||||||
function MailBoxAppScreen()
|
function MailBoxUserScreen()
|
||||||
{
|
{
|
||||||
AbstractScreen.call(this, 'mailbox', [
|
AbstractScreen.call(this, 'mailbox', [
|
||||||
require('View/App/MailBox/SystemDropDown'),
|
require('View/User/MailBox/SystemDropDown'),
|
||||||
require('View/App/MailBox/FolderList'),
|
require('View/User/MailBox/FolderList'),
|
||||||
require('View/App/MailBox/MessageList'),
|
require('View/User/MailBox/MessageList'),
|
||||||
require('View/App/MailBox/MessageView')
|
require('View/User/MailBox/MessageView')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
this.oLastRoute = {};
|
this.oLastRoute = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(MailBoxAppScreen.prototype, AbstractScreen.prototype);
|
_.extend(MailBoxUserScreen.prototype, AbstractScreen.prototype);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
MailBoxAppScreen.prototype.oLastRoute = {};
|
MailBoxUserScreen.prototype.oLastRoute = {};
|
||||||
|
|
||||||
MailBoxAppScreen.prototype.setNewTitle = function ()
|
MailBoxUserScreen.prototype.setNewTitle = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
sEmail = Data.accountEmail(),
|
sEmail = Data.accountEmail(),
|
||||||
nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount()
|
nFoldersInboxUnreadCount = Data.foldersInboxUnreadCount()
|
||||||
;
|
;
|
||||||
|
|
||||||
require('App/App').setTitle(('' === sEmail ? '' :
|
require('App/User').setTitle(('' === sEmail ? '' :
|
||||||
(0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') + sEmail + ' - ') + Utils.i18n('TITLES/MAILBOX'));
|
(0 < nFoldersInboxUnreadCount ? '(' + nFoldersInboxUnreadCount + ') ' : ' ') + sEmail + ' - ') + Utils.i18n('TITLES/MAILBOX'));
|
||||||
};
|
};
|
||||||
|
|
||||||
MailBoxAppScreen.prototype.onShow = function ()
|
MailBoxUserScreen.prototype.onShow = function ()
|
||||||
{
|
{
|
||||||
this.setNewTitle();
|
this.setNewTitle();
|
||||||
Globals.keyScope(Enums.KeyState.MessageList);
|
Globals.keyScope(Enums.KeyState.MessageList);
|
||||||
|
|
@ -65,13 +65,13 @@
|
||||||
* @param {string} sSearch
|
* @param {string} sSearch
|
||||||
* @param {boolean=} bPreview = false
|
* @param {boolean=} bPreview = false
|
||||||
*/
|
*/
|
||||||
MailBoxAppScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview)
|
MailBoxUserScreen.prototype.onRoute = function (sFolderHash, iPage, sSearch, bPreview)
|
||||||
{
|
{
|
||||||
if (Utils.isUnd(bPreview) ? false : !!bPreview)
|
if (Utils.isUnd(bPreview) ? false : !!bPreview)
|
||||||
{
|
{
|
||||||
if (Enums.Layout.NoPreview === Data.layout() && !Data.message())
|
if (Enums.Layout.NoPreview === Data.layout() && !Data.message())
|
||||||
{
|
{
|
||||||
require('App/App').historyBack();
|
require('App/User').historyBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
@ -94,12 +94,12 @@
|
||||||
Data.message(null);
|
Data.message(null);
|
||||||
}
|
}
|
||||||
|
|
||||||
require('App/App').reloadMessageList();
|
require('App/User').reloadMessageList();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MailBoxAppScreen.prototype.onStart = function ()
|
MailBoxUserScreen.prototype.onStart = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
sInboxFolderName = Cache.getFolderInboxName(),
|
sInboxFolderName = Cache.getFolderInboxName(),
|
||||||
|
|
@ -110,18 +110,18 @@
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.AdditionalIdentities))
|
if (Settings.capa(Enums.Capa.AdditionalAccounts) || Settings.capa(Enums.Capa.AdditionalIdentities))
|
||||||
{
|
{
|
||||||
require('App/App').accountsAndIdentities();
|
require('App/User').accountsAndIdentities();
|
||||||
}
|
}
|
||||||
|
|
||||||
_.delay(function () {
|
_.delay(function () {
|
||||||
if (sInboxFolderName !== Data.currentFolderFullNameRaw())
|
if (sInboxFolderName !== Data.currentFolderFullNameRaw())
|
||||||
{
|
{
|
||||||
require('App/App').folderInformation(sInboxFolderName);
|
require('App/User').folderInformation(sInboxFolderName);
|
||||||
}
|
}
|
||||||
}, 1000);
|
}, 1000);
|
||||||
|
|
||||||
_.delay(function () {
|
_.delay(function () {
|
||||||
require('App/App').quota();
|
require('App/User').quota();
|
||||||
}, 5000);
|
}, 5000);
|
||||||
|
|
||||||
_.delay(function () {
|
_.delay(function () {
|
||||||
|
|
@ -150,7 +150,7 @@
|
||||||
/**
|
/**
|
||||||
* @return {Array}
|
* @return {Array}
|
||||||
*/
|
*/
|
||||||
MailBoxAppScreen.prototype.routes = function ()
|
MailBoxUserScreen.prototype.routes = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
sInboxFolderName = Cache.getFolderInboxName(),
|
sInboxFolderName = Cache.getFolderInboxName(),
|
||||||
|
|
@ -193,6 +193,6 @@
|
||||||
];
|
];
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = MailBoxAppScreen;
|
module.exports = MailBoxUserScreen;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -21,12 +21,12 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractSettingsScreen
|
* @extends AbstractSettingsScreen
|
||||||
*/
|
*/
|
||||||
function SettingsAppScreen()
|
function SettingsUserScreen()
|
||||||
{
|
{
|
||||||
AbstractSettingsScreen.call(this, [
|
AbstractSettingsScreen.call(this, [
|
||||||
require('View/App/Settings/SystemDropDown'),
|
require('View/User/Settings/SystemDropDown'),
|
||||||
require('View/App/Settings/Menu'),
|
require('View/User/Settings/Menu'),
|
||||||
require('View/App/Settings/Pane')
|
require('View/User/Settings/Pane')
|
||||||
]);
|
]);
|
||||||
|
|
||||||
Utils.initOnStartOrLangChange(function () {
|
Utils.initOnStartOrLangChange(function () {
|
||||||
|
|
@ -36,48 +36,48 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(SettingsAppScreen.prototype, AbstractSettingsScreen.prototype);
|
_.extend(SettingsUserScreen.prototype, AbstractSettingsScreen.prototype);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {Function=} fCallback
|
* @param {Function=} fCallback
|
||||||
*/
|
*/
|
||||||
SettingsAppScreen.prototype.setupSettings = function (fCallback)
|
SettingsUserScreen.prototype.setupSettings = function (fCallback)
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/General'),
|
kn.addSettingsViewModel(require('Settings/User/General'),
|
||||||
'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
'SettingsGeneral', 'SETTINGS_LABELS/LABEL_GENERAL_NAME', 'general', true);
|
||||||
|
|
||||||
if (Settings.settingsGet('ContactsIsAllowed'))
|
if (Settings.settingsGet('ContactsIsAllowed'))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/Contacts'),
|
kn.addSettingsViewModel(require('Settings/User/Contacts'),
|
||||||
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
'SettingsContacts', 'SETTINGS_LABELS/LABEL_CONTACTS_NAME', 'contacts');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.AdditionalAccounts))
|
if (Settings.capa(Enums.Capa.AdditionalAccounts))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/Accounts'),
|
kn.addSettingsViewModel(require('Settings/User/Accounts'),
|
||||||
'SettingsAccounts', 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME', 'accounts');
|
'SettingsAccounts', 'SETTINGS_LABELS/LABEL_ACCOUNTS_NAME', 'accounts');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.AdditionalIdentities))
|
if (Settings.capa(Enums.Capa.AdditionalIdentities))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/Identities'),
|
kn.addSettingsViewModel(require('Settings/User/Identities'),
|
||||||
'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
|
'SettingsIdentities', 'SETTINGS_LABELS/LABEL_IDENTITIES_NAME', 'identities');
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/Identity'),
|
kn.addSettingsViewModel(require('Settings/User/Identity'),
|
||||||
'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
|
'SettingsIdentity', 'SETTINGS_LABELS/LABEL_IDENTITY_NAME', 'identity');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.Filters))
|
if (Settings.capa(Enums.Capa.Filters))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/Filters'),
|
kn.addSettingsViewModel(require('Settings/User/Filters'),
|
||||||
'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
|
'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.TwoFactor))
|
if (Settings.capa(Enums.Capa.TwoFactor))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/Security'),
|
kn.addSettingsViewModel(require('Settings/User/Security'),
|
||||||
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
'SettingsSecurity', 'SETTINGS_LABELS/LABEL_SECURITY_NAME', 'security');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -85,28 +85,28 @@
|
||||||
Settings.settingsGet('AllowFacebookSocial') ||
|
Settings.settingsGet('AllowFacebookSocial') ||
|
||||||
Settings.settingsGet('AllowTwitterSocial'))
|
Settings.settingsGet('AllowTwitterSocial'))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/Social'),
|
kn.addSettingsViewModel(require('Settings/User/Social'),
|
||||||
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.settingsGet('ChangePasswordIsAllowed'))
|
if (Settings.settingsGet('ChangePasswordIsAllowed'))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/ChangePassword'),
|
kn.addSettingsViewModel(require('Settings/User/ChangePassword'),
|
||||||
'SettingsChangePassword', 'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME', 'change-password');
|
'SettingsChangePassword', 'SETTINGS_LABELS/LABEL_CHANGE_PASSWORD_NAME', 'change-password');
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.addSettingsViewModel(require('Settings/App/Folders'),
|
kn.addSettingsViewModel(require('Settings/User/Folders'),
|
||||||
'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
|
'SettingsFolders', 'SETTINGS_LABELS/LABEL_FOLDERS_NAME', 'folders');
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.Themes))
|
if (Settings.capa(Enums.Capa.Themes))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/Themes'),
|
kn.addSettingsViewModel(require('Settings/User/Themes'),
|
||||||
'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
'SettingsThemes', 'SETTINGS_LABELS/LABEL_THEMES_NAME', 'themes');
|
||||||
}
|
}
|
||||||
|
|
||||||
if (Settings.capa(Enums.Capa.OpenPGP))
|
if (Settings.capa(Enums.Capa.OpenPGP))
|
||||||
{
|
{
|
||||||
kn.addSettingsViewModel(require('Settings/App/OpenPGP'),
|
kn.addSettingsViewModel(require('Settings/User/OpenPgp'),
|
||||||
'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
|
'SettingsOpenPGP', 'SETTINGS_LABELS/LABEL_OPEN_PGP_NAME', 'openpgp');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -116,17 +116,17 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SettingsAppScreen.prototype.onShow = function ()
|
SettingsUserScreen.prototype.onShow = function ()
|
||||||
{
|
{
|
||||||
this.setSettingsTitle();
|
this.setSettingsTitle();
|
||||||
Globals.keyScope(Enums.KeyState.Settings);
|
Globals.keyScope(Enums.KeyState.Settings);
|
||||||
};
|
};
|
||||||
|
|
||||||
SettingsAppScreen.prototype.setSettingsTitle = function ()
|
SettingsUserScreen.prototype.setSettingsTitle = function ()
|
||||||
{
|
{
|
||||||
require('App/App').setTitle(this.sSettingsTitle);
|
require('App/User').setTitle(this.sSettingsTitle);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = SettingsAppScreen;
|
module.exports = SettingsUserScreen;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -12,14 +12,14 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote')
|
Remote = require('Storage/User/Remote')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function AccountsAppSetting()
|
function AccountsUserSetting()
|
||||||
{
|
{
|
||||||
this.accounts = Data.accounts;
|
this.accounts = Data.accounts;
|
||||||
|
|
||||||
|
|
@ -46,7 +46,7 @@
|
||||||
]});
|
]});
|
||||||
}
|
}
|
||||||
|
|
||||||
AccountsAppSetting.prototype.addNewAccount = function ()
|
AccountsUserSetting.prototype.addNewAccount = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
|
||||||
};
|
};
|
||||||
|
|
@ -54,7 +54,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {AccountModel} oAccountToRemove
|
* @param {AccountModel} oAccountToRemove
|
||||||
*/
|
*/
|
||||||
AccountsAppSetting.prototype.deleteAccount = function (oAccountToRemove)
|
AccountsUserSetting.prototype.deleteAccount = function (oAccountToRemove)
|
||||||
{
|
{
|
||||||
if (oAccountToRemove && oAccountToRemove.deleteAccess())
|
if (oAccountToRemove && oAccountToRemove.deleteAccess())
|
||||||
{
|
{
|
||||||
|
|
@ -86,7 +86,7 @@
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
require('App/App').accountsAndIdentities();
|
require('App/User').accountsAndIdentities();
|
||||||
}
|
}
|
||||||
|
|
||||||
}, oAccountToRemove.email);
|
}, oAccountToRemove.email);
|
||||||
|
|
@ -94,6 +94,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = AccountsAppSetting;
|
module.exports = AccountsUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -10,13 +10,13 @@
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Remote = require('Storage/App/Remote')
|
Remote = require('Storage/User/Remote')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function ChangePasswordAppSetting()
|
function ChangePasswordUserSetting()
|
||||||
{
|
{
|
||||||
this.changeProcess = ko.observable(false);
|
this.changeProcess = ko.observable(false);
|
||||||
|
|
||||||
|
|
@ -76,7 +76,7 @@
|
||||||
this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this);
|
this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ChangePasswordAppSetting.prototype.onHide = function ()
|
ChangePasswordUserSetting.prototype.onHide = function ()
|
||||||
{
|
{
|
||||||
this.changeProcess(false);
|
this.changeProcess(false);
|
||||||
this.currentPassword('');
|
this.currentPassword('');
|
||||||
|
|
@ -87,7 +87,7 @@
|
||||||
this.currentPassword.error(false);
|
this.currentPassword.error(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
ChangePasswordAppSetting.prototype.onChangePasswordResponse = function (sResult, oData)
|
ChangePasswordUserSetting.prototype.onChangePasswordResponse = function (sResult, oData)
|
||||||
{
|
{
|
||||||
this.changeProcess(false);
|
this.changeProcess(false);
|
||||||
this.passwordMismatch(false);
|
this.passwordMismatch(false);
|
||||||
|
|
@ -116,6 +116,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ChangePasswordAppSetting;
|
module.exports = ChangePasswordUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -6,14 +6,14 @@
|
||||||
var
|
var
|
||||||
ko = require('ko'),
|
ko = require('ko'),
|
||||||
|
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
Data = require('Storage/App/Data')
|
Data = require('Storage/User/Data')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function ContactsAppSetting()
|
function ContactsUserSetting()
|
||||||
{
|
{
|
||||||
this.contactsAutosave = Data.contactsAutosave;
|
this.contactsAutosave = Data.contactsAutosave;
|
||||||
|
|
||||||
|
|
@ -42,7 +42,7 @@
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ContactsAppSetting.prototype.onBuild = function ()
|
ContactsUserSetting.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
Data.contactsAutosave.subscribe(function (bValue) {
|
Data.contactsAutosave.subscribe(function (bValue) {
|
||||||
Remote.saveSettings(null, {
|
Remote.saveSettings(null, {
|
||||||
|
|
@ -51,6 +51,6 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ContactsAppSetting;
|
module.exports = ContactsUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function FiltersAppSetting()
|
function FiltersUserSetting()
|
||||||
{
|
{
|
||||||
this.filters = ko.observableArray([]);
|
this.filters = ko.observableArray([]);
|
||||||
this.filters.loading = ko.observable(false);
|
this.filters.loading = ko.observable(false);
|
||||||
|
|
@ -22,13 +22,13 @@
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
FiltersAppSetting.prototype.deleteFilter = function (oFilter)
|
FiltersUserSetting.prototype.deleteFilter = function (oFilter)
|
||||||
{
|
{
|
||||||
this.filters.remove(oFilter);
|
this.filters.remove(oFilter);
|
||||||
Utils.delegateRunOnDestroy(oFilter);
|
Utils.delegateRunOnDestroy(oFilter);
|
||||||
};
|
};
|
||||||
|
|
||||||
FiltersAppSetting.prototype.addFilter = function ()
|
FiltersUserSetting.prototype.addFilter = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
FilterModel = require('Model/Filter')
|
FilterModel = require('Model/Filter')
|
||||||
|
|
@ -38,6 +38,6 @@
|
||||||
require('View/Popup/Filter'), [new FilterModel()]);
|
require('View/Popup/Filter'), [new FilterModel()]);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = FiltersAppSetting;
|
module.exports = FiltersUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -10,16 +10,16 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
Local = require('Storage/Local')
|
Local = require('Storage/Local')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function FoldersAppSetting()
|
function FoldersUserSetting()
|
||||||
{
|
{
|
||||||
this.foldersListError = Data.foldersListError;
|
this.foldersListError = Data.foldersListError;
|
||||||
this.folderList = Data.folderList;
|
this.folderList = Data.folderList;
|
||||||
|
|
@ -89,7 +89,7 @@
|
||||||
this.useImapSubscribe = !!Settings.settingsGet('UseImapSubscribe');
|
this.useImapSubscribe = !!Settings.settingsGet('UseImapSubscribe');
|
||||||
}
|
}
|
||||||
|
|
||||||
FoldersAppSetting.prototype.folderEditOnEnter = function (oFolder)
|
FoldersUserSetting.prototype.folderEditOnEnter = function (oFolder)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : ''
|
sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : ''
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER'));
|
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER'));
|
||||||
}
|
}
|
||||||
|
|
||||||
require('App/App').folders();
|
require('App/User').folders();
|
||||||
|
|
||||||
}, oFolder.fullNameRaw, sEditName);
|
}, oFolder.fullNameRaw, sEditName);
|
||||||
|
|
||||||
|
|
@ -121,7 +121,7 @@
|
||||||
oFolder.edited(false);
|
oFolder.edited(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
FoldersAppSetting.prototype.folderEditOnEsc = function (oFolder)
|
FoldersUserSetting.prototype.folderEditOnEsc = function (oFolder)
|
||||||
{
|
{
|
||||||
if (oFolder)
|
if (oFolder)
|
||||||
{
|
{
|
||||||
|
|
@ -129,22 +129,22 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FoldersAppSetting.prototype.onShow = function ()
|
FoldersUserSetting.prototype.onShow = function ()
|
||||||
{
|
{
|
||||||
Data.foldersListError('');
|
Data.foldersListError('');
|
||||||
};
|
};
|
||||||
|
|
||||||
FoldersAppSetting.prototype.createFolder = function ()
|
FoldersUserSetting.prototype.createFolder = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderCreate'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderCreate'));
|
||||||
};
|
};
|
||||||
|
|
||||||
FoldersAppSetting.prototype.systemFolder = function ()
|
FoldersUserSetting.prototype.systemFolder = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderSystem'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderSystem'));
|
||||||
};
|
};
|
||||||
|
|
||||||
FoldersAppSetting.prototype.deleteFolder = function (oFolderToRemove)
|
FoldersUserSetting.prototype.deleteFolder = function (oFolderToRemove)
|
||||||
{
|
{
|
||||||
if (oFolderToRemove && oFolderToRemove.canBeDeleted() && oFolderToRemove.deleteAccess() &&
|
if (oFolderToRemove && oFolderToRemove.canBeDeleted() && oFolderToRemove.deleteAccess() &&
|
||||||
0 === oFolderToRemove.privateMessageCountAll())
|
0 === oFolderToRemove.privateMessageCountAll())
|
||||||
|
|
@ -180,7 +180,7 @@
|
||||||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER'));
|
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER'));
|
||||||
}
|
}
|
||||||
|
|
||||||
require('App/App').folders();
|
require('App/User').folders();
|
||||||
|
|
||||||
}, oFolderToRemove.fullNameRaw);
|
}, oFolderToRemove.fullNameRaw);
|
||||||
|
|
||||||
|
|
@ -193,7 +193,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FoldersAppSetting.prototype.subscribeFolder = function (oFolder)
|
FoldersUserSetting.prototype.subscribeFolder = function (oFolder)
|
||||||
{
|
{
|
||||||
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||||
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, true);
|
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, true);
|
||||||
|
|
@ -201,7 +201,7 @@
|
||||||
oFolder.subScribed(true);
|
oFolder.subScribed(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
FoldersAppSetting.prototype.unSubscribeFolder = function (oFolder)
|
FoldersUserSetting.prototype.unSubscribeFolder = function (oFolder)
|
||||||
{
|
{
|
||||||
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
|
||||||
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, false);
|
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, false);
|
||||||
|
|
@ -209,6 +209,6 @@
|
||||||
oFolder.subScribed(false);
|
oFolder.subScribed(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = FoldersAppSetting;
|
module.exports = FoldersUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -12,14 +12,14 @@
|
||||||
Globals = require('Common/Globals'),
|
Globals = require('Common/Globals'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote')
|
Remote = require('Storage/User/Remote')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function GeneralAppSetting()
|
function GeneralUserSetting()
|
||||||
{
|
{
|
||||||
this.mainLanguage = Data.mainLanguage;
|
this.mainLanguage = Data.mainLanguage;
|
||||||
this.mainMessagesPerPage = Data.mainMessagesPerPage;
|
this.mainMessagesPerPage = Data.mainMessagesPerPage;
|
||||||
|
|
@ -55,12 +55,12 @@
|
||||||
this.isAnimationSupported = Globals.bAnimationSupported;
|
this.isAnimationSupported = Globals.bAnimationSupported;
|
||||||
}
|
}
|
||||||
|
|
||||||
GeneralAppSetting.prototype.toggleLayout = function ()
|
GeneralUserSetting.prototype.toggleLayout = function ()
|
||||||
{
|
{
|
||||||
this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview);
|
this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview);
|
||||||
};
|
};
|
||||||
|
|
||||||
GeneralAppSetting.prototype.onBuild = function ()
|
GeneralUserSetting.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
@ -158,16 +158,16 @@
|
||||||
}, 50);
|
}, 50);
|
||||||
};
|
};
|
||||||
|
|
||||||
GeneralAppSetting.prototype.onShow = function ()
|
GeneralUserSetting.prototype.onShow = function ()
|
||||||
{
|
{
|
||||||
Data.desktopNotifications.valueHasMutated();
|
Data.desktopNotifications.valueHasMutated();
|
||||||
};
|
};
|
||||||
|
|
||||||
GeneralAppSetting.prototype.selectLanguage = function ()
|
GeneralUserSetting.prototype.selectLanguage = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Languages'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Languages'));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = GeneralAppSetting;
|
module.exports = GeneralUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -11,14 +11,14 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
HtmlEditor = require('Common/HtmlEditor'),
|
HtmlEditor = require('Common/HtmlEditor'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote')
|
Remote = require('Storage/User/Remote')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function IdentitiesAppSetting()
|
function IdentitiesUserSetting()
|
||||||
{
|
{
|
||||||
this.editor = null;
|
this.editor = null;
|
||||||
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
|
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
|
||||||
|
|
@ -100,7 +100,7 @@
|
||||||
*
|
*
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
IdentitiesAppSetting.prototype.formattedAccountIdentity = function ()
|
IdentitiesUserSetting.prototype.formattedAccountIdentity = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
sDisplayName = this.displayName.peek(),
|
sDisplayName = this.displayName.peek(),
|
||||||
|
|
@ -110,12 +110,12 @@
|
||||||
return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>';
|
return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>';
|
||||||
};
|
};
|
||||||
|
|
||||||
IdentitiesAppSetting.prototype.addNewIdentity = function ()
|
IdentitiesUserSetting.prototype.addNewIdentity = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'));
|
||||||
};
|
};
|
||||||
|
|
||||||
IdentitiesAppSetting.prototype.editIdentity = function (oIdentity)
|
IdentitiesUserSetting.prototype.editIdentity = function (oIdentity)
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]);
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]);
|
||||||
};
|
};
|
||||||
|
|
@ -123,7 +123,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {IdentityModel} oIdentityToRemove
|
* @param {IdentityModel} oIdentityToRemove
|
||||||
*/
|
*/
|
||||||
IdentitiesAppSetting.prototype.deleteIdentity = function (oIdentityToRemove)
|
IdentitiesUserSetting.prototype.deleteIdentity = function (oIdentityToRemove)
|
||||||
{
|
{
|
||||||
if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
|
if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
|
||||||
{
|
{
|
||||||
|
|
@ -140,13 +140,13 @@
|
||||||
this.identities.remove(fRemoveFolder);
|
this.identities.remove(fRemoveFolder);
|
||||||
|
|
||||||
Remote.identityDelete(function () {
|
Remote.identityDelete(function () {
|
||||||
require('App/App').accountsAndIdentities();
|
require('App/User').accountsAndIdentities();
|
||||||
}, oIdentityToRemove.id);
|
}, oIdentityToRemove.id);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IdentitiesAppSetting.prototype.onFocus = function ()
|
IdentitiesUserSetting.prototype.onFocus = function ()
|
||||||
{
|
{
|
||||||
if (!this.editor && this.signatureDom())
|
if (!this.editor && this.signatureDom())
|
||||||
{
|
{
|
||||||
|
|
@ -172,7 +172,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IdentitiesAppSetting.prototype.onBuild = function (oDom)
|
IdentitiesUserSetting.prototype.onBuild = function (oDom)
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
@ -228,6 +228,6 @@
|
||||||
}, 50);
|
}, 50);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = IdentitiesAppSetting;
|
module.exports = IdentitiesUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -11,14 +11,14 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
HtmlEditor = require('Common/HtmlEditor'),
|
HtmlEditor = require('Common/HtmlEditor'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote')
|
Remote = require('Storage/User/Remote')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function IdentityAppSetting()
|
function IdentityUserSetting()
|
||||||
{
|
{
|
||||||
this.editor = null;
|
this.editor = null;
|
||||||
|
|
||||||
|
|
@ -34,7 +34,7 @@
|
||||||
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
|
||||||
}
|
}
|
||||||
|
|
||||||
IdentityAppSetting.prototype.onFocus = function ()
|
IdentityUserSetting.prototype.onFocus = function ()
|
||||||
{
|
{
|
||||||
if (!this.editor && this.signatureDom())
|
if (!this.editor && this.signatureDom())
|
||||||
{
|
{
|
||||||
|
|
@ -60,7 +60,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
IdentityAppSetting.prototype.onBuild = function ()
|
IdentityUserSetting.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
_.delay(function () {
|
_.delay(function () {
|
||||||
|
|
@ -98,6 +98,6 @@
|
||||||
}, 50);
|
}, 50);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = IdentityAppSetting;
|
module.exports = IdentityUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -11,13 +11,13 @@
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data')
|
Data = require('Storage/User/Data')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function OpenPGPAppSetting()
|
function OpenPgpUserSetting()
|
||||||
{
|
{
|
||||||
this.openpgpkeys = Data.openpgpkeys;
|
this.openpgpkeys = Data.openpgpkeys;
|
||||||
this.openpgpkeysPublic = Data.openpgpkeysPublic;
|
this.openpgpkeysPublic = Data.openpgpkeysPublic;
|
||||||
|
|
@ -38,17 +38,17 @@
|
||||||
]});
|
]});
|
||||||
}
|
}
|
||||||
|
|
||||||
OpenPGPAppSetting.prototype.addOpenPgpKey = function ()
|
OpenPgpUserSetting.prototype.addOpenPgpKey = function ()
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/AddOpenPgpKey'));
|
kn.showScreenPopup(require('View/Popup/AddOpenPgpKey'));
|
||||||
};
|
};
|
||||||
|
|
||||||
OpenPGPAppSetting.prototype.generateOpenPgpKey = function ()
|
OpenPgpUserSetting.prototype.generateOpenPgpKey = function ()
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/NewOpenPgpKey'));
|
kn.showScreenPopup(require('View/Popup/NewOpenPgpKey'));
|
||||||
};
|
};
|
||||||
|
|
||||||
OpenPGPAppSetting.prototype.viewOpenPgpKey = function (oOpenPgpKey)
|
OpenPgpUserSetting.prototype.viewOpenPgpKey = function (oOpenPgpKey)
|
||||||
{
|
{
|
||||||
if (oOpenPgpKey)
|
if (oOpenPgpKey)
|
||||||
{
|
{
|
||||||
|
|
@ -59,7 +59,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {OpenPgpKeyModel} oOpenPgpKeyToRemove
|
* @param {OpenPgpKeyModel} oOpenPgpKeyToRemove
|
||||||
*/
|
*/
|
||||||
OpenPGPAppSetting.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
|
OpenPgpUserSetting.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
|
||||||
{
|
{
|
||||||
if (oOpenPgpKeyToRemove && oOpenPgpKeyToRemove.deleteAccess())
|
if (oOpenPgpKeyToRemove && oOpenPgpKeyToRemove.deleteAccess())
|
||||||
{
|
{
|
||||||
|
|
@ -82,11 +82,11 @@
|
||||||
Data.openpgpKeyring.store();
|
Data.openpgpKeyring.store();
|
||||||
}
|
}
|
||||||
|
|
||||||
require('App/App').reloadOpenPgpKeys();
|
require('App/User').reloadOpenPgpKeys();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = OpenPGPAppSetting;
|
module.exports = OpenPgpUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -10,13 +10,13 @@
|
||||||
Globals = require('Common/Globals'),
|
Globals = require('Common/Globals'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Remote = require('Storage/App/Remote')
|
Remote = require('Storage/User/Remote')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function SecurityAppSetting()
|
function SecurityUserSetting()
|
||||||
{
|
{
|
||||||
this.processing = ko.observable(false);
|
this.processing = ko.observable(false);
|
||||||
this.clearing = ko.observable(false);
|
this.clearing = ko.observable(false);
|
||||||
|
|
@ -46,37 +46,37 @@
|
||||||
this.onSecretResult = _.bind(this.onSecretResult, this);
|
this.onSecretResult = _.bind(this.onSecretResult, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
SecurityAppSetting.prototype.showSecret = function ()
|
SecurityUserSetting.prototype.showSecret = function ()
|
||||||
{
|
{
|
||||||
this.secreting(true);
|
this.secreting(true);
|
||||||
Remote.showTwoFactorSecret(this.onSecretResult);
|
Remote.showTwoFactorSecret(this.onSecretResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.hideSecret = function ()
|
SecurityUserSetting.prototype.hideSecret = function ()
|
||||||
{
|
{
|
||||||
this.viewSecret('');
|
this.viewSecret('');
|
||||||
this.viewBackupCodes('');
|
this.viewBackupCodes('');
|
||||||
this.viewUrl('');
|
this.viewUrl('');
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.createTwoFactor = function ()
|
SecurityUserSetting.prototype.createTwoFactor = function ()
|
||||||
{
|
{
|
||||||
this.processing(true);
|
this.processing(true);
|
||||||
Remote.createTwoFactor(this.onResult);
|
Remote.createTwoFactor(this.onResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.enableTwoFactor = function ()
|
SecurityUserSetting.prototype.enableTwoFactor = function ()
|
||||||
{
|
{
|
||||||
this.processing(true);
|
this.processing(true);
|
||||||
Remote.enableTwoFactor(this.onResult, this.viewEnable());
|
Remote.enableTwoFactor(this.onResult, this.viewEnable());
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.testTwoFactor = function ()
|
SecurityUserSetting.prototype.testTwoFactor = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/TwoFactorTest'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/TwoFactorTest'));
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.clearTwoFactor = function ()
|
SecurityUserSetting.prototype.clearTwoFactor = function ()
|
||||||
{
|
{
|
||||||
this.viewSecret('');
|
this.viewSecret('');
|
||||||
this.viewBackupCodes('');
|
this.viewBackupCodes('');
|
||||||
|
|
@ -86,14 +86,14 @@
|
||||||
Remote.clearTwoFactor(this.onResult);
|
Remote.clearTwoFactor(this.onResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.onShow = function ()
|
SecurityUserSetting.prototype.onShow = function ()
|
||||||
{
|
{
|
||||||
this.viewSecret('');
|
this.viewSecret('');
|
||||||
this.viewBackupCodes('');
|
this.viewBackupCodes('');
|
||||||
this.viewUrl('');
|
this.viewUrl('');
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.onResult = function (sResult, oData)
|
SecurityUserSetting.prototype.onResult = function (sResult, oData)
|
||||||
{
|
{
|
||||||
this.processing(false);
|
this.processing(false);
|
||||||
this.clearing(false);
|
this.clearing(false);
|
||||||
|
|
@ -139,7 +139,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.onSecretResult = function (sResult, oData)
|
SecurityUserSetting.prototype.onSecretResult = function (sResult, oData)
|
||||||
{
|
{
|
||||||
this.secreting(false);
|
this.secreting(false);
|
||||||
|
|
||||||
|
|
@ -155,12 +155,12 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
SecurityAppSetting.prototype.onBuild = function ()
|
SecurityUserSetting.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
this.processing(true);
|
this.processing(true);
|
||||||
Remote.getTwoFactor(this.onResult);
|
Remote.getTwoFactor(this.onResult);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = SecurityAppSetting;
|
module.exports = SecurityUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -6,11 +6,11 @@
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function SocialAppSetting()
|
function SocialUserSetting()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
Data = require('Storage/App/Data')
|
Data = require('Storage/User/Data')
|
||||||
;
|
;
|
||||||
|
|
||||||
this.googleEnable = Data.googleEnable;
|
this.googleEnable = Data.googleEnable;
|
||||||
|
|
@ -34,43 +34,43 @@
|
||||||
this.connectGoogle = Utils.createCommand(this, function () {
|
this.connectGoogle = Utils.createCommand(this, function () {
|
||||||
if (!this.googleLoggined())
|
if (!this.googleLoggined())
|
||||||
{
|
{
|
||||||
require('App/App').googleConnect();
|
require('App/User').googleConnect();
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function () {
|
||||||
return !this.googleLoggined() && !this.googleActions();
|
return !this.googleLoggined() && !this.googleActions();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.disconnectGoogle = Utils.createCommand(this, function () {
|
this.disconnectGoogle = Utils.createCommand(this, function () {
|
||||||
require('App/App').googleDisconnect();
|
require('App/User').googleDisconnect();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.connectFacebook = Utils.createCommand(this, function () {
|
this.connectFacebook = Utils.createCommand(this, function () {
|
||||||
if (!this.facebookLoggined())
|
if (!this.facebookLoggined())
|
||||||
{
|
{
|
||||||
require('App/App').facebookConnect();
|
require('App/User').facebookConnect();
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function () {
|
||||||
return !this.facebookLoggined() && !this.facebookActions();
|
return !this.facebookLoggined() && !this.facebookActions();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.disconnectFacebook = Utils.createCommand(this, function () {
|
this.disconnectFacebook = Utils.createCommand(this, function () {
|
||||||
require('App/App').facebookDisconnect();
|
require('App/User').facebookDisconnect();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.connectTwitter = Utils.createCommand(this, function () {
|
this.connectTwitter = Utils.createCommand(this, function () {
|
||||||
if (!this.twitterLoggined())
|
if (!this.twitterLoggined())
|
||||||
{
|
{
|
||||||
require('App/App').twitterConnect();
|
require('App/User').twitterConnect();
|
||||||
}
|
}
|
||||||
}, function () {
|
}, function () {
|
||||||
return !this.twitterLoggined() && !this.twitterActions();
|
return !this.twitterLoggined() && !this.twitterActions();
|
||||||
});
|
});
|
||||||
|
|
||||||
this.disconnectTwitter = Utils.createCommand(this, function () {
|
this.disconnectTwitter = Utils.createCommand(this, function () {
|
||||||
require('App/App').twitterDisconnect();
|
require('App/User').twitterDisconnect();
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
module.exports = SocialAppSetting;
|
module.exports = SocialUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -13,14 +13,14 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote')
|
Remote = require('Storage/User/Remote')
|
||||||
;
|
;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function ThemesAppSetting()
|
function ThemesUserSetting()
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
@ -114,7 +114,7 @@
|
||||||
}, this);
|
}, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
ThemesAppSetting.prototype.onBuild = function ()
|
ThemesUserSetting.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
var sCurrentTheme = Data.theme();
|
var sCurrentTheme = Data.theme();
|
||||||
this.themesObjects(_.map(Data.themes(), function (sTheme) {
|
this.themesObjects(_.map(Data.themes(), function (sTheme) {
|
||||||
|
|
@ -127,6 +127,6 @@
|
||||||
}));
|
}));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = ThemesAppSetting;
|
module.exports = ThemesUserSetting;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
/**
|
/**
|
||||||
* @constructor
|
* @constructor
|
||||||
*/
|
*/
|
||||||
function CacheAppStorage()
|
function CacheUserStorage()
|
||||||
{
|
{
|
||||||
this.oFoldersCache = {};
|
this.oFoldersCache = {};
|
||||||
this.oFoldersNamesCache = {};
|
this.oFoldersNamesCache = {};
|
||||||
|
|
@ -34,54 +34,54 @@
|
||||||
/**
|
/**
|
||||||
* @type {boolean}
|
* @type {boolean}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.bCapaGravatar = false;
|
CacheUserStorage.prototype.bCapaGravatar = false;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oFoldersCache = {};
|
CacheUserStorage.prototype.oFoldersCache = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oFoldersNamesCache = {};
|
CacheUserStorage.prototype.oFoldersNamesCache = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oFolderHashCache = {};
|
CacheUserStorage.prototype.oFolderHashCache = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oFolderUidNextCache = {};
|
CacheUserStorage.prototype.oFolderUidNextCache = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oMessageListHashCache = {};
|
CacheUserStorage.prototype.oMessageListHashCache = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oMessageFlagsCache = {};
|
CacheUserStorage.prototype.oMessageFlagsCache = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oBodies = {};
|
CacheUserStorage.prototype.oBodies = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oNewMessage = {};
|
CacheUserStorage.prototype.oNewMessage = {};
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {Object}
|
* @type {Object}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.oRequestedMessage = {};
|
CacheUserStorage.prototype.oRequestedMessage = {};
|
||||||
|
|
||||||
CacheAppStorage.prototype.clear = function ()
|
CacheUserStorage.prototype.clear = function ()
|
||||||
{
|
{
|
||||||
this.oFoldersCache = {};
|
this.oFoldersCache = {};
|
||||||
this.oFoldersNamesCache = {};
|
this.oFoldersNamesCache = {};
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
* @param {Function} fCallback
|
* @param {Function} fCallback
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.getUserPic = function (sEmail, fCallback)
|
CacheUserStorage.prototype.getUserPic = function (sEmail, fCallback)
|
||||||
{
|
{
|
||||||
sEmail = Utils.trim(sEmail);
|
sEmail = Utils.trim(sEmail);
|
||||||
fCallback(this.bCapaGravatar && '' !== sEmail ? Links.avatarLink(sEmail) : '', sEmail);
|
fCallback(this.bCapaGravatar && '' !== sEmail ? Links.avatarLink(sEmail) : '', sEmail);
|
||||||
|
|
@ -109,7 +109,7 @@
|
||||||
* @param {string} sUid
|
* @param {string} sUid
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid)
|
CacheUserStorage.prototype.getMessageKey = function (sFolderFullNameRaw, sUid)
|
||||||
{
|
{
|
||||||
return sFolderFullNameRaw + '#' + sUid;
|
return sFolderFullNameRaw + '#' + sUid;
|
||||||
};
|
};
|
||||||
|
|
@ -118,7 +118,7 @@
|
||||||
* @param {string} sFolder
|
* @param {string} sFolder
|
||||||
* @param {string} sUid
|
* @param {string} sUid
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.addRequestedMessage = function (sFolder, sUid)
|
CacheUserStorage.prototype.addRequestedMessage = function (sFolder, sUid)
|
||||||
{
|
{
|
||||||
this.oRequestedMessage[this.getMessageKey(sFolder, sUid)] = true;
|
this.oRequestedMessage[this.getMessageKey(sFolder, sUid)] = true;
|
||||||
};
|
};
|
||||||
|
|
@ -128,7 +128,7 @@
|
||||||
* @param {string} sUid
|
* @param {string} sUid
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.hasRequestedMessage = function (sFolder, sUid)
|
CacheUserStorage.prototype.hasRequestedMessage = function (sFolder, sUid)
|
||||||
{
|
{
|
||||||
return true === this.oRequestedMessage[this.getMessageKey(sFolder, sUid)];
|
return true === this.oRequestedMessage[this.getMessageKey(sFolder, sUid)];
|
||||||
};
|
};
|
||||||
|
|
@ -137,7 +137,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @param {string} sUid
|
* @param {string} sUid
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid)
|
CacheUserStorage.prototype.addNewMessageCache = function (sFolderFullNameRaw, sUid)
|
||||||
{
|
{
|
||||||
this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)] = true;
|
this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)] = true;
|
||||||
};
|
};
|
||||||
|
|
@ -146,7 +146,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @param {string} sUid
|
* @param {string} sUid
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid)
|
CacheUserStorage.prototype.hasNewMessageAndRemoveFromCache = function (sFolderFullNameRaw, sUid)
|
||||||
{
|
{
|
||||||
if (this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)])
|
if (this.oNewMessage[this.getMessageKey(sFolderFullNameRaw, sUid)])
|
||||||
{
|
{
|
||||||
|
|
@ -157,7 +157,7 @@
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
CacheAppStorage.prototype.clearNewMessageCache = function ()
|
CacheUserStorage.prototype.clearNewMessageCache = function ()
|
||||||
{
|
{
|
||||||
this.oNewMessage = {};
|
this.oNewMessage = {};
|
||||||
};
|
};
|
||||||
|
|
@ -165,12 +165,12 @@
|
||||||
/**
|
/**
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.sInboxFolderName = '';
|
CacheUserStorage.prototype.sInboxFolderName = '';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.getFolderInboxName = function ()
|
CacheUserStorage.prototype.getFolderInboxName = function ()
|
||||||
{
|
{
|
||||||
return '' === this.sInboxFolderName ? 'INBOX' : this.sInboxFolderName;
|
return '' === this.sInboxFolderName ? 'INBOX' : this.sInboxFolderName;
|
||||||
};
|
};
|
||||||
|
|
@ -179,7 +179,7 @@
|
||||||
* @param {string} sFolderHash
|
* @param {string} sFolderHash
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.getFolderFullNameRaw = function (sFolderHash)
|
CacheUserStorage.prototype.getFolderFullNameRaw = function (sFolderHash)
|
||||||
{
|
{
|
||||||
return '' !== sFolderHash && this.oFoldersNamesCache[sFolderHash] ? this.oFoldersNamesCache[sFolderHash] : '';
|
return '' !== sFolderHash && this.oFoldersNamesCache[sFolderHash] ? this.oFoldersNamesCache[sFolderHash] : '';
|
||||||
};
|
};
|
||||||
|
|
@ -188,7 +188,7 @@
|
||||||
* @param {string} sFolderHash
|
* @param {string} sFolderHash
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw)
|
CacheUserStorage.prototype.setFolderFullNameRaw = function (sFolderHash, sFolderFullNameRaw)
|
||||||
{
|
{
|
||||||
this.oFoldersNamesCache[sFolderHash] = sFolderFullNameRaw;
|
this.oFoldersNamesCache[sFolderHash] = sFolderFullNameRaw;
|
||||||
if ('INBOX' === sFolderFullNameRaw || '' === this.sInboxFolderName)
|
if ('INBOX' === sFolderFullNameRaw || '' === this.sInboxFolderName)
|
||||||
|
|
@ -201,7 +201,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.getFolderHash = function (sFolderFullNameRaw)
|
CacheUserStorage.prototype.getFolderHash = function (sFolderFullNameRaw)
|
||||||
{
|
{
|
||||||
return '' !== sFolderFullNameRaw && this.oFolderHashCache[sFolderFullNameRaw] ? this.oFolderHashCache[sFolderFullNameRaw] : '';
|
return '' !== sFolderFullNameRaw && this.oFolderHashCache[sFolderFullNameRaw] ? this.oFolderHashCache[sFolderFullNameRaw] : '';
|
||||||
};
|
};
|
||||||
|
|
@ -210,7 +210,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @param {string} sFolderHash
|
* @param {string} sFolderHash
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash)
|
CacheUserStorage.prototype.setFolderHash = function (sFolderFullNameRaw, sFolderHash)
|
||||||
{
|
{
|
||||||
this.oFolderHashCache[sFolderFullNameRaw] = sFolderHash;
|
this.oFolderHashCache[sFolderFullNameRaw] = sFolderHash;
|
||||||
};
|
};
|
||||||
|
|
@ -219,7 +219,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @return {string}
|
* @return {string}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw)
|
CacheUserStorage.prototype.getFolderUidNext = function (sFolderFullNameRaw)
|
||||||
{
|
{
|
||||||
return '' !== sFolderFullNameRaw && this.oFolderUidNextCache[sFolderFullNameRaw] ? this.oFolderUidNextCache[sFolderFullNameRaw] : '';
|
return '' !== sFolderFullNameRaw && this.oFolderUidNextCache[sFolderFullNameRaw] ? this.oFolderUidNextCache[sFolderFullNameRaw] : '';
|
||||||
};
|
};
|
||||||
|
|
@ -228,7 +228,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @param {string} sUidNext
|
* @param {string} sUidNext
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext)
|
CacheUserStorage.prototype.setFolderUidNext = function (sFolderFullNameRaw, sUidNext)
|
||||||
{
|
{
|
||||||
this.oFolderUidNextCache[sFolderFullNameRaw] = sUidNext;
|
this.oFolderUidNextCache[sFolderFullNameRaw] = sUidNext;
|
||||||
};
|
};
|
||||||
|
|
@ -237,7 +237,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @return {?FolderModel}
|
* @return {?FolderModel}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw)
|
CacheUserStorage.prototype.getFolderFromCacheList = function (sFolderFullNameRaw)
|
||||||
{
|
{
|
||||||
return '' !== sFolderFullNameRaw && this.oFoldersCache[sFolderFullNameRaw] ? this.oFoldersCache[sFolderFullNameRaw] : null;
|
return '' !== sFolderFullNameRaw && this.oFoldersCache[sFolderFullNameRaw] ? this.oFoldersCache[sFolderFullNameRaw] : null;
|
||||||
};
|
};
|
||||||
|
|
@ -246,7 +246,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @param {?FolderModel} oFolder
|
* @param {?FolderModel} oFolder
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder)
|
CacheUserStorage.prototype.setFolderToCacheList = function (sFolderFullNameRaw, oFolder)
|
||||||
{
|
{
|
||||||
this.oFoldersCache[sFolderFullNameRaw] = oFolder;
|
this.oFoldersCache[sFolderFullNameRaw] = oFolder;
|
||||||
};
|
};
|
||||||
|
|
@ -254,7 +254,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw)
|
CacheUserStorage.prototype.removeFolderFromCacheList = function (sFolderFullNameRaw)
|
||||||
{
|
{
|
||||||
this.setFolderToCacheList(sFolderFullNameRaw, null);
|
this.setFolderToCacheList(sFolderFullNameRaw, null);
|
||||||
};
|
};
|
||||||
|
|
@ -264,7 +264,7 @@
|
||||||
* @param {string} sUid
|
* @param {string} sUid
|
||||||
* @return {?Array}
|
* @return {?Array}
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid)
|
CacheUserStorage.prototype.getMessageFlagsFromCache = function (sFolderFullName, sUid)
|
||||||
{
|
{
|
||||||
return this.oMessageFlagsCache[sFolderFullName] && this.oMessageFlagsCache[sFolderFullName][sUid] ?
|
return this.oMessageFlagsCache[sFolderFullName] && this.oMessageFlagsCache[sFolderFullName][sUid] ?
|
||||||
this.oMessageFlagsCache[sFolderFullName][sUid] : null;
|
this.oMessageFlagsCache[sFolderFullName][sUid] : null;
|
||||||
|
|
@ -275,7 +275,7 @@
|
||||||
* @param {string} sUid
|
* @param {string} sUid
|
||||||
* @param {Array} aFlagsCache
|
* @param {Array} aFlagsCache
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache)
|
CacheUserStorage.prototype.setMessageFlagsToCache = function (sFolderFullName, sUid, aFlagsCache)
|
||||||
{
|
{
|
||||||
if (!this.oMessageFlagsCache[sFolderFullName])
|
if (!this.oMessageFlagsCache[sFolderFullName])
|
||||||
{
|
{
|
||||||
|
|
@ -288,7 +288,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {string} sFolderFullName
|
* @param {string} sFolderFullName
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName)
|
CacheUserStorage.prototype.clearMessageFlagsFromCacheByFolder = function (sFolderFullName)
|
||||||
{
|
{
|
||||||
this.oMessageFlagsCache[sFolderFullName] = {};
|
this.oMessageFlagsCache[sFolderFullName] = {};
|
||||||
};
|
};
|
||||||
|
|
@ -296,7 +296,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {(MessageModel|null)} oMessage
|
* @param {(MessageModel|null)} oMessage
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.initMessageFlagsFromCache = function (oMessage)
|
CacheUserStorage.prototype.initMessageFlagsFromCache = function (oMessage)
|
||||||
{
|
{
|
||||||
if (oMessage)
|
if (oMessage)
|
||||||
{
|
{
|
||||||
|
|
@ -337,7 +337,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {(MessageModel|null)} oMessage
|
* @param {(MessageModel|null)} oMessage
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.storeMessageFlagsToCache = function (oMessage)
|
CacheUserStorage.prototype.storeMessageFlagsToCache = function (oMessage)
|
||||||
{
|
{
|
||||||
if (oMessage)
|
if (oMessage)
|
||||||
{
|
{
|
||||||
|
|
@ -353,7 +353,7 @@
|
||||||
* @param {string} sUid
|
* @param {string} sUid
|
||||||
* @param {Array} aFlags
|
* @param {Array} aFlags
|
||||||
*/
|
*/
|
||||||
CacheAppStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags)
|
CacheUserStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function (sFolder, sUid, aFlags)
|
||||||
{
|
{
|
||||||
if (Utils.isArray(aFlags) && 0 < aFlags.length)
|
if (Utils.isArray(aFlags) && 0 < aFlags.length)
|
||||||
{
|
{
|
||||||
|
|
@ -361,6 +361,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = new CacheAppStorage();
|
module.exports = new CacheUserStorage();
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -18,7 +18,7 @@
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
|
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractData
|
* @extends AbstractData
|
||||||
*/
|
*/
|
||||||
function DataAppStorage()
|
function DataUserStorage()
|
||||||
{
|
{
|
||||||
AbstractData.call(this);
|
AbstractData.call(this);
|
||||||
|
|
||||||
|
|
@ -322,7 +322,7 @@
|
||||||
if (Enums.Layout.NoPreview === this.layout() &&
|
if (Enums.Layout.NoPreview === this.layout() &&
|
||||||
-1 < window.location.hash.indexOf('message-preview'))
|
-1 < window.location.hash.indexOf('message-preview'))
|
||||||
{
|
{
|
||||||
require('App/App').historyBack();
|
require('App/User').historyBack();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (Enums.Layout.NoPreview === this.layout())
|
else if (Enums.Layout.NoPreview === this.layout())
|
||||||
|
|
@ -470,9 +470,9 @@
|
||||||
this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30);
|
this.purgeMessageBodyCacheThrottle = _.throttle(this.purgeMessageBodyCache, 1000 * 30);
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(DataAppStorage.prototype, AbstractData.prototype);
|
_.extend(DataUserStorage.prototype, AbstractData.prototype);
|
||||||
|
|
||||||
DataAppStorage.prototype.purgeMessageBodyCache = function()
|
DataUserStorage.prototype.purgeMessageBodyCache = function()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
iCount = 0,
|
iCount = 0,
|
||||||
|
|
@ -504,7 +504,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
DataAppStorage.prototype.populateDataOnStart = function()
|
DataUserStorage.prototype.populateDataOnStart = function()
|
||||||
{
|
{
|
||||||
AbstractData.prototype.populateDataOnStart.call(this);
|
AbstractData.prototype.populateDataOnStart.call(this);
|
||||||
|
|
||||||
|
|
@ -529,7 +529,7 @@
|
||||||
this.devPassword = Settings.settingsGet('DevPassword');
|
this.devPassword = Settings.settingsGet('DevPassword');
|
||||||
};
|
};
|
||||||
|
|
||||||
DataAppStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages)
|
DataUserStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUidNext, aNewMessages)
|
||||||
{
|
{
|
||||||
if (Cache.getFolderInboxName() === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '')
|
if (Cache.getFolderInboxName() === sFolder && Utils.isNormal(sUidNext) && sUidNext !== '')
|
||||||
{
|
{
|
||||||
|
|
@ -608,7 +608,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
DataAppStorage.prototype.hideMessageBodies = function ()
|
DataUserStorage.prototype.hideMessageBodies = function ()
|
||||||
{
|
{
|
||||||
var oMessagesBodiesDom = this.messagesBodiesDom();
|
var oMessagesBodiesDom = this.messagesBodiesDom();
|
||||||
if (oMessagesBodiesDom)
|
if (oMessagesBodiesDom)
|
||||||
|
|
@ -621,7 +621,7 @@
|
||||||
* @param {boolean=} bBoot = false
|
* @param {boolean=} bBoot = false
|
||||||
* @returns {Array}
|
* @returns {Array}
|
||||||
*/
|
*/
|
||||||
DataAppStorage.prototype.getNextFolderNames = function (bBoot)
|
DataUserStorage.prototype.getNextFolderNames = function (bBoot)
|
||||||
{
|
{
|
||||||
bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
|
bBoot = Utils.isUnd(bBoot) ? false : !!bBoot;
|
||||||
|
|
||||||
|
|
@ -685,7 +685,7 @@
|
||||||
* @param {string=} sToFolderFullNameRaw = ''
|
* @param {string=} sToFolderFullNameRaw = ''
|
||||||
* @param {bCopy=} bCopy = false
|
* @param {bCopy=} bCopy = false
|
||||||
*/
|
*/
|
||||||
DataAppStorage.prototype.removeMessagesFromList = function (
|
DataUserStorage.prototype.removeMessagesFromList = function (
|
||||||
sFromFolderFullNameRaw, aUidForRemove, sToFolderFullNameRaw, bCopy)
|
sFromFolderFullNameRaw, aUidForRemove, sToFolderFullNameRaw, bCopy)
|
||||||
{
|
{
|
||||||
sToFolderFullNameRaw = Utils.isNormal(sToFolderFullNameRaw) ? sToFolderFullNameRaw : '';
|
sToFolderFullNameRaw = Utils.isNormal(sToFolderFullNameRaw) ? sToFolderFullNameRaw : '';
|
||||||
|
|
@ -782,7 +782,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {Object} oMessageTextBody
|
* @param {Object} oMessageTextBody
|
||||||
*/
|
*/
|
||||||
DataAppStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody)
|
DataUserStorage.prototype.initBlockquoteSwitcher = function (oMessageTextBody)
|
||||||
{
|
{
|
||||||
if (oMessageTextBody)
|
if (oMessageTextBody)
|
||||||
{
|
{
|
||||||
|
|
@ -814,7 +814,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
DataAppStorage.prototype.setMessage = function (oData, bCached)
|
DataUserStorage.prototype.setMessage = function (oData, bCached)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
bIsHtml = false,
|
bIsHtml = false,
|
||||||
|
|
@ -960,7 +960,7 @@
|
||||||
Cache.initMessageFlagsFromCache(oMessage);
|
Cache.initMessageFlagsFromCache(oMessage);
|
||||||
if (oMessage.unseen())
|
if (oMessage.unseen())
|
||||||
{
|
{
|
||||||
require('App/App').setMessageSeen(oMessage);
|
require('App/User').setMessageSeen(oMessage);
|
||||||
}
|
}
|
||||||
|
|
||||||
Utils.windowResize();
|
Utils.windowResize();
|
||||||
|
|
@ -971,21 +971,21 @@
|
||||||
* @param {Array} aList
|
* @param {Array} aList
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
DataAppStorage.prototype.calculateMessageListHash = function (aList)
|
DataUserStorage.prototype.calculateMessageListHash = function (aList)
|
||||||
{
|
{
|
||||||
return _.map(aList, function (oMessage) {
|
return _.map(aList, function (oMessage) {
|
||||||
return '' + oMessage.hash + '_' + oMessage.threadsLen() + '_' + oMessage.flagHash();
|
return '' + oMessage.hash + '_' + oMessage.threadsLen() + '_' + oMessage.flagHash();
|
||||||
}).join('|');
|
}).join('|');
|
||||||
};
|
};
|
||||||
|
|
||||||
DataAppStorage.prototype.findPublicKeyByHex = function (sHash)
|
DataUserStorage.prototype.findPublicKeyByHex = function (sHash)
|
||||||
{
|
{
|
||||||
return _.find(this.openpgpkeysPublic(), function (oItem) {
|
return _.find(this.openpgpkeysPublic(), function (oItem) {
|
||||||
return oItem && sHash === oItem.id;
|
return oItem && sHash === oItem.id;
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
DataAppStorage.prototype.findPublicKeysByEmail = function (sEmail)
|
DataUserStorage.prototype.findPublicKeysByEmail = function (sEmail)
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) {
|
return _.compact(_.map(this.openpgpkeysPublic(), function (oItem) {
|
||||||
|
|
@ -1014,7 +1014,7 @@
|
||||||
* @param {string=} sPassword
|
* @param {string=} sPassword
|
||||||
* @returns {?}
|
* @returns {?}
|
||||||
*/
|
*/
|
||||||
DataAppStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword)
|
DataUserStorage.prototype.findPrivateKeyByEmail = function (sEmail, sPassword)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
self = this,
|
self = this,
|
||||||
|
|
@ -1052,11 +1052,11 @@
|
||||||
* @param {string=} sPassword
|
* @param {string=} sPassword
|
||||||
* @returns {?}
|
* @returns {?}
|
||||||
*/
|
*/
|
||||||
DataAppStorage.prototype.findSelfPrivateKey = function (sPassword)
|
DataUserStorage.prototype.findSelfPrivateKey = function (sPassword)
|
||||||
{
|
{
|
||||||
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
|
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = new DataAppStorage();
|
module.exports = new DataUserStorage();
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
Base64 = require('Common/Base64'),
|
Base64 = require('Common/Base64'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
|
|
||||||
AbstractRemoteStorage = require('Storage/AbstractRemote')
|
AbstractRemoteStorage = require('Storage/AbstractRemote')
|
||||||
;
|
;
|
||||||
|
|
@ -22,19 +22,19 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractRemoteStorage
|
* @extends AbstractRemoteStorage
|
||||||
*/
|
*/
|
||||||
function RemoteAppStorage()
|
function RemoteUserStorage()
|
||||||
{
|
{
|
||||||
AbstractRemoteStorage.call(this);
|
AbstractRemoteStorage.call(this);
|
||||||
|
|
||||||
this.oRequests = {};
|
this.oRequests = {};
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(RemoteAppStorage.prototype, AbstractRemoteStorage.prototype);
|
_.extend(RemoteUserStorage.prototype, AbstractRemoteStorage.prototype);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.folders = function (fCallback)
|
RemoteUserStorage.prototype.folders = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'Folders', {
|
this.defaultRequest(fCallback, 'Folders', {
|
||||||
'SentFolder': Settings.settingsGet('SentFolder'),
|
'SentFolder': Settings.settingsGet('SentFolder'),
|
||||||
|
|
@ -55,7 +55,7 @@
|
||||||
* @param {string=} sAdditionalCode
|
* @param {string=} sAdditionalCode
|
||||||
* @param {boolean=} bAdditionalCodeSignMe
|
* @param {boolean=} bAdditionalCodeSignMe
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode, bAdditionalCodeSignMe)
|
RemoteUserStorage.prototype.login = function (fCallback, sEmail, sLogin, sPassword, bSignMe, sLanguage, sAdditionalCode, bAdditionalCodeSignMe)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'Login', {
|
this.defaultRequest(fCallback, 'Login', {
|
||||||
'Email': sEmail,
|
'Email': sEmail,
|
||||||
|
|
@ -71,7 +71,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.getTwoFactor = function (fCallback)
|
RemoteUserStorage.prototype.getTwoFactor = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'GetTwoFactorInfo');
|
this.defaultRequest(fCallback, 'GetTwoFactorInfo');
|
||||||
};
|
};
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.createTwoFactor = function (fCallback)
|
RemoteUserStorage.prototype.createTwoFactor = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'CreateTwoFactorSecret');
|
this.defaultRequest(fCallback, 'CreateTwoFactorSecret');
|
||||||
};
|
};
|
||||||
|
|
@ -87,7 +87,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.clearTwoFactor = function (fCallback)
|
RemoteUserStorage.prototype.clearTwoFactor = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ClearTwoFactorInfo');
|
this.defaultRequest(fCallback, 'ClearTwoFactorInfo');
|
||||||
};
|
};
|
||||||
|
|
@ -95,7 +95,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.showTwoFactorSecret = function (fCallback)
|
RemoteUserStorage.prototype.showTwoFactorSecret = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ShowTwoFactorSecret');
|
this.defaultRequest(fCallback, 'ShowTwoFactorSecret');
|
||||||
};
|
};
|
||||||
|
|
@ -104,7 +104,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {string} sCode
|
* @param {string} sCode
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.testTwoFactor = function (fCallback, sCode)
|
RemoteUserStorage.prototype.testTwoFactor = function (fCallback, sCode)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'TestTwoFactorInfo', {
|
this.defaultRequest(fCallback, 'TestTwoFactorInfo', {
|
||||||
'Code': sCode
|
'Code': sCode
|
||||||
|
|
@ -115,7 +115,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {boolean} bEnable
|
* @param {boolean} bEnable
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.enableTwoFactor = function (fCallback, bEnable)
|
RemoteUserStorage.prototype.enableTwoFactor = function (fCallback, bEnable)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'EnableTwoFactor', {
|
this.defaultRequest(fCallback, 'EnableTwoFactor', {
|
||||||
'Enable': bEnable ? '1' : '0'
|
'Enable': bEnable ? '1' : '0'
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.clearTwoFactorInfo = function (fCallback)
|
RemoteUserStorage.prototype.clearTwoFactorInfo = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ClearTwoFactorInfo');
|
this.defaultRequest(fCallback, 'ClearTwoFactorInfo');
|
||||||
};
|
};
|
||||||
|
|
@ -133,7 +133,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.contactsSync = function (fCallback)
|
RemoteUserStorage.prototype.contactsSync = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ContactsSync', null, Consts.Defaults.ContactsSyncAjaxTimeout);
|
this.defaultRequest(fCallback, 'ContactsSync', null, Consts.Defaults.ContactsSyncAjaxTimeout);
|
||||||
};
|
};
|
||||||
|
|
@ -145,7 +145,7 @@
|
||||||
* @param {string} sUser
|
* @param {string} sUser
|
||||||
* @param {string} sPassword
|
* @param {string} sPassword
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.saveContactsSyncData = function (fCallback, bEnable, sUrl, sUser, sPassword)
|
RemoteUserStorage.prototype.saveContactsSyncData = function (fCallback, bEnable, sUrl, sUser, sPassword)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SaveContactsSyncData', {
|
this.defaultRequest(fCallback, 'SaveContactsSyncData', {
|
||||||
'Enable': bEnable ? '1' : '0',
|
'Enable': bEnable ? '1' : '0',
|
||||||
|
|
@ -161,7 +161,7 @@
|
||||||
* @param {string} sLogin
|
* @param {string} sLogin
|
||||||
* @param {string} sPassword
|
* @param {string} sPassword
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.accountAdd = function (fCallback, sEmail, sLogin, sPassword)
|
RemoteUserStorage.prototype.accountAdd = function (fCallback, sEmail, sLogin, sPassword)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'AccountAdd', {
|
this.defaultRequest(fCallback, 'AccountAdd', {
|
||||||
'Email': sEmail,
|
'Email': sEmail,
|
||||||
|
|
@ -174,7 +174,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {string} sEmailToDelete
|
* @param {string} sEmailToDelete
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.accountDelete = function (fCallback, sEmailToDelete)
|
RemoteUserStorage.prototype.accountDelete = function (fCallback, sEmailToDelete)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'AccountDelete', {
|
this.defaultRequest(fCallback, 'AccountDelete', {
|
||||||
'EmailToDelete': sEmailToDelete
|
'EmailToDelete': sEmailToDelete
|
||||||
|
|
@ -189,7 +189,7 @@
|
||||||
* @param {string} sReplyTo
|
* @param {string} sReplyTo
|
||||||
* @param {string} sBcc
|
* @param {string} sBcc
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.identityUpdate = function (fCallback, sId, sEmail, sName, sReplyTo, sBcc)
|
RemoteUserStorage.prototype.identityUpdate = function (fCallback, sId, sEmail, sName, sReplyTo, sBcc)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'IdentityUpdate', {
|
this.defaultRequest(fCallback, 'IdentityUpdate', {
|
||||||
'Id': sId,
|
'Id': sId,
|
||||||
|
|
@ -204,7 +204,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {string} sIdToDelete
|
* @param {string} sIdToDelete
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.identityDelete = function (fCallback, sIdToDelete)
|
RemoteUserStorage.prototype.identityDelete = function (fCallback, sIdToDelete)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'IdentityDelete', {
|
this.defaultRequest(fCallback, 'IdentityDelete', {
|
||||||
'IdToDelete': sIdToDelete
|
'IdToDelete': sIdToDelete
|
||||||
|
|
@ -214,7 +214,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.accountsAndIdentities = function (fCallback)
|
RemoteUserStorage.prototype.accountsAndIdentities = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'AccountsAndIdentities');
|
this.defaultRequest(fCallback, 'AccountsAndIdentities');
|
||||||
};
|
};
|
||||||
|
|
@ -227,7 +227,7 @@
|
||||||
* @param {string=} sSearch = ''
|
* @param {string=} sSearch = ''
|
||||||
* @param {boolean=} bSilent = false
|
* @param {boolean=} bSilent = false
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.messageList = function (fCallback, sFolderFullNameRaw, iOffset, iLimit, sSearch, bSilent)
|
RemoteUserStorage.prototype.messageList = function (fCallback, sFolderFullNameRaw, iOffset, iLimit, sSearch, bSilent)
|
||||||
{
|
{
|
||||||
sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
|
sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
|
||||||
|
|
||||||
|
|
@ -274,7 +274,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {Array} aDownloads
|
* @param {Array} aDownloads
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.messageUploadAttachments = function (fCallback, aDownloads)
|
RemoteUserStorage.prototype.messageUploadAttachments = function (fCallback, aDownloads)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'MessageUploadAttachments', {
|
this.defaultRequest(fCallback, 'MessageUploadAttachments', {
|
||||||
'Attachments': aDownloads
|
'Attachments': aDownloads
|
||||||
|
|
@ -287,7 +287,7 @@
|
||||||
* @param {number} iUid
|
* @param {number} iUid
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.message = function (fCallback, sFolderFullNameRaw, iUid)
|
RemoteUserStorage.prototype.message = function (fCallback, sFolderFullNameRaw, iUid)
|
||||||
{
|
{
|
||||||
sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
|
sFolderFullNameRaw = Utils.pString(sFolderFullNameRaw);
|
||||||
iUid = Utils.pInt(iUid);
|
iUid = Utils.pInt(iUid);
|
||||||
|
|
@ -312,7 +312,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {Array} aExternals
|
* @param {Array} aExternals
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.composeUploadExternals = function (fCallback, aExternals)
|
RemoteUserStorage.prototype.composeUploadExternals = function (fCallback, aExternals)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ComposeUploadExternals', {
|
this.defaultRequest(fCallback, 'ComposeUploadExternals', {
|
||||||
'Externals': aExternals
|
'Externals': aExternals
|
||||||
|
|
@ -324,7 +324,7 @@
|
||||||
* @param {string} sUrl
|
* @param {string} sUrl
|
||||||
* @param {string} sAccessToken
|
* @param {string} sAccessToken
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.composeUploadDrive = function (fCallback, sUrl, sAccessToken)
|
RemoteUserStorage.prototype.composeUploadDrive = function (fCallback, sUrl, sAccessToken)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ComposeUploadDrive', {
|
this.defaultRequest(fCallback, 'ComposeUploadDrive', {
|
||||||
'AccessToken': sAccessToken,
|
'AccessToken': sAccessToken,
|
||||||
|
|
@ -337,7 +337,7 @@
|
||||||
* @param {string} sFolder
|
* @param {string} sFolder
|
||||||
* @param {Array=} aList = []
|
* @param {Array=} aList = []
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.folderInformation = function (fCallback, sFolder, aList)
|
RemoteUserStorage.prototype.folderInformation = function (fCallback, sFolder, aList)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
bRequest = true,
|
bRequest = true,
|
||||||
|
|
@ -380,7 +380,7 @@
|
||||||
}
|
}
|
||||||
else if (Data.useThreads())
|
else if (Data.useThreads())
|
||||||
{
|
{
|
||||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -388,7 +388,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {Array} aFolders
|
* @param {Array} aFolders
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.folderInformationMultiply = function (fCallback, aFolders)
|
RemoteUserStorage.prototype.folderInformationMultiply = function (fCallback, aFolders)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'FolderInformationMultiply', {
|
this.defaultRequest(fCallback, 'FolderInformationMultiply', {
|
||||||
'Folders': aFolders
|
'Folders': aFolders
|
||||||
|
|
@ -398,7 +398,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.logout = function (fCallback)
|
RemoteUserStorage.prototype.logout = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'Logout');
|
this.defaultRequest(fCallback, 'Logout');
|
||||||
};
|
};
|
||||||
|
|
@ -409,7 +409,7 @@
|
||||||
* @param {Array} aUids
|
* @param {Array} aUids
|
||||||
* @param {boolean} bSetFlagged
|
* @param {boolean} bSetFlagged
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.messageSetFlagged = function (fCallback, sFolderFullNameRaw, aUids, bSetFlagged)
|
RemoteUserStorage.prototype.messageSetFlagged = function (fCallback, sFolderFullNameRaw, aUids, bSetFlagged)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'MessageSetFlagged', {
|
this.defaultRequest(fCallback, 'MessageSetFlagged', {
|
||||||
'Folder': sFolderFullNameRaw,
|
'Folder': sFolderFullNameRaw,
|
||||||
|
|
@ -424,7 +424,7 @@
|
||||||
* @param {Array} aUids
|
* @param {Array} aUids
|
||||||
* @param {boolean} bSetSeen
|
* @param {boolean} bSetSeen
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.messageSetSeen = function (fCallback, sFolderFullNameRaw, aUids, bSetSeen)
|
RemoteUserStorage.prototype.messageSetSeen = function (fCallback, sFolderFullNameRaw, aUids, bSetSeen)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'MessageSetSeen', {
|
this.defaultRequest(fCallback, 'MessageSetSeen', {
|
||||||
'Folder': sFolderFullNameRaw,
|
'Folder': sFolderFullNameRaw,
|
||||||
|
|
@ -438,7 +438,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @param {boolean} bSetSeen
|
* @param {boolean} bSetSeen
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.messageSetSeenToAll = function (fCallback, sFolderFullNameRaw, bSetSeen)
|
RemoteUserStorage.prototype.messageSetSeenToAll = function (fCallback, sFolderFullNameRaw, bSetSeen)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'MessageSetSeenToAll', {
|
this.defaultRequest(fCallback, 'MessageSetSeenToAll', {
|
||||||
'Folder': sFolderFullNameRaw,
|
'Folder': sFolderFullNameRaw,
|
||||||
|
|
@ -463,7 +463,7 @@
|
||||||
* @param {string} sInReplyTo
|
* @param {string} sInReplyTo
|
||||||
* @param {string} sReferences
|
* @param {string} sReferences
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.saveMessage = function (fCallback, sMessageFolder, sMessageUid, sDraftFolder,
|
RemoteUserStorage.prototype.saveMessage = function (fCallback, sMessageFolder, sMessageUid, sDraftFolder,
|
||||||
sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences)
|
sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SaveMessage', {
|
this.defaultRequest(fCallback, 'SaveMessage', {
|
||||||
|
|
@ -493,7 +493,7 @@
|
||||||
* @param {string} sSubject
|
* @param {string} sSubject
|
||||||
* @param {string} sText
|
* @param {string} sText
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.sendReadReceiptMessage = function (fCallback, sMessageFolder, sMessageUid, sReadReceipt, sSubject, sText)
|
RemoteUserStorage.prototype.sendReadReceiptMessage = function (fCallback, sMessageFolder, sMessageUid, sReadReceipt, sSubject, sText)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SendReadReceiptMessage', {
|
this.defaultRequest(fCallback, 'SendReadReceiptMessage', {
|
||||||
'MessageFolder': sMessageFolder,
|
'MessageFolder': sMessageFolder,
|
||||||
|
|
@ -522,7 +522,7 @@
|
||||||
* @param {string} sReferences
|
* @param {string} sReferences
|
||||||
* @param {boolean} bRequestReadReceipt
|
* @param {boolean} bRequestReadReceipt
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.sendMessage = function (fCallback, sMessageFolder, sMessageUid, sSentFolder,
|
RemoteUserStorage.prototype.sendMessage = function (fCallback, sMessageFolder, sMessageUid, sSentFolder,
|
||||||
sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences, bRequestReadReceipt)
|
sFrom, sTo, sCc, sBcc, sSubject, bTextIsHtml, sText, aAttachments, aDraftInfo, sInReplyTo, sReferences, bRequestReadReceipt)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SendMessage', {
|
this.defaultRequest(fCallback, 'SendMessage', {
|
||||||
|
|
@ -548,7 +548,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {Object} oData
|
* @param {Object} oData
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.saveSystemFolders = function (fCallback, oData)
|
RemoteUserStorage.prototype.saveSystemFolders = function (fCallback, oData)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SystemFoldersUpdate', oData);
|
this.defaultRequest(fCallback, 'SystemFoldersUpdate', oData);
|
||||||
};
|
};
|
||||||
|
|
@ -557,7 +557,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {Object} oData
|
* @param {Object} oData
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.saveSettings = function (fCallback, oData)
|
RemoteUserStorage.prototype.saveSettings = function (fCallback, oData)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SettingsUpdate', oData);
|
this.defaultRequest(fCallback, 'SettingsUpdate', oData);
|
||||||
};
|
};
|
||||||
|
|
@ -567,7 +567,7 @@
|
||||||
* @param {string} sPrevPassword
|
* @param {string} sPrevPassword
|
||||||
* @param {string} sNewPassword
|
* @param {string} sNewPassword
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.changePassword = function (fCallback, sPrevPassword, sNewPassword)
|
RemoteUserStorage.prototype.changePassword = function (fCallback, sPrevPassword, sNewPassword)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ChangePassword', {
|
this.defaultRequest(fCallback, 'ChangePassword', {
|
||||||
'PrevPassword': sPrevPassword,
|
'PrevPassword': sPrevPassword,
|
||||||
|
|
@ -580,7 +580,7 @@
|
||||||
* @param {string} sNewFolderName
|
* @param {string} sNewFolderName
|
||||||
* @param {string} sParentName
|
* @param {string} sParentName
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.folderCreate = function (fCallback, sNewFolderName, sParentName)
|
RemoteUserStorage.prototype.folderCreate = function (fCallback, sNewFolderName, sParentName)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'FolderCreate', {
|
this.defaultRequest(fCallback, 'FolderCreate', {
|
||||||
'Folder': sNewFolderName,
|
'Folder': sNewFolderName,
|
||||||
|
|
@ -592,7 +592,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.folderDelete = function (fCallback, sFolderFullNameRaw)
|
RemoteUserStorage.prototype.folderDelete = function (fCallback, sFolderFullNameRaw)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'FolderDelete', {
|
this.defaultRequest(fCallback, 'FolderDelete', {
|
||||||
'Folder': sFolderFullNameRaw
|
'Folder': sFolderFullNameRaw
|
||||||
|
|
@ -604,7 +604,7 @@
|
||||||
* @param {string} sPrevFolderFullNameRaw
|
* @param {string} sPrevFolderFullNameRaw
|
||||||
* @param {string} sNewFolderName
|
* @param {string} sNewFolderName
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.folderRename = function (fCallback, sPrevFolderFullNameRaw, sNewFolderName)
|
RemoteUserStorage.prototype.folderRename = function (fCallback, sPrevFolderFullNameRaw, sNewFolderName)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'FolderRename', {
|
this.defaultRequest(fCallback, 'FolderRename', {
|
||||||
'Folder': sPrevFolderFullNameRaw,
|
'Folder': sPrevFolderFullNameRaw,
|
||||||
|
|
@ -616,7 +616,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.folderClear = function (fCallback, sFolderFullNameRaw)
|
RemoteUserStorage.prototype.folderClear = function (fCallback, sFolderFullNameRaw)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'FolderClear', {
|
this.defaultRequest(fCallback, 'FolderClear', {
|
||||||
'Folder': sFolderFullNameRaw
|
'Folder': sFolderFullNameRaw
|
||||||
|
|
@ -628,7 +628,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @param {boolean} bSubscribe
|
* @param {boolean} bSubscribe
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.folderSetSubscribe = function (fCallback, sFolderFullNameRaw, bSubscribe)
|
RemoteUserStorage.prototype.folderSetSubscribe = function (fCallback, sFolderFullNameRaw, bSubscribe)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'FolderSubscribe', {
|
this.defaultRequest(fCallback, 'FolderSubscribe', {
|
||||||
'Folder': sFolderFullNameRaw,
|
'Folder': sFolderFullNameRaw,
|
||||||
|
|
@ -643,7 +643,7 @@
|
||||||
* @param {Array} aUids
|
* @param {Array} aUids
|
||||||
* @param {string=} sLearning
|
* @param {string=} sLearning
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.messagesMove = function (fCallback, sFolder, sToFolder, aUids, sLearning)
|
RemoteUserStorage.prototype.messagesMove = function (fCallback, sFolder, sToFolder, aUids, sLearning)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'MessageMove', {
|
this.defaultRequest(fCallback, 'MessageMove', {
|
||||||
'FromFolder': sFolder,
|
'FromFolder': sFolder,
|
||||||
|
|
@ -659,7 +659,7 @@
|
||||||
* @param {string} sToFolder
|
* @param {string} sToFolder
|
||||||
* @param {Array} aUids
|
* @param {Array} aUids
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.messagesCopy = function (fCallback, sFolder, sToFolder, aUids)
|
RemoteUserStorage.prototype.messagesCopy = function (fCallback, sFolder, sToFolder, aUids)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'MessageCopy', {
|
this.defaultRequest(fCallback, 'MessageCopy', {
|
||||||
'FromFolder': sFolder,
|
'FromFolder': sFolder,
|
||||||
|
|
@ -673,7 +673,7 @@
|
||||||
* @param {string} sFolder
|
* @param {string} sFolder
|
||||||
* @param {Array} aUids
|
* @param {Array} aUids
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.messagesDelete = function (fCallback, sFolder, aUids)
|
RemoteUserStorage.prototype.messagesDelete = function (fCallback, sFolder, aUids)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'MessageDelete', {
|
this.defaultRequest(fCallback, 'MessageDelete', {
|
||||||
'Folder': sFolder,
|
'Folder': sFolder,
|
||||||
|
|
@ -684,7 +684,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.appDelayStart = function (fCallback)
|
RemoteUserStorage.prototype.appDelayStart = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'AppDelayStart');
|
this.defaultRequest(fCallback, 'AppDelayStart');
|
||||||
};
|
};
|
||||||
|
|
@ -692,7 +692,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.quota = function (fCallback)
|
RemoteUserStorage.prototype.quota = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'Quota');
|
this.defaultRequest(fCallback, 'Quota');
|
||||||
};
|
};
|
||||||
|
|
@ -703,7 +703,7 @@
|
||||||
* @param {number} iLimit
|
* @param {number} iLimit
|
||||||
* @param {string} sSearch
|
* @param {string} sSearch
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.contacts = function (fCallback, iOffset, iLimit, sSearch)
|
RemoteUserStorage.prototype.contacts = function (fCallback, iOffset, iLimit, sSearch)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'Contacts', {
|
this.defaultRequest(fCallback, 'Contacts', {
|
||||||
'Offset': iOffset,
|
'Offset': iOffset,
|
||||||
|
|
@ -715,7 +715,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.contactSave = function (fCallback, sRequestUid, sUid, aProperties)
|
RemoteUserStorage.prototype.contactSave = function (fCallback, sRequestUid, sUid, aProperties)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ContactSave', {
|
this.defaultRequest(fCallback, 'ContactSave', {
|
||||||
'RequestUid': sRequestUid,
|
'RequestUid': sRequestUid,
|
||||||
|
|
@ -728,7 +728,7 @@
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
* @param {Array} aUids
|
* @param {Array} aUids
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.contactsDelete = function (fCallback, aUids)
|
RemoteUserStorage.prototype.contactsDelete = function (fCallback, aUids)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'ContactsDelete', {
|
this.defaultRequest(fCallback, 'ContactsDelete', {
|
||||||
'Uids': aUids.join(',')
|
'Uids': aUids.join(',')
|
||||||
|
|
@ -740,7 +740,7 @@
|
||||||
* @param {string} sQuery
|
* @param {string} sQuery
|
||||||
* @param {number} iPage
|
* @param {number} iPage
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.suggestions = function (fCallback, sQuery, iPage)
|
RemoteUserStorage.prototype.suggestions = function (fCallback, sQuery, iPage)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'Suggestions', {
|
this.defaultRequest(fCallback, 'Suggestions', {
|
||||||
'Query': sQuery,
|
'Query': sQuery,
|
||||||
|
|
@ -751,7 +751,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.facebookUser = function (fCallback)
|
RemoteUserStorage.prototype.facebookUser = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SocialFacebookUserInformation');
|
this.defaultRequest(fCallback, 'SocialFacebookUserInformation');
|
||||||
};
|
};
|
||||||
|
|
@ -759,7 +759,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.facebookDisconnect = function (fCallback)
|
RemoteUserStorage.prototype.facebookDisconnect = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SocialFacebookDisconnect');
|
this.defaultRequest(fCallback, 'SocialFacebookDisconnect');
|
||||||
};
|
};
|
||||||
|
|
@ -767,7 +767,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.twitterUser = function (fCallback)
|
RemoteUserStorage.prototype.twitterUser = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SocialTwitterUserInformation');
|
this.defaultRequest(fCallback, 'SocialTwitterUserInformation');
|
||||||
};
|
};
|
||||||
|
|
@ -775,7 +775,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.twitterDisconnect = function (fCallback)
|
RemoteUserStorage.prototype.twitterDisconnect = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SocialTwitterDisconnect');
|
this.defaultRequest(fCallback, 'SocialTwitterDisconnect');
|
||||||
};
|
};
|
||||||
|
|
@ -783,7 +783,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.googleUser = function (fCallback)
|
RemoteUserStorage.prototype.googleUser = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SocialGoogleUserInformation');
|
this.defaultRequest(fCallback, 'SocialGoogleUserInformation');
|
||||||
};
|
};
|
||||||
|
|
@ -791,7 +791,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.googleDisconnect = function (fCallback)
|
RemoteUserStorage.prototype.googleDisconnect = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SocialGoogleDisconnect');
|
this.defaultRequest(fCallback, 'SocialGoogleDisconnect');
|
||||||
};
|
};
|
||||||
|
|
@ -799,11 +799,11 @@
|
||||||
/**
|
/**
|
||||||
* @param {?Function} fCallback
|
* @param {?Function} fCallback
|
||||||
*/
|
*/
|
||||||
RemoteAppStorage.prototype.socialUsers = function (fCallback)
|
RemoteUserStorage.prototype.socialUsers = function (fCallback)
|
||||||
{
|
{
|
||||||
this.defaultRequest(fCallback, 'SocialUsers');
|
this.defaultRequest(fCallback, 'SocialUsers');
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = new RemoteAppStorage();
|
module.exports = new RemoteUserStorage();
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
|
|
||||||
(function () {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var
|
|
||||||
_ = require('_'),
|
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
|
||||||
AbstractSystemDropDownViewModel = require('View/App/AbstractSystemDropDown')
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
* @extends AbstractSystemDropDownViewModel
|
|
||||||
*/
|
|
||||||
function SystemDropDownMailBoxAppView()
|
|
||||||
{
|
|
||||||
AbstractSystemDropDownViewModel.call(this);
|
|
||||||
kn.constructorEnd(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/MailBox/SystemDropDown', 'MailBoxSystemDropDownViewModel'], SystemDropDownMailBoxAppView);
|
|
||||||
_.extend(SystemDropDownMailBoxAppView.prototype, AbstractSystemDropDownViewModel.prototype);
|
|
||||||
|
|
||||||
module.exports = SystemDropDownMailBoxAppView;
|
|
||||||
|
|
||||||
}());
|
|
||||||
|
|
@ -1,28 +0,0 @@
|
||||||
|
|
||||||
(function () {
|
|
||||||
|
|
||||||
'use strict';
|
|
||||||
|
|
||||||
var
|
|
||||||
_ = require('_'),
|
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
|
||||||
AbstractSystemDropDownAppView = require('View/App/AbstractSystemDropDown')
|
|
||||||
;
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @constructor
|
|
||||||
* @extends AbstractSystemDropDownAppView
|
|
||||||
*/
|
|
||||||
function SystemDropDownSettingsAppView()
|
|
||||||
{
|
|
||||||
AbstractSystemDropDownAppView.call(this);
|
|
||||||
kn.constructorEnd(this);
|
|
||||||
}
|
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/Settings/SystemDropDown', 'SettingsSystemDropDownViewModel'], SystemDropDownSettingsAppView);
|
|
||||||
_.extend(SystemDropDownSettingsAppView.prototype, AbstractSystemDropDownAppView.prototype);
|
|
||||||
|
|
||||||
module.exports = SystemDropDownSettingsAppView;
|
|
||||||
|
|
||||||
}());
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -62,7 +62,7 @@
|
||||||
{
|
{
|
||||||
if (oData.Result)
|
if (oData.Result)
|
||||||
{
|
{
|
||||||
require('App/App').accountsAndIdentities();
|
require('App/User').accountsAndIdentities();
|
||||||
this.cancelCommand();
|
this.cancelCommand();
|
||||||
}
|
}
|
||||||
else if (oData.ErrorCode)
|
else if (oData.ErrorCode)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -77,7 +77,7 @@
|
||||||
|
|
||||||
oOpenpgpKeyring.store();
|
oOpenpgpKeyring.store();
|
||||||
|
|
||||||
require('App/App').reloadOpenPgpKeys();
|
require('App/User').reloadOpenPgpKeys();
|
||||||
Utils.delegateRun(this, 'cancelCommand');
|
Utils.delegateRun(this, 'cancelCommand');
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
|
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
|
||||||
|
|
@ -21,9 +21,9 @@
|
||||||
HtmlEditor = require('Common/HtmlEditor'),
|
HtmlEditor = require('Common/HtmlEditor'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
ComposeAttachmentModel = require('Model/ComposeAttachment'),
|
ComposeAttachmentModel = require('Model/ComposeAttachment'),
|
||||||
|
|
||||||
|
|
@ -211,7 +211,7 @@
|
||||||
|
|
||||||
this.deleteCommand = Utils.createCommand(this, function () {
|
this.deleteCommand = Utils.createCommand(this, function () {
|
||||||
|
|
||||||
require('App/App').deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]);
|
require('App/User').deleteMessagesFromFolderWithoutCheck(this.draftFolder(), [this.draftUid()]);
|
||||||
kn.hideScreenPopup(ComposePopupView);
|
kn.hideScreenPopup(ComposePopupView);
|
||||||
|
|
||||||
}, function () {
|
}, function () {
|
||||||
|
|
@ -270,7 +270,7 @@
|
||||||
}
|
}
|
||||||
|
|
||||||
Cache.setMessageFlagsToCache(this.aDraftInfo[2], this.aDraftInfo[1], aFlagsCache);
|
Cache.setMessageFlagsToCache(this.aDraftInfo[2], this.aDraftInfo[1], aFlagsCache);
|
||||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||||
Cache.setFolderHash(this.aDraftInfo[2], '');
|
Cache.setFolderHash(this.aDraftInfo[2], '');
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -408,7 +408,7 @@
|
||||||
|
|
||||||
ComposePopupView.prototype.emailsSource = function (oData, fResponse)
|
ComposePopupView.prototype.emailsSource = function (oData, fResponse)
|
||||||
{
|
{
|
||||||
require('App/App').getAutocomplete(oData.term, function (aData) {
|
require('App/User').getAutocomplete(oData.term, function (aData) {
|
||||||
fResponse(_.map(aData, function (oEmailItem) {
|
fResponse(_.map(aData, function (oEmailItem) {
|
||||||
return oEmailItem.toLine(false);
|
return oEmailItem.toLine(false);
|
||||||
}));
|
}));
|
||||||
|
|
@ -446,11 +446,11 @@
|
||||||
Cache.setFolderHash(sDraftFolder, '');
|
Cache.setFolderHash(sDraftFolder, '');
|
||||||
if (Data.currentFolderFullNameRaw() === sDraftFolder)
|
if (Data.currentFolderFullNameRaw() === sDraftFolder)
|
||||||
{
|
{
|
||||||
require('App/App').reloadMessageList(true);
|
require('App/User').reloadMessageList(true);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
require('App/App').folderInformation(sDraftFolder);
|
require('App/User').folderInformation(sDraftFolder);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -11,7 +11,7 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
|
|
||||||
EmailModel = require('Model/Email'),
|
EmailModel = require('Model/Email'),
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -17,8 +17,8 @@
|
||||||
Selector = require('Common/Selector'),
|
Selector = require('Common/Selector'),
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
EmailModel = require('Model/Email'),
|
EmailModel = require('Model/Email'),
|
||||||
ContactModel = require('Model/Contact'),
|
ContactModel = require('Model/Contact'),
|
||||||
|
|
@ -333,7 +333,7 @@
|
||||||
this.syncCommand = Utils.createCommand(this, function () {
|
this.syncCommand = Utils.createCommand(this, function () {
|
||||||
|
|
||||||
var self = this;
|
var self = this;
|
||||||
require('App/App').contactsSync(function (sResult, oData) {
|
require('App/User').contactsSync(function (sResult, oData) {
|
||||||
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
|
if (Enums.StorageResultType.Success !== sResult || !oData || !oData.Result)
|
||||||
{
|
{
|
||||||
window.alert(Utils.getNotification(
|
window.alert(Utils.getNotification(
|
||||||
|
|
@ -447,12 +447,12 @@
|
||||||
|
|
||||||
ContactsPopupView.prototype.exportVcf = function ()
|
ContactsPopupView.prototype.exportVcf = function ()
|
||||||
{
|
{
|
||||||
require('App/App').download(Links.exportContactsVcf());
|
require('App/User').download(Links.exportContactsVcf());
|
||||||
};
|
};
|
||||||
|
|
||||||
ContactsPopupView.prototype.exportCsv = function ()
|
ContactsPopupView.prototype.exportCsv = function ()
|
||||||
{
|
{
|
||||||
require('App/App').download(Links.exportContactsCsv());
|
require('App/User').download(Links.exportContactsCsv());
|
||||||
};
|
};
|
||||||
|
|
||||||
ContactsPopupView.prototype.initUploader = function ()
|
ContactsPopupView.prototype.initUploader = function ()
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
Consts = require('Common/Consts'),
|
Consts = require('Common/Consts'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
|
||||||
|
|
@ -10,9 +10,9 @@
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -70,7 +70,7 @@
|
||||||
self.clearingProcess(false);
|
self.clearingProcess(false);
|
||||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||||
{
|
{
|
||||||
require('App/App').reloadMessageList(true);
|
require('App/User').reloadMessageList(true);
|
||||||
self.cancelCommand();
|
self.cancelCommand();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
|
|
|
||||||
|
|
@ -11,8 +11,8 @@
|
||||||
Consts = require('Common/Consts'),
|
Consts = require('Common/Consts'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -79,7 +79,7 @@
|
||||||
Data.foldersCreating(false);
|
Data.foldersCreating(false);
|
||||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||||
{
|
{
|
||||||
require('App/App').folders();
|
require('App/User').folders();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
|
||||||
|
|
@ -12,8 +12,8 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -83,7 +83,7 @@
|
||||||
{
|
{
|
||||||
if (oData.Result)
|
if (oData.Result)
|
||||||
{
|
{
|
||||||
require('App/App').accountsAndIdentities();
|
require('App/User').accountsAndIdentities();
|
||||||
this.cancelCommand();
|
this.cancelCommand();
|
||||||
}
|
}
|
||||||
else if (oData.ErrorCode)
|
else if (oData.ErrorCode)
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
|
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -74,7 +74,7 @@
|
||||||
oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored);
|
oOpenpgpKeyring.publicKeys.importKey(mKeyPair.publicKeyArmored);
|
||||||
oOpenpgpKeyring.store();
|
oOpenpgpKeyring.store();
|
||||||
|
|
||||||
require('App/App').reloadOpenPgpKeys();
|
require('App/User').reloadOpenPgpKeys();
|
||||||
Utils.delegateRun(self, 'cancelCommand');
|
Utils.delegateRun(self, 'cancelCommand');
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,7 @@
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
|
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function AboutAppView()
|
function AboutUserView()
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Center', 'About');
|
AbstractView.call(this, 'Center', 'About');
|
||||||
|
|
||||||
|
|
@ -26,9 +26,9 @@
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/About', 'AboutViewModel'], AboutAppView);
|
kn.extendAsViewModel(['View/User/About', 'View/App/About', 'AboutViewModel'], AboutUserView);
|
||||||
_.extend(AboutAppView.prototype, AbstractView.prototype);
|
_.extend(AboutUserView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
module.exports = AboutAppView;
|
module.exports = AboutUserView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
;
|
;
|
||||||
|
|
@ -23,7 +23,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function AbstractSystemDropDownAppView()
|
function AbstractSystemDropDownUserView()
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Right', 'SystemDropDown');
|
AbstractView.call(this, 'Right', 'SystemDropDown');
|
||||||
|
|
||||||
|
|
@ -42,9 +42,9 @@
|
||||||
this.accountClick = _.bind(this.accountClick, this);
|
this.accountClick = _.bind(this.accountClick, this);
|
||||||
}
|
}
|
||||||
|
|
||||||
_.extend(AbstractSystemDropDownAppView.prototype, AbstractView.prototype);
|
_.extend(AbstractSystemDropDownUserView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
AbstractSystemDropDownAppView.prototype.accountClick = function (oAccount, oEvent)
|
AbstractSystemDropDownUserView.prototype.accountClick = function (oAccount, oEvent)
|
||||||
{
|
{
|
||||||
if (oAccount && oEvent && !Utils.isUnd(oEvent.which) && 1 === oEvent.which)
|
if (oAccount && oEvent && !Utils.isUnd(oEvent.which) && 1 === oEvent.which)
|
||||||
{
|
{
|
||||||
|
|
@ -58,22 +58,22 @@
|
||||||
return true;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
AbstractSystemDropDownAppView.prototype.emailTitle = function ()
|
AbstractSystemDropDownUserView.prototype.emailTitle = function ()
|
||||||
{
|
{
|
||||||
return Data.accountEmail();
|
return Data.accountEmail();
|
||||||
};
|
};
|
||||||
|
|
||||||
AbstractSystemDropDownAppView.prototype.settingsClick = function ()
|
AbstractSystemDropDownUserView.prototype.settingsClick = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').setHash(Links.settings());
|
require('Knoin/Knoin').setHash(Links.settings());
|
||||||
};
|
};
|
||||||
|
|
||||||
AbstractSystemDropDownAppView.prototype.settingsHelp = function ()
|
AbstractSystemDropDownUserView.prototype.settingsHelp = function ()
|
||||||
{
|
{
|
||||||
require('Knoin/Knoin').showScreenPopup(require('View/Popup/KeyboardShortcutsHelp'));
|
require('Knoin/Knoin').showScreenPopup(require('View/Popup/KeyboardShortcutsHelp'));
|
||||||
};
|
};
|
||||||
|
|
||||||
AbstractSystemDropDownAppView.prototype.addAccountClick = function ()
|
AbstractSystemDropDownUserView.prototype.addAccountClick = function ()
|
||||||
{
|
{
|
||||||
if (this.capaAdditionalAccounts())
|
if (this.capaAdditionalAccounts())
|
||||||
{
|
{
|
||||||
|
|
@ -81,15 +81,15 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
AbstractSystemDropDownAppView.prototype.logoutClick = function ()
|
AbstractSystemDropDownUserView.prototype.logoutClick = function ()
|
||||||
{
|
{
|
||||||
Remote.logout(function () {
|
Remote.logout(function () {
|
||||||
require('App/App').loginAndLogoutReload(true,
|
require('App/User').loginAndLogoutReload(true,
|
||||||
Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length);
|
Settings.settingsGet('ParentEmail') && 0 < Settings.settingsGet('ParentEmail').length);
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
AbstractSystemDropDownAppView.prototype.onBuild = function ()
|
AbstractSystemDropDownUserView.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
key('`', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () {
|
key('`', [Enums.KeyState.MessageList, Enums.KeyState.MessageView, Enums.KeyState.Settings], function () {
|
||||||
|
|
@ -109,6 +109,6 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = AbstractSystemDropDownAppView;
|
module.exports = AbstractSystemDropDownUserView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -14,8 +14,8 @@
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -25,7 +25,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function LoginAppView()
|
function LoginUserView()
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Center', 'Login');
|
AbstractView.call(this, 'Center', 'Login');
|
||||||
|
|
||||||
|
|
@ -130,11 +130,11 @@
|
||||||
}
|
}
|
||||||
else if (oData.Admin)
|
else if (oData.Admin)
|
||||||
{
|
{
|
||||||
require('App/App').redirectToAdminPanel();
|
require('App/User').redirectToAdminPanel();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
require('App/App').loginAndLogoutReload();
|
require('App/User').loginAndLogoutReload();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (oData.ErrorCode)
|
else if (oData.ErrorCode)
|
||||||
|
|
@ -234,10 +234,10 @@
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/Login', 'LoginViewModel'], LoginAppView);
|
kn.extendAsViewModel(['View/User/Login', 'View/App/Login', 'LoginViewModel'], LoginUserView);
|
||||||
_.extend(LoginAppView.prototype, AbstractView.prototype);
|
_.extend(LoginUserView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
LoginAppView.prototype.onShow = function ()
|
LoginUserView.prototype.onShow = function ()
|
||||||
{
|
{
|
||||||
kn.routeOff();
|
kn.routeOff();
|
||||||
|
|
||||||
|
|
@ -259,13 +259,13 @@
|
||||||
}, this), 100);
|
}, this), 100);
|
||||||
};
|
};
|
||||||
|
|
||||||
LoginAppView.prototype.onHide = function ()
|
LoginUserView.prototype.onHide = function ()
|
||||||
{
|
{
|
||||||
this.submitFocus(false);
|
this.submitFocus(false);
|
||||||
this.emailFocus(false);
|
this.emailFocus(false);
|
||||||
};
|
};
|
||||||
|
|
||||||
LoginAppView.prototype.onBuild = function ()
|
LoginUserView.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
self = this,
|
self = this,
|
||||||
|
|
@ -275,7 +275,7 @@
|
||||||
if (0 === iErrorCode)
|
if (0 === iErrorCode)
|
||||||
{
|
{
|
||||||
self.submitRequest(true);
|
self.submitRequest(true);
|
||||||
require('App/App').loginAndLogoutReload();
|
require('App/User').loginAndLogoutReload();
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
|
|
@ -338,16 +338,16 @@
|
||||||
Utils.triggerAutocompleteInputChange(true);
|
Utils.triggerAutocompleteInputChange(true);
|
||||||
};
|
};
|
||||||
|
|
||||||
LoginAppView.prototype.submitForm = function ()
|
LoginUserView.prototype.submitForm = function ()
|
||||||
{
|
{
|
||||||
this.submitCommand();
|
this.submitCommand();
|
||||||
};
|
};
|
||||||
|
|
||||||
LoginAppView.prototype.selectLanguage = function ()
|
LoginUserView.prototype.selectLanguage = function ()
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/Languages'));
|
kn.showScreenPopup(require('View/Popup/Languages'));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = LoginAppView;
|
module.exports = LoginUserView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -16,8 +16,8 @@
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function FolderListMailBoxAppView()
|
function FolderListMailBoxUserView()
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Left', 'MailFolderList');
|
AbstractView.call(this, 'Left', 'MailFolderList');
|
||||||
|
|
||||||
|
|
@ -48,10 +48,10 @@
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/MailBox/FolderList', 'MailBoxFolderListViewModel'], FolderListMailBoxAppView);
|
kn.extendAsViewModel(['View/User/MailBox/FolderList', 'View/App/MailBox/FolderList', 'MailBoxFolderListViewModel'], FolderListMailBoxUserView);
|
||||||
_.extend(FolderListMailBoxAppView.prototype, AbstractView.prototype);
|
_.extend(FolderListMailBoxUserView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
FolderListMailBoxAppView.prototype.onBuild = function (oDom)
|
FolderListMailBoxUserView.prototype.onBuild = function (oDom)
|
||||||
{
|
{
|
||||||
this.oContentVisible = $('.b-content', oDom);
|
this.oContentVisible = $('.b-content', oDom);
|
||||||
this.oContentScrollable = $('.content', this.oContentVisible);
|
this.oContentScrollable = $('.content', this.oContentVisible);
|
||||||
|
|
@ -69,7 +69,7 @@
|
||||||
if (oFolder && oEvent)
|
if (oFolder && oEvent)
|
||||||
{
|
{
|
||||||
bCollapsed = oFolder.collapsed();
|
bCollapsed = oFolder.collapsed();
|
||||||
require('App/App').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
require('App/User').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
||||||
|
|
||||||
oFolder.collapsed(!bCollapsed);
|
oFolder.collapsed(!bCollapsed);
|
||||||
oEvent.preventDefault();
|
oEvent.preventDefault();
|
||||||
|
|
@ -152,7 +152,7 @@
|
||||||
if (oFolder)
|
if (oFolder)
|
||||||
{
|
{
|
||||||
bCollapsed = oFolder.collapsed();
|
bCollapsed = oFolder.collapsed();
|
||||||
require('App/App').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
require('App/User').setExpandedFolder(oFolder.fullNameHash, bCollapsed);
|
||||||
oFolder.collapsed(!bCollapsed);
|
oFolder.collapsed(!bCollapsed);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -174,25 +174,25 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
FolderListMailBoxAppView.prototype.messagesDropOver = function (oFolder)
|
FolderListMailBoxUserView.prototype.messagesDropOver = function (oFolder)
|
||||||
{
|
{
|
||||||
window.clearTimeout(this.iDropOverTimer);
|
window.clearTimeout(this.iDropOverTimer);
|
||||||
if (oFolder && oFolder.collapsed())
|
if (oFolder && oFolder.collapsed())
|
||||||
{
|
{
|
||||||
this.iDropOverTimer = window.setTimeout(function () {
|
this.iDropOverTimer = window.setTimeout(function () {
|
||||||
oFolder.collapsed(false);
|
oFolder.collapsed(false);
|
||||||
require('App/App').setExpandedFolder(oFolder.fullNameHash, true);
|
require('App/User').setExpandedFolder(oFolder.fullNameHash, true);
|
||||||
Utils.windowResize();
|
Utils.windowResize();
|
||||||
}, 500);
|
}, 500);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FolderListMailBoxAppView.prototype.messagesDropOut = function ()
|
FolderListMailBoxUserView.prototype.messagesDropOut = function ()
|
||||||
{
|
{
|
||||||
window.clearTimeout(this.iDropOverTimer);
|
window.clearTimeout(this.iDropOverTimer);
|
||||||
};
|
};
|
||||||
|
|
||||||
FolderListMailBoxAppView.prototype.scrollToFocused = function ()
|
FolderListMailBoxUserView.prototype.scrollToFocused = function ()
|
||||||
{
|
{
|
||||||
if (!this.oContentVisible || !this.oContentScrollable)
|
if (!this.oContentVisible || !this.oContentScrollable)
|
||||||
{
|
{
|
||||||
|
|
@ -229,7 +229,7 @@
|
||||||
* @param {FolderModel} oToFolder
|
* @param {FolderModel} oToFolder
|
||||||
* @param {{helper:jQuery}} oUi
|
* @param {{helper:jQuery}} oUi
|
||||||
*/
|
*/
|
||||||
FolderListMailBoxAppView.prototype.messagesDrop = function (oToFolder, oUi)
|
FolderListMailBoxUserView.prototype.messagesDrop = function (oToFolder, oUi)
|
||||||
{
|
{
|
||||||
if (oToFolder && oUi && oUi.helper)
|
if (oToFolder && oUi && oUi.helper)
|
||||||
{
|
{
|
||||||
|
|
@ -241,27 +241,27 @@
|
||||||
|
|
||||||
if (Utils.isNormal(sFromFolderFullNameRaw) && '' !== sFromFolderFullNameRaw && Utils.isArray(aUids))
|
if (Utils.isNormal(sFromFolderFullNameRaw) && '' !== sFromFolderFullNameRaw && Utils.isArray(aUids))
|
||||||
{
|
{
|
||||||
require('App/App').moveMessagesToFolder(sFromFolderFullNameRaw, aUids, oToFolder.fullNameRaw, bCopy);
|
require('App/User').moveMessagesToFolder(sFromFolderFullNameRaw, aUids, oToFolder.fullNameRaw, bCopy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
FolderListMailBoxAppView.prototype.composeClick = function ()
|
FolderListMailBoxUserView.prototype.composeClick = function ()
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/Compose'));
|
kn.showScreenPopup(require('View/Popup/Compose'));
|
||||||
};
|
};
|
||||||
|
|
||||||
FolderListMailBoxAppView.prototype.createFolder = function ()
|
FolderListMailBoxUserView.prototype.createFolder = function ()
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/FolderCreate'));
|
kn.showScreenPopup(require('View/Popup/FolderCreate'));
|
||||||
};
|
};
|
||||||
|
|
||||||
FolderListMailBoxAppView.prototype.configureFolders = function ()
|
FolderListMailBoxUserView.prototype.configureFolders = function ()
|
||||||
{
|
{
|
||||||
kn.setHash(Links.settings('folders'));
|
kn.setHash(Links.settings('folders'));
|
||||||
};
|
};
|
||||||
|
|
||||||
FolderListMailBoxAppView.prototype.contactsClick = function ()
|
FolderListMailBoxUserView.prototype.contactsClick = function ()
|
||||||
{
|
{
|
||||||
if (this.allowContacts)
|
if (this.allowContacts)
|
||||||
{
|
{
|
||||||
|
|
@ -269,6 +269,6 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = FolderListMailBoxAppView;
|
module.exports = FolderListMailBoxUserView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -20,9 +20,9 @@
|
||||||
Selector = require('Common/Selector'),
|
Selector = require('Common/Selector'),
|
||||||
|
|
||||||
Settings = require('Storage/Settings'),
|
Settings = require('Storage/Settings'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -32,7 +32,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function MessageListMailBoxAppView()
|
function MessageListMailBoxUserView()
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Right', 'MailMessageList');
|
AbstractView.call(this, 'Right', 'MailMessageList');
|
||||||
|
|
||||||
|
|
@ -177,31 +177,31 @@
|
||||||
}, this.canBeMoved);
|
}, this.canBeMoved);
|
||||||
|
|
||||||
this.deleteWithoutMoveCommand = Utils.createCommand(this, function () {
|
this.deleteWithoutMoveCommand = Utils.createCommand(this, function () {
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||||
Data.currentFolderFullNameRaw(),
|
Data.currentFolderFullNameRaw(),
|
||||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), false);
|
Data.messageListCheckedOrSelectedUidsWithSubMails(), false);
|
||||||
}, this.canBeMoved);
|
}, this.canBeMoved);
|
||||||
|
|
||||||
this.deleteCommand = Utils.createCommand(this, function () {
|
this.deleteCommand = Utils.createCommand(this, function () {
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||||
Data.currentFolderFullNameRaw(),
|
Data.currentFolderFullNameRaw(),
|
||||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
||||||
}, this.canBeMoved);
|
}, this.canBeMoved);
|
||||||
|
|
||||||
this.archiveCommand = Utils.createCommand(this, function () {
|
this.archiveCommand = Utils.createCommand(this, function () {
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Archive,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.Archive,
|
||||||
Data.currentFolderFullNameRaw(),
|
Data.currentFolderFullNameRaw(),
|
||||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
||||||
}, this.canBeMoved);
|
}, this.canBeMoved);
|
||||||
|
|
||||||
this.spamCommand = Utils.createCommand(this, function () {
|
this.spamCommand = Utils.createCommand(this, function () {
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Spam,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.Spam,
|
||||||
Data.currentFolderFullNameRaw(),
|
Data.currentFolderFullNameRaw(),
|
||||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
||||||
}, this.canBeMoved);
|
}, this.canBeMoved);
|
||||||
|
|
||||||
this.notSpamCommand = Utils.createCommand(this, function () {
|
this.notSpamCommand = Utils.createCommand(this, function () {
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
|
||||||
Data.currentFolderFullNameRaw(),
|
Data.currentFolderFullNameRaw(),
|
||||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
Data.messageListCheckedOrSelectedUidsWithSubMails(), true);
|
||||||
}, this.canBeMoved);
|
}, this.canBeMoved);
|
||||||
|
|
@ -211,7 +211,7 @@
|
||||||
this.reloadCommand = Utils.createCommand(this, function () {
|
this.reloadCommand = Utils.createCommand(this, function () {
|
||||||
if (!Data.messageListCompleteLoadingThrottle())
|
if (!Data.messageListCompleteLoadingThrottle())
|
||||||
{
|
{
|
||||||
require('App/App').reloadMessageList(false, true);
|
require('App/User').reloadMessageList(false, true);
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
@ -265,15 +265,15 @@
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/MailBox/MessageList', 'MailBoxMessageListViewModel'], MessageListMailBoxAppView);
|
kn.extendAsViewModel(['View/User/MailBox/MessageList', 'View/App/MailBox/MessageList', 'MailBoxMessageListViewModel'], MessageListMailBoxUserView);
|
||||||
_.extend(MessageListMailBoxAppView.prototype, AbstractView.prototype);
|
_.extend(MessageListMailBoxUserView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @type {string}
|
* @type {string}
|
||||||
*/
|
*/
|
||||||
MessageListMailBoxAppView.prototype.emptySubjectValue = '';
|
MessageListMailBoxUserView.prototype.emptySubjectValue = '';
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.searchEnterAction = function ()
|
MessageListMailBoxUserView.prototype.searchEnterAction = function ()
|
||||||
{
|
{
|
||||||
this.mainMessageListSearch(this.sLastSearchValue);
|
this.mainMessageListSearch(this.sLastSearchValue);
|
||||||
this.inputMessageListSearchFocus(false);
|
this.inputMessageListSearchFocus(false);
|
||||||
|
|
@ -282,13 +282,13 @@
|
||||||
/**
|
/**
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
MessageListMailBoxAppView.prototype.printableMessageCountForDeletion = function ()
|
MessageListMailBoxUserView.prototype.printableMessageCountForDeletion = function ()
|
||||||
{
|
{
|
||||||
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
|
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
|
||||||
return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : '';
|
return 1 < iCnt ? ' (' + (100 > iCnt ? iCnt : '99+') + ')' : '';
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.cancelSearch = function ()
|
MessageListMailBoxUserView.prototype.cancelSearch = function ()
|
||||||
{
|
{
|
||||||
this.mainMessageListSearch('');
|
this.mainMessageListSearch('');
|
||||||
this.inputMessageListSearchFocus(false);
|
this.inputMessageListSearchFocus(false);
|
||||||
|
|
@ -299,11 +299,11 @@
|
||||||
* @param {boolean} bCopy
|
* @param {boolean} bCopy
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageListMailBoxAppView.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy)
|
MessageListMailBoxUserView.prototype.moveSelectedMessagesToFolder = function (sToFolderFullNameRaw, bCopy)
|
||||||
{
|
{
|
||||||
if (this.canBeMoved())
|
if (this.canBeMoved())
|
||||||
{
|
{
|
||||||
require('App/App').moveMessagesToFolder(
|
require('App/User').moveMessagesToFolder(
|
||||||
Data.currentFolderFullNameRaw(),
|
Data.currentFolderFullNameRaw(),
|
||||||
Data.messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy);
|
Data.messageListCheckedOrSelectedUidsWithSubMails(), sToFolderFullNameRaw, bCopy);
|
||||||
}
|
}
|
||||||
|
|
@ -311,7 +311,7 @@
|
||||||
return false;
|
return false;
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.dragAndDronHelper = function (oMessageListItem)
|
MessageListMailBoxUserView.prototype.dragAndDronHelper = function (oMessageListItem)
|
||||||
{
|
{
|
||||||
if (oMessageListItem)
|
if (oMessageListItem)
|
||||||
{
|
{
|
||||||
|
|
@ -342,7 +342,7 @@
|
||||||
* @param {AjaxJsonDefaultResponse} oData
|
* @param {AjaxJsonDefaultResponse} oData
|
||||||
* @param {boolean} bCached
|
* @param {boolean} bCached
|
||||||
*/
|
*/
|
||||||
MessageListMailBoxAppView.prototype.onMessageResponse = function (sResult, oData, bCached)
|
MessageListMailBoxUserView.prototype.onMessageResponse = function (sResult, oData, bCached)
|
||||||
{
|
{
|
||||||
Data.hideMessageBodies();
|
Data.hideMessageBodies();
|
||||||
Data.messageLoading(false);
|
Data.messageLoading(false);
|
||||||
|
|
@ -365,7 +365,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.populateMessageBody = function (oMessage)
|
MessageListMailBoxUserView.prototype.populateMessageBody = function (oMessage)
|
||||||
{
|
{
|
||||||
if (oMessage)
|
if (oMessage)
|
||||||
{
|
{
|
||||||
|
|
@ -385,7 +385,7 @@
|
||||||
* @param {number} iSetAction
|
* @param {number} iSetAction
|
||||||
* @param {Array=} aMessages = null
|
* @param {Array=} aMessages = null
|
||||||
*/
|
*/
|
||||||
MessageListMailBoxAppView.prototype.setAction = function (sFolderFullNameRaw, iSetAction, aMessages)
|
MessageListMailBoxUserView.prototype.setAction = function (sFolderFullNameRaw, iSetAction, aMessages)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
aUids = [],
|
aUids = [],
|
||||||
|
|
@ -458,7 +458,7 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -466,7 +466,7 @@
|
||||||
* @param {string} sFolderFullNameRaw
|
* @param {string} sFolderFullNameRaw
|
||||||
* @param {number} iSetAction
|
* @param {number} iSetAction
|
||||||
*/
|
*/
|
||||||
MessageListMailBoxAppView.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction)
|
MessageListMailBoxUserView.prototype.setActionForAll = function (sFolderFullNameRaw, iSetAction)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
oFolder = null,
|
oFolder = null,
|
||||||
|
|
@ -509,37 +509,37 @@
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.listSetSeen = function ()
|
MessageListMailBoxUserView.prototype.listSetSeen = function ()
|
||||||
{
|
{
|
||||||
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen, Data.messageListCheckedOrSelected());
|
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen, Data.messageListCheckedOrSelected());
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.listSetAllSeen = function ()
|
MessageListMailBoxUserView.prototype.listSetAllSeen = function ()
|
||||||
{
|
{
|
||||||
this.setActionForAll(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen);
|
this.setActionForAll(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetSeen);
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.listUnsetSeen = function ()
|
MessageListMailBoxUserView.prototype.listUnsetSeen = function ()
|
||||||
{
|
{
|
||||||
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetSeen, Data.messageListCheckedOrSelected());
|
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetSeen, Data.messageListCheckedOrSelected());
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.listSetFlags = function ()
|
MessageListMailBoxUserView.prototype.listSetFlags = function ()
|
||||||
{
|
{
|
||||||
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetFlag, Data.messageListCheckedOrSelected());
|
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.SetFlag, Data.messageListCheckedOrSelected());
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.listUnsetFlags = function ()
|
MessageListMailBoxUserView.prototype.listUnsetFlags = function ()
|
||||||
{
|
{
|
||||||
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetFlag, Data.messageListCheckedOrSelected());
|
this.setAction(Data.currentFolderFullNameRaw(), Enums.MessageSetAction.UnsetFlag, Data.messageListCheckedOrSelected());
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.flagMessages = function (oCurrentMessage)
|
MessageListMailBoxUserView.prototype.flagMessages = function (oCurrentMessage)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
aChecked = this.messageListCheckedOrSelected(),
|
aChecked = this.messageListCheckedOrSelected(),
|
||||||
|
|
@ -568,7 +568,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.flagMessagesFast = function (bFlag)
|
MessageListMailBoxUserView.prototype.flagMessagesFast = function (bFlag)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
aChecked = this.messageListCheckedOrSelected(),
|
aChecked = this.messageListCheckedOrSelected(),
|
||||||
|
|
@ -594,7 +594,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.seenMessagesFast = function (bSeen)
|
MessageListMailBoxUserView.prototype.seenMessagesFast = function (bSeen)
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
aChecked = this.messageListCheckedOrSelected(),
|
aChecked = this.messageListCheckedOrSelected(),
|
||||||
|
|
@ -620,7 +620,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.onBuild = function (oDom)
|
MessageListMailBoxUserView.prototype.onBuild = function (oDom)
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
@ -653,7 +653,7 @@
|
||||||
oMessage.lastInCollapsedThreadLoading(true);
|
oMessage.lastInCollapsedThreadLoading(true);
|
||||||
oMessage.lastInCollapsedThread(!oMessage.lastInCollapsedThread());
|
oMessage.lastInCollapsedThread(!oMessage.lastInCollapsedThread());
|
||||||
|
|
||||||
require('App/App').reloadMessageList();
|
require('App/User').reloadMessageList();
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|
@ -700,7 +700,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.initShortcuts = function ()
|
MessageListMailBoxUserView.prototype.initShortcuts = function ()
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
|
|
||||||
|
|
@ -822,7 +822,7 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.prefetchNextTick = function ()
|
MessageListMailBoxUserView.prototype.prefetchNextTick = function ()
|
||||||
{
|
{
|
||||||
if (ifvisible && !this.bPrefetch && !ifvisible.now() && this.viewModelVisibility())
|
if (ifvisible && !this.bPrefetch && !ifvisible.now() && this.viewModelVisibility())
|
||||||
{
|
{
|
||||||
|
|
@ -857,17 +857,17 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.composeClick = function ()
|
MessageListMailBoxUserView.prototype.composeClick = function ()
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/Compose'));
|
kn.showScreenPopup(require('View/Popup/Compose'));
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.advancedSearchClick = function ()
|
MessageListMailBoxUserView.prototype.advancedSearchClick = function ()
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/AdvancedSearch'));
|
kn.showScreenPopup(require('View/Popup/AdvancedSearch'));
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.quotaTooltip = function ()
|
MessageListMailBoxUserView.prototype.quotaTooltip = function ()
|
||||||
{
|
{
|
||||||
return Utils.i18n('MESSAGE_LIST/QUOTA_SIZE', {
|
return Utils.i18n('MESSAGE_LIST/QUOTA_SIZE', {
|
||||||
'SIZE': Utils.friendlySize(this.userUsageSize()),
|
'SIZE': Utils.friendlySize(this.userUsageSize()),
|
||||||
|
|
@ -876,7 +876,7 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageListMailBoxAppView.prototype.initUploaderForAppend = function ()
|
MessageListMailBoxUserView.prototype.initUploaderForAppend = function ()
|
||||||
{
|
{
|
||||||
if (!Settings.settingsGet('AllowAppendMessage') || !this.dragOverArea())
|
if (!Settings.settingsGet('AllowAppendMessage') || !this.dragOverArea())
|
||||||
{
|
{
|
||||||
|
|
@ -923,13 +923,13 @@
|
||||||
return false;
|
return false;
|
||||||
}, this))
|
}, this))
|
||||||
.on('onComplete', _.bind(function () {
|
.on('onComplete', _.bind(function () {
|
||||||
require('App/App').reloadMessageList(true, true);
|
require('App/User').reloadMessageList(true, true);
|
||||||
}, this))
|
}, this))
|
||||||
;
|
;
|
||||||
|
|
||||||
return !!oJua;
|
return !!oJua;
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = MessageListMailBoxAppView;
|
module.exports = MessageListMailBoxUserView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -15,9 +15,9 @@
|
||||||
Utils = require('Common/Utils'),
|
Utils = require('Common/Utils'),
|
||||||
Events = require('Common/Events'),
|
Events = require('Common/Events'),
|
||||||
|
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Remote = require('Storage/App/Remote'),
|
Remote = require('Storage/User/Remote'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -27,7 +27,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function MessageViewMailBoxAppView()
|
function MessageViewMailBoxUserView()
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Right', 'MailMessageView');
|
AbstractView.call(this, 'Right', 'MailMessageView');
|
||||||
|
|
||||||
|
|
@ -98,7 +98,7 @@
|
||||||
this.deleteCommand = Utils.createCommand(this, function () {
|
this.deleteCommand = Utils.createCommand(this, function () {
|
||||||
if (this.message())
|
if (this.message())
|
||||||
{
|
{
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||||
this.message().folderFullNameRaw,
|
this.message().folderFullNameRaw,
|
||||||
[this.message().uid], true);
|
[this.message().uid], true);
|
||||||
}
|
}
|
||||||
|
|
@ -107,7 +107,7 @@
|
||||||
this.deleteWithoutMoveCommand = Utils.createCommand(this, function () {
|
this.deleteWithoutMoveCommand = Utils.createCommand(this, function () {
|
||||||
if (this.message())
|
if (this.message())
|
||||||
{
|
{
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.Trash,
|
||||||
Data.currentFolderFullNameRaw(),
|
Data.currentFolderFullNameRaw(),
|
||||||
[this.message().uid], false);
|
[this.message().uid], false);
|
||||||
}
|
}
|
||||||
|
|
@ -116,7 +116,7 @@
|
||||||
this.archiveCommand = Utils.createCommand(this, function () {
|
this.archiveCommand = Utils.createCommand(this, function () {
|
||||||
if (this.message())
|
if (this.message())
|
||||||
{
|
{
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Archive,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.Archive,
|
||||||
this.message().folderFullNameRaw,
|
this.message().folderFullNameRaw,
|
||||||
[this.message().uid], true);
|
[this.message().uid], true);
|
||||||
}
|
}
|
||||||
|
|
@ -125,7 +125,7 @@
|
||||||
this.spamCommand = Utils.createCommand(this, function () {
|
this.spamCommand = Utils.createCommand(this, function () {
|
||||||
if (this.message())
|
if (this.message())
|
||||||
{
|
{
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.Spam,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.Spam,
|
||||||
this.message().folderFullNameRaw,
|
this.message().folderFullNameRaw,
|
||||||
[this.message().uid], true);
|
[this.message().uid], true);
|
||||||
}
|
}
|
||||||
|
|
@ -134,7 +134,7 @@
|
||||||
this.notSpamCommand = Utils.createCommand(this, function () {
|
this.notSpamCommand = Utils.createCommand(this, function () {
|
||||||
if (this.message())
|
if (this.message())
|
||||||
{
|
{
|
||||||
require('App/App').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
|
require('App/User').deleteMessagesFromFolder(Enums.FolderType.NotSpam,
|
||||||
this.message().folderFullNameRaw,
|
this.message().folderFullNameRaw,
|
||||||
[this.message().uid], true);
|
[this.message().uid], true);
|
||||||
}
|
}
|
||||||
|
|
@ -248,25 +248,25 @@
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/MailBox/MessageView', 'MailBoxMessageViewViewModel'], MessageViewMailBoxAppView);
|
kn.extendAsViewModel(['View/User/MailBox/MessageView', 'View/App/MailBox/MessageView', 'MailBoxMessageViewViewModel'], MessageViewMailBoxUserView);
|
||||||
_.extend(MessageViewMailBoxAppView.prototype, AbstractView.prototype);
|
_.extend(MessageViewMailBoxUserView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.isPgpActionVisible = function ()
|
MessageViewMailBoxUserView.prototype.isPgpActionVisible = function ()
|
||||||
{
|
{
|
||||||
return Enums.SignedVerifyStatus.Success !== this.viewPgpSignedVerifyStatus();
|
return Enums.SignedVerifyStatus.Success !== this.viewPgpSignedVerifyStatus();
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.isPgpStatusVerifyVisible = function ()
|
MessageViewMailBoxUserView.prototype.isPgpStatusVerifyVisible = function ()
|
||||||
{
|
{
|
||||||
return Enums.SignedVerifyStatus.None !== this.viewPgpSignedVerifyStatus();
|
return Enums.SignedVerifyStatus.None !== this.viewPgpSignedVerifyStatus();
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.isPgpStatusVerifySuccess = function ()
|
MessageViewMailBoxUserView.prototype.isPgpStatusVerifySuccess = function ()
|
||||||
{
|
{
|
||||||
return Enums.SignedVerifyStatus.Success === this.viewPgpSignedVerifyStatus();
|
return Enums.SignedVerifyStatus.Success === this.viewPgpSignedVerifyStatus();
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.pgpStatusVerifyMessage = function ()
|
MessageViewMailBoxUserView.prototype.pgpStatusVerifyMessage = function ()
|
||||||
{
|
{
|
||||||
var sResult = '';
|
var sResult = '';
|
||||||
switch (this.viewPgpSignedVerifyStatus())
|
switch (this.viewPgpSignedVerifyStatus())
|
||||||
|
|
@ -293,19 +293,19 @@
|
||||||
return sResult;
|
return sResult;
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.fullScreen = function ()
|
MessageViewMailBoxUserView.prototype.fullScreen = function ()
|
||||||
{
|
{
|
||||||
this.fullScreenMode(true);
|
this.fullScreenMode(true);
|
||||||
Utils.windowResize();
|
Utils.windowResize();
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.unFullScreen = function ()
|
MessageViewMailBoxUserView.prototype.unFullScreen = function ()
|
||||||
{
|
{
|
||||||
this.fullScreenMode(false);
|
this.fullScreenMode(false);
|
||||||
Utils.windowResize();
|
Utils.windowResize();
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.toggleFullScreen = function ()
|
MessageViewMailBoxUserView.prototype.toggleFullScreen = function ()
|
||||||
{
|
{
|
||||||
Utils.removeSelection();
|
Utils.removeSelection();
|
||||||
|
|
||||||
|
|
@ -316,12 +316,12 @@
|
||||||
/**
|
/**
|
||||||
* @param {string} sType
|
* @param {string} sType
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.replyOrforward = function (sType)
|
MessageViewMailBoxUserView.prototype.replyOrforward = function (sType)
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/Compose'), [sType, Data.message()]);
|
kn.showScreenPopup(require('View/Popup/Compose'), [sType, Data.message()]);
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.onBuild = function (oDom)
|
MessageViewMailBoxUserView.prototype.onBuild = function (oDom)
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
this.fullScreenMode.subscribe(function (bValue) {
|
this.fullScreenMode.subscribe(function (bValue) {
|
||||||
|
|
@ -370,7 +370,7 @@
|
||||||
|
|
||||||
if (oAttachment && oAttachment.download)
|
if (oAttachment && oAttachment.download)
|
||||||
{
|
{
|
||||||
require('App/App').download(oAttachment.linkDownload());
|
require('App/User').download(oAttachment.linkDownload());
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
;
|
;
|
||||||
|
|
@ -408,7 +408,7 @@
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.escShortcuts = function ()
|
MessageViewMailBoxUserView.prototype.escShortcuts = function ()
|
||||||
{
|
{
|
||||||
if (this.viewModelVisibility() && this.message())
|
if (this.viewModelVisibility() && this.message())
|
||||||
{
|
{
|
||||||
|
|
@ -429,7 +429,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.initShortcuts = function ()
|
MessageViewMailBoxUserView.prototype.initShortcuts = function ()
|
||||||
{
|
{
|
||||||
var
|
var
|
||||||
self = this
|
self = this
|
||||||
|
|
@ -570,7 +570,7 @@
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.isDraftFolder = function ()
|
MessageViewMailBoxUserView.prototype.isDraftFolder = function ()
|
||||||
{
|
{
|
||||||
return Data.message() && Data.draftFolder() === Data.message().folderFullNameRaw;
|
return Data.message() && Data.draftFolder() === Data.message().folderFullNameRaw;
|
||||||
};
|
};
|
||||||
|
|
@ -578,7 +578,7 @@
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.isSentFolder = function ()
|
MessageViewMailBoxUserView.prototype.isSentFolder = function ()
|
||||||
{
|
{
|
||||||
return Data.message() && Data.sentFolder() === Data.message().folderFullNameRaw;
|
return Data.message() && Data.sentFolder() === Data.message().folderFullNameRaw;
|
||||||
};
|
};
|
||||||
|
|
@ -586,7 +586,7 @@
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.isSpamFolder = function ()
|
MessageViewMailBoxUserView.prototype.isSpamFolder = function ()
|
||||||
{
|
{
|
||||||
return Data.message() && Data.spamFolder() === Data.message().folderFullNameRaw;
|
return Data.message() && Data.spamFolder() === Data.message().folderFullNameRaw;
|
||||||
};
|
};
|
||||||
|
|
@ -594,7 +594,7 @@
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.isSpamDisabled = function ()
|
MessageViewMailBoxUserView.prototype.isSpamDisabled = function ()
|
||||||
{
|
{
|
||||||
return Data.message() && Data.spamFolder() === Consts.Values.UnuseOptionValue;
|
return Data.message() && Data.spamFolder() === Consts.Values.UnuseOptionValue;
|
||||||
};
|
};
|
||||||
|
|
@ -602,7 +602,7 @@
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.isArchiveFolder = function ()
|
MessageViewMailBoxUserView.prototype.isArchiveFolder = function ()
|
||||||
{
|
{
|
||||||
return Data.message() && Data.archiveFolder() === Data.message().folderFullNameRaw;
|
return Data.message() && Data.archiveFolder() === Data.message().folderFullNameRaw;
|
||||||
};
|
};
|
||||||
|
|
@ -610,7 +610,7 @@
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.isArchiveDisabled = function ()
|
MessageViewMailBoxUserView.prototype.isArchiveDisabled = function ()
|
||||||
{
|
{
|
||||||
return Data.message() && Data.archiveFolder() === Consts.Values.UnuseOptionValue;
|
return Data.message() && Data.archiveFolder() === Consts.Values.UnuseOptionValue;
|
||||||
};
|
};
|
||||||
|
|
@ -618,17 +618,17 @@
|
||||||
/**
|
/**
|
||||||
* @return {boolean}
|
* @return {boolean}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.isDraftOrSentFolder = function ()
|
MessageViewMailBoxUserView.prototype.isDraftOrSentFolder = function ()
|
||||||
{
|
{
|
||||||
return this.isDraftFolder() || this.isSentFolder();
|
return this.isDraftFolder() || this.isSentFolder();
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.composeClick = function ()
|
MessageViewMailBoxUserView.prototype.composeClick = function ()
|
||||||
{
|
{
|
||||||
kn.showScreenPopup(require('View/Popup/Compose'));
|
kn.showScreenPopup(require('View/Popup/Compose'));
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.editMessage = function ()
|
MessageViewMailBoxUserView.prototype.editMessage = function ()
|
||||||
{
|
{
|
||||||
if (Data.message())
|
if (Data.message())
|
||||||
{
|
{
|
||||||
|
|
@ -636,7 +636,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.scrollMessageToTop = function ()
|
MessageViewMailBoxUserView.prototype.scrollMessageToTop = function ()
|
||||||
{
|
{
|
||||||
if (this.oMessageScrollerDom)
|
if (this.oMessageScrollerDom)
|
||||||
{
|
{
|
||||||
|
|
@ -645,7 +645,7 @@
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
MessageViewMailBoxAppView.prototype.scrollMessageToLeft = function ()
|
MessageViewMailBoxUserView.prototype.scrollMessageToLeft = function ()
|
||||||
{
|
{
|
||||||
if (this.oMessageScrollerDom)
|
if (this.oMessageScrollerDom)
|
||||||
{
|
{
|
||||||
|
|
@ -657,7 +657,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {MessageModel} oMessage
|
* @param {MessageModel} oMessage
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.showImages = function (oMessage)
|
MessageViewMailBoxUserView.prototype.showImages = function (oMessage)
|
||||||
{
|
{
|
||||||
if (oMessage && oMessage.showExternalImages)
|
if (oMessage && oMessage.showExternalImages)
|
||||||
{
|
{
|
||||||
|
|
@ -668,7 +668,7 @@
|
||||||
/**
|
/**
|
||||||
* @returns {string}
|
* @returns {string}
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.printableCheckedMessageCount = function ()
|
MessageViewMailBoxUserView.prototype.printableCheckedMessageCount = function ()
|
||||||
{
|
{
|
||||||
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
|
var iCnt = this.messageListCheckedOrSelectedUidsWithSubMails().length;
|
||||||
return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : '';
|
return 0 < iCnt ? (100 > iCnt ? iCnt : '99+') : '';
|
||||||
|
|
@ -678,7 +678,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {MessageModel} oMessage
|
* @param {MessageModel} oMessage
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.verifyPgpSignedClearMessage = function (oMessage)
|
MessageViewMailBoxUserView.prototype.verifyPgpSignedClearMessage = function (oMessage)
|
||||||
{
|
{
|
||||||
if (oMessage)
|
if (oMessage)
|
||||||
{
|
{
|
||||||
|
|
@ -689,7 +689,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {MessageModel} oMessage
|
* @param {MessageModel} oMessage
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.decryptPgpEncryptedMessage = function (oMessage)
|
MessageViewMailBoxUserView.prototype.decryptPgpEncryptedMessage = function (oMessage)
|
||||||
{
|
{
|
||||||
if (oMessage)
|
if (oMessage)
|
||||||
{
|
{
|
||||||
|
|
@ -700,7 +700,7 @@
|
||||||
/**
|
/**
|
||||||
* @param {MessageModel} oMessage
|
* @param {MessageModel} oMessage
|
||||||
*/
|
*/
|
||||||
MessageViewMailBoxAppView.prototype.readReceipt = function (oMessage)
|
MessageViewMailBoxUserView.prototype.readReceipt = function (oMessage)
|
||||||
{
|
{
|
||||||
if (oMessage && '' !== oMessage.readReceipt())
|
if (oMessage && '' !== oMessage.readReceipt())
|
||||||
{
|
{
|
||||||
|
|
@ -713,10 +713,10 @@
|
||||||
|
|
||||||
Cache.storeMessageFlagsToCache(oMessage);
|
Cache.storeMessageFlagsToCache(oMessage);
|
||||||
|
|
||||||
require('App/App').reloadFlagsCurrentMessageListAndMessageFromCache();
|
require('App/User').reloadFlagsCurrentMessageListAndMessageFromCache();
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = MessageViewMailBoxAppView;
|
module.exports = MessageViewMailBoxUserView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
28
dev/View/User/MailBox/SystemDropDown.js
Normal file
28
dev/View/User/MailBox/SystemDropDown.js
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var
|
||||||
|
_ = require('_'),
|
||||||
|
|
||||||
|
kn = require('Knoin/Knoin'),
|
||||||
|
AbstractSystemDropDownViewModel = require('View/User/AbstractSystemDropDown')
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @extends AbstractSystemDropDownViewModel
|
||||||
|
*/
|
||||||
|
function SystemDropDownMailBoxUserView()
|
||||||
|
{
|
||||||
|
AbstractSystemDropDownViewModel.call(this);
|
||||||
|
kn.constructorEnd(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
kn.extendAsViewModel(['View/User/MailBox/SystemDropDown', 'View/App/MailBox/SystemDropDown', 'MailBoxSystemDropDownViewModel'], SystemDropDownMailBoxUserView);
|
||||||
|
_.extend(SystemDropDownMailBoxUserView.prototype, AbstractSystemDropDownViewModel.prototype);
|
||||||
|
|
||||||
|
module.exports = SystemDropDownMailBoxUserView;
|
||||||
|
|
||||||
|
}());
|
||||||
|
|
@ -9,7 +9,7 @@
|
||||||
Globals = require('Common/Globals'),
|
Globals = require('Common/Globals'),
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -21,7 +21,7 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function MenuSettingsAppView(oScreen)
|
function MenuSettingsUserView(oScreen)
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Left', 'SettingsMenu');
|
AbstractView.call(this, 'Left', 'SettingsMenu');
|
||||||
|
|
||||||
|
|
@ -32,19 +32,19 @@
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/Settings/Menu', 'SettingsMenuViewModel'], MenuSettingsAppView);
|
kn.extendAsViewModel(['View/User/Settings/Menu', 'View/App/Settings/Menu', 'SettingsMenuViewModel'], MenuSettingsUserView);
|
||||||
_.extend(MenuSettingsAppView.prototype, AbstractView.prototype);
|
_.extend(MenuSettingsUserView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
MenuSettingsAppView.prototype.link = function (sRoute)
|
MenuSettingsUserView.prototype.link = function (sRoute)
|
||||||
{
|
{
|
||||||
return Links.settings(sRoute);
|
return Links.settings(sRoute);
|
||||||
};
|
};
|
||||||
|
|
||||||
MenuSettingsAppView.prototype.backToMailBoxClick = function ()
|
MenuSettingsUserView.prototype.backToMailBoxClick = function ()
|
||||||
{
|
{
|
||||||
kn.setHash(Links.inbox(Cache.getFolderInboxName()));
|
kn.setHash(Links.inbox(Cache.getFolderInboxName()));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = MenuSettingsAppView;
|
module.exports = MenuSettingsUserView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
|
|
@ -10,8 +10,8 @@
|
||||||
Enums = require('Common/Enums'),
|
Enums = require('Common/Enums'),
|
||||||
Links = require('Common/Links'),
|
Links = require('Common/Links'),
|
||||||
|
|
||||||
Data = require('Storage/App/Data'),
|
Data = require('Storage/User/Data'),
|
||||||
Cache = require('Storage/App/Cache'),
|
Cache = require('Storage/User/Cache'),
|
||||||
|
|
||||||
kn = require('Knoin/Knoin'),
|
kn = require('Knoin/Knoin'),
|
||||||
AbstractView = require('Knoin/AbstractView')
|
AbstractView = require('Knoin/AbstractView')
|
||||||
|
|
@ -21,17 +21,17 @@
|
||||||
* @constructor
|
* @constructor
|
||||||
* @extends AbstractView
|
* @extends AbstractView
|
||||||
*/
|
*/
|
||||||
function PaneSettingsAppView()
|
function PaneSettingsUserView()
|
||||||
{
|
{
|
||||||
AbstractView.call(this, 'Right', 'SettingsPane');
|
AbstractView.call(this, 'Right', 'SettingsPane');
|
||||||
|
|
||||||
kn.constructorEnd(this);
|
kn.constructorEnd(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
kn.extendAsViewModel(['View/App/Settings/Pane', 'SettingsPaneViewModel'], PaneSettingsAppView);
|
kn.extendAsViewModel(['View/User/Settings/Pane', 'View/App/Settings/Pane', 'SettingsPaneViewModel'], PaneSettingsUserView);
|
||||||
_.extend(PaneSettingsAppView.prototype, AbstractView.prototype);
|
_.extend(PaneSettingsUserView.prototype, AbstractView.prototype);
|
||||||
|
|
||||||
PaneSettingsAppView.prototype.onBuild = function ()
|
PaneSettingsUserView.prototype.onBuild = function ()
|
||||||
{
|
{
|
||||||
var self = this;
|
var self = this;
|
||||||
key('esc', Enums.KeyState.Settings, function () {
|
key('esc', Enums.KeyState.Settings, function () {
|
||||||
|
|
@ -39,16 +39,16 @@
|
||||||
});
|
});
|
||||||
};
|
};
|
||||||
|
|
||||||
PaneSettingsAppView.prototype.onShow = function ()
|
PaneSettingsUserView.prototype.onShow = function ()
|
||||||
{
|
{
|
||||||
Data.message(null);
|
Data.message(null);
|
||||||
};
|
};
|
||||||
|
|
||||||
PaneSettingsAppView.prototype.backToMailBoxClick = function ()
|
PaneSettingsUserView.prototype.backToMailBoxClick = function ()
|
||||||
{
|
{
|
||||||
kn.setHash(Links.inbox(Cache.getFolderInboxName()));
|
kn.setHash(Links.inbox(Cache.getFolderInboxName()));
|
||||||
};
|
};
|
||||||
|
|
||||||
module.exports = PaneSettingsAppView;
|
module.exports = PaneSettingsUserView;
|
||||||
|
|
||||||
}());
|
}());
|
||||||
28
dev/View/User/Settings/SystemDropDown.js
Normal file
28
dev/View/User/Settings/SystemDropDown.js
Normal file
|
|
@ -0,0 +1,28 @@
|
||||||
|
|
||||||
|
(function () {
|
||||||
|
|
||||||
|
'use strict';
|
||||||
|
|
||||||
|
var
|
||||||
|
_ = require('_'),
|
||||||
|
|
||||||
|
kn = require('Knoin/Knoin'),
|
||||||
|
AbstractSystemDropDownUserView = require('View/User/AbstractSystemDropDown')
|
||||||
|
;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @constructor
|
||||||
|
* @extends AbstractSystemDropDownUserView
|
||||||
|
*/
|
||||||
|
function SystemDropDownSettingsUserView()
|
||||||
|
{
|
||||||
|
AbstractSystemDropDownUserView.call(this);
|
||||||
|
kn.constructorEnd(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
kn.extendAsViewModel(['View/User/Settings/SystemDropDown', 'View/App/Settings/SystemDropDown', 'SettingsSystemDropDownViewModel'], SystemDropDownSettingsUserView);
|
||||||
|
_.extend(SystemDropDownSettingsUserView.prototype, AbstractSystemDropDownUserView.prototype);
|
||||||
|
|
||||||
|
module.exports = SystemDropDownSettingsUserView;
|
||||||
|
|
||||||
|
}());
|
||||||
|
|
@ -1 +1 @@
|
||||||
require('App/Boot')(require('App/Admin'));
|
require('bootstrap')(require('App/Admin'));
|
||||||
|
|
@ -1 +1 @@
|
||||||
require('App/Boot')(require('App/App'));
|
require('bootstrap')(require('App/User'));
|
||||||
0
dev/App/Boot.js → dev/bootstrap.js
vendored
0
dev/App/Boot.js → dev/bootstrap.js
vendored
|
|
@ -2251,4 +2251,21 @@ class Utils
|
||||||
|
|
||||||
return ('' === $sUser ? '' : $sUser.'@').$sDomain;
|
return ('' === $sUser ? '' : $sUser.'@').$sDomain;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $sPassword
|
||||||
|
*
|
||||||
|
* @return bool
|
||||||
|
*/
|
||||||
|
public static function PasswordWeaknessCheck($sPassword)
|
||||||
|
{
|
||||||
|
$sPassword = \trim($sPassword);
|
||||||
|
if (6 > \strlen($sPassword))
|
||||||
|
{
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
$sLine = 'password 123.456 12345678 abc123 qwerty monkey letmein dragon 111.111 baseball iloveyou trustno1 1234567 sunshine master 123.123 welcome shadow ashley football jesus michael ninja mustang password1 123456 123456789 qwerty 111111 1234567 666666 12345678 7777777 123321 654321 1234567890 123123 555555 vkontakte gfhjkm 159753 777777 temppassword qazwsx 1q2w3e 1234 112233 121212 qwertyuiop qq18ww899 987654321 12345 zxcvbn zxcvbnm 999999 samsung ghbdtn 1q2w3e4r 1111111 123654 159357 131313 qazwsxedc 123qwe 222222 asdfgh 333333 9379992 asdfghjkl 4815162342 12344321 88888888 11111111 knopka 789456 qwertyu 1q2w3e4r5t iloveyou vfhbyf marina password qweasdzxc 10203 987654 yfnfif cjkysirj nikita 888888 vfrcbv k.,jdm qwertyuiop[] qwe123 qweasd natasha 123123123 fylhtq q1w2e3 stalker 1111111111 q1w2e3r4 nastya 147258369 147258 fyfcnfcbz 1234554321 1qaz2wsx andrey 111222 147852 genius sergey 7654321 232323 123789 fktrcfylh spartak admin test 123 azerty abc123 lol123 easytocrack1 hello saravn holysh!t test123 tundra_cool2 456 dragon thomas killer root 1111 pass master aaaaaa a monkey daniel asdasd e10adc3949ba59abbe56e057f20f883e changeme computer jessica letmein mirage loulou lol superman shadow admin123 secret administrator sophie kikugalanetroot doudou liverpool hallo sunshine charlie parola 100827092 michael andrew password1 fuckyou matrix cjmasterinf internet hallo123 eminem demo gewinner pokemon abcd1234 guest ngockhoa martin sandra asdf hejsan george qweqwe lollipop lovers q1q1q1 tecktonik naruto 12 password12 password123 password1234 password12345 password123456 password1234567 password12345678 password123456789 000000 maximius 123abc baseball1 football1 soccer princess slipknot 11111 nokia super star 666999 12341234 1234321 135790 159951 212121 zzzzzz 121314 134679 142536 19921992 753951 7007 1111114 124578 19951995 258456 qwaszx zaqwsx 55555 77777 54321 qwert 22222 33333 99999 88888 66666';
|
||||||
|
return false === \strpos($sLine, \strtolower($sPassword));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -61,7 +61,16 @@ class ChangePassword extends \RainLoop\Providers\AbstractProvider
|
||||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CurrentPasswordIncorrect);
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::CurrentPasswordIncorrect);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->weaknessCheck($sNewPassword);
|
$sPasswordForCheck = \trim($sNewPassword);
|
||||||
|
if (6 > \strlen($sPasswordForCheck))
|
||||||
|
{
|
||||||
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::NewPasswordShort);
|
||||||
|
}
|
||||||
|
|
||||||
|
if (!\MailSo\Base\Utils::PasswordWeaknessCheck($sPasswordForCheck))
|
||||||
|
{
|
||||||
|
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::NewPasswordWeak);
|
||||||
|
}
|
||||||
|
|
||||||
if (!$this->oDriver->ChangePassword($oAccount, $sPrevPassword, $sNewPassword))
|
if (!$this->oDriver->ChangePassword($oAccount, $sPrevPassword, $sNewPassword))
|
||||||
{
|
{
|
||||||
|
|
@ -84,25 +93,4 @@ class ChangePassword extends \RainLoop\Providers\AbstractProvider
|
||||||
{
|
{
|
||||||
return $this->oDriver instanceof \RainLoop\Providers\ChangePassword\ChangePasswordInterface;
|
return $this->oDriver instanceof \RainLoop\Providers\ChangePassword\ChangePasswordInterface;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @param string $sPassword
|
|
||||||
*/
|
|
||||||
public function weaknessCheck($sPassword)
|
|
||||||
{
|
|
||||||
$sPassword = \trim($sPassword);
|
|
||||||
if (4 > \strlen($sPassword))
|
|
||||||
{
|
|
||||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::NewPasswordShort);
|
|
||||||
}
|
|
||||||
|
|
||||||
if ($this->bCheckWeak)
|
|
||||||
{
|
|
||||||
$sLine = ' password 123.456 12345678 abc123 qwerty monkey letmein dragon 111.111 baseball iloveyou trustno1 1234567 sunshine master 123.123 welcome shadow ashley football jesus michael ninja mustang password1 123456 123456789 qwerty 111111 1234567 666666 12345678 7777777 123321 654321 1234567890 123123 555555 vkontakte gfhjkm 159753 777777 temppassword qazwsx 1q2w3e 1234 112233 121212 qwertyuiop qq18ww899 987654321 12345 zxcvbn zxcvbnm 999999 samsung ghbdtn 1q2w3e4r 1111111 123654 159357 131313 qazwsxedc 123qwe 222222 asdfgh 333333 9379992 asdfghjkl 4815162342 12344321 88888888 11111111 knopka 789456 qwertyu 1q2w3e4r5t iloveyou vfhbyf marina password qweasdzxc 10203 987654 yfnfif cjkysirj nikita 888888 vfrcbv k.,jdm qwertyuiop[] qwe123 qweasd natasha 123123123 fylhtq q1w2e3 stalker 1111111111 q1w2e3r4 nastya 147258369 147258 fyfcnfcbz 1234554321 1qaz2wsx andrey 111222 147852 genius sergey 7654321 232323 123789 fktrcfylh spartak admin test 123 azerty abc123 lol123 easytocrack1 hello saravn holysh!t test123 tundra_cool2 456 dragon thomas killer root 1111 pass master aaaaaa a monkey daniel asdasd e10adc3949ba59abbe56e057f20f883e changeme computer jessica letmein mirage loulou lol superman shadow admin123 secret administrator sophie kikugalanetroot doudou liverpool hallo sunshine charlie parola 100827092 michael andrew password1 fuckyou matrix cjmasterinf internet hallo123 eminem demo gewinner pokemon abcd1234 guest ngockhoa martin sandra asdf hejsan george qweqwe lollipop lovers q1q1q1 tecktonik naruto 12 password12 password123 password1234 password12345 password123456 password1234567 password12345678 password123456789 000000 maximius 123abc baseball1 football1 soccer princess slipknot 11111 nokia super star 666999 12341234 1234321 135790 159951 212121 zzzzzz 121314 134679 142536 19921992 753951 7007 1111114 124578 19951995 258456 qwaszx zaqwsx 55555 77777 54321 qwert 22222 33333 99999 88888 66666 ';
|
|
||||||
if (false !== \strpos($sLine, \strtolower($sPassword)))
|
|
||||||
{
|
|
||||||
throw new \RainLoop\Exceptions\ClientException(\RainLoop\Notifications::NewPasswordWeak);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1070,7 +1070,7 @@ class ServiceActions
|
||||||
*/
|
*/
|
||||||
private function compileTemplates($bAdmin = false)
|
private function compileTemplates($bAdmin = false)
|
||||||
{
|
{
|
||||||
$sHtml = \RainLoop\Utils::CompileTemplates(APP_VERSION_ROOT_PATH.'app/templates/Views/'.($bAdmin ? 'Admin' : 'App'), $this->oActions).
|
$sHtml = \RainLoop\Utils::CompileTemplates(APP_VERSION_ROOT_PATH.'app/templates/Views/'.($bAdmin ? 'Admin' : 'User'), $this->oActions).
|
||||||
\RainLoop\Utils::CompileTemplates(APP_VERSION_ROOT_PATH.'app/templates/Views/Common', $this->oActions).
|
\RainLoop\Utils::CompileTemplates(APP_VERSION_ROOT_PATH.'app/templates/Views/Common', $this->oActions).
|
||||||
$this->oActions->Plugins()->CompileTemplate($bAdmin);
|
$this->oActions->Plugins()->CompileTemplate($bAdmin);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,15 @@
|
||||||
<div class="legend">
|
<div class="legend">
|
||||||
Security
|
Security
|
||||||
</div>
|
</div>
|
||||||
|
<div class="control-group">
|
||||||
|
<div class="controls">
|
||||||
|
<label data-bind="click: function () { capaTwoFactorAuth(!capaTwoFactorAuth()); }">
|
||||||
|
<i data-bind="css: capaTwoFactorAuth() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
||||||
|
|
||||||
|
Allow 2-Step Verification (Google Authenticator)
|
||||||
|
</label>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<label data-bind="click: function () { capaOpenPGP(!capaOpenPGP()); }">
|
<label data-bind="click: function () { capaOpenPGP(!capaOpenPGP()); }">
|
||||||
|
|
@ -13,15 +22,6 @@
|
||||||
</label>
|
</label>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group">
|
|
||||||
<div class="controls">
|
|
||||||
<label data-bind="click: function () { capaTwoFactorAuth(!capaTwoFactorAuth()); }">
|
|
||||||
<i data-bind="css: capaTwoFactorAuth() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
|
|
||||||
|
|
||||||
Allow 2-Step Verification (Google Authenticator)
|
|
||||||
</label>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
<div class="control-group">
|
<div class="control-group">
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<label data-bind="click: function () { useLocalProxyForExternalImages(!useLocalProxyForExternalImages()); }">
|
<label data-bind="click: function () { useLocalProxyForExternalImages(!useLocalProxyForExternalImages()); }">
|
||||||
|
|
@ -63,7 +63,7 @@
|
||||||
</div>
|
</div>
|
||||||
<div class="control-group" data-bind="css: {'error': adminPasswordNewError}">
|
<div class="control-group" data-bind="css: {'error': adminPasswordNewError}">
|
||||||
<label class="control-label">
|
<label class="control-label">
|
||||||
Repeat new password
|
Repeat
|
||||||
</label>
|
</label>
|
||||||
<div class="controls">
|
<div class="controls">
|
||||||
<input type="password" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
<input type="password" autocomplete="off" autocorrect="off" autocapitalize="off" spellcheck="false"
|
||||||
|
|
|
||||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Add table
Add a link
Reference in a new issue