Added export contacts (vCard)

This commit is contained in:
RainLoop Team 2014-04-29 00:34:34 +04:00
parent c25b5bfef7
commit c248292f07
37 changed files with 489 additions and 237 deletions

View file

@ -227,6 +227,22 @@ LinkBuilder.prototype.getUserPicUrlFromHash = function (sHash)
return this.sServer + '/Raw/' + this.sSpecSuffix + '/UserPic/' + sHash + '/' + this.sVersion + '/';
};
/**
* @return {string}
*/
LinkBuilder.prototype.exportContactsVcf = function ()
{
return this.sServer + '/Raw/' + this.sSpecSuffix + '/ContactsVcf/';
};
/**
* @return {string}
*/
LinkBuilder.prototype.exportContactsCsv = function ()
{
return this.sServer + '/Raw/' + this.sSpecSuffix + '/ContactsCsv/';
};
/**
* @return {string}
*/

View file

@ -87,6 +87,9 @@ function WebMailDataStorage()
this.contacts.loading = ko.observable(false).extend({'throttle': 200});
this.contacts.importing = ko.observable(false).extend({'throttle': 200});
this.contacts.syncing = ko.observable(false).extend({'throttle': 200});
this.contacts.exportingVcf = ko.observable(false).extend({'throttle': 200});
this.contacts.exportingCsv = ko.observable(false).extend({'throttle': 200});
this.contacts.skipNextSync = false;
this.allowContactsSync = ko.observable(false);

View file

@ -19,6 +19,7 @@ function PopupsContactsViewModel()
this.allowContactsSync = RL.data().allowContactsSync;
this.enableContactsSync = RL.data().enableContactsSync;
this.allowExport = !Globals.bMobileDevice;
this.search = ko.observable('');
this.contactsCount = ko.observable(0);
@ -317,6 +318,16 @@ PopupsContactsViewModel.prototype.addNewPhone = function ()
this.addNewProperty(Enums.ContactPropertyType.Phone, 'Mobile');
};
PopupsContactsViewModel.prototype.exportVcf = function ()
{
RL.download(RL.link().exportContactsVcf());
};
PopupsContactsViewModel.prototype.exportCsv = function ()
{
RL.download(RL.link().exportContactsCsv());
};
PopupsContactsViewModel.prototype.initUploader = function ()
{
if (this.importUploaderButton())