Added stickers emoji to UI
This commit is contained in:
parent
85199e45a6
commit
b77ac43b76
@ -15,6 +15,7 @@
|
|||||||
var emojis = {};
|
var emojis = {};
|
||||||
var shortcuts = {};
|
var shortcuts = {};
|
||||||
var spritesheetPositions = {};
|
var spritesheetPositions = {};
|
||||||
|
var stickers = {};
|
||||||
var index = false;
|
var index = false;
|
||||||
|
|
||||||
var popular = 'joy,kissing_heart,heart,heart_eyes,blush,grin,+1,relaxed,pensive,smile,sob,kiss,unamused,flushed,stuck_out_tongue_winking_eye,see_no_evil,wink,smiley,cry,stuck_out_tongue_closed_eyes,scream,rage,smirk,disappointed,sweat_smile,kissing_closed_eyes,speak_no_evil,relieved,grinning,yum,laughing,ok_hand,neutral_face,confused'.split(',');
|
var popular = 'joy,kissing_heart,heart,heart_eyes,blush,grin,+1,relaxed,pensive,smile,sob,kiss,unamused,flushed,stuck_out_tongue_winking_eye,see_no_evil,wink,smiley,cry,stuck_out_tongue_closed_eyes,scream,rage,smirk,disappointed,sweat_smile,kissing_closed_eyes,speak_no_evil,relieved,grinning,yum,laughing,ok_hand,neutral_face,confused'.split(',');
|
||||||
@ -119,6 +120,7 @@
|
|||||||
emojis: emojis,
|
emojis: emojis,
|
||||||
shortcuts: shortcuts,
|
shortcuts: shortcuts,
|
||||||
spritesheetPositions: spritesheetPositions,
|
spritesheetPositions: spritesheetPositions,
|
||||||
|
stickers: stickers,
|
||||||
getPopularEmoji: getPopularEmoji,
|
getPopularEmoji: getPopularEmoji,
|
||||||
pushPopularEmoji: pushPopularEmoji,
|
pushPopularEmoji: pushPopularEmoji,
|
||||||
indexEmojis: indexEmojis,
|
indexEmojis: indexEmojis,
|
||||||
|
@ -1981,6 +1981,10 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
case 'messageMediaDocument':
|
case 'messageMediaDocument':
|
||||||
if (message.media.document.sticker) {
|
if (message.media.document.sticker) {
|
||||||
notificationMessage = _('conversation_media_sticker');
|
notificationMessage = _('conversation_media_sticker');
|
||||||
|
var stickerEmoji = EmojiHelper.stickers[message.media.document.id];
|
||||||
|
if (stickerEmoji !== undefined) {
|
||||||
|
notificationMessage = RichTextProcessor.wrapPlainText(stickerEmoji) + ' (' + notificationMessage + ')';
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
notificationMessage = message.media.document.file_name || _('conversation_media_document_raw');
|
notificationMessage = message.media.document.file_name || _('conversation_media_document_raw');
|
||||||
}
|
}
|
||||||
@ -2726,7 +2730,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
.service('AppDocsManager', function ($sce, $rootScope, $modal, $window, $q, MtpApiFileManager, FileManager) {
|
.service('AppDocsManager', function ($sce, $rootScope, $modal, $window, $q, RichTextProcessor, MtpApiFileManager, FileManager) {
|
||||||
var docs = {},
|
var docs = {},
|
||||||
docsForHistory = {},
|
docsForHistory = {},
|
||||||
windowW = $(window).width(),
|
windowW = $(window).width(),
|
||||||
@ -2753,7 +2757,12 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
apiDoc.duration = attribute.duration;
|
apiDoc.duration = attribute.duration;
|
||||||
break;
|
break;
|
||||||
case 'documentAttributeSticker':
|
case 'documentAttributeSticker':
|
||||||
apiDoc.sticker = true;
|
apiDoc.sticker = 1;
|
||||||
|
var stickerEmoji = EmojiHelper.stickers[apiDoc.id];
|
||||||
|
if (stickerEmoji !== undefined) {
|
||||||
|
apiDoc.sticker = 2;
|
||||||
|
apiDoc.stickerEmoji = RichTextProcessor.wrapRichText(stickerEmoji, {noLinks: true, noLinebreaks: true});
|
||||||
|
}
|
||||||
break;
|
break;
|
||||||
case 'documentAttributeImageSize':
|
case 'documentAttributeImageSize':
|
||||||
apiDoc.w = attribute.w;
|
apiDoc.w = attribute.w;
|
||||||
@ -3067,7 +3076,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
}
|
}
|
||||||
|
|
||||||
function getStickerEmoji(docID) {
|
function getStickerEmoji(docID) {
|
||||||
return stickersToEmoji[docID] || false;
|
return EmojiHelper.stickers[docID] || false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function processRawStickers(stickers) {
|
function processRawStickers(stickers) {
|
||||||
@ -3082,7 +3091,6 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
|
|
||||||
var pack, emoticon, docID;
|
var pack, emoticon, docID;
|
||||||
var doneDocIDs = {};
|
var doneDocIDs = {};
|
||||||
stickersToEmoji = {};
|
|
||||||
currentStickers = [];
|
currentStickers = [];
|
||||||
len1 = stickers.packs.length;
|
len1 = stickers.packs.length;
|
||||||
for (i = 0; i < len1; i++) {
|
for (i = 0; i < len1; i++) {
|
||||||
@ -3091,8 +3099,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
|
|||||||
len2 = pack.documents.length;
|
len2 = pack.documents.length;
|
||||||
for (j = 0; j < len2; j++) {
|
for (j = 0; j < len2; j++) {
|
||||||
docID = pack.documents[j];
|
docID = pack.documents[j];
|
||||||
if (stickersToEmoji[docID] === undefined) {
|
if (EmojiHelper.stickers[docID] === undefined) {
|
||||||
stickersToEmoji[docID] = emoticon;
|
EmojiHelper.stickers[docID] = emoticon;
|
||||||
}
|
}
|
||||||
if (doneDocIDs[docID] === undefined) {
|
if (doneDocIDs[docID] === undefined) {
|
||||||
doneDocIDs[docID] = true;
|
doneDocIDs[docID] = true;
|
||||||
|
@ -45,7 +45,11 @@
|
|||||||
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
|
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
|
||||||
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
|
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
|
||||||
<span ng-switch-when="messageMediaDocument" ng-switch="::dialogMessage.media.document.sticker || false">
|
<span ng-switch-when="messageMediaDocument" ng-switch="::dialogMessage.media.document.sticker || false">
|
||||||
<span ng-switch-when="true" my-i18n="conversation_media_sticker"></span>
|
<span ng-switch-when="1" my-i18n="conversation_media_sticker"></span>
|
||||||
|
<span ng-switch-when="2">
|
||||||
|
<span ng-bind-html="dialogMessage.media.document.stickerEmoji"></span>
|
||||||
|
(<my-i18n msgid="conversation_media_sticker"></my-i18n>)
|
||||||
|
</span>
|
||||||
<span ng-switch-default ng-bind="dialogMessage.media.document.file_name"></span>
|
<span ng-switch-default ng-bind="dialogMessage.media.document.file_name"></span>
|
||||||
</span>
|
</span>
|
||||||
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>
|
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>
|
||||||
|
@ -52,7 +52,11 @@
|
|||||||
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
|
<span ng-switch-when="messageMediaPhoto" my-i18n="conversation_media_photo"></span>
|
||||||
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
|
<span ng-switch-when="messageMediaVideo" my-i18n="conversation_media_video"></span>
|
||||||
<span ng-switch-when="messageMediaDocument" ng-switch="::dialogMessage.media.document.sticker || false">
|
<span ng-switch-when="messageMediaDocument" ng-switch="::dialogMessage.media.document.sticker || false">
|
||||||
<span ng-switch-when="true" my-i18n="conversation_media_sticker"></span>
|
<span ng-switch-when="1" my-i18n="conversation_media_sticker"></span>
|
||||||
|
<span ng-switch-when="2">
|
||||||
|
<span ng-bind-html="dialogMessage.media.document.stickerEmoji"></span>
|
||||||
|
(<my-i18n msgid="conversation_media_sticker"></my-i18n>)
|
||||||
|
</span>
|
||||||
<span ng-switch-default ng-bind="dialogMessage.media.document.file_name"></span>
|
<span ng-switch-default ng-bind="dialogMessage.media.document.file_name"></span>
|
||||||
</span>
|
</span>
|
||||||
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>
|
<span ng-switch-when="messageMediaAudio" my-i18n="conversation_media_audio"></span>
|
||||||
|
Loading…
Reference in New Issue
Block a user