Skip to content
This repository has been archived by the owner on Mar 15, 2024. It is now read-only.

Commit

Permalink
importer fixes for ipif and safe in cloud
Browse files Browse the repository at this point in the history
  • Loading branch information
kspearrin committed May 4, 2017
1 parent 612ad32 commit 21ca3ab
Showing 1 changed file with 17 additions and 4 deletions.
21 changes: 17 additions & 4 deletions src/app/services/importService.js
Original file line number Diff line number Diff line change
Expand Up @@ -404,7 +404,7 @@
uri: null,
username: null,
password: null,
notes: null,
notes: '',
name: card.attr('title'),
};

Expand All @@ -414,6 +414,7 @@

var text = field.text();
var type = field.attr('type');
var name = field.attr('name');

if (text && text !== '') {
if (type === 'login') {
Expand All @@ -423,14 +424,26 @@
login.password = text;
}
else if (type === 'notes') {
login.notes = text;
login.notes += (text + '\n');
}
else if (type === 'weblogin') {
else if (type === 'weblogin' || type === 'website') {
login.uri = trimUri(text);
}
else {
login.notes += (name + ': ' + text + '\n');
}
}
}

var notes = card.find('> notes');
for (j = 0; j < notes.length; j++) {
login.notes += ($(notes[j]).text() + '\n');
}

if (login.notes === '') {
login.notes = null;
}

logins.push(login);

labels = card.find('> label_id');
Expand Down Expand Up @@ -759,7 +772,7 @@
}
}

getXmlFileContents(file, parse, error);
getFileContents(file, parse, error);

function parse(fileContent) {
var fileLines = fileContent.split(/(?:\r\n|\r|\n)/);
Expand Down

0 comments on commit 21ca3ab

Please sign in to comment.