mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-30 04:29:21 +03:00
Merged from sub repository (updated ckeditor, filters - step 2)
This commit is contained in:
parent
a57dc3720e
commit
ec7324b061
427 changed files with 10909 additions and 3336 deletions
|
|
@ -26,14 +26,10 @@
|
|||
|
||||
this.name = ko.observable('');
|
||||
|
||||
this.conditionsType = ko.observable(Enums.FilterRulesType.And);
|
||||
this.conditionsType = ko.observable(Enums.FilterRulesType.All);
|
||||
|
||||
this.conditions = ko.observableArray([]);
|
||||
|
||||
this.regDisposables(this.conditions.subscribe(function () {
|
||||
Utils.windowResize();
|
||||
}));
|
||||
|
||||
// Actions
|
||||
this.actionMarkAsRead = ko.observable(false);
|
||||
this.actionSkipOtherFilters = ko.observable(true);
|
||||
|
|
@ -41,18 +37,27 @@
|
|||
|
||||
this.actionType = ko.observable(Enums.FiltersAction.Move);
|
||||
this.actionTypeOptions = [ // TODO i18n
|
||||
{'id': Enums.FiltersAction.None, 'name': 'Action - None'},
|
||||
{'id': Enums.FiltersAction.Move, 'name': 'Action - Move to'},
|
||||
// {'id': Enums.FiltersAction.Forward, 'name': 'Action - Forward to'},
|
||||
{'id': Enums.FiltersAction.Discard, 'name': 'Action - Discard'}
|
||||
{'id': Enums.FiltersAction.None, 'name': 'None'},
|
||||
{'id': Enums.FiltersAction.Move, 'name': ' Move to'},
|
||||
// {'id': Enums.FiltersAction.Forward, 'name': 'Forward to'},
|
||||
{'id': Enums.FiltersAction.Discard, 'name': 'Discard'}
|
||||
];
|
||||
|
||||
this.actionMarkAsReadVisiblity = ko.computed(function () {
|
||||
return -1 < Utils.inArray(this.actionType(), [
|
||||
Enums.FiltersAction.None, Enums.FiltersAction.Forward, Enums.FiltersAction.Move
|
||||
this.enableSkipOtherFilters = ko.computed(function () {
|
||||
return -1 === Utils.inArray(this.actionType(), [
|
||||
Enums.FiltersAction.Move, Enums.FiltersAction.Forward, Enums.FiltersAction.Discard
|
||||
]);
|
||||
}, this);
|
||||
|
||||
this.actionSkipOtherFiltersResult = ko.computed({
|
||||
'read': function () {
|
||||
return this.actionSkipOtherFilters() ||
|
||||
!this.enableSkipOtherFilters();
|
||||
},
|
||||
'write': this.actionSkipOtherFilters,
|
||||
'owner': this
|
||||
});
|
||||
|
||||
this.actionTemplate = ko.computed(function () {
|
||||
|
||||
var sTemplate = '';
|
||||
|
|
@ -75,7 +80,11 @@
|
|||
|
||||
}, this);
|
||||
|
||||
this.regDisposables([this.actionMarkAsReadVisiblity, this.actionTemplate]);
|
||||
this.regDisposables(this.conditions.subscribe(function () {
|
||||
Utils.windowResize();
|
||||
}));
|
||||
|
||||
this.regDisposables([this.enableSkipOtherFilters, this.actionSkipOtherFiltersResult, this.actionTemplate]);
|
||||
}
|
||||
|
||||
_.extend(FilterModel.prototype, AbstractModel.prototype);
|
||||
|
|
|
|||
|
|
@ -27,7 +27,6 @@
|
|||
this.fieldOptions = [ // TODO i18n
|
||||
{'id': Enums.FilterConditionField.From, 'name': 'From'},
|
||||
{'id': Enums.FilterConditionField.Recipient, 'name': 'Recipient (To or CC)'},
|
||||
{'id': Enums.FilterConditionField.To, 'name': 'To'},
|
||||
{'id': Enums.FilterConditionField.Subject, 'name': 'Subject'}
|
||||
];
|
||||
|
||||
|
|
|
|||
|
|
@ -86,12 +86,14 @@
|
|||
}, this);
|
||||
|
||||
this.visible = ko.computed(function () {
|
||||
|
||||
var
|
||||
bSubScribed = this.subScribed(),
|
||||
bSubFolders = this.hasSubScribedSubfolders()
|
||||
;
|
||||
|
||||
return (bSubScribed || (bSubFolders && (!this.existen || !this.selectable)));
|
||||
|
||||
}, this);
|
||||
|
||||
this.isSystemFolder = ko.computed(function () {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue