Login screen new interface (social buttons)

This commit is contained in:
RainLoop Team 2014-10-30 17:59:25 +04:00
parent 28a684b7c8
commit 77a30c0b92
40 changed files with 622 additions and 630 deletions

View file

@ -19,7 +19,7 @@
/**
* @constructor
*/
function AccountsUserSetting()
function AccountsUserSettings()
{
this.accounts = Data.accounts;
@ -46,12 +46,12 @@
]});
}
AccountsUserSetting.prototype.addNewAccount = function ()
AccountsUserSettings.prototype.addNewAccount = function ()
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/AddAccount'));
};
AccountsUserSetting.prototype.editAccount = function (oAccountItem)
AccountsUserSettings.prototype.editAccount = function (oAccountItem)
{
if (oAccountItem && oAccountItem.canBeEdit())
{
@ -62,7 +62,7 @@
/**
* @param {AccountModel} oAccountToRemove
*/
AccountsUserSetting.prototype.deleteAccount = function (oAccountToRemove)
AccountsUserSettings.prototype.deleteAccount = function (oAccountToRemove)
{
if (oAccountToRemove && oAccountToRemove.deleteAccess())
{
@ -102,7 +102,7 @@
}
};
AccountsUserSetting.prototype.onBuild = function (oDom)
AccountsUserSettings.prototype.onBuild = function (oDom)
{
var self = this;
@ -117,6 +117,6 @@
;
};
module.exports = AccountsUserSetting;
module.exports = AccountsUserSettings;
}());

View file

@ -16,7 +16,7 @@
/**
* @constructor
*/
function ChangePasswordUserSetting()
function ChangePasswordUserSettings()
{
this.changeProcess = ko.observable(false);
@ -76,7 +76,7 @@
this.onChangePasswordResponse = _.bind(this.onChangePasswordResponse, this);
}
ChangePasswordUserSetting.prototype.onHide = function ()
ChangePasswordUserSettings.prototype.onHide = function ()
{
this.changeProcess(false);
this.currentPassword('');
@ -87,7 +87,7 @@
this.currentPassword.error(false);
};
ChangePasswordUserSetting.prototype.onChangePasswordResponse = function (sResult, oData)
ChangePasswordUserSettings.prototype.onChangePasswordResponse = function (sResult, oData)
{
this.changeProcess(false);
this.passwordMismatch(false);
@ -116,6 +116,6 @@
}
};
module.exports = ChangePasswordUserSetting;
module.exports = ChangePasswordUserSettings;
}());

View file

@ -13,7 +13,7 @@
/**
* @constructor
*/
function ContactsUserSetting()
function ContactsUserSettings()
{
this.contactsAutosave = Data.contactsAutosave;
@ -31,6 +31,15 @@
this.contactsSyncPass()
].join('|');
}, this).extend({'throttle': 500});
}
ContactsUserSettings.prototype.onBuild = function ()
{
Data.contactsAutosave.subscribe(function (bValue) {
Remote.saveSettings(null, {
'ContactsAutosave': bValue ? '1' : '0'
});
});
this.saveTrigger.subscribe(function () {
Remote.saveContactsSyncData(null,
@ -40,17 +49,8 @@
this.contactsSyncPass()
);
}, this);
}
ContactsUserSetting.prototype.onBuild = function ()
{
Data.contactsAutosave.subscribe(function (bValue) {
Remote.saveSettings(null, {
'ContactsAutosave': bValue ? '1' : '0'
});
});
};
module.exports = ContactsUserSetting;
module.exports = ContactsUserSettings;
}());

View file

@ -12,7 +12,7 @@
/**
* @constructor
*/
function FiltersUserSetting()
function FiltersUserSettings()
{
this.filters = ko.observableArray([]);
this.filters.loading = ko.observable(false);
@ -22,13 +22,13 @@
});
}
FiltersUserSetting.prototype.deleteFilter = function (oFilter)
FiltersUserSettings.prototype.deleteFilter = function (oFilter)
{
this.filters.remove(oFilter);
Utils.delegateRunOnDestroy(oFilter);
};
FiltersUserSetting.prototype.addFilter = function ()
FiltersUserSettings.prototype.addFilter = function ()
{
var
FilterModel = require('Model/Filter')
@ -38,6 +38,6 @@
require('View/Popup/Filter'), [new FilterModel()]);
};
module.exports = FiltersUserSetting;
module.exports = FiltersUserSettings;
}());

View file

@ -19,7 +19,7 @@
/**
* @constructor
*/
function FoldersUserSetting()
function FoldersUserSettings()
{
this.foldersListError = Data.foldersListError;
this.folderList = Data.folderList;
@ -89,7 +89,7 @@
this.useImapSubscribe = !!Settings.settingsGet('UseImapSubscribe');
}
FoldersUserSetting.prototype.folderEditOnEnter = function (oFolder)
FoldersUserSettings.prototype.folderEditOnEnter = function (oFolder)
{
var
sEditName = oFolder ? Utils.trim(oFolder.nameForEdit()) : ''
@ -121,7 +121,7 @@
oFolder.edited(false);
};
FoldersUserSetting.prototype.folderEditOnEsc = function (oFolder)
FoldersUserSettings.prototype.folderEditOnEsc = function (oFolder)
{
if (oFolder)
{
@ -129,22 +129,22 @@
}
};
FoldersUserSetting.prototype.onShow = function ()
FoldersUserSettings.prototype.onShow = function ()
{
Data.foldersListError('');
};
FoldersUserSetting.prototype.createFolder = function ()
FoldersUserSettings.prototype.createFolder = function ()
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderCreate'));
};
FoldersUserSetting.prototype.systemFolder = function ()
FoldersUserSettings.prototype.systemFolder = function ()
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/FolderSystem'));
};
FoldersUserSetting.prototype.deleteFolder = function (oFolderToRemove)
FoldersUserSettings.prototype.deleteFolder = function (oFolderToRemove)
{
if (oFolderToRemove && oFolderToRemove.canBeDeleted() && oFolderToRemove.deleteAccess() &&
0 === oFolderToRemove.privateMessageCountAll())
@ -193,7 +193,7 @@
}
};
FoldersUserSetting.prototype.subscribeFolder = function (oFolder)
FoldersUserSettings.prototype.subscribeFolder = function (oFolder)
{
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, true);
@ -201,7 +201,7 @@
oFolder.subScribed(true);
};
FoldersUserSetting.prototype.unSubscribeFolder = function (oFolder)
FoldersUserSettings.prototype.unSubscribeFolder = function (oFolder)
{
Local.set(Enums.ClientSideKeyName.FoldersLashHash, '');
Remote.folderSetSubscribe(Utils.emptyFunction, oFolder.fullNameRaw, false);
@ -209,6 +209,6 @@
oFolder.subScribed(false);
};
module.exports = FoldersUserSetting;
module.exports = FoldersUserSettings;
}());

View file

@ -19,7 +19,7 @@
/**
* @constructor
*/
function GeneralUserSetting()
function GeneralUserSettings()
{
this.mainLanguage = Data.mainLanguage;
this.mainMessagesPerPage = Data.mainMessagesPerPage;
@ -74,12 +74,12 @@
}, this);
}
GeneralUserSetting.prototype.toggleLayout = function ()
GeneralUserSettings.prototype.toggleLayout = function ()
{
this.layout(Enums.Layout.NoPreview === this.layout() ? Enums.Layout.SidePreview : Enums.Layout.NoPreview);
};
GeneralUserSetting.prototype.onBuild = function ()
GeneralUserSettings.prototype.onBuild = function ()
{
var self = this;
@ -178,16 +178,16 @@
}, 50);
};
GeneralUserSetting.prototype.onShow = function ()
GeneralUserSettings.prototype.onShow = function ()
{
Data.desktopNotifications.valueHasMutated();
};
GeneralUserSetting.prototype.selectLanguage = function ()
GeneralUserSettings.prototype.selectLanguage = function ()
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Languages'));
};
module.exports = GeneralUserSetting;
module.exports = GeneralUserSettings;
}());

