window.location.href = $(e.target).attr('href');
}
});
+
+ $('.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);
+ }
+ });
});
a {
color: $color4;
}
+
+ a.status__content__spoiler-link {
+ color: $color5;
+ background: $color3;
+
+ &:hover {
+ background: lighten($color3, 8%);
+ }
+ }
}
.status__attachments {
a {
color: $color4;
}
+
+ a.status__content__spoiler-link {
+ color: $color5;
+ background: $color3;
+
+ &:hover {
+ background: lighten($color3, 8%);
+ }
+ }
}
.detailed-status__meta {
.status__content.e-content.p-name.emojify<
- unless status.spoiler_text.blank?
- %p= status.spoiler_text
- %div{ style: "direction: #{rtl?(status.content) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status)
+ %p{ style: 'margin-bottom: 0' }<
+ %span>= "#{status.spoiler_text} "
+ %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more')
+ %div{ style: "display: #{status.spoiler_text.blank? ? 'block' : 'none'}; direction: #{rtl?(status.content) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status)
- unless status.media_attachments.empty?
- if status.media_attachments.first.video?
.status__content.e-content.p-name.emojify<
- unless status.spoiler_text.blank?
- %p= status.spoiler_text
- %div{ style: "direction: #{rtl?(status.content) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status)
+ %p{ style: 'margin-bottom: 0' }<
+ %span>= "#{status.spoiler_text} "
+ %a.status__content__spoiler-link{ href: '#' }= t('statuses.show_more')
+ %div{ style: "display: #{status.spoiler_text.blank? ? 'block' : 'none'}; direction: #{rtl?(status.content) ? 'rtl' : 'ltr'}" }= Formatter.instance.format(status)
- unless status.media_attachments.empty?
.status__attachments
statuses:
open_in_web: Open in web
over_character_limit: character limit of %{max} exceeded
+ show_more: Show more
visibilities:
private: Only show to followers
public: Public