|
|
@ -171,7 +171,7 @@ |
|
|
|
/*! MODIFICATION START |
|
|
|
/*! MODIFICATION START |
|
|
|
This function was added by Igor Zhukov to save recent used emojis. |
|
|
|
This function was added by Igor Zhukov to save recent used emojis. |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
util.emojiInserted = function (emojiKey, menu) { |
|
|
|
util.emojiInserted = function (emojiKey, menu, quickSelect) { |
|
|
|
ConfigStorage.get('emojis_recent', function (curEmojis) { |
|
|
|
ConfigStorage.get('emojis_recent', function (curEmojis) { |
|
|
|
curEmojis = curEmojis || []; |
|
|
|
curEmojis = curEmojis || []; |
|
|
|
|
|
|
|
|
|
|
@ -192,6 +192,10 @@ |
|
|
|
if (menu) { |
|
|
|
if (menu) { |
|
|
|
menu.updateRecentTab(curEmojis); |
|
|
|
menu.updateRecentTab(curEmojis); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (quickSelect) { |
|
|
|
|
|
|
|
quickSelect.load(0); |
|
|
|
|
|
|
|
} |
|
|
|
}) |
|
|
|
}) |
|
|
|
}; |
|
|
|
}; |
|
|
|
/*! MODIFICATION END */ |
|
|
|
/*! MODIFICATION END */ |
|
|
@ -207,6 +211,11 @@ |
|
|
|
this.$editor.on('blur', function() { self.hasFocus = false; }); |
|
|
|
this.$editor.on('blur', function() { self.hasFocus = false; }); |
|
|
|
|
|
|
|
|
|
|
|
this.setupButton(); |
|
|
|
this.setupButton(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (this.options.quickSelect) { |
|
|
|
|
|
|
|
var $items = $(this.options.quickSelect); |
|
|
|
|
|
|
|
this.quickSelect = new EmojiQuickSelectArea(self, $items); |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
EmojiArea.prototype.setupButton = function() { |
|
|
|
EmojiArea.prototype.setupButton = function() { |
|
|
@ -278,7 +287,7 @@ |
|
|
|
if (!$.emojiarea.icons.hasOwnProperty(emoji)) return; |
|
|
|
if (!$.emojiarea.icons.hasOwnProperty(emoji)) return; |
|
|
|
util.insertAtCursor(emoji, this.$textarea[0]); |
|
|
|
util.insertAtCursor(emoji, this.$textarea[0]); |
|
|
|
/* MODIFICATION: Following line was added by Igor Zhukov, in order to save recent emojis */ |
|
|
|
/* MODIFICATION: Following line was added by Igor Zhukov, in order to save recent emojis */ |
|
|
|
util.emojiInserted(emoji, this.menu); |
|
|
|
util.emojiInserted(emoji, this.menu, this.quickSelect); |
|
|
|
this.$textarea.trigger('change'); |
|
|
|
this.$textarea.trigger('change'); |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
@ -397,7 +406,7 @@ |
|
|
|
/*! MODIFICATION END */ |
|
|
|
/*! MODIFICATION END */ |
|
|
|
|
|
|
|
|
|
|
|
/* MODIFICATION: Following line was added by Igor Zhukov, in order to save recent emojis */ |
|
|
|
/* MODIFICATION: Following line was added by Igor Zhukov, in order to save recent emojis */ |
|
|
|
util.emojiInserted(emoji, this.menu); |
|
|
|
util.emojiInserted(emoji, this.menu, this.quickSelect); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.onChange(); |
|
|
|
this.onChange(); |
|
|
@ -611,7 +620,7 @@ |
|
|
|
var updateItems = function () { |
|
|
|
var updateItems = function () { |
|
|
|
self.$items.html(html.join('')); |
|
|
|
self.$items.html(html.join('')); |
|
|
|
|
|
|
|
|
|
|
|
if (!Config.Mobile) { |
|
|
|
if (!Config.Mobile && self.$itemsWrap) { |
|
|
|
setTimeout(function () { |
|
|
|
setTimeout(function () { |
|
|
|
self.$itemsWrap.nanoScroller(); |
|
|
|
self.$itemsWrap.nanoScroller(); |
|
|
|
}, 100); |
|
|
|
}, 100); |
|
|
@ -707,4 +716,21 @@ |
|
|
|
}; |
|
|
|
}; |
|
|
|
})(); |
|
|
|
})(); |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
var EmojiQuickSelectArea = function(emojiarea, $items) { |
|
|
|
|
|
|
|
var self = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.emojiarea = emojiarea; |
|
|
|
|
|
|
|
this.$items = $items; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
this.load(0); |
|
|
|
|
|
|
|
this.$items.on('click', 'a', function(e) { |
|
|
|
|
|
|
|
var emoji = $('.label', $(this)).text(); |
|
|
|
|
|
|
|
self.onItemSelected(emoji); |
|
|
|
|
|
|
|
e.stopPropagation(); |
|
|
|
|
|
|
|
return false; |
|
|
|
|
|
|
|
}); |
|
|
|
|
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
util.extend(EmojiQuickSelectArea.prototype, EmojiMenu.prototype); |
|
|
|
|
|
|
|
|
|
|
|
})(jQuery, window, document); |
|
|
|
})(jQuery, window, document); |