View file

@ -18,7 +18,7 @@
/**
* @constructor
*/
function IdentitiesUserSetting()
function IdentitiesUserSettings()
{
this.editor = null;
this.defautOptionsAfterRender = Utils.defautOptionsAfterRender;
@ -100,7 +100,7 @@
*
* @return {string}
*/
IdentitiesUserSetting.prototype.formattedAccountIdentity = function ()
IdentitiesUserSettings.prototype.formattedAccountIdentity = function ()
{
var
sDisplayName = this.displayName.peek(),
@ -110,12 +110,12 @@
return '' === sDisplayName ? sEmail : '"' + Utils.quoteName(sDisplayName) + '" <' + sEmail + '>';
};
IdentitiesUserSetting.prototype.addNewIdentity = function ()
IdentitiesUserSettings.prototype.addNewIdentity = function ()
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'));
};
IdentitiesUserSetting.prototype.editIdentity = function (oIdentity)
IdentitiesUserSettings.prototype.editIdentity = function (oIdentity)
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/Identity'), [oIdentity]);
};
@ -123,7 +123,7 @@
/**
* @param {IdentityModel} oIdentityToRemove
*/
IdentitiesUserSetting.prototype.deleteIdentity = function (oIdentityToRemove)
IdentitiesUserSettings.prototype.deleteIdentity = function (oIdentityToRemove)
{
if (oIdentityToRemove && oIdentityToRemove.deleteAccess())
{
@ -146,7 +146,7 @@
}
};
IdentitiesUserSetting.prototype.onFocus = function ()
IdentitiesUserSettings.prototype.onFocus = function ()
{
if (!this.editor && this.signatureDom())
{
@ -172,7 +172,7 @@
}
};
IdentitiesUserSetting.prototype.onBuild = function (oDom)
IdentitiesUserSettings.prototype.onBuild = function (oDom)
{
var self = this;
@ -228,6 +228,6 @@
}, 50);
};
module.exports = IdentitiesUserSetting;
module.exports = IdentitiesUserSettings;
}());

View file

@ -18,7 +18,7 @@
/**
* @constructor
*/
function IdentityUserSetting()
function IdentityUserSettings()
{
this.editor = null;
@ -34,7 +34,7 @@
this.signatureTrigger = ko.observable(Enums.SaveSettingsStep.Idle);
}
IdentityUserSetting.prototype.onFocus = function ()
IdentityUserSettings.prototype.onFocus = function ()
{
if (!this.editor && this.signatureDom())
{
@ -60,7 +60,7 @@
}
};
IdentityUserSetting.prototype.onBuild = function ()
IdentityUserSettings.prototype.onBuild = function ()
{
var self = this;
_.delay(function () {
@ -98,6 +98,6 @@
}, 50);
};
module.exports = IdentityUserSetting;
module.exports = IdentityUserSettings;
}());

View file

@ -17,7 +17,7 @@
/**
* @constructor
*/
function OpenPgpUserSetting()
function OpenPgpUserSettings()
{
this.openpgpkeys = Data.openpgpkeys;
this.openpgpkeysPublic = Data.openpgpkeysPublic;
@ -38,17 +38,17 @@
]});
}
OpenPgpUserSetting.prototype.addOpenPgpKey = function ()
OpenPgpUserSettings.prototype.addOpenPgpKey = function ()
{
kn.showScreenPopup(require('View/Popup/AddOpenPgpKey'));
};
OpenPgpUserSetting.prototype.generateOpenPgpKey = function ()
OpenPgpUserSettings.prototype.generateOpenPgpKey = function ()
{
kn.showScreenPopup(require('View/Popup/NewOpenPgpKey'));
};
OpenPgpUserSetting.prototype.viewOpenPgpKey = function (oOpenPgpKey)
OpenPgpUserSettings.prototype.viewOpenPgpKey = function (oOpenPgpKey)
{
if (oOpenPgpKey)
{
@ -59,7 +59,7 @@
/**
* @param {OpenPgpKeyModel} oOpenPgpKeyToRemove
*/
OpenPgpUserSetting.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
OpenPgpUserSettings.prototype.deleteOpenPgpKey = function (oOpenPgpKeyToRemove)
{
if (oOpenPgpKeyToRemove && oOpenPgpKeyToRemove.deleteAccess())
{
@ -87,6 +87,6 @@
}
};
module.exports = OpenPgpUserSetting;
module.exports = OpenPgpUserSettings;
}());

