diff --git a/css/app.css b/css/app.css index 48c621b8..48d16be0 100644 --- a/css/app.css +++ b/css/app.css @@ -109,6 +109,7 @@ fieldset[disabled] .btn-tg:active, .btn-tg.disabled.active, .btn-tg[disabled].active, fieldset[disabled] .btn-tg.active { + color: #DDD; background-color: #999; border-color: #999; } @@ -145,6 +146,19 @@ fieldset[disabled] .btn-tg.active { line-height: 0; height: auto; } +.navbar-offline { + max-width: 250px; + margin: 0 auto; + float: none; +} +.navbar-offline-text { + padding: 12px 15px; + /*color: #FFF;*/ + color: #b9cfe3; + font-size: 13px; + display: block; + line-height: 20px; +} .tg_head_logo { @@ -279,6 +293,10 @@ fieldset[disabled] .btn-tg.active { opacity: 1; } +.text-invisible { + visibility: hidden; +} + .modal-header { padding: 12px 0 4px 3px; border-bottom: 2px solid #E1E1E1; @@ -438,7 +456,6 @@ fieldset[disabled] .btn-tg.active { /* Dialogs list */ .im_dialogs_col { - /*min-width: 315px;*/ margin-right: -7px; } .im_dialogs_col .nano > .pane { @@ -588,6 +605,9 @@ a.im_dialog:hover .im_dialog_message_text { color: #428bca; background-color: #fff; } +.im_dialogs_modal_col .im_dialog_badge { + display: none; +} .im_dialog_unread { background: #c1d6e5; @@ -649,11 +669,13 @@ a.im_dialog:hover .im_dialog_date { .im_history_col { } -.im_history_col .nano > .pane { +.im_history_col .nano > .pane, +.contacts_modal_col .nano > .pane, +.im_dialogs_modal_col .nano > .pane { background : rgba(3,36,64,0.08); width : 9px; - top: 10px; - right: 8px; + right: 0; + top: 0; -webkit-transition : .2s; -moz-transition : .2s; -o-transition : .2s; @@ -662,7 +684,14 @@ a.im_dialog:hover .im_dialog_date { -webkit-border-radius : 2px; border-radius : 2px; } -.im_history_col .nano > .pane > .slider { + +.im_history_col .nano > .pane { + top: 10px; + right: 8px; +} +.im_history_col .nano > .pane > .slider, +.contacts_modal_col .nano > .pane > .slider, +.im_dialogs_modal_col .nano > .pane > .slider { background : rgba(3,46,79,0.22); margin: 0; -moz-border-radius : 2px; @@ -1103,7 +1132,8 @@ div.im_message_video_thumb { .im_content_message_wrap { - margin: 10px 0px 5px 16px; + /*margin: 10px 0px 5px 16px;*/ + margin: 8px 0px 8px 16px } .icon-message-status { background: #43A4DB; @@ -1150,6 +1180,7 @@ div.im_message_video_thumb { .im_message_date { color: #adadad; font-size: 0.85em; + padding-bottom: 20px; } div.im_message_author, div.im_message_body { @@ -1411,6 +1442,49 @@ img.img_fullsize { .user_modal_wrap .modal-body { padding: 23px 25px 30px; } +.settings_profile_photo_wrap { + width: 120px; + margin-right: 22px; +} +.settings_profile_photo { + position: relative; + overflow: hidden; +} +.settings_profile_photo_change_wrap { + background: rgba(0,0,0,0.6); + padding: 2px 5px; + position: absolute; + opacity: 0; + bottom: -30px; + + -webkit-transition: all ease-in-out 0.2s; + transition: all ease-in-out 0.2s; + width: 120px; +} +.settings_profile_photo:hover .settings_profile_photo_change_wrap { + bottom: 0; + opacity: 1; +} + +.settings_profile_photo_update_link, +.settings_profile_photo_delete_link, +.settings_profile_photo_loading { + display: block; + color: rgba(255,255,255,0.8); + text-align: center; + padding: 2px 0; +} +.settings_profile_photo_update_link:hover, +.settings_profile_photo_delete_link:hover { + color: #FFF; + text-decoration: none; +} +.settings_profile_photo_update_link { + position: relative; + overflow: hidden; +} + + .user_modal_image_wrap { width: 120px; margin-right: 22px; @@ -1498,6 +1572,10 @@ img.img_fullsize { padding: 8px 7px; border-top: 1px solid #F0F0F0; } +.chat_modal_participant_kick { + padding: 11px 0; + display: block; +} .chat_modal_participant_name { display: block; color: #3C6E97; @@ -1564,7 +1642,7 @@ img.img_fullsize { z-index: 999; width: 180px; margin-left: -91px; - margin-top: -232px; + margin-top: -260px; overflow: hidden; } .emoji-items-wrap1 { @@ -1574,12 +1652,62 @@ img.img_fullsize { -moz-border-radius: 3px; border-radius: 3px; } +.emoji-items-wrap1 .emoji-menu-tabs { + width: 100%; +} +.emoji-items-wrap1 .emoji-menu-tabs td { + text-align: center; + color: white; +} +.emoji-menu-tabs .emoji-menu-tab { + display: inline-block; + width: 24px; + height: 24px; + background: url(../img/icons/EmojiTabSheet.png) no-repeat; + background-size: 120px 48px; +} +.icon-smile { + background-position: 0 0 !important; +} +.icon-smile-selected { + background-position: 0 -24px !important; + border-bottom: 1px solid white; +} +.icon-flower { + background-position: -24px 0 !important; +} +.icon-flower-selected { + background-position: -24px -24px !important; + border-bottom: 1px solid white; +} +.icon-bell { + background-position: -48px 0 !important; +} +.icon-bell-selected { + background-position: -48px -24px !important; + border-bottom: 1px solid white; +} +.icon-car { + background-position: -72px 0 !important; +} +.icon-car-selected { + background-position: -72px -24px !important; + border-bottom: 1px solid white; +} +.icon-grid { + background-position: -96px 0 !important; +} +.icon-grid-selected { + background-position: -96px -24px !important; + border-bottom: 1px solid white; +} .emoji-menu .emoji-items-wrap { position: relative; height: 190px; } .emoji-menu .emoji-items { padding-right: 8px; + outline: 0 !important; } .emoji-menu img { width: 20px; @@ -1587,7 +1715,7 @@ img.img_fullsize { vertical-align: middle; border: 0 none; } -.emoji-menu a { +.emoji-menu .emoji-items a { margin: -1px 0 0 -1px; /*border: 1px solid #f2f2f2;*/ padding: 4px; @@ -1595,7 +1723,7 @@ img.img_fullsize { float: left; border-radius: 2px; } -.emoji-menu a:hover { +.emoji-menu .emoji-items a:hover { background-color: rgba(0,0,0, 0.5); /*background-color: #fffae7;*/ } @@ -1680,11 +1808,21 @@ img.img_fullsize { .settings_profile_edit_form { margin-bottom: 15px; } +.settings_profile_image_wrap { + float: left; + width: 120px; + margin-right: 22px; +} .settings_profile_first_name, .settings_profile_last_name { width: 180px; + margin-bottom: 10px; float: left; } +.settings_profile_first_name label, +.settings_profile_last_name label { + margin-bottom: 3px; +} .settings_profile_first_name { margin-right: 22px; } @@ -1777,13 +1915,38 @@ img.img_fullsize { opacity: 1; } -.contacts_modal_contact_wrap { - padding: 8px 7px; - border-top: 1px solid #F0F0F0; +.contacts_modal_col { + margin-right: -17px; +} +.contacts_scrollable_wrap { + padding: 0 17px 0 0; + outline: none ! important; +} + + +.contacts_modal_members_list .contacts_modal_contact_wrap { + /*margin-top: 0;*/ } -.contacts_modal_contact_wrap:first-child { - border-top: 0; +.contacts_modal_members_list a.contacts_modal_contact { + clear: both; + overflow: hidden; + color: #000; + padding: 8px 9px; + border-radius: 0; +} +.contacts_modal_members_list a.contacts_modal_contact:hover { + border-radius: 2px; + background: #f2f6fa; } +.contacts_modal_members_list .active a.contacts_modal_contact { + border-radius: 2px; + background-color: #6490b1; +} +.contacts_modal_members_list .active a.contacts_modal_contact:hover { + background-color: #6490b1; +} + + .contacts_modal_contact_name { display: block; color: #3C6E97; @@ -1793,9 +1956,6 @@ img.img_fullsize { .non_osx .contacts_modal_contact_name { font-size: 12px; } -.contacts_modal_contact_status { - color: #999; -} .contacts_modal_contact_photo { width: 40px; height: 40px; @@ -1803,6 +1963,50 @@ img.img_fullsize { overflow: hidden; } +.contacts_modal_contact_status { + color: #999; +} +a.contacts_modal_contact:hover .contacts_modal_contact_status { + color: #91a6ba; +} + +.contacts_modal_members_list .active .contacts_modal_contact_name, +.contacts_modal_members_list .active a.contacts_modal_contact .contacts_modal_contact_status { + color: #FFF; +} + +.icon-contact-tick { + position: absolute; + right: 10px; + top: 22px; + width: 17px; + height: 15px; + /*margin: 10px 0 0 -75px;*/ + background: url(../img/icons/IconsetW.png?1) -13px -343px no-repeat; + background-size: 42px 460px; +} +.is_1x .icon-contact-tick { + background-image: url(../img/icons/IconsetW_1x.png?2); +} + +.contacts_modal_members_list .active .icon-contact-tick, +.contacts_modal_members_list a.contacts_modal_contact:hover .icon-contact-tick { + background-position: -13px -367px; + opacity: 0.5; +} +.contacts_modal_members_list .active .icon-contact-tick { + opacity: 1 !important; +} + +.contacts_modal_panel { + padding-top: 10px; +} + +.contacts_modal_actions { + padding-top: 10px; +} + + /* Messages edit panel */ .im_edit_panel_wrap { @@ -1816,6 +2020,7 @@ img.img_fullsize { width: 100%; } .im_edit_delete_link, +.im_edit_forward_link, .im_edit_cancel_link { display: block; padding: 8px 17px; @@ -1823,11 +2028,13 @@ img.img_fullsize { .im_edit_cancel_link { float: left; } -.im_edit_delete_link { +.im_edit_delete_link, +.im_edit_forward_link { float: right; } .im_edit_delete_link:hover, +.im_edit_forward_link:hover, .im_edit_cancel_link:hover { background: #f2f6fa; text-decoration: none; @@ -1898,8 +2105,11 @@ img.img_fullsize { .is_1x .icon-select-tick { background-image: url(../img/icons/IconsetW_1x.png?2); } -.im_history_selectable .icon-select-tick { - display: inline-block; + +@media (min-width: 1024px) { + .im_history_selectable .icon-select-tick { + display: inline-block; + } } .im_message_selected .icon-select-tick, @@ -2067,4 +2277,13 @@ img.img_fullsize { .im_emoji_btn { display: none; } +} + + +/* Dialogs modal */ +.peer_select_window .modal-dialog { + max-width: 506px; +} +.peer_select_modal_wrap .modal-body { + padding: 10px 10px 15px; } \ No newline at end of file diff --git a/img/emojisprite_0.png b/img/emojisprite_0.png new file mode 100644 index 00000000..1adfcc97 Binary files /dev/null and b/img/emojisprite_0.png differ diff --git a/img/emojisprite_1.png b/img/emojisprite_1.png new file mode 100644 index 00000000..5db1e9e7 Binary files /dev/null and b/img/emojisprite_1.png differ diff --git a/img/emojisprite_2.png b/img/emojisprite_2.png new file mode 100644 index 00000000..7d559da4 Binary files /dev/null and b/img/emojisprite_2.png differ diff --git a/img/emojisprite_3.png b/img/emojisprite_3.png new file mode 100644 index 00000000..5f259ecb Binary files /dev/null and b/img/emojisprite_3.png differ diff --git a/img/emojisprite_4.png b/img/emojisprite_4.png new file mode 100644 index 00000000..379ff9ca Binary files /dev/null and b/img/emojisprite_4.png differ diff --git a/img/icons/EmojiTabSheet.png b/img/icons/EmojiTabSheet.png new file mode 100644 index 00000000..026a37fe Binary files /dev/null and b/img/icons/EmojiTabSheet.png differ diff --git a/index.html b/index.html index 21007072..29a5a0b1 100644 --- a/index.html +++ b/index.html @@ -47,16 +47,5 @@ - - - diff --git a/js/app.js b/js/app.js index 41dba584..9d6ea783 100644 --- a/js/app.js +++ b/js/app.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -38,21 +38,23 @@ angular.module('myApp', [ ]). config(['$locationProvider', '$routeProvider', '$compileProvider', function($locationProvider, $routeProvider, $compileProvider) { - var icons = {}, reverseIcons = {}, i, j, hex, name, dataItem, - ranges = [[0x1f600, 0x1f637], [0x261d, 0x263f], [0x270a, 0x270c], [0x1f446, 0x1f450]]; + var icons = {}, reverseIcons = {}, i, j, hex, name, dataItem, row, column, totalColumns; - for (j in ranges) { - for (i = ranges[j][0]; i <= ranges[j][1]; i++) { - hex = i.toString(16); - if (dataItem = Config.Emoji[hex]) { - name = dataItem[1][0]; - icons[':' + name + ':'] = hex + '.png'; - reverseIcons[name] = dataItem[0]; - } + for (j = 0; j < Config.EmojiCategories.length; j++) { + totalColumns = Config.EmojiCategorySpritesheetDimens[j][1]; + for (i = 0; i < Config.EmojiCategories[j].length; i++) { + dataItem = Config.Emoji[Config.EmojiCategories[j][i]]; + name = dataItem[1][0]; + row = Math.floor(i / totalColumns); + column = (i % totalColumns); + icons[':' + name + ':'] = [j, row, column, ':'+name+':']; + reverseIcons[name] = dataItem[0]; } } - $.emojiarea.path = 'vendor/gemoji/images'; + $.emojiarea.spritesheetPath = 'img/emojisprite_!.png'; + $.emojiarea.spritesheetDimens = Config.EmojiCategorySpritesheetDimens; + $.emojiarea.iconSize = 20; $.emojiarea.icons = icons; $.emojiarea.reverseIcons = reverseIcons; diff --git a/js/background.js b/js/background.js index 64a42b82..09020469 100644 --- a/js/background.js +++ b/js/background.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/controllers.js b/js/controllers.js index a3d614c1..0545bbd0 100644 --- a/js/controllers.js +++ b/js/controllers.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -22,6 +22,12 @@ angular.module('myApp.controllers', []) }) .controller('AppLoginController', function ($scope, $location, $timeout, MtpApiManager, ErrorService) { + MtpApiManager.getUserID().then(function (id) { + if (id) { + $location.url('/im'); + return; + } + }); var options = {dcID: 1}; $scope.credentials = {}; @@ -145,7 +151,7 @@ angular.module('myApp.controllers', []) }; }) - .controller('AppIMController', function ($scope, $location, $routeParams, $modal, $rootScope, $modalStack, MtpApiManager) { + .controller('AppIMController', function ($scope, $location, $routeParams, $modal, $rootScope, $modalStack, MtpApiManager, AppUsersManager, ContactsSelectService) { $scope.$on('$routeUpdate', updateCurDialog); @@ -170,14 +176,35 @@ angular.module('myApp.controllers', []) } $scope.openContacts = function () { - $modal.open({ - templateUrl: 'partials/contacts_modal.html?3', - controller: 'ContactsModalController', - scope: $rootScope.$new(), - windowClass: 'contacts_modal_window' + ContactsSelectService.selectContact().then(function (userID) { + $scope.dialogSelect(AppUsersManager.getUserString(userID)); + }); + } + + $scope.openGroup = function () { + ContactsSelectService.selectContacts().then(function (userIDs) { + + if (userIDs.length == 1) { + $scope.dialogSelect(AppUsersManager.getUserString(userIDs[0])); + } else if (userIDs.length > 1) { + var scope = $rootScope.$new(); + scope.userIDs = userIDs; + + $modal.open({ + templateUrl: 'partials/chat_create_modal.html?3', + controller: 'ChatCreateModalController', + scope: scope, + windowClass: 'contacts_modal_window' + }); + } + }); } + $scope.dialogSelect = function (peerString) { + $rootScope.$broadcast('history_focus', {peerString: peerString}); + }; + updateCurDialog(); function updateCurDialog() { @@ -294,11 +321,11 @@ angular.module('myApp.controllers', []) $scope.$broadcast('ui_dialogs_append'); }); - } + }; }) - .controller('AppImHistoryController', function ($scope, $location, $timeout, $rootScope, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, ApiUpdatesManager, IdleManager, StatusManager) { + .controller('AppImHistoryController', function ($scope, $location, $timeout, $rootScope, MtpApiManager, AppUsersManager, AppChatsManager, AppMessagesManager, AppPeersManager, ApiUpdatesManager, PeersSelectService, IdleManager, StatusManager) { $scope.$watch('curDialog.peer', applyDialogSelect); @@ -318,6 +345,7 @@ angular.module('myApp.controllers', []) $scope.toggleMessage = toggleMessage; $scope.selectedDelete = selectedDelete; + $scope.selectedForward = selectedForward; $scope.selectedCancel = selectedCancel; $scope.toggleEdit = toggleEdit; $scope.toggleMedia = toggleMedia; @@ -385,16 +413,14 @@ angular.module('myApp.controllers', []) if (!hasMore || !offset) { return; } - // console.trace('load history'); + console.trace('load history'); var inputMediaFilter = $scope.mediaType && {_: inputMediaFilters[$scope.mediaType]}, getMessagesPromise = inputMediaFilter - ? AppMessagesManager.getSearch($scope.curDialog.inputPeer, '', inputMediaFilter, maxID, startLimit) - : AppMessagesManager.getHistory($scope.curDialog.inputPeer, maxID, startLimit); + ? AppMessagesManager.getSearch($scope.curDialog.inputPeer, '', inputMediaFilter, maxID, limit) + : AppMessagesManager.getHistory($scope.curDialog.inputPeer, maxID, limit); getMessagesPromise.then(function (historyResult) { - console.log('got', maxID, historyResult); - offset += limit; hasMore = offset < historyResult.count; maxID = historyResult.history[historyResult.history.length - 1]; @@ -491,6 +517,24 @@ angular.module('myApp.controllers', []) } } + + function selectedForward () { + if ($scope.selectedCount > 0) { + var selectedMessageIDs = []; + angular.forEach($scope.selectedMsgs, function (t, messageID) { + selectedMessageIDs.push(messageID); + }); + + PeersSelectService.selectPeer().then(function (peerString) { + var inputPeer = AppPeersManager.getInputPeer(peerString); + AppMessagesManager.forwardMessages(selectedMessageIDs, inputPeer).then(function () { + selectedCancel(); + }); + }); + + } + } + function toggleEdit () { if ($scope.selectActions) { selectedCancel(); @@ -751,7 +795,7 @@ angular.module('myApp.controllers', []) }; }) - .controller('ChatModalController', function ($scope, $timeout, $rootScope, AppUsersManager, AppChatsManager, MtpApiManager, NotificationsManager, AppMessagesManager, AppPeersManager, ApiUpdatesManager) { + .controller('ChatModalController', function ($scope, $timeout, $rootScope, AppUsersManager, AppChatsManager, MtpApiManager, NotificationsManager, AppMessagesManager, AppPeersManager, ApiUpdatesManager, ContactsSelectService) { $scope.chatFull = AppChatsManager.wrapForFull($scope.chatID, {}); @@ -820,6 +864,73 @@ angular.module('myApp.controllers', []) }; + $scope.inviteToGroup = function () { + var disabled = []; + angular.forEach($scope.chatFull.participants.participants, function(participant){ + disabled.push(participant.user_id); + }); + + ContactsSelectService.selectContacts({disabled: disabled}).then(function (userIDs) { + angular.forEach(userIDs, function (userID) { + MtpApiManager.invokeApi('messages.addChatUser', { + chat_id: $scope.chatID, + user_id: {_: 'inputUserContact', user_id: userID}, + fwd_limit: 100 + }).then(function (addResult) { + AppUsersManager.saveApiUsers(addResult.users); + AppChatsManager.saveApiChats(addResult.chats); + + if (ApiUpdatesManager.saveSeq(addResult.seq)) { + ApiUpdatesManager.saveUpdate({ + _: 'updateNewMessage', + message: addResult.message, + pts: addResult.pts + }); + } + }); + }); + + $rootScope.$broadcast('history_focus', {peerString: $scope.chatFull.peerString}); + }); + + MtpApiManager.invokeApi('messages.addChatUser', { + chat_id: $scope.chatID, + user_id: {_: 'inputUserSelf'} + }).then(function (result) { + if (ApiUpdatesManager.saveSeq(result.seq)) { + ApiUpdatesManager.saveUpdate({ + _: 'updateNewMessage', + message: result.message, + pts: result.pts + }); + } + + $rootScope.$broadcast('history_focus', {peerString: $scope.chatFull.peerString}); + }); + }; + + $scope.kickFromGroup = function (userID) { + var user = AppUsersManager.getUser(userID); + + console.log({_: 'inputUserForeign', user_id: userID, access_hash: user.access_hash || '0'}, user); + + MtpApiManager.invokeApi('messages.deleteChatUser', { + chat_id: $scope.chatID, + user_id: {_: 'inputUserForeign', user_id: userID, access_hash: user.access_hash || '0'} + }).then(function (result) { + if (ApiUpdatesManager.saveSeq(result.seq)) { + ApiUpdatesManager.saveUpdate({ + _: 'updateNewMessage', + message: result.message, + pts: result.pts + }); + } + + $rootScope.$broadcast('history_focus', {peerString: $scope.chatFull.peerString}); + }); + }; + + $scope.flushHistory = function () { if (confirm('Are you sure? This can not be undone!') !== true) { @@ -833,7 +944,7 @@ angular.module('myApp.controllers', []) }) - .controller('SettingsModalController', function ($rootScope, $scope, $timeout, AppUsersManager, AppChatsManager, MtpApiManager, AppConfigManager, NotificationsManager) { + .controller('SettingsModalController', function ($rootScope, $scope, $timeout, AppUsersManager, AppChatsManager, MtpApiManager, AppConfigManager, NotificationsManager, MtpApiFileManager, ApiUpdatesManager) { $scope.profile = {}; @@ -841,6 +952,7 @@ angular.module('myApp.controllers', []) var user = AppUsersManager.getUser(id); $scope.profile.first_name = user.first_name; $scope.profile.last_name = user.last_name; + $scope.profile.photo = AppUsersManager.getUserPhoto(id, 'User'); $scope.phone = user.phone; }); @@ -848,6 +960,58 @@ angular.module('myApp.controllers', []) $scope.notify = {}; $scope.send = {}; + $scope.photo = {}; + + $scope.$watch('photo.file', onPhotoSelected); + + function onPhotoSelected (photo) { + if (!photo || !photo.hasOwnProperty('name')) { + return; + } + $scope.photo.updating = true; + MtpApiFileManager.uploadFile(photo).then(function (inputFile) { + MtpApiManager.invokeApi('photos.uploadProfilePhoto', { + file: inputFile, + caption: '', + geo_point: {_: 'inputGeoPointEmpty'}, + crop: {_: 'inputPhotoCropAuto'} + }).then(function (updateResult) { + AppUsersManager.saveApiUsers(updateResult.users); + MtpApiManager.getUserID().then(function (id) { + ApiUpdatesManager.saveUpdate({ + _: 'updateUserPhoto', + user_id: id, + date: tsNow(true), + photo: AppUsersManager.getUser(id).photo, + previous: true + }); + $scope.profile.photo = AppUsersManager.getUserPhoto(id, 'User'); + }); + $scope.photo.updating = false; + }); + }); + }; + + $scope.deletePhoto = function () { + $scope.photo.updating = true; + MtpApiManager.invokeApi('photos.updateProfilePhoto', { + id: {_: 'inputPhotoEmpty'}, + crop: {_: 'inputPhotoCropAuto'} + }).then(function (updateResult) { + MtpApiManager.getUserID().then(function (id) { + ApiUpdatesManager.saveUpdate({ + _: 'updateUserPhoto', + user_id: id, + date: tsNow(true), + photo: updateResult, + previous: true + }); + $scope.profile.photo = AppUsersManager.getUserPhoto(id, 'User'); + }); + $scope.photo.updating = false; + }); + }; + AppConfigManager.get('notify_nodesktop', 'notify_nosound', 'send_ctrlenter').then(function (settings) { $scope.notify.desktop = !settings[0]; $scope.notify.sound = !settings[1]; @@ -925,9 +1089,28 @@ angular.module('myApp.controllers', []) } }) - .controller('ContactsModalController', function ($scope, AppUsersManager) { + .controller('ContactsModalController', function ($scope, $modalInstance, AppUsersManager) { $scope.contacts = []; - $scope.search = []; + $scope.search = {}; + + $scope.selectedContacts = {}; + $scope.disabledContacts = {}; + $scope.selectedCount = 0; + + if ($scope.disabled) { + for (var i = 0; i < $scope.disabled.length; i++) { + $scope.disabledContacts[$scope.disabled[i]] = true; + } + } + + if ($scope.selected) { + for (var i = 0; i < $scope.selected.length; i++) { + if (!$scope.selectedContacts[$scope.selected[i]]) { + $scope.selectedContacts[$scope.selected[i]] = true; + $scope.selectedCount++; + } + } + } $scope.$watch('search.query', function (newValue) { AppUsersManager.getContacts(newValue).then(function (contactsList) { @@ -940,10 +1123,79 @@ angular.module('myApp.controllers', []) } $scope.contacts.push(contact); }); + $scope.$broadcast('contacts_change'); }); - }) + }); + + $scope.contactSelect = function (userID) { + if ($scope.disabledContacts[userID]) { + return false; + } + if (!$scope.multiSelect) { + return $modalInstance.close(userID); + } + if ($scope.selectedContacts[userID]) { + delete $scope.selectedContacts[userID]; + $scope.selectedCount--; + } else { + $scope.selectedContacts[userID] = true; + $scope.selectedCount++; + } + }; + + $scope.submitSelected = function () { + if ($scope.selectedCount > 0) { + var selectedUserIDs = []; + angular.forEach($scope.selectedContacts, function (t, userID) { + selectedUserIDs.push(userID); + }); + return $modalInstance.close(selectedUserIDs); + } + } + + }) + + .controller('PeerSelectController', function ($scope, $modalInstance) { + + $scope.dialogSelect = function (peerString) { + $modalInstance.close(peerString); + }; }) + .controller('ChatCreateModalController', function ($scope, $modalInstance, $rootScope, MtpApiManager, AppUsersManager, AppChatsManager, ApiUpdatesManager) { + $scope.group = {name: ''}; + $scope.createGroup = function () { + if (!$scope.group.name) { + return; + } + var inputUsers = []; + angular.forEach($scope.userIDs, function(userID) { + inputUsers.push({_: 'inputUserContact', user_id: userID}); + }); + return MtpApiManager.invokeApi('messages.createChat', { + title: $scope.group.name, + users: inputUsers + }).then(function (createdResult) { + AppUsersManager.saveApiUsers(createdResult.users); + AppChatsManager.saveApiChats(createdResult.chats); + + if (ApiUpdatesManager.saveSeq(createdResult.seq)) { + ApiUpdatesManager.saveUpdate({ + _: 'updateNewMessage', + message: createdResult.message, + pts: createdResult.pts + }); + } + + var peerString = AppChatsManager.getChatString(createdResult.message.to_id.chat_id); + $rootScope.$broadcast('history_focus', {peerString: peerString}); + }); + }; + + $scope.back = function () { + $modalInstance.dismiss(); + }; + }) diff --git a/js/directives.js b/js/directives.js index 7308be7a..3a1e8a4b 100644 --- a/js/directives.js +++ b/js/directives.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -81,9 +81,18 @@ angular.module('myApp.directives', ['myApp.filters']) function updateSizes () { + if (attrs.modal) { + $(element).css({ + height: $($window).height() - 200 + }); + updateScroller(); + return; + } + $(element).css({ height: $($window).height() - footer.offsetHeight - (headWrap ? headWrap.offsetHeight : 50) - 72 }); + updateScroller(); if (!headWrap) { headWrap = $('.tg_page_head')[0]; } @@ -96,6 +105,38 @@ angular.module('myApp.directives', ['myApp.filters']) }) + .directive('myContactsList', function($window, $timeout) { + + return { + link: link + }; + + + function link (scope, element, attrs) { + var searchWrap = $('.contacts_modal_search')[0], + panelWrap = $('.contacts_modal_panel')[0], + contactsWrap = $('.contacts_wrap', element)[0]; + + onContentLoaded(function () { + $(contactsWrap).nanoScroller({preventPageScrolling: true, tabIndex: -1, iOSNativeScrolling: true}); + updateSizes(); + }); + + function updateSizes () { + $(element).css({ + height: $($window).height() - (panelWrap && panelWrap.offsetHeight || 0) - (searchWrap && searchWrap.offsetHeight || 0) - 200 + }); + $(contactsWrap).nanoScroller(); + } + + $($window).on('resize', updateSizes); + scope.$on('contacts_change', function () { + onContentLoaded(updateSizes) + }); + }; + + }) + .directive('myHistory', function ($window, $timeout) { return { @@ -479,7 +520,9 @@ angular.module('myApp.directives', ['myApp.filters']) return; } - element.attr('src', scope.thumb.placeholder || 'img/blank.gif'); + if (!element.attr('src')) { + element.attr('src', scope.thumb.placeholder || 'img/blank.gif'); + } MtpApiFileManager.downloadSmallFile(scope.thumb.location, scope.thumb.size).then(function (url) { if (counterSaved == counter) { @@ -711,7 +754,11 @@ angular.module('myApp.directives', ['myApp.filters']) } else if (time % 1000 <= 600) { cnt = 2; } - element.html((new Array(cnt + 1)).join('.')); + + var text = '...', + html = text.substr(0, cnt + 1) + (cnt < 2 ? ('' + text.substr(cnt + 1) + '') : ''); + + element.html(html); }, 200); scope.$on('$destroy', function cleanup() { @@ -749,4 +796,25 @@ angular.module('myApp.directives', ['myApp.filters']) }, 100); } }; + }) + + .directive('myFileUpload', function(){ + + return { + link: link + }; + + function link(scope, element, attrs) { + element.on('change', function () { + var self = this; + scope.$apply(function () { + scope.photo.file = self.files[0]; + setTimeout(function () { + try { + self.value = ''; + } catch (e) {}; + }, 1000); + }); + }); + }; }); diff --git a/js/filters.js b/js/filters.js index a85a1b1d..b2fedc6e 100644 --- a/js/filters.js +++ b/js/filters.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/lib/aes_worker.js b/js/lib/aes_worker.js index 61b17d10..a8418fe7 100644 --- a/js/lib/aes_worker.js +++ b/js/lib/aes_worker.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/lib/config.js b/js/lib/config.js index a8b84298..64d3b32b 100644 --- a/js/lib/config.js +++ b/js/lib/config.js @@ -12,3 +12,7 @@ Config.Schema.API = {"constructors":[{"id":"-1132882121","predicate":"boolFalse" Config.Schema.API.layer = 10; Config.Emoji = {"00a9":["\u00A9",["copyright"]],"00ae":["\u00AE",["registered"]],"203c":["\u203C",["bangbang"]],"2049":["\u2049",["interrobang"]],"2122":["\u2122",["tm"]],"2139":["\u2139",["information_source"]],"2194":["\u2194",["left_right_arrow"]],"2195":["\u2195",["arrow_up_down"]],"2196":["\u2196",["arrow_upper_left"]],"2197":["\u2197",["arrow_upper_right"]],"2198":["\u2198",["arrow_lower_right"]],"2199":["\u2199",["arrow_lower_left"]],"21a9":["\u21A9",["leftwards_arrow_with_hook"]],"21aa":["\u21AA",["arrow_right_hook"]],"231a":["\u231A",["watch"]],"231b":["\u231B",["hourglass"]],"23e9":["\u23E9",["fast_forward"]],"23ea":["\u23EA",["rewind"]],"23eb":["\u23EB",["arrow_double_up"]],"23ec":["\u23EC",["arrow_double_down"]],"23f0":["\u23F0",["alarm_clock"]],"23f3":["\u23F3",["hourglass_flowing_sand"]],"24c2":["\u24C2",["m"]],"25aa":["\u25AA",["black_small_square"]],"25ab":["\u25AB",["white_small_square"]],"25b6":["\u25B6",["arrow_forward"]],"25c0":["\u25C0",["arrow_backward"]],"25fb":["\u25FB",["white_medium_square"]],"25fc":["\u25FC",["black_medium_square"]],"25fd":["\u25FD",["white_medium_small_square"]],"25fe":["\u25FE",["black_medium_small_square"]],"2600":["\u2600",["sunny"]],"2601":["\u2601",["cloud"]],"260e":["\u260E",["phone","telephone"]],"2611":["\u2611",["ballot_box_with_check"]],"2614":["\u2614",["umbrella"]],"2615":["\u2615",["coffee"]],"261d":["\u261D",["point_up"]],"263a":["\u263A",["relaxed"]],"2648":["\u2648",["aries"]],"2649":["\u2649",["taurus"]],"264a":["\u264A",["gemini"]],"264b":["\u264B",["cancer"]],"264c":["\u264C",["leo"]],"264d":["\u264D",["virgo"]],"264e":["\u264E",["libra"]],"264f":["\u264F",["scorpius"]],"2650":["\u2650",["sagittarius"]],"2651":["\u2651",["capricorn"]],"2652":["\u2652",["aquarius"]],"2653":["\u2653",["pisces"]],"2660":["\u2660",["spades"]],"2663":["\u2663",["clubs"]],"2665":["\u2665",["hearts"]],"2666":["\u2666",["diamonds"]],"2668":["\u2668",["hotsprings"]],"267b":["\u267B",["recycle"]],"267f":["\u267F",["wheelchair"]],"2693":["\u2693",["anchor"]],"26a0":["\u26A0",["warning"]],"26a1":["\u26A1",["zap"]],"26aa":["\u26AA",["white_circle"]],"26ab":["\u26AB",["black_circle"]],"26bd":["\u26BD",["soccer"]],"26be":["\u26BE",["baseball"]],"26c4":["\u26C4",["snowman"]],"26c5":["\u26C5",["partly_sunny"]],"26ce":["\u26CE",["ophiuchus"]],"26d4":["\u26D4",["no_entry"]],"26ea":["\u26EA",["church"]],"26f2":["\u26F2",["fountain"]],"26f3":["\u26F3",["golf"]],"26f5":["\u26F5",["boat","sailboat"]],"26fa":["\u26FA",["tent"]],"26fd":["\u26FD",["fuelpump"]],"2702":["\u2702",["scissors"]],"2705":["\u2705",["white_check_mark"]],"2708":["\u2708",["airplane"]],"2709":["\u2709",["email","envelope"]],"270a":["\u270A",["fist"]],"270b":["\u270B",["hand","raised_hand"]],"270c":["\u270C",["v"]],"270f":["\u270F",["pencil2"]],"2712":["\u2712",["black_nib"]],"2714":["\u2714",["heavy_check_mark"]],"2716":["\u2716",["heavy_multiplication_x"]],"2728":["\u2728",["sparkles"]],"2733":["\u2733",["eight_spoked_asterisk"]],"2734":["\u2734",["eight_pointed_black_star"]],"2744":["\u2744",["snowflake"]],"2747":["\u2747",["sparkle"]],"274c":["\u274C",["x"]],"274e":["\u274E",["negative_squared_cross_mark"]],"2753":["\u2753",["question"]],"2754":["\u2754",["grey_question"]],"2755":["\u2755",["grey_exclamation"]],"2757":["\u2757",["exclamation","heavy_exclamation_mark"]],"2764":["\u2764",["heart"],"<3"],"2795":["\u2795",["heavy_plus_sign"]],"2796":["\u2796",["heavy_minus_sign"]],"2797":["\u2797",["heavy_division_sign"]],"27a1":["\u27A1",["arrow_right"]],"27b0":["\u27B0",["curly_loop"]],"27bf":["\u27BF",["loop"]],"2934":["\u2934",["arrow_heading_up"]],"2935":["\u2935",["arrow_heading_down"]],"2b05":["\u2B05",["arrow_left"]],"2b06":["\u2B06",["arrow_up"]],"2b07":["\u2B07",["arrow_down"]],"2b1b":["\u2B1B",["black_large_square"]],"2b1c":["\u2B1C",["white_large_square"]],"2b50":["\u2B50",["star"]],"2b55":["\u2B55",["o"]],"3030":["\u3030",["wavy_dash"]],"303d":["\u303D",["part_alternation_mark"]],"3297":["\u3297",["congratulations"]],"3299":["\u3299",["secret"]],"1f004":["\uD83C\uDC04",["mahjong"]],"1f0cf":["\uD83C\uDCCF",["black_joker"]],"1f170":["\uD83C\uDD70",["a"]],"1f171":["\uD83C\uDD71",["b"]],"1f17e":["\uD83C\uDD7E",["o2"]],"1f17f":["\uD83C\uDD7F",["parking"]],"1f18e":["\uD83C\uDD8E",["ab"]],"1f191":["\uD83C\uDD91",["cl"]],"1f192":["\uD83C\uDD92",["cool"]],"1f193":["\uD83C\uDD93",["free"]],"1f194":["\uD83C\uDD94",["id"]],"1f195":["\uD83C\uDD95",["new"]],"1f196":["\uD83C\uDD96",["ng"]],"1f197":["\uD83C\uDD97",["ok"]],"1f198":["\uD83C\uDD98",["sos"]],"1f199":["\uD83C\uDD99",["up"]],"1f19a":["\uD83C\uDD9A",["vs"]],"1f201":["\uD83C\uDE01",["koko"]],"1f202":["\uD83C\uDE02",["sa"]],"1f21a":["\uD83C\uDE1A",["u7121"]],"1f22f":["\uD83C\uDE2F",["u6307"]],"1f232":["\uD83C\uDE32",["u7981"]],"1f233":["\uD83C\uDE33",["u7a7a"]],"1f234":["\uD83C\uDE34",["u5408"]],"1f235":["\uD83C\uDE35",["u6e80"]],"1f236":["\uD83C\uDE36",["u6709"]],"1f237":["\uD83C\uDE37",["u6708"]],"1f238":["\uD83C\uDE38",["u7533"]],"1f239":["\uD83C\uDE39",["u5272"]],"1f23a":["\uD83C\uDE3A",["u55b6"]],"1f250":["\uD83C\uDE50",["ideograph_advantage"]],"1f251":["\uD83C\uDE51",["accept"]],"1f300":["\uD83C\uDF00",["cyclone"]],"1f301":["\uD83C\uDF01",["foggy"]],"1f302":["\uD83C\uDF02",["closed_umbrella"]],"1f303":["\uD83C\uDF03",["stars"]],"1f304":["\uD83C\uDF04",["sunrise_over_mountains"]],"1f305":["\uD83C\uDF05",["sunrise"]],"1f306":["\uD83C\uDF06",["city_sunset"]],"1f307":["\uD83C\uDF07",["city_sunrise"]],"1f308":["\uD83C\uDF08",["rainbow"]],"1f309":["\uD83C\uDF09",["bridge_at_night"]],"1f30a":["\uD83C\uDF0A",["ocean"]],"1f30b":["\uD83C\uDF0B",["volcano"]],"1f30c":["\uD83C\uDF0C",["milky_way"]],"1f30d":["\uD83C\uDF0D",["earth_africa"]],"1f30e":["\uD83C\uDF0E",["earth_americas"]],"1f30f":["\uD83C\uDF0F",["earth_asia"]],"1f310":["\uD83C\uDF10",["globe_with_meridians"]],"1f311":["\uD83C\uDF11",["new_moon"]],"1f312":["\uD83C\uDF12",["waxing_crescent_moon"]],"1f313":["\uD83C\uDF13",["first_quarter_moon"]],"1f314":["\uD83C\uDF14",["moon","waxing_gibbous_moon"]],"1f315":["\uD83C\uDF15",["full_moon"]],"1f316":["\uD83C\uDF16",["waning_gibbous_moon"]],"1f317":["\uD83C\uDF17",["last_quarter_moon"]],"1f318":["\uD83C\uDF18",["waning_crescent_moon"]],"1f319":["\uD83C\uDF19",["crescent_moon"]],"1f31a":["\uD83C\uDF1A",["new_moon_with_face"]],"1f31b":["\uD83C\uDF1B",["first_quarter_moon_with_face"]],"1f31c":["\uD83C\uDF1C",["last_quarter_moon_with_face"]],"1f31d":["\uD83C\uDF1D",["full_moon_with_face"]],"1f31e":["\uD83C\uDF1E",["sun_with_face"]],"1f31f":["\uD83C\uDF1F",["star2"]],"1f330":["\uD83C\uDF30",["chestnut"]],"1f331":["\uD83C\uDF31",["seedling"]],"1f332":["\uD83C\uDF32",["evergreen_tree"]],"1f333":["\uD83C\uDF33",["deciduous_tree"]],"1f334":["\uD83C\uDF34",["palm_tree"]],"1f335":["\uD83C\uDF35",["cactus"]],"1f337":["\uD83C\uDF37",["tulip"]],"1f338":["\uD83C\uDF38",["cherry_blossom"]],"1f339":["\uD83C\uDF39",["rose"]],"1f33a":["\uD83C\uDF3A",["hibiscus"]],"1f33b":["\uD83C\uDF3B",["sunflower"]],"1f33c":["\uD83C\uDF3C",["blossom"]],"1f33d":["\uD83C\uDF3D",["corn"]],"1f33e":["\uD83C\uDF3E",["ear_of_rice"]],"1f33f":["\uD83C\uDF3F",["herb"]],"1f340":["\uD83C\uDF40",["four_leaf_clover"]],"1f341":["\uD83C\uDF41",["maple_leaf"]],"1f342":["\uD83C\uDF42",["fallen_leaf"]],"1f343":["\uD83C\uDF43",["leaves"]],"1f344":["\uD83C\uDF44",["mushroom"]],"1f345":["\uD83C\uDF45",["tomato"]],"1f346":["\uD83C\uDF46",["eggplant"]],"1f347":["\uD83C\uDF47",["grapes"]],"1f348":["\uD83C\uDF48",["melon"]],"1f349":["\uD83C\uDF49",["watermelon"]],"1f34a":["\uD83C\uDF4A",["tangerine"]],"1f34b":["\uD83C\uDF4B",["lemon"]],"1f34c":["\uD83C\uDF4C",["banana"]],"1f34d":["\uD83C\uDF4D",["pineapple"]],"1f34e":["\uD83C\uDF4E",["apple"]],"1f34f":["\uD83C\uDF4F",["green_apple"]],"1f350":["\uD83C\uDF50",["pear"]],"1f351":["\uD83C\uDF51",["peach"]],"1f352":["\uD83C\uDF52",["cherries"]],"1f353":["\uD83C\uDF53",["strawberry"]],"1f354":["\uD83C\uDF54",["hamburger"]],"1f355":["\uD83C\uDF55",["pizza"]],"1f356":["\uD83C\uDF56",["meat_on_bone"]],"1f357":["\uD83C\uDF57",["poultry_leg"]],"1f358":["\uD83C\uDF58",["rice_cracker"]],"1f359":["\uD83C\uDF59",["rice_ball"]],"1f35a":["\uD83C\uDF5A",["rice"]],"1f35b":["\uD83C\uDF5B",["curry"]],"1f35c":["\uD83C\uDF5C",["ramen"]],"1f35d":["\uD83C\uDF5D",["spaghetti"]],"1f35e":["\uD83C\uDF5E",["bread"]],"1f35f":["\uD83C\uDF5F",["fries"]],"1f360":["\uD83C\uDF60",["sweet_potato"]],"1f361":["\uD83C\uDF61",["dango"]],"1f362":["\uD83C\uDF62",["oden"]],"1f363":["\uD83C\uDF63",["sushi"]],"1f364":["\uD83C\uDF64",["fried_shrimp"]],"1f365":["\uD83C\uDF65",["fish_cake"]],"1f366":["\uD83C\uDF66",["icecream"]],"1f367":["\uD83C\uDF67",["shaved_ice"]],"1f368":["\uD83C\uDF68",["ice_cream"]],"1f369":["\uD83C\uDF69",["doughnut"]],"1f36a":["\uD83C\uDF6A",["cookie"]],"1f36b":["\uD83C\uDF6B",["chocolate_bar"]],"1f36c":["\uD83C\uDF6C",["candy"]],"1f36d":["\uD83C\uDF6D",["lollipop"]],"1f36e":["\uD83C\uDF6E",["custard"]],"1f36f":["\uD83C\uDF6F",["honey_pot"]],"1f370":["\uD83C\uDF70",["cake"]],"1f371":["\uD83C\uDF71",["bento"]],"1f372":["\uD83C\uDF72",["stew"]],"1f373":["\uD83C\uDF73",["egg"]],"1f374":["\uD83C\uDF74",["fork_and_knife"]],"1f375":["\uD83C\uDF75",["tea"]],"1f376":["\uD83C\uDF76",["sake"]],"1f377":["\uD83C\uDF77",["wine_glass"]],"1f378":["\uD83C\uDF78",["cocktail"]],"1f379":["\uD83C\uDF79",["tropical_drink"]],"1f37a":["\uD83C\uDF7A",["beer"]],"1f37b":["\uD83C\uDF7B",["beers"]],"1f37c":["\uD83C\uDF7C",["baby_bottle"]],"1f380":["\uD83C\uDF80",["ribbon"]],"1f381":["\uD83C\uDF81",["gift"]],"1f382":["\uD83C\uDF82",["birthday"]],"1f383":["\uD83C\uDF83",["jack_o_lantern"]],"1f384":["\uD83C\uDF84",["christmas_tree"]],"1f385":["\uD83C\uDF85",["santa"]],"1f386":["\uD83C\uDF86",["fireworks"]],"1f387":["\uD83C\uDF87",["sparkler"]],"1f388":["\uD83C\uDF88",["balloon"]],"1f389":["\uD83C\uDF89",["tada"]],"1f38a":["\uD83C\uDF8A",["confetti_ball"]],"1f38b":["\uD83C\uDF8B",["tanabata_tree"]],"1f38c":["\uD83C\uDF8C",["crossed_flags"]],"1f38d":["\uD83C\uDF8D",["bamboo"]],"1f38e":["\uD83C\uDF8E",["dolls"]],"1f38f":["\uD83C\uDF8F",["flags"]],"1f390":["\uD83C\uDF90",["wind_chime"]],"1f391":["\uD83C\uDF91",["rice_scene"]],"1f392":["\uD83C\uDF92",["school_satchel"]],"1f393":["\uD83C\uDF93",["mortar_board"]],"1f3a0":["\uD83C\uDFA0",["carousel_horse"]],"1f3a1":["\uD83C\uDFA1",["ferris_wheel"]],"1f3a2":["\uD83C\uDFA2",["roller_coaster"]],"1f3a3":["\uD83C\uDFA3",["fishing_pole_and_fish"]],"1f3a4":["\uD83C\uDFA4",["microphone"]],"1f3a5":["\uD83C\uDFA5",["movie_camera"]],"1f3a6":["\uD83C\uDFA6",["cinema"]],"1f3a7":["\uD83C\uDFA7",["headphones"]],"1f3a8":["\uD83C\uDFA8",["art"]],"1f3a9":["\uD83C\uDFA9",["tophat"]],"1f3aa":["\uD83C\uDFAA",["circus_tent"]],"1f3ab":["\uD83C\uDFAB",["ticket"]],"1f3ac":["\uD83C\uDFAC",["clapper"]],"1f3ad":["\uD83C\uDFAD",["performing_arts"]],"1f3ae":["\uD83C\uDFAE",["video_game"]],"1f3af":["\uD83C\uDFAF",["dart"]],"1f3b0":["\uD83C\uDFB0",["slot_machine"]],"1f3b1":["\uD83C\uDFB1",["8ball"]],"1f3b2":["\uD83C\uDFB2",["game_die"]],"1f3b3":["\uD83C\uDFB3",["bowling"]],"1f3b4":["\uD83C\uDFB4",["flower_playing_cards"]],"1f3b5":["\uD83C\uDFB5",["musical_note"]],"1f3b6":["\uD83C\uDFB6",["notes"]],"1f3b7":["\uD83C\uDFB7",["saxophone"]],"1f3b8":["\uD83C\uDFB8",["guitar"]],"1f3b9":["\uD83C\uDFB9",["musical_keyboard"]],"1f3ba":["\uD83C\uDFBA",["trumpet"]],"1f3bb":["\uD83C\uDFBB",["violin"]],"1f3bc":["\uD83C\uDFBC",["musical_score"]],"1f3bd":["\uD83C\uDFBD",["running_shirt_with_sash"]],"1f3be":["\uD83C\uDFBE",["tennis"]],"1f3bf":["\uD83C\uDFBF",["ski"]],"1f3c0":["\uD83C\uDFC0",["basketball"]],"1f3c1":["\uD83C\uDFC1",["checkered_flag"]],"1f3c2":["\uD83C\uDFC2",["snowboarder"]],"1f3c3":["\uD83C\uDFC3",["runner","running"]],"1f3c4":["\uD83C\uDFC4",["surfer"]],"1f3c6":["\uD83C\uDFC6",["trophy"]],"1f3c7":["\uD83C\uDFC7",["horse_racing"]],"1f3c8":["\uD83C\uDFC8",["football"]],"1f3c9":["\uD83C\uDFC9",["rugby_football"]],"1f3ca":["\uD83C\uDFCA",["swimmer"]],"1f3e0":["\uD83C\uDFE0",["house"]],"1f3e1":["\uD83C\uDFE1",["house_with_garden"]],"1f3e2":["\uD83C\uDFE2",["office"]],"1f3e3":["\uD83C\uDFE3",["post_office"]],"1f3e4":["\uD83C\uDFE4",["european_post_office"]],"1f3e5":["\uD83C\uDFE5",["hospital"]],"1f3e6":["\uD83C\uDFE6",["bank"]],"1f3e7":["\uD83C\uDFE7",["atm"]],"1f3e8":["\uD83C\uDFE8",["hotel"]],"1f3e9":["\uD83C\uDFE9",["love_hotel"]],"1f3ea":["\uD83C\uDFEA",["convenience_store"]],"1f3eb":["\uD83C\uDFEB",["school"]],"1f3ec":["\uD83C\uDFEC",["department_store"]],"1f3ed":["\uD83C\uDFED",["factory"]],"1f3ee":["\uD83C\uDFEE",["izakaya_lantern","lantern"]],"1f3ef":["\uD83C\uDFEF",["japanese_castle"]],"1f3f0":["\uD83C\uDFF0",["european_castle"]],"1f400":["\uD83D\uDC00",["rat"]],"1f401":["\uD83D\uDC01",["mouse2"]],"1f402":["\uD83D\uDC02",["ox"]],"1f403":["\uD83D\uDC03",["water_buffalo"]],"1f404":["\uD83D\uDC04",["cow2"]],"1f405":["\uD83D\uDC05",["tiger2"]],"1f406":["\uD83D\uDC06",["leopard"]],"1f407":["\uD83D\uDC07",["rabbit2"]],"1f408":["\uD83D\uDC08",["cat2"]],"1f409":["\uD83D\uDC09",["dragon"]],"1f40a":["\uD83D\uDC0A",["crocodile"]],"1f40b":["\uD83D\uDC0B",["whale2"]],"1f40c":["\uD83D\uDC0C",["snail"]],"1f40d":["\uD83D\uDC0D",["snake"]],"1f40e":["\uD83D\uDC0E",["racehorse"]],"1f40f":["\uD83D\uDC0F",["ram"]],"1f410":["\uD83D\uDC10",["goat"]],"1f411":["\uD83D\uDC11",["sheep"]],"1f412":["\uD83D\uDC12",["monkey"]],"1f413":["\uD83D\uDC13",["rooster"]],"1f414":["\uD83D\uDC14",["chicken"]],"1f415":["\uD83D\uDC15",["dog2"]],"1f416":["\uD83D\uDC16",["pig2"]],"1f417":["\uD83D\uDC17",["boar"]],"1f418":["\uD83D\uDC18",["elephant"]],"1f419":["\uD83D\uDC19",["octopus"]],"1f41a":["\uD83D\uDC1A",["shell"]],"1f41b":["\uD83D\uDC1B",["bug"]],"1f41c":["\uD83D\uDC1C",["ant"]],"1f41d":["\uD83D\uDC1D",["bee","honeybee"]],"1f41e":["\uD83D\uDC1E",["beetle"]],"1f41f":["\uD83D\uDC1F",["fish"]],"1f420":["\uD83D\uDC20",["tropical_fish"]],"1f421":["\uD83D\uDC21",["blowfish"]],"1f422":["\uD83D\uDC22",["turtle"]],"1f423":["\uD83D\uDC23",["hatching_chick"]],"1f424":["\uD83D\uDC24",["baby_chick"]],"1f425":["\uD83D\uDC25",["hatched_chick"]],"1f426":["\uD83D\uDC26",["bird"]],"1f427":["\uD83D\uDC27",["penguin"]],"1f428":["\uD83D\uDC28",["koala"]],"1f429":["\uD83D\uDC29",["poodle"]],"1f42a":["\uD83D\uDC2A",["dromedary_camel"]],"1f42b":["\uD83D\uDC2B",["camel"]],"1f42c":["\uD83D\uDC2C",["dolphin","flipper"]],"1f42d":["\uD83D\uDC2D",["mouse"]],"1f42e":["\uD83D\uDC2E",["cow"]],"1f42f":["\uD83D\uDC2F",["tiger"]],"1f430":["\uD83D\uDC30",["rabbit"]],"1f431":["\uD83D\uDC31",["cat"]],"1f432":["\uD83D\uDC32",["dragon_face"]],"1f433":["\uD83D\uDC33",["whale"]],"1f434":["\uD83D\uDC34",["horse"]],"1f435":["\uD83D\uDC35",["monkey_face"]],"1f436":["\uD83D\uDC36",["dog"]],"1f437":["\uD83D\uDC37",["pig"]],"1f438":["\uD83D\uDC38",["frog"]],"1f439":["\uD83D\uDC39",["hamster"]],"1f43a":["\uD83D\uDC3A",["wolf"]],"1f43b":["\uD83D\uDC3B",["bear"]],"1f43c":["\uD83D\uDC3C",["panda_face"]],"1f43d":["\uD83D\uDC3D",["pig_nose"]],"1f43e":["\uD83D\uDC3E",["feet","paw_prints"]],"1f440":["\uD83D\uDC40",["eyes"]],"1f442":["\uD83D\uDC42",["ear"]],"1f443":["\uD83D\uDC43",["nose"]],"1f444":["\uD83D\uDC44",["lips"]],"1f445":["\uD83D\uDC45",["tongue"]],"1f446":["\uD83D\uDC46",["point_up_2"]],"1f447":["\uD83D\uDC47",["point_down"]],"1f448":["\uD83D\uDC48",["point_left"]],"1f449":["\uD83D\uDC49",["point_right"]],"1f44a":["\uD83D\uDC4A",["facepunch","punch"]],"1f44b":["\uD83D\uDC4B",["wave"]],"1f44c":["\uD83D\uDC4C",["ok_hand"]],"1f44d":["\uD83D\uDC4D",["+1","thumbsup"]],"1f44e":["\uD83D\uDC4E",["-1","thumbsdown"]],"1f44f":["\uD83D\uDC4F",["clap"]],"1f450":["\uD83D\uDC50",["open_hands"]],"1f451":["\uD83D\uDC51",["crown"]],"1f452":["\uD83D\uDC52",["womans_hat"]],"1f453":["\uD83D\uDC53",["eyeglasses"]],"1f454":["\uD83D\uDC54",["necktie"]],"1f455":["\uD83D\uDC55",["shirt","tshirt"]],"1f456":["\uD83D\uDC56",["jeans"]],"1f457":["\uD83D\uDC57",["dress"]],"1f458":["\uD83D\uDC58",["kimono"]],"1f459":["\uD83D\uDC59",["bikini"]],"1f45a":["\uD83D\uDC5A",["womans_clothes"]],"1f45b":["\uD83D\uDC5B",["purse"]],"1f45c":["\uD83D\uDC5C",["handbag"]],"1f45d":["\uD83D\uDC5D",["pouch"]],"1f45e":["\uD83D\uDC5E",["mans_shoe","shoe"]],"1f45f":["\uD83D\uDC5F",["athletic_shoe"]],"1f460":["\uD83D\uDC60",["high_heel"]],"1f461":["\uD83D\uDC61",["sandal"]],"1f462":["\uD83D\uDC62",["boot"]],"1f463":["\uD83D\uDC63",["footprints"]],"1f464":["\uD83D\uDC64",["bust_in_silhouette"]],"1f465":["\uD83D\uDC65",["busts_in_silhouette"]],"1f466":["\uD83D\uDC66",["boy"]],"1f467":["\uD83D\uDC67",["girl"]],"1f468":["\uD83D\uDC68",["man"]],"1f469":["\uD83D\uDC69",["woman"]],"1f46a":["\uD83D\uDC6A",["family"]],"1f46b":["\uD83D\uDC6B",["couple"]],"1f46c":["\uD83D\uDC6C",["two_men_holding_hands"]],"1f46d":["\uD83D\uDC6D",["two_women_holding_hands"]],"1f46e":["\uD83D\uDC6E",["cop"]],"1f46f":["\uD83D\uDC6F",["dancers"]],"1f470":["\uD83D\uDC70",["bride_with_veil"]],"1f471":["\uD83D\uDC71",["person_with_blond_hair"]],"1f472":["\uD83D\uDC72",["man_with_gua_pi_mao"]],"1f473":["\uD83D\uDC73",["man_with_turban"]],"1f474":["\uD83D\uDC74",["older_man"]],"1f475":["\uD83D\uDC75",["older_woman"]],"1f476":["\uD83D\uDC76",["baby"]],"1f477":["\uD83D\uDC77",["construction_worker"]],"1f478":["\uD83D\uDC78",["princess"]],"1f479":["\uD83D\uDC79",["japanese_ogre"]],"1f47a":["\uD83D\uDC7A",["japanese_goblin"]],"1f47b":["\uD83D\uDC7B",["ghost"]],"1f47c":["\uD83D\uDC7C",["angel"]],"1f47d":["\uD83D\uDC7D",["alien"]],"1f47e":["\uD83D\uDC7E",["space_invader"]],"1f47f":["\uD83D\uDC7F",["imp"]],"1f480":["\uD83D\uDC80",["skull"]],"1f481":["\uD83D\uDC81",["information_desk_person"]],"1f482":["\uD83D\uDC82",["guardsman"]],"1f483":["\uD83D\uDC83",["dancer"]],"1f484":["\uD83D\uDC84",["lipstick"]],"1f485":["\uD83D\uDC85",["nail_care"]],"1f486":["\uD83D\uDC86",["massage"]],"1f487":["\uD83D\uDC87",["haircut"]],"1f488":["\uD83D\uDC88",["barber"]],"1f489":["\uD83D\uDC89",["syringe"]],"1f48a":["\uD83D\uDC8A",["pill"]],"1f48b":["\uD83D\uDC8B",["kiss"]],"1f48c":["\uD83D\uDC8C",["love_letter"]],"1f48d":["\uD83D\uDC8D",["ring"]],"1f48e":["\uD83D\uDC8E",["gem"]],"1f48f":["\uD83D\uDC8F",["couplekiss"]],"1f490":["\uD83D\uDC90",["bouquet"]],"1f491":["\uD83D\uDC91",["couple_with_heart"]],"1f492":["\uD83D\uDC92",["wedding"]],"1f493":["\uD83D\uDC93",["heartbeat"]],"1f494":["\uD83D\uDC94",["broken_heart"],"<\/3"],"1f495":["\uD83D\uDC95",["two_hearts"]],"1f496":["\uD83D\uDC96",["sparkling_heart"]],"1f497":["\uD83D\uDC97",["heartpulse"]],"1f498":["\uD83D\uDC98",["cupid"]],"1f499":["\uD83D\uDC99",["blue_heart"],"<3"],"1f49a":["\uD83D\uDC9A",["green_heart"],"<3"],"1f49b":["\uD83D\uDC9B",["yellow_heart"],"<3"],"1f49c":["\uD83D\uDC9C",["purple_heart"],"<3"],"1f49d":["\uD83D\uDC9D",["gift_heart"]],"1f49e":["\uD83D\uDC9E",["revolving_hearts"]],"1f49f":["\uD83D\uDC9F",["heart_decoration"]],"1f4a0":["\uD83D\uDCA0",["diamond_shape_with_a_dot_inside"]],"1f4a1":["\uD83D\uDCA1",["bulb"]],"1f4a2":["\uD83D\uDCA2",["anger"]],"1f4a3":["\uD83D\uDCA3",["bomb"]],"1f4a4":["\uD83D\uDCA4",["zzz"]],"1f4a5":["\uD83D\uDCA5",["boom","collision"]],"1f4a6":["\uD83D\uDCA6",["sweat_drops"]],"1f4a7":["\uD83D\uDCA7",["droplet"]],"1f4a8":["\uD83D\uDCA8",["dash"]],"1f4a9":["\uD83D\uDCA9",["hankey","poop","shit"]],"1f4aa":["\uD83D\uDCAA",["muscle"]],"1f4ab":["\uD83D\uDCAB",["dizzy"]],"1f4ac":["\uD83D\uDCAC",["speech_balloon"]],"1f4ad":["\uD83D\uDCAD",["thought_balloon"]],"1f4ae":["\uD83D\uDCAE",["white_flower"]],"1f4af":["\uD83D\uDCAF",["100"]],"1f4b0":["\uD83D\uDCB0",["moneybag"]],"1f4b1":["\uD83D\uDCB1",["currency_exchange"]],"1f4b2":["\uD83D\uDCB2",["heavy_dollar_sign"]],"1f4b3":["\uD83D\uDCB3",["credit_card"]],"1f4b4":["\uD83D\uDCB4",["yen"]],"1f4b5":["\uD83D\uDCB5",["dollar"]],"1f4b6":["\uD83D\uDCB6",["euro"]],"1f4b7":["\uD83D\uDCB7",["pound"]],"1f4b8":["\uD83D\uDCB8",["money_with_wings"]],"1f4b9":["\uD83D\uDCB9",["chart"]],"1f4ba":["\uD83D\uDCBA",["seat"]],"1f4bb":["\uD83D\uDCBB",["computer"]],"1f4bc":["\uD83D\uDCBC",["briefcase"]],"1f4bd":["\uD83D\uDCBD",["minidisc"]],"1f4be":["\uD83D\uDCBE",["floppy_disk"]],"1f4bf":["\uD83D\uDCBF",["cd"]],"1f4c0":["\uD83D\uDCC0",["dvd"]],"1f4c1":["\uD83D\uDCC1",["file_folder"]],"1f4c2":["\uD83D\uDCC2",["open_file_folder"]],"1f4c3":["\uD83D\uDCC3",["page_with_curl"]],"1f4c4":["\uD83D\uDCC4",["page_facing_up"]],"1f4c5":["\uD83D\uDCC5",["date"]],"1f4c6":["\uD83D\uDCC6",["calendar"]],"1f4c7":["\uD83D\uDCC7",["card_index"]],"1f4c8":["\uD83D\uDCC8",["chart_with_upwards_trend"]],"1f4c9":["\uD83D\uDCC9",["chart_with_downwards_trend"]],"1f4ca":["\uD83D\uDCCA",["bar_chart"]],"1f4cb":["\uD83D\uDCCB",["clipboard"]],"1f4cc":["\uD83D\uDCCC",["pushpin"]],"1f4cd":["\uD83D\uDCCD",["round_pushpin"]],"1f4ce":["\uD83D\uDCCE",["paperclip"]],"1f4cf":["\uD83D\uDCCF",["straight_ruler"]],"1f4d0":["\uD83D\uDCD0",["triangular_ruler"]],"1f4d1":["\uD83D\uDCD1",["bookmark_tabs"]],"1f4d2":["\uD83D\uDCD2",["ledger"]],"1f4d3":["\uD83D\uDCD3",["notebook"]],"1f4d4":["\uD83D\uDCD4",["notebook_with_decorative_cover"]],"1f4d5":["\uD83D\uDCD5",["closed_book"]],"1f4d6":["\uD83D\uDCD6",["book","open_book"]],"1f4d7":["\uD83D\uDCD7",["green_book"]],"1f4d8":["\uD83D\uDCD8",["blue_book"]],"1f4d9":["\uD83D\uDCD9",["orange_book"]],"1f4da":["\uD83D\uDCDA",["books"]],"1f4db":["\uD83D\uDCDB",["name_badge"]],"1f4dc":["\uD83D\uDCDC",["scroll"]],"1f4dd":["\uD83D\uDCDD",["memo","pencil"]],"1f4de":["\uD83D\uDCDE",["telephone_receiver"]],"1f4df":["\uD83D\uDCDF",["pager"]],"1f4e0":["\uD83D\uDCE0",["fax"]],"1f4e1":["\uD83D\uDCE1",["satellite"]],"1f4e2":["\uD83D\uDCE2",["loudspeaker"]],"1f4e3":["\uD83D\uDCE3",["mega"]],"1f4e4":["\uD83D\uDCE4",["outbox_tray"]],"1f4e5":["\uD83D\uDCE5",["inbox_tray"]],"1f4e6":["\uD83D\uDCE6",["package"]],"1f4e7":["\uD83D\uDCE7",["e-mail"]],"1f4e8":["\uD83D\uDCE8",["incoming_envelope"]],"1f4e9":["\uD83D\uDCE9",["envelope_with_arrow"]],"1f4ea":["\uD83D\uDCEA",["mailbox_closed"]],"1f4eb":["\uD83D\uDCEB",["mailbox"]],"1f4ec":["\uD83D\uDCEC",["mailbox_with_mail"]],"1f4ed":["\uD83D\uDCED",["mailbox_with_no_mail"]],"1f4ee":["\uD83D\uDCEE",["postbox"]],"1f4ef":["\uD83D\uDCEF",["postal_horn"]],"1f4f0":["\uD83D\uDCF0",["newspaper"]],"1f4f1":["\uD83D\uDCF1",["iphone"]],"1f4f2":["\uD83D\uDCF2",["calling"]],"1f4f3":["\uD83D\uDCF3",["vibration_mode"]],"1f4f4":["\uD83D\uDCF4",["mobile_phone_off"]],"1f4f5":["\uD83D\uDCF5",["no_mobile_phones"]],"1f4f6":["\uD83D\uDCF6",["signal_strength"]],"1f4f7":["\uD83D\uDCF7",["camera"]],"1f4f9":["\uD83D\uDCF9",["video_camera"]],"1f4fa":["\uD83D\uDCFA",["tv"]],"1f4fb":["\uD83D\uDCFB",["radio"]],"1f4fc":["\uD83D\uDCFC",["vhs"]],"1f500":["\uD83D\uDD00",["twisted_rightwards_arrows"]],"1f501":["\uD83D\uDD01",["repeat"]],"1f502":["\uD83D\uDD02",["repeat_one"]],"1f503":["\uD83D\uDD03",["arrows_clockwise"]],"1f504":["\uD83D\uDD04",["arrows_counterclockwise"]],"1f505":["\uD83D\uDD05",["low_brightness"]],"1f506":["\uD83D\uDD06",["high_brightness"]],"1f507":["\uD83D\uDD07",["mute"]],"1f509":["\uD83D\uDD09",["sound"]],"1f50a":["\uD83D\uDD0A",["speaker"]],"1f50b":["\uD83D\uDD0B",["battery"]],"1f50c":["\uD83D\uDD0C",["electric_plug"]],"1f50d":["\uD83D\uDD0D",["mag"]],"1f50e":["\uD83D\uDD0E",["mag_right"]],"1f50f":["\uD83D\uDD0F",["lock_with_ink_pen"]],"1f510":["\uD83D\uDD10",["closed_lock_with_key"]],"1f511":["\uD83D\uDD11",["key"]],"1f512":["\uD83D\uDD12",["lock"]],"1f513":["\uD83D\uDD13",["unlock"]],"1f514":["\uD83D\uDD14",["bell"]],"1f515":["\uD83D\uDD15",["no_bell"]],"1f516":["\uD83D\uDD16",["bookmark"]],"1f517":["\uD83D\uDD17",["link"]],"1f518":["\uD83D\uDD18",["radio_button"]],"1f519":["\uD83D\uDD19",["back"]],"1f51a":["\uD83D\uDD1A",["end"]],"1f51b":["\uD83D\uDD1B",["on"]],"1f51c":["\uD83D\uDD1C",["soon"]],"1f51d":["\uD83D\uDD1D",["top"]],"1f51e":["\uD83D\uDD1E",["underage"]],"1f51f":["\uD83D\uDD1F",["keycap_ten"]],"1f520":["\uD83D\uDD20",["capital_abcd"]],"1f521":["\uD83D\uDD21",["abcd"]],"1f522":["\uD83D\uDD22",["1234"]],"1f523":["\uD83D\uDD23",["symbols"]],"1f524":["\uD83D\uDD24",["abc"]],"1f525":["\uD83D\uDD25",["fire"]],"1f526":["\uD83D\uDD26",["flashlight"]],"1f527":["\uD83D\uDD27",["wrench"]],"1f528":["\uD83D\uDD28",["hammer"]],"1f529":["\uD83D\uDD29",["nut_and_bolt"]],"1f52a":["\uD83D\uDD2A",["hocho"]],"1f52b":["\uD83D\uDD2B",["gun"]],"1f52c":["\uD83D\uDD2C",["microscope"]],"1f52d":["\uD83D\uDD2D",["telescope"]],"1f52e":["\uD83D\uDD2E",["crystal_ball"]],"1f52f":["\uD83D\uDD2F",["six_pointed_star"]],"1f530":["\uD83D\uDD30",["beginner"]],"1f531":["\uD83D\uDD31",["trident"]],"1f532":["\uD83D\uDD32",["black_square_button"]],"1f533":["\uD83D\uDD33",["white_square_button"]],"1f534":["\uD83D\uDD34",["red_circle"]],"1f535":["\uD83D\uDD35",["large_blue_circle"]],"1f536":["\uD83D\uDD36",["large_orange_diamond"]],"1f537":["\uD83D\uDD37",["large_blue_diamond"]],"1f538":["\uD83D\uDD38",["small_orange_diamond"]],"1f539":["\uD83D\uDD39",["small_blue_diamond"]],"1f53a":["\uD83D\uDD3A",["small_red_triangle"]],"1f53b":["\uD83D\uDD3B",["small_red_triangle_down"]],"1f53c":["\uD83D\uDD3C",["arrow_up_small"]],"1f53d":["\uD83D\uDD3D",["arrow_down_small"]],"1f550":["\uD83D\uDD50",["clock1"]],"1f551":["\uD83D\uDD51",["clock2"]],"1f552":["\uD83D\uDD52",["clock3"]],"1f553":["\uD83D\uDD53",["clock4"]],"1f554":["\uD83D\uDD54",["clock5"]],"1f555":["\uD83D\uDD55",["clock6"]],"1f556":["\uD83D\uDD56",["clock7"]],"1f557":["\uD83D\uDD57",["clock8"]],"1f558":["\uD83D\uDD58",["clock9"]],"1f559":["\uD83D\uDD59",["clock10"]],"1f55a":["\uD83D\uDD5A",["clock11"]],"1f55b":["\uD83D\uDD5B",["clock12"]],"1f55c":["\uD83D\uDD5C",["clock130"]],"1f55d":["\uD83D\uDD5D",["clock230"]],"1f55e":["\uD83D\uDD5E",["clock330"]],"1f55f":["\uD83D\uDD5F",["clock430"]],"1f560":["\uD83D\uDD60",["clock530"]],"1f561":["\uD83D\uDD61",["clock630"]],"1f562":["\uD83D\uDD62",["clock730"]],"1f563":["\uD83D\uDD63",["clock830"]],"1f564":["\uD83D\uDD64",["clock930"]],"1f565":["\uD83D\uDD65",["clock1030"]],"1f566":["\uD83D\uDD66",["clock1130"]],"1f567":["\uD83D\uDD67",["clock1230"]],"1f5fb":["\uD83D\uDDFB",["mount_fuji"]],"1f5fc":["\uD83D\uDDFC",["tokyo_tower"]],"1f5fd":["\uD83D\uDDFD",["statue_of_liberty"]],"1f5fe":["\uD83D\uDDFE",["japan"]],"1f5ff":["\uD83D\uDDFF",["moyai"]],"1f600":["\uD83D\uDE00",["grinning"]],"1f601":["\uD83D\uDE01",["grin"]],"1f602":["\uD83D\uDE02",["joy"]],"1f603":["\uD83D\uDE03",["smiley"],":)"],"1f604":["\uD83D\uDE04",["smile"],":)"],"1f605":["\uD83D\uDE05",["sweat_smile"]],"1f606":["\uD83D\uDE06",["laughing","satisfied"]],"1f607":["\uD83D\uDE07",["innocent"]],"1f608":["\uD83D\uDE08",["smiling_imp"]],"1f609":["\uD83D\uDE09",["wink"],";)"],"1f60a":["\uD83D\uDE0A",["blush"]],"1f60b":["\uD83D\uDE0B",["yum"]],"1f60c":["\uD83D\uDE0C",["relieved"]],"1f60d":["\uD83D\uDE0D",["heart_eyes"]],"1f60e":["\uD83D\uDE0E",["sunglasses"]],"1f60f":["\uD83D\uDE0F",["smirk"]],"1f610":["\uD83D\uDE10",["neutral_face"]],"1f611":["\uD83D\uDE11",["expressionless"]],"1f612":["\uD83D\uDE12",["unamused"]],"1f613":["\uD83D\uDE13",["sweat"]],"1f614":["\uD83D\uDE14",["pensive"]],"1f615":["\uD83D\uDE15",["confused"]],"1f616":["\uD83D\uDE16",["confounded"]],"1f617":["\uD83D\uDE17",["kissing"]],"1f618":["\uD83D\uDE18",["kissing_heart"]],"1f619":["\uD83D\uDE19",["kissing_smiling_eyes"]],"1f61a":["\uD83D\uDE1A",["kissing_closed_eyes"]],"1f61b":["\uD83D\uDE1B",["stuck_out_tongue"]],"1f61c":["\uD83D\uDE1C",["stuck_out_tongue_winking_eye"],";p"],"1f61d":["\uD83D\uDE1D",["stuck_out_tongue_closed_eyes"]],"1f61e":["\uD83D\uDE1E",["disappointed"],":("],"1f61f":["\uD83D\uDE1F",["worried"]],"1f620":["\uD83D\uDE20",["angry"]],"1f621":["\uD83D\uDE21",["rage"]],"1f622":["\uD83D\uDE22",["cry"],":'("],"1f623":["\uD83D\uDE23",["persevere"]],"1f624":["\uD83D\uDE24",["triumph"]],"1f625":["\uD83D\uDE25",["disappointed_relieved"]],"1f626":["\uD83D\uDE26",["frowning"]],"1f627":["\uD83D\uDE27",["anguished"]],"1f628":["\uD83D\uDE28",["fearful"]],"1f629":["\uD83D\uDE29",["weary"]],"1f62a":["\uD83D\uDE2A",["sleepy"]],"1f62b":["\uD83D\uDE2B",["tired_face"]],"1f62c":["\uD83D\uDE2C",["grimacing"]],"1f62d":["\uD83D\uDE2D",["sob"],":'("],"1f62e":["\uD83D\uDE2E",["open_mouth"]],"1f62f":["\uD83D\uDE2F",["hushed"]],"1f630":["\uD83D\uDE30",["cold_sweat"]],"1f631":["\uD83D\uDE31",["scream"]],"1f632":["\uD83D\uDE32",["astonished"]],"1f633":["\uD83D\uDE33",["flushed"]],"1f634":["\uD83D\uDE34",["sleeping"]],"1f635":["\uD83D\uDE35",["dizzy_face"]],"1f636":["\uD83D\uDE36",["no_mouth"]],"1f637":["\uD83D\uDE37",["mask"]],"1f638":["\uD83D\uDE38",["smile_cat"]],"1f639":["\uD83D\uDE39",["joy_cat"]],"1f63a":["\uD83D\uDE3A",["smiley_cat"]],"1f63b":["\uD83D\uDE3B",["heart_eyes_cat"]],"1f63c":["\uD83D\uDE3C",["smirk_cat"]],"1f63d":["\uD83D\uDE3D",["kissing_cat"]],"1f63e":["\uD83D\uDE3E",["pouting_cat"]],"1f63f":["\uD83D\uDE3F",["crying_cat_face"]],"1f640":["\uD83D\uDE40",["scream_cat"]],"1f645":["\uD83D\uDE45",["no_good"]],"1f646":["\uD83D\uDE46",["ok_woman"]],"1f647":["\uD83D\uDE47",["bow"]],"1f648":["\uD83D\uDE48",["see_no_evil"]],"1f649":["\uD83D\uDE49",["hear_no_evil"]],"1f64a":["\uD83D\uDE4A",["speak_no_evil"]],"1f64b":["\uD83D\uDE4B",["raising_hand"]],"1f64c":["\uD83D\uDE4C",["raised_hands"]],"1f64d":["\uD83D\uDE4D",["person_frowning"]],"1f64e":["\uD83D\uDE4E",["person_with_pouting_face"]],"1f64f":["\uD83D\uDE4F",["pray"]],"1f680":["\uD83D\uDE80",["rocket"]],"1f681":["\uD83D\uDE81",["helicopter"]],"1f682":["\uD83D\uDE82",["steam_locomotive"]],"1f683":["\uD83D\uDE83",["railway_car","train"]],"1f684":["\uD83D\uDE84",["bullettrain_side"]],"1f685":["\uD83D\uDE85",["bullettrain_front"]],"1f686":["\uD83D\uDE86",["train2"]],"1f687":["\uD83D\uDE87",["metro"]],"1f688":["\uD83D\uDE88",["light_rail"]],"1f689":["\uD83D\uDE89",["station"]],"1f68a":["\uD83D\uDE8A",["tram"]],"1f68c":["\uD83D\uDE8C",["bus"]],"1f68d":["\uD83D\uDE8D",["oncoming_bus"]],"1f68e":["\uD83D\uDE8E",["trolleybus"]],"1f68f":["\uD83D\uDE8F",["busstop"]],"1f690":["\uD83D\uDE90",["minibus"]],"1f691":["\uD83D\uDE91",["ambulance"]],"1f692":["\uD83D\uDE92",["fire_engine"]],"1f693":["\uD83D\uDE93",["police_car"]],"1f694":["\uD83D\uDE94",["oncoming_police_car"]],"1f695":["\uD83D\uDE95",["taxi"]],"1f696":["\uD83D\uDE96",["oncoming_taxi"]],"1f697":["\uD83D\uDE97",["car","red_car"]],"1f698":["\uD83D\uDE98",["oncoming_automobile"]],"1f699":["\uD83D\uDE99",["blue_car"]],"1f69a":["\uD83D\uDE9A",["truck"]],"1f69b":["\uD83D\uDE9B",["articulated_lorry"]],"1f69c":["\uD83D\uDE9C",["tractor"]],"1f69d":["\uD83D\uDE9D",["monorail"]],"1f69e":["\uD83D\uDE9E",["mountain_railway"]],"1f69f":["\uD83D\uDE9F",["suspension_railway"]],"1f6a0":["\uD83D\uDEA0",["mountain_cableway"]],"1f6a1":["\uD83D\uDEA1",["aerial_tramway"]],"1f6a2":["\uD83D\uDEA2",["ship"]],"1f6a3":["\uD83D\uDEA3",["rowboat"]],"1f6a4":["\uD83D\uDEA4",["speedboat"]],"1f6a5":["\uD83D\uDEA5",["traffic_light"]],"1f6a6":["\uD83D\uDEA6",["vertical_traffic_light"]],"1f6a7":["\uD83D\uDEA7",["construction"]],"1f6a8":["\uD83D\uDEA8",["rotating_light"]],"1f6a9":["\uD83D\uDEA9",["triangular_flag_on_post"]],"1f6aa":["\uD83D\uDEAA",["door"]],"1f6ab":["\uD83D\uDEAB",["no_entry_sign"]],"1f6ac":["\uD83D\uDEAC",["smoking"]],"1f6ad":["\uD83D\uDEAD",["no_smoking"]],"1f6ae":["\uD83D\uDEAE",["put_litter_in_its_place"]],"1f6af":["\uD83D\uDEAF",["do_not_litter"]],"1f6b0":["\uD83D\uDEB0",["potable_water"]],"1f6b1":["\uD83D\uDEB1",["non-potable_water"]],"1f6b2":["\uD83D\uDEB2",["bike"]],"1f6b3":["\uD83D\uDEB3",["no_bicycles"]],"1f6b4":["\uD83D\uDEB4",["bicyclist"]],"1f6b5":["\uD83D\uDEB5",["mountain_bicyclist"]],"1f6b6":["\uD83D\uDEB6",["walking"]],"1f6b7":["\uD83D\uDEB7",["no_pedestrians"]],"1f6b8":["\uD83D\uDEB8",["children_crossing"]],"1f6b9":["\uD83D\uDEB9",["mens"]],"1f6ba":["\uD83D\uDEBA",["womens"]],"1f6bb":["\uD83D\uDEBB",["restroom"]],"1f6bc":["\uD83D\uDEBC",["baby_symbol"]],"1f6bd":["\uD83D\uDEBD",["toilet"]],"1f6be":["\uD83D\uDEBE",["wc"]],"1f6bf":["\uD83D\uDEBF",["shower"]],"1f6c0":["\uD83D\uDEC0",["bath"]],"1f6c1":["\uD83D\uDEC1",["bathtub"]],"1f6c2":["\uD83D\uDEC2",["passport_control"]],"1f6c3":["\uD83D\uDEC3",["customs"]],"1f6c4":["\uD83D\uDEC4",["baggage_claim"]],"1f6c5":["\uD83D\uDEC5",["left_luggage"]],"0023":["\u0023\u20E3",["hash"]],"0030":["\u0030\u20E3",["zero"]],"0031":["\u0031\u20E3",["one"]],"0032":["\u0032\u20E3",["two"]],"0033":["\u0033\u20E3",["three"]],"0034":["\u0034\u20E3",["four"]],"0035":["\u0035\u20E3",["five"]],"0036":["\u0036\u20E3",["six"]],"0037":["\u0037\u20E3",["seven"]],"0038":["\u0038\u20E3",["eight"]],"0039":["\u0039\u20E3",["nine"]],"1f1e8-1f1f3":["\uD83C\uDDE8\uD83C\uDDF3",["cn"]],"1f1e9-1f1ea":["\uD83C\uDDE9\uD83C\uDDEA",["de"]],"1f1ea-1f1f8":["\uD83C\uDDEA\uD83C\uDDF8",["es"]],"1f1eb-1f1f7":["\uD83C\uDDEB\uD83C\uDDF7",["fr"]],"1f1ec-1f1e7":["\uD83C\uDDEC\uD83C\uDDE7",["gb","uk"]],"1f1ee-1f1f9":["\uD83C\uDDEE\uD83C\uDDF9",["it"]],"1f1ef-1f1f5":["\uD83C\uDDEF\uD83C\uDDF5",["jp"]],"1f1f0-1f1f7":["\uD83C\uDDF0\uD83C\uDDF7",["kr"]],"1f1f7-1f1fa":["\uD83C\uDDF7\uD83C\uDDFA",["ru"]],"1f1fa-1f1f8":["\uD83C\uDDFA\uD83C\uDDF8",["us"]]} + +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]]; diff --git a/js/lib/mtproto.js b/js/lib/mtproto.js index 4c91d0d1..a4618cbc 100644 --- a/js/lib/mtproto.js +++ b/js/lib/mtproto.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -893,12 +893,12 @@ factory('MtpDcConfigurator', function () { var dcOptions = window._testMode ? [ {id: 1, host: '173.240.5.253', port: 80}, - {id: 2, host: '95.142.192.65', port: 80}, + {id: 2, host: '109.239.131.195', port: 80}, {id: 3, host: '174.140.142.5', port: 80} ] : [ {id: 1, host: '173.240.5.1', port: 80}, - {id: 2, host: '95.142.192.66', port: 80}, + {id: 2, host: '109.239.131.193', port: 80}, {id: 3, host: '174.140.142.6', port: 80}, {id: 4, host: '31.210.235.12', port: 80}, {id: 5, host: '116.51.22.2', port: 80}, @@ -1500,11 +1500,18 @@ factory('MtpSha1Service', function ($q) { } }). -factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerator, MtpSecureRandom, MtpSha1Service, MtpAesService, AppConfigManager, $http, $q, $timeout, $interval) { +factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerator, MtpSecureRandom, MtpSha1Service, MtpAesService, AppConfigManager, $http, $q, $timeout, $interval, $rootScope) { var updatesProcessor, iii = 0, - offline = false; + offline; + + $rootScope.offline = true; + $rootScope.offlineConnecting = true; + + $rootScope.retryOnline = function () { + $(document.body).trigger('online'); + } function MtpNetworker(dcID, authKey, serverSalt, options) { options = options || {}; @@ -1759,6 +1766,8 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato }; MtpNetworker.prototype.checkConnection = function(event) { + $rootScope.offlineConnecting = true; + console.log('check connection', event); $timeout.cancel(this.checkConnectionPromise); @@ -1775,21 +1784,27 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato var self = this; this.sendEncryptedRequest(pingMessage).then(function (result) { + delete $rootScope.offlineConnecting; self.toggleOffline(false); }, function () { console.log('delay ', self.checkConnectionPeriod * 1000); self.checkConnectionPromise = $timeout(self.checkConnection.bind(self), parseInt(self.checkConnectionPeriod * 1000)); self.checkConnectionPeriod = Math.min(60, self.checkConnectionPeriod * 1.5); + $timeout(function () { + delete $rootScope.offlineConnecting; + }, 1000); }) }; MtpNetworker.prototype.toggleOffline = function(enabled) { console.log('toggle ', enabled, this.dcID, this.iii); - if (this.offline == enabled) { + if (this.offline !== undefined && this.offline == enabled) { return false; } this.offline = enabled; + $rootScope.offline = enabled; + $rootScope.offlineConnecting = false; if (this.offline) { $timeout.cancel(this.nextReqPromise); @@ -1912,6 +1927,7 @@ factory('MtpNetworkerFactory', function (MtpDcConfigurator, MtpMessageIdGenerato var self = this; this.sendEncryptedRequest(message).then(function (result) { + self.toggleOffline(false); self.parseResponse(result.data).then(function (response) { if (window._debugMode) { console.log('Server response', self.dcID, response); diff --git a/js/lib/pq_worker.js b/js/lib/pq_worker.js index 193a2985..3cc216a7 100644 --- a/js/lib/pq_worker.js +++ b/js/lib/pq_worker.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/lib/sha1_worker.js b/js/lib/sha1_worker.js index ce08771b..5dee15f0 100644 --- a/js/lib/sha1_worker.js +++ b/js/lib/sha1_worker.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE diff --git a/js/services.js b/js/services.js index b2d1c4a2..2b9b79e0 100644 --- a/js/services.js +++ b/js/services.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -118,7 +118,7 @@ angular.module('myApp.services', []) }; }) -.service('AppUsersManager', function ($rootScope, $modal, $modalStack, MtpApiFileManager, MtpApiManager, RichTextProcessor, SearchIndexManager) { +.service('AppUsersManager', function ($rootScope, $modal, $modalStack, $filter, MtpApiFileManager, MtpApiManager, RichTextProcessor, SearchIndexManager) { var users = {}, contactsFillPromise, contactsIndex = SearchIndexManager.createIndex(); @@ -180,12 +180,16 @@ angular.module('myApp.services', []) return; } + if (apiUser.phone) { + apiUser.rPhone = $filter('phoneNumber')(apiUser.phone); + } + if (apiUser.first_name) { apiUser.rFirstName = RichTextProcessor.wrapRichText(apiUser.first_name, {noLinks: true, noLinebreaks: true}); apiUser.rFullName = RichTextProcessor.wrapRichText(apiUser.first_name + ' ' + (apiUser.last_name || ''), {noLinks: true, noLinebreaks: true}); } else { - apiUser.rFirstName = RichTextProcessor.wrapRichText(apiUser.last_name, {noLinks: true, noLinebreaks: true}) || 'DELETED'; - apiUser.rFullName = RichTextProcessor.wrapRichText(apiUser.last_name, {noLinks: true, noLinebreaks: true}) || 'DELETED'; + apiUser.rFirstName = RichTextProcessor.wrapRichText(apiUser.last_name, {noLinks: true, noLinebreaks: true}) || apiUser.rPhone || 'DELETED'; + apiUser.rFullName = RichTextProcessor.wrapRichText(apiUser.last_name, {noLinks: true, noLinebreaks: true}) || apiUser.rPhone || 'DELETED'; } apiUser.sortName = $.trim((apiUser.last_name || '') + ' ' + apiUser.first_name); apiUser.sortStatus = apiUser.status && (apiUser.status.expires || apiUser.status.was_online) || 0; @@ -361,11 +365,15 @@ angular.module('myApp.services', []) var chatFull = angular.copy(fullChat), chat = getChat(id); + if (chatFull.participants && chatFull.participants._ == 'chatParticipants') { - angular.forEach(chatFull.participants.participants, function(participant){ - participant.user = AppUsersManager.getUser(participant.user_id); - participant.userPhoto = AppUsersManager.getUserPhoto(participant.user_id, 'User'); - participant.inviter = AppUsersManager.getUser(participant.inviter_id); + MtpApiManager.getUserID().then(function (myID) { + angular.forEach(chatFull.participants.participants, function(participant){ + participant.user = AppUsersManager.getUser(participant.user_id); + participant.userPhoto = AppUsersManager.getUserPhoto(participant.user_id, 'User'); + participant.inviter = AppUsersManager.getUser(participant.inviter_id); + participant.canKick = myID != participant.user_id && (myID == chat.admin_id || myID == participant.inviter_id); + }); }); } @@ -1126,6 +1134,28 @@ angular.module('myApp.services', []) pendingByRandomID[randomIDS] = [peerID, messageID]; } + function forwardMessages (msgIDs, inputPeer) { + return MtpApiManager.invokeApi('messages.forwardMessages', { + peer: inputPeer, + id: msgIDs + }).then(function (forwardResult) { + AppUsersManager.saveApiUsers(forwardResult.users); + AppChatsManager.saveApiChats(forwardResult.chats); + + if (ApiUpdatesManager.saveSeq(forwardResult.seq)) { + angular.forEach(forwardResult.messages, function(apiMessage) { + + ApiUpdatesManager.saveUpdate({ + _: 'updateNewMessage', + message: apiMessage, + pts: forwardResult.pts + }); + + }); + } + + }); + }; function finalizePendingMessage(randomID, finalMessage) { var pendingData = pendingByRandomID[randomID]; @@ -1178,7 +1208,7 @@ angular.module('myApp.services', []) if (toID < 0) { return toID; } else if (message.out) { - return toID + return toID; } return message.from_id; } @@ -1533,6 +1563,7 @@ angular.module('myApp.services', []) saveMessages: saveMessages, sendText: sendText, sendFile: sendFile, + forwardMessages: forwardMessages, getMessagePeer: getMessagePeer, wrapForDialog: wrapForDialog, wrapForHistory: wrapForHistory @@ -2231,7 +2262,7 @@ angular.module('myApp.services', []) '', - encodeEntities((match[2] != 'http' ? match[2] + '://' : '') + match[4]), + encodeEntities(match[2] + '://' + match[4]), '' ); } @@ -2345,13 +2376,15 @@ angular.module('myApp.services', []) if (!started) { started = true; $rootScope.$watch('idle.isIDLE', checkIDLE); + $rootScope.$watch('offline', checkIDLE); } } function sendUpdateStatusReq(offline) { var date = tsNow(); if (offline && !lastOnlineUpdated || - !offline && (date - lastOnlineUpdated) < 50000) { + !offline && (date - lastOnlineUpdated) < 50000 || + $rootScope.offline) { return; } lastOnlineUpdated = offline ? 0 : date; @@ -2591,3 +2624,54 @@ angular.module('myApp.services', []) showSimpleError: showSimpleError } }) + + + +.service('PeersSelectService', function ($rootScope, $modal) { + + function selectPeer () { + var scope = $rootScope.$new(); + // angular.extend(scope, params); + + return $modal.open({ + templateUrl: 'partials/peer_select.html', + controller: 'PeerSelectController', + scope: scope, + windowClass: 'peer_select_window' + }).result; + } + + + return { + selectPeer: selectPeer + } +}) + + +.service('ContactsSelectService', function ($rootScope, $modal) { + + function select (multiSelect, options) { + options = options || {}; + + var scope = $rootScope.$new(); + scope.multiSelect = multiSelect; + angular.extend(scope, options); + + return $modal.open({ + templateUrl: 'partials/contacts_modal.html', + controller: 'ContactsModalController', + scope: scope, + windowClass: 'contacts_modal_window' + }).result; + } + + + return { + selectContacts: function (options) { + return select (true, options); + }, + selectContact: function (options) { + return select (false, options); + }, + } +}) diff --git a/js/util.js b/js/util.js index d49edbd6..630ad941 100644 --- a/js/util.js +++ b/js/util.js @@ -1,5 +1,5 @@ /*! - * Webogram v0.0.18 - messaging web application for MTProto + * Webogram v0.0.19 - messaging web application for MTProto * https://github.com/zhukov/webogram * Copyright (C) 2014 Igor Zhukov * https://github.com/zhukov/webogram/blob/master/LICENSE @@ -54,8 +54,9 @@ function onContentLoaded (cb) { setTimeout(cb, 0); }; -function tsNow () { - return +new Date(); +function tsNow (seconds) { + var t = +new Date(); + return seconds ? Math.floor(t / 1000) : t; } function safeReplaceObject (wasObject, newObject) { diff --git a/manifest.json b/manifest.json index c490d4b8..9522146d 100644 --- a/manifest.json +++ b/manifest.json @@ -1,6 +1,6 @@ { "name": "Telegram UNOFFICIAL", - "version": "0.0.18", + "version": "0.0.19", "short_name": "Webogram", "manifest_version": 2, "app": { diff --git a/manifest.webapp b/manifest.webapp index 8589f6e3..8f0a9a23 100644 --- a/manifest.webapp +++ b/manifest.webapp @@ -1,7 +1,7 @@ { "name": "Webogram", "description": "Webogram – UNOFFICIAL Telegram Web App.\nMore info & source code here: https://github.com/zhukov/webogram", - "version": "0.0.18", + "version": "0.0.19", "launch_path": "/index.html", "developer": { "name": "Igor Zhukov", diff --git a/partials/chat_create_modal.html b/partials/chat_create_modal.html new file mode 100644 index 00000000..b1bc3dbf --- /dev/null +++ b/partials/chat_create_modal.html @@ -0,0 +1,30 @@ +
+ + + + + +
\ No newline at end of file diff --git a/partials/chat_modal.html b/partials/chat_modal.html index d8faf49e..1b24baac 100644 --- a/partials/chat_modal.html +++ b/partials/chat_modal.html @@ -41,14 +41,19 @@ + -
Members
+
+ Add participant + Members +
-
- -
- - - - -
- + +
+ +
+ -
{{contact.user | userStatus}}
+ +
+ + + +
+
\ No newline at end of file diff --git a/partials/dialog.html b/partials/dialog.html index 1ded7010..7066c83a 100644 --- a/partials/dialog.html +++ b/partials/dialog.html @@ -1,4 +1,4 @@ - + diff --git a/partials/im.html b/partials/im.html index a114a6d3..36f23b90 100644 --- a/partials/im.html +++ b/partials/im.html @@ -79,6 +79,7 @@
+ Forward Cancel

+ + + + + +

\ No newline at end of file diff --git a/partials/settings_modal.html b/partials/settings_modal.html index 435720b6..762b082c 100644 --- a/partials/settings_modal.html +++ b/partials/settings_modal.html @@ -7,7 +7,30 @@