diff --git a/app/css/app.css b/app/css/app.css index 6552c308..619bb5f3 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -449,6 +449,11 @@ input[type="number"]::-webkit-inner-spin-button { .modal-body { padding: 14px 14px; } +.modal_simple_header { + font-size: 14px; + margin: 0 0 12px; + text-align: center; +} .modal_simple_form { max-width: 230px; @@ -691,6 +696,35 @@ a.tg_radio_on:hover i.icon-radio { font-size: 13px; } +.login_country_selector { + cursor: pointer; + background: #f7f7f7; + height: 34px; + padding: 10px 12px 10px 13px; + line-height: 14px; + margin-bottom: 12px; +} +.login_country_selector .icon-caret { + margin-top: 4px; +} + +.login_phone_country, +.login_phone_number { + float: left; + display: inline-block; + width: auto; + font-size: 12px; +} +.login_phone_country { + width: 53px; + margin-right: 9px; + padding: 6px 3px; + text-align: center; +} +.login_phone_number { + width: 198px; +} + /* IM page start */ @@ -2306,6 +2340,12 @@ img.chat_modal_participant_photo { margin-top: 40px; } +.confirm_phone_number { + font-weight: bold; + padding: 15px 10px 0; + text-align: center; +} + .photo_modal_error { @@ -3024,6 +3064,61 @@ ce671b orange } +.countries_modal_window .modal-dialog { + max-width: 392px; +} + +.countries_modal_search { + padding: 0 20px 12px; + margin: 0; +} + +.countries_modal_wrap .modal-body { + padding: 14px 0; +} + +.countries_modal_col .nano > .pane { + background : rgba(3,36,64,0.08); + width : 3px; + right: 6px; + top: 0; + -webkit-transition : .2s; + -moz-transition : .2s; + -o-transition : .2s; + transition : .2s; + -moz-border-radius : 0; + -webkit-border-radius : 0; + border-radius : 0; +} +.countries_modal_col .nano > .pane > .slider { + background : rgba(3,46,79,0.22); + margin: 0; + -moz-border-radius : 0; + -webkit-border-radius : 0; + border-radius : 0; +} + + +.countries_scrollable_wrap a.countries_modal_country { + clear: both; + overflow: hidden; + color: #000; + padding: 8px 26px; + font-size: 12px; + border-radius: 0; +} +.countries_scrollable_wrap a.countries_modal_country:hover { + border-radius: 2px; + background: #f2f6fa; +} + +.countries_modal_country_code { + color: #999; +} +.countries_scrollable_wrap a.countries_modal_country:hover .countries_modal_country_code { + color: #698192; +} + /* Loading dots animation */ .loading_dots diff --git a/app/js/controllers.js b/app/js/controllers.js index 2a602131..7d603f44 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -21,7 +21,7 @@ angular.module('myApp.controllers', []) }); }) - .controller('AppLoginController', function ($scope, $location, $timeout, MtpApiManager, ErrorService) { + .controller('AppLoginController', function ($scope, $location, $timeout, $modal, MtpApiManager, ErrorService) { MtpApiManager.getUserID().then(function (id) { if (id) { $location.url('/im'); @@ -30,10 +30,51 @@ angular.module('myApp.controllers', []) }); var options = {dcID: 1, createNetworker: true}; - $scope.credentials = {}; + $scope.credentials = {phone_country: '+1', phone_country_name: 'USA', phone_number: '', phone_full: ''}; $scope.progress = {}; $scope.callPending = {}; + $scope.selectCountry = function () { + var modal = $modal.open({ + templateUrl: 'partials/country_select_modal.html', + controller: 'CountrySelectModalController', + windowClass: 'countries_modal_window' + }); + + modal.result.then(function (code) { + $scope.credentials.phone_country = code; + $scope.$broadcast('country_selected'); + }); + }; + + $scope.$watch('credentials.phone_country', updateCountry); + $scope.$watch('credentials.phone_number', updateCountry); + + function updateCountry () { + var phoneNumber = ( + ($scope.credentials.phone_country || '') + + ($scope.credentials.phone_number || '') + ).replace(/\D+/g, ''), + i, j, code, + maxLength = 0, + 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]; + } + } + } + } + + $scope.credentials.phone_full = phoneNumber; + $scope.credentials.phone_country_name = maxName || 'Unknown'; + }; + var callTimeout; function saveAuth (result) { @@ -51,7 +92,7 @@ angular.module('myApp.controllers', []) if (!(--$scope.callPending.remaining)) { $scope.callPending.success = false; MtpApiManager.invokeApi('auth.sendCall', { - phone_number: $scope.credentials.phone_number, + phone_number: $scope.credentials.phone_full, phone_code_hash: $scope.credentials.phone_code_hash }, options).then(function () { $scope.callPending.success = true; @@ -63,38 +104,53 @@ angular.module('myApp.controllers', []) $scope.sendCode = function () { $timeout.cancel(callTimeout); - $scope.progress.enabled = true; - MtpApiManager.invokeApi('auth.checkPhone', { - phone_number: $scope.credentials.phone_number - }, options).then(function (result) { - $scope.progress.enabled = false; - if (!result.phone_registered) { - ErrorService.show({ - error: {code: 400, type: 'ACCOUNT_REQUIRED'}, - phone: $scope.credentials.phone_number - }); - return false; - } + ErrorService.confirm({ + type: 'LOGIN_PHONE_CORRECT', + country_code: $scope.credentials.phone_country, + phone_number: $scope.credentials.phone_number + }).then(function () { $scope.progress.enabled = true; - MtpApiManager.invokeApi('auth.sendCode', { - phone_number: $scope.credentials.phone_number, - sms_type: 0, - api_id: 2496, - api_hash: '8da85b0d5bfe62527e5b244c209159c3' - }, options).then(function (sentCode) { + MtpApiManager.invokeApi('auth.checkPhone', { + phone_number: $scope.credentials.phone_full + }, options).then(function (result) { $scope.progress.enabled = false; + if (!result.phone_registered) { + ErrorService.show({ + error: {code: 400, type: 'ACCOUNT_REQUIRED'}, + phone: $scope.credentials.phone_full + }); + return false; + } - $scope.credentials.phone_code_hash = sentCode.phone_code_hash; - $scope.credentials.phone_occupied = sentCode.phone_registered; - $scope.error = {}; - - $scope.callPending.remaining = sentCode.send_call_timeout; - callCheck(); - + $scope.progress.enabled = true; + MtpApiManager.invokeApi('auth.sendCode', { + phone_number: $scope.credentials.phone_full, + sms_type: 0, + api_id: 2496, + api_hash: '8da85b0d5bfe62527e5b244c209159c3' + }, options).then(function (sentCode) { + $scope.progress.enabled = false; + + $scope.credentials.phone_code_hash = sentCode.phone_code_hash; + $scope.credentials.phone_occupied = sentCode.phone_registered; + $scope.error = {}; + + $scope.callPending.remaining = sentCode.send_call_timeout; + callCheck(); + + }, function (error) { + $scope.progress.enabled = false; + console.log('sendCode error', error); + switch (error.type) { + case 'PHONE_NUMBER_INVALID': + $scope.error = {field: 'phone'}; + error.handled = true; + break; + } + }); }, function (error) { $scope.progress.enabled = false; - console.log('sendCode error', error); switch (error.type) { case 'PHONE_NUMBER_INVALID': $scope.error = {field: 'phone'}; @@ -102,20 +158,14 @@ angular.module('myApp.controllers', []) break; } }); - }, function (error) { - $scope.progress.enabled = false; - switch (error.type) { - case 'PHONE_NUMBER_INVALID': - $scope.error = {field: 'phone'}; - error.handled = true; - break; - } }); + + } $scope.logIn = function (forceSignUp) { var method = 'auth.signIn', params = { - phone_number: $scope.credentials.phone_number, + phone_number: $scope.credentials.phone_full, phone_code_hash: $scope.credentials.phone_code_hash, phone_code: $scope.credentials.phone_code }; @@ -1629,3 +1679,37 @@ angular.module('myApp.controllers', []) }; }) + + .controller('CountrySelectModalController', function ($scope, $modalInstance, $rootScope, SearchIndexManager) { + + $scope.search = {}; + + var searchIndex = SearchIndexManager.createIndex(); + + for (var i = 0; i < Config.CountryCodes.length; i++) { + SearchIndexManager.indexObject(i, Config.CountryCodes[i].join(' '), searchIndex); + } + + $scope.$watch('search.query', function (newValue) { + var filtered = false, + results = {}; + + if (angular.isString(newValue) && newValue.length) { + filtered = true; + results = SearchIndexManager.search(newValue, searchIndex); + } + + console.log(dT(), newValue, results); + + $scope.countries = []; + 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]}); + } + } + } + + }); + }) diff --git a/app/js/directives.js b/app/js/directives.js index 6b64c531..d3143c20 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -149,6 +149,37 @@ angular.module('myApp.directives', ['myApp.filters']) }) + .directive('myCountriesList', function($window, $timeout) { + + return { + link: link + }; + + function link ($scope, element, attrs) { + var searchWrap = $('.countries_modal_search')[0], + panelWrap = $('.countries_modal_panel')[0], + countriesWrap = $('.countries_wrap', element)[0]; + + onContentLoaded(function () { + $(countriesWrap).nanoScroller({preventPageScrolling: true, tabIndex: -1, iOSNativeScrolling: true}); + updateSizes(); + }); + + function updateSizes () { + $(element).css({ + height: $($window).height() - (panelWrap && panelWrap.offsetHeight || 0) - (searchWrap && searchWrap.offsetHeight || 0) - 200 + }); + $(countriesWrap).nanoScroller(); + } + + $($window).on('resize', updateSizes); + $scope.$on('contacts_change', function () { + onContentLoaded(updateSizes) + }); + }; + + }) + .directive('myHistory', function ($window, $timeout, $transition) { return { @@ -972,6 +1003,18 @@ angular.module('myApp.directives', ['myApp.filters']) }; }) + .directive('myFocusOn', function(){ + return { + link: function($scope, element, attrs) { + $scope.$on(attrs.myFocusOn, function () { + onContentLoaded(function () { + element[0].focus(); + }); + }); + } + }; + }) + .directive('myFileUpload', function(){ return { diff --git a/app/js/lib/config.js b/app/js/lib/config.js index 688090f7..bb7b3fc0 100644 --- a/app/js/lib/config.js +++ b/app/js/lib/config.js @@ -16,3 +16,6 @@ Config.Emoji = {"00a9":["\u00A9",["copyright"]],"00ae":["\u00AE",["registered"]] Config.EmojiCategories = [[ "1f604", "1f603", "1f600", "1f60a", "263a", "1f609", "1f60d","1f618", "1f61a", "1f617", "1f619", "1f61c", "1f61d", "1f61b","1f633", "1f601", "1f614", "1f60c", "1f612", "1f61e", "1f623","1f622", "1f602", "1f62d", "1f62a", "1f625", "1f630", "1f605","1f613", "1f629", "1f62b", "1f628", "1f631", "1f620", "1f621","1f624", "1f616", "1f606", "1f60b", "1f637", "1f60e", "1f634","1f635", "1f632", "1f61f", "1f626", "1f627", "1f608", "1f47f","1f62e", "1f62c", "1f610", "1f615", "1f62f", "1f636", "1f607","1f60f", "1f611", "1f472", "1f473", "1f46e", "1f477", "1f482","1f476", "1f466", "1f467", "1f468", "1f469", "1f474", "1f475","1f471", "1f47c", "1f478", "1f63a", "1f638", "1f63b", "1f63d","1f63c", "1f640", "1f63f", "1f639", "1f63e", "1f479", "1f47a","1f648", "1f649", "1f64a", "1f480", "1f47d", "1f4a9", "1f525","2728", "1f31f", "1f4ab", "1f4a5", "1f4a2", "1f4a6", "1f4a7","1f4a4", "1f4a8", "1f442", "1f440", "1f443", "1f445", "1f444","1f44d", "1f44e", "1f44c", "1f44a", "270a", "270c", "1f44b","270b", "1f450", "1f446", "1f447", "1f449", "1f448", "1f64c","1f64f", "261d", "1f44f", "1f4aa", "1f6b6", "1f3c3", "1f483","1f46b", "1f46a", "1f46c", "1f46d", "1f48f", "1f491", "1f46f","1f646", "1f645", "1f481", "1f64b", "1f486", "1f487", "1f485","1f470", "1f64e", "1f64d", "1f647", "1f3a9", "1f451", "1f452","1f45f", "1f45e", "1f461", "1f460", "1f462", "1f455", "1f454","1f45a", "1f457", "1f3bd", "1f456", "1f458", "1f459", "1f4bc","1f45c", "1f45d", "1f45b", "1f453", "1f380", "1f302", "1f484","1f49b", "1f499", "1f49c", "1f49a", "2764", "1f494", "1f497","1f493", "1f495", "1f496", "1f49e", "1f498", "1f48c", "1f48b","1f48d", "1f48e", "1f464", "1f465", "1f4ac", "1f463", "1f4ad" ],[ "1f436", "1f43a", "1f431", "1f42d", "1f439", "1f430", "1f438","1f42f", "1f428", "1f43b", "1f437", "1f43d", "1f42e", "1f417","1f435", "1f412", "1f434", "1f411", "1f418", "1f43c", "1f427","1f426", "1f424", "1f425", "1f423", "1f414", "1f40d", "1f422","1f41b", "1f41d", "1f41c", "1f41e", "1f40c", "1f419", "1f41a","1f420", "1f41f", "1f42c", "1f433", "1f40b", "1f404", "1f40f","1f400", "1f403", "1f405", "1f407", "1f409", "1f40e", "1f410","1f413", "1f415", "1f416", "1f401", "1f402", "1f432", "1f421","1f40a", "1f42b", "1f42a", "1f406", "1f408", "1f429", "1f43e","1f490", "1f338", "1f337", "1f340", "1f339", "1f33b", "1f33a","1f341", "1f343", "1f342", "1f33f", "1f33e", "1f344", "1f335","1f334", "1f332", "1f333", "1f330", "1f331", "1f33c", "1f310","1f31e", "1f31d", "1f31a", "1f311", "1f312", "1f313", "1f314","1f315", "1f316", "1f317", "1f318", "1f31c", "1f31b", "1f319","1f30d", "1f30e", "1f30f", "1f30b", "1f30c", "1f30d", "2b50","2600", "26c5", "2601", "26a1", "2614", "2744", "26c4", "1f300","1f301", "1f308", "1f30a" ],[ "1f38d", "1f49d", "1f38e", "1f392", "1f393", "1f38f", "1f386","1f387", "1f390", "1f391", "1f383", "1f47b", "1f385", "1f384","1f381", "1f38b", "1f389", "1f38a", "1f388", "1f38c", "1f52e","1f3a5", "1f4f7", "1f4f9", "1f4fc", "1f4bf", "1f4c0", "1f4bd","1f4be", "1f4bb", "1f4f1", "260e", "1f4de", "1f4df", "1f4e0","1f4e1", "1f4fa", "1f4fb", "1f50a", "1f509", "1f509", "1f507","1f514", "1f514", "1f4e2", "1f4e3", "23f3", "231b", "23f0","231a", "1f513", "1f512", "1f50f", "1f510", "1f511", "1f50e","1f4a1", "1f526", "1f506", "1f505", "1f50c", "1f50b", "1f50d","1f6c0", "1f6bf", "1f6bd", "1f527", "1f529", "1f528", "1f6aa","1f6ac", "1f4a3", "1f52b", "1f52a", "1f48a", "1f489", "1f4b0","1f4b4", "1f4b5", "1f4b7", "1f4b6", "1f4b3", "1f4b8", "1f4f2","1f4e7", "1f4e5", "1f4e4", "2709", "1f4e9", "1f4e8", "1f4ef","1f4eb", "1f4ea", "1f4ec", "1f4ed", "1f4ee", "1f4e6", "1f4dd","1f4c4", "1f4c3", "1f4d1", "1f4ca", "1f4c8", "1f4c9", "1f4dc","1f4cb", "1f4c5", "1f4c6", "1f4c7", "1f4c1", "1f4c2", "2702","1f4cc", "1f4ce", "2712", "270f", "1f4cf", "1f4d0", "1f4d5","1f4d7", "1f4d8", "1f4d9", "1f4d3", "1f4d4", "1f4d2", "1f4da","1f4d6", "1f516", "1f4db", "1f52c", "1f52d", "1f4f0", "1f3a8","1f3ac", "1f3a4", "1f3a7", "1f3bc", "1f3b5", "1f3b6", "1f3b9","1f3bb", "1f3ba", "1f3b7", "1f3b8", "1f47e", "1f3ae", "1f0cf","1f3b4", "1f004", "1f3b2", "1f3af", "1f3c8", "1f3c0", "26bd","26be", "1f3be", "1f3b1", "1f3c9", "1f3b3", "26f3", "1f6b5","1f6b4", "1f3c1", "1f3c7", "1f3c6", "1f3bf", "1f3c2", "1f3ca","1f3c4", "1f3a3", "2615", "1f375", "1f376", "1f37c", "1f37a","1f37b", "1f378", "1f379", "1f377", "1f374", "1f355", "1f354","1f35f", "1f357", "1f356", "1f35d", "1f35b", "1f364", "1f371","1f363", "1f365", "1f359", "1f358", "1f35a", "1f35c", "1f372","1f362", "1f361", "1f373", "1f35e", "1f369", "1f36e", "1f366","1f368", "1f367", "1f382", "1f370", "1f36a", "1f36b", "1f36c","1f36d", "1f36f", "1f34e", "1f34f", "1f34a", "1f34b", "1f352","1f347", "1f349", "1f353", "1f351", "1f348", "1f34c", "1f350","1f34d", "1f360", "1f346", "1f345", "1f33d" ],[ "1f3e0", "1f3e1", "1f3eb", "1f3e2", "1f3e3", "1f3e5", "1f3e6","1f3ea", "1f3e9", "1f3e8", "1f492", "26ea", "1f3ec", "1f3e4","1f307", "1f306", "1f3ef", "1f3f0", "26fa", "1f3ed", "1f5fc","1f5fe", "1f5fb", "1f304", "1f305", "1f303", "1f5fd", "1f309","1f3a0", "1f3a1", "26f2", "1f3a2", "1f6a2", "26f5", "1f6a4","1f6a3", "2693", "1f680", "2708", "1f4ba", "1f681", "1f682","1f68a", "1f689", "1f69e", "1f686", "1f684", "1f685", "1f688","1f687", "1f69d", "1f69d", "1f683", "1f68e", "1f68c", "1f68d","1f699", "1f698", "1f697", "1f695", "1f696", "1f69b", "1f69a","1f6a8", "1f693", "1f694", "1f692", "1f691", "1f690", "1f6b2","1f6a1", "1f69f", "1f6a0", "1f69c", "1f488", "1f68f", "1f3ab","1f6a6", "1f6a5", "26a0", "1f6a7", "1f530", "26fd", "1f3ee","1f3b0", "2668", "1f5ff", "1f3aa", "1f3ad", "1f4cd", "1f6a9","1f1ef-1f1f5", "1f1f0-1f1f7", "1f1e9-1f1ea", "1f1e8-1f1f3", "1f1fa-1f1f8", "1f1eb-1f1f7", "1f1ea-1f1f8","1f1ee-1f1f9", "1f1f7-1f1fa", "1f1ec-1f1e7" ],[ "0031", "0032", "0033", "0034", "0035", "0036", "0037","0038", "0039", "0030", "1f51f", "1f522", "0023", "1f523","2b06", "2b07", "2b05", "27a1", "1f520", "1f521", "1f524","2197", "2196", "2198", "2199", "2194", "2195", "1f504","25c0", "25b6", "1f53c", "1f53d", "21a9", "21aa", "2139","23ea", "23e9", "23eb", "23ec", "2935", "2934", "1f197","1f500", "1f501", "1f502", "1f195", "1f199", "1f192", "1f193","1f196", "1f4f6", "1f3a6", "1f201", "1f22f", "1f233", "1f235","1f232", "1f234", "1f232", "1f250", "1f239", "1f23a", "1f236","1f21a", "1f6bb", "1f6b9", "1f6ba", "1f6bc", "1f6be", "1f6b0","1f6ae", "1f17f", "267f", "1f6ad", "1f237", "1f238", "1f202","24c2", "1f251", "3299", "3297", "1f191", "1f198", "1f194","1f6ab", "1f51e", "1f4f5", "1f6af", "1f6b1", "1f6b3", "1f6b7","1f6b8", "26d4", "2733", "2747", "274e", "2705", "2734","1f49f", "1f19a", "1f4f3", "1f4f4", "1f170", "1f171", "1f18e","1f17e", "1f4a0", "27bf", "267b", "2648", "2649", "264a","264b", "264c", "264d", "264e", "264f", "2650", "2651","2652", "2653", "26ce", "1f52f", "1f3e7", "1f4b9", "1f4b2","1f4b1", "00a9", "00ae", "2122", "303d", "3030", "1f51d","1f51a", "1f519", "1f51b", "1f51c", "274c", "2b55", "2757","2753", "2755", "2754", "1f503", "1f55b", "1f567", "1f550","1f55c", "1f551", "1f55d", "1f552", "1f55e", "1f553", "1f55f","1f554", "1f560", "1f555", "1f556", "1f557", "1f558", "1f559","1f55a", "1f561", "1f562", "1f563", "1f564", "1f565", "1f566","2716", "2795", "2796", "2797", "2660", "2665", "2663","2666", "1f4ae", "1f4af", "2714", "2611", "1f518", "1f517","27b0", "1f531", "1f532", "1f533", "25fc", "25fb", "25fe","25fd", "25aa", "25ab", "1f53a", "2b1c", "2b1b", "26ab","26aa", "1f534", "1f535", "1f53b", "1f536", "1f537", "1f538","1f539" ]]; 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"]] \ No newline at end of file diff --git a/app/js/services.js b/app/js/services.js index 03dd3307..f843e52f 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -564,7 +564,7 @@ angular.module('myApp.services', []) var badCharsRe = /[`~!@#$%^&*()\-_=+\[\]\\|{}'";:\/?.>,<\s]+/g, trimRe = /^\s+|\s$/g, accentsReplace = { - a: /[áâäà]/g, + a: /[åáâäà]/g, e: /[éêëè]/g, i: /[íîïì]/g, o: /[óôöò]/g, @@ -3252,7 +3252,7 @@ angular.module('myApp.services', []) if (typeof params === 'string') { params = {message: params}; } - confirm(params).then(function (result) { + confirm(params.message).then(function (result) { callback(result || true) }, function () { callback(false) diff --git a/app/partials/confirm_modal.html b/app/partials/confirm_modal.html index e551d89c..0f41e6c6 100644 --- a/app/partials/confirm_modal.html +++ b/app/partials/confirm_modal.html @@ -16,6 +16,10 @@ Are you sure to send file(s) from clipboard? Are you sure to delete the message? +