View file

@ -16,7 +16,7 @@
/**
* @constructor
*/
function SecurityUserSetting()
function SecurityUserSettings()
{
this.processing = ko.observable(false);
this.clearing = ko.observable(false);
@ -46,37 +46,37 @@
this.onSecretResult = _.bind(this.onSecretResult, this);
}
SecurityUserSetting.prototype.showSecret = function ()
SecurityUserSettings.prototype.showSecret = function ()
{
this.secreting(true);
Remote.showTwoFactorSecret(this.onSecretResult);
};
SecurityUserSetting.prototype.hideSecret = function ()
SecurityUserSettings.prototype.hideSecret = function ()
{
this.viewSecret('');
this.viewBackupCodes('');
this.viewUrl('');
};
SecurityUserSetting.prototype.createTwoFactor = function ()
SecurityUserSettings.prototype.createTwoFactor = function ()
{
this.processing(true);
Remote.createTwoFactor(this.onResult);
};
SecurityUserSetting.prototype.enableTwoFactor = function ()
SecurityUserSettings.prototype.enableTwoFactor = function ()
{
this.processing(true);
Remote.enableTwoFactor(this.onResult, this.viewEnable());
};
SecurityUserSetting.prototype.testTwoFactor = function ()
SecurityUserSettings.prototype.testTwoFactor = function ()
{
require('Knoin/Knoin').showScreenPopup(require('View/Popup/TwoFactorTest'));
};
SecurityUserSetting.prototype.clearTwoFactor = function ()
SecurityUserSettings.prototype.clearTwoFactor = function ()
{
this.viewSecret('');
this.viewBackupCodes('');
@ -86,14 +86,14 @@
Remote.clearTwoFactor(this.onResult);
};
SecurityUserSetting.prototype.onShow = function ()
SecurityUserSettings.prototype.onShow = function ()
{
this.viewSecret('');
this.viewBackupCodes('');
this.viewUrl('');
};
SecurityUserSetting.prototype.onResult = function (sResult, oData)
SecurityUserSettings.prototype.onResult = function (sResult, oData)
{
this.processing(false);
this.clearing(false);
@ -139,7 +139,7 @@
}
};
SecurityUserSetting.prototype.onSecretResult = function (sResult, oData)
SecurityUserSettings.prototype.onSecretResult = function (sResult, oData)
{
this.secreting(false);
@ -155,12 +155,12 @@
}
};
SecurityUserSetting.prototype.onBuild = function ()
SecurityUserSettings.prototype.onBuild = function ()
{
this.processing(true);
Remote.getTwoFactor(this.onResult);
};
module.exports = SecurityUserSetting;
module.exports = SecurityUserSettings;
}());

View file

@ -6,7 +6,7 @@
/**
* @constructor
*/
function SocialUserSetting()
function SocialUserSettings()
{
var
Utils = require('Common/Utils'),
@ -71,6 +71,6 @@
});
}
module.exports = SocialUserSetting;
module.exports = SocialUserSettings;
}());

View file

@ -18,7 +18,7 @@
/**
* @constructor
*/
function ThemesUserSetting()
function ThemesUserSettings()
{
var self = this;
@ -45,7 +45,7 @@
}, this);
}
ThemesUserSetting.prototype.onBuild = function ()
ThemesUserSettings.prototype.onBuild = function ()
{
var sCurrentTheme = Data.theme();
this.themesObjects(_.map(Data.themes(), function (sTheme) {
@ -58,6 +58,6 @@
}));
};
module.exports = ThemesUserSetting;
module.exports = ThemesUserSettings;
}());