diff --git a/app/js/controllers.js b/app/js/controllers.js index d40f6bcd..89dc8424 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -33,13 +33,15 @@ angular.module('myApp.controllers', []) return; } }); - var options = {dcID: 1, createNetworker: true}; + var options = {dcID: 2, createNetworker: true}, + countryChanged = false, + selectedCountry = false; - $scope.credentials = {phone_country: '+1', phone_country_name: 'USA', phone_number: '', phone_full: ''}; + $scope.credentials = {phone_country: '', phone_country_name: '', phone_number: '', phone_full: ''}; $scope.progress = {}; $scope.callPending = {}; - $scope.selectCountry = function () { + $scope.chooseCountry = function () { var tUrl = 'partials/country_select_modal.html', className = 'countries_modal_window page_modal'; @@ -54,14 +56,60 @@ angular.module('myApp.controllers', []) windowClass: className }); - modal.result.then(function (code) { - $scope.credentials.phone_country = code; - $scope.$broadcast('country_selected'); - }); + modal.result.then(selectCountry); }; - $scope.$watch('credentials.phone_country', updateCountry); - $scope.$watch('credentials.phone_number', updateCountry); + function initPhoneCountry () { + var langCode = (navigator.language || '').toLowerCase(), + countryIso2 = Config.LangCountries[langCode], + shouldPregenerate = !Config.Navigator.mobile; + + if (['en', 'en-us', 'en-uk'].indexOf(langCode) == -1) { + if (countryIso2 !== undefined) { + selectPhoneCountryByIso2(countryIso2); + } else if (langCode.indexOf('-') > 0) { + selectPhoneCountryByIso2(langCode.split('-')[1].toUpperCase()); + } else { + selectPhoneCountryByIso2('US'); + } + } else { + selectPhoneCountryByIso2('US'); + } + + if (!shouldPregenerate) { + return; + } + var wasCountry = $scope.credentials.phone_country; + MtpApiManager.invokeApi('help.getNearestDc', {}, {dcID: 4, createNetworker: true}).then(function (nearestDcResult) { + if (wasCountry == $scope.credentials.phone_country) { + selectPhoneCountryByIso2(nearestDcResult.country); + } + if (nearestDcResult.nearest_dc != nearestDcResult.this_dc) { + MtpApiManager.getNetworker(nearestDcResult.nearest_dc, {createNetworker: true}); + } + }); + } + + function selectPhoneCountryByIso2 (countryIso2) { + var i, country; + for (i = 0; i < Config.CountryCodes.length; i++) { + country = Config.CountryCodes[i]; + if (country[0] == countryIso2) { + return selectCountry({name: country[1], code: country[2]}); + } + } + return selectCountry({name: 'United States', code: '+1'}); + } + + function selectCountry (country) { + selectedCountry = country; + if ($scope.credentials.phone_country != country.code) { + $scope.credentials.phone_country = country.code; + } else { + updateCountry(); + } + $scope.$broadcast('country_selected'); + } function updateCountry () { var phoneNumber = ( @@ -73,12 +121,16 @@ angular.module('myApp.controllers', []) maxName = false; if (phoneNumber.length) { - for (i = 0; i < Config.CountryCodes.length; i++) { - for (j = 1; j < Config.CountryCodes[i].length; j++) { - code = Config.CountryCodes[i][j].replace(/\D+/g, ''); - if (code.length >= maxLength && !phoneNumber.indexOf(code)) { - maxLength = code.length; - maxName = Config.CountryCodes[i][0]; + if (selectedCountry && !phoneNumber.indexOf(selectedCountry.code.replace(/\D+/g, ''))) { + maxName = selectedCountry.name; + } else { + for (i = 0; i < Config.CountryCodes.length; i++) { + for (j = 2; j < Config.CountryCodes[i].length; j++) { + code = Config.CountryCodes[i][j].replace(/\D+/g, ''); + if (code.length > maxLength && !phoneNumber.indexOf(code)) { + maxLength = code.length; + maxName = Config.CountryCodes[i][1]; + } } } } @@ -88,6 +140,11 @@ angular.module('myApp.controllers', []) $scope.credentials.phone_country_name = maxName || 'Unknown'; }; + $scope.$watch('credentials.phone_country', updateCountry); + $scope.$watch('credentials.phone_number', updateCountry); + initPhoneCountry(); + + var callTimeout; function saveAuth (result) { @@ -2284,8 +2341,8 @@ angular.module('myApp.controllers', []) var j; for (var i = 0; i < Config.CountryCodes.length; i++) { if (!filtered || results[i]) { - for (j = 1; j < Config.CountryCodes[i].length; j++) { - $scope.countries.push({name: Config.CountryCodes[i][0], code: Config.CountryCodes[i][j]}); + for (j = 2; j < Config.CountryCodes[i].length; j++) { + $scope.countries.push({name: Config.CountryCodes[i][1], code: Config.CountryCodes[i][j]}); } } } diff --git a/app/js/lib/config.js b/app/js/lib/config.js index 099ec66c..fd093244 100644 --- a/app/js/lib/config.js +++ b/app/js/lib/config.js @@ -59,4 +59,6 @@ Config.EmojiCategories = [[ "1f604", "1f603", "1f600", "1f60a", "263a", "1f609", Config.EmojiCategorySpritesheetDimens = [[7, 27], [4, 29], [7, 33], [3, 34], [6,34]]; -Config.CountryCodes = [["Abkhazia", "+7 840", "+7 940", "+995 44"], ["Afghanistan", "+93"], ["Åland Islands", "+358 18"], ["Albania", "+355"], ["Algeria", "+213"], ["American Samoa", "+1 684"], ["Andorra", "+376"], ["Angola", "+244"], ["Anguilla", "+1 264"], ["Antigua and Barbuda", "+1 268"], ["Argentina", "+54"], ["Armenia", "+374"], ["Aruba", "+297"], ["Ascension", "+247"], ["Australia", "+61"], ["Australian External Territories", "+672"], ["Austria", "+43"], ["Azerbaijan", "+994"], ["Bahamas", "+1 242"], ["Bahrain", "+973"], ["Bangladesh", "+880"], ["Barbados", "+1 246"], ["Barbuda", "+1 268"], ["Belarus", "+375"], ["Belgium", "+32"], ["Belize", "+501"], ["Benin", "+229"], ["Bermuda", "+1 441"], ["Bhutan", "+975"], ["Bolivia", "+591"], ["Bonaire", "+599 7"], ["Bosnia and Herzegovina", "+387"], ["Botswana", "+267"], ["Brazil", "+55"], ["British Indian Ocean Territory", "+246"], ["British Virgin Islands", "+1 284"], ["Brunei Darussalam", "+673"], ["Bulgaria", "+359"], ["Burkina Faso", "+226"], ["Burma", "+95"], ["Burundi", "+257"], ["Cambodia", "+855"], ["Cameroon", "+237"], ["Canada", "+1"], ["Cape Verde", "+238"], ["Caribbean Netherlands", "+599 3", "+599 4", "+599 7"], ["Cayman Islands", "+1 345"], ["Central African Republic", "+236"], ["Chad", "+235"], ["Chatham Island, New Zealand", "+64"], ["Chile", "+56"], ["China", "+86"], ["Christmas Island", "+61"], ["Cocos (Keeling) Islands", "+61"], ["Colombia", "+57"], ["Comoros", "+269"], ["Congo", "+242"], ["Congo, Democratic Republic of the (Zaire)", "+243"], ["Cook Islands", "+682"], ["Costa Rica", "+506"], ["Côte d'Ivoire", "+225"], ["Croatia", "+385"], ["Cuba", "+53"], ["Guantanamo Bay, Cuba", "+53 99"], ["Curaçao", "+599 9"], ["Cyprus", "+357"], ["Czech Republic", "+420"], ["Denmark", "+45"], ["Diego Garcia", "+246"], ["Djibouti", "+253"], ["Dominica", "+1 767"], ["Dominican Republic", "+1 809", "+1 829", "+1 849"], ["East Timor", "+670"], ["Easter Island", "+56"], ["Ecuador", "+593"], ["Egypt", "+20"], ["El Salvador", "+503"], ["Ellipso (Mobile Satellite service)", "+881 2", "+881 3"], ["EMSAT (Mobile Satellite service)", "+882 13"], ["Equatorial Guinea", "+240"], ["Eritrea", "+291"], ["Estonia", "+372"], ["Ethiopia", "+251"], ["Falkland Islands", "+500"], ["Faroe Islands", "+298"], ["Fiji", "+679"], ["Finland", "+358"], ["France", "+33"], ["French Antilles", "+596"], ["French Guiana", "+594"], ["French Polynesia", "+689"], ["Gabon", "+241"], ["Gambia", "+220"], ["Georgia", "+995"], ["Germany", "+49"], ["Ghana", "+233"], ["Gibraltar", "+350"], ["Global Mobile Satellite System (GMSS)", "+881"], ["Globalstar (Mobile Satellite Service)", "+881 8", "+881 9"], ["Greece", "+30"], ["Greenland", "+299"], ["Grenada", "+1 473"], ["Guadeloupe", "+590"], ["Guam", "+1 671"], ["Guatemala", "+502"], ["Guernsey", "+44"], ["Guinea", "+224"], ["Guinea-Bissau", "+245"], ["Guyana", "+592"], ["Haiti", "+509"], ["Honduras", "+504"], ["Hong Kong", "+852"], ["Hungary", "+36"], ["Iceland", "+354"], ["ICO Global (Mobile Satellite Service)", "+881 0", "+881 1"], ["India", "+91"], ["Indonesia", "+62"], ["Inmarsat SNAC", "+870"], ["International Freephone Service", "+800"], ["International Shared Cost Service (ISCS)", "+808"], ["Iran", "+98"], ["Iraq", "+964"], ["Ireland", "+353"], ["Iridium (Mobile Satellite service)", "+881 6", "+881 7"], ["Isle of Man", "+44"], ["Israel", "+972"], ["Italy", "+39"], ["Jamaica", "+1 876"], ["Jan Mayen", "+47 79"], ["Japan", "+81"], ["Jersey", "+44"], ["Jordan", "+962"], ["Kazakhstan", "+7 6", "+7 7"], ["Kenya", "+254"], ["Kiribati", "+686"], ["Korea, North", "+850"], ["Korea, South", "+82"], ["Kuwait", "+965"], ["Kyrgyzstan", "+996"], ["Laos", "+856"], ["Latvia", "+371"], ["Lebanon", "+961"], ["Lesotho", "+266"], ["Liberia", "+231"], ["Libya", "+218"], ["Liechtenstein", "+423"], ["Lithuania", "+370"], ["Luxembourg", "+352"], ["Macau", "+853"], ["Macedonia", "+389"], ["Madagascar", "+261"], ["Malawi", "+265"], ["Malaysia", "+60"], ["Maldives", "+960"], ["Mali", "+223"], ["Malta", "+356"], ["Marshall Islands", "+692"], ["Martinique", "+596"], ["Mauritania", "+222"], ["Mauritius", "+230"], ["Mayotte", "+262"], ["Mexico", "+52"], ["Micronesia, Federated States of", "+691"], ["Midway Island, USA", "+1 808"], ["Moldova", "+373"], ["Monaco", "+377"], ["Mongolia", "+976"], ["Montenegro", "+382"], ["Montserrat", "+1 664"], ["Morocco", "+212"], ["Mozambique", "+258"], ["Namibia", "+264"], ["Nauru", "+674"], ["Nepal", "+977"], ["Netherlands", "+31"], ["Nevis", "+1 869"], ["New Caledonia", "+687"], ["New Zealand", "+64"], ["Nicaragua", "+505"], ["Niger", "+227"], ["Nigeria", "+234"], ["Niue", "+683"], ["Norfolk Island", "+672"], ["Northern Mariana Islands", "+1 670"], ["Norway", "+47"], ["Oman", "+968"], ["Pakistan", "+92"], ["Palau", "+680"], ["Palestinian territories", "+970"], ["Panama", "+507"], ["Papua New Guinea", "+675"], ["Paraguay", "+595"], ["Peru", "+51"], ["Philippines", "+63"], ["Pitcairn Islands", "+64"], ["Poland", "+48"], ["Portugal", "+351"], ["Puerto Rico", "+1 787", "+1 939"], ["Qatar", "+974"], ["Réunion", "+262"], ["Romania", "+40"], ["Russia", "+7"], ["Rwanda", "+250"], ["Saba", "+599 4"], ["Saint Barthélemy", "+590"], ["Saint Helena", "+290"], ["Saint Kitts and Nevis", "+1 869"], ["Saint Lucia", "+1 758"], ["Saint Martin (France)", "+590"], ["Saint Pierre and Miquelon", "+508"], ["Saint Vincent and the Grenadines", "+1 784"], ["Samoa", "+685"], ["San Marino", "+378"], ["São Tomé and Príncipe", "+239"], ["Saudi Arabia", "+966"], ["Senegal", "+221"], ["Serbia", "+381"], ["Seychelles", "+248"], ["Sierra Leone", "+232"], ["Singapore", "+65"], ["Sint Eustatius", "+599 3"], ["Sint Maarten (Netherlands)", "+1 721"], ["Slovakia", "+421"], ["Slovenia", "+386"], ["Solomon Islands", "+677"], ["Somalia", "+252"], ["South Africa", "+27"], ["South Georgia and the South Sandwich Islands", "+500"], ["South Ossetia", "+995 34"], ["South Sudan", "+211"], ["Spain", "+34"], ["Sri Lanka", "+94"], ["Sudan", "+249"], ["Suriname", "+597"], ["Svalbard", "+47 79"], ["Swaziland", "+268"], ["Sweden", "+46"], ["Switzerland", "+41"], ["Syria", "+963"], ["Taiwan", "+886"], ["Tajikistan", "+992"], ["Tanzania", "+255"], ["Thailand", "+66"], ["Thuraya (Mobile Satellite service)", "+882 16"], ["Togo", "+228"], ["Tokelau", "+690"], ["Tonga", "+676"], ["Trinidad and Tobago", "+1 868"], ["Tristan da Cunha", "+290 8"], ["Tunisia", "+216"], ["Turkey", "+90"], ["Turkmenistan", "+993"], ["Turks and Caicos Islands", "+1 649"], ["Tuvalu", "+688"], ["Uganda", "+256"], ["Ukraine", "+380"], ["United Arab Emirates", "+971"], ["United Kingdom", "+44"], ["United States", "+1"], ["Universal Personal Telecommunications (UPT)", "+878"], ["Uruguay", "+598"], ["US Virgin Islands", "+1 340"], ["Uzbekistan", "+998"], ["Vanuatu", "+678"], ["Venezuela", "+58"], ["Vatican City State (Holy See)", "+39 06 698", "+379"], ["Vietnam", "+84"], ["Wake Island, USA", "+1 808"], ["Wallis and Futuna", "+681"], ["Yemen", "+967"], ["Zambia", "+260"], ["Zanzibar", "+255"], ["Zimbabwe", "+263"]] +Config.CountryCodes = [["AB", "Abkhazia", "+7 840", "+7 940", "+995 44"], ["AF", "Afghanistan", "+93"], ["AX", "Åland Islands", "+358 18"], ["AL", "Albania", "+355"], ["DZ", "Algeria", "+213"], ["AS", "American Samoa", "+1 684"], ["AD", "Andorra", "+376"], ["AO", "Angola", "+244"], ["AI", "Anguilla", "+1 264"], ["AG", "Antigua and Barbuda", "+1 268"], ["AR", "Argentina", "+54"], ["AM", "Armenia", "+374"], ["AW", "Aruba", "+297"], ["SH", "Ascension", "+247"], ["AU", "Australia", "+61"], ["AU", "Australian External Territories", "+672"], ["AT", "Austria", "+43"], ["AZ", "Azerbaijan", "+994"], ["BS", "Bahamas", "+1 242"], ["BH", "Bahrain", "+973"], ["BD", "Bangladesh", "+880"], ["BB", "Barbados", "+1 246"], ["AG", "Barbuda", "+1 268"], ["BY", "Belarus", "+375"], ["BE", "Belgium", "+32"], ["BZ", "Belize", "+501"], ["BJ", "Benin", "+229"], ["BM", "Bermuda", "+1 441"], ["BT", "Bhutan", "+975"], ["BO", "Bolivia", "+591"], ["BQ", "Bonaire", "+599 7"], ["BA", "Bosnia and Herzegovina", "+387"], ["BW", "Botswana", "+267"], ["BR", "Brazil", "+55"], ["IO", "British Indian Ocean Territory", "+246"], ["VG", "British Virgin Islands", "+1 284"], ["BN", "Brunei Darussalam", "+673"], ["BG", "Bulgaria", "+359"], ["BF", "Burkina Faso", "+226"], ["MY", "Burma", "+95"], ["BI", "Burundi", "+257"], ["KH", "Cambodia", "+855"], ["CM", "Cameroon", "+237"], ["CA", "Canada", "+1"], ["CV", "Cape Verde", "+238"], ["KY", "Cayman Islands", "+1 345"], ["CF", "Central African Republic", "+236"], ["TD", "Chad", "+235"], ["CL", "Chile", "+56"], ["CN", "China", "+86"], ["CX", "Christmas Island", "+61"], ["CC", "Cocos (Keeling) Islands", "+61"], ["CO", "Colombia", "+57"], ["KM", "Comoros", "+269"], ["CG", "Congo", "+242"], ["CD", "Congo, Democratic Republic of the (Zaire)", "+243"], ["CK", "Cook Islands", "+682"], ["CR", "Costa Rica", "+506"], ["CI", "Côte d'Ivoire", "+225"], ["HR", "Croatia", "+385"], ["CU", "Cuba", "+53"], ["CW", "Curaçao", "+599 9"], ["CY", "Cyprus", "+357"], ["CZ", "Czech Republic", "+420"], ["DK", "Denmark", "+45"], ["DG", "Diego Garcia", "+246"], ["DJ", "Djibouti", "+253"], ["DM", "Dominica", "+1 767"], ["DO", "Dominican Republic", "+1 809", "+1 829", "+1 849"], ["TL", "East Timor", "+670"], ["EC", "Ecuador", "+593"], ["EG", "Egypt", "+20"], ["SV", "El Salvador", "+503"], ["GQ", "Equatorial Guinea", "+240"], ["ER", "Eritrea", "+291"], ["EE", "Estonia", "+372"], ["ET", "Ethiopia", "+251"], ["FK", "Falkland Islands", "+500"], ["FO", "Faroe Islands", "+298"], ["FJ", "Fiji", "+679"], ["FI", "Finland", "+358"], ["FR", "France", "+33"], ["GF", "French Guiana", "+594"], ["PF", "French Polynesia", "+689"], ["GA", "Gabon", "+241"], ["GM", "Gambia", "+220"], ["GE", "Georgia", "+995"], ["DE", "Germany", "+49"], ["GH", "Ghana", "+233"], ["GI", "Gibraltar", "+350"], ["GR", "Greece", "+30"], ["GL", "Greenland", "+299"], ["GD", "Grenada", "+1 473"], ["GP", "Guadeloupe", "+590"], ["GU", "Guam", "+1 671"], ["GT", "Guatemala", "+502"], ["GG", "Guernsey", "+44"], ["GN", "Guinea", "+224"], ["GW", "Guinea-Bissau", "+245"], ["GY", "Guyana", "+592"], ["HT", "Haiti", "+509"], ["HN", "Honduras", "+504"], ["HK", "Hong Kong", "+852"], ["HU", "Hungary", "+36"], ["IS", "Iceland", "+354"], ["IN", "India", "+91"], ["ID", "Indonesia", "+62"], ["IR", "Iran", "+98"], ["IQ", "Iraq", "+964"], ["IE", "Ireland", "+353"], ["IL", "Israel", "+972"], ["IT", "Italy", "+39"], ["JM", "Jamaica", "+1 876"], ["SJ", "Jan Mayen", "+47 79"], ["JP", "Japan", "+81"], ["JE", "Jersey", "+44"], ["JO", "Jordan", "+962"], ["KZ", "Kazakhstan", "+7 6", "+7 7"], ["KE", "Kenya", "+254"], ["KI", "Kiribati", "+686"], ["KP", "Korea, North", "+850"], ["KR", "Korea, South", "+82"], ["KW", "Kuwait", "+965"], ["KG", "Kyrgyzstan", "+996"], ["LA", "Laos", "+856"], ["LV", "Latvia", "+371"], ["LB", "Lebanon", "+961"], ["LS", "Lesotho", "+266"], ["LR", "Liberia", "+231"], ["LY", "Libya", "+218"], ["LI", "Liechtenstein", "+423"], ["LT", "Lithuania", "+370"], ["LU", "Luxembourg", "+352"], ["MO", "Macau", "+853"], ["MK", "Macedonia", "+389"], ["MG", "Madagascar", "+261"], ["MW", "Malawi", "+265"], ["MY", "Malaysia", "+60"], ["MV", "Maldives", "+960"], ["ML", "Mali", "+223"], ["MT", "Malta", "+356"], ["MH", "Marshall Islands", "+692"], ["MQ", "Martinique", "+596"], ["MR", "Mauritania", "+222"], ["MU", "Mauritius", "+230"], ["YT", "Mayotte", "+262"], ["MX", "Mexico", "+52"], ["FM", "Micronesia, Federated States of", "+691"], ["MD", "Moldova", "+373"], ["MC", "Monaco", "+377"], ["MN", "Mongolia", "+976"], ["ME", "Montenegro", "+382"], ["MS", "Montserrat", "+1 664"], ["MA", "Morocco", "+212"], ["MZ", "Mozambique", "+258"], ["NA", "Namibia", "+264"], ["NR", "Nauru", "+674"], ["NP", "Nepal", "+977"], ["NL", "Netherlands", "+31"], ["NC", "New Caledonia", "+687"], ["NZ", "New Zealand", "+64"], ["NI", "Nicaragua", "+505"], ["NE", "Niger", "+227"], ["NG", "Nigeria", "+234"], ["NU", "Niue", "+683"], ["NF", "Norfolk Island", "+672"], ["MP", "Northern Mariana Islands", "+1 670"], ["NO", "Norway", "+47"], ["OM", "Oman", "+968"], ["PK", "Pakistan", "+92"], ["PW", "Palau", "+680"], ["PS", "Palestinian territories", "+970"], ["PA", "Panama", "+507"], ["PG", "Papua New Guinea", "+675"], ["PY", "Paraguay", "+595"], ["PE", "Peru", "+51"], ["PH", "Philippines", "+63"], ["PN", "Pitcairn Islands", "+64"], ["PL", "Poland", "+48"], ["PT", "Portugal", "+351"], ["PR", "Puerto Rico", "+1 787", "+1 939"], ["QA", "Qatar", "+974"], ["RE", "Réunion", "+262"], ["RO", "Romania", "+40"], ["RU", "Russia", "+7"], ["RW", "Rwanda", "+250"], ["BL", "Saint Barthélemy", "+590"], ["SH", "Saint Helena", "+290"], ["KN", "Saint Kitts and Nevis", "+1 869"], ["LC", "Saint Lucia", "+1 758"], ["MF", "Saint Martin (France)", "+590"], ["PM", "Saint Pierre and Miquelon", "+508"], ["VC", "Saint Vincent and the Grenadines", "+1 784"], ["WS", "Samoa", "+685"], ["SM", "San Marino", "+378"], ["ST", "São Tomé and Príncipe", "+239"], ["SA", "Saudi Arabia", "+966"], ["SN", "Senegal", "+221"], ["RS", "Serbia", "+381"], ["SC", "Seychelles", "+248"], ["SL", "Sierra Leone", "+232"], ["SG", "Singapore", "+65"], ["BQ", "Sint Eustatius", "+599 3"], ["SX", "Sint Maarten (Netherlands)", "+1 721"], ["SK", "Slovakia", "+421"], ["SI", "Slovenia", "+386"], ["SB", "Solomon Islands", "+677"], ["SO", "Somalia", "+252"], ["ZA", "South Africa", "+27"], ["GS", "South Georgia and the South Sandwich Islands", "+500"], [false, "South Ossetia", "+995 34"], ["SS", "South Sudan", "+211"], ["ES", "Spain", "+34"], ["LK", "Sri Lanka", "+94"], ["SD", "Sudan", "+249"], ["SR", "Suriname", "+597"], ["SJ", "Svalbard", "+47 79"], ["SZ", "Swaziland", "+268"], ["SE", "Sweden", "+46"], ["CH", "Switzerland", "+41"], ["SY", "Syria", "+963"], ["TW", "Taiwan", "+886"], ["TJ", "Tajikistan", "+992"], ["TZ", "Tanzania", "+255"], ["TH", "Thailand", "+66"], ["TG", "Togo", "+228"], ["TK", "Tokelau", "+690"], ["TO", "Tonga", "+676"], ["TT", "Trinidad and Tobago", "+1 868"], ["TN", "Tunisia", "+216"], ["TR", "Turkey", "+90"], ["TM", "Turkmenistan", "+993"], ["TC", "Turks and Caicos Islands", "+1 649"], ["TV", "Tuvalu", "+688"], ["UG", "Uganda", "+256"], ["UA", "Ukraine", "+380"], ["AE", "United Arab Emirates", "+971"], ["UK", "United Kingdom", "+44"], ["US", "United States", "+1"], ["UY", "Uruguay", "+598"], ["VI", "US Virgin Islands", "+1 340"], ["UZ", "Uzbekistan", "+998"], ["VU", "Vanuatu", "+678"], ["VE", "Venezuela", "+58"], ["VA", "Vatican City State (Holy See)", "+39 06 698", "+379"], ["VN", "Vietnam", "+84"], ["WF", "Wallis and Futuna", "+681"], ["YE", "Yemen", "+967"], ["ZM", "Zambia", "+260"], [false, "Zanzibar", "+255"], ["ZW", "Zimbabwe", "+263"] ]; + +Config.LangCountries = {"es": "ES", "ru": "RU", "en": "US", "de": "DE", "it": "IT", "nl": "NL", "fr": "FR", "ca": "ES", "es-419": "MX", "ar": "SA", "he": "IL", "tr": "TR", "id": "ID", "pl": "PL"}; diff --git a/app/js/lib/mtproto_wrapper.js b/app/js/lib/mtproto_wrapper.js index 15bfd592..317ab26f 100644 --- a/app/js/lib/mtproto_wrapper.js +++ b/app/js/lib/mtproto_wrapper.js @@ -223,6 +223,7 @@ angular.module('izhukov.mtproto.wrapper', ['izhukov.utils', 'izhukov.mtproto']) getBaseDcID: getBaseDcID, getUserID: mtpGetUserID, invokeApi: mtpInvokeApi, + getNetworker: mtpGetNetworker, setUserAuth: mtpSetUserAuth, logOut: mtpLogOut } diff --git a/app/partials/country_select_modal.html b/app/partials/country_select_modal.html index 604e07e2..a6454837 100644 --- a/app/partials/country_select_modal.html +++ b/app/partials/country_select_modal.html @@ -17,7 +17,7 @@
Please choose your country and enter your full phone number.
-