Browse Source

Improved quick emoji selector

master
Igor Zhukov 10 years ago
parent
commit
5548b86b45
  1. 1
      app/css/desktop.css
  2. 2
      app/js/lib/mtproto.js
  3. 5
      app/js/services.js
  4. 11
      app/vendor/jquery.emojiarea/jquery.emojiarea.js

1
app/css/desktop.css

@ -662,6 +662,7 @@ a.footer_link.active:active {
.im_emoji_quick_select_area a { .im_emoji_quick_select_area a {
display: inline-block; display: inline-block;
padding: 5px; padding: 5px;
outline: 0;
} }
.im_emoji_quick_select_area a:hover { .im_emoji_quick_select_area a:hover {

2
app/js/lib/mtproto.js

@ -12,7 +12,7 @@ angular.module('izhukov.mtproto', ['izhukov.utils'])
var dcOptions = Config.Modes.test var dcOptions = Config.Modes.test
? [ ? [
{id: 1, host: '173.240.5.253', port: 80}, {id: 1, host: '149.154.175.10', port: 80},
{id: 2, host: '149.154.167.40', port: 80}, {id: 2, host: '149.154.167.40', port: 80},
{id: 3, host: '174.140.142.5', port: 80} {id: 3, host: '174.140.142.5', port: 80}
] ]

5
app/js/services.js

@ -2719,7 +2719,7 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
var doc = angular.copy(docs[docID]), var doc = angular.copy(docs[docID]),
isGif = doc.mime_type == 'image/gif', isGif = doc.mime_type == 'image/gif',
isSticker = doc.mime_type == 'image/webp' || doc.mime_type.substr(0, 6) == 'image/' && doc.sticker, isSticker = doc.mime_type.substr(0, 6) == 'image/' && doc.sticker,
thumbPhotoSize = doc.thumb, thumbPhotoSize = doc.thumb,
width, height; width, height;
@ -2736,7 +2736,8 @@ angular.module('myApp.services', ['myApp.i18n', 'izhukov.utils'])
location: { location: {
_: 'inputDocumentFileLocation', _: 'inputDocumentFileLocation',
id: doc.id, id: doc.id,
access_hash: doc.access_hash access_hash: doc.access_hash,
dc_id: doc.dc_id
}, },
w: doc.w, w: doc.w,
h: doc.h, h: doc.h,

11
app/vendor/jquery.emojiarea/jquery.emojiarea.js vendored

@ -206,7 +206,7 @@
ConfigStorage.set({emojis_recent: curEmojis}); ConfigStorage.set({emojis_recent: curEmojis});
if (quickSelect) { if (quickSelect) {
quickSelect.load(0); quickSelect.changed = true;
} }
}) })
}; };
@ -709,17 +709,26 @@
var EmojiQuickSelectArea = function(emojiarea, $items) { var EmojiQuickSelectArea = function(emojiarea, $items) {
var self = this; var self = this;
var $body = $(document.body);
this.emojiarea = emojiarea; this.emojiarea = emojiarea;
this.changed = false;
this.$items = $items; this.$items = $items;
this.load(0); this.load(0);
this.$items.on('click', 'a', function(e) { this.$items.on('click', 'a', function(e) {
var emoji = $('.label', $(this)).text(); var emoji = $('.label', $(this)).text();
self.onItemSelected(emoji); self.onItemSelected(emoji);
self.changed = true;
e.stopPropagation(); e.stopPropagation();
return false; return false;
}); });
$body.on('message_send', function(e) {
if (self.changed) {
self.load(0);
self.changed = false;
}
});
}; };
util.extend(EmojiQuickSelectArea.prototype, EmojiMenu.prototype); util.extend(EmojiQuickSelectArea.prototype, EmojiMenu.prototype);

Loading…
Cancel
Save