diff --git a/app/css/app.css b/app/css/app.css index 7f3172ae..01ca642e 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;*/ @@ -251,9 +251,33 @@ fieldset[disabled] .btn-tg.active { /* Welcome */ -.jumbotron { - background: none; + +.welcome_logo { + background: url(../img/logo_dogogram.png) 0 0 no-repeat; + background-size: 111px 112px; + display: block; + width: 112px; + height: 112px; + margin: 100px auto 0; } +.welcome_box_wrap { + max-width: 310px; + padding: 25px; + background: #FFF; + margin: 30px auto 0; + border-radius: 1px; + overflow: hidden; + + -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1); + -moz-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1); + box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1); +} +.welcome_text { + color: #999; + text-align: center; + margin-bottom: 25px; +} + /* Login page */ .login_form_wrap { @@ -261,7 +285,7 @@ fieldset[disabled] .btn-tg.active { padding: 25px; background: #FFF; margin: 200px auto 0; - border-radius: 3px; + border-radius: 1px; overflow: hidden; -webkit-box-shadow: 0px 1px 2px rgba(0, 0, 0, 0.1); diff --git a/app/img/logo_dogogram.png b/app/img/logo_dogogram.png new file mode 100644 index 00000000..694c7174 Binary files /dev/null and b/app/img/logo_dogogram.png differ diff --git a/app/index.html b/app/index.html index 9635d81e..825dbb1e 100644 --- a/app/index.html +++ b/app/index.html @@ -7,7 +7,7 @@ - + @@ -37,12 +37,12 @@ - + - + - + diff --git a/app/js/app.js b/app/js/app.js index d8a4723f..ce633664 100644 --- a/app/js/app.js +++ b/app/js/app.js @@ -7,7 +7,8 @@ 'use strict'; -// window._testMode = 1; +window._testMode = location.search.indexOf('test=1') > 0; +window._debugMode = location.search.indexOf('debug=1') > 0; // Declare app level module which depends on filters, and services @@ -47,8 +48,8 @@ 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('/', {templateUrl: 'partials/welcome.html?1', controller: 'AppWelcomeController'}); + $routeProvider.when('/login', {templateUrl: 'partials/login.html?2', controller: 'AppLoginController'}); $routeProvider.when('/im', {templateUrl: 'partials/im.html?3', controller: 'AppIMController', reloadOnSearch: false}); $routeProvider.otherwise({redirectTo: '/'}); diff --git a/app/js/controllers.js b/app/js/controllers.js index 099a5992..aeede4f0 100644 --- a/app/js/controllers.js +++ b/app/js/controllers.js @@ -15,8 +15,6 @@ angular.module('myApp.controllers', []) MtpApiManager.getUserID().then(function (id) { if (id) { $location.url('/im'); - } else { - $location.url('/login'); } }); }) diff --git a/app/js/lib/mtproto.js b/app/js/lib/mtproto.js index 5ae987e4..a0e0babf 100644 --- a/app/js/lib/mtproto.js +++ b/app/js/lib/mtproto.js @@ -351,7 +351,7 @@ function TLSerialization (options) { this.createBuffer(); - // this.debug = options.debug !== undefined ? options.debug : true; + this.debug = options.debug !== undefined ? options.debug : window._debugMode; this.mtproto = options.mtproto || false; return this; } @@ -631,7 +631,7 @@ function TLDeserialization (buffer, options) { this.intView = new Uint32Array(this.buffer); this.byteView = new Uint8Array(this.buffer); - // this.debug = options.debug !== undefined ? options.debug : true; + this.debug = options.debug !== undefined ? options.debug : window._debugMode; this.mtproto = options.mtproto || false; return this; } @@ -1575,7 +1575,9 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato body: serializer.getBytes() }; - // dLog('MT call', method, params, messageID, seqNo); + if (window._debugMode) { + dLog('MT call', method, params, messageID, seqNo); + } return this.pushMessage(message, options); }; @@ -1594,7 +1596,9 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato body: serializer.getBytes() }; - // dLog('MT message', object, messageID, seqNo); + if (window._debugMode) { + dLog('MT message', object, messageID, seqNo); + } return this.pushMessage(message, options); }; @@ -1623,8 +1627,11 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato isAPI: true }; - dLog('Api call', method, messageID, seqNo); - // dLog('Api call', method, params, messageID, seqNo); + if (window._debugMode) { + dLog('Api call', method, params, messageID, seqNo) + } else { + dLog('Api call', method, messageID, seqNo); + } return this.pushMessage(message, options); }; @@ -1793,7 +1800,9 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato var self = this; this.sendEncryptedRequest(message).then(function (result) { self.parseResponse(result.data).then(function (response) { - // dLog('Server response', self.dcID, response); + if (window._debugMode) { + dLog('Server response', self.dcID, response); + } self.processMessage(response.response, response.messageID, response.sessionID); diff --git a/app/partials/login.html b/app/partials/login.html index 86f9b01e..573478ee 100644 --- a/app/partials/login.html +++ b/app/partials/login.html @@ -5,7 +5,7 @@