From 21ca3abc7e96f27bf652e57eb4b0743b147673e0 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Thu, 4 May 2017 15:56:45 -0400 Subject: [PATCH] importer fixes for ipif and safe in cloud --- src/app/services/importService.js | 21 +++++++++++++++++---- 1 file changed, 17 insertions(+), 4 deletions(-) diff --git a/src/app/services/importService.js b/src/app/services/importService.js index 7298b4c409..9aaf116626 100644 --- a/src/app/services/importService.js +++ b/src/app/services/importService.js @@ -404,7 +404,7 @@ uri: null, username: null, password: null, - notes: null, + notes: '', name: card.attr('title'), }; @@ -414,6 +414,7 @@ var text = field.text(); var type = field.attr('type'); + var name = field.attr('name'); if (text && text !== '') { if (type === 'login') { @@ -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'); @@ -759,7 +772,7 @@ } } - getXmlFileContents(file, parse, error); + getFileContents(file, parse, error); function parse(fileContent) { var fileLines = fileContent.split(/(?:\r\n|\r|\n)/);