1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-24 16:49:26 +01:00

importer fixes for ipif and safe in cloud

This commit is contained in:
Kyle Spearrin 2017-05-04 15:56:45 -04:00
parent 612ad32722
commit 21ca3abc7e

View File

@ -404,7 +404,7 @@
uri: null, uri: null,
username: null, username: null,
password: null, password: null,
notes: null, notes: '',
name: card.attr('title'), name: card.attr('title'),
}; };
@ -414,6 +414,7 @@
var text = field.text(); var text = field.text();
var type = field.attr('type'); var type = field.attr('type');
var name = field.attr('name');
if (text && text !== '') { if (text && text !== '') {
if (type === 'login') { if (type === 'login') {
@ -423,14 +424,26 @@
login.password = text; login.password = text;
} }
else if (type === 'notes') { 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); 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); logins.push(login);
labels = card.find('> label_id'); labels = card.find('> label_id');
@ -759,7 +772,7 @@
} }
} }
getXmlFileContents(file, parse, error); getFileContents(file, parse, error);
function parse(fileContent) { function parse(fileContent) {
var fileLines = fileContent.split(/(?:\r\n|\r|\n)/); var fileLines = fileContent.split(/(?:\r\n|\r|\n)/);