diff --git a/app/css/app.css b/app/css/app.css index 0a6e6224..d05d90db 100644 --- a/app/css/app.css +++ b/app/css/app.css @@ -2,7 +2,7 @@ html { background: #dee4e9 url(../img/bg_tile.png?1) 0 0 repeat; - background-size: 300px 468px; + /*background-size: 300px 468px;*/ /*background: #dee4e9 url(../img/bg_full.png) 0 0 no-repeat;*/ /*background-size: cover;*/ @@ -1103,6 +1103,7 @@ img.img_fullsize { .chat_modal_window .modal-dialog { max-width: 506px; } + .chat_modal_wrap .modal-body { padding: 23px 25px 15px; } @@ -1242,4 +1243,13 @@ img.img_fullsize { /*-moz-border-radius : 0; -webkit-border-radius : 0; border-radius : 0;*/ +} + + +.error_modal_window .modal-dialog { + max-width: 400px; +} +.error_modal_description { + text-align: center; + padding: 40px 20px; } \ No newline at end of file diff --git a/app/favicon.ico b/app/favicon.ico new file mode 100644 index 00000000..d0f064d6 Binary files /dev/null and b/app/favicon.ico differ diff --git a/app/img/placeholders/DialogListAvatarSystem@2x.png b/app/img/placeholders/DialogListAvatarSystem@2x.png index 305e86cf..110bd07d 100644 Binary files a/app/img/placeholders/DialogListAvatarSystem@2x.png and b/app/img/placeholders/DialogListAvatarSystem@2x.png differ diff --git a/app/index.html b/app/index.html index 557a9cff..c4c644d9 100644 --- a/app/index.html +++ b/app/index.html @@ -7,7 +7,8 @@ - + + @@ -35,11 +36,11 @@ - - - - - + + + + + diff --git a/app/js/app.js b/app/js/app.js index 385303fb..917ace19 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -49,7 +49,7 @@ config(['$locationProvider', '$routeProvider', '$compileProvider', function($loc // $locationProvider.html5Mode(true); $routeProvider.when('/', {templateUrl: 'partials/welcome.html', controller: 'AppWelcomeController'}); $routeProvider.when('/login', {templateUrl: 'partials/login.html?1', controller: 'AppLoginController'}); - $routeProvider.when('/im', {templateUrl: 'partials/im.html', controller: 'AppIMController', reloadOnSearch: false}); + $routeProvider.when('/im', {templateUrl: 'partials/im.html?1', controller: 'AppIMController', reloadOnSearch: false}); $routeProvider.otherwise({redirectTo: '/'}); }]); diff --git a/app/js/controllers.js b/app/js/controllers.js index ea368bf9..fa72d72f 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -21,7 +21,7 @@ angular.module('myApp.controllers', []) }); }) - .controller('AppLoginController', function ($scope, $location, MtpApiManager) { + .controller('AppLoginController', function ($scope, $location, MtpApiManager, ErrorService) { var dcID = 1; $scope.credentials = {}; @@ -46,6 +46,11 @@ angular.module('myApp.controllers', []) }, {dcID: dcID}).then(function (sentCode) { $scope.progress.enabled = false; + if (!sentCode.phone_registered) { + ErrorService.showSimpleError('No account', 'Sorry, there is no Telegram account for ' + $scope.credentials.phone_number + '. Please sign up using our mobile apps.'); + return false; + } + $scope.credentials.phone_code_hash = sentCode.phone_code_hash; $scope.credentials.phone_occupied = sentCode.phone_registered; $scope.error = {}; @@ -88,7 +93,7 @@ angular.module('myApp.controllers', []) $scope.progress.enabled = false; if (error.code == 400 && error.type == 'PHONE_NUMBER_UNOCCUPIED') { return $scope.logIn(true); - } else if (error.code == 400 && error.type == 'PHONE_NUMBER_UNOCCUPIED') { + } else if (error.code == 400 && error.type == 'PHONE_NUMBER_OCCUPIED') { return $scope.logIn(false); } diff --git a/app/js/directives.js b/app/js/directives.js index ac25c641..144b3ac1 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -16,7 +16,7 @@ angular.module('myApp.directives', ['myApp.filters']) restrict: 'AE', scope: true, translude: false, - templateUrl: 'partials/dialog.html' + templateUrl: 'partials/dialog.html?1' }; }) @@ -25,7 +25,7 @@ angular.module('myApp.directives', ['myApp.filters']) restrict: 'AE', scope: true, translude: false, - templateUrl: 'partials/message.html?1' + templateUrl: 'partials/message.html?2' }; }) diff --git a/app/js/services.js b/app/js/services.js index 24c006b5..8e0fb63c 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -160,6 +160,12 @@ angular.module('myApp.services', []) function getUserPhoto(id, placeholder) { var user = getUser(id); + if (id == 333000) { + return { + placeholder: 'img/placeholders/DialogListAvatarSystem@2x.png' + } + }; + return { placeholder: 'img/placeholders/' + placeholder + 'Avatar'+((Math.abs(id) % 8) + 1)+'@2x.png', location: user && user.photo && user.photo.photo_small @@ -320,7 +326,7 @@ angular.module('myApp.services', []) scope.chatID = chatID; var modalInstance = $modal.open({ - templateUrl: 'partials/chat_modal.html', + templateUrl: 'partials/chat_modal.html?1', controller: 'ChatModalController', windowClass: 'chat_modal_window', scope: scope, @@ -1309,9 +1315,9 @@ angular.module('myApp.services', []) scope.videoID = videoID; scope.progress = {enabled: false}; scope.player = {}; - scope.close = function () { - modalInstance.close(); - } + // scope.close = function () { + // modalInstance.close(); + // } var modalInstance = $modal.open({ templateUrl: 'partials/video_modal.html', @@ -1945,3 +1951,33 @@ angular.module('myApp.services', []) notificationsShown = []; } }) + + +.service('ErrorService', function ($rootScope, $modal) { + + function showError (templateUrl, params, options) { + var scope = $rootScope.$new(); + angular.extend(scope, params); + + return $modal.open({ + templateUrl: templateUrl, + // controller: 'ErrorModalController', + scope: scope, + windowClass: options.windowClass || '' + }); + } + + function showSimpleError (title, description) { + return showError ('partials/error_modal.html', { + title: title, + description: description + }, { + windowClass: 'error_modal_window' + }); + }; + + return { + showError: showError, + showSimpleError: showSimpleError + } +}) diff --git a/app/partials/error_modal.html b/app/partials/error_modal.html new file mode 100644 index 00000000..50e2ac2e --- /dev/null +++ b/app/partials/error_modal.html @@ -0,0 +1,17 @@ +
+ + + + + + +
\ No newline at end of file diff --git a/app/partials/im.html b/app/partials/im.html index d1fa6e43..0773340b 100644 --- a/app/partials/im.html +++ b/app/partials/im.html @@ -1,4 +1,4 @@ -
+
diff --git a/app/partials/login.html b/app/partials/login.html index 974e0e89..86f9b01e 100644 --- a/app/partials/login.html +++ b/app/partials/login.html @@ -1,4 +1,4 @@ -
+