mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-09-03 22:47:03 +03:00
Autocreate system folders in folder list request.
Additional plugin hooks
This commit is contained in:
parent
972067b6d9
commit
394e22520e
19 changed files with 357 additions and 288 deletions
|
|
@ -1143,7 +1143,7 @@ table {
|
|||
border-spacing: 0;
|
||||
}
|
||||
|
||||
@charset "UTF-8";
|
||||
/*@charset "UTF-8";*/
|
||||
|
||||
@font-face {
|
||||
font-family: "rainloop";
|
||||
|
|
@ -7903,6 +7903,19 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
|
|||
opacity: 0.5;
|
||||
filter: alpha(opacity=50);
|
||||
}
|
||||
/*.folderPaddingHelper(@i) {
|
||||
(~".folder-padding.deep-@{i}") {
|
||||
width: 15px * @i + 10px;
|
||||
}
|
||||
}*/
|
||||
.b-settings-folders {
|
||||
/* .folderPaddingHelper(1);
|
||||
.folderPaddingHelper(2);
|
||||
.folderPaddingHelper(3);
|
||||
.folderPaddingHelper(4);
|
||||
.folderPaddingHelper(5);*/
|
||||
|
||||
}
|
||||
.b-settings-folders.ignore-folder-subscribe .subscribe-folder,
|
||||
.b-settings-folders.ignore-folder-subscribe .unsubscribe-folder {
|
||||
display: none;
|
||||
|
|
@ -7953,6 +7966,10 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
|
|||
.b-settings-folders .list-table .folder-name-input {
|
||||
border-width: 1px;
|
||||
margin-bottom: 0;
|
||||
margin-left: -4px;
|
||||
}
|
||||
.b-settings-folders .folder-item.system .folder-name {
|
||||
font-weight: bold;
|
||||
}
|
||||
.b-settings-folders .folder-item .button-delete {
|
||||
margin-right: 15px;
|
||||
|
|
@ -8426,10 +8443,3 @@ html.rl-message-fullscreen .messageView .b-content .buttonFull {
|
|||
.editorFontStylePicker .editorFpFonts .editorFpFont {
|
||||
padding: 5px;
|
||||
}
|
||||
input[type="text"],
|
||||
input[type="password"],
|
||||
input[type="email"],
|
||||
input[type="search"] {
|
||||
height: 20px;
|
||||
line-height: 21px;
|
||||
}
|
||||
|
|
|
|||
4
rainloop/v/0.0.0/static/css/app.min.css
vendored
4
rainloop/v/0.0.0/static/css/app.min.css
vendored
File diff suppressed because one or more lines are too long
|
|
@ -7180,10 +7180,6 @@ function FolderModel()
|
|||
}
|
||||
}, this);
|
||||
|
||||
this.canBeEdited = ko.computed(function () {
|
||||
return Enums.FolderType.User === this.type();
|
||||
}, this);
|
||||
|
||||
this.privateMessageCountAll = ko.observable(0);
|
||||
this.privateMessageCountUnread = ko.observable(0);
|
||||
|
||||
|
|
@ -7212,6 +7208,10 @@ FolderModel.prototype.initComputed = function ()
|
|||
});
|
||||
}, this);
|
||||
|
||||
this.canBeEdited = ko.computed(function () {
|
||||
return Enums.FolderType.User === this.type() && this.existen && this.selectable;
|
||||
}, this);
|
||||
|
||||
this.visible = ko.computed(function () {
|
||||
var
|
||||
bSubScribed = this.subScribed(),
|
||||
|
|
@ -7689,7 +7689,7 @@ function PopupsFolderCreateViewModel()
|
|||
RL.data().foldersCreating(false);
|
||||
if (Enums.StorageResultType.Success === sResult && oData && oData.Result)
|
||||
{
|
||||
RL.folders(false);
|
||||
RL.folders();
|
||||
}
|
||||
else
|
||||
{
|
||||
|
|
@ -7791,7 +7791,8 @@ function PopupsFolderSystemViewModel()
|
|||
'SentFolder': self.sentFolder(),
|
||||
'DraftFolder': self.draftFolder(),
|
||||
'SpamFolder': self.spamFolder(),
|
||||
'TrashFolder': self.trashFolder()
|
||||
'TrashFolder': self.trashFolder(),
|
||||
'NullFolder': 'NullFolder'
|
||||
});
|
||||
|
||||
}, 1000);
|
||||
|
|
@ -12730,7 +12731,7 @@ SettingsFolders.prototype.folderEditOnEnter = function (oFolder)
|
|||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_RENAME_FOLDER'));
|
||||
}
|
||||
|
||||
RL.folders(false);
|
||||
RL.folders();
|
||||
|
||||
}, oFolder.fullNameRaw, sEditName);
|
||||
|
||||
|
|
@ -12801,7 +12802,7 @@ SettingsFolders.prototype.deleteFolder = function (oFolderToRemove)
|
|||
oData && oData.ErrorCode ? Utils.getNotification(oData.ErrorCode) : Utils.i18n('NOTIFICATIONS/CANT_DELETE_FOLDER'));
|
||||
}
|
||||
|
||||
RL.folders(false);
|
||||
RL.folders();
|
||||
|
||||
}, oFolderToRemove.fullNameRaw);
|
||||
|
||||
|
|
@ -13601,10 +13602,9 @@ WebMailDataStorage.prototype.initUidNextAndNewMessages = function (sFolder, sUid
|
|||
/**
|
||||
* @param {string} sNamespace
|
||||
* @param {Array} aFolders
|
||||
* @param {boolean} bCached
|
||||
* @return {Array}
|
||||
*/
|
||||
WebMailDataStorage.prototype.folderResponseParseRec = function (sNamespace, aFolders, bCached)
|
||||
WebMailDataStorage.prototype.folderResponseParseRec = function (sNamespace, aFolders)
|
||||
{
|
||||
var
|
||||
iIndex = 0,
|
||||
|
|
@ -13616,8 +13616,6 @@ WebMailDataStorage.prototype.folderResponseParseRec = function (sNamespace, aFol
|
|||
aList = []
|
||||
;
|
||||
|
||||
bCached = !!bCached;
|
||||
|
||||
for (iIndex = 0, iLen = aFolders.length; iIndex < iLen; iIndex++)
|
||||
{
|
||||
oFolder = aFolders[iIndex];
|
||||
|
|
@ -13651,7 +13649,7 @@ WebMailDataStorage.prototype.folderResponseParseRec = function (sNamespace, aFol
|
|||
{
|
||||
oCacheFolder.collapsed(!Utils.isFolderExpanded(oCacheFolder.fullNameHash));
|
||||
|
||||
if (!bCached && oFolder.Extended)
|
||||
if (oFolder.Extended)
|
||||
{
|
||||
if (oFolder.Extended.Hash)
|
||||
{
|
||||
|
|
@ -13674,7 +13672,7 @@ WebMailDataStorage.prototype.folderResponseParseRec = function (sNamespace, aFol
|
|||
aSubFolders['@Collection'] && Utils.isArray(aSubFolders['@Collection']))
|
||||
{
|
||||
oCacheFolder.subFolders(
|
||||
this.folderResponseParseRec(sNamespace, aSubFolders['@Collection'], bCached));
|
||||
this.folderResponseParseRec(sNamespace, aSubFolders['@Collection']));
|
||||
}
|
||||
|
||||
aList.push(oCacheFolder);
|
||||
|
|
@ -13687,16 +13685,13 @@ WebMailDataStorage.prototype.folderResponseParseRec = function (sNamespace, aFol
|
|||
|
||||
/**
|
||||
* @param {*} oData
|
||||
* @param {boolean=} bCached = false
|
||||
*/
|
||||
WebMailDataStorage.prototype.setFolders = function (oData, bCached)
|
||||
WebMailDataStorage.prototype.setFolders = function (oData)
|
||||
{
|
||||
var
|
||||
aList = [],
|
||||
bUpdate = false,
|
||||
oRLData = RL.data(),
|
||||
aFolders = oRLData.folderList(),
|
||||
bFoldersFirst = 0 === aFolders.length,
|
||||
fNormalizeFolder = function (sFolderFullNameRaw) {
|
||||
return ('' === sFolderFullNameRaw || Consts.Values.UnuseOptionValue === sFolderFullNameRaw ||
|
||||
null !== RL.cache().getFolderFromCacheList(sFolderFullNameRaw)) ? sFolderFullNameRaw : '';
|
||||
|
|
@ -13713,12 +13708,12 @@ WebMailDataStorage.prototype.setFolders = function (oData, bCached)
|
|||
|
||||
this.threading(!!RL.settingsGet('UseImapThread') && oData.Result.IsThreadsSupported && true);
|
||||
|
||||
aList = this.folderResponseParseRec(oRLData.namespace, oData.Result['@Collection'], !!bCached);
|
||||
aList = this.folderResponseParseRec(oRLData.namespace, oData.Result['@Collection']);
|
||||
oRLData.folderList(aList);
|
||||
|
||||
if (oData.Result['SystemFolders'] &&
|
||||
'' === '' + RL.settingsGet('SentFolder') + RL.settingsGet('DraftFolder') +
|
||||
RL.settingsGet('SpamFolder') + RL.settingsGet('TrashFolder'))
|
||||
RL.settingsGet('SpamFolder') + RL.settingsGet('TrashFolder') + RL.settingsGet('NullFolder'))
|
||||
{
|
||||
// TODO Magic Numbers
|
||||
RL.settingsSet('SentFolder', oData.Result['SystemFolders'][2] || null);
|
||||
|
|
@ -13740,19 +13735,12 @@ WebMailDataStorage.prototype.setFolders = function (oData, bCached)
|
|||
'SentFolder': oRLData.sentFolder(),
|
||||
'DraftFolder': oRLData.draftFolder(),
|
||||
'SpamFolder': oRLData.spamFolder(),
|
||||
'TrashFolder': oRLData.trashFolder()
|
||||
'TrashFolder': oRLData.trashFolder(),
|
||||
'NullFolder': 'NullFolder'
|
||||
});
|
||||
}
|
||||
|
||||
if (!bCached)
|
||||
{
|
||||
RL.local().set(Enums.ClientSideKeyName.FoldersLashHash, oData.Result.FoldersHash);
|
||||
}
|
||||
|
||||
if (bFoldersFirst && bCached)
|
||||
{
|
||||
RL.folders(false);
|
||||
}
|
||||
RL.local().set(Enums.ClientSideKeyName.FoldersLashHash, oData.Result.FoldersHash);
|
||||
}
|
||||
};
|
||||
|
||||
|
|
@ -14365,21 +14353,15 @@ _.extend(WebMailAjaxRemoteStorage.prototype, AbstractAjaxRemoteStorage.prototype
|
|||
|
||||
/**
|
||||
* @param {?Function} fCallback
|
||||
* @param {boolean=} bUseCache = true
|
||||
*/
|
||||
WebMailAjaxRemoteStorage.prototype.folders = function (fCallback, bUseCache)
|
||||
WebMailAjaxRemoteStorage.prototype.folders = function (fCallback)
|
||||
{
|
||||
var sFoldersHash = RL.data().lastFoldersHash;
|
||||
|
||||
bUseCache = Utils.isUnd(bUseCache) ? false : !!bUseCache;
|
||||
if (bUseCache && '' !== sFoldersHash)
|
||||
{
|
||||
this.defaultRequest(fCallback, 'Folders', {}, null, 'Folders/' + RL.data().projectHash() + '-' + sFoldersHash, ['Folders']);
|
||||
}
|
||||
else
|
||||
{
|
||||
this.defaultRequest(fCallback, 'Folders', {}, null, '', ['Folders']);
|
||||
}
|
||||
this.defaultRequest(fCallback, 'Folders', {
|
||||
'SentFolder': RL.settingsGet('SentFolder'),
|
||||
'DraftFolder': RL.settingsGet('DraftFolder'),
|
||||
'SpamFolder': RL.settingsGet('SpamFolder'),
|
||||
'TrashFolder': RL.settingsGet('TrashFolder')
|
||||
}, null, '', ['Folders']);
|
||||
};
|
||||
|
||||
/**
|
||||
|
|
@ -16226,18 +16208,17 @@ RainLoopApp.prototype.recacheInboxMessageList = function ()
|
|||
};
|
||||
|
||||
/**
|
||||
* @param {boolean=} bUseCache = true
|
||||
* @param {Function=} fCallback
|
||||
*/
|
||||
RainLoopApp.prototype.folders = function (bUseCache, fCallback)
|
||||
RainLoopApp.prototype.folders = function (fCallback)
|
||||
{
|
||||
this.data().foldersLoading(true);
|
||||
this.remote().folders(_.bind(function (sResult, oData, bCached) {
|
||||
this.remote().folders(_.bind(function (sResult, oData) {
|
||||
|
||||
RL.data().foldersLoading(false);
|
||||
if (Enums.StorageResultType.Success === sResult)
|
||||
{
|
||||
this.data().setFolders(oData, bCached);
|
||||
this.data().setFolders(oData);
|
||||
if (fCallback)
|
||||
{
|
||||
fCallback(true);
|
||||
|
|
@ -16250,7 +16231,7 @@ RainLoopApp.prototype.folders = function (bUseCache, fCallback)
|
|||
fCallback(false);
|
||||
}
|
||||
}
|
||||
}, this), bUseCache);
|
||||
}, this));
|
||||
};
|
||||
|
||||
RainLoopApp.prototype.accountsAndIdentities = function ()
|
||||
|
|
@ -16837,7 +16818,7 @@ RainLoopApp.prototype.bootstart = function ()
|
|||
{
|
||||
this.setTitle(Utils.i18n('TITLES/LOADING'));
|
||||
|
||||
this.folders(true, _.bind(function (bValue) {
|
||||
this.folders(_.bind(function (bValue) {
|
||||
|
||||
kn.hideLoading();
|
||||
|
||||
|
|
|
|||
12
rainloop/v/0.0.0/static/js/app.min.js
vendored
12
rainloop/v/0.0.0/static/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
Loading…
Add table
Add a link
Reference in a new issue