2019-03-29 08:49:32 -07:00
|
|
|
<template>
|
2019-09-08 05:51:17 -07:00
|
|
|
<div class="emoji-picker panel panel-default panel-body">
|
|
|
|
<div class="heading">
|
2019-08-12 04:20:08 -07:00
|
|
|
<span class="emoji-tabs">
|
|
|
|
<span
|
2019-08-12 10:01:38 -07:00
|
|
|
v-for="group in emojis"
|
|
|
|
:key="group.id"
|
2019-08-12 04:20:08 -07:00
|
|
|
class="emoji-tabs-item"
|
2019-08-12 10:01:38 -07:00
|
|
|
:class="{
|
|
|
|
active: activeGroupView === group.id,
|
|
|
|
disabled: group.emojis.length === 0
|
|
|
|
}"
|
|
|
|
:title="group.text"
|
|
|
|
@click.prevent="highlight(group.id)"
|
2019-08-12 04:20:08 -07:00
|
|
|
>
|
2019-08-12 10:01:38 -07:00
|
|
|
<i :class="group.icon" />
|
2019-08-12 04:20:08 -07:00
|
|
|
</span>
|
|
|
|
</span>
|
2019-08-12 10:01:38 -07:00
|
|
|
<span
|
|
|
|
v-if="stickerPicker"
|
|
|
|
class="additional-tabs"
|
|
|
|
>
|
|
|
|
<span
|
|
|
|
class="stickers-tab-icon additional-tabs-item"
|
|
|
|
:class="{active: showingStickers}"
|
|
|
|
:title="$t('emoji.stickers')"
|
|
|
|
@click.prevent="toggleStickers"
|
|
|
|
>
|
|
|
|
<i class="icon-star" />
|
|
|
|
</span>
|
2019-07-28 14:10:43 -07:00
|
|
|
</span>
|
2019-07-28 06:07:01 -07:00
|
|
|
</div>
|
2019-09-08 05:51:17 -07:00
|
|
|
<div class="content">
|
2019-07-28 14:10:43 -07:00
|
|
|
<div
|
2019-08-12 04:20:08 -07:00
|
|
|
class="emoji-content"
|
2019-08-12 10:01:38 -07:00
|
|
|
:class="{hidden: showingStickers}"
|
2019-07-28 14:10:43 -07:00
|
|
|
>
|
2019-08-12 04:20:08 -07:00
|
|
|
<div class="emoji-search">
|
|
|
|
<input
|
|
|
|
v-model="keyword"
|
|
|
|
type="text"
|
|
|
|
class="form-control"
|
2019-08-12 10:01:38 -07:00
|
|
|
:placeholder="$t('emoji.search_emoji')"
|
2019-08-12 04:20:08 -07:00
|
|
|
>
|
|
|
|
</div>
|
2019-07-28 14:10:43 -07:00
|
|
|
<div
|
2019-08-12 04:20:08 -07:00
|
|
|
ref="emoji-groups"
|
|
|
|
class="emoji-groups"
|
|
|
|
@scroll="scrolledGroup"
|
2019-07-28 14:10:43 -07:00
|
|
|
>
|
2019-08-12 04:20:08 -07:00
|
|
|
<div
|
2019-08-12 10:01:38 -07:00
|
|
|
v-for="group in emojisView"
|
|
|
|
:key="group.id"
|
2019-08-12 04:20:08 -07:00
|
|
|
class="emoji-group"
|
2019-07-28 06:07:01 -07:00
|
|
|
>
|
2019-08-12 04:20:08 -07:00
|
|
|
<h6
|
2019-08-12 10:01:38 -07:00
|
|
|
:ref="'group-' + group.id"
|
2019-08-12 04:20:08 -07:00
|
|
|
class="emoji-group-title"
|
2019-07-28 14:10:43 -07:00
|
|
|
>
|
2019-08-12 10:01:38 -07:00
|
|
|
{{ group.text }}
|
2019-08-12 04:20:08 -07:00
|
|
|
</h6>
|
|
|
|
<span
|
2019-08-12 10:01:38 -07:00
|
|
|
v-for="emoji in group.emojis"
|
|
|
|
:key="group.id + emoji.displayText"
|
2019-08-12 04:20:08 -07:00
|
|
|
:title="emoji.displayText"
|
|
|
|
class="emoji-item"
|
2019-08-12 10:01:38 -07:00
|
|
|
@click.stop.prevent="onEmoji(emoji)"
|
2019-09-08 06:56:54 -07:00
|
|
|
@mouseenter="setZoomEmoji($event, emoji)"
|
|
|
|
@mouseleave="setZoomEmoji($event, false)"
|
|
|
|
>
|
|
|
|
<span v-if="!emoji.imageUrl">
|
|
|
|
{{ emoji.replacement }}
|
|
|
|
</span>
|
2019-08-12 04:20:08 -07:00
|
|
|
<img
|
|
|
|
v-else
|
|
|
|
:src="emoji.imageUrl"
|
2019-09-08 06:56:54 -07:00
|
|
|
>
|
2019-08-12 04:20:08 -07:00
|
|
|
</span>
|
|
|
|
</div>
|
2019-07-28 14:10:43 -07:00
|
|
|
</div>
|
2019-09-08 05:51:17 -07:00
|
|
|
<div
|
|
|
|
class="spam-mode"
|
|
|
|
>
|
|
|
|
<input
|
|
|
|
:id="labelKey + 'spam-mode'"
|
|
|
|
v-model="spamMode"
|
|
|
|
type="checkbox"
|
|
|
|
>
|
|
|
|
<label class="spam-mode-label" :for="labelKey + 'spam-mode'">{{ $t('emoji.spam') }}</label>
|
|
|
|
</div>
|
2019-03-29 09:48:52 -07:00
|
|
|
</div>
|
2019-08-12 10:01:38 -07:00
|
|
|
<div
|
|
|
|
v-if="showingStickers"
|
|
|
|
class="stickers-content"
|
|
|
|
>
|
|
|
|
<sticker-picker
|
|
|
|
@uploaded="onStickerUploaded"
|
|
|
|
@upload-failed="onStickerUploadFailed"
|
|
|
|
/>
|
2019-08-12 04:20:08 -07:00
|
|
|
</div>
|
2019-03-29 08:49:32 -07:00
|
|
|
</div>
|
2019-09-08 06:56:54 -07:00
|
|
|
<div ref="zoom-portal" class="zoom-portal">
|
|
|
|
<span v-if="zoomEmoji">
|
|
|
|
<span v-if="!zoomEmoji.imageUrl">
|
|
|
|
{{ zoomEmoji.replacement }}
|
|
|
|
</span>
|
|
|
|
<img
|
|
|
|
v-else
|
|
|
|
:key="zoomEmoji.imageUrl"
|
|
|
|
:src="zoomEmoji.imageUrl"
|
|
|
|
>
|
|
|
|
</span>
|
|
|
|
</div>
|
2019-08-12 10:01:38 -07:00
|
|
|
</div>
|
2019-03-29 08:49:32 -07:00
|
|
|
</template>
|
|
|
|
|
2019-08-12 03:18:37 -07:00
|
|
|
<script src="./emoji_picker.js"></script>
|
2019-08-12 04:20:08 -07:00
|
|
|
<style lang="scss" src="./emoji_picker.scss"></style>
|