Skip to content

Commit

Permalink
Adding warning if we already imported the contacts at least once
Browse files Browse the repository at this point in the history
  • Loading branch information
arcturus committed Mar 24, 2013
1 parent f5c28c3 commit f4a52b5
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 3 deletions.
4 changes: 1 addition & 3 deletions importer/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -52,10 +52,8 @@ <h2></h2>
</div>
<button id='importButton'>Import contacts</button>
<p>Copy all the contacts retrieved from Google to your phone</p>
<p id="message" class="hide">You already imported your contacts in a previous session. Importing them again will add the new ones and duplicate the rest of the contacts in your phone.</p>
</article>
<!--article id='importWithPhone' class='hide'>
<button id='importWithPhoneButton'>Import contacts with phone</button>
</article-->

<form id="import_progress" role="dialog" data-type="confirm" class='hide'>
<section>
Expand Down
4 changes: 4 additions & 0 deletions importer/js/google/import.js
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,9 @@ google.ui = function ui() {
var importButton = document.querySelector('#import button');
importButton.disabled = num == 0 ? 'disabled' : false;

if (localStorage['alreadyImported'] == 1) {
document.getElementById('message').classList.remove('hide');
}
document.getElementById('import').classList.remove('hide');
};

Expand All @@ -40,6 +43,7 @@ google.ui = function ui() {
};

var finishImporting = function hideImporting() {
localStorage['alreadyImported'] = 1;
document.getElementById('import_progress').classList.add('hide');
document.getElementById('importer-finish').classList.remove('hide');
};
Expand Down
11 changes: 11 additions & 0 deletions importer/style/style.css
Original file line number Diff line number Diff line change
Expand Up @@ -74,3 +74,14 @@ section[role="region"] > article p strong {
line-height: 27px;
}

#import {
position: relative;
}

#message {
position: absolute;
bottom: 0;
left: 0;
padding: 1.5rem;
color: rgb(51, 51, 51);
}

0 comments on commit f4a52b5

Please sign in to comment.