Sieve Filters (Interface first look)

Code refactoring
Small fixes
This commit is contained in:
RainLoop Team 2014-08-07 01:02:20 +04:00
parent 409e9fbdc2
commit 1027f319ed
43 changed files with 466 additions and 427 deletions

View file

@ -303,9 +303,10 @@ Enums.FilterConditionType = {
* @enum {string}
*/
Enums.FiltersAction = {
'None': 'None',
'Move': 'Move',
'Delete': 'Delete',
'Forward': 'Forward'
'Discard': 'Discard',
'Forward': 'Forward',
};
/**
@ -313,8 +314,7 @@ Enums.FiltersAction = {
*/
Enums.FilterRulesType = {
'And': 'And',
'Or': 'Or',
'All': 'All'
'Or': 'Or'
};
/**

View file

@ -1,50 +0,0 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
*/
function FilterActionModel(oKoList, oKoCanBeDeleted)
{
this.parentList = oKoList;
this.canBeDeleted = oKoCanBeDeleted;
this.value = ko.observable('');
this.type = ko.observable(Enums.FiltersAction.Move);
this.typeOptions = [ // TODO i18n
{'id': Enums.FiltersAction.Move, 'name': 'Move to'},
{'id': Enums.FiltersAction.Forward, 'name': 'Forward to'},
{'id': Enums.FiltersAction.Delete, 'name': 'Discard'},
{'id': Enums.FiltersAction.MarkAsRead, 'name': 'Mark as read'}
];
this.template = ko.computed(function () {
var sTemplate = '';
switch (this.type())
{
default:
case Enums.FiltersAction.Move:
sTemplate = 'SettingsFiltersActionValueAsFolders';
break;
case Enums.FiltersAction.Forward:
sTemplate = 'SettingsFiltersActionWithValue';
break;
case Enums.FiltersAction.MarkAsRead:
case Enums.FiltersAction.Delete:
sTemplate = 'SettingsFiltersActionNoValue';
break;
}
return sTemplate;
}, this);
}
FilterActionModel.prototype.removeSelf = function ()
{
if (this.canBeDeleted())
{
this.parentList.remove(this);
}
};

View file

@ -3,25 +3,26 @@
/**
* @constructor
*/
function FilterConditionModel(oKoList, oKoCanBeDeleted)
function FilterConditionModel(oKoList)
{
this.parentList = oKoList;
this.canBeDeleted = oKoCanBeDeleted;
this.field = ko.observable(Enums.FilterConditionField.Subject);
this.field = ko.observable(Enums.FilterConditionField.From);
this.fieldOptions = [ // TODO i18n
{'id': Enums.FilterConditionField.Subject, 'name': 'Subject'},
{'id': Enums.FilterConditionField.Recipient, 'name': 'Recipient (To or CC)'},
{'id': Enums.FilterConditionField.From, 'name': 'From'},
{'id': Enums.FilterConditionField.To, 'name': 'To'}
{'id': Enums.FilterConditionField.Recipient, 'name': 'Recipient (To or CC)'},
{'id': Enums.FilterConditionField.To, 'name': 'To'},
{'id': Enums.FilterConditionField.Subject, 'name': 'Subject'}
];
this.type = ko.observable(Enums.FilterConditionType.Contains);
this.type = ko.observable(Enums.FilterConditionType.EqualTo);
this.typeOptions = [ // TODO i18n
{'id': Enums.FilterConditionType.Contains, 'name': 'Contains'},
{'id': Enums.FilterConditionType.NotContains, 'name': 'Not Contains'},
{'id': Enums.FilterConditionType.EqualTo, 'name': 'Equal To'},
{'id': Enums.FilterConditionType.NotEqualTo, 'name': 'Not Equal To'}
{'id': Enums.FilterConditionType.NotEqualTo, 'name': 'Not Equal To'},
{'id': Enums.FilterConditionType.Contains, 'name': 'Contains'},
{'id': Enums.FilterConditionType.NotContains, 'name': 'Not Contains'}
];
this.value = ko.observable('');
@ -43,8 +44,5 @@ function FilterConditionModel(oKoList, oKoCanBeDeleted)
FilterConditionModel.prototype.removeSelf = function ()
{
if (this.canBeDeleted())
{
this.parentList.remove(this);
}
this.parentList.remove(this);
};

View file

@ -5,6 +5,7 @@
*/
function FilterModel()
{
this.new = ko.observable(true);
this.enabled = ko.observable(true);
this.name = ko.observable('');
@ -12,33 +13,56 @@ function FilterModel()
this.conditionsType = ko.observable(Enums.FilterRulesType.And);
this.conditions = ko.observableArray([]);
this.actions = ko.observableArray([]);
this.conditions.subscribe(function () {
Utils.windowResize();
});
this.actions.subscribe(function () {
Utils.windowResize();
});
// Actions
this.actionMarkAsRead = ko.observable(false);
this.actionSkipOtherFilters = ko.observable(true);
this.actionValue = ko.observable('');
this.conditionsCanBeDeleted = ko.computed(function () {
return 1 < this.conditions().length;
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'}
];
this.actionMarkAsReadVisiblity = ko.computed(function () {
return -1 < Utils.inArray(this.actionType(), [
Enums.FiltersAction.None, Enums.FiltersAction.Forward, Enums.FiltersAction.Move
]);
}, this);
this.actionsCanBeDeleted = ko.computed(function () {
return 1 < this.actions().length;
this.actionTemplate = ko.computed(function () {
var sTemplate = '';
switch (this.actionType())
{
default:
case Enums.FiltersAction.Move:
sTemplate = 'SettingsFiltersActionValueAsFolders';
break;
case Enums.FiltersAction.Forward:
sTemplate = 'SettingsFiltersActionWithValue';
break;
case Enums.FiltersAction.None:
case Enums.FiltersAction.Discard:
sTemplate = 'SettingsFiltersActionNoValue';
break;
}
return sTemplate;
}, this);
}
FilterModel.prototype.addCondition = function ()
{
this.conditions.push(new FilterConditionModel(this.conditions, this.conditionsCanBeDeleted));
};
FilterModel.prototype.addAction = function ()
{
this.actions.push(new FilterActionModel(this.actions, this.actionsCanBeDeleted));
this.conditions.push(new FilterConditionModel(this.conditions));
};
FilterModel.prototype.parse = function (oItem)

View file

@ -28,9 +28,5 @@ SettingsFilters.prototype.deleteFilter = function (oFilter)
SettingsFilters.prototype.addFilter = function ()
{
var oFilter = new FilterModel();
oFilter.addCondition();
oFilter.addAction();
this.filters.push(oFilter);
kn.showScreenPopup(PopupsFilterViewModel, [new FilterModel()]);
};

View file

@ -60,6 +60,7 @@
@import "FolderClear.less";
@import "FolderCreate.less";
@import "FolderSystem.less";
@import "Filter.less";
@import "Languages.less";
@import "AddAccount.less";
@import "OpenPgpKey.less";

10
dev/Styles/Filter.less Normal file
View file

@ -0,0 +1,10 @@
.popups {
.b-filter-content {
width: 800px;
.modal-header {
background-color: #fff;
}
}
}

View file

@ -0,0 +1,37 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
* @extends KnoinAbstractViewModel
*/
function PopupsFilterViewModel()
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFilter');
this.filter = ko.observable(null);
this.selectedFolderValue = ko.observable(Consts.Values.UnuseOptionValue);
this.folderSelectList = RL.data().folderMenuForMove;
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsFilterViewModel', PopupsFilterViewModel);
PopupsFilterViewModel.prototype.clearPopup = function ()
{
};
PopupsFilterViewModel.prototype.onShow = function (oFilter)
{
this.clearPopup();
this.filter(oFilter);
};
PopupsFilterViewModel.prototype.onFocus = function ()
{
};

View file

@ -200,27 +200,27 @@ cfg.paths.js = {
'dev/Models/FolderModel.js',
'dev/Models/AccountModel.js',
'dev/Models/IdentityModel.js',
'dev/Models/FilterActionModel.js',
'dev/Models/FilterConditionModel.js',
'dev/Models/FilterModel.js',
'dev/Models/OpenPgpKeyModel.js',
'dev/ViewModels/PopupsFolderClearViewModel.js',
'dev/ViewModels/PopupsFolderCreateViewModel.js',
'dev/ViewModels/PopupsFolderSystemViewModel.js',
'dev/ViewModels/PopupsComposeViewModel.js',
'dev/ViewModels/PopupsContactsViewModel.js',
'dev/ViewModels/PopupsAdvancedSearchViewModel.js',
'dev/ViewModels/PopupsAddAccountViewModel.js',
'dev/ViewModels/PopupsAddOpenPgpKeyViewModel.js',
'dev/ViewModels/PopupsViewOpenPgpKeyViewModel.js',
'dev/ViewModels/PopupsGenerateNewOpenPgpKeyViewModel.js',
'dev/ViewModels/PopupsComposeOpenPgpViewModel.js',
'dev/ViewModels/PopupsIdentityViewModel.js',
'dev/ViewModels/PopupsLanguagesViewModel.js',
'dev/ViewModels/PopupsTwoFactorTestViewModel.js',
'dev/ViewModels/PopupsAskViewModel.js',
'dev/ViewModels/PopupsKeyboardShortcutsHelpViewModel.js',
'dev/ViewModels/Popups/PopupsFolderClearViewModel.js',
'dev/ViewModels/Popups/PopupsFolderCreateViewModel.js',
'dev/ViewModels/Popups/PopupsFolderSystemViewModel.js',
'dev/ViewModels/Popups/PopupsComposeViewModel.js',
'dev/ViewModels/Popups/PopupsContactsViewModel.js',
'dev/ViewModels/Popups/PopupsAdvancedSearchViewModel.js',
'dev/ViewModels/Popups/PopupsAddAccountViewModel.js',
'dev/ViewModels/Popups/PopupsAddOpenPgpKeyViewModel.js',
'dev/ViewModels/Popups/PopupsViewOpenPgpKeyViewModel.js',
'dev/ViewModels/Popups/PopupsGenerateNewOpenPgpKeyViewModel.js',
'dev/ViewModels/Popups/PopupsComposeOpenPgpViewModel.js',
'dev/ViewModels/Popups/PopupsIdentityViewModel.js',
'dev/ViewModels/Popups/PopupsLanguagesViewModel.js',
'dev/ViewModels/Popups/PopupsTwoFactorTestViewModel.js',
'dev/ViewModels/Popups/PopupsAskViewModel.js',
'dev/ViewModels/Popups/PopupsKeyboardShortcutsHelpViewModel.js',
'dev/ViewModels/Popups/PopupsFiterViewModel.js',
'dev/ViewModels/LoginViewModel.js',
@ -298,11 +298,11 @@ cfg.paths.js = {
'dev/Models/EmailModel.js',
'dev/Models/ContactTagModel.js',
'dev/ViewModels/PopupsDomainViewModel.js',
'dev/ViewModels/PopupsPluginViewModel.js',
'dev/ViewModels/PopupsActivateViewModel.js',
'dev/ViewModels/PopupsLanguagesViewModel.js',
'dev/ViewModels/PopupsAskViewModel.js',
'dev/ViewModels/Popups/PopupsDomainViewModel.js',
'dev/ViewModels/Popups/PopupsPluginViewModel.js',
'dev/ViewModels/Popups/PopupsActivateViewModel.js',
'dev/ViewModels/Popups/PopupsLanguagesViewModel.js',
'dev/ViewModels/Popups/PopupsAskViewModel.js',
'dev/ViewModels/AdminLoginViewModel.js',
@ -592,7 +592,7 @@ gulp.task('rainloop+', ['rainloop', 'package-inc-release']);
gulp.task('owncloud', ['rainloop:owncloud:copy', 'rainloop:owncloud:setup', 'rainloop:owncloud:zip', 'rainloop:owncloud:md5', 'rainloop:owncloud:clean']);
//WATCH
gulp.task('watch', function() {
gulp.task('watch', ['fast'], function() {
gulp.watch(cfg.paths.js.app.src, {interval: 1000}, ['js:app']);
gulp.watch(cfg.paths.js.admin.src, {interval: 1000}, ['js:admin']);
gulp.watch(cfg.paths.less.main.watch, {interval: 1000}, ['css:main']);

View file

@ -0,0 +1,67 @@
<div class="popups">
<div class="modal hide b-filter-content g-ui-user-select-none" data-bind="modal: modalVisibility">
<div>
<div class="modal-header">
<button type="button" class="close" data-bind="command: cancelCommand">&times;</button>
<h3>
<span class="i18n" data-i18n-text="POPUPS_CREATE_FOLDER/TITLE_CREATE_FOLDER"></span>
</h3>
</div>
<div class="modal-body">
<div class="row filter" data-bind="with: filter">
<div class="span9">
<br />
<input type="text" class="span4" data-bind="value: name" placeholder="Description" />
<hr />
<div>
<a class="btn" data-bind="click: addCondition">
<i class="icon-plus"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="SETTINGS_FILTERS/BUTTON_ADD_CONDITION"></span>
</a>
<br />
<br />
<div data-bind="visible: 1 < conditions().length">
<select class="span4" data-bind="value: conditionsType">
<option value="And">
Matching all of the following rules
</option>
<option value="Or">
Matching any of the following rules
</option>
</select>
</div>
<div data-bind="visible: 0 < conditions().length, foreach: conditions">
<div data-bind="template: {'name': template(), 'data': $data}"></div>
</div>
<div data-bind="visible: 0 === conditions().length">
All messages
</div>
</div>
<hr />
<div data-bind="template: {'name': actionTemplate()}"></div>
<label data-bind="visible: actionMarkAsReadVisiblity, click: function () { actionMarkAsRead(!actionMarkAsRead()); }">
<i data-bind="css: actionMarkAsRead() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
<span>Mark as read</span>
</label>
<label data-bind="click: function () { actionSkipOtherFilters(!actionSkipOtherFilters()); }">
<i data-bind="css: actionSkipOtherFilters() ? 'icon-checkbox-checked' : 'icon-checkbox-unchecked'"></i>
&nbsp;&nbsp;
<span>Skip other filters</span>
</label>
</div>
</div>
</div>
<div class="modal-footer">
<a class="btn buttonSave">
<i class="icon-folder-add"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="POPUPS_CREATE_FOLDER/BUTTON_CREATE"></span>
</a>
</div>
</div>
</div>
</div>

View file

@ -6,60 +6,8 @@
</div>
<div class="row">
<div data-bind="foreach: filters, i18nUpdate: filters">
<div class="filter span12 pull-left" style="background-color: #eee; padding: 15px; border-radius: 4px">
<input type="text" data-bind="value: name" placeholder="Description:" />
<br />
<label class="radio inline">
<input type="radio" name="conditionsType" value="And" data-bind="checked: conditionsType" />
Matching all of the following rules
</label>
<label class="radio inline">
<input type="radio" name="conditionsType" value="Or" data-bind="checked: conditionsType" />
Matching any of the following rules
</label>
<label class="radio inline">
<input type="radio" name="conditionsType" value="All" data-bind="checked: conditionsType" />
All messages
</label>
<hr />
<div>
<a class="btn" data-bind="click: addCondition">
<i class="icon-plus"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="SETTINGS_FILTERS/BUTTON_ADD_CONDITION"></span>
</a>
<br />
<br />
<div data-bind="foreach: conditions">
<div data-bind="template: {'name': template(), 'data': $data}"></div>
</div>
</div>
<hr />
<div>
<a class="btn" data-bind="click: addAction">
<i class="icon-plus"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="SETTINGS_FILTERS/BUTTON_ADD_ACTION"></span>
</a>
<br />
<br />
<div data-bind="foreach: actions">
<div data-bind="template: {'name': template(), 'data': $data}"></div>
</div>
</div>
<hr />
<a class="btn" data-bind="click: function (oFilter) { $parent.deleteFilter(oFilter); }">
<i class="icon-trash"></i>
&nbsp;&nbsp;
<span class="i18n" data-i18n-text="SETTINGS_FILTERS/BUTTON_DELETE_FILTER"></span>
</a>
<br />
</div>
<span data-bind="text: name" ></span>
<br />
</div>
</div>
<br />

View file

@ -1,4 +1 @@
<select data-bind="options: typeOptions, value: type, optionsText: 'name', optionsValue: 'id'"></select>
<span class="delete-action pull-right" data-bind="visible: canBeDeleted, click: removeSelf">
<i class="icon-trash"></i>
</span>
<select data-bind="options: actionTypeOptions, value: actionType, optionsText: 'name', optionsValue: 'id'"></select>

View file

@ -1,5 +1,4 @@
<select data-bind="options: typeOptions, value: type, optionsText: 'name', optionsValue: 'id'"></select>
Folders
<span class="delete-action pull-right" data-bind="visible: canBeDeleted, click: removeSelf">
<i class="icon-trash"></i>
</span>
<select data-bind="options: actionTypeOptions, value: actionType, optionsText: 'name', optionsValue: 'id'"></select>
&nbsp;
<select data-bind="options: $root.folderSelectList, value: $root.selectedFolderValue,
optionsText: 'name', optionsValue: 'id', optionsAfterRender: $root.defautOptionsAfterRender"></select>

View file

@ -1,5 +1,3 @@
<select data-bind="options: typeOptions, value: type, optionsText: 'name', optionsValue: 'id'"></select>
<input type="text" data-bind="value: value" />
<span class="delete-action pull-right" data-bind="visible: canBeDeleted, click: removeSelf">
<i class="icon-trash"></i>
</span>
<select data-bind="options: actionTypeOptions, value: actionType, optionsText: 'name', optionsValue: 'id'"></select>
&nbsp;
<input type="text" data-bind="value: actionValue" />

View file

@ -1,6 +1,9 @@
<select data-bind="options: fieldOptions, value: field, optionsText: 'name', optionsValue: 'id'"></select>
<select data-bind="options: typeOptions, value: type, optionsText: 'name', optionsValue: 'id'"></select>
<input type="text" data-bind="value: value" />
<span class="delete-action pull-right" data-bind="visible: canBeDeleted, click: removeSelf">
<select class="span3" data-bind="options: fieldOptions, value: field, optionsText: 'name', optionsValue: 'id'"></select>
&nbsp;
<select class="span2" data-bind="options: typeOptions, value: type, optionsText: 'name', optionsValue: 'id'"></select>
&nbsp;
<input class="span3" type="text" data-bind="value: value" />
&nbsp;
<span class="delete-action pull-right" data-bind="click: removeSelf">
<i class="icon-trash"></i>
</span>

View file

@ -363,7 +363,6 @@ LEGEND_FILTERS = "Filters"
BUTTON_ADD_FILTER = "Add Filter"
BUTTON_DELETE_FILTER = "Delete Filter"
BUTTON_ADD_CONDITION = "Add Condition"
BUTTON_ADD_ACTION = "Add Action"
[SETTINGS_IDENTITY]
LEGEND_IDENTITY = "Identity"

View file

@ -362,7 +362,6 @@ LEGEND_FILTERS = "Filtry"
BUTTON_ADD_FILTER = "Dodaj filter"
BUTTON_DELETE_FILTER = "Usuń filter"
BUTTON_ADD_CONDITION = "Dodaj warunek"
BUTTON_ADD_ACTION = "Dodaj działanie"
[SETTINGS_IDENTITY]
LEGEND_IDENTITY = "Tożsamość"

View file

@ -637,7 +637,7 @@
border-radius: 8px;
}
/*! normalize.css 2012-03-11T12:53 UTC - http://github.com/necolas/normalize.css */
/* =============================================================================
@ -1142,7 +1142,7 @@ table {
border-collapse: collapse;
border-spacing: 0;
}
@charset "UTF-8";
@font-face {
@ -1513,7 +1513,7 @@ table {
.icon-resize-out:before {
content: "\e06d";
}
/** initial setup **/
.nano {
/*
@ -1630,7 +1630,7 @@ table {
.nano > .pane2:hover > .slider2, .nano > .pane2.active > .slider2 {
background-color: rgba(0, 0, 0, 0.4);
}
/* Magnific Popup CSS */
.mfp-bg {
top: 0;
@ -1995,7 +1995,7 @@ img.mfp-img {
right: 0;
padding-top: 0; }
/* overlay at start */
.mfp-fade.mfp-bg {
@ -2041,7 +2041,7 @@ img.mfp-img {
-moz-transform: translateX(50px);
transform: translateX(50px);
}
.simple-pace {
-webkit-pointer-events: none;
pointer-events: none;
@ -2112,7 +2112,7 @@ img.mfp-img {
@keyframes simple-pace-stripe-animation {
0% { transform: none; transform: none; }
100% { transform: translate(-32px, 0); transform: translate(-32px, 0); }
}
}
.inputosaurus-container {
background-color:#fff;
border:1px solid #bcbec0;
@ -2180,7 +2180,7 @@ img.mfp-img {
box-shadow:none;
}
.inputosaurus-input-hidden { display:none; }
.flag-wrapper {
width: 24px;
height: 16px;
@ -2226,7 +2226,7 @@ img.mfp-img {
.flag.flag-pt-br {background-position: -192px -11px}
.flag.flag-cn, .flag.flag-zh-tw, .flag.flag-zh-cn, .flag.flag-zh-hk {background-position: -208px -22px}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
.clearfix {
*zoom: 1;
@ -7502,6 +7502,12 @@ html.rl-left-panel-disabled .btn.buttonContacts {
.popups .b-folder-system-content .modal-header {
background-color: #fff;
}
.popups .b-filter-content {
width: 800px;
}
.popups .b-filter-content .modal-header {
background-color: #fff;
}
.popups .b-languages-content.modal {
width: 700px;
}

File diff suppressed because one or more lines are too long

View file

@ -78,7 +78,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/
@ -87,7 +87,7 @@ var
*/
var RL = null;
/*jshint onevar: true*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -248,7 +248,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Consts.Defaults = {};
@ -368,7 +368,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -674,9 +674,10 @@ Enums.FilterConditionType = {
* @enum {string}
*/
Enums.FiltersAction = {
'None': 'None',
'Move': 'Move',
'Delete': 'Delete',
'Forward': 'Forward'
'Discard': 'Discard',
'Forward': 'Forward',
};
/**
@ -684,8 +685,7 @@ Enums.FiltersAction = {
*/
Enums.FilterRulesType = {
'And': 'And',
'Or': 'Or',
'All': 'All'
'Or': 'Or'
};
/**
@ -799,7 +799,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Utils.trim = $.trim;
@ -2856,7 +2856,7 @@ Utils.triggerAutocompleteInputChange = function (bDelay) {
};
/*jslint bitwise: true*/
// Base64 encode / decode
// http://www.webtoolkit.info/
@ -3020,7 +3020,7 @@ Base64 = {
}
};
/*jslint bitwise: false*/
/*jslint bitwise: false*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
ko.bindingHandlers.tooltip = {
@ -3863,7 +3863,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4169,7 +4169,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4265,7 +4265,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4341,7 +4341,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4414,7 +4414,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4459,7 +4459,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4474,7 +4474,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4569,7 +4569,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
return true;
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4647,7 +4647,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5063,7 +5063,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5429,7 +5429,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5475,7 +5475,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
Utils.encodeHtml(this.name()) : this.name();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5772,7 +5772,7 @@ PopupsDomainViewModel.prototype.clearForm = function ()
this.smtpAuth(true);
this.whiteList('');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5916,7 +5916,7 @@ PopupsPluginViewModel.prototype.onBuild = function ()
return false;
}, this));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6034,7 +6034,7 @@ PopupsActivateViewModel.prototype.validateSubscriptionKey = function ()
{
var sValue = this.key();
return '' === sValue || !!/^RL[\d]+-[A-Z0-9\-]+Z$/.test(Utils.trim(sValue));
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6096,7 +6096,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6209,7 +6209,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6310,7 +6310,7 @@ AdminLoginViewModel.prototype.submitForm = function ()
{
this.submitCommand();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6336,7 +6336,7 @@ AdminMenuViewModel.prototype.link = function (sRoute)
{
return '#/' + sRoute;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6362,7 +6362,7 @@ AdminPaneViewModel.prototype.logoutClick = function ()
RL.remote().adminLogout(function () {
RL.loginAndLogoutReload();
});
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6490,7 +6490,7 @@ AdminGeneral.prototype.phpInfoLink = function ()
return RL.link().phpInfo();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6544,7 +6544,7 @@ AdminLogin.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6615,7 +6615,7 @@ AdminBranding.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6837,7 +6837,7 @@ AdminContacts.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6928,7 +6928,7 @@ AdminDomains.prototype.onDomainListChangeRequest = function ()
{
RL.reloadDomainList();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7043,7 +7043,7 @@ AdminSecurity.prototype.phpInfoLink = function ()
{
return RL.link().phpInfo();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7180,7 +7180,7 @@ AdminSocial.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7279,7 +7279,7 @@ AdminPlugins.prototype.onPluginDisableRequest = function (sResult, oData)
RL.reloadPluginList();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7379,7 +7379,7 @@ AdminPackages.prototype.installPackage = function (oPackage)
RL.remote().packageInstall(this.requestHelper(oPackage, true), oPackage);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7436,7 +7436,7 @@ AdminLicensing.prototype.licenseExpiredMomentValue = function ()
;
return iTime && 1898625600 === iTime ? 'Never' : (oDate.format('LL') + ' (' + oDate.from(moment()) + ')');
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7513,7 +7513,7 @@ AdminAbout.prototype.updateCoreData = function ()
RL.updateCoreData();
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7648,7 +7648,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7701,7 +7701,7 @@ _.extend(AdminDataStorage.prototype, AbstractData.prototype);
AdminDataStorage.prototype.populateDataOnStart = function()
{
AbstractData.prototype.populateDataOnStart.call(this);
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -7985,7 +7985,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8248,7 +8248,7 @@ AdminAjaxRemoteStorage.prototype.adminPing = function (fCallback)
{
this.defaultRequest(fCallback, 'AdminPing');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8309,7 +8309,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{
this.oServices = oData;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8322,7 +8322,7 @@ function AdminCacheStorage()
}
_.extend(AdminCacheStorage.prototype, AbstractCacheStorage.prototype);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8504,7 +8504,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8521,7 +8521,7 @@ _.extend(AdminLoginScreen.prototype, KnoinAbstractScreen.prototype);
AdminLoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8541,7 +8541,7 @@ _.extend(AdminSettingsScreen.prototype, AbstractSettings.prototype);
AdminSettingsScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8901,7 +8901,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -9204,7 +9204,7 @@ AdminApp.prototype.bootstart = function ()
* @type {AdminApp}
*/
RL = new AdminApp();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@ -9257,7 +9257,7 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null;
});
};
if (window.SimplePace) {
window.SimplePace.add(10);
}

File diff suppressed because one or more lines are too long

View file

@ -78,7 +78,7 @@ var
NotificationClass = window.Notification && window.Notification.requestPermission ? window.Notification : null
;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/*jshint onevar: false*/
@ -90,7 +90,7 @@ var
$proxyDiv = $('<div></div>')
;
/*jshint onevar: true*/
/*jshint onevar: true*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -251,7 +251,7 @@ if (Globals.bAllowPdfPreview && navigator && navigator.mimeTypes)
return oType && 'application/pdf' === oType.type;
});
}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Consts.Defaults = {};
@ -371,7 +371,7 @@ Consts.DataImages.UserDotPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAA
* @type {string}
*/
Consts.DataImages.TranspPic = 'data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAYAAAAfFcSJAAAAC0lEQVQIW2NkAAIAAAoAAggA9GkAAAAASUVORK5CYII=';
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -677,9 +677,10 @@ Enums.FilterConditionType = {
* @enum {string}
*/
Enums.FiltersAction = {
'None': 'None',
'Move': 'Move',
'Delete': 'Delete',
'Forward': 'Forward'
'Discard': 'Discard',
'Forward': 'Forward',
};
/**
@ -687,8 +688,7 @@ Enums.FiltersAction = {
*/
Enums.FilterRulesType = {
'And': 'And',
'Or': 'Or',
'All': 'All'
'Or': 'Or'
};
/**
@ -802,7 +802,7 @@ Enums.Notification = {
'UnknownNotification': 999,
'UnknownError': 999
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
Utils.trim = $.trim;
@ -2859,7 +2859,7 @@ Utils.triggerAutocompleteInputChange = function (bDelay) {
};
/*jslint bitwise: true*/
// Base64 encode / decode
// http://www.webtoolkit.info/
@ -3023,7 +3023,7 @@ Base64 = {
}
};
/*jslint bitwise: false*/
/*jslint bitwise: false*/
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
ko.bindingHandlers.tooltip = {
@ -3866,7 +3866,7 @@ ko.observable.fn.validateFunc = function (fFunc)
return this;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4172,7 +4172,7 @@ LinkBuilder.prototype.socialFacebook = function ()
{
return this.sServer + 'SocialFacebook' + ('' !== this.sSpecSuffix ? '/' + this.sSpecSuffix + '/' : '');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -4268,7 +4268,7 @@ Plugins.settingsGet = function (sPluginSection, sName)
};
/**
* @constructor
@ -4507,7 +4507,7 @@ NewHtmlEditorWrapper.prototype.clear = function (bFocus)
this.setHtml('', bFocus);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5220,7 +5220,7 @@ Selector.prototype.on = function (sEventName, fCallback)
{
this.oCallbacks[sEventName] = fCallback;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5296,7 +5296,7 @@ CookieDriver.prototype.get = function (sKey)
return mResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5369,7 +5369,7 @@ LocalStorageDriver.prototype.get = function (sKey)
return mResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5414,7 +5414,7 @@ LocalStorage.prototype.get = function (iKey)
{
return this.oDriver ? this.oDriver.get('p' + iKey) : null;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5429,7 +5429,7 @@ KnoinAbstractBoot.prototype.bootstart = function ()
{
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5524,7 +5524,7 @@ KnoinAbstractViewModel.prototype.registerPopupKeyDown = function ()
return true;
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -5602,7 +5602,7 @@ KnoinAbstractScreen.prototype.__start = function ()
this.oCross = oRoute;
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6018,7 +6018,7 @@ Knoin.prototype.bootstart = function ()
};
kn = new Knoin();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6384,7 +6384,7 @@ EmailModel.prototype.inputoTagLine = function ()
{
return 0 < this.name.length ? this.name + ' (' + this.email + ')' : this.email;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6510,7 +6510,7 @@ ContactModel.prototype.lineAsCcc = function ()
return aResult.join(' ');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6541,7 +6541,7 @@ function ContactPropertyModel(iType, sTypeStr, sValue, bFocused, sPlaceholder)
}, this);
}
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6587,7 +6587,7 @@ ContactTagModel.prototype.toLine = function (bEncodeHtml)
return (Utils.isUnd(bEncodeHtml) ? false : !!bEncodeHtml) ?
Utils.encodeHtml(this.name()) : this.name();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6825,7 +6825,7 @@ AttachmentModel.prototype.iconClass = function ()
return sClass;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -6888,7 +6888,7 @@ ComposeAttachmentModel.prototype.initByUploadJson = function (oJsonAttachment)
}
return bResult;
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8110,7 +8110,7 @@ MessageModel.prototype.flagHash = function ()
return [this.deleted(), this.unseen(), this.flagged(), this.answered(), this.forwarded(),
this.isReadReceipt()].join('');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8444,7 +8444,7 @@ FolderModel.prototype.printableFullName = function ()
{
return this.fullName.split(this.delimiter).join(' / ');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8467,7 +8467,7 @@ AccountModel.prototype.email = '';
AccountModel.prototype.changeAccountLink = function ()
{
return RL.link().change(this.email);
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8505,81 +8505,32 @@ IdentityModel.prototype.formattedNameForEmail = function ()
var sName = this.name();
return '' === sName ? this.email() : '"' + Utils.quoteName(sName) + '" <' + this.email() + '>';
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
*/
function FilterActionModel(oKoList, oKoCanBeDeleted)
function FilterConditionModel(oKoList)
{
this.parentList = oKoList;
this.canBeDeleted = oKoCanBeDeleted;
this.value = ko.observable('');
this.field = ko.observable(Enums.FilterConditionField.From);
this.type = ko.observable(Enums.FiltersAction.Move);
this.typeOptions = [ // TODO i18n
{'id': Enums.FiltersAction.Move, 'name': 'Move to'},
{'id': Enums.FiltersAction.Forward, 'name': 'Forward to'},
{'id': Enums.FiltersAction.Delete, 'name': 'Discard'},
{'id': Enums.FiltersAction.MarkAsRead, 'name': 'Mark as read'}
];
this.template = ko.computed(function () {
var sTemplate = '';
switch (this.type())
{
default:
case Enums.FiltersAction.Move:
sTemplate = 'SettingsFiltersActionValueAsFolders';
break;
case Enums.FiltersAction.Forward:
sTemplate = 'SettingsFiltersActionWithValue';
break;
case Enums.FiltersAction.MarkAsRead:
case Enums.FiltersAction.Delete:
sTemplate = 'SettingsFiltersActionNoValue';
break;
}
return sTemplate;
}, this);
}
FilterActionModel.prototype.removeSelf = function ()
{
if (this.canBeDeleted())
{
this.parentList.remove(this);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
*/
function FilterConditionModel(oKoList, oKoCanBeDeleted)
{
this.parentList = oKoList;
this.canBeDeleted = oKoCanBeDeleted;
this.field = ko.observable(Enums.FilterConditionField.Subject);
this.fieldOptions = [ // TODO i18n
{'id': Enums.FilterConditionField.Subject, 'name': 'Subject'},
{'id': Enums.FilterConditionField.Recipient, 'name': 'Recipient (To or CC)'},
{'id': Enums.FilterConditionField.From, 'name': 'From'},
{'id': Enums.FilterConditionField.To, 'name': 'To'}
{'id': Enums.FilterConditionField.Recipient, 'name': 'Recipient (To or CC)'},
{'id': Enums.FilterConditionField.To, 'name': 'To'},
{'id': Enums.FilterConditionField.Subject, 'name': 'Subject'}
];
this.type = ko.observable(Enums.FilterConditionType.Contains);
this.type = ko.observable(Enums.FilterConditionType.EqualTo);
this.typeOptions = [ // TODO i18n
{'id': Enums.FilterConditionType.Contains, 'name': 'Contains'},
{'id': Enums.FilterConditionType.NotContains, 'name': 'Not Contains'},
{'id': Enums.FilterConditionType.EqualTo, 'name': 'Equal To'},
{'id': Enums.FilterConditionType.NotEqualTo, 'name': 'Not Equal To'}
{'id': Enums.FilterConditionType.NotEqualTo, 'name': 'Not Equal To'},
{'id': Enums.FilterConditionType.Contains, 'name': 'Contains'},
{'id': Enums.FilterConditionType.NotContains, 'name': 'Not Contains'}
];
this.value = ko.observable('');
@ -8601,12 +8552,9 @@ function FilterConditionModel(oKoList, oKoCanBeDeleted)
FilterConditionModel.prototype.removeSelf = function ()
{
if (this.canBeDeleted())
{
this.parentList.remove(this);
}
this.parentList.remove(this);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8614,6 +8562,7 @@ FilterConditionModel.prototype.removeSelf = function ()
*/
function FilterModel()
{
this.new = ko.observable(true);
this.enabled = ko.observable(true);
this.name = ko.observable('');
@ -8621,33 +8570,56 @@ function FilterModel()
this.conditionsType = ko.observable(Enums.FilterRulesType.And);
this.conditions = ko.observableArray([]);
this.actions = ko.observableArray([]);
this.conditions.subscribe(function () {
Utils.windowResize();
});
this.actions.subscribe(function () {
Utils.windowResize();
});
// Actions
this.actionMarkAsRead = ko.observable(false);
this.actionSkipOtherFilters = ko.observable(true);
this.actionValue = ko.observable('');
this.conditionsCanBeDeleted = ko.computed(function () {
return 1 < this.conditions().length;
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'}
];
this.actionMarkAsReadVisiblity = ko.computed(function () {
return -1 < Utils.inArray(this.actionType(), [
Enums.FiltersAction.None, Enums.FiltersAction.Forward, Enums.FiltersAction.Move
]);
}, this);
this.actionsCanBeDeleted = ko.computed(function () {
return 1 < this.actions().length;
this.actionTemplate = ko.computed(function () {
var sTemplate = '';
switch (this.actionType())
{
default:
case Enums.FiltersAction.Move:
sTemplate = 'SettingsFiltersActionValueAsFolders';
break;
case Enums.FiltersAction.Forward:
sTemplate = 'SettingsFiltersActionWithValue';
break;
case Enums.FiltersAction.None:
case Enums.FiltersAction.Discard:
sTemplate = 'SettingsFiltersActionNoValue';
break;
}
return sTemplate;
}, this);
}
FilterModel.prototype.addCondition = function ()
{
this.conditions.push(new FilterConditionModel(this.conditions, this.conditionsCanBeDeleted));
};
FilterModel.prototype.addAction = function ()
{
this.actions.push(new FilterActionModel(this.actions, this.actionsCanBeDeleted));
this.conditions.push(new FilterConditionModel(this.conditions));
};
FilterModel.prototype.parse = function (oItem)
@ -8662,7 +8634,7 @@ FilterModel.prototype.parse = function (oItem)
return bResult;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8695,7 +8667,7 @@ OpenPgpKeyModel.prototype.user = '';
OpenPgpKeyModel.prototype.email = '';
OpenPgpKeyModel.prototype.armor = '';
OpenPgpKeyModel.prototype.isPrivate = false;
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8793,7 +8765,7 @@ PopupsFolderClearViewModel.prototype.onShow = function (oFolder)
this.selectedFolder(oFolder);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -8905,7 +8877,7 @@ PopupsFolderCreateViewModel.prototype.onFocus = function ()
{
this.folderName.focused(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -9020,7 +8992,7 @@ PopupsFolderSystemViewModel.prototype.onShow = function (iNotificationType)
this.notification(sNotification);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -10715,7 +10687,7 @@ PopupsComposeViewModel.prototype.triggerForResize = function ()
this.editorResizeThrottle();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11459,7 +11431,7 @@ PopupsContactsViewModel.prototype.onHide = function ()
// oItem.checked(false);
// });
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11597,7 +11569,7 @@ PopupsAdvancedSearchViewModel.prototype.onFocus = function ()
{
this.fromFocus(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11693,7 +11665,7 @@ PopupsAddAccountViewModel.prototype.onFocus = function ()
{
this.emailFocus(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11784,7 +11756,7 @@ PopupsAddOpenPgpKeyViewModel.prototype.onFocus = function ()
{
this.key.focus(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11826,7 +11798,7 @@ PopupsViewOpenPgpKeyViewModel.prototype.onShow = function (oOpenPgpKey)
this.key(oOpenPgpKey.armor);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -11923,7 +11895,7 @@ PopupsGenerateNewOpenPgpKeyViewModel.prototype.onFocus = function ()
{
this.email.focus(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12165,7 +12137,7 @@ PopupsComposeOpenPgpViewModel.prototype.onShow = function (fCallback, sText, sFr
this.to(aRec);
this.text(sText);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12315,7 +12287,7 @@ PopupsIdentityViewModel.prototype.onFocus = function ()
this.email.focused(true);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12377,7 +12349,7 @@ PopupsLanguagesViewModel.prototype.changeLanguage = function (sLang)
RL.data().mainLanguage(sLang);
this.cancelCommand();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12433,7 +12405,7 @@ PopupsTwoFactorTestViewModel.prototype.onFocus = function ()
{
this.code.focused(true);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12546,7 +12518,7 @@ PopupsAskViewModel.prototype.onBuild = function ()
}, this));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12593,7 +12565,45 @@ PopupsKeyboardShortcutsHelpViewModel.prototype.onBuild = function (oDom)
}
}, this));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
* @extends KnoinAbstractViewModel
*/
function PopupsFilterViewModel()
{
KnoinAbstractViewModel.call(this, 'Popups', 'PopupsFilter');
this.filter = ko.observable(null);
this.selectedFolderValue = ko.observable(Consts.Values.UnuseOptionValue);
this.folderSelectList = RL.data().folderMenuForMove;
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
Knoin.constructorEnd(this);
}
Utils.extendAsViewModel('PopupsFilterViewModel', PopupsFilterViewModel);
PopupsFilterViewModel.prototype.clearPopup = function ()
{
};
PopupsFilterViewModel.prototype.onShow = function (oFilter)
{
this.clearPopup();
this.filter(oFilter);
};
PopupsFilterViewModel.prototype.onFocus = function ()
{
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -12938,7 +12948,7 @@ LoginViewModel.prototype.selectLanguage = function ()
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13036,7 +13046,7 @@ AbstractSystemDropDownViewModel.prototype.onBuild = function ()
}
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13050,7 +13060,7 @@ function MailBoxSystemDropDownViewModel()
}
Utils.extendAsViewModel('MailBoxSystemDropDownViewModel', MailBoxSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13064,7 +13074,7 @@ function SettingsSystemDropDownViewModel()
}
Utils.extendAsViewModel('SettingsSystemDropDownViewModel', SettingsSystemDropDownViewModel, AbstractSystemDropDownViewModel);
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -13314,7 +13324,7 @@ MailBoxFolderListViewModel.prototype.contactsClick = function ()
kn.showScreenPopup(PopupsContactsViewModel);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -14219,7 +14229,7 @@ MailBoxMessageListViewModel.prototype.initUploaderForAppend = function ()
;
return !!oJua;
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -14913,7 +14923,7 @@ MailBoxMessageViewViewModel.prototype.readReceipt = function (oMessage)
RL.reloadFlagsCurrentMessageListAndMessageFromCache();
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -14944,7 +14954,7 @@ SettingsMenuViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -14977,7 +14987,7 @@ SettingsPaneViewModel.prototype.backToMailBoxClick = function ()
{
kn.setHash(RL.link().inbox());
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15139,7 +15149,7 @@ SettingsGeneral.prototype.selectLanguage = function ()
{
kn.showScreenPopup(PopupsLanguagesViewModel);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15191,7 +15201,7 @@ SettingsContacts.prototype.onBuild = function ()
//{
//
//};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15274,7 +15284,7 @@ SettingsAccounts.prototype.deleteAccount = function (oAccountToRemove)
}
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15364,7 +15374,7 @@ SettingsIdentity.prototype.onBuild = function ()
}, 50);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15583,7 +15593,7 @@ SettingsIdentities.prototype.onBuild = function (oDom)
});
}, 50);
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15614,13 +15624,9 @@ SettingsFilters.prototype.deleteFilter = function (oFilter)
SettingsFilters.prototype.addFilter = function ()
{
var oFilter = new FilterModel();
oFilter.addCondition();
oFilter.addAction();
this.filters.push(oFilter);
kn.showScreenPopup(PopupsFilterViewModel, [new FilterModel()]);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15772,7 +15778,7 @@ SettingsSecurity.prototype.onBuild = function ()
this.processing(true);
RL.remote().getTwoFactor(this.onResult);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15841,7 +15847,7 @@ function SettingsSocialScreen()
}
Utils.addSettingsViewModel(SettingsSocialScreen, 'SettingsSocial', 'SETTINGS_LABELS/LABEL_SOCIAL_NAME', 'social');
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -15948,7 +15954,7 @@ SettingsChangePasswordScreen.prototype.onChangePasswordResponse = function (sRes
Utils.getNotification(Enums.Notification.CouldNotSaveNewPassword));
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16145,7 +16151,7 @@ SettingsFolders.prototype.unSubscribeFolder = function (oFolder)
oFolder.subScribed(false);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16261,7 +16267,7 @@ SettingsThemes.prototype.onBuild = function ()
};
}));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16331,7 +16337,7 @@ SettingsOpenPGP.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
RL.reloadOpenPgpKeys();
}
}
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -16466,7 +16472,7 @@ AbstractData.prototype.populateDataOnStart = function()
this.contactsIsAllowed(!!RL.settingsGet('ContactsIsAllowed'));
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -17725,7 +17731,7 @@ WebMailDataStorage.prototype.findSelfPrivateKey = function (sPassword)
{
return this.findPrivateKeyByEmail(this.accountEmail(), sPassword);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -18009,7 +18015,7 @@ AbstractAjaxRemoteStorage.prototype.jsVersion = function (fCallback, sVersion)
'Version': sVersion
});
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -18809,7 +18815,7 @@ WebMailAjaxRemoteStorage.prototype.socialUsers = function (fCallback)
this.defaultRequest(fCallback, 'SocialUsers');
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -18870,7 +18876,7 @@ AbstractCacheStorage.prototype.setServicesData = function (oData)
{
this.oServices = oData;
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19190,7 +19196,7 @@ WebMailCacheStorage.prototype.storeMessageFlagsToCacheByFolderAndUid = function
this.setMessageFlagsToCache(sFolder, sUid, aFlags);
}
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19372,7 +19378,7 @@ AbstractSettings.prototype.routes = function ()
['', oRules]
];
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19389,7 +19395,7 @@ _.extend(LoginScreen.prototype, KnoinAbstractScreen.prototype);
LoginScreen.prototype.onShow = function ()
{
RL.setTitle('');
};
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19562,7 +19568,7 @@ MailBoxScreen.prototype.routes = function ()
[/^([^\/]*)$/, {'normalize_': fNormS}]
];
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19591,7 +19597,7 @@ SettingsScreen.prototype.onShow = function ()
RL.setTitle(this.sSettingsTitle);
RL.data().keyScope(Enums.KeyState.Settings);
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -19951,7 +19957,7 @@ AbstractApp.prototype.bootstart = function ()
ssm.ready();
};
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
@ -21248,7 +21254,7 @@ RainLoopApp.prototype.bootstart = function ()
* @type {RainLoopApp}
*/
RL = new RainLoopApp();
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
$html.addClass(Globals.bMobileDevice ? 'mobile' : 'no-mobile');
@ -21301,7 +21307,7 @@ window['__RLBOOT'] = function (fCall) {
window['__RLBOOT'] = null;
});
};
if (window.SimplePace) {
window.SimplePace.add(10);
}

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long