diff --git a/index.html b/index.html
index 5937a576..821ead59 100644
--- a/index.html
+++ b/index.html
@@ -42,6 +42,16 @@
Add members:
+
+
diff --git a/js/options.js b/js/options.js
index f097ac09..9240b50d 100644
--- a/js/options.js
+++ b/js/options.js
@@ -15,24 +15,6 @@
*/
;(function() {
- function validateNumber() {
- try {
- var regionCode = $('#regionCode').val();
- var number = $('#number').val();
-
- var parsedNumber = libphonenumber.util.verifyNumber(number, regionCode);
-
- $('#regionCode').val(libphonenumber.util.getRegionCodeForNumber(parsedNumber));
- $('#number-container').removeClass('invalid');
- $('#number-container').addClass('valid');
- $('#request-sms, #request-voice').removeAttr('disabled');
- return parsedNumber;
- } catch(e) {
- $('#number-container').removeClass('valid');
- $('#request-sms, #request-voice').prop('disabled', 'disabled');
- }
- };
-
function validateCode() {
var verificationCode = $('#code').val().replace(/\D/g, '');
if (verificationCode.length == 6) {
@@ -45,18 +27,19 @@
};
$(function() {
+ var phoneView = new Whisper.PhoneInputView({el: $('#phone-number-input')});
if (textsecure.registration.isDone()) {
$('#complete-number').text(textsecure.utils.unencodeNumber(textsecure.storage.getUnencrypted("number_id"))[0]);//TODO: no
$('#setup-complete').show().addClass('in');
} else {
$('#choose-setup').show().addClass('in');
- $('#number').keyup(validateNumber);
- $('#regionCode').change(validateNumber);
- $.each(libphonenumber.util.getAllRegionCodes(), function (regionCode, countryName) {
- $('#regionCode').append(
- $('