mirror of
https://github.com/nextcloud/passman.git
synced 2025-11-10 22:22:38 +08:00
Fix code style
This commit is contained in:
parent
1b173e76a1
commit
2c0455ead1
3 changed files with 11 additions and 12 deletions
|
|
@ -46,8 +46,8 @@ PassmanExporter.csv.export = function (credentials, FileService, EncryptService)
|
||||||
for (var t = 0; t < _credential[field].length; t++) {
|
for (var t = 0; t < _credential[field].length; t++) {
|
||||||
_tags.push(_credential[field][t].text);
|
_tags.push(_credential[field][t].text);
|
||||||
}
|
}
|
||||||
var data = '[' + _tags.join(",") + ']';
|
var tag_data = '[' + _tags.join(",") + ']';
|
||||||
row_data.push('"' + data + '"');
|
row_data.push('"' + tag_data + '"');
|
||||||
}
|
}
|
||||||
else if (field == 'custom_fields' || field == 'files') {
|
else if (field == 'custom_fields' || field == 'files') {
|
||||||
var _fields = JSON.stringify(_credential[field]);
|
var _fields = JSON.stringify(_credential[field]);
|
||||||
|
|
@ -68,7 +68,7 @@ PassmanExporter.csv.export = function (credentials, FileService, EncryptService)
|
||||||
}
|
}
|
||||||
this.call_then();
|
this.call_then();
|
||||||
download(file_data, 'passman-export.csv');
|
download(file_data, 'passman-export.csv');
|
||||||
}).bind(this)).progress(function(progress) {
|
}).bind(this)).progress(function() {
|
||||||
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -33,7 +33,7 @@ PassmanExporter.json = {
|
||||||
PassmanExporter.json.export = function (credentials, FileService, EncryptService) {
|
PassmanExporter.json.export = function (credentials, FileService, EncryptService) {
|
||||||
/** global: C_Promise */
|
/** global: C_Promise */
|
||||||
return new C_Promise(function () {
|
return new C_Promise(function () {
|
||||||
PassmanExporter.getCredentialsWithFiles(credentials, FileService, EncryptService).then((function(data){
|
PassmanExporter.getCredentialsWithFiles(credentials, FileService, EncryptService).then((function(){
|
||||||
var _output = [];
|
var _output = [];
|
||||||
for (var i = 0; i < credentials.length; i++) {
|
for (var i = 0; i < credentials.length; i++) {
|
||||||
var _credential = angular.copy(credentials[i]);
|
var _credential = angular.copy(credentials[i]);
|
||||||
|
|
@ -42,7 +42,6 @@ PassmanExporter.json.export = function (credentials, FileService, EncryptService
|
||||||
delete _credential.vault_id;
|
delete _credential.vault_id;
|
||||||
delete _credential.shared_key;
|
delete _credential.shared_key;
|
||||||
|
|
||||||
console.log(_credential);
|
|
||||||
_output.push(_credential);
|
_output.push(_credential);
|
||||||
|
|
||||||
var progress = {
|
var progress = {
|
||||||
|
|
@ -55,8 +54,8 @@ PassmanExporter.json.export = function (credentials, FileService, EncryptService
|
||||||
var file_data = JSON.stringify(_output);
|
var file_data = JSON.stringify(_output);
|
||||||
this.call_then();
|
this.call_then();
|
||||||
download(file_data, 'passman-export.json');
|
download(file_data, 'passman-export.json');
|
||||||
}).bind(this)).progress(function(progress) {
|
}).bind(this)).progress(function() {
|
||||||
console.log(progress);
|
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -28,10 +28,10 @@ if (!window['PassmanExporter']) {
|
||||||
cred: credentials,
|
cred: credentials,
|
||||||
FS: FileService,
|
FS: FileService,
|
||||||
ES: EncryptService
|
ES: EncryptService
|
||||||
}
|
};
|
||||||
|
/** global: C_Promise */
|
||||||
return new C_Promise(function() {
|
return new C_Promise(function() {
|
||||||
_this = this.parent;
|
var _this = this.parent;
|
||||||
var credentials = _this.cred;
|
var credentials = _this.cred;
|
||||||
this.parent.total = 0;
|
this.parent.total = 0;
|
||||||
this.parent.finished = 0;
|
this.parent.finished = 0;
|
||||||
|
|
@ -68,7 +68,7 @@ if (!window['PassmanExporter']) {
|
||||||
var item = credentials[i];
|
var item = credentials[i];
|
||||||
|
|
||||||
// Custom fields
|
// Custom fields
|
||||||
for (var c = 0; c < item.custom_fields.length; c++) {
|
for (c = 0; c < item.custom_fields.length; c++) {
|
||||||
var cf = item.custom_fields[c];
|
var cf = item.custom_fields[c];
|
||||||
if (cf.field_type === 'file') {
|
if (cf.field_type === 'file') {
|
||||||
this.parent.total ++;
|
this.parent.total ++;
|
||||||
|
|
@ -100,5 +100,5 @@ if (!window['PassmanExporter']) {
|
||||||
}
|
}
|
||||||
}, t);
|
}, t);
|
||||||
}
|
}
|
||||||
}
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue