Code refactoring

a lot of small fixes (Closes #173)
Added login field (ownCloud package)
This commit is contained in:
RainLoop Team 2014-05-24 02:14:16 +04:00
parent a059b3d063
commit fed896776f
129 changed files with 1016 additions and 804 deletions

View file

@ -5,7 +5,6 @@
*/
function AdminSecurity()
{
this.csrfProtection = ko.observable(!!RL.settingsGet('UseTokenProtection'));
this.capaOpenPGP = ko.observable(RL.capa(Enums.Capa.OpenPGP));
this.capaTwoFactorAuth = ko.observable(RL.capa(Enums.Capa.TwoFactor));
@ -28,13 +27,13 @@ function AdminSecurity()
this.adminPasswordUpdateSuccess(false);
this.adminPasswordNewError(false);
}, this);
this.adminPasswordNew2.subscribe(function () {
this.adminPasswordUpdateError(false);
this.adminPasswordUpdateSuccess(false);
this.adminPasswordNewError(false);
}, this);
this.saveNewAdminPasswordCommand = Utils.createCommand(this, function () {
if (this.adminPasswordNew() !== this.adminPasswordNew2())
@ -78,12 +77,6 @@ AdminSecurity.prototype.onNewAdminPasswordResponse = function (sResult, oData)
AdminSecurity.prototype.onBuild = function ()
{
this.csrfProtection.subscribe(function (bValue) {
RL.remote().saveAdminConfig(Utils.emptyFunction, {
'TokenProtection': bValue ? '1' : '0'
});
});
this.capaOpenPGP.subscribe(function (bValue) {
RL.remote().saveAdminConfig(Utils.emptyFunction, {
'CapaOpenPGP': bValue ? '1' : '0'

View file

@ -1072,6 +1072,11 @@ RainLoopApp.prototype.bootstart = function ()
Utils.removeSettingsViewModel(SettingsThemes);
}
if (!RL.capa(Enums.Capa.Filters))
{
Utils.removeSettingsViewModel(SettingsFilters);
}
if (!bGoogle && !bFacebook && !bTwitter)
{
Utils.removeSettingsViewModel(SettingsSocialScreen);

View file

@ -37,6 +37,7 @@ Enums.Capa = {
'Prefetch': 'PREFETCH',
'Gravatar': 'GRAVATAR',
'Themes': 'THEMES',
'Filters': 'FILTERS',
'AdditionalAccounts': 'ADDITIONAL_ACCOUNTS',
'AdditionalIdentities': 'ADDITIONAL_IDENTITIES'
};
@ -278,6 +279,34 @@ Enums.Layout = {
'BottomPreview': 2
};
/**
* @enum {number}
*/
Enums.FilterConditionField = {
'From': 0,
'To': 1,
'Subject': 2
};
/**
* @enum {number}
*/
Enums.FilterConditionType = {
'contains': 0,
'NotContains': 1,
'EqualTo': 2,
'NotEqualTo': 3
};
/**
* @enum {number}
*/
Enums.FiltersAction = {
'None': 0,
'Move': 1,
'Delete': 2
};
/**
* @enum {number}
*/
@ -345,7 +374,7 @@ Enums.Notification = {
'NewPasswordShort': 132,
'NewPasswordWeak': 133,
'NewPasswordForbidden': 134,
'ContactsSyncError': 140,
'CantGetMessageList': 201,
@ -374,13 +403,13 @@ Enums.Notification = {
'CantDeletePackage': 702,
'InvalidPluginPackage': 703,
'UnsupportedPluginPackage': 704,
'LicensingServerIsUnavailable': 710,
'LicensingExpired': 711,
'LicensingBanned': 712,
'DemoSendMessageError': 750,
'AccountAlreadyExists': 801,
'MailServerError': 901,

View file

@ -80,7 +80,7 @@ ko.bindingHandlers.tooltip3 = {
$document.click(function () {
$oEl.tooltip('hide');
});
Globals.tooltipTrigger.subscribe(function () {
$oEl.tooltip('hide');
});

View file

@ -0,0 +1,8 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
*/
function FilterConditionModel()
{
}

36
dev/Models/FilterModel.js Normal file
View file

@ -0,0 +1,36 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
*/
function FilterModel()
{
this.enabled = ko.observable(true);
this.conditions = ko.observableArray([]);
this.action = ko.observable(Enums.FiltersAction.None);
}
FilterModel.prototype.deleteCondition = function (oCondition)
{
this.conditions.remove(oCondition);
};
FilterModel.prototype.addCondition = function ()
{
this.conditions.push(new FilterConditionModel());
};
FilterModel.prototype.parse = function (oItem)
{
var bResult = false;
if (oItem && 'Object/Filter' === oItem['@Object'])
{
this.name(Utils.pString(oItem['Name']));
bResult = true;
}
return bResult;
};

31
dev/Settings/Filters.js Normal file
View file

@ -0,0 +1,31 @@
/* RainLoop Webmail (c) RainLoop Team | Licensed under CC BY-NC-SA 3.0 */
/**
* @constructor
*/
function SettingsFilters()
{
// var oData = RL.data();
this.filters = ko.observableArray([]);
this.filters.loading = ko.observable(false);
}
Utils.addSettingsViewModel(SettingsFilters, 'SettingsFilters', 'SETTINGS_LABELS/LABEL_FILTERS_NAME', 'filters');
//SettingsFilters.prototype.onBuild = function ()
//{
//};
SettingsFilters.prototype.deleteFilter = function (oFilter)
{
this.filters.remove(oFilter);
};
SettingsFilters.prototype.addFilter = function ()
{
var oFilter = new FilterModel();
oFilter.addCondition();
this.filters.push(oFilter);
};

View file

@ -37,6 +37,7 @@
right: 0;
overflow: hidden;
overflow-y: auto;
min-width: 100px;
// padding: 5px;
.content {

View file

@ -1,24 +1,24 @@
.nano:before, .nano:after {
display: none;
content: "";
position: absolute;
left: 0;
width: 100%;
height: 2px;
z-index: 102;
-webkit-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
-moz-box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
box-shadow: 0px 0px 8px rgba(0, 0, 0, 0.5);
}
.nano:before {
top: -2px;
}
.nano:after {
bottom: -2px;
}
.nano.nano-scrolllimit-top:before, .nano.nano-scrolllimit-bottom:after {
display: block;
.nano:before, .nano:after {
display: none;
content: "";
position: absolute;
left: 0;
width: 100%;
height: 10px;
z-index: 102;
-webkit-box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);
-moz-box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);
box-shadow: 0px 0px 20px rgba(0, 0, 0, 0.3);
}
.nano:before {
top: -10px;
}
.nano:after {
bottom: -10px;
}
.nano.nano-scrolllimit-top:before, .nano.nano-scrolllimit-bottom:after {
display: block;
}

View file

@ -190,6 +190,7 @@ html.cssanimations {
height: 15px;
background-color: #ddd;
margin: 0 5px;
.box-shadow(0px 0px 3px rgba(0, 0, 0, 0.3));
border-radius: 100%;
display: inline-block;
@ -209,7 +210,7 @@ html.cssanimations {
-webkit-animation-delay: -0.16s;
animation-delay: -0.16s;
}
}
@-webkit-keyframes bouncedelay {

View file

@ -122,6 +122,8 @@ html.rgba.textshadow {
.tooltip {
font-size: 14px;
z-index: 2000 !important;
overflow: hidden;
text-overflow: ellipsis;
&.in {
.opacity(100);
@ -130,17 +132,20 @@ html.rgba.textshadow {
.tooltip-class {
}
.tooltip-inner {
max-width: 400px;
text-shadow: 0px 0px 5px rgba(0, 0, 0, 0.2);
padding: 5px 10px;
.border-radius(2px);
}
.tooltip-big {
font-size: 18px;
padding: 0 10px;
white-space: nowrap;
}
}
.tooltip-inner {
padding: 5px 10px;
.border-radius(2px);
}
// Set corners individual because sometimes a single button can be in a .btn-group and we need :first-child and :last-child to both match
.btn-group > .btn:first-child {
-webkit-border-top-left-radius: @btnBorderRadius;

View file

@ -9,7 +9,7 @@ function AbstractSystemDropDownViewModel()
KnoinAbstractViewModel.call(this, 'Right', 'SystemDropDown');
var oData = RL.data();
this.accounts = oData.accounts;
this.accountEmail = oData.accountEmail;
this.accountsLoading = oData.accountsLoading;
@ -37,7 +37,7 @@ AbstractSystemDropDownViewModel.prototype.accountClick = function (oAccount, oEv
self.accountsLoading(false);
}, 1000);
}
return true;
};