mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-08-29 03:59:21 +03:00
parent
9cc791caba
commit
8c0276631b
36 changed files with 628 additions and 66 deletions
|
|
@ -32,8 +32,11 @@ function PopupsContactsViewModel()
|
|||
this.contactsCount = ko.observable(0);
|
||||
this.contacts = ko.observableArray([]);
|
||||
this.contacts.loading = ko.observable(false).extend({'throttle': 200});
|
||||
this.contacts.importing = ko.observable(false).extend({'throttle': 200});
|
||||
this.currentContact = ko.observable(null);
|
||||
|
||||
this.importUploaderButton = ko.observable(null);
|
||||
|
||||
this.contactsSharingIsAllowed = !!RL.settingsGet('ContactsSharingIsAllowed');
|
||||
|
||||
this.contactsPage = ko.observable(1);
|
||||
|
|
@ -336,6 +339,46 @@ PopupsContactsViewModel.prototype.addNewPhone = function ()
|
|||
this.addNewProperty(Enums.ContactPropertyType.MobilePersonal);
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.initUploader = function ()
|
||||
{
|
||||
if (this.importUploaderButton())
|
||||
{
|
||||
var
|
||||
oJua = new Jua({
|
||||
'action': RL.link().uploadContacts(),
|
||||
'name': 'uploader',
|
||||
'queueSize': 1,
|
||||
'multipleSizeLimit': 1,
|
||||
'disableFolderDragAndDrop': true,
|
||||
'disableDragAndDrop': true,
|
||||
'disableMultiple': true,
|
||||
'disableDocumentDropPrevent': true,
|
||||
'clickElement': this.importUploaderButton()
|
||||
})
|
||||
;
|
||||
|
||||
if (oJua)
|
||||
{
|
||||
oJua
|
||||
.on('onStart', _.bind(function () {
|
||||
this.contacts.importing(true);
|
||||
}, this))
|
||||
.on('onComplete', _.bind(function (sId, bResult, oData) {
|
||||
|
||||
this.contacts.importing(false);
|
||||
this.reloadContactList();
|
||||
|
||||
if (!sId || !bResult || !oData || !oData.Result)
|
||||
{
|
||||
window.alert(Utils.i18n('CONTACTS/ERROR_IMPORT_FILE'));
|
||||
}
|
||||
|
||||
}, this))
|
||||
;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.removeCheckedOrSelectedContactsFromList = function ()
|
||||
{
|
||||
var
|
||||
|
|
@ -575,6 +618,8 @@ PopupsContactsViewModel.prototype.onBuild = function (oDom)
|
|||
|
||||
return bResult;
|
||||
});
|
||||
|
||||
this.initUploader();
|
||||
};
|
||||
|
||||
PopupsContactsViewModel.prototype.onShow = function ()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue