2016-12-18 09:20:39 -05:00
|
|
|
import emojify from './components/emoji'
|
|
|
|
|
|
|
|
$(() => {
|
2017-01-09 22:40:45 -05:00
|
|
|
$.each($('.emojify'), (_, content) => {
|
2016-12-18 09:20:39 -05:00
|
|
|
const $content = $(content);
|
|
|
|
$content.html(emojify($content.html()));
|
|
|
|
});
|
2016-12-18 13:47:11 -05:00
|
|
|
|
|
|
|
$('.video-player video').on('click', e => {
|
|
|
|
if (e.target.paused) {
|
|
|
|
e.target.play();
|
|
|
|
} else {
|
|
|
|
e.target.pause();
|
|
|
|
}
|
|
|
|
});
|
|
|
|
|
|
|
|
$('.media-spoiler').on('click', e => {
|
|
|
|
$(e.target).hide();
|
|
|
|
});
|
2016-12-20 18:13:13 -05:00
|
|
|
|
|
|
|
$('.webapp-btn').on('click', e => {
|
|
|
|
if (e.button === 0) {
|
|
|
|
e.preventDefault();
|
|
|
|
window.location.href = $(e.target).attr('href');
|
|
|
|
}
|
|
|
|
});
|
2017-03-31 07:54:36 -04:00
|
|
|
|
|
|
|
$('.status__content__spoiler-link').on('click', e => {
|
|
|
|
e.preventDefault();
|
|
|
|
const contentEl = $(e.target).parent().parent().find('div');
|
|
|
|
|
|
|
|
if (contentEl.is(':visible')) {
|
|
|
|
contentEl.hide();
|
|
|
|
$(e.target).parent().attr('style', 'margin-bottom: 0');
|
|
|
|
} else {
|
|
|
|
contentEl.show();
|
|
|
|
$(e.target).parent().attr('style', null);
|
|
|
|
}
|
|
|
|
});
|
2017-04-21 12:17:21 -04:00
|
|
|
|
|
|
|
// used on /settings/profile
|
|
|
|
$('.account_display_name').on('input', e => {
|
|
|
|
$('.name-counter').text(30 - $(e.target).val().length)
|
|
|
|
});
|
|
|
|
$('.account_note').on('input', e => {
|
|
|
|
$('.note-counter').text(160 - $(e.target).val().length)
|
|
|
|
});
|
2016-12-18 09:20:39 -05:00
|
|
|
});
|