2022-10-09 11:34:57 +03:00
|
|
|
var tooltipTemplate = Handlebars.compile(`
|
|
|
|
<table>
|
|
|
|
<tr>
|
|
|
|
<td width="54" valign="top">
|
|
|
|
<img src="{{ava}}" width="54" />
|
|
|
|
</td>
|
|
|
|
<td width="1"></td>
|
|
|
|
<td width="150" valign="top">
|
|
|
|
<span>
|
|
|
|
<a href="{{url}}"><b>{{name}}</b></a>
|
|
|
|
{{#if verif}}
|
|
|
|
<img class="name-checkmark" src="/assets/packages/static/openvk/img/checkmark.png" />
|
|
|
|
{{/if}}
|
|
|
|
</span><br/>
|
2022-10-09 12:31:19 +03:00
|
|
|
<span style="color: #444;">{{online}}</span><br/>
|
|
|
|
<span style="color: #000;">{{about}}</span>
|
2022-10-09 11:34:57 +03:00
|
|
|
</td>
|
|
|
|
</tr>
|
|
|
|
</table>
|
|
|
|
`);
|
|
|
|
|
2024-11-22 16:31:07 +03:00
|
|
|
tippy.delegate("body", {
|
|
|
|
target: '.mention',
|
2022-10-09 11:34:57 +03:00
|
|
|
theme: "light vk",
|
|
|
|
content: "⌛",
|
|
|
|
allowHTML: true,
|
|
|
|
interactive: true,
|
|
|
|
interactiveDebounce: 500,
|
|
|
|
|
|
|
|
onCreate: async function(that) {
|
|
|
|
that._resolvedMention = null;
|
|
|
|
},
|
|
|
|
|
|
|
|
onShow: async function(that) {
|
|
|
|
if(!that._resolvedMention) {
|
|
|
|
let id = Number(that.reference.dataset.mentionRef);
|
|
|
|
that._resolvedMention = await API.Mentions.resolve(id);
|
|
|
|
}
|
|
|
|
|
|
|
|
let res = that._resolvedMention;
|
|
|
|
that.setContent(tooltipTemplate(res));
|
|
|
|
}
|
|
|
|
});
|