Browse Source

Merged with master

master
Igor Zhukov 10 years ago
parent
commit
4821550517
  1. 3
      README.md
  2. BIN
      app/img/screenshot2.png
  3. BIN
      app/img/screenshot3.png
  4. 2
      app/index.html
  5. 23
      app/js/controllers.js
  6. 2
      app/js/directives.js
  7. 3
      app/js/services.js
  8. 2
      app/manifest.json
  9. 4
      app/manifest.webapp
  10. 2
      app/partials/desktop/country_select_modal.html
  11. 2
      app/partials/desktop/im.html
  12. 2
      app/partials/mobile/country_select_modal.html
  13. 12
      app/partials/mobile/message.html
  14. 2
      app/webogram.appcache
  15. 2
      gulpfile.js
  16. 6
      package.json

3
README.md

@ -17,7 +17,10 @@ That said, I'm using this app myself and I'd like to share its sources, so anyon
Here are some screenshots of the interface: Here are some screenshots of the interface:
![Sample screenshot 1](/app/img/screenshot1.png) ![Sample screenshot 1](/app/img/screenshot1.png)
![Mobile screenshot 2](/app/img/screenshot2.png)
![Mobile screenshot 3](/app/img/screenshot3.png)
### Implemented functionality list ### Implemented functionality list

BIN
app/img/screenshot2.png

Binary file not shown.

Before

Width:  |  Height:  |  Size: 2.9 MiB

After

Width:  |  Height:  |  Size: 33 KiB

BIN
app/img/screenshot3.png

Binary file not shown.

After

Width:  |  Height:  |  Size: 86 KiB

2
app/index.html

@ -34,6 +34,8 @@
<body> <body>
<div class="page_wrap" ng-view></div> <div class="page_wrap" ng-view></div>
<div id="notify_sound"></div>
<!-- build:js js/app.js --> <!-- build:js js/app.js -->
<script type="text/javascript" src="vendor/console-polyfill/console-polyfill.js"></script> <script type="text/javascript" src="vendor/console-polyfill/console-polyfill.js"></script>

23
app/js/controllers.js

@ -23,9 +23,10 @@ angular.module('myApp.controllers', [])
ChangelogNotifyService.checkUpdate(); ChangelogNotifyService.checkUpdate();
}) })
.controller('AppLoginController', function ($scope, $location, $timeout, $modal, $modalStack, MtpApiManager, ErrorService, ChangelogNotifyService) { .controller('AppLoginController', function ($scope, $rootScope, $location, $timeout, $modal, $modalStack, MtpApiManager, ErrorService, NotificationsManager, ChangelogNotifyService, IdleManager) {
$modalStack.dismissAll(); $modalStack.dismissAll();
IdleManager.start();
MtpApiManager.getUserID().then(function (id) { MtpApiManager.getUserID().then(function (id) {
if (id) { if (id) {
@ -181,6 +182,12 @@ angular.module('myApp.controllers', [])
phone_number: $scope.credentials.phone_number phone_number: $scope.credentials.phone_number
}).then(function () { }).then(function () {
$scope.progress.enabled = true; $scope.progress.enabled = true;
onContentLoaded(function () {
$scope.$broadcast('ui_height');
});
var authKeyStarted = tsNow();
MtpApiManager.invokeApi('auth.sendCode', { MtpApiManager.invokeApi('auth.sendCode', {
phone_number: $scope.credentials.phone_full, phone_number: $scope.credentials.phone_full,
sms_type: 5, sms_type: 5,
@ -197,6 +204,10 @@ angular.module('myApp.controllers', [])
callCheck(); callCheck();
onContentLoaded(function () {
$scope.$broadcast('ui_height');
});
}, function (error) { }, function (error) {
$scope.progress.enabled = false; $scope.progress.enabled = false;
console.log('sendCode error', error); console.log('sendCode error', error);
@ -215,6 +226,14 @@ angular.module('myApp.controllers', [])
error.handled = true; error.handled = true;
break; break;
} }
})['finally'](function () {
if ($rootScope.idle.isIDLE || tsNow() - authKeyStarted > 60000) {
NotificationsManager.notify({
title: 'Telegram',
message: 'Your authorization key was successfully generated! Open the app to log in.',
tag: 'auth_key'
});
}
}); });
}); });
} }
@ -1060,7 +1079,7 @@ angular.module('myApp.controllers', [])
} }
onContentLoaded(function () { onContentLoaded(function () {
$scope.$broadcast('messages_focus', $scope.curDialog.messageID || 0); $scope.$broadcast('messages_focus', $scope.curDialog.messageID || 0);
}) });
$scope.$broadcast('ui_history_change'); $scope.$broadcast('ui_history_change');
AppMessagesManager.readHistory($scope.curDialog.inputPeer); AppMessagesManager.readHistory($scope.curDialog.inputPeer);

