From 4033b9937abf0a00c2a111b3cc66cb34e998e3f0 Mon Sep 17 00:00:00 2001 From: Roman Anasal Date: Mon, 29 Sep 2014 17:51:52 +0200 Subject: [PATCH 01/10] Bugfix: added missing message to i18n --- app/js/directives.js | 2 +- app/js/locales/en-us.json | 2 ++ 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/app/js/directives.js b/app/js/directives.js index 8cc50882..68cfb13d 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -37,7 +37,7 @@ angular.module('myApp.directives', ['myApp.filters']) var dateFilter = $filter('myDate'), dateSplitHtml = '
', - unreadSplitHtml = '
Unread messages
', + unreadSplitHtml = '
', selectedClass = 'im_message_selected', focusClass = 'im_message_focus', unreadClass = 'im_message_unread', diff --git a/app/js/locales/en-us.json b/app/js/locales/en-us.json index 03d4cb1d..49ea7f68 100644 --- a/app/js/locales/en-us.json +++ b/app/js/locales/en-us.json @@ -74,6 +74,8 @@ "error_browser_no_local_file_system_video_md": "Your browser doesn't support {moz-link: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem | LocalFileSystem} feature which is needed to play this video.\nPlease, install {chrome-link: http://google.com/chrome | Google Chrome} or use {telegram-link: https://telegram.org/ | mobile app} instead.", "error_video_download_failed": "Video download failed", + "unread_messages_split": "Unread messages", + "user_name_deleted": "DELETED", "user_first_name_deleted": "DELETED", "user_status_offline": "offline", From 932dffcbb70957d275a39e74d6fc7f3c0bfb0d6a Mon Sep 17 00:00:00 2001 From: Roman Anasal Date: Mon, 29 Sep 2014 17:53:09 +0200 Subject: [PATCH 02/10] added missing message to german locale see previous commit --- app/js/locales/de-de.json | 1 + 1 file changed, 1 insertion(+) diff --git a/app/js/locales/de-de.json b/app/js/locales/de-de.json index fc149f59..891e0e13 100644 --- a/app/js/locales/de-de.json +++ b/app/js/locales/de-de.json @@ -66,6 +66,7 @@ "error_image_download_failed": "Download fehlgeschlagen", "error_browser_no_local_file_system_video_md": "Dein Browser unterstützt nicht die {moz-link: https://developer.mozilla.org/en-US/docs/Web/API/LocalFileSystem | LocalFileSystem}-Funktion, welche zum Abspielen dieses Videos benötigt wird.\nBitte installiere {chrome-link: http://google.com/chrome | Google Chrome} oder benutze stattdessen die {telegram-link: https://telegram.org/ | mobile App}.", "error_video_download_failed": "Videodownload fehlgeschlagen", + "unread_messages_split": "ungelesene Nachrichten", "user_name_deleted": "Gelöscht", "user_first_name_deleted": "Gelöscht", "user_status_offline": "offline", From 14be9c8b4141ef47696c0998e0c7996d920dd9be Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 29 Sep 2014 21:47:19 +0400 Subject: [PATCH 03/10] Improved l10n for time format #490 --- app/js/filters.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/filters.js b/app/js/filters.js index 3ea481d1..29a1ebb8 100644 --- a/app/js/filters.js +++ b/app/js/filters.js @@ -63,7 +63,7 @@ angular.module('myApp.filters', ['myApp.i18n']) var ticks = timestamp * 1000, diff = Math.abs(tsNow() - ticks), - format = 'HH:mm'; + format = 'shortTime'; if (diff > 518400000) { // 6 days format = 'shortDate'; @@ -78,7 +78,7 @@ angular.module('myApp.filters', ['myApp.i18n']) .filter('time', ['$filter', function($filter) { var cachedDates = {}, dateFilter = $filter('date'), - format = Config.Mobile ? 'HH:mm' : 'HH:mm:ss'; + format = Config.Mobile ? 'shortTime' : 'mediumTime'; return function (timestamp) { if (cachedDates[timestamp]) { From 1cd2fc3354178ad63eb8e5005c7a76a0b33f1b5a Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 29 Sep 2014 22:18:38 +0400 Subject: [PATCH 04/10] Added l10n to some mobile partials --- app/partials/desktop/im.html | 7 ++- app/partials/mobile/chat_create_modal.html | 8 +-- app/partials/mobile/chat_edit_modal.html | 8 +-- app/partials/mobile/dialog.html | 45 +++++++------- app/partials/mobile/edit_contact_modal.html | 10 ++-- app/partials/mobile/im.html | 51 +++++++--------- app/partials/mobile/import_contact_modal.html | 14 ++--- app/partials/mobile/login.html | 60 ++++++++++--------- .../mobile/message_attach_document.html | 8 ++- .../mobile/message_attach_pending.html | 4 +- app/partials/mobile/message_service.html | 39 +++++------- app/partials/mobile/photo_modal.html | 8 +-- app/partials/mobile/profile_edit_modal.html | 8 +-- app/partials/mobile/video_modal.html | 8 +-- app/partials/mobile/welcome.html | 20 +++---- 15 files changed, 138 insertions(+), 160 deletions(-) diff --git a/app/partials/desktop/im.html b/app/partials/desktop/im.html index aac2b8fa..6e7aeae6 100644 --- a/app/partials/desktop/im.html +++ b/app/partials/desktop/im.html @@ -148,7 +148,9 @@
- + + +
@@ -187,7 +189,7 @@ - Cancel +
@@ -257,7 +259,6 @@
-
\ No newline at end of file diff --git a/app/partials/mobile/chat_create_modal.html b/app/partials/mobile/chat_create_modal.html index 46cd4367..5f9daf49 100644 --- a/app/partials/mobile/chat_create_modal.html +++ b/app/partials/mobile/chat_create_modal.html @@ -8,15 +8,13 @@
\ No newline at end of file + diff --git a/app/partials/mobile/welcome.html b/app/partials/mobile/welcome.html index 6149e88b..3b4cd6f9 100644 --- a/app/partials/mobile/welcome.html +++ b/app/partials/mobile/welcome.html @@ -5,14 +5,14 @@
-

Telegram Web

+

-

This is an unofficial web-client for the Telegram Messenger.

-

It's still an alpha-version and may not be 200% reliable

+

+

@@ -24,24 +24,24 @@
From d3be7bd09c745e1816f6774f65537971e722cc12 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 29 Sep 2014 22:23:19 +0400 Subject: [PATCH 05/10] Fixed l10n bugs Unread split group_name => group-name --- app/js/directives.js | 4 ++-- app/js/locales/de-de.json | 4 ++-- app/js/locales/es-es.json | 4 ++-- app/js/locales/ru-ru.json | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/js/directives.js b/app/js/directives.js index 23531eeb..a76e83bf 100644 --- a/app/js/directives.js +++ b/app/js/directives.js @@ -33,11 +33,11 @@ angular.module('myApp.directives', ['myApp.filters']) }; }) - .directive('myMessage', function($filter) { + .directive('myMessage', function($filter, _) { var dateFilter = $filter('myDate'), dateSplitHtml = '
', - unreadSplitHtml = '
', + unreadSplitHtml = '
' + _('unread_messages_split') + '
', selectedClass = 'im_message_selected', focusClass = 'im_message_focus', unreadClass = 'im_message_unread', diff --git a/app/js/locales/de-de.json b/app/js/locales/de-de.json index b92ec23f..0532579a 100644 --- a/app/js/locales/de-de.json +++ b/app/js/locales/de-de.json @@ -155,8 +155,8 @@ "conversation_kicked_user_message": "hat Benutzer gekickt", "conversation_unknown_user": "Jemand", "conversation_unknown_chat": "Unbekannte Unterhaltung", - "message_service_created_group": "hat die Gruppe {group_name} erstellt", - "message_service_changed_group_name": "hat den Gruppennamen zu {group_name} geändert", + "message_service_created_group": "hat die Gruppe {group-name} erstellt", + "message_service_changed_group_name": "hat den Gruppennamen zu {group-name} geändert", "message_service_changed_group_photo": "hat das Gruppenbild geändert", "message_service_removed_group_photo": "hat das Gruppenbild entfernt", "message_service_invited_user": "hat {user} eingeladen", diff --git a/app/js/locales/es-es.json b/app/js/locales/es-es.json index ce72117a..8c52da87 100644 --- a/app/js/locales/es-es.json +++ b/app/js/locales/es-es.json @@ -154,8 +154,8 @@ "conversation_kicked_user_message": "usuario expulsado", "conversation_unknown_user": "Alguien", "conversation_unknown_chat": "Chat desconocido", - "message_service_created_group": "ha creado el grupo {group_name}", - "message_service_changed_group_name": "ha cambiado el nombre del grupo a {group_name}", + "message_service_created_group": "ha creado el grupo {group-name}", + "message_service_changed_group_name": "ha cambiado el nombre del grupo a {group-name}", "message_service_changed_group_photo": "ha cambiado la foto del grupo", "message_service_removed_group_photo": "ha eliminado la foto del grupo", "message_service_invited_user": "ha invitado a {user}", diff --git a/app/js/locales/ru-ru.json b/app/js/locales/ru-ru.json index 1412fd08..b95e73d5 100644 --- a/app/js/locales/ru-ru.json +++ b/app/js/locales/ru-ru.json @@ -155,8 +155,8 @@ "conversation_kicked_user_message": "исключённый пользователь", "conversation_unknown_user": "Кто-то", "conversation_unknown_chat": "Неизвестный чат", - "message_service_created_group": "создал(а) группу {group_name}", - "message_service_changed_group_name": "изменил(а) название группы на {group_name}", + "message_service_created_group": "создал(а) группу {group-name}", + "message_service_changed_group_name": "изменил(а) название группы на {group-name}", "message_service_changed_group_photo": "изменил(а) фото группы", "message_service_removed_group_photo": "удалил(а) фото группы", "message_service_invited_user": "пригласил(а) {user}", From 9c3ae42065c2600fcc85fcbe0d0cb800a68ae3eb Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 29 Sep 2014 22:33:46 +0400 Subject: [PATCH 06/10] l10n fix --- app/partials/desktop/chat_edit_modal.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/partials/desktop/chat_edit_modal.html b/app/partials/desktop/chat_edit_modal.html index 367ed855..103a36bf 100644 --- a/app/partials/desktop/chat_edit_modal.html +++ b/app/partials/desktop/chat_edit_modal.html @@ -17,7 +17,7 @@ From ccab402f7ca974a08287731c326854bbd6299b4b Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 29 Sep 2014 23:15:23 +0400 Subject: [PATCH 07/10] Fixed message invalid peer bug --- app/js/services.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/app/js/services.js b/app/js/services.js index 5d749e83..80e37d21 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -1728,7 +1728,7 @@ angular.module('myApp.services', ['myApp.i18n']) if (toID < 0) { return toID; - } else if (message.out) { + } else if (message.out || message.flags & 2) { return toID; } return message.from_id; @@ -2032,10 +2032,6 @@ angular.module('myApp.services', ['myApp.i18n']) peerID = getMessagePeer(message), historyStorage = historiesStorage[peerID]; - if (!message.out) { - AppUsersManager.forceUserOnline(message.from_id); - } - if (historyStorage !== undefined) { var topMsgID = historiesStorage[peerID].history[0]; if (historiesStorage[peerID].history.indexOf(message.id) != -1) { @@ -2055,6 +2051,10 @@ angular.module('myApp.services', ['myApp.i18n']) saveMessages([message]); + if (!message.out) { + AppUsersManager.forceUserOnline(message.from_id); + } + if (historyStorage.count !== null) { historyStorage.count++; } From 4967f4261e29e2116634b6341e47d16ceb65f917 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 29 Sep 2014 23:27:27 +0400 Subject: [PATCH 08/10] Fixed mobile icons --- app/css/mobile.css | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/app/css/mobile.css b/app/css/mobile.css index 6498017d..26cf46bc 100644 --- a/app/css/mobile.css +++ b/app/css/mobile.css @@ -130,7 +130,7 @@ html { vertical-align: text-top; background: url(../img/icons/IconsetW.png) -15px -835px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.8; } .is_1x .icon-back { @@ -954,7 +954,7 @@ a.mobile_modal_action .tg_checkbox_label { .im_submit:active, .im_submit:hover { background: url(../img/icons/IconsetW.png) 2px -860px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; color: transparent; box-shadow: none; } @@ -978,7 +978,7 @@ a.mobile_modal_action .tg_checkbox_label { height: 23px; vertical-align: text-top; background: url(../img/icons/IconsetW.png) -12px -68px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; opacity: 0.8; } .is_1x .icon-paperclip { @@ -1015,7 +1015,7 @@ a.mobile_modal_action .tg_checkbox_label { opacity: 1; margin: 0; background: url(../img/icons/IconsetW.png) -10px -771px no-repeat; - background-size: 42px 891px; + background-size: 42px 971px; } .is_1x .icon-emoji { background-image: url(../img/icons/IconsetW_1x.png); From 8868f3e3df1821010c6a8d471d39d83397a34659 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Mon, 29 Sep 2014 23:35:15 +0400 Subject: [PATCH 09/10] Added preview for no-thumb PDF --- app/js/services.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/services.js b/app/js/services.js index 80e37d21..b4134f02 100644 --- a/app/js/services.js +++ b/app/js/services.js @@ -2713,9 +2713,9 @@ angular.module('myApp.services', ['myApp.i18n']) doc.thumb = thumb; doc.canDownload = !(window.chrome && chrome.fileSystem && chrome.fileSystem.chooseEntry); - doc.withPreview = doc.canDownload && doc.thumb && doc.mime_type.match(/^(image\/|application\/pdf)/) ? 1 : 0; + doc.withPreview = doc.canDownload && doc.mime_type.match(/^(image\/|application\/pdf)/) ? 1 : 0; - if (doc.withPreview && isGif) { + if (isGif && doc.withPreview && doc.thumb) { doc.isSpecial = 'gif'; } else if (isAudio) { From 3af88febb917ece76bd5bf011e56125a5a0f4ba6 Mon Sep 17 00:00:00 2001 From: Igor Zhukov Date: Tue, 30 Sep 2014 00:07:33 +0400 Subject: [PATCH 10/10] l10n fixes --- app/js/locales/en-us.json | 2 +- app/partials/mobile/profile_edit_modal.html | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/app/js/locales/en-us.json b/app/js/locales/en-us.json index fd71e2b1..5e7b2f92 100644 --- a/app/js/locales/en-us.json +++ b/app/js/locales/en-us.json @@ -106,7 +106,7 @@ "group_edit_submit_active": "Saving...", "confirm_modal_logout": "Are you sure you want to log out?", - "confirm_modal_update_reload": "A new version of Webogram has been downloaded. Launch it?", + "confirm_modal_update_reload": "A new version of Telegram Web has been downloaded. Launch it?", "confirm_modal_history_flush": "Are you sure? This can not be undone!", "confirm_modal_terminate_sessions": "Are you sure you want to log out all devices except for the current one?", "confirm_modal_mixed_content_fail_http_redirect_md": "Your browser {moz-link: does not support} mixed content which is neccessary for MTProto support on https. {issue-link: Learn more}\n\n Would you like to use http-version instead?", diff --git a/app/partials/mobile/profile_edit_modal.html b/app/partials/mobile/profile_edit_modal.html index 273ebfb4..85ea5e9e 100644 --- a/app/partials/mobile/profile_edit_modal.html +++ b/app/partials/mobile/profile_edit_modal.html @@ -8,7 +8,7 @@