[Glitch] Add setting to disable hover cards

Port ad52b04a1c to glitch-soc

Co-authored-by: Eugen Rochko <eugen@zeonfederated.com>
main
Claire 2024-07-11 21:42:58 +02:00
parent 55cf5e0188
commit 8d2a93b0cb
4 changed files with 6 additions and 3 deletions

View File

@ -181,7 +181,7 @@ class StatusContent extends PureComponent {
if (mention) { if (mention) {
link.addEventListener('click', this.onMentionClick.bind(this, mention), false); link.addEventListener('click', this.onMentionClick.bind(this, mention), false);
link.removeAttribute('title'); link.setAttribute('title', `@${mention.get('acct')}`);
link.setAttribute('data-hover-card-account', mention.get('id')); link.setAttribute('data-hover-card-account', mention.get('id'));
if (rewriteMentions !== 'no') { if (rewriteMentions !== 'no') {
while (link.firstChild) link.removeChild(link.firstChild); while (link.firstChild) link.removeChild(link.firstChild);

View File

@ -51,6 +51,7 @@ export default class StatusHeader extends PureComponent {
target='_blank' target='_blank'
onClick={this.handleAccountClick} onClick={this.handleAccountClick}
rel='noopener noreferrer' rel='noopener noreferrer'
title={status.getIn(['account', 'acct'])}
data-hover-card-account={status.getIn(['account', 'id'])} data-hover-card-account={status.getIn(['account', 'id'])}
> >
<div className='status__avatar'> <div className='status__avatar'>

View File

@ -27,7 +27,7 @@ import { clearHeight } from '../../actions/height_cache';
import { expandNotifications, notificationsSetVisibility } from '../../actions/notifications'; import { expandNotifications, notificationsSetVisibility } from '../../actions/notifications';
import { fetchServer, fetchServerTranslationLanguages } from '../../actions/server'; import { fetchServer, fetchServerTranslationLanguages } from '../../actions/server';
import { expandHomeTimeline } from '../../actions/timelines'; import { expandHomeTimeline } from '../../actions/timelines';
import initialState, { me, owner, singleUserMode, trendsEnabled, trendsAsLanding } from '../../initial_state'; import initialState, { me, owner, singleUserMode, trendsEnabled, trendsAsLanding, disableHoverCards } from '../../initial_state';
import BundleColumnError from './components/bundle_column_error'; import BundleColumnError from './components/bundle_column_error';
import Header from './components/header'; import Header from './components/header';
@ -651,7 +651,7 @@ class UI extends PureComponent {
{layout !== 'mobile' && <PictureInPicture />} {layout !== 'mobile' && <PictureInPicture />}
<NotificationsContainer /> <NotificationsContainer />
<HoverCardController /> {!disableHoverCards && <HoverCardController />}
<LoadingBarContainer className='loading-bar' /> <LoadingBarContainer className='loading-bar' />
<ModalContainer /> <ModalContainer />
<UploadArea active={draggingOver} onClose={this.closeUploadModal} /> <UploadArea active={draggingOver} onClose={this.closeUploadModal} />

View File

@ -17,6 +17,7 @@
* @property {boolean} crop_images * @property {boolean} crop_images
* @property {boolean=} delete_modal * @property {boolean=} delete_modal
* @property {boolean=} disable_swiping * @property {boolean=} disable_swiping
* @property {boolean=} disable_hover_cards
* @property {string=} disabled_account_id * @property {string=} disabled_account_id
* @property {string} display_media * @property {string} display_media
* @property {string} domain * @property {string} domain
@ -106,6 +107,7 @@ export const boostModal = getMeta('boost_modal');
export const cropImages = getMeta('crop_images'); export const cropImages = getMeta('crop_images');
export const deleteModal = getMeta('delete_modal'); export const deleteModal = getMeta('delete_modal');
export const disableSwiping = getMeta('disable_swiping'); export const disableSwiping = getMeta('disable_swiping');
export const disableHoverCards = getMeta('disable_hover_cards');
export const disabledAccountId = getMeta('disabled_account_id'); export const disabledAccountId = getMeta('disabled_account_id');
export const displayMedia = getMeta('display_media'); export const displayMedia = getMeta('display_media');
export const domain = getMeta('domain'); export const domain = getMeta('domain');