2
app/js/directives.js

@ -39,9 +39,11 @@ angular.module('myApp.directives', ['myApp.filters'])
return { return {
templateUrl: templateUrl('message'), templateUrl: templateUrl('message'),
link: link
}; };
function link($scope, element, attrs) { function link($scope, element, attrs) {
console.log(111);
var selected = false, var selected = false,
grouped = false, grouped = false,
focused = false, focused = false,

3
app/js/services.js

@ -3603,6 +3603,9 @@ angular.module('myApp.services', [])
if (Config.Navigator.ffos) { if (Config.Navigator.ffos) {
data.image = 'https://raw.githubusercontent.com/zhukov/webogram/master/app/img/icons/icon60.png'; data.image = 'https://raw.githubusercontent.com/zhukov/webogram/master/app/img/icons/icon60.png';
} }
else if (!data.image) {
data.image = 'img/icons/icon60.png';
}
notificationsCount++; notificationsCount++;

2
app/manifest.json

@ -1,5 +1,5 @@
{ {
"name": "Telegram UNOFFICIAL", "name": "Telegram",
"version": "0.3.0", "version": "0.3.0",
"short_name": "Webogram", "short_name": "Webogram",
"manifest_version": 2, "manifest_version": 2,

4
app/manifest.webapp

@ -34,7 +34,9 @@
"share": { "share": {
"href": "/index.html", "href": "/index.html",
"disposition": "window", "disposition": "window",
"filters": {}, "filters": {
"type": ["image/*","audio/*","video/*"]
},
"returnValue": false "returnValue": false
} }
}, },

2
app/partials/desktop/country_select_modal.html

@ -5,7 +5,7 @@
<h4 class="modal_simple_header">Country</h4> <h4 class="modal_simple_header">Country</h4>
<div class="countries_modal_search"> <div class="countries_modal_search">
<input class="form-control countries_modal_search_field" my-focused type="search" placeholder="Search" ng-model="search.query"/> <input class="form-control countries_modal_search_field no_outline" my-focused type="search" placeholder="Search" ng-model="search.query"/>
<a class="countries_modal_search_clear" ng-click="search.query = ''" ng-show="search.query.length"></a> <a class="countries_modal_search_clear" ng-click="search.query = ''" ng-show="search.query.length"></a>
</div> </div>

2
app/partials/desktop/im.html

@ -277,5 +277,3 @@
<div class="im_page_footer"> <div class="im_page_footer">
<a class="im_page_footer_brand" target="_blank" href="https://github.com/zhukov/webogram">Telegram beta</a> by izhukov &amp; toberg <a class="im_page_footer_brand" target="_blank" href="https://github.com/zhukov/webogram">Telegram beta</a> by izhukov &amp; toberg
</div> </div>
<div id="notify_sound"></div>

2
app/partials/mobile/country_select_modal.html

@ -26,7 +26,7 @@
<div class="modal-body mobile_modal_body"> <div class="modal-body mobile_modal_body">
<div class="countries_modal_search"> <div class="countries_modal_search">
<input class="form-control countries_modal_search_field" my-focused type="search" placeholder="Search" ng-model="search.query"/> <input class="form-control countries_modal_search_field no_outline" my-focused type="search" placeholder="Search" ng-model="search.query"/>
<a class="countries_modal_search_clear" ng-click="search.query = ''" ng-show="search.query.length"></a> <a class="countries_modal_search_clear" ng-click="search.query = ''" ng-show="search.query.length"></a>
</div> </div>

12
app/partials/mobile/message.html

@ -1,12 +1,4 @@
<div class="im_message_unread_split" ng-if="::historyUnreadAfter == historyMessage.id || false" ng-show="historyUnreadAfter == historyMessage.id"> <div class="im_message_outer_wrap" ng-click="toggleMessage(historyMessage.id, $event)">
Unread messages
</div>
<div class="im_message_date_split im_service_message_wrap" ng-if="::historyMessage.needDate || false" ng-show="historyMessage.needDate">
<div class="im_service_message" ng-bind="historyMessage.date | myDate"></div>
</div>
<div class="im_message_outer_wrap" ng-class="[selectedMsgs[historyMessage.id] ? 'im_message_selected' : '', historyMessage.grouped, historyFocus == historyMessage.id ? 'im_message_focus' : '', historyMessage.unread ? 'im_message_unread' : '', historyMessage.error ? 'im_message_error' : '', historyMessage.pending ? 'im_message_pending' : '']" ng-click="toggleMessage(historyMessage.id, $event)">
<div class="im_message_wrap clearfix"> <div class="im_message_wrap clearfix">
@ -45,7 +37,7 @@
<span class="im_message_date" ng-bind="::historyMessage.date | time"></span> <span class="im_message_date" ng-bind="::historyMessage.date | time"></span>
</div> </div>
<div class="im_message_body" ng-class="{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media &amp;&amp; historyMessage.media._ != 'messageMediaEmpty'}"> <div class="im_message_body" ng-class="::{im_message_body_media: historyMessage._ == 'message' &amp;&amp; historyMessage.media &amp;&amp; historyMessage.media._ != 'messageMediaEmpty'}">
<a class="im_message_author" my-user-link="historyMessage.from_id" short="!historyMessage.to_id.chat_id" color="historyMessage.to_id.chat_id > 0"></a> <a class="im_message_author" my-user-link="historyMessage.from_id" short="!historyMessage.to_id.chat_id" color="historyMessage.to_id.chat_id > 0"></a>

2
app/webogram.appcache

@ -1,6 +1,6 @@
CACHE MANIFEST CACHE MANIFEST
# 31 # 32
NETWORK: NETWORK:
* *

2
gulpfile.js

@ -21,7 +21,7 @@ gulp.task('usemin', ['templates', 'enable-production'], function() {
return gulp.src('app/index.html') return gulp.src('app/index.html')
.pipe($.usemin({ .pipe($.usemin({
html: [$.minifyHtml({empty: true})], html: [$.minifyHtml({empty: true})],
js: ['concat', $.ngmin(), $.uglify({outSourceMap: true})], js: ['concat', $.ngmin(), $.uglify(/*{outSourceMap: true}*/)],
css: [$.minifyCss(), 'concat'] css: [$.minifyCss(), 'concat']
})) }))
.pipe(gulp.dest('dist')); .pipe(gulp.dest('dist'));

6
package.json

@ -35,9 +35,9 @@
"gulp": "~3.5.5", "gulp": "~3.5.5",
"gulp-angular-templatecache": "^1.1.0", "gulp-angular-templatecache": "^1.1.0",
"gulp-load-plugins": "^0.4.0", "gulp-load-plugins": "^0.4.0",
"gulp-usemin": "^0.3.3", "gulp-usemin": "^0.3.8",
"gulp-uglify": "^0.2.1", "gulp-uglify": "^1.0.1",
"gulp-rev": "^0.3.0", "gulp-rev": "^1.1.0",
"gulp-minify-css": "^0.3.0", "gulp-minify-css": "^0.3.0",
"gulp-minify-html": "^0.1.1", "gulp-minify-html": "^0.1.1",
"gulp-imagemin": "^0.1.5", "gulp-imagemin": "^0.1.5",

Loading…
Cancel
Save