From 473fed2cdf67031f12cad7b2355cbafcd281022d Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 18 Jan 2023 16:28:18 +0100 Subject: [Glitch] Fix /api/v1/admin/trends/tags using wrong serializer Port b034dc42be2250f9b754fb88c9163b62d41f78f5 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/admin/Trends.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/components/admin/Trends.js b/app/javascript/flavours/glitch/components/admin/Trends.js index 4c17b69a0..774bf36e6 100644 --- a/app/javascript/flavours/glitch/components/admin/Trends.js +++ b/app/javascript/flavours/glitch/components/admin/Trends.js @@ -50,7 +50,7 @@ export default class Trends extends React.PureComponent { day.uses)} -- cgit From c87b1a20c750bb9166a5ede3ad9ab8d01f97913e Mon Sep 17 00:00:00 2001 From: Jeong Arm Date: Thu, 19 Jan 2023 00:29:07 +0900 Subject: [Glitch] Make visible change for new post notification setting icon Port 1b2ef60cec381e69384c208589c3dcf0ca2661db to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/account/components/header.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js index ec4a192bc..2f1800259 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.js +++ b/app/javascript/flavours/glitch/features/account/components/header.js @@ -188,7 +188,7 @@ class Header extends ImmutablePureComponent { } if (account.getIn(['relationship', 'requested']) || account.getIn(['relationship', 'following'])) { - bellBtn = ; + bellBtn = ; } if (me !== account.get('id')) { -- cgit From 9205b4e32f2fdeca8f3d8076f5e60542aed1665f Mon Sep 17 00:00:00 2001 From: Peter Simonsson Date: Wed, 18 Jan 2023 15:30:46 +0000 Subject: [Glitch] Add checkmark symbol to checkbox Port 7e6ffa085f97dc4688e2655fe2447743ab807e44 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/components/compose_form.scss | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/components/compose_form.scss b/app/javascript/flavours/glitch/styles/components/compose_form.scss index aa2d52ed0..40adf28c9 100644 --- a/app/javascript/flavours/glitch/styles/components/compose_form.scss +++ b/app/javascript/flavours/glitch/styles/components/compose_form.scss @@ -118,7 +118,7 @@ &.active { border-color: $highlight-text-color; - background: $highlight-text-color; + background: $highlight-text-color url("data:image/svg+xml;utf8,") center center no-repeat; } } } -- cgit From 9b4afb320a55761259a6e467cb1b4b6b5fb447f0 Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 18 Jan 2023 16:32:23 +0100 Subject: [Glitch] Change account moderation notes to make links clickable Port 9b3e22c40d5a24ddfa0df42d8fe6e96a273e8afd to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/admin.scss | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 8ddf815c3..9aa2318ce 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -1588,6 +1588,15 @@ a.sparkline { margin-bottom: 0; } } + + a { + color: $highlight-text-color; + text-decoration: none; + + &:hover { + text-decoration: underline; + } + } } &__actions { -- cgit From b5c6a116a765ba2d336ff1c3ec4acd66bb41a3fb Mon Sep 17 00:00:00 2001 From: Claire Date: Wed, 18 Jan 2023 16:33:55 +0100 Subject: [Glitch] Add support for editing media description and focus point of already-posted statuses Port 4b92e59f4fea4486ee6e5af7421e7945d5f7f998 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/actions/compose.js | 46 +++++++++++++++++++--- .../glitch/features/compose/components/upload.js | 8 ++-- .../features/ui/components/focal_point_modal.js | 2 +- app/javascript/flavours/glitch/reducers/compose.js | 2 +- 4 files changed, 46 insertions(+), 12 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 7a4af4cda..267cff563 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -181,6 +181,18 @@ export function submitCompose(routerHistory) { dispatch(submitComposeRequest()); + // If we're editing a post with media attachments, those have not + // necessarily been changed on the server. Do it now in the same + // API call. + let media_attributes; + if (statusId !== null) { + media_attributes = media.map(item => ({ + id: item.get('id'), + description: item.get('description'), + focus: item.get('focus'), + })); + } + api(getState).request({ url: statusId === null ? '/api/v1/statuses' : `/api/v1/statuses/${statusId}`, method: statusId === null ? 'post' : 'put', @@ -189,6 +201,7 @@ export function submitCompose(routerHistory) { content_type: getState().getIn(['compose', 'content_type']), in_reply_to_id: getState().getIn(['compose', 'in_reply_to'], null), media_ids: media.map(item => item.get('id')), + media_attributes, sensitive: getState().getIn(['compose', 'sensitive']) || (spoilerText.length > 0 && media.size !== 0), spoiler_text: spoilerText, visibility: getState().getIn(['compose', 'privacy']), @@ -415,11 +428,31 @@ export function changeUploadCompose(id, params) { return (dispatch, getState) => { dispatch(changeUploadComposeRequest()); - api(getState).put(`/api/v1/media/${id}`, params).then(response => { - dispatch(changeUploadComposeSuccess(response.data)); - }).catch(error => { - dispatch(changeUploadComposeFail(id, error)); - }); + let media = getState().getIn(['compose', 'media_attachments']).find((item) => item.get('id') === id); + + // Editing already-attached media is deferred to editing the post itself. + // For simplicity's sake, fake an API reply. + if (media && !media.get('unattached')) { + let { description, focus } = params; + const data = media.toJS(); + + if (description) { + data.description = description; + } + + if (focus) { + focus = focus.split(','); + data.meta = { focus: { x: parseFloat(focus[0]), y: parseFloat(focus[1]) } }; + } + + dispatch(changeUploadComposeSuccess(data, true)); + } else { + api(getState).put(`/api/v1/media/${id}`, params).then(response => { + dispatch(changeUploadComposeSuccess(response.data, false)); + }).catch(error => { + dispatch(changeUploadComposeFail(id, error)); + }); + } }; }; @@ -430,10 +463,11 @@ export function changeUploadComposeRequest() { }; }; -export function changeUploadComposeSuccess(media) { +export function changeUploadComposeSuccess(media, attached) { return { type: COMPOSE_UPLOAD_CHANGE_SUCCESS, media: media, + attached: attached, skipLoading: true, }; }; diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.js b/app/javascript/flavours/glitch/features/compose/components/upload.js index 6528bbc84..cd4524540 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload.js @@ -43,13 +43,13 @@ export default class Upload extends ImmutablePureComponent { {({ scale }) => (
- - {!!media.get('unattached') && ()} + +
- {(media.get('description') || '').length === 0 && !!media.get('unattached') && ( + {(media.get('description') || '').length === 0 && (
- +
)}
diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js index 0dd07fb76..fb432cf9c 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js @@ -320,7 +320,7 @@ class FocalPointModal extends ImmutablePureComponent { - ); - } + }; render () { const { timestamp, intl, statusId } = this.props; diff --git a/app/javascript/flavours/glitch/components/error_boundary.js b/app/javascript/flavours/glitch/components/error_boundary.js index e0ca3e2b0..8518dfc86 100644 --- a/app/javascript/flavours/glitch/components/error_boundary.js +++ b/app/javascript/flavours/glitch/components/error_boundary.js @@ -18,7 +18,7 @@ export default class ErrorBoundary extends React.PureComponent { stackTrace: undefined, mappedStackTrace: undefined, componentStack: undefined, - } + }; componentDidCatch(error, info) { this.setState({ diff --git a/app/javascript/flavours/glitch/components/gifv.js b/app/javascript/flavours/glitch/components/gifv.js index b775e5200..1f0f99b46 100644 --- a/app/javascript/flavours/glitch/components/gifv.js +++ b/app/javascript/flavours/glitch/components/gifv.js @@ -17,7 +17,7 @@ export default class GIFV extends React.PureComponent { handleLoadedData = () => { this.setState({ loading: false }); - } + }; componentWillReceiveProps (nextProps) { if (nextProps.src !== this.props.src) { @@ -32,7 +32,7 @@ export default class GIFV extends React.PureComponent { e.stopPropagation(); onClick(); } - } + }; render () { const { src, width, height, alt } = this.props; diff --git a/app/javascript/flavours/glitch/components/icon_button.js b/app/javascript/flavours/glitch/components/icon_button.js index 2485f0f48..10d7926be 100644 --- a/app/javascript/flavours/glitch/components/icon_button.js +++ b/app/javascript/flavours/glitch/components/icon_button.js @@ -46,7 +46,7 @@ export default class IconButton extends React.PureComponent { state = { activate: false, deactivate: false, - } + }; componentWillReceiveProps (nextProps) { if (!nextProps.animate) return; @@ -64,25 +64,25 @@ export default class IconButton extends React.PureComponent { if (!this.props.disabled) { this.props.onClick(e); } - } + }; handleKeyPress = (e) => { if (this.props.onKeyPress && !this.props.disabled) { this.props.onKeyPress(e); } - } + }; handleMouseDown = (e) => { if (!this.props.disabled && this.props.onMouseDown) { this.props.onMouseDown(e); } - } + }; handleKeyDown = (e) => { if (!this.props.disabled && this.props.onKeyDown) { this.props.onKeyDown(e); } - } + }; render () { // Hack required for some icons which have an overriden size diff --git a/app/javascript/flavours/glitch/components/intersection_observer_article.js b/app/javascript/flavours/glitch/components/intersection_observer_article.js index b28e44e4c..77cd66358 100644 --- a/app/javascript/flavours/glitch/components/intersection_observer_article.js +++ b/app/javascript/flavours/glitch/components/intersection_observer_article.js @@ -21,7 +21,7 @@ export default class IntersectionObserverArticle extends React.Component { state = { isHidden: false, // set to true in requestIdleCallback to trigger un-render - } + }; shouldComponentUpdate (nextProps, nextState) { const isUnrendered = !this.state.isIntersecting && (this.state.isHidden || this.props.cachedHeight); @@ -63,7 +63,7 @@ export default class IntersectionObserverArticle extends React.Component { scheduleIdleTask(this.calculateHeight); this.setState(this.updateStateAfterIntersection); - } + }; updateStateAfterIntersection = (prevState) => { if (prevState.isIntersecting !== false && !this.entry.isIntersecting) { @@ -73,7 +73,7 @@ export default class IntersectionObserverArticle extends React.Component { isIntersecting: this.entry.isIntersecting, isHidden: false, }; - } + }; calculateHeight = () => { const { onHeightChange, saveHeightKey, id } = this.props; @@ -84,7 +84,7 @@ export default class IntersectionObserverArticle extends React.Component { if (onHeightChange && saveHeightKey) { onHeightChange(saveHeightKey, id, this.height); } - } + }; hideIfNotIntersecting = () => { if (!this.componentMounted) { @@ -96,11 +96,11 @@ export default class IntersectionObserverArticle extends React.Component { // this is to save DOM nodes and avoid using up too much memory. // See: https://github.com/mastodon/mastodon/issues/2900 this.setState((prevState) => ({ isHidden: !prevState.isIntersecting })); - } + }; handleRef = (node) => { this.node = node; - } + }; render () { const { children, id, index, listLength, cachedHeight } = this.props; @@ -121,8 +121,9 @@ export default class IntersectionObserverArticle extends React.Component { aria-setsize={listLength} data-id={id} tabIndex='0' - style={style}> - {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} + style={style} + > + {children && React.cloneElement(children, { hidden: !isIntersecting && (isHidden || !!cachedHeight) })} ); } diff --git a/app/javascript/flavours/glitch/components/load_gap.js b/app/javascript/flavours/glitch/components/load_gap.js index fe3f60a58..6ed9a38c6 100644 --- a/app/javascript/flavours/glitch/components/load_gap.js +++ b/app/javascript/flavours/glitch/components/load_gap.js @@ -19,7 +19,7 @@ class LoadGap extends React.PureComponent { handleClick = () => { this.props.onClick(this.props.maxId); - } + }; render () { const { disabled, intl } = this.props; diff --git a/app/javascript/flavours/glitch/components/load_more.js b/app/javascript/flavours/glitch/components/load_more.js index 389c3e1e1..ab9428e35 100644 --- a/app/javascript/flavours/glitch/components/load_more.js +++ b/app/javascript/flavours/glitch/components/load_more.js @@ -8,11 +8,11 @@ export default class LoadMore extends React.PureComponent { onClick: PropTypes.func, disabled: PropTypes.bool, visible: PropTypes.bool, - } + }; static defaultProps = { visible: true, - } + }; render() { const { disabled, visible } = this.props; diff --git a/app/javascript/flavours/glitch/components/load_pending.js b/app/javascript/flavours/glitch/components/load_pending.js index 7e2702403..a75259146 100644 --- a/app/javascript/flavours/glitch/components/load_pending.js +++ b/app/javascript/flavours/glitch/components/load_pending.js @@ -7,7 +7,7 @@ export default class LoadPending extends React.PureComponent { static propTypes = { onClick: PropTypes.func, count: PropTypes.number, - } + }; render() { const { count } = this.props; diff --git a/app/javascript/flavours/glitch/components/media_attachments.js b/app/javascript/flavours/glitch/components/media_attachments.js index a517fcf30..33f01bb5a 100644 --- a/app/javascript/flavours/glitch/components/media_attachments.js +++ b/app/javascript/flavours/glitch/components/media_attachments.js @@ -30,7 +30,7 @@ export default class MediaAttachments extends ImmutablePureComponent { return (
); - } + }; renderLoadingVideoPlayer = () => { const { height, width } = this.props; @@ -38,7 +38,7 @@ export default class MediaAttachments extends ImmutablePureComponent { return (
); - } + }; renderLoadingAudioPlayer = () => { const { height, width } = this.props; @@ -46,7 +46,7 @@ export default class MediaAttachments extends ImmutablePureComponent { return (
); - } + }; render () { const { status, width, height, revealed } = this.props; diff --git a/app/javascript/flavours/glitch/components/media_gallery.js b/app/javascript/flavours/glitch/components/media_gallery.js index 23e279589..c11ac46c2 100644 --- a/app/javascript/flavours/glitch/components/media_gallery.js +++ b/app/javascript/flavours/glitch/components/media_gallery.js @@ -60,14 +60,14 @@ class Item extends React.PureComponent { if (this.hoverToPlay()) { e.target.play(); } - } + }; handleMouseLeave = (e) => { if (this.hoverToPlay()) { e.target.pause(); e.target.currentTime = 0; } - } + }; getAutoPlay() { return this.props.autoplay || autoPlayGif; @@ -91,11 +91,11 @@ class Item extends React.PureComponent { } e.stopPropagation(); - } + }; handleImageLoad = () => { this.setState({ loaded: true }); - } + }; render () { const { attachment, index, size, standalone, letterbox, displayWidth, visible } = this.props; @@ -307,11 +307,11 @@ class MediaGallery extends React.PureComponent { } else { this.setState({ visible: !this.state.visible }); } - } + }; handleClick = (index) => { this.props.onOpenMedia(this.props.media, index); - } + }; handleRef = (node) => { this.node = node; @@ -319,11 +319,11 @@ class MediaGallery extends React.PureComponent { if (this.node) { this._setDimensions(); } - } + }; _setDimensions () { const width = this.node.offsetWidth; - + if (width && width != this.state.width) { // offsetWidth triggers a layout, so only calculate when we need to if (this.props.cacheWidth) { @@ -360,7 +360,7 @@ class MediaGallery extends React.PureComponent { } else if (width) { style.height = width / (16/9); } else { - return (
); + return (
); } if (this.isStandaloneEligible()) { diff --git a/app/javascript/flavours/glitch/components/modal_root.js b/app/javascript/flavours/glitch/components/modal_root.js index 056277447..5a5563e87 100644 --- a/app/javascript/flavours/glitch/components/modal_root.js +++ b/app/javascript/flavours/glitch/components/modal_root.js @@ -5,6 +5,7 @@ import { createBrowserHistory } from 'history'; import { multiply } from 'color-blend'; export default class ModalRoot extends React.PureComponent { + static contextTypes = { router: PropTypes.object, }; @@ -28,7 +29,7 @@ export default class ModalRoot extends React.PureComponent { && !!this.props.children && !this.props.noEsc) { this.props.onClose(); } - } + }; handleKeyDown = (e) => { if (e.key === 'Tab') { @@ -49,7 +50,7 @@ export default class ModalRoot extends React.PureComponent { e.preventDefault(); } } - } + }; componentDidMount () { window.addEventListener('keyup', this.handleKeyUp, false); @@ -125,11 +126,11 @@ export default class ModalRoot extends React.PureComponent { getSiblings = () => { return Array(...this.node.parentElement.childNodes).filter(node => node !== this.node); - } + }; setRef = ref => { this.node = ref; - } + }; render () { const { children, onClose } = this.props; diff --git a/app/javascript/flavours/glitch/components/permalink.js b/app/javascript/flavours/glitch/components/permalink.js index 718b02115..b09b17eeb 100644 --- a/app/javascript/flavours/glitch/components/permalink.js +++ b/app/javascript/flavours/glitch/components/permalink.js @@ -24,12 +24,12 @@ export default class Permalink extends React.PureComponent { if (this.context.router) { e.preventDefault(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(this.props.to, state); } } - } + }; render () { const { diff --git a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js index 01dce0a38..8bfdf343c 100644 --- a/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js +++ b/app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js @@ -22,7 +22,7 @@ class PictureInPicturePlaceholder extends React.PureComponent { handleClick = () => { const { dispatch } = this.props; dispatch(removePictureInPicture()); - } + }; setRef = c => { this.node = c; @@ -30,7 +30,7 @@ class PictureInPicturePlaceholder extends React.PureComponent { if (this.node) { this._setDimensions(); } - } + }; _setDimensions () { const width = this.node.offsetWidth; diff --git a/app/javascript/flavours/glitch/components/poll.js b/app/javascript/flavours/glitch/components/poll.js index da65cd241..53ece560e 100644 --- a/app/javascript/flavours/glitch/components/poll.js +++ b/app/javascript/flavours/glitch/components/poll.js @@ -95,7 +95,7 @@ class Poll extends ImmutablePureComponent { tmp[value] = true; this.setState({ selected: tmp }); } - } + }; handleOptionChange = ({ target: { value } }) => { this._toggleOption(value); @@ -107,7 +107,7 @@ class Poll extends ImmutablePureComponent { e.stopPropagation(); e.preventDefault(); } - } + }; handleVote = () => { if (this.props.disabled) { diff --git a/app/javascript/flavours/glitch/components/scrollable_list.js b/app/javascript/flavours/glitch/components/scrollable_list.js index 8eb2b66d4..ae1ba3037 100644 --- a/app/javascript/flavours/glitch/components/scrollable_list.js +++ b/app/javascript/flavours/glitch/components/scrollable_list.js @@ -137,7 +137,7 @@ class ScrollableList extends PureComponent { } this.mouseMovedRecently = false; this.scrollToTopOnMouseIdle = false; - } + }; componentDidMount () { this.attachScrollListener(); @@ -154,29 +154,29 @@ class ScrollableList extends PureComponent { } else { return null; } - } + }; getScrollTop = () => { return this.props.bindToDocument ? document.scrollingElement.scrollTop : this.node.scrollTop; - } + }; getScrollHeight = () => { return this.props.bindToDocument ? document.scrollingElement.scrollHeight : this.node.scrollHeight; - } + }; getClientHeight = () => { return this.props.bindToDocument ? document.scrollingElement.clientHeight : this.node.clientHeight; - } + }; updateScrollBottom = (snapshot) => { const newScrollTop = this.getScrollHeight() - snapshot; this.setScrollTop(newScrollTop); - } + }; cacheMediaWidth = (width) => { if (width && this.state.cachedMediaWidth != width) this.setState({ cachedMediaWidth: width }); - } + }; getSnapshotBeforeUpdate (prevProps, prevState) { const someItemInserted = React.Children.count(prevProps.children) > 0 && @@ -208,7 +208,7 @@ class ScrollableList extends PureComponent { onFullScreenChange = () => { this.setState({ fullscreen: isFullscreen() }); - } + }; attachIntersectionObserver () { this.intersectionObserverWrapper.connect({ @@ -256,12 +256,12 @@ class ScrollableList extends PureComponent { setRef = (c) => { this.node = c; - } + }; handleLoadMore = e => { e.preventDefault(); this.props.onLoadMore(); - } + }; handleLoadPending = e => { e.preventDefault(); @@ -273,7 +273,7 @@ class ScrollableList extends PureComponent { this.clearMouseIdleTimer(); this.mouseIdleTimer = setTimeout(this.handleMouseIdle, MOUSE_IDLE_DELAY); this.mouseMovedRecently = true; - } + }; render () { const { children, scrollKey, trackScroll, showLoading, isLoading, hasMore, numPending, prepend, alwaysPrepend, append, emptyMessage, onLoadMore } = this.props; diff --git a/app/javascript/flavours/glitch/components/setting_text.js b/app/javascript/flavours/glitch/components/setting_text.js index 2c1b70bc3..3a21a0601 100644 --- a/app/javascript/flavours/glitch/components/setting_text.js +++ b/app/javascript/flavours/glitch/components/setting_text.js @@ -13,7 +13,7 @@ export default class SettingText extends React.PureComponent { handleChange = (e) => { this.props.onChange(this.props.settingPath, e.target.value); - } + }; render () { const { settings, settingPath, label } = this.props; diff --git a/app/javascript/flavours/glitch/components/spoilers.js b/app/javascript/flavours/glitch/components/spoilers.js index 8527403c1..75e4ec3a1 100644 --- a/app/javascript/flavours/glitch/components/spoilers.js +++ b/app/javascript/flavours/glitch/components/spoilers.js @@ -4,6 +4,7 @@ import { FormattedMessage } from 'react-intl'; export default class Spoilers extends React.PureComponent { + static propTypes = { spoilerText: PropTypes.string, children: PropTypes.node, @@ -11,27 +12,27 @@ class Spoilers extends React.PureComponent { state = { hidden: true, - } + }; handleSpoilerClick = () => { this.setState({ hidden: !this.state.hidden }); - } + }; render () { const { spoilerText, children } = this.props; const { hidden } = this.state; - const toggleText = hidden ? - : - ; + const toggleText = hidden ? + () : + (); return ([

@@ -43,8 +44,9 @@ class Spoilers extends React.PureComponent {

,
{children} -
+
, ]); } + } diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index cbd8eb31c..34880efe4 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -54,7 +54,7 @@ export const defaultMediaVisibility = (status, settings) => { } return (displayMedia !== 'hide_all' && !status.get('sensitive') || displayMedia === 'show_all'); -} +}; export default @injectIntl class Status extends ImmutablePureComponent { @@ -117,7 +117,7 @@ class Status extends ImmutablePureComponent { revealBehindCW: undefined, showCard: false, forceFilter: undefined, - } + }; // Avoid checking props that are functions (and whose equality will always // evaluate to false. See react-immutable-pure-component for usage. @@ -132,14 +132,14 @@ class Status extends ImmutablePureComponent { 'expanded', 'unread', 'pictureInPicture', - ] + ]; updateOnStates = [ 'isExpanded', 'isCollapsed', 'showMedia', 'forceFilter', - ] + ]; // If our settings have changed to disable collapsed statuses, then we // need to make sure that we uncollapse every one. We do that by watching @@ -302,7 +302,9 @@ class Status extends ImmutablePureComponent { if (this.node && this.props.getScrollPosition) { const position = this.props.getScrollPosition(); if (position !== null && this.node.offsetTop < position.top) { - requestAnimationFrame(() => { this.props.updateScrollBottom(position.height - position.top); }); + requestAnimationFrame(() => { + this.props.updateScrollBottom(position.height - position.top); + }); } } } @@ -321,7 +323,7 @@ class Status extends ImmutablePureComponent { } else { this.setState({ isCollapsed: false }); } - } + }; setExpansion = (value) => { if (this.props.settings.getIn(['content_warnings', 'shared_state']) && this.props.status.get('hidden') === value) { @@ -332,7 +334,7 @@ class Status extends ImmutablePureComponent { if (value) { this.setCollapsed(false); } - } + }; // `parseClick()` takes a click event and responds appropriately. // If our status is collapsed, then clicking on it should uncollapse it. @@ -361,17 +363,17 @@ class Status extends ImmutablePureComponent { status.getIn(['reblog', 'id'], status.get('id')) }`; } - let state = {...router.history.location.state}; + let state = { ...router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; router.history.push(destination, state); } e.preventDefault(); } - } + }; handleToggleMediaVisibility = () => { this.setState({ showMedia: !this.state.showMedia }); - } + }; handleExpandedToggle = () => { if (this.props.settings.getIn(['content_warnings', 'shared_state'])) { @@ -384,11 +386,11 @@ class Status extends ImmutablePureComponent { handleOpenVideo = (options) => { const { status } = this.props; this.props.onOpenVideo(status.get('id'), status.getIn(['media_attachments', 0]), options); - } + }; handleOpenMedia = (media, index) => { this.props.onOpenMedia(this.props.status.get('id'), media, index); - } + }; handleHotkeyOpenMedia = e => { const { status, onOpenMedia, onOpenVideo } = this.props; @@ -403,84 +405,84 @@ class Status extends ImmutablePureComponent { onOpenMedia(statusId, status.get('media_attachments'), 0); } } - } + }; handleDeployPictureInPicture = (type, mediaProps) => { const { deployPictureInPicture, status } = this.props; deployPictureInPicture(status, type, mediaProps); - } + }; handleHotkeyReply = e => { e.preventDefault(); this.props.onReply(this.props.status, this.context.router.history); - } + }; handleHotkeyFavourite = (e) => { this.props.onFavourite(this.props.status, e); - } + }; handleHotkeyBoost = e => { this.props.onReblog(this.props.status, e); - } + }; handleHotkeyBookmark = e => { this.props.onBookmark(this.props.status, e); - } + }; handleHotkeyMention = e => { e.preventDefault(); this.props.onMention(this.props.status.get('account'), this.context.router.history); - } + }; handleHotkeyOpen = () => { - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; const status = this.props.status; this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`, state); - } + }; handleHotkeyOpenProfile = () => { - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); - } + }; handleHotkeyMoveUp = e => { this.props.onMoveUp(this.props.containerId || this.props.id, e.target.getAttribute('data-featured')); - } + }; handleHotkeyMoveDown = e => { this.props.onMoveDown(this.props.containerId || this.props.id, e.target.getAttribute('data-featured')); - } + }; handleHotkeyCollapse = e => { if (!this.props.settings.getIn(['collapsed', 'enabled'])) return; this.setCollapsed(!this.state.isCollapsed); - } + }; handleHotkeyToggleSensitive = () => { this.handleToggleMediaVisibility(); - } + }; handleUnfilterClick = e => { this.setState({ forceFilter: false }); e.preventDefault(); - } + }; handleFilterClick = () => { this.setState({ forceFilter: true }); - } + }; handleRef = c => { this.node = c; - } + }; handleTranslate = () => { this.props.onTranslate(this.props.status); - } + }; renderLoadingMediaGallery () { return
; diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js index baf61000a..02c5442b5 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.js +++ b/app/javascript/flavours/glitch/components/status_action_bar.js @@ -86,7 +86,7 @@ class StatusActionBar extends ImmutablePureComponent { 'showReplyCount', 'withCounters', 'withDismiss', - ] + ]; handleReplyClick = () => { const { signedIn } = this.context.identity; @@ -96,14 +96,14 @@ class StatusActionBar extends ImmutablePureComponent { } else { this.props.onInteractionModal('reply', this.props.status); } - } + }; handleShareClick = () => { navigator.share({ text: this.props.status.get('search_index'), url: this.props.status.get('url'), }); - } + }; handleFavouriteClick = (e) => { const { signedIn } = this.context.identity; @@ -113,7 +113,7 @@ class StatusActionBar extends ImmutablePureComponent { } else { this.props.onInteractionModal('favourite', this.props.status); } - } + }; handleReblogClick = e => { const { signedIn } = this.context.identity; @@ -123,78 +123,78 @@ class StatusActionBar extends ImmutablePureComponent { } else { this.props.onInteractionModal('reblog', this.props.status); } - } + }; handleBookmarkClick = (e) => { this.props.onBookmark(this.props.status, e); - } + }; handleDeleteClick = () => { this.props.onDelete(this.props.status, this.context.router.history); - } + }; handleRedraftClick = () => { this.props.onDelete(this.props.status, this.context.router.history, true); - } + }; handleEditClick = () => { this.props.onEdit(this.props.status, this.context.router.history); - } + }; handlePinClick = () => { this.props.onPin(this.props.status); - } + }; handleMentionClick = () => { this.props.onMention(this.props.status.get('account'), this.context.router.history); - } + }; handleDirectClick = () => { this.props.onDirect(this.props.status.get('account'), this.context.router.history); - } + }; handleMuteClick = () => { this.props.onMute(this.props.status.get('account')); - } + }; handleBlockClick = () => { this.props.onBlock(this.props.status); - } + }; handleOpen = () => { - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; if (state.mastodonModalKey) { this.context.router.history.replace(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`, { mastodonBackSteps: (state.mastodonBackSteps || 0) + 1 }); } else { state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}/${this.props.status.get('id')}`, state); } - } + }; handleEmbed = () => { this.props.onEmbed(this.props.status); - } + }; handleReport = () => { this.props.onReport(this.props.status); - } + }; handleConversationMuteClick = () => { this.props.onMuteConversation(this.props.status); - } + }; handleCopy = () => { const url = this.props.status.get('url'); navigator.clipboard.writeText(url); - } + }; handleHideClick = () => { this.props.onFilter(); - } + }; handleFilterClick = () => { this.props.onAddFilter(this.props.status); - } + }; render () { const { status, intl, withDismiss, withCounters, showReplyCount, scrollKey } = this.props; diff --git a/app/javascript/flavours/glitch/components/status_content.js b/app/javascript/flavours/glitch/components/status_content.js index c59f42220..790a5c659 100644 --- a/app/javascript/flavours/glitch/components/status_content.js +++ b/app/javascript/flavours/glitch/components/status_content.js @@ -12,7 +12,7 @@ const textMatchesTarget = (text, origin, host) => { return (text === origin || text === host || text.startsWith(origin + '/') || text.startsWith(host + '/') || 'www.' + text === host || ('www.' + text).startsWith(host + '/')); -} +}; const isLinkMisleading = (link) => { let linkTextParts = []; @@ -168,8 +168,8 @@ class StatusContent extends React.PureComponent { link.setAttribute('title', link.href); link.classList.add('unhandled-link'); - link.setAttribute('target', '_blank'); - link.setAttribute('rel', 'noopener nofollow noreferrer'); + link.setAttribute('target', '_blank'); + link.setAttribute('rel', 'noopener nofollow noreferrer'); try { if (tagLinks && isLinkMisleading(link)) { @@ -210,7 +210,7 @@ class StatusContent extends React.PureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -223,7 +223,7 @@ class StatusContent extends React.PureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; componentDidMount () { this._updateStatusLinks(); @@ -238,13 +238,13 @@ class StatusContent extends React.PureComponent { if (this.props.collapsed) { if (this.props.parseClick) this.props.parseClick(e); } - } + }; onMentionClick = (mention, e) => { if (this.props.parseClick) { this.props.parseClick(e, `/@${mention.get('acct')}`); } - } + }; onHashtagClick = (hashtag, e) => { hashtag = hashtag.replace(/^#/, ''); @@ -252,11 +252,11 @@ class StatusContent extends React.PureComponent { if (this.props.parseClick) { this.props.parseClick(e, `/tags/${hashtag}`); } - } + }; handleMouseDown = (e) => { this.startXY = [e.clientX, e.clientY]; - } + }; handleMouseUp = (e) => { const { parseClick, disabled } = this.props; @@ -281,7 +281,7 @@ class StatusContent extends React.PureComponent { } this.startXY = null; - } + }; handleSpoilerClick = (e) => { e.preventDefault(); @@ -291,15 +291,15 @@ class StatusContent extends React.PureComponent { } else { this.setState({ hidden: !this.state.hidden }); } - } + }; handleTranslate = () => { this.props.onTranslate(); - } + }; setContentsRef = (c) => { this.contentsNode = c; - } + }; render () { const { diff --git a/app/javascript/flavours/glitch/components/status_header.js b/app/javascript/flavours/glitch/components/status_header.js index 990dea536..21d8b4212 100644 --- a/app/javascript/flavours/glitch/components/status_header.js +++ b/app/javascript/flavours/glitch/components/status_header.js @@ -21,12 +21,12 @@ export default class StatusHeader extends React.PureComponent { handleClick = (acct, e) => { const { parseClick } = this.props; parseClick(e, `/@${acct}`); - } + }; handleAccountClick = (e) => { const { status } = this.props; this.handleClick(status.getIn(['account', 'acct']), e); - } + }; // Rendering. render () { diff --git a/app/javascript/flavours/glitch/components/status_icons.js b/app/javascript/flavours/glitch/components/status_icons.js index 71ffb2e56..c4cb42741 100644 --- a/app/javascript/flavours/glitch/components/status_icons.js +++ b/app/javascript/flavours/glitch/components/status_icons.js @@ -60,22 +60,22 @@ class StatusIcons extends React.PureComponent { setCollapsed(!collapsed); e.preventDefault(); } - } + }; mediaIconTitleText (mediaIcon) { const { intl } = this.props; switch (mediaIcon) { - case 'link': - return intl.formatMessage(messages.previewCard); - case 'picture-o': - return intl.formatMessage(messages.pictures); - case 'tasks': - return intl.formatMessage(messages.poll); - case 'video-camera': - return intl.formatMessage(messages.video); - case 'music': - return intl.formatMessage(messages.audio); + case 'link': + return intl.formatMessage(messages.previewCard); + case 'picture-o': + return intl.formatMessage(messages.pictures); + case 'tasks': + return intl.formatMessage(messages.poll); + case 'video-camera': + return intl.formatMessage(messages.video); + case 'music': + return intl.formatMessage(messages.audio); } } diff --git a/app/javascript/flavours/glitch/components/status_list.js b/app/javascript/flavours/glitch/components/status_list.js index 0d843a27d..a9c06f693 100644 --- a/app/javascript/flavours/glitch/components/status_list.js +++ b/app/javascript/flavours/glitch/components/status_list.js @@ -35,7 +35,7 @@ export default class StatusList extends ImmutablePureComponent { getFeaturedStatusCount = () => { return this.props.featuredStatusIds ? this.props.featuredStatusIds.size : 0; - } + }; getCurrentStatusIndex = (id, featured) => { if (featured) { @@ -43,21 +43,21 @@ export default class StatusList extends ImmutablePureComponent { } else { return this.props.statusIds.indexOf(id) + this.getFeaturedStatusCount(); } - } + }; handleMoveUp = (id, featured) => { const elementIndex = this.getCurrentStatusIndex(id, featured) - 1; this._selectChild(elementIndex, true); - } + }; handleMoveDown = (id, featured) => { const elementIndex = this.getCurrentStatusIndex(id, featured) + 1; this._selectChild(elementIndex, false); - } + }; handleLoadOlder = debounce(() => { this.props.onLoadMore(this.props.statusIds.size > 0 ? this.props.statusIds.last() : undefined); - }, 300, { leading: true }) + }, 300, { leading: true }); _selectChild (index, align_top) { const container = this.node.node; @@ -75,7 +75,7 @@ export default class StatusList extends ImmutablePureComponent { setRef = c => { this.node = c; - } + }; render () { const { statusIds, featuredStatusIds, onLoadMore, timelineId, ...other } = this.props; diff --git a/app/javascript/flavours/glitch/components/status_prepend.js b/app/javascript/flavours/glitch/components/status_prepend.js index f82533062..8c4343b04 100644 --- a/app/javascript/flavours/glitch/components/status_prepend.js +++ b/app/javascript/flavours/glitch/components/status_prepend.js @@ -18,7 +18,7 @@ export default class StatusPrepend extends React.PureComponent { handleClick = (e) => { const { account, parseClick } = this.props; parseClick(e, `/@${account.get('acct')}`); - } + }; Message = () => { const { type, account } = this.props; @@ -98,7 +98,7 @@ export default class StatusPrepend extends React.PureComponent { ); } return null; - } + }; render () { const { Message } = this; @@ -126,7 +126,7 @@ export default class StatusPrepend extends React.PureComponent { case 'update': iconId = 'pencil'; break; - }; + } return !type ? null : (
diff --git a/app/javascript/flavours/glitch/features/account/components/header.js b/app/javascript/flavours/glitch/features/account/components/header.js index 963ce7bf3..c11a472e7 100644 --- a/app/javascript/flavours/glitch/features/account/components/header.js +++ b/app/javascript/flavours/glitch/features/account/components/header.js @@ -109,7 +109,7 @@ class Header extends ImmutablePureComponent { openEditProfile = () => { window.open(profileLink, '_blank'); - } + }; handleMouseEnter = ({ currentTarget }) => { if (autoPlayGif) { @@ -122,7 +122,7 @@ class Header extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -135,14 +135,14 @@ class Header extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; handleAvatarClick = e => { if (e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); this.props.onOpenAvatar(); } - } + }; handleShare = () => { const { account } = this.props; @@ -153,7 +153,7 @@ class Header extends ImmutablePureComponent { }).catch((e) => { if (e.name !== 'AbortError') console.error(e); }); - } + }; render () { const { account, hidden, intl, domain } = this.props; @@ -177,8 +177,7 @@ class Header extends ImmutablePureComponent { if (me !== account.get('id') && account.getIn(['relationship', 'followed_by'])) { info.push(); - } - else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) { + } else if (me !== account.get('id') && account.getIn(['relationship', 'blocking'])) { info.push(); } @@ -378,7 +377,7 @@ class Header extends ImmutablePureComponent { {fields.map((pair, i) => (
- +
{pair.get('verified_at') && }
diff --git a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js index f20ee685e..d169875b0 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js +++ b/app/javascript/flavours/glitch/features/account_gallery/components/media_item.js @@ -22,20 +22,20 @@ export default class MediaItem extends ImmutablePureComponent { handleImageLoad = () => { this.setState({ loaded: true }); - } + }; handleMouseEnter = e => { if (this.hoverToPlay()) { e.target.play(); } - } + }; handleMouseLeave = e => { if (this.hoverToPlay()) { e.target.pause(); e.target.currentTime = 0; } - } + }; hoverToPlay () { return !autoPlayGif && ['gifv', 'video'].indexOf(this.props.attachment.get('type')) !== -1; @@ -51,7 +51,7 @@ export default class MediaItem extends ImmutablePureComponent { this.setState({ visible: true }); } } - } + }; render () { const { attachment, displayWidth } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_gallery/index.js b/app/javascript/flavours/glitch/features/account_gallery/index.js index 638224bc0..afd6e5161 100644 --- a/app/javascript/flavours/glitch/features/account_gallery/index.js +++ b/app/javascript/flavours/glitch/features/account_gallery/index.js @@ -45,7 +45,7 @@ class LoadMoreMedia extends ImmutablePureComponent { handleLoadMore = () => { this.props.onLoadMore(this.props.maxId); - } + }; render () { return ( @@ -109,13 +109,13 @@ class AccountGallery extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; handleScrollToBottom = () => { if (this.props.hasMore) { this.handleLoadMore(this.props.attachments.size > 0 ? this.props.attachments.last().getIn(['status', 'id']) : undefined); } - } + }; handleScroll = e => { const { scrollTop, scrollHeight, clientHeight } = e.target; @@ -124,7 +124,7 @@ class AccountGallery extends ImmutablePureComponent { if (150 > offset && !this.props.isLoading) { this.handleScrollToBottom(); } - } + }; handleLoadMore = maxId => { this.props.dispatch(expandAccountMediaTimeline(this.props.accountId, { maxId })); @@ -133,11 +133,11 @@ class AccountGallery extends ImmutablePureComponent { handleLoadOlder = e => { e.preventDefault(); this.handleScrollToBottom(); - } + }; setColumnRef = c => { this.column = c; - } + }; handleOpenMedia = attachment => { const { dispatch } = this.props; @@ -153,13 +153,13 @@ class AccountGallery extends ImmutablePureComponent { dispatch(openModal('MEDIA', { media, index, statusId })); } - } + }; handleRef = c => { if (c) { this.setState({ width: c.offsetWidth }); } - } + }; render () { const { attachments, isLoading, hasMore, isAccount, multiColumn, suspended } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/header.js b/app/javascript/flavours/glitch/features/account_timeline/components/header.js index 90c4c9d51..eec065b43 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/header.js +++ b/app/javascript/flavours/glitch/features/account_timeline/components/header.js @@ -37,35 +37,35 @@ export default class Header extends ImmutablePureComponent { handleFollow = () => { this.props.onFollow(this.props.account); - } + }; handleBlock = () => { this.props.onBlock(this.props.account); - } + }; handleMention = () => { this.props.onMention(this.props.account, this.context.router.history); - } + }; handleDirect = () => { this.props.onDirect(this.props.account, this.context.router.history); - } + }; handleReport = () => { this.props.onReport(this.props.account); - } + }; handleReblogToggle = () => { this.props.onReblogToggle(this.props.account); - } + }; handleNotifyToggle = () => { this.props.onNotifyToggle(this.props.account); - } + }; handleMute = () => { this.props.onMute(this.props.account); - } + }; handleBlockDomain = () => { const domain = this.props.account.get('acct').split('@')[1]; @@ -73,7 +73,7 @@ export default class Header extends ImmutablePureComponent { if (!domain) return; this.props.onBlockDomain(domain); - } + }; handleUnblockDomain = () => { const domain = this.props.account.get('acct').split('@')[1]; @@ -81,31 +81,31 @@ export default class Header extends ImmutablePureComponent { if (!domain) return; this.props.onUnblockDomain(domain); - } + }; handleEndorseToggle = () => { this.props.onEndorseToggle(this.props.account); - } + }; handleAddToList = () => { this.props.onAddToList(this.props.account); - } + }; handleEditAccountNote = () => { this.props.onEditAccountNote(this.props.account); - } + }; handleChangeLanguages = () => { this.props.onChangeLanguages(this.props.account); - } + }; handleInteractionModal = () => { this.props.onInteractionModal(this.props.account); - } + }; handleOpenAvatar = () => { this.props.onOpenAvatar(this.props.account); - } + }; render () { const { account, hidden, hideTabs } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js b/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js index ca0e60672..dc2b3e3e6 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js +++ b/app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js @@ -20,7 +20,7 @@ class LimitedAccountHint extends React.PureComponent { static propTypes = { accountId: PropTypes.string.isRequired, reveal: PropTypes.func, - } + }; render () { const { reveal } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js b/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js index 308407e94..40bdc4034 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js +++ b/app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js @@ -21,13 +21,13 @@ export default class MovedNote extends ImmutablePureComponent { handleAccountClick = e => { if (e.button === 0) { e.preventDefault(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.to.get('acct')}`, state); } e.stopPropagation(); - } + }; render () { const { from, to } = this.props; diff --git a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js index 25bcd0119..3ec47cf2f 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js +++ b/app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js @@ -12,7 +12,7 @@ import { } from 'flavours/glitch/actions/accounts'; import { mentionCompose, - directCompose + directCompose, } from 'flavours/glitch/actions/compose'; import { initMuteModal } from 'flavours/glitch/actions/mutes'; import { initBlockModal } from 'flavours/glitch/actions/blocks'; diff --git a/app/javascript/flavours/glitch/features/account_timeline/index.js b/app/javascript/flavours/glitch/features/account_timeline/index.js index b79082f00..9151c1990 100644 --- a/app/javascript/flavours/glitch/features/account_timeline/index.js +++ b/app/javascript/flavours/glitch/features/account_timeline/index.js @@ -140,15 +140,15 @@ class AccountTimeline extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; handleLoadMore = maxId => { this.props.dispatch(expandAccountTimeline(this.props.accountId, { maxId, withReplies: this.props.withReplies, tagged: this.props.params.tagged })); - } + }; setRef = c => { this.column = c; - } + }; render () { const { accountId, statusIds, featuredStatusIds, isLoading, hasMore, suspended, isAccount, hidden, multiColumn, remote, remoteUrl } = this.props; diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 3a0d49100..1a1d438c0 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -75,7 +75,7 @@ class Audio extends React.PureComponent { if (this.player) { this._setDimensions(); } - } + }; _pack() { return { @@ -107,11 +107,11 @@ class Audio extends React.PureComponent { setSeekRef = c => { this.seek = c; - } + }; setVolumeRef = c => { this.volume = c; - } + }; setAudioRef = c => { this.audio = c; @@ -120,14 +120,14 @@ class Audio extends React.PureComponent { this.audio.volume = 1; this.audio.muted = false; } - } + }; setCanvasRef = c => { this.canvas = c; this.visualizer.setCanvas(c); - } - + }; + componentDidMount () { window.addEventListener('scroll', this.handleScroll); window.addEventListener('resize', this.handleResize, { passive: true }); @@ -169,7 +169,7 @@ class Audio extends React.PureComponent { } else { this.setState({ paused: true }, () => this.audio.pause()); } - } + }; handleResize = debounce(() => { if (this.player) { @@ -187,7 +187,7 @@ class Audio extends React.PureComponent { } this._renderCanvas(); - } + }; handlePause = () => { this.setState({ paused: true }); @@ -195,7 +195,7 @@ class Audio extends React.PureComponent { if (this.audioContext) { this.audioContext.suspend(); } - } + }; handleProgress = () => { const lastTimeRange = this.audio.buffered.length - 1; @@ -203,7 +203,7 @@ class Audio extends React.PureComponent { if (lastTimeRange > -1) { this.setState({ buffer: Math.ceil(this.audio.buffered.end(lastTimeRange) / this.audio.duration * 100) }); } - } + }; toggleMute = () => { const muted = !this.state.muted; @@ -213,7 +213,7 @@ class Audio extends React.PureComponent { this.gainNode.gain.value = muted ? 0 : this.state.volume; } }); - } + }; toggleReveal = () => { if (this.props.onToggleVisibility) { @@ -221,7 +221,7 @@ class Audio extends React.PureComponent { } else { this.setState({ revealed: !this.state.revealed }); } - } + }; handleVolumeMouseDown = e => { document.addEventListener('mousemove', this.handleMouseVolSlide, true); @@ -233,14 +233,14 @@ class Audio extends React.PureComponent { e.preventDefault(); e.stopPropagation(); - } + }; handleVolumeMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseVolSlide, true); document.removeEventListener('mouseup', this.handleVolumeMouseUp, true); document.removeEventListener('touchmove', this.handleMouseVolSlide, true); document.removeEventListener('touchend', this.handleVolumeMouseUp, true); - } + }; handleMouseDown = e => { document.addEventListener('mousemove', this.handleMouseMove, true); @@ -254,7 +254,7 @@ class Audio extends React.PureComponent { e.preventDefault(); e.stopPropagation(); - } + }; handleMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseMove, true); @@ -264,7 +264,7 @@ class Audio extends React.PureComponent { this.setState({ dragging: false }); this.audio.play(); - } + }; handleMouseMove = throttle(e => { const { x } = getPointerPosition(this.seek, e); @@ -282,7 +282,7 @@ class Audio extends React.PureComponent { currentTime: this.audio.currentTime, duration: this.audio.duration, }); - } + }; handleMouseVolSlide = throttle(e => { const { x } = getPointerPosition(this.volume, e); @@ -317,11 +317,11 @@ class Audio extends React.PureComponent { handleMouseEnter = () => { this.setState({ hovered: true }); - } + }; handleMouseLeave = () => { this.setState({ hovered: false }); - } + }; handleLoadedData = () => { const { autoPlay, currentTime } = this.props; @@ -333,7 +333,7 @@ class Audio extends React.PureComponent { if (autoPlay) { this.togglePlay(); } - } + }; _initAudioContext () { const AudioContext = window.AudioContext || window.webkitAudioContext; @@ -367,7 +367,7 @@ class Audio extends React.PureComponent { }).catch(err => { console.error(err); }); - } + }; _renderCanvas () { requestAnimationFrame(() => { @@ -438,7 +438,7 @@ class Audio extends React.PureComponent { e.stopPropagation(); this.togglePlay(); } - } + }; handleKeyDown = e => { switch(e.key) { @@ -463,7 +463,7 @@ class Audio extends React.PureComponent { this.seekBy(10); break; } - } + }; render () { const { src, intl, alt, editable, autoPlay, sensitive, blurhash } = this.props; diff --git a/app/javascript/flavours/glitch/features/bookmarked_statuses/index.js b/app/javascript/flavours/glitch/features/bookmarked_statuses/index.js index 8978ac5fc..8e25bc6fd 100644 --- a/app/javascript/flavours/glitch/features/bookmarked_statuses/index.js +++ b/app/javascript/flavours/glitch/features/bookmarked_statuses/index.js @@ -48,24 +48,24 @@ class Bookmarks extends ImmutablePureComponent { } else { dispatch(addColumn('BOOKMARKS', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleLoadMore = debounce(() => { this.props.dispatch(expandBookmarkedStatuses()); - }, 300, { leading: true }) + }, 300, { leading: true }); render () { const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props; diff --git a/app/javascript/flavours/glitch/features/closed_registrations_modal/index.js b/app/javascript/flavours/glitch/features/closed_registrations_modal/index.js index cb91636cb..bdaa9885c 100644 --- a/app/javascript/flavours/glitch/features/closed_registrations_modal/index.js +++ b/app/javascript/flavours/glitch/features/closed_registrations_modal/index.js @@ -72,4 +72,4 @@ class ClosedRegistrationsModal extends ImmutablePureComponent { ); } -}; +} diff --git a/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js index b892f08ad..eac1c4bba 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/community_timeline/containers/column_settings_container.js @@ -12,7 +12,7 @@ const mapStateToProps = (state, { columnId }) => { settings: (uuid && index >= 0) ? columns.get(index).get('params') : state.getIn(['settings', 'community']), }; }; - + const mapDispatchToProps = (dispatch, { columnId }) => { return { onChange (key, checked) { diff --git a/app/javascript/flavours/glitch/features/community_timeline/index.js b/app/javascript/flavours/glitch/features/community_timeline/index.js index 67bf54875..b9a59fdc7 100644 --- a/app/javascript/flavours/glitch/features/community_timeline/index.js +++ b/app/javascript/flavours/glitch/features/community_timeline/index.js @@ -63,16 +63,16 @@ class CommunityTimeline extends React.PureComponent { } else { dispatch(addColumn('COMMUNITY', { other: { onlyMedia } })); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch, onlyMedia } = this.props; @@ -112,13 +112,13 @@ class CommunityTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { const { dispatch, onlyMedia } = this.props; dispatch(expandCommunityTimeline({ maxId, onlyMedia })); - } + }; render () { const { intl, hasUnread, columnId, multiColumn, onlyMedia } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/action_bar.js b/app/javascript/flavours/glitch/features/compose/components/action_bar.js index 838ef09ea..1843fdacb 100644 --- a/app/javascript/flavours/glitch/features/compose/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/compose/components/action_bar.js @@ -32,7 +32,7 @@ class ActionBar extends React.PureComponent { handleLogout = () => { this.props.onLogout(); - } + }; render () { const { intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index 2b57cf15d..c5655c4f2 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -22,9 +22,9 @@ import { length } from 'stringz'; const messages = defineMessages({ placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' }, missingDescriptionMessage: { id: 'confirmations.missing_media_description.message', - defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, + defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, missingDescriptionConfirm: { id: 'confirmations.missing_media_description.confirm', - defaultMessage: 'Send anyway' }, + defaultMessage: 'Send anyway' }, spoiler_placeholder: { id: 'compose_form.spoiler_placeholder', defaultMessage: 'Write your warning here' }, }); @@ -83,22 +83,22 @@ class ComposeForm extends ImmutablePureComponent { handleChange = (e) => { this.props.onChange(e.target.value); - } + }; getFulltextForCharacterCounting = () => { return [ this.props.spoiler? this.props.spoilerText: '', countableText(this.props.text), - this.props.advancedOptions && this.props.advancedOptions.get('do_not_federate') ? ' 👁️' : '' + this.props.advancedOptions && this.props.advancedOptions.get('do_not_federate') ? ' 👁️' : '', ].join(''); - } + }; canSubmit = () => { const { isSubmitting, isChangingUpload, isUploading, anyMedia } = this.props; const fulltext = this.getFulltextForCharacterCounting(); return !(isSubmitting || isUploading || isChangingUpload || length(fulltext) > maxChars || (!fulltext.trim().length && !anyMedia)); - } + }; handleSubmit = (overriddenVisibility = null) => { const { @@ -129,7 +129,7 @@ class ComposeForm extends ImmutablePureComponent { } onSubmit(this.context.router ? this.context.router.history : null); } - } + }; // Changes the text value of the spoiler. handleChangeSpoiler = ({ target: { value } }) => { @@ -137,7 +137,7 @@ class ComposeForm extends ImmutablePureComponent { if (onChangeSpoilerText) { onChangeSpoilerText(value); } - } + }; setRef = c => { this.composeForm = c; @@ -150,7 +150,7 @@ class ComposeForm extends ImmutablePureComponent { if (onPickEmoji) { onPickEmoji(selectionStart, data); } - } + }; // Handles the secondary submit button. handleSecondarySubmit = () => { @@ -158,16 +158,16 @@ class ComposeForm extends ImmutablePureComponent { sideArm, } = this.props; this.handleSubmit(sideArm === 'none' ? null : sideArm); - } + }; // Selects a suggestion from the autofill. onSuggestionSelected = (tokenStart, token, value) => { this.props.onSuggestionSelected(tokenStart, token, value, ['text']); - } + }; onSpoilerSuggestionSelected = (tokenStart, token, value) => { this.props.onSuggestionSelected(tokenStart, token, value, ['spoiler_text']); - } + }; handleKeyDown = (e) => { if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { @@ -177,21 +177,21 @@ class ComposeForm extends ImmutablePureComponent { if (e.keyCode == 13 && e.altKey) { this.handleSecondarySubmit(); } - } + }; // Sets a reference to the textarea. setAutosuggestTextarea = (textareaComponent) => { if (textareaComponent) { this.textarea = textareaComponent.textarea; } - } + }; // Sets a reference to the CW field. handleRefSpoilerText = (spoilerComponent) => { if (spoilerComponent) { this.spoilerText = spoilerComponent.input; } - } + }; handleFocus = () => { if (this.composeForm && !this.props.singleColumn) { @@ -200,7 +200,7 @@ class ComposeForm extends ImmutablePureComponent { this.composeForm.scrollIntoView(); } } - } + }; componentDidMount () { this._updateFocusAndSelection({ }); @@ -217,7 +217,7 @@ class ComposeForm extends ImmutablePureComponent { // - Replying to more than one user, selects any usernames past // the first; this provides a convenient shortcut to drop // everyone else from the conversation. - _updateFocusAndSelection = (prevProps) => { + _updateFocusAndSelection = (prevProps) => { const { textarea, spoilerText, @@ -271,7 +271,7 @@ class ComposeForm extends ImmutablePureComponent { } } } - } + }; render () { diff --git a/app/javascript/flavours/glitch/features/compose/components/dropdown.js b/app/javascript/flavours/glitch/features/compose/components/dropdown.js index d98b311d9..fe4ab36f5 100644 --- a/app/javascript/flavours/glitch/features/compose/components/dropdown.js +++ b/app/javascript/flavours/glitch/features/compose/components/dropdown.js @@ -64,7 +64,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent { } this.setState({ open: !this.state.open, openedViaKeyboard: type !== 'click' }); } - } + }; handleKeyDown = (e) => { switch (e.key) { @@ -72,13 +72,13 @@ export default class ComposerOptionsDropdown extends React.PureComponent { this.handleClose(); break; } - } + }; handleMouseDown = () => { if (!this.state.open) { this.activeElement = document.activeElement; } - } + }; handleButtonKeyDown = (e) => { switch(e.key) { @@ -87,7 +87,7 @@ export default class ComposerOptionsDropdown extends React.PureComponent { this.handleMouseDown(); break; } - } + }; handleKeyPress = (e) => { switch(e.key) { @@ -98,14 +98,14 @@ export default class ComposerOptionsDropdown extends React.PureComponent { e.preventDefault(); break; } - } + }; handleClose = () => { if (this.state.open && this.activeElement) { this.activeElement.focus({ preventScroll: true }); } this.setState({ open: false }); - } + }; handleItemClick = (e) => { const { @@ -151,22 +151,22 @@ export default class ComposerOptionsDropdown extends React.PureComponent { ...rest, active: value && name === value, name, - }) + }), ), }; - } + }; setTargetRef = c => { this.target = c; - } + }; findTarget = () => { return this.target; - } + }; handleOverlayEnter = (state) => { this.setState({ placement: state.placement }); - } + }; // Rendering. render () { diff --git a/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js b/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js index c4895dfd0..1ea0df536 100644 --- a/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js +++ b/app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js @@ -44,12 +44,12 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; // Stores our node in `this.node`. setRef = (node) => { this.node = node; - } + }; // On mounting, we add our listeners. componentDidMount () { @@ -84,7 +84,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent onClose(); } onChange(name); - } + }; // Handle changes differently whether the dropdown is a list of options or actions handleChange = (name) => { @@ -93,7 +93,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent } else { this.setState({ value: name }); } - } + }; handleKeyDown = (e) => { const index = Number(e.currentTarget.getAttribute('data-index')); @@ -135,11 +135,11 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent e.preventDefault(); e.stopPropagation(); } - } + }; setFocusRef = c => { this.focusedItem = c; - } + }; renderItem = (item, i) => { const { name, icon, meta, text } = item; @@ -177,7 +177,7 @@ export default class ComposerOptionsDropdownContent extends React.PureComponent {contents}
); - } + }; // Rendering. render () { diff --git a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js index 38c735551..66355e088 100644 --- a/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js +++ b/app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js @@ -58,7 +58,7 @@ class ModifierPickerMenu extends React.PureComponent { handleClick = e => { this.props.onSelect(e.currentTarget.getAttribute('data-index') * 1); - } + }; componentWillReceiveProps (nextProps) { if (nextProps.active) { @@ -76,7 +76,7 @@ class ModifierPickerMenu extends React.PureComponent { if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; attachListeners () { document.addEventListener('click', this.handleDocumentClick, false); @@ -90,7 +90,7 @@ class ModifierPickerMenu extends React.PureComponent { setRef = c => { this.node = c; - } + }; render () { const { active } = this.props; @@ -125,12 +125,12 @@ class ModifierPicker extends React.PureComponent { } else { this.props.onOpen(); } - } + }; handleSelect = modifier => { this.props.onChange(modifier); this.props.onClose(); - } + }; render () { const { active, modifier } = this.props; @@ -175,7 +175,7 @@ class EmojiPickerMenu extends React.PureComponent { if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; componentDidMount () { document.addEventListener('click', this.handleDocumentClick, false); @@ -199,7 +199,7 @@ class EmojiPickerMenu extends React.PureComponent { setRef = c => { this.node = c; - } + }; getI18n = () => { const { intl } = this.props; @@ -220,7 +220,7 @@ class EmojiPickerMenu extends React.PureComponent { custom: intl.formatMessage(messages.custom), }, }; - } + }; handleClick = (emoji, event) => { if (!emoji.native) { @@ -230,19 +230,19 @@ class EmojiPickerMenu extends React.PureComponent { this.props.onClose(); } this.props.onPick(emoji); - } + }; handleModifierOpen = () => { this.setState({ modifierOpen: true }); - } + }; handleModifierClose = () => { this.setState({ modifierOpen: false }); - } + }; handleModifierChange = modifier => { this.props.onSkinTone(modifier); - } + }; render () { const { loading, style, intl, custom_emojis, skinTone, frequentlyUsedEmojis } = this.props; @@ -327,7 +327,7 @@ class EmojiPickerDropdown extends React.PureComponent { setRef = (c) => { this.dropdown = c; - } + }; onShowDropdown = () => { this.setState({ active: true }); @@ -344,11 +344,11 @@ class EmojiPickerDropdown extends React.PureComponent { this.setState({ loading: false, active: false }); }); } - } + }; onHideDropdown = () => { this.setState({ active: false }); - } + }; onToggle = (e) => { if (!this.state.loading && (!e.key || e.key === 'Enter')) { @@ -358,21 +358,21 @@ class EmojiPickerDropdown extends React.PureComponent { this.onShowDropdown(e); } } - } + }; handleKeyDown = e => { if (e.key === 'Escape') { this.onHideDropdown(); } - } + }; setTargetRef = c => { this.target = c; - } + }; findTarget = () => { return this.target; - } + }; render () { const { intl, onPickEmoji, onSkinTone, skinTone, frequentlyUsedEmojis, button } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/header.js b/app/javascript/flavours/glitch/features/compose/components/header.js index 7ecb573ab..dcbdafa57 100644 --- a/app/javascript/flavours/glitch/features/compose/components/header.js +++ b/app/javascript/flavours/glitch/features/compose/components/header.js @@ -47,6 +47,7 @@ const messages = defineMessages({ export default @injectIntl class Header extends ImmutablePureComponent { + static propTypes = { columns: ImmutablePropTypes.list, unreadNotifications: PropTypes.number, @@ -63,7 +64,7 @@ class Header extends ImmutablePureComponent { this.props.onLogout(); return false; - } + }; render () { const { intl, columns, unreadNotifications, showNotificationsBadge, onSettingsClick } = this.props; @@ -71,8 +72,8 @@ class Header extends ImmutablePureComponent { // Only renders the component if the column isn't being shown. const renderForColumn = conditionalRender.bind(null, columnId => !columns || !columns.some( - column => column.get('id') === columnId - ) + column => column.get('id') === columnId, + ), ); // The result. @@ -125,10 +126,11 @@ class Header extends ImmutablePureComponent { ); - }; + } + } diff --git a/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js b/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js index 3a1fa0226..3f8411ab1 100644 --- a/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js +++ b/app/javascript/flavours/glitch/features/compose/components/language_dropdown.js @@ -40,7 +40,7 @@ class LanguageDropdownMenu extends React.PureComponent { if (this.node && !this.node.contains(e.target)) { this.props.onClose(); } - } + }; componentDidMount () { document.addEventListener('click', this.handleDocumentClick, false); @@ -63,15 +63,15 @@ class LanguageDropdownMenu extends React.PureComponent { setRef = c => { this.node = c; - } + }; setListRef = c => { this.listNode = c; - } + }; handleSearchChange = ({ target }) => { this.setState({ searchValue: target.value }); - } + }; search () { const { languages, value, frequentlyUsedLanguages } = this.props; @@ -122,7 +122,7 @@ class LanguageDropdownMenu extends React.PureComponent { this.props.onClose(); this.props.onChange(value); - } + }; handleKeyDown = e => { const { onClose } = this.props; @@ -163,7 +163,7 @@ class LanguageDropdownMenu extends React.PureComponent { e.preventDefault(); e.stopPropagation(); } - } + }; handleSearchKeyDown = e => { const { onChange, onClose } = this.props; @@ -199,11 +199,11 @@ class LanguageDropdownMenu extends React.PureComponent { break; } - } + }; handleClear = () => { this.setState({ searchValue: '' }); - } + }; renderItem = lang => { const { value } = this.props; @@ -213,7 +213,7 @@ class LanguageDropdownMenu extends React.PureComponent { {lang[2]} ({lang[1]})
); - } + }; render () { const { intl } = this.props; @@ -259,7 +259,7 @@ class LanguageDropdown extends React.PureComponent { } this.setState({ open: !this.state.open }); - } + }; handleClose = () => { const { value, onClose } = this.props; @@ -270,24 +270,24 @@ class LanguageDropdown extends React.PureComponent { this.setState({ open: false }); onClose(value); - } + }; handleChange = value => { const { onChange } = this.props; onChange(value); - } + }; setTargetRef = c => { this.target = c; - } + }; findTarget = () => { return this.target; - } + }; handleOverlayEnter = (state) => { this.setState({ placement: state.placement }); - } + }; render () { const { value, intl, frequentlyUsedLanguages } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/options.js b/app/javascript/flavours/glitch/features/compose/components/options.js index b5276c371..e09e13bcb 100644 --- a/app/javascript/flavours/glitch/features/compose/components/options.js +++ b/app/javascript/flavours/glitch/features/compose/components/options.js @@ -144,7 +144,7 @@ class ComposerOptions extends ImmutablePureComponent { if (files.length && onUpload) { onUpload(files); } - } + }; // Handles attachment clicks. handleClickAttach = (name) => { @@ -164,12 +164,12 @@ class ComposerOptions extends ImmutablePureComponent { } return; } - } + }; // Handles a ref to the file input. handleRefFileElement = (fileElement) => { this.fileElement = fileElement; - } + }; renderToggleItemContents = (item) => { const { onChangeAdvancedOption } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.js b/app/javascript/flavours/glitch/features/compose/components/poll_form.js index 2ab3c64ac..13b7322d3 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/poll_form.js @@ -49,15 +49,15 @@ class Option extends React.PureComponent { onSuggestionsClearRequested = () => { this.props.onClearSuggestions(); - } + }; onSuggestionsFetchRequested = (token) => { this.props.onFetchSuggestions(token); - } + }; onSuggestionSelected = (tokenStart, token, value) => { this.props.onSuggestionSelected(tokenStart, token, value, ['poll', 'options', this.props.index]); - } + }; render () { const { isPollMultiple, title, lang, index, autoFocus, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/publisher.js b/app/javascript/flavours/glitch/features/compose/components/publisher.js index 9d53b7ee3..59254990b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/publisher.js +++ b/app/javascript/flavours/glitch/features/compose/components/publisher.js @@ -94,5 +94,6 @@ class Publisher extends ImmutablePureComponent {
); - }; + } + } diff --git a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js index 7ad9e2b64..ca167d114 100644 --- a/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js +++ b/app/javascript/flavours/glitch/features/compose/components/reply_indicator.js @@ -33,7 +33,7 @@ class ReplyIndicator extends ImmutablePureComponent { if (onCancel) { onCancel(); } - } + }; // Rendering. render () { diff --git a/app/javascript/flavours/glitch/features/compose/components/search.js b/app/javascript/flavours/glitch/features/compose/components/search.js index e5874de75..6241e2a0a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search.js +++ b/app/javascript/flavours/glitch/features/compose/components/search.js @@ -71,14 +71,14 @@ class Search extends React.PureComponent { setRef = c => { this.searchForm = c; - } + }; handleChange = (e) => { const { onChange } = this.props; if (onChange) { onChange(e.target.value); } - } + }; handleClear = (e) => { const { @@ -90,11 +90,11 @@ class Search extends React.PureComponent { if (onClear && (submitted || value && value.length)) { onClear(); } - } + }; handleBlur = () => { this.setState({ expanded: false }); - } + }; handleFocus = () => { this.setState({ expanded: true }); @@ -106,7 +106,7 @@ class Search extends React.PureComponent { this.searchForm.scrollIntoView(); } } - } + }; handleKeyUp = (e) => { const { onSubmit } = this.props; @@ -121,11 +121,11 @@ class Search extends React.PureComponent { case 'Escape': focusRoot(); } - } + }; findTarget = () => { return this.searchForm; - } + }; render () { const { intl, value, submitted } = this.props; diff --git a/app/javascript/flavours/glitch/features/compose/components/search_results.js b/app/javascript/flavours/glitch/features/compose/components/search_results.js index c2178702c..23ff60936 100644 --- a/app/javascript/flavours/glitch/features/compose/components/search_results.js +++ b/app/javascript/flavours/glitch/features/compose/components/search_results.js @@ -103,7 +103,7 @@ class SearchResults extends ImmutablePureComponent {
- {results.get('statuses').map(statusId => )} + {results.get('statuses').map(statusId => )} {results.get('statuses').size >= 5 && }
@@ -136,5 +136,6 @@ class SearchResults extends ImmutablePureComponent { {hashtags} ); - }; + } + } diff --git a/app/javascript/flavours/glitch/features/compose/components/textarea_icons.js b/app/javascript/flavours/glitch/features/compose/components/textarea_icons.js index 25c2443b1..d8ee5c81b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/textarea_icons.js +++ b/app/javascript/flavours/glitch/features/compose/components/textarea_icons.js @@ -51,9 +51,10 @@ class TextareaIcons extends ImmutablePureComponent { id={icon} /> - ) : null + ) : null, ) : null} ); } + } diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.js b/app/javascript/flavours/glitch/features/compose/components/upload.js index cd4524540..c82b8d55a 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload.js @@ -23,12 +23,12 @@ export default class Upload extends ImmutablePureComponent { handleUndoClick = e => { e.stopPropagation(); this.props.onUndo(this.props.media.get('id')); - } + }; handleFocalPointClick = e => { e.stopPropagation(); this.props.onOpenFocalPoint(this.props.media.get('id')); - } + }; render () { const { media } = this.props; @@ -39,7 +39,7 @@ export default class Upload extends ImmutablePureComponent { return (
- + {({ scale }) => (
diff --git a/app/javascript/flavours/glitch/features/compose/components/upload_form.js b/app/javascript/flavours/glitch/features/compose/components/upload_form.js index 7ebbac963..f2e7fe7a2 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload_form.js @@ -6,6 +6,7 @@ import UploadContainer from '../containers/upload_container'; import SensitiveButtonContainer from '../containers/sensitive_button_container'; export default class UploadForm extends ImmutablePureComponent { + static propTypes = { mediaIds: ImmutablePropTypes.list.isRequired, }; diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index 8f2947672..56eaaf920 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -22,11 +22,11 @@ import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; const messages = defineMessages({ missingDescriptionMessage: { id: 'confirmations.missing_media_description.message', - defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, + defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, missingDescriptionConfirm: { id: 'confirmations.missing_media_description.confirm', - defaultMessage: 'Send anyway' }, + defaultMessage: 'Send anyway' }, missingDescriptionEdit: { id: 'confirmations.missing_media_description.edit', - defaultMessage: 'Edit media' }, + defaultMessage: 'Edit media' }, }); // State mapping. @@ -38,12 +38,12 @@ function mapStateToProps (state) { const sideArmRestrictedPrivacy = replyPrivacy ? privacyPreference(replyPrivacy, sideArmBasePrivacy) : null; let sideArmPrivacy = null; switch (state.getIn(['local_settings', 'side_arm_reply_mode'])) { - case 'copy': - sideArmPrivacy = replyPrivacy; - break; - case 'restrict': - sideArmPrivacy = sideArmRestrictedPrivacy; - break; + case 'copy': + sideArmPrivacy = replyPrivacy; + break; + case 'restrict': + sideArmPrivacy = sideArmRestrictedPrivacy; + break; } sideArmPrivacy = sideArmPrivacy || sideArmBasePrivacy; return { @@ -72,7 +72,7 @@ function mapStateToProps (state) { isInReply: state.getIn(['compose', 'in_reply_to']) !== null, lang: state.getIn(['compose', 'language']), }; -}; +} // Dispatch mapping. const mapDispatchToProps = (dispatch, { intl }) => ({ @@ -124,7 +124,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ onConfirm: () => { if (overriddenVisibility) { dispatch(changeComposeVisibility(overriddenVisibility)); - }; + } dispatch(submitCompose(routerHistory)); }, secondary: intl.formatMessage(messages.missingDescriptionEdit), diff --git a/app/javascript/flavours/glitch/features/compose/containers/options_container.js b/app/javascript/flavours/glitch/features/compose/containers/options_container.js index 5de9f5419..19a90ac8b 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/options_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/options_container.js @@ -23,7 +23,7 @@ function mapStateToProps (state) { showContentTypeChoice: state.getIn(['local_settings', 'show_content_type_choice']), contentType: state.getIn(['compose', 'content_type']), }; -}; +} const mapDispatchToProps = (dispatch) => ({ diff --git a/app/javascript/flavours/glitch/features/compose/containers/warning_container.js b/app/javascript/flavours/glitch/features/compose/containers/warning_container.js index b2ed40b82..9402601f8 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/warning_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/warning_container.js @@ -8,7 +8,7 @@ import { profileLink, termsLink } from 'flavours/glitch/utils/backend_links'; const buildHashtagRE = () => { try { - const HASHTAG_SEPARATORS = "_\\u00b7\\u200c"; + const HASHTAG_SEPARATORS = '_\\u00b7\\u200c'; const ALPHA = '\\p{L}\\p{M}'; const WORD = '\\p{L}\\p{M}\\p{N}\\p{Pc}'; return new RegExp( @@ -22,7 +22,7 @@ const buildHashtagRE = () => { '[' + WORD + '_]*' + '[' + ALPHA + ']' + '[' + WORD + '_]*' + - '))', 'iu' + '))', 'iu', ); } catch { return /(?:^|[^\/\)\w])#(\w*[a-zA-Z·]\w*)/i; diff --git a/app/javascript/flavours/glitch/features/compose/index.js b/app/javascript/flavours/glitch/features/compose/index.js index 8ca378672..68eb05e2c 100644 --- a/app/javascript/flavours/glitch/features/compose/index.js +++ b/app/javascript/flavours/glitch/features/compose/index.js @@ -43,6 +43,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ export default @connect(mapStateToProps, mapDispatchToProps) @injectIntl class Compose extends React.PureComponent { + static propTypes = { multiColumn: PropTypes.bool, showSearch: PropTypes.bool, diff --git a/app/javascript/flavours/glitch/features/compose/util/counter.js b/app/javascript/flavours/glitch/features/compose/util/counter.js index 7aa9e87b1..5a68bad99 100644 --- a/app/javascript/flavours/glitch/features/compose/util/counter.js +++ b/app/javascript/flavours/glitch/features/compose/util/counter.js @@ -6,4 +6,4 @@ export function countableText(inputText) { return inputText .replace(urlRegex, urlPlaceholder) .replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3'); -}; +} diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js index 00d9fdcd0..ad2a68ebd 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js @@ -60,12 +60,12 @@ class Conversation extends ImmutablePureComponent { } destination = `/statuses/${lastStatus.get('id')}`; } - let state = {...router.history.location.state}; + let state = { ...router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; router.history.push(destination, state); e.preventDefault(); } - } + }; handleMouseEnter = ({ currentTarget }) => { if (autoPlayGif) { @@ -78,7 +78,7 @@ class Conversation extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -91,7 +91,7 @@ class Conversation extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; handleClick = () => { if (!this.context.router) { @@ -105,31 +105,31 @@ class Conversation extends ImmutablePureComponent { } this.context.router.history.push(`/@${lastStatus.getIn(['account', 'acct'])}/${lastStatus.get('id')}`); - } + }; handleMarkAsRead = () => { this.props.markRead(); - } + }; handleReply = () => { this.props.reply(this.props.lastStatus, this.context.router.history); - } + }; handleDelete = () => { this.props.delete(); - } + }; handleHotkeyMoveUp = () => { this.props.onMoveUp(this.props.conversationId); - } + }; handleHotkeyMoveDown = () => { this.props.onMoveDown(this.props.conversationId); - } + }; handleConversationMute = () => { this.props.onMute(this.props.lastStatus); - } + }; handleShowMore = () => { this.props.onToggleHidden(this.props.lastStatus); @@ -141,7 +141,7 @@ class Conversation extends ImmutablePureComponent { setExpansion = value => { this.setState({ isExpanded: value }); - } + }; render () { const { accounts, lastStatus, unread, scrollKey, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js index c2aff1b57..ae72179e2 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js @@ -16,17 +16,17 @@ export default class ConversationsList extends ImmutablePureComponent { onLoadMore: PropTypes.func, }; - getCurrentIndex = id => this.props.conversations.findIndex(x => x.get('id') === id) + getCurrentIndex = id => this.props.conversations.findIndex(x => x.get('id') === id); handleMoveUp = id => { const elementIndex = this.getCurrentIndex(id) - 1; this._selectChild(elementIndex, true); - } + }; handleMoveDown = id => { const elementIndex = this.getCurrentIndex(id) + 1; this._selectChild(elementIndex, false); - } + }; _selectChild (index, align_top) { const container = this.node.node; @@ -44,7 +44,7 @@ export default class ConversationsList extends ImmutablePureComponent { setRef = c => { this.node = c; - } + }; handleLoadOlder = debounce(() => { const last = this.props.conversations.last(); @@ -52,7 +52,7 @@ export default class ConversationsList extends ImmutablePureComponent { if (last && last.get('last_status')) { this.props.onLoadMore(last.get('last_status')); } - }, 300, { leading: true }) + }, 300, { leading: true }); render () { const { conversations, onLoadMore, ...other } = this.props; diff --git a/app/javascript/flavours/glitch/features/direct_timeline/index.js b/app/javascript/flavours/glitch/features/direct_timeline/index.js index d55c63c2b..afd348988 100644 --- a/app/javascript/flavours/glitch/features/direct_timeline/index.js +++ b/app/javascript/flavours/glitch/features/direct_timeline/index.js @@ -43,16 +43,16 @@ class DirectTimeline extends React.PureComponent { } else { dispatch(addColumn('DIRECT', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch, conversationsMode } = this.props; @@ -89,15 +89,15 @@ class DirectTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMoreTimeline = maxId => { this.props.dispatch(expandDirectTimeline({ maxId })); - } + }; handleLoadMoreConversations = maxId => { this.props.dispatch(expandConversations({ maxId })); - } + }; render () { const { intl, hasUnread, columnId, multiColumn, conversationsMode } = this.props; diff --git a/app/javascript/flavours/glitch/features/directory/components/account_card.js b/app/javascript/flavours/glitch/features/directory/components/account_card.js index ccc3dd3d2..3fddb5b81 100644 --- a/app/javascript/flavours/glitch/features/directory/components/account_card.js +++ b/app/javascript/flavours/glitch/features/directory/components/account_card.js @@ -118,7 +118,7 @@ class AccountCard extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -131,7 +131,7 @@ class AccountCard extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; handleFollow = () => { this.props.onFollow(this.props.account); @@ -143,11 +143,11 @@ class AccountCard extends ImmutablePureComponent { handleMute = () => { this.props.onMute(this.props.account); - } + }; handleEditProfile = () => { window.open('/settings/profile', '_blank'); - } + }; handleDismiss = (e) => { const { account, onDismiss } = this.props; @@ -155,7 +155,7 @@ class AccountCard extends ImmutablePureComponent { e.preventDefault(); e.stopPropagation(); - } + }; render() { const { account, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/directory/index.js b/app/javascript/flavours/glitch/features/directory/index.js index 94bcd578c..07875b3e1 100644 --- a/app/javascript/flavours/glitch/features/directory/index.js +++ b/app/javascript/flavours/glitch/features/directory/index.js @@ -64,7 +64,7 @@ class Directory extends React.PureComponent { } else { dispatch(addColumn('DIRECTORY', this.getParams(this.props, this.state))); } - } + }; getParams = (props, state) => ({ order: state.order === null ? (props.params.order || 'active') : state.order, @@ -74,11 +74,11 @@ class Directory extends React.PureComponent { handleMove = dir => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch } = this.props; @@ -97,7 +97,7 @@ class Directory extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleChangeOrder = e => { const { dispatch, columnId } = this.props; @@ -107,7 +107,7 @@ class Directory extends React.PureComponent { } else { this.setState({ order: e.target.value }); } - } + }; handleChangeLocal = e => { const { dispatch, columnId } = this.props; @@ -117,12 +117,12 @@ class Directory extends React.PureComponent { } else { this.setState({ local: e.target.value === '1' }); } - } + }; handleLoadMore = () => { const { dispatch } = this.props; dispatch(expandDirectory(this.getParams(this.props, this.state))); - } + }; render () { const { isLoading, accountIds, intl, columnId, multiColumn, domain } = this.props; diff --git a/app/javascript/flavours/glitch/features/explore/index.js b/app/javascript/flavours/glitch/features/explore/index.js index da0dc7f7c..4cbc5294b 100644 --- a/app/javascript/flavours/glitch/features/explore/index.js +++ b/app/javascript/flavours/glitch/features/explore/index.js @@ -41,11 +41,11 @@ class Explore extends React.PureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; render() { const { intl, multiColumn, isSearching } = this.props; diff --git a/app/javascript/flavours/glitch/features/explore/statuses.js b/app/javascript/flavours/glitch/features/explore/statuses.js index 0a5c9de23..21768dd24 100644 --- a/app/javascript/flavours/glitch/features/explore/statuses.js +++ b/app/javascript/flavours/glitch/features/explore/statuses.js @@ -33,7 +33,7 @@ class Statuses extends React.PureComponent { handleLoadMore = debounce(() => { const { dispatch } = this.props; dispatch(expandTrendingStatuses()); - }, 300, { leading: true }) + }, 300, { leading: true }); render () { const { isLoading, hasMore, statusIds, multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/features/explore/suggestions.js b/app/javascript/flavours/glitch/features/explore/suggestions.js index 52e5ce62b..1c9b99266 100644 --- a/app/javascript/flavours/glitch/features/explore/suggestions.js +++ b/app/javascript/flavours/glitch/features/explore/suggestions.js @@ -29,7 +29,7 @@ class Suggestions extends React.PureComponent { handleDismiss = (accountId) => { const { dispatch } = this.props; dispatch(dismissSuggestion(accountId)); - } + }; render () { const { isLoading, suggestions } = this.props; diff --git a/app/javascript/flavours/glitch/features/favourited_statuses/index.js b/app/javascript/flavours/glitch/features/favourited_statuses/index.js index a03e1a4eb..0667c205b 100644 --- a/app/javascript/flavours/glitch/features/favourited_statuses/index.js +++ b/app/javascript/flavours/glitch/features/favourited_statuses/index.js @@ -48,24 +48,24 @@ class Favourites extends ImmutablePureComponent { } else { dispatch(addColumn('FAVOURITES', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleLoadMore = debounce(() => { this.props.dispatch(expandFavouritedStatuses()); - }, 300, { leading: true }) + }, 300, { leading: true }); render () { const { intl, statusIds, columnId, multiColumn, hasMore, isLoading } = this.props; diff --git a/app/javascript/flavours/glitch/features/favourites/index.js b/app/javascript/flavours/glitch/features/favourites/index.js index 47c3279c4..ba58ed43b 100644 --- a/app/javascript/flavours/glitch/features/favourites/index.js +++ b/app/javascript/flavours/glitch/features/favourites/index.js @@ -48,15 +48,15 @@ class Favourites extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleRefresh = () => { this.props.dispatch(fetchFavourites(this.props.params.statusId)); - } + }; render () { const { intl, accountIds, multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/features/filters/select_filter.js b/app/javascript/flavours/glitch/features/filters/select_filter.js index 5391766c9..57adb59cc 100644 --- a/app/javascript/flavours/glitch/features/filters/select_filter.js +++ b/app/javascript/flavours/glitch/features/filters/select_filter.js @@ -71,7 +71,7 @@ class SelectFilter extends React.PureComponent { {filter[1]} {warning}
); - } + }; renderCreateNew (name) { return ( @@ -83,11 +83,11 @@ class SelectFilter extends React.PureComponent { handleSearchChange = ({ target }) => { this.setState({ searchValue: target.value }); - } + }; setListRef = c => { this.listNode = c; - } + }; handleKeyDown = e => { const index = Array.from(this.listNode.childNodes).findIndex(node => node === e.currentTarget); @@ -125,7 +125,7 @@ class SelectFilter extends React.PureComponent { e.preventDefault(); e.stopPropagation(); } - } + }; handleSearchKeyDown = e => { let element = null; @@ -143,11 +143,11 @@ class SelectFilter extends React.PureComponent { break; } - } + }; handleClear = () => { this.setState({ searchValue: '' }); - } + }; handleItemClick = e => { const value = e.currentTarget.getAttribute('data-index'); @@ -155,7 +155,7 @@ class SelectFilter extends React.PureComponent { e.preventDefault(); this.props.onSelectFilter(value); - } + }; handleNewFilterClick = e => { e.preventDefault(); diff --git a/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js b/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js index 2c668da3e..7c8a71879 100644 --- a/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js +++ b/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js @@ -50,7 +50,7 @@ class Account extends ImmutablePureComponent { } else { dispatch(followAccount(account.get('id'))); } - } + }; render () { const { account, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/follow_recommendations/index.js b/app/javascript/flavours/glitch/features/follow_recommendations/index.js index d9d962b7c..11396d2a3 100644 --- a/app/javascript/flavours/glitch/features/follow_recommendations/index.js +++ b/app/javascript/flavours/glitch/features/follow_recommendations/index.js @@ -69,7 +69,7 @@ class FollowRecommendations extends ImmutablePureComponent { })); router.history.push('/home'); - } + }; render () { const { suggestions, isLoading } = this.props; diff --git a/app/javascript/flavours/glitch/features/followers/index.js b/app/javascript/flavours/glitch/features/followers/index.js index 7122c1905..10fd76865 100644 --- a/app/javascript/flavours/glitch/features/followers/index.js +++ b/app/javascript/flavours/glitch/features/followers/index.js @@ -107,11 +107,11 @@ class Followers extends ImmutablePureComponent { setRef = c => { this.column = c; - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; render () { const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl } = this.props; diff --git a/app/javascript/flavours/glitch/features/following/index.js b/app/javascript/flavours/glitch/features/following/index.js index 4ad670105..5af4e60b6 100644 --- a/app/javascript/flavours/glitch/features/following/index.js +++ b/app/javascript/flavours/glitch/features/following/index.js @@ -107,11 +107,11 @@ class Following extends ImmutablePureComponent { setRef = c => { this.column = c; - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; render () { const { accountId, accountIds, hasMore, isAccount, multiColumn, isLoading, suspended, hidden, remote, remoteUrl } = this.props; diff --git a/app/javascript/flavours/glitch/features/getting_started/components/announcements.js b/app/javascript/flavours/glitch/features/getting_started/components/announcements.js index 93f3c9428..5ff4f0523 100644 --- a/app/javascript/flavours/glitch/features/getting_started/components/announcements.js +++ b/app/javascript/flavours/glitch/features/getting_started/components/announcements.js @@ -35,7 +35,7 @@ class Content extends ImmutablePureComponent { setRef = c => { this.node = c; - } + }; componentDidMount () { this._updateLinks(); @@ -89,7 +89,7 @@ class Content extends ImmutablePureComponent { e.preventDefault(); this.context.router.history.push(`/@${mention.get('acct')}`); } - } + }; onHashtagClick = (hashtag, e) => { hashtag = hashtag.replace(/^#/, ''); @@ -98,14 +98,14 @@ class Content extends ImmutablePureComponent { e.preventDefault(); this.context.router.history.push(`/tags/${hashtag}`); } - } + }; onStatusClick = (status, e) => { if (this.context.router && e.button === 0 && !(e.ctrlKey || e.metaKey)) { e.preventDefault(); this.context.router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); } - } + }; handleMouseEnter = ({ currentTarget }) => { if (autoPlayGif) { @@ -118,7 +118,7 @@ class Content extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-original'); } - } + }; handleMouseLeave = ({ currentTarget }) => { if (autoPlayGif) { @@ -131,7 +131,7 @@ class Content extends ImmutablePureComponent { let emoji = emojis[i]; emoji.src = emoji.getAttribute('data-static'); } - } + }; render () { const { announcement } = this.props; @@ -216,11 +216,11 @@ class Reaction extends ImmutablePureComponent { } else { addReaction(announcementId, reaction.get('name')); } - } + }; - handleMouseEnter = () => this.setState({ hovered: true }) + handleMouseEnter = () => this.setState({ hovered: true }); - handleMouseLeave = () => this.setState({ hovered: false }) + handleMouseLeave = () => this.setState({ hovered: false }); render () { const { reaction } = this.props; @@ -254,7 +254,7 @@ class ReactionsBar extends ImmutablePureComponent { handleEmojiPick = data => { const { addReaction, announcementId } = this.props; addReaction(announcementId, data.native.replace(/:/g, '')); - } + }; willEnter () { return { scale: reduceMotion ? 1 : 0 }; @@ -397,15 +397,15 @@ class Announcements extends ImmutablePureComponent { handleChangeIndex = index => { this.setState({ index: index % this.props.announcements.size }); - } + }; handleNextClick = () => { this.setState({ index: (this.state.index + 1) % this.props.announcements.size }); - } + }; handlePrevClick = () => { this.setState({ index: (this.props.announcements.size + this.state.index - 1) % this.props.announcements.size }); - } + }; render () { const { announcements, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/getting_started/index.js b/app/javascript/flavours/glitch/features/getting_started/index.js index f9d79013b..91b33c1dd 100644 --- a/app/javascript/flavours/glitch/features/getting_started/index.js +++ b/app/javascript/flavours/glitch/features/getting_started/index.js @@ -79,9 +79,9 @@ const badgeDisplay = (number, limit) => { const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2); - export default @connect(makeMapStateToProps, mapDispatchToProps) +export default @connect(makeMapStateToProps, mapDispatchToProps) @injectIntl - class GettingStarted extends ImmutablePureComponent { +class GettingStarted extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object.isRequired, @@ -164,7 +164,7 @@ const NAVIGATION_PANEL_BREAKPOINT = 600 + (285 * 2) + (10 * 2);
{lists.filter(list => !columns.find(item => item.get('id') === 'LIST' && item.getIn(['params', 'id']) === list.get('id'))).map(list => - + , )}
, ]); diff --git a/app/javascript/flavours/glitch/features/getting_started_misc/index.js b/app/javascript/flavours/glitch/features/getting_started_misc/index.js index de354d6b1..613b43df7 100644 --- a/app/javascript/flavours/glitch/features/getting_started_misc/index.js +++ b/app/javascript/flavours/glitch/features/getting_started_misc/index.js @@ -35,11 +35,11 @@ class gettingStartedMisc extends ImmutablePureComponent { openOnboardingModal = (e) => { this.props.dispatch(openModal('ONBOARDING')); - } + }; openFeaturedAccountsModal = (e) => { this.props.dispatch(openModal('PINNED_ACCOUNTS_EDITOR')); - } + }; render () { const { intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js b/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js index ede8907e5..ac7863ed3 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js @@ -38,7 +38,7 @@ class ColumnSettings extends React.PureComponent { } else { return tags; } - }; + } onSelect = mode => value => { const oldValue = this.tags(mode); @@ -98,7 +98,7 @@ class ColumnSettings extends React.PureComponent { default: return ''; } - }; + } render () { const { settings, onChange } = this.props; diff --git a/app/javascript/flavours/glitch/features/hashtag_timeline/index.js b/app/javascript/flavours/glitch/features/hashtag_timeline/index.js index 219dc0ec6..54a67804e 100644 --- a/app/javascript/flavours/glitch/features/hashtag_timeline/index.js +++ b/app/javascript/flavours/glitch/features/hashtag_timeline/index.js @@ -54,7 +54,7 @@ class HashtagTimeline extends React.PureComponent { } else { dispatch(addColumn('HASHTAG', { id: this.props.params.id })); } - } + }; title = () => { const { id } = this.props.params; @@ -73,7 +73,7 @@ class HashtagTimeline extends React.PureComponent { } return title; - } + }; additionalFor = (mode) => { const { tags } = this.props.params; @@ -83,16 +83,16 @@ class HashtagTimeline extends React.PureComponent { } else { return ''; } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; _subscribe (dispatch, id, tags = {}, local) { const { signedIn } = this.context.identity; @@ -157,14 +157,14 @@ class HashtagTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { const { dispatch, params } = this.props; const { id, tags, local } = params; dispatch(expandHashtagTimeline(id, { maxId, tags, local })); - } + }; handleFollow = () => { const { dispatch, params, tag } = this.props; @@ -180,7 +180,7 @@ class HashtagTimeline extends React.PureComponent { } else { dispatch(followHashtag(id)); } - } + }; render () { const { hasUnread, columnId, multiColumn, tag, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/home_timeline/index.js b/app/javascript/flavours/glitch/features/home_timeline/index.js index 5ed108ad2..b2bfd3f17 100644 --- a/app/javascript/flavours/glitch/features/home_timeline/index.js +++ b/app/javascript/flavours/glitch/features/home_timeline/index.js @@ -60,24 +60,24 @@ class HomeTimeline extends React.PureComponent { } else { dispatch(addColumn('HOME', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { this.props.dispatch(expandHomeTimeline({ maxId })); - } + }; componentDidMount () { setTimeout(() => this.props.dispatch(fetchAnnouncements()), 700); @@ -116,7 +116,7 @@ class HomeTimeline extends React.PureComponent { handleToggleAnnouncementsClick = (e) => { e.stopPropagation(); this.props.dispatch(toggleShowAnnouncements()); - } + }; render () { const { intl, hasUnread, columnId, multiColumn, hasAnnouncements, unreadAnnouncements, showAnnouncements } = this.props; diff --git a/app/javascript/flavours/glitch/features/interaction_modal/index.js b/app/javascript/flavours/glitch/features/interaction_modal/index.js index b71c041c9..3a54105a3 100644 --- a/app/javascript/flavours/glitch/features/interaction_modal/index.js +++ b/app/javascript/flavours/glitch/features/interaction_modal/index.js @@ -30,14 +30,14 @@ class Copypaste extends React.PureComponent { setRef = c => { this.input = c; - } + }; handleInputClick = () => { this.setState({ copied: false }); this.input.focus(); this.input.select(); this.input.setSelectionRange(0, this.input.value.length); - } + }; handleButtonClick = () => { const { value } = this.props; @@ -45,7 +45,7 @@ class Copypaste extends React.PureComponent { this.input.blur(); this.setState({ copied: true }); this.timeout = setTimeout(() => this.setState({ copied: false }), 700); - } + }; componentWillUnmount () { if (this.timeout) clearTimeout(this.timeout); @@ -86,7 +86,7 @@ class InteractionModal extends React.PureComponent { handleSignupClick = () => { this.props.onSignupClick(); - } + }; render () { const { url, type, displayNameHtml } = this.props; diff --git a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js index a8cab2762..418c2a3e7 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js +++ b/app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js @@ -33,16 +33,16 @@ class ListForm extends React.PureComponent { handleChange = e => { this.props.onChange(e.target.value); - } + }; handleSubmit = e => { e.preventDefault(); this.props.onSubmit(); - } + }; handleClick = () => { this.props.onSubmit(); - } + }; render () { const { value, disabled, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/list_editor/components/search.js b/app/javascript/flavours/glitch/features/list_editor/components/search.js index 192643f77..94782ba69 100644 --- a/app/javascript/flavours/glitch/features/list_editor/components/search.js +++ b/app/javascript/flavours/glitch/features/list_editor/components/search.js @@ -20,17 +20,17 @@ export default class Search extends React.PureComponent { handleChange = e => { this.props.onChange(e.target.value); - } + }; handleKeyUp = e => { if (e.keyCode === 13) { this.props.onSubmit(this.props.value); } - } + }; handleClear = () => { this.props.onClear(); - } + }; render () { const { value, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/list_timeline/index.js b/app/javascript/flavours/glitch/features/list_timeline/index.js index a94c05c56..3f1503548 100644 --- a/app/javascript/flavours/glitch/features/list_timeline/index.js +++ b/app/javascript/flavours/glitch/features/list_timeline/index.js @@ -58,16 +58,16 @@ class ListTimeline extends React.PureComponent { dispatch(addColumn('LIST', { id: this.props.params.id })); this.context.router.history.push('/'); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch } = this.props; @@ -105,16 +105,16 @@ class ListTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { const { id } = this.props.params; this.props.dispatch(expandListTimeline(id, { maxId })); - } + }; handleEditClick = () => { this.props.dispatch(openModal('LIST_EDITOR', { listId: this.props.params.id })); - } + }; handleDeleteClick = () => { const { dispatch, columnId, intl } = this.props; @@ -126,20 +126,20 @@ class ListTimeline extends React.PureComponent { onConfirm: () => { dispatch(deleteList(id)); - if (!!columnId) { + if (columnId) { dispatch(removeColumn(columnId)); } else { this.context.router.history.push('/lists'); } }, })); - } + }; handleRepliesPolicyChange = ({ target }) => { const { dispatch, list } = this.props; const { id } = this.props.params; this.props.dispatch(updateList(id, undefined, false, target.value)); - } + }; render () { const { hasUnread, columnId, multiColumn, list, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/lists/components/new_list_form.js b/app/javascript/flavours/glitch/features/lists/components/new_list_form.js index cc78d30b7..e78a6a3bc 100644 --- a/app/javascript/flavours/glitch/features/lists/components/new_list_form.js +++ b/app/javascript/flavours/glitch/features/lists/components/new_list_form.js @@ -34,16 +34,16 @@ class NewListForm extends React.PureComponent { handleChange = e => { this.props.onChange(e.target.value); - } + }; handleSubmit = e => { e.preventDefault(); this.props.onSubmit(); - } + }; handleClick = () => { this.props.onSubmit(); - } + }; render () { const { value, disabled, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/local_settings/navigation/index.js b/app/javascript/flavours/glitch/features/local_settings/navigation/index.js index 98dda182f..cc1f3df6d 100644 --- a/app/javascript/flavours/glitch/features/local_settings/navigation/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/navigation/index.js @@ -72,7 +72,7 @@ class LocalSettingsNavigation extends React.PureComponent { /> - + - + - + - + @@ -306,7 +306,7 @@ class LocalSettingsPage extends React.PureComponent { defaultMessage='user preferences' /> - ) + ), }} /> @@ -414,7 +414,7 @@ class LocalSettingsPage extends React.PureComponent { onChange={onChange} dependsOn={[['collapsed', 'enabled']]} dependsOnNot={[['collapsed', 'auto', 'all']]} - inputProps={{type: 'number', min: '200', max: '999'}} + inputProps={{ type: 'number', min: '200', max: '999' }} > diff --git a/app/javascript/flavours/glitch/features/local_settings/page/item/index.js b/app/javascript/flavours/glitch/features/local_settings/page/item/index.js index 86da640ba..41c0676a2 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/item/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/page/item/index.js @@ -31,7 +31,7 @@ export default class LocalSettingsPageItem extends React.PureComponent { if (options && options.length > 0) onChange(item, target.value); else if (placeholder) onChange(item, target.value); else onChange(item, target.checked); - } + }; render () { const { handleChange } = this; @@ -55,7 +55,7 @@ export default class LocalSettingsPageItem extends React.PureComponent { let optionId = `${id}--${opt.value}`; return (
diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_report.js b/app/javascript/flavours/glitch/features/notifications/components/admin_report.js index 4662bd953..556df8f66 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/admin_report.js +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_report.js @@ -32,28 +32,28 @@ export default class AdminReport extends ImmutablePureComponent { handleMoveUp = () => { const { notification, onMoveUp } = this.props; onMoveUp(notification.get('id')); - } + }; handleMoveDown = () => { const { notification, onMoveDown } = this.props; onMoveDown(notification.get('id')); - } + }; handleOpen = () => { this.handleOpenProfile(); - } + }; handleOpenProfile = () => { const { notification } = this.props; this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); - } + }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; onMention(notification.get('account'), this.context.router.history); - } + }; getHandlers () { return { diff --git a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js index 355ebef94..ead2a9701 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js +++ b/app/javascript/flavours/glitch/features/notifications/components/admin_signup.js @@ -26,28 +26,28 @@ export default class NotificationFollow extends ImmutablePureComponent { handleMoveUp = () => { const { notification, onMoveUp } = this.props; onMoveUp(notification.get('id')); - } + }; handleMoveDown = () => { const { notification, onMoveDown } = this.props; onMoveDown(notification.get('id')); - } + }; handleOpen = () => { this.handleOpenProfile(); - } + }; handleOpenProfile = () => { const { notification } = this.props; this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); - } + }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; onMention(notification.get('account'), this.context.router.history); - } + }; getHandlers () { return { diff --git a/app/javascript/flavours/glitch/features/notifications/components/column_settings.js b/app/javascript/flavours/glitch/features/notifications/components/column_settings.js index 64fd98bd9..1c04218ba 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/column_settings.js +++ b/app/javascript/flavours/glitch/features/notifications/components/column_settings.js @@ -27,7 +27,7 @@ export default class ColumnSettings extends React.PureComponent { onPushChange = (path, checked) => { this.props.onChange(['push', ...path], checked); - } + }; render () { const { settings, pushSettings, onChange, onClear, alertsEnabled, browserSupport, browserPermission, onRequestNotificationPermission } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/components/follow.js b/app/javascript/flavours/glitch/features/notifications/components/follow.js index b8fad19d0..434d6609d 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/follow.js +++ b/app/javascript/flavours/glitch/features/notifications/components/follow.js @@ -26,28 +26,28 @@ export default class NotificationFollow extends ImmutablePureComponent { handleMoveUp = () => { const { notification, onMoveUp } = this.props; onMoveUp(notification.get('id')); - } + }; handleMoveDown = () => { const { notification, onMoveDown } = this.props; onMoveDown(notification.get('id')); - } + }; handleOpen = () => { this.handleOpenProfile(); - } + }; handleOpenProfile = () => { const { notification } = this.props; this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); - } + }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; onMention(notification.get('account'), this.context.router.history); - } + }; getHandlers () { return { diff --git a/app/javascript/flavours/glitch/features/notifications/components/follow_request.js b/app/javascript/flavours/glitch/features/notifications/components/follow_request.js index 69b92a06f..a3fdf8a61 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/follow_request.js +++ b/app/javascript/flavours/glitch/features/notifications/components/follow_request.js @@ -32,28 +32,28 @@ class FollowRequest extends ImmutablePureComponent { handleMoveUp = () => { const { notification, onMoveUp } = this.props; onMoveUp(notification.get('id')); - } + }; handleMoveDown = () => { const { notification, onMoveDown } = this.props; onMoveDown(notification.get('id')); - } + }; handleOpen = () => { this.handleOpenProfile(); - } + }; handleOpenProfile = () => { const { notification } = this.props; this.context.router.history.push(`/@${notification.getIn(['account', 'acct'])}`); - } + }; handleMention = e => { e.preventDefault(); const { notification, onMention } = this.props; onMention(notification.get('account'), this.context.router.history); - } + }; getHandlers () { return { diff --git a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js index dd163225e..7b6ab0c7d 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js +++ b/app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js @@ -23,11 +23,11 @@ class NotificationsPermissionBanner extends React.PureComponent { handleClick = () => { this.props.dispatch(requestBrowserPermission()); - } + }; handleClose = () => { this.props.dispatch(changeSetting(['notifications', 'dismissPermissionBanner'], true)); - } + }; render () { const { intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/components/overlay.js b/app/javascript/flavours/glitch/features/notifications/components/overlay.js index f3ccafc06..21d3f8acf 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/overlay.js +++ b/app/javascript/flavours/glitch/features/notifications/components/overlay.js @@ -29,7 +29,7 @@ class NotificationOverlay extends ImmutablePureComponent { const mark = !this.props.notification.get('markedForDelete'); const id = this.props.notification.get('id'); this.props.onMarkForDelete(id, mark); - } + }; render () { const { notification, show, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js b/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js index 223b7f75f..2f0b48ef9 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js +++ b/app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js @@ -1,7 +1,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import classNames from 'classnames' +import classNames from 'classnames'; export default class PillBarButton extends React.PureComponent { @@ -12,12 +12,12 @@ export default class PillBarButton extends React.PureComponent { label: PropTypes.node.isRequired, onChange: PropTypes.func.isRequired, disabled: PropTypes.bool, - } + }; onChange = () => { const { settings, settingPath } = this.props; this.props.onChange(settingPath, !settings.getIn(settingPath)); - } + }; render () { const { prefix, settings, settingPath, label, disabled } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js index e472f7c4f..dc7b89b7f 100644 --- a/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js +++ b/app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js @@ -14,11 +14,11 @@ export default class SettingToggle extends React.PureComponent { onChange: PropTypes.func.isRequired, defaultValue: PropTypes.bool, disabled: PropTypes.bool, - } + }; onChange = ({ target }) => { this.props.onChange(this.props.settingPath, target.checked); - } + }; render () { const { prefix, settings, settingPath, label, meta, defaultValue, disabled } = this.props; diff --git a/app/javascript/flavours/glitch/features/notifications/index.js b/app/javascript/flavours/glitch/features/notifications/index.js index fc42a4de4..fff365617 100644 --- a/app/javascript/flavours/glitch/features/notifications/index.js +++ b/app/javascript/flavours/glitch/features/notifications/index.js @@ -158,30 +158,30 @@ class Notifications extends React.PureComponent { } else { dispatch(addColumn('NOTIFICATIONS', {})); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; setColumnRef = c => { this.column = c; - } + }; handleMoveUp = id => { const elementIndex = this.props.notifications.findIndex(item => item !== null && item.get('id') === id) - 1; this._selectChild(elementIndex, true); - } + }; handleMoveDown = id => { const elementIndex = this.props.notifications.findIndex(item => item !== null && item.get('id') === id) + 1; this._selectChild(elementIndex, false); - } + }; _selectChild (index, align_top) { const container = this.column.node; @@ -213,16 +213,16 @@ class Notifications extends React.PureComponent { handleTransitionEndNCD = () => { this.setState({ animatingNCD: false }); - } + }; onEnterCleaningMode = () => { this.setState({ animatingNCD: true }); this.props.onEnterCleaningMode(!this.props.notifCleaningActive); - } + }; handleMarkAsRead = () => { this.props.onMarkAsRead(); - } + }; render () { const { intl, notifications, isLoading, isUnread, columnId, multiColumn, hasMore, numPending, showFilterBar, lastReadId, canMarkAsRead, needsNotificationPermission } = this.props; diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js index f05a763e0..bc312d530 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js +++ b/app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js @@ -114,7 +114,7 @@ class Footer extends ImmutablePureComponent { _performReblog = (privacy) => { const { dispatch, status } = this.props; dispatch(reblog(status, privacy)); - } + }; handleReblogClick = e => { const { dispatch, status } = this.props; @@ -151,7 +151,7 @@ class Footer extends ImmutablePureComponent { } router.history.push(`/@${status.getIn(['account', 'acct'])}/${status.get('id')}`); - } + }; render () { const { status, intl, showReplyCount, withOpenButton } = this.props; diff --git a/app/javascript/flavours/glitch/features/picture_in_picture/index.js b/app/javascript/flavours/glitch/features/picture_in_picture/index.js index 3e6a20faa..d445b6d58 100644 --- a/app/javascript/flavours/glitch/features/picture_in_picture/index.js +++ b/app/javascript/flavours/glitch/features/picture_in_picture/index.js @@ -35,7 +35,7 @@ class PictureInPicture extends React.Component { handleClose = () => { const { dispatch } = this.props; dispatch(removePictureInPicture()); - } + }; render () { const { type, src, currentTime, accountId, statusId, left } = this.props; diff --git a/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js b/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js index 5a1efce0a..db586ecf7 100644 --- a/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js +++ b/app/javascript/flavours/glitch/features/pinned_accounts_editor/containers/search_container.js @@ -4,7 +4,7 @@ import { injectIntl } from 'react-intl'; import { fetchPinnedAccountsSuggestions, clearPinnedAccountsSuggestions, - changePinnedAccountsSuggestions + changePinnedAccountsSuggestions, } from '../../../actions/accounts'; import Search from 'flavours/glitch/features/list_editor/components/search'; diff --git a/app/javascript/flavours/glitch/features/pinned_statuses/index.js b/app/javascript/flavours/glitch/features/pinned_statuses/index.js index eeeab46ab..b7bd46fbe 100644 --- a/app/javascript/flavours/glitch/features/pinned_statuses/index.js +++ b/app/javascript/flavours/glitch/features/pinned_statuses/index.js @@ -37,11 +37,11 @@ class PinnedStatuses extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; render () { const { intl, statusIds, hasMore, multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js index 5091bfb90..97b756658 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/public_timeline/containers/column_settings_container.js @@ -2,7 +2,7 @@ import { connect } from 'react-redux'; import ColumnSettings from '../components/column_settings'; import { changeSetting } from 'flavours/glitch/actions/settings'; import { changeColumnParams } from 'flavours/glitch/actions/columns'; - + const mapStateToProps = (state, { columnId }) => { const uuid = columnId; const columns = state.getIn(['settings', 'columns']); diff --git a/app/javascript/flavours/glitch/features/public_timeline/index.js b/app/javascript/flavours/glitch/features/public_timeline/index.js index a61a47de1..810643f97 100644 --- a/app/javascript/flavours/glitch/features/public_timeline/index.js +++ b/app/javascript/flavours/glitch/features/public_timeline/index.js @@ -68,16 +68,16 @@ class PublicTimeline extends React.PureComponent { } else { dispatch(addColumn(onlyRemote ? 'REMOTE' : 'PUBLIC', { other: { onlyMedia, onlyRemote, allowLocalOnly } })); } - } + }; handleMove = (dir) => { const { columnId, dispatch } = this.props; dispatch(moveColumn(columnId, dir)); - } + }; handleHeaderClick = () => { this.column.scrollTop(); - } + }; componentDidMount () { const { dispatch, onlyMedia, onlyRemote, allowLocalOnly } = this.props; @@ -116,13 +116,13 @@ class PublicTimeline extends React.PureComponent { setRef = c => { this.column = c; - } + }; handleLoadMore = maxId => { const { dispatch, onlyMedia, onlyRemote, allowLocalOnly } = this.props; dispatch(expandPublicTimeline({ maxId, onlyMedia, onlyRemote, allowLocalOnly })); - } + }; render () { const { intl, columnId, hasUnread, multiColumn, onlyMedia, onlyRemote, allowLocalOnly } = this.props; diff --git a/app/javascript/flavours/glitch/features/reblogs/index.js b/app/javascript/flavours/glitch/features/reblogs/index.js index b097ff9d7..46b1ed4e5 100644 --- a/app/javascript/flavours/glitch/features/reblogs/index.js +++ b/app/javascript/flavours/glitch/features/reblogs/index.js @@ -48,15 +48,15 @@ class Reblogs extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; setRef = c => { this.column = c; - } + }; handleRefresh = () => { this.props.dispatch(fetchReblogs(this.props.params.statusId)); - } + }; render () { const { intl, accountIds, multiColumn } = this.props; diff --git a/app/javascript/flavours/glitch/features/report/components/option.js b/app/javascript/flavours/glitch/features/report/components/option.js index 7e94f0654..6ecfc7a24 100644 --- a/app/javascript/flavours/glitch/features/report/components/option.js +++ b/app/javascript/flavours/glitch/features/report/components/option.js @@ -24,12 +24,12 @@ export default class Option extends React.PureComponent { e.preventDefault(); onToggle(value, !checked); } - } + }; handleChange = e => { const { value, onToggle } = this.props; onToggle(value, e.target.checked); - } + }; render () { const { name, value, checked, label, labelComponent, description, multiple } = this.props; diff --git a/app/javascript/flavours/glitch/features/status/components/action_bar.js b/app/javascript/flavours/glitch/features/status/components/action_bar.js index 73913dd49..4901fc4cc 100644 --- a/app/javascript/flavours/glitch/features/status/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/status/components/action_bar.js @@ -68,75 +68,75 @@ class ActionBar extends React.PureComponent { handleReplyClick = () => { this.props.onReply(this.props.status); - } + }; handleReblogClick = (e) => { this.props.onReblog(this.props.status, e); - } + }; handleFavouriteClick = (e) => { this.props.onFavourite(this.props.status, e); - } + }; handleBookmarkClick = (e) => { this.props.onBookmark(this.props.status, e); - } + }; handleDeleteClick = () => { this.props.onDelete(this.props.status, this.context.router.history); - } + }; handleRedraftClick = () => { this.props.onDelete(this.props.status, this.context.router.history, true); - } + }; handleEditClick = () => { this.props.onEdit(this.props.status, this.context.router.history); - } + }; handleDirectClick = () => { this.props.onDirect(this.props.status.get('account'), this.context.router.history); - } + }; handleMentionClick = () => { this.props.onMention(this.props.status.get('account'), this.context.router.history); - } + }; handleMuteClick = () => { this.props.onMute(this.props.status.get('account')); - } + }; handleConversationMuteClick = () => { this.props.onMuteConversation(this.props.status); - } + }; handleBlockClick = () => { this.props.onBlock(this.props.status); - } + }; handleReport = () => { this.props.onReport(this.props.status); - } + }; handlePinClick = () => { this.props.onPin(this.props.status); - } + }; handleShare = () => { navigator.share({ text: this.props.status.get('search_index'), url: this.props.status.get('url'), }); - } + }; handleEmbed = () => { this.props.onEmbed(this.props.status); - } + }; handleCopy = () => { const url = this.props.status.get('url'); navigator.clipboard.writeText(url); - } + }; render () { const { status, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/status/components/card.js b/app/javascript/flavours/glitch/features/status/components/card.js index 2d2e49eb8..6a306ed14 100644 --- a/app/javascript/flavours/glitch/features/status/components/card.js +++ b/app/javascript/flavours/glitch/features/status/components/card.js @@ -138,7 +138,7 @@ export default class Card extends React.PureComponent { } else { this.setState({ embedded: true }); } - } + }; setRef = c => { this.node = c; @@ -146,17 +146,17 @@ export default class Card extends React.PureComponent { if (this.node) { this._setDimensions(); } - } + }; handleImageLoad = () => { this.setState({ previewLoaded: true }); - } + }; handleReveal = e => { e.preventDefault(); e.stopPropagation(); this.setState({ revealed: true }); - } + }; renderVideo () { const { card } = this.props; diff --git a/app/javascript/flavours/glitch/features/status/components/detailed_status.js b/app/javascript/flavours/glitch/features/status/components/detailed_status.js index 907fc3f1c..644881fa5 100644 --- a/app/javascript/flavours/glitch/features/status/components/detailed_status.js +++ b/app/javascript/flavours/glitch/features/status/components/detailed_status.js @@ -56,28 +56,28 @@ class DetailedStatus extends ImmutablePureComponent { handleAccountClick = (e) => { if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.context.router) { e.preventDefault(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); } e.stopPropagation(); - } + }; parseClick = (e, destination) => { if (e.button === 0 && !(e.ctrlKey || e.altKey || e.metaKey) && this.context.router) { e.preventDefault(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(destination, state); } e.stopPropagation(); - } + }; handleOpenVideo = (options) => { this.props.onOpenVideo(this.props.status.getIn(['media_attachments', 0]), options); - } + }; _measureHeight (heightJustChanged) { if (this.props.measureHeight && this.node) { @@ -92,7 +92,7 @@ class DetailedStatus extends ImmutablePureComponent { setRef = c => { this.node = c; this._measureHeight(); - } + }; componentDidUpdate (prevProps, prevState) { this._measureHeight(prevState.height !== this.state.height); @@ -100,7 +100,7 @@ class DetailedStatus extends ImmutablePureComponent { handleChildUpdate = () => { this._measureHeight(); - } + }; handleModalLink = e => { e.preventDefault(); @@ -114,12 +114,12 @@ class DetailedStatus extends ImmutablePureComponent { } window.open(href, 'mastodon-intent', 'width=445,height=600,resizable=no,menubar=no,status=no,scrollbars=yes'); - } + }; handleTranslate = () => { const { onTranslate, status } = this.props; onTranslate(status); - } + }; render () { const status = (this.props.status && this.props.status.get('reblog')) ? this.props.status.get('reblog') : this.props.status; diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js index c22e7f0bd..9b49d41e4 100644 --- a/app/javascript/flavours/glitch/features/status/index.js +++ b/app/javascript/flavours/glitch/features/status/index.js @@ -263,15 +263,15 @@ class Status extends ImmutablePureComponent { } else if (this.props.status.get('spoiler_text')) { this.setExpansion(!this.state.isExpanded); } - } + }; handleToggleMediaVisibility = () => { this.setState({ showMedia: !this.state.showMedia }); - } + }; handleModalFavourite = (status) => { this.props.dispatch(favourite(status)); - } + }; handleFavouriteClick = (status, e) => { const { dispatch } = this.props; @@ -294,7 +294,7 @@ class Status extends ImmutablePureComponent { url: status.get('url'), })); } - } + }; handlePin = (status) => { if (status.get('pinned')) { @@ -302,7 +302,7 @@ class Status extends ImmutablePureComponent { } else { this.props.dispatch(pin(status)); } - } + }; handleReplyClick = (status) => { const { askReplyConfirmation, dispatch, intl } = this.props; @@ -326,7 +326,7 @@ class Status extends ImmutablePureComponent { url: status.get('url'), })); } - } + }; handleModalReblog = (status, privacy) => { const { dispatch } = this.props; @@ -336,7 +336,7 @@ class Status extends ImmutablePureComponent { } else { dispatch(reblog(status, privacy)); } - } + }; handleReblogClick = (status, e) => { const { settings, dispatch } = this.props; @@ -357,7 +357,7 @@ class Status extends ImmutablePureComponent { url: status.get('url'), })); } - } + }; handleBookmarkClick = (status) => { if (status.get('bookmarked')) { @@ -365,7 +365,7 @@ class Status extends ImmutablePureComponent { } else { this.props.dispatch(bookmark(status)); } - } + }; handleDeleteClick = (status, history, withRedraft = false) => { const { dispatch, intl } = this.props; @@ -379,27 +379,27 @@ class Status extends ImmutablePureComponent { onConfirm: () => dispatch(deleteStatus(status.get('id'), history, withRedraft)), })); } - } + }; handleEditClick = (status, history) => { this.props.dispatch(editStatus(status.get('id'), history)); - } + }; handleDirectClick = (account, router) => { this.props.dispatch(directCompose(account, router)); - } + }; handleMentionClick = (account, router) => { this.props.dispatch(mentionCompose(account, router)); - } + }; handleOpenMedia = (media, index) => { this.props.dispatch(openModal('MEDIA', { statusId: this.props.status.get('id'), media, index })); - } + }; handleOpenVideo = (media, options) => { this.props.dispatch(openModal('VIDEO', { statusId: this.props.status.get('id'), media, options })); - } + }; handleHotkeyOpenMedia = e => { const { status } = this.props; @@ -413,11 +413,11 @@ class Status extends ImmutablePureComponent { this.handleOpenMedia(status.get('media_attachments'), 0); } } - } + }; handleMuteClick = (account) => { this.props.dispatch(initMuteModal(account)); - } + }; handleConversationMuteClick = (status) => { if (status.get('muted')) { @@ -425,7 +425,7 @@ class Status extends ImmutablePureComponent { } else { this.props.dispatch(muteStatus(status.get('id'))); } - } + }; handleToggleAll = () => { const { status, ancestorsIds, descendantsIds, settings } = this.props; @@ -442,7 +442,7 @@ class Status extends ImmutablePureComponent { } this.setState({ isExpanded: !isExpanded, threadExpanded: !isExpanded }); - } + }; handleTranslate = status => { const { dispatch } = this.props; @@ -452,61 +452,61 @@ class Status extends ImmutablePureComponent { } else { dispatch(translateStatus(status.get('id'))); } - } + }; handleBlockClick = (status) => { const { dispatch } = this.props; const account = status.get('account'); dispatch(initBlockModal(account)); - } + }; handleReport = (status) => { this.props.dispatch(initReport(status.get('account'), status)); - } + }; handleEmbed = (status) => { this.props.dispatch(openModal('EMBED', { url: status.get('url') })); - } + }; handleHotkeyToggleSensitive = () => { this.handleToggleMediaVisibility(); - } + }; handleHotkeyMoveUp = () => { this.handleMoveUp(this.props.status.get('id')); - } + }; handleHotkeyMoveDown = () => { this.handleMoveDown(this.props.status.get('id')); - } + }; handleHotkeyReply = e => { e.preventDefault(); this.handleReplyClick(this.props.status); - } + }; handleHotkeyFavourite = () => { this.handleFavouriteClick(this.props.status); - } + }; handleHotkeyBoost = () => { this.handleReblogClick(this.props.status); - } + }; handleHotkeyBookmark = () => { this.handleBookmarkClick(this.props.status); - } + }; handleHotkeyMention = e => { e.preventDefault(); this.handleMentionClick(this.props.status); - } + }; handleHotkeyOpenProfile = () => { - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); - } + }; handleMoveUp = id => { const { status, ancestorsIds, descendantsIds } = this.props; @@ -523,7 +523,7 @@ class Status extends ImmutablePureComponent { this._selectChild(index - 1, true); } } - } + }; handleMoveDown = id => { const { status, ancestorsIds, descendantsIds } = this.props; @@ -540,7 +540,7 @@ class Status extends ImmutablePureComponent { this._selectChild(index + 1, false); } } - } + }; _selectChild (index, align_top) { const container = this.node; @@ -558,7 +558,7 @@ class Status extends ImmutablePureComponent { handleHeaderClick = () => { this.column.scrollTop(); - } + }; renderChildren (list) { return list.map(id => ( @@ -575,15 +575,15 @@ class Status extends ImmutablePureComponent { setExpansion = value => { this.setState({ isExpanded: value }); - } + }; setRef = c => { this.node = c; - } + }; setColumnRef = c => { this.column = c; - } + }; componentDidUpdate (prevProps) { if (this.props.params.statusId && (this.props.params.statusId !== prevProps.params.statusId || prevProps.ancestorsIds.size < this.props.ancestorsIds.size)) { @@ -605,7 +605,7 @@ class Status extends ImmutablePureComponent { onFullScreenChange = () => { this.setState({ fullscreen: isFullscreen() }); - } + }; render () { let ancestors, descendants; diff --git a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js index fa69d82a4..35083503c 100644 --- a/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js +++ b/app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js @@ -72,7 +72,7 @@ class SubscribedLanguagesModal extends ImmutablePureComponent { handleSubmit = () => { this.props.onSubmit(this.state.selectedLanguages.toArray()); this.props.onClose(); - } + }; renderItem (value) { const language = this.props.languages.find(language => language[0] === value); diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js index aae2e4426..c6e3ee37c 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js @@ -52,7 +52,7 @@ export default class ActionsModal extends ImmutablePureComponent { ); - } + }; render () { const status = this.props.status && ( diff --git a/app/javascript/flavours/glitch/features/ui/components/block_modal.js b/app/javascript/flavours/glitch/features/ui/components/block_modal.js index a07baeaa6..6c9d2043c 100644 --- a/app/javascript/flavours/glitch/features/ui/components/block_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/block_modal.js @@ -55,20 +55,20 @@ class BlockModal extends React.PureComponent { handleClick = () => { this.props.onClose(); this.props.onConfirm(this.props.account); - } + }; handleSecondary = () => { this.props.onClose(); this.props.onBlockAndReport(this.props.account); - } + }; handleCancel = () => { this.props.onClose(); - } + }; setRef = (c) => { this.button = c; - } + }; render () { const { account } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/boost_modal.js b/app/javascript/flavours/glitch/features/ui/components/boost_modal.js index 8d9496bb9..a65b84e20 100644 --- a/app/javascript/flavours/glitch/features/ui/components/boost_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/boost_modal.js @@ -58,17 +58,17 @@ class BoostModal extends ImmutablePureComponent { handleReblog = () => { this.props.onReblog(this.props.status, this.props.privacy); this.props.onClose(); - } + }; handleAccountClick = (e) => { if (e.button === 0) { e.preventDefault(); this.props.onClose(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); } - } + }; _findContainer = () => { return document.getElementsByClassName('modal-root__container')[0]; @@ -76,7 +76,7 @@ class BoostModal extends ImmutablePureComponent { setRef = (c) => { this.button = c; - } + }; render () { const { status, missingMediaDescription, privacy, intl } = this.props; @@ -116,9 +116,9 @@ class BoostModal extends ImmutablePureComponent {
{ missingMediaDescription ? - + : - Shift + }} /> + Shift + }} /> }
diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle.js b/app/javascript/flavours/glitch/features/ui/components/bundle.js index 8f0d7b8b1..27b13ecfe 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle.js +++ b/app/javascript/flavours/glitch/features/ui/components/bundle.js @@ -15,7 +15,7 @@ class Bundle extends React.Component { onFetch: PropTypes.func, onFetchSuccess: PropTypes.func, onFetchFail: PropTypes.func, - } + }; static defaultProps = { loading: emptyComponent, @@ -24,14 +24,14 @@ class Bundle extends React.Component { onFetch: noop, onFetchSuccess: noop, onFetchFail: noop, - } + }; - static cache = {} + static cache = {}; state = { mod: undefined, forceRender: false, - } + }; componentWillMount() { this.load(this.props); @@ -84,7 +84,7 @@ class Bundle extends React.Component { this.setState({ mod: null }); onFetchFail(error); }); - } + }; render() { const { loading: Loading, error: Error, children, renderDelay } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js b/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js index 7cbe1413d..88304dc36 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js +++ b/app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js @@ -31,7 +31,7 @@ class GIF extends React.PureComponent { if (!animate) { this.setState({ hovering: true }); } - } + }; handleMouseLeave = () => { const { animate } = this.props; @@ -39,7 +39,7 @@ class GIF extends React.PureComponent { if (!animate) { this.setState({ hovering: false }); } - } + }; render () { const { src, staticSrc, className, animate } = this.props; @@ -75,7 +75,7 @@ class CopyButton extends React.PureComponent { navigator.clipboard.writeText(value); this.setState({ copied: true }); this.timeout = setTimeout(() => this.setState({ copied: false }), 700); - } + }; componentWillUnmount () { if (this.timeout) clearTimeout(this.timeout); @@ -113,7 +113,7 @@ class BundleColumnError extends React.PureComponent { if (onRetry) { onRetry(); } - } + }; render () { const { errorType, multiColumn, stacktrace } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js b/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js index 2c14a1e5c..b79105450 100644 --- a/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js +++ b/app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js @@ -16,11 +16,11 @@ class BundleModalError extends React.Component { onRetry: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, - } + }; handleRetry = () => { this.props.onRetry(); - } + }; render () { const { onClose, intl: { formatMessage } } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/column.js b/app/javascript/flavours/glitch/features/ui/components/column.js index e9c1e2f87..cc2abc43a 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column.js +++ b/app/javascript/flavours/glitch/features/ui/components/column.js @@ -25,7 +25,7 @@ export default class Column extends React.PureComponent { } this._interruptScrollAnimation = scrollTop(scrollable); - } + }; scrollTop () { const scrollable = this.props.bindToDocument ? document.scrollingElement : this.node.querySelector('.scrollable'); @@ -42,11 +42,11 @@ export default class Column extends React.PureComponent { if (typeof this._interruptScrollAnimation !== 'undefined') { this._interruptScrollAnimation(); } - }, 200) + }, 200); setRef = (c) => { this.node = c; - } + }; render () { const { heading, icon, children, active, hideHeadingOnMobile, name } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/column_header.js b/app/javascript/flavours/glitch/features/ui/components/column_header.js index 528ff73a6..151476f8b 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column_header.js +++ b/app/javascript/flavours/glitch/features/ui/components/column_header.js @@ -15,7 +15,7 @@ export default class ColumnHeader extends React.PureComponent { handleClick = () => { this.props.onClick(); - } + }; render () { const { icon, type, active, columnHeaderId } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/column_link.js b/app/javascript/flavours/glitch/features/ui/components/column_link.js index bd1c20b47..dcdac077f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/column_link.js +++ b/app/javascript/flavours/glitch/features/ui/components/column_link.js @@ -30,7 +30,7 @@ const ColumnLink = ({ icon, text, to, onClick, href, method, badge, transparent, e.preventDefault(); e.stopPropagation(); return onClick(e); - } + }; return ( {iconElement} diff --git a/app/javascript/flavours/glitch/features/ui/components/columns_area.js b/app/javascript/flavours/glitch/features/ui/components/columns_area.js index 993a50796..3b3b0d58f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/columns_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/columns_area.js @@ -59,7 +59,7 @@ export default class ColumnsArea extends ImmutablePureComponent { state = { renderComposePanel: !(this.mediaQuery && this.mediaQuery.matches), - } + }; componentDidMount() { if (!this.props.singleColumn) { @@ -113,7 +113,7 @@ export default class ColumnsArea extends ImmutablePureComponent { handleLayoutChange = (e) => { this.setState({ renderComposePanel: !e.matches }); - } + }; handleWheel = () => { if (typeof this._interruptScrollAnimation !== 'function') { @@ -121,19 +121,19 @@ export default class ColumnsArea extends ImmutablePureComponent { } this._interruptScrollAnimation(); - } + }; setRef = (node) => { this.node = node; - } + }; renderLoading = columnId => () => { return columnId === 'COMPOSE' ? : ; - } + }; renderError = (props) => { return ; - } + }; render () { const { columns, children, singleColumn, navbarUnder, openSettings } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js index dde252a61..34c194c99 100644 --- a/app/javascript/flavours/glitch/features/ui/components/compose_panel.js +++ b/app/javascript/flavours/glitch/features/ui/components/compose_panel.js @@ -55,4 +55,4 @@ class ComposePanel extends React.PureComponent { ); } -}; +} diff --git a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js index a665b9fb1..94935de5d 100644 --- a/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js @@ -34,24 +34,24 @@ class ConfirmationModal extends React.PureComponent { if (this.props.onDoNotAsk && this.doNotAskCheckbox.checked) { this.props.onDoNotAsk(); } - } + }; handleSecondary = () => { this.props.onClose(); this.props.onSecondary(); - } + }; handleCancel = () => { this.props.onClose(); - } + }; setRef = (c) => { this.button = c; - } + }; setDoNotAskRef = (c) => { this.doNotAskCheckbox = c; - } + }; render () { const { message, confirm, secondary, onDoNotAsk } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js b/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js index 68f04cb21..37f52b014 100644 --- a/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js @@ -30,11 +30,11 @@ class DeprecatedSettingsModal extends React.PureComponent { handleClick = () => { this.props.onConfirm(); this.props.onClose(); - } + }; setRef = (c) => { this.button = c; - } + }; render () { const { settings, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js b/app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js index c861d4d81..35933bedb 100644 --- a/app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js +++ b/app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js @@ -46,7 +46,7 @@ class DisabledAccountBanner extends React.PureComponent { this.props.onLogout(); return false; - } + }; render () { const { disabledAcct, movedToAcct } = this.props; @@ -89,4 +89,4 @@ class DisabledAccountBanner extends React.PureComponent { ); } -}; +} diff --git a/app/javascript/flavours/glitch/features/ui/components/doodle_modal.js b/app/javascript/flavours/glitch/features/ui/components/doodle_modal.js index 0d10204fc..c8ea33a0e 100644 --- a/app/javascript/flavours/glitch/features/ui/components/doodle_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/doodle_modal.js @@ -279,7 +279,7 @@ class DoodleModal extends ImmutablePureComponent { this.swapped = false; window.addEventListener('keyup', this.handleKeyUp, false); window.addEventListener('keydown', this.handleKeyDown, false); - }; + } /** * Tear component down @@ -575,7 +575,7 @@ class DoodleModal extends ImmutablePureComponent {
@@ -602,7 +602,7 @@ class DoodleModal extends ImmutablePureComponent { 'foreground': this.fg === c[0], 'background': this.bg === c[0], })} - /> + />, ) }
diff --git a/app/javascript/flavours/glitch/features/ui/components/embed_modal.js b/app/javascript/flavours/glitch/features/ui/components/embed_modal.js index 624b68f7e..92bfa79c4 100644 --- a/app/javascript/flavours/glitch/features/ui/components/embed_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/embed_modal.js @@ -17,7 +17,7 @@ class EmbedModal extends ImmutablePureComponent { onClose: PropTypes.func.isRequired, onError: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, - } + }; state = { loading: false, @@ -48,11 +48,11 @@ class EmbedModal extends ImmutablePureComponent { setIframeRef = c => { this.iframe = c; - } + }; handleTextareaClick = (e) => { e.target.select(); - } + }; render () { const { intl, onClose } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js index d7f671d58..78cbfeb51 100644 --- a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js @@ -38,21 +38,21 @@ class FavouriteModal extends ImmutablePureComponent { handleFavourite = () => { this.props.onFavourite(this.props.status); this.props.onClose(); - } + }; handleAccountClick = (e) => { if (e.button === 0) { e.preventDefault(); this.props.onClose(); - let state = {...this.context.router.history.location.state}; + let state = { ...this.context.router.history.location.state }; state.mastodonBackSteps = (state.mastodonBackSteps || 0) + 1; this.context.router.history.push(`/@${this.props.status.getIn(['account', 'acct'])}`, state); } - } + }; setRef = (c) => { this.button = c; - } + }; render () { const { status, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js index 9eb1c0fbf..e36657fab 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js @@ -135,7 +135,7 @@ class FocalPointModal extends ImmutablePureComponent { this.updatePosition(e); this.setState({ dragging: true }); - } + }; handleTouchStart = e => { document.addEventListener('touchmove', this.handleMouseMove); @@ -143,25 +143,25 @@ class FocalPointModal extends ImmutablePureComponent { this.updatePosition(e); this.setState({ dragging: true }); - } + }; handleMouseMove = e => { this.updatePosition(e); - } + }; handleMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseMove); document.removeEventListener('mouseup', this.handleMouseUp); this.setState({ dragging: false }); - } + }; handleTouchEnd = () => { document.removeEventListener('touchmove', this.handleMouseMove); document.removeEventListener('touchend', this.handleTouchEnd); this.setState({ dragging: false }); - } + }; updatePosition = e => { const { x, y } = getPointerPosition(this.node, e); @@ -169,11 +169,11 @@ class FocalPointModal extends ImmutablePureComponent { const focusY = (y - .5) * -2; this.props.onChangeFocus(focusX, focusY); - } + }; handleChange = e => { this.props.onChangeDescription(e.target.value); - } + }; handleKeyDown = (e) => { if (e.keyCode === 13 && (e.ctrlKey || e.metaKey)) { @@ -182,11 +182,11 @@ class FocalPointModal extends ImmutablePureComponent { this.props.onChangeDescription(e.target.value); this.handleSubmit(); } - } + }; handleSubmit = () => { this.props.onSave(this.props.description, this.props.focusX, this.props.focusY); - } + }; getCloseConfirmationMessage = () => { const { intl, dirty } = this.props; @@ -199,15 +199,15 @@ class FocalPointModal extends ImmutablePureComponent { } else { return null; } - } + }; setRef = c => { this.node = c; - } + }; handleTextDetection = () => { this._detectText(); - } + }; _detectText = (refreshCache = false) => { const { media } = this.props; @@ -258,21 +258,21 @@ class FocalPointModal extends ImmutablePureComponent { console.error(e); this.setState({ detecting: false }); }); - } + }; handleThumbnailChange = e => { if (e.target.files.length > 0) { this.props.onSelectThumbnail(e.target.files); } - } + }; setFileInputRef = c => { this.fileInput = c; - } + }; handleFileInputClick = () => { this.fileInput.click(); - } + }; render () { const { media, intl, account, onClose, isUploadingThumbnail, description, lang, focusX, focusY, dirty, is_changing_upload } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/image_loader.js b/app/javascript/flavours/glitch/features/ui/components/image_loader.js index dfa0efe49..92aeef5c4 100644 --- a/app/javascript/flavours/glitch/features/ui/components/image_loader.js +++ b/app/javascript/flavours/glitch/features/ui/components/image_loader.js @@ -14,7 +14,7 @@ export default class ImageLoader extends PureComponent { height: PropTypes.number, onClick: PropTypes.func, zoomButtonHidden: PropTypes.bool, - } + }; static defaultProps = { alt: '', @@ -26,7 +26,7 @@ export default class ImageLoader extends PureComponent { loading: true, error: false, width: null, - } + }; removers = []; canvas = null; @@ -86,7 +86,7 @@ export default class ImageLoader extends PureComponent { image.addEventListener('load', handleLoad); image.src = previewSrc; this.removers.push(removeEventListeners); - }) + }); clearPreviewCanvas () { const { width, height } = this.canvas; @@ -126,7 +126,7 @@ export default class ImageLoader extends PureComponent { setCanvasRef = c => { this.canvas = c; if (c) this.setState({ width: c.offsetWidth }); - } + }; render () { const { alt, src, width, height, onClick } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/link_footer.js b/app/javascript/flavours/glitch/features/ui/components/link_footer.js index ac0c78674..c4bea9f31 100644 --- a/app/javascript/flavours/glitch/features/ui/components/link_footer.js +++ b/app/javascript/flavours/glitch/features/ui/components/link_footer.js @@ -44,7 +44,7 @@ class LinkFooter extends React.PureComponent { this.props.onLogout(); return false; - } + }; render () { const { signedIn, permissions } = this.context.identity; @@ -93,4 +93,4 @@ class LinkFooter extends React.PureComponent { ); } -}; +} diff --git a/app/javascript/flavours/glitch/features/ui/components/media_modal.js b/app/javascript/flavours/glitch/features/ui/components/media_modal.js index ec3af857d..24559264e 100644 --- a/app/javascript/flavours/glitch/features/ui/components/media_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/media_modal.js @@ -47,27 +47,27 @@ class MediaModal extends ImmutablePureComponent { handleSwipe = (index) => { this.setState({ index: index % this.props.media.size }); - } + }; handleTransitionEnd = () => { this.setState({ zoomButtonHidden: false, }); - } + }; handleNextClick = () => { this.setState({ index: (this.getIndex() + 1) % this.props.media.size, zoomButtonHidden: true, }); - } + }; handlePrevClick = () => { this.setState({ index: (this.props.media.size + this.getIndex() - 1) % this.props.media.size, zoomButtonHidden: true, }); - } + }; handleChangeIndex = (e) => { const index = Number(e.currentTarget.getAttribute('data-index')); @@ -76,7 +76,7 @@ class MediaModal extends ImmutablePureComponent { index: index % this.props.media.size, zoomButtonHidden: true, }); - } + }; handleKeyDown = (e) => { switch(e.key) { @@ -91,7 +91,7 @@ class MediaModal extends ImmutablePureComponent { e.stopPropagation(); break; } - } + }; componentDidMount () { window.addEventListener('keydown', this.handleKeyDown, false); diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_root.js b/app/javascript/flavours/glitch/features/ui/components/modal_root.js index 379f57cbb..d04a2d53a 100644 --- a/app/javascript/flavours/glitch/features/ui/components/modal_root.js +++ b/app/javascript/flavours/glitch/features/ui/components/modal_root.js @@ -76,7 +76,7 @@ export default class ModalRoot extends React.PureComponent { }; componentDidUpdate () { - if (!!this.props.type) { + if (this.props.type) { document.body.classList.add('with-modals--active'); document.documentElement.style.marginRight = `${getScrollbarWidth()}px`; } else { @@ -87,17 +87,17 @@ export default class ModalRoot extends React.PureComponent { setBackgroundColor = color => { this.setState({ backgroundColor: color }); - } + }; renderLoading = modalId => () => { return ['MEDIA', 'VIDEO', 'BOOST', 'FAVOURITE', 'DOODLE', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? : null; - } + }; renderError = (props) => { const { onClose } = this.props; return ; - } + }; handleClose = (ignoreFocus = false) => { const { onClose } = this.props; @@ -110,14 +110,14 @@ export default class ModalRoot extends React.PureComponent { // This would be much smoother with react-intl 3+ and `forwardRef`. } onClose(message, ignoreFocus); - } + }; setModalRef = (c) => { this._modal = c; - } + }; // prevent closing of modal when clicking the overlay - noop = () => {} + noop = () => {}; render () { const { type, props, ignoreFocus } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/mute_modal.js b/app/javascript/flavours/glitch/features/ui/components/mute_modal.js index 7d25db316..f8bb9a364 100644 --- a/app/javascript/flavours/glitch/features/ui/components/mute_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/mute_modal.js @@ -65,23 +65,23 @@ class MuteModal extends React.PureComponent { handleClick = () => { this.props.onClose(); this.props.onConfirm(this.props.account, this.props.notifications, this.props.muteDuration); - } + }; handleCancel = () => { this.props.onClose(); - } + }; setRef = (c) => { this.button = c; - } + }; toggleNotifications = () => { this.props.onToggleNotifications(); - } + }; changeMuteDuration = (e) => { this.props.onChangeMuteDuration(e); - } + }; render () { const { account, notifications, muteDuration, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js b/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js index 611fae1ce..d972fe3b5 100644 --- a/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js @@ -49,7 +49,7 @@ const PageTwo = ({ intl, myAccount }) => ( privacy='public' text='Awoo! #introductions' spoilerText='' - suggestions={ [] } + suggestions={[]} />
@@ -195,7 +195,7 @@ class OnboardingModal extends React.PureComponent { , , ]; - }; + } componentDidMount() { window.addEventListener('keyup', this.handleKeyUp); @@ -208,30 +208,30 @@ class OnboardingModal extends React.PureComponent { handleSkip = (e) => { e.preventDefault(); this.props.onClose(); - } + }; handleDot = (e) => { const i = Number(e.currentTarget.getAttribute('data-index')); e.preventDefault(); this.setState({ currentIndex: i }); - } + }; handlePrev = () => { this.setState(({ currentIndex }) => ({ currentIndex: Math.max(0, currentIndex - 1), })); - } + }; handleNext = () => { const { pages } = this; this.setState(({ currentIndex }) => ({ currentIndex: Math.min(currentIndex + 1, pages.length - 1), })); - } + }; handleSwipe = (index) => { this.setState({ currentIndex: index }); - } + }; handleKeyUp = ({ key }) => { switch (key) { @@ -242,11 +242,11 @@ class OnboardingModal extends React.PureComponent { this.handleNext(); break; } - } + }; handleClose = () => { this.props.onClose(); - } + }; render () { const { pages } = this; diff --git a/app/javascript/flavours/glitch/features/ui/components/report_modal.js b/app/javascript/flavours/glitch/features/ui/components/report_modal.js index 7b6a4a784..4d7f84bae 100644 --- a/app/javascript/flavours/glitch/features/ui/components/report_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/report_modal.js @@ -96,7 +96,7 @@ class ReportModal extends ImmutablePureComponent { } else { this.setState({ selectedRuleIds: selectedRuleIds.remove(ruleId) }); } - } + }; handleChangeCategory = category => { this.setState({ category }); diff --git a/app/javascript/flavours/glitch/features/ui/components/upload_area.js b/app/javascript/flavours/glitch/features/ui/components/upload_area.js index 6958ba9df..0e07b67f8 100644 --- a/app/javascript/flavours/glitch/features/ui/components/upload_area.js +++ b/app/javascript/flavours/glitch/features/ui/components/upload_area.js @@ -22,7 +22,7 @@ export default class UploadArea extends React.PureComponent { break; } } - } + }; componentDidMount () { window.addEventListener('keyup', this.handleKeyUp, false); diff --git a/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js b/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js index caeeced64..50b36b478 100644 --- a/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js +++ b/app/javascript/flavours/glitch/features/ui/components/zoomable_image.js @@ -102,7 +102,7 @@ class ZoomableImage extends React.PureComponent { onClick: PropTypes.func, zoomButtonHidden: PropTypes.bool, intl: PropTypes.object.isRequired, - } + }; static defaultProps = { alt: '', @@ -132,7 +132,7 @@ class ZoomableImage extends React.PureComponent { dragged: false, lockScroll: { x: 0, y: 0 }, lockTranslate: { x: 0, y: 0 }, - } + }; removers = []; container = null; @@ -212,7 +212,7 @@ class ZoomableImage extends React.PureComponent { // lock horizontal scroll this.container.scrollLeft = Math.max(this.container.scrollLeft + event.pixelX, this.state.lockScroll.x); - } + }; mouseDownHandler = e => { this.container.style.cursor = 'grabbing'; @@ -228,7 +228,7 @@ class ZoomableImage extends React.PureComponent { this.image.addEventListener('mousemove', this.mouseMoveHandler); this.image.addEventListener('mouseup', this.mouseUpHandler); - } + }; mouseMoveHandler = e => { const dx = e.clientX - this.state.dragPosition.x; @@ -238,7 +238,7 @@ class ZoomableImage extends React.PureComponent { this.container.scrollTop = Math.max(this.state.dragPosition.top - dy, this.state.lockScroll.y); this.setState({ dragged: true }); - } + }; mouseUpHandler = () => { this.container.style.cursor = 'grab'; @@ -246,13 +246,13 @@ class ZoomableImage extends React.PureComponent { this.image.removeEventListener('mousemove', this.mouseMoveHandler); this.image.removeEventListener('mouseup', this.mouseUpHandler); - } + }; handleTouchStart = e => { if (e.touches.length !== 2) return; this.lastDistance = getDistance(...e.touches); - } + }; handleTouchMove = e => { const { scrollTop, scrollHeight, clientHeight } = this.container; @@ -275,7 +275,7 @@ class ZoomableImage extends React.PureComponent { this.lastMidpoint = midpoint; this.lastDistance = distance; - } + }; zoom(nextScale, midpoint) { const { scale, zoomMatrix } = this.state; @@ -314,11 +314,11 @@ class ZoomableImage extends React.PureComponent { const handler = this.props.onClick; if (handler) handler(); this.setState({ navigationHidden: !this.state.navigationHidden }); - } + }; handleMouseDown = e => { e.preventDefault(); - } + }; initZoomMatrix = () => { const { width, height } = this.props; @@ -350,7 +350,7 @@ class ZoomableImage extends React.PureComponent { translateY: translateY, }, }); - } + }; handleZoomClick = e => { e.preventDefault(); @@ -392,15 +392,15 @@ class ZoomableImage extends React.PureComponent { this.container.style.cursor = 'grab'; this.container.style.removeProperty('user-select'); - } + }; setContainerRef = c => { this.container = c; - } + }; setImageRef = c => { this.image = c; - } + }; render () { const { alt, src, width, height, intl } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index d8889f9f9..9255e346e 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -162,7 +162,7 @@ class SwitchingColumnsArea extends React.PureComponent { if (c) { this.node = c; } - } + }; render () { const { children, mobile, navbarUnder } = this.props; @@ -240,7 +240,7 @@ class SwitchingColumnsArea extends React.PureComponent { ); - }; + } } @@ -292,7 +292,7 @@ class UI extends React.Component { // but we set user-friendly message for other browsers, e.g. Edge. e.returnValue = intl.formatMessage(messages.beforeUnload); } - } + }; handleDragEnter = (e) => { e.preventDefault(); @@ -308,7 +308,7 @@ class UI extends React.Component { if (e.dataTransfer && e.dataTransfer.types.includes('Files') && this.props.canUploadMore && this.context.identity.signedIn) { this.setState({ draggingOver: true }); } - } + }; handleDragOver = (e) => { if (this.dataTransferIsText(e.dataTransfer)) return false; @@ -322,7 +322,7 @@ class UI extends React.Component { } return false; - } + }; handleDrop = (e) => { if (this.dataTransferIsText(e.dataTransfer)) return; @@ -335,7 +335,7 @@ class UI extends React.Component { if (e.dataTransfer && e.dataTransfer.files.length >= 1 && this.props.canUploadMore && this.context.identity.signedIn) { this.props.dispatch(uploadCompose(e.dataTransfer.files)); } - } + }; handleDragLeave = (e) => { e.preventDefault(); @@ -348,15 +348,15 @@ class UI extends React.Component { } this.setState({ draggingOver: false }); - } + }; dataTransferIsText = (dataTransfer) => { return (dataTransfer && Array.from(dataTransfer.types).filter((type) => type === 'text/plain').length === 1); - } + }; closeUploadModal = () => { this.setState({ draggingOver: false }); - } + }; handleServiceWorkerPostMessage = ({ data }) => { if (data.type === 'navigate') { @@ -364,7 +364,7 @@ class UI extends React.Component { } else { console.warn('Unknown message type:', data.type); } - } + }; handleVisibilityChange = () => { const visibility = !document[this.visibilityHiddenProp]; @@ -372,7 +372,7 @@ class UI extends React.Component { if (visibility) { this.props.dispatch(submitMarkers({ immediate: true })); } - } + }; handleLayoutChange = debounce(() => { this.props.dispatch(clearHeight()); // The cached heights are no longer accurate, invalidate @@ -389,7 +389,7 @@ class UI extends React.Component { } else { this.handleLayoutChange(); } - } + }; componentDidMount () { const { signedIn } = this.context.identity; @@ -407,7 +407,7 @@ class UI extends React.Component { navigator.serviceWorker.addEventListener('message', this.handleServiceWorkerPostMessage); } - this.favicon = new Favico({ animation:"none" }); + this.favicon = new Favico({ animation:'none' }); // On first launch, redirect to the follow recommendations page if (signedIn && this.props.firstLaunch) { @@ -487,7 +487,7 @@ class UI extends React.Component { setRef = c => { this.node = c; - } + }; handleHotkeyNew = e => { e.preventDefault(); @@ -497,7 +497,7 @@ class UI extends React.Component { if (element) { element.focus(); } - } + }; handleHotkeySearch = e => { e.preventDefault(); @@ -507,17 +507,17 @@ class UI extends React.Component { if (element) { element.focus(); } - } + }; handleHotkeyForceNew = e => { this.handleHotkeyNew(e); this.props.dispatch(resetCompose()); - } + }; handleHotkeyToggleComposeSpoilers = e => { e.preventDefault(); this.props.dispatch(changeComposeSpoilerness()); - } + }; handleHotkeyFocusColumn = e => { const index = (e.key * 1) + 1; // First child is drawer, skip that @@ -535,7 +535,7 @@ class UI extends React.Component { status.focus(); } } - } + }; handleHotkeyBack = () => { // if history is exhausted, or we would leave mastodon, just go to root. @@ -544,11 +544,11 @@ class UI extends React.Component { } else { this.props.history.push('/'); } - } + }; setHotkeysRef = c => { this.hotkeys = c; - } + }; handleHotkeyToggleHelp = () => { if (this.props.location.pathname === '/keyboard-shortcuts') { @@ -556,55 +556,55 @@ class UI extends React.Component { } else { this.props.history.push('/keyboard-shortcuts'); } - } + }; handleHotkeyGoToHome = () => { this.props.history.push('/home'); - } + }; handleHotkeyGoToNotifications = () => { this.props.history.push('/notifications'); - } + }; handleHotkeyGoToLocal = () => { this.props.history.push('/public/local'); - } + }; handleHotkeyGoToFederated = () => { this.props.history.push('/public'); - } + }; handleHotkeyGoToDirect = () => { this.props.history.push('/conversations'); - } + }; handleHotkeyGoToStart = () => { this.props.history.push('/getting-started'); - } + }; handleHotkeyGoToFavourites = () => { this.props.history.push('/favourites'); - } + }; handleHotkeyGoToPinned = () => { this.props.history.push('/pinned'); - } + }; handleHotkeyGoToProfile = () => { this.props.history.push(`/@${this.props.username}`); - } + }; handleHotkeyGoToBlocked = () => { this.props.history.push('/blocks'); - } + }; handleHotkeyGoToMuted = () => { this.props.history.push('/mutes'); - } + }; handleHotkeyGoToRequests = () => { this.props.history.push('/follow_requests'); - } + }; render () { const { draggingOver } = this.state; @@ -661,7 +661,7 @@ class UI extends React.Component { @{moved.get('acct')} - )}} + ) }} /> )} diff --git a/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js b/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js index 8946c8252..b1c952d87 100644 --- a/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js +++ b/app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js @@ -36,7 +36,7 @@ export class WrappedRoute extends React.Component { content: PropTypes.node, multiColumn: PropTypes.bool, componentParams: PropTypes.object, - } + }; static defaultProps = { componentParams: {}, @@ -46,7 +46,7 @@ export class WrappedRoute extends React.Component { return { hasError: true, }; - }; + } state = { hasError: false, @@ -80,17 +80,17 @@ export class WrappedRoute extends React.Component { {Component => {content}} ); - } + }; renderLoading = () => { const { multiColumn } = this.props; return ; - } + }; renderError = (props) => { return ; - } + }; render () { const { component: Component, content, ...rest } = this.props; diff --git a/app/javascript/flavours/glitch/features/ui/util/reduced_motion.js b/app/javascript/flavours/glitch/features/ui/util/reduced_motion.js index 95519042b..1123b80ed 100644 --- a/app/javascript/flavours/glitch/features/ui/util/reduced_motion.js +++ b/app/javascript/flavours/glitch/features/ui/util/reduced_motion.js @@ -17,7 +17,7 @@ class ReducedMotion extends React.Component { defaultStyle: PropTypes.object, style: PropTypes.object, children: PropTypes.func, - } + }; render() { diff --git a/app/javascript/flavours/glitch/features/video/index.js b/app/javascript/flavours/glitch/features/video/index.js index 0daab747b..cb923bcf7 100644 --- a/app/javascript/flavours/glitch/features/video/index.js +++ b/app/javascript/flavours/glitch/features/video/index.js @@ -156,7 +156,7 @@ class Video extends React.PureComponent { if (this.player) { this._setDimensions(); } - } + }; _setDimensions () { const width = this.player.offsetWidth; @@ -178,26 +178,26 @@ class Video extends React.PureComponent { if (this.video) { this.setState({ volume: this.video.volume, muted: this.video.muted }); } - } + }; setSeekRef = c => { this.seek = c; - } + }; setVolumeRef = c => { this.volume = c; - } + }; handleClickRoot = e => e.stopPropagation(); handlePlay = () => { this.setState({ paused: false }); this._updateTime(); - } + }; handlePause = () => { this.setState({ paused: true }); - } + }; _updateTime () { requestAnimationFrame(() => { @@ -216,7 +216,7 @@ class Video extends React.PureComponent { currentTime: this.video.currentTime, duration:this.video.duration, }); - } + }; handleVolumeMouseDown = e => { document.addEventListener('mousemove', this.handleMouseVolSlide, true); @@ -228,14 +228,14 @@ class Video extends React.PureComponent { e.preventDefault(); e.stopPropagation(); - } + }; handleVolumeMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseVolSlide, true); document.removeEventListener('mouseup', this.handleVolumeMouseUp, true); document.removeEventListener('touchmove', this.handleMouseVolSlide, true); document.removeEventListener('touchend', this.handleVolumeMouseUp, true); - } + }; handleMouseVolSlide = throttle(e => { const { x } = getPointerPosition(this.volume, e); @@ -259,7 +259,7 @@ class Video extends React.PureComponent { e.preventDefault(); e.stopPropagation(); - } + }; handleMouseUp = () => { document.removeEventListener('mousemove', this.handleMouseMove, true); @@ -269,7 +269,7 @@ class Video extends React.PureComponent { this.setState({ dragging: false }); this.video.play(); - } + }; handleMouseMove = throttle(e => { const { x } = getPointerPosition(this.seek, e); @@ -301,7 +301,7 @@ class Video extends React.PureComponent { e.stopPropagation(); this.togglePlay(); } - } + }; handleKeyDown = e => { const frameTime = 1 / this.getFrameRate(); @@ -355,7 +355,7 @@ class Video extends React.PureComponent { exitFullscreen(); } } - } + }; togglePlay = () => { if (this.state.paused) { @@ -363,7 +363,7 @@ class Video extends React.PureComponent { } else { this.setState({ paused: true }, () => this.video.pause()); } - } + }; toggleFullscreen = () => { if (isFullscreen()) { @@ -371,7 +371,7 @@ class Video extends React.PureComponent { } else { requestFullscreen(this.player); } - } + }; componentDidMount () { document.addEventListener('fullscreenchange', this.handleFullscreenChange, true); @@ -444,19 +444,19 @@ class Video extends React.PureComponent { this.setState({ paused: true }); } - }, 150, { trailing: true }) + }, 150, { trailing: true }); handleFullscreenChange = () => { this.setState({ fullscreen: isFullscreen() }); - } + }; handleMouseEnter = () => { this.setState({ hovered: true }); - } + }; handleMouseLeave = () => { this.setState({ hovered: false }); - } + }; toggleMute = () => { const muted = !this.video.muted; @@ -464,7 +464,7 @@ class Video extends React.PureComponent { this.setState({ muted }, () => { this.video.muted = muted; }); - } + }; toggleReveal = () => { if (this.state.revealed) { @@ -476,7 +476,7 @@ class Video extends React.PureComponent { } else { this.setState({ revealed: !this.state.revealed }); } - } + }; handleLoadedData = () => { const { currentTime, volume, muted, autoPlay } = this.props; @@ -496,7 +496,7 @@ class Video extends React.PureComponent { if (autoPlay) { this.video.play(); } - } + }; handleProgress = () => { const lastTimeRange = this.video.buffered.length - 1; @@ -504,11 +504,11 @@ class Video extends React.PureComponent { if (lastTimeRange > -1) { this.setState({ buffer: Math.ceil(this.video.buffered.end(lastTimeRange) / this.video.duration * 100) }); } - } + }; handleVolumeChange = () => { this.setState({ volume: this.video.volume, muted: this.video.muted }); - } + }; handleOpenVideo = () => { this.video.pause(); @@ -519,12 +519,12 @@ class Video extends React.PureComponent { defaultVolume: this.state.volume, componentIndex: this.props.componentIndex, }); - } + }; handleCloseVideo = () => { this.video.pause(); this.props.onCloseVideo(); - } + }; getFrameRate () { if (this.props.frameRate && isNaN(this.props.frameRate)) { @@ -553,7 +553,7 @@ class Video extends React.PureComponent { playerStyle.height = height; } else if (inline) { - return (
); + return (
); } let preload; diff --git a/app/javascript/flavours/glitch/middleware/errors.js b/app/javascript/flavours/glitch/middleware/errors.js index ade529a4e..3639a5951 100644 --- a/app/javascript/flavours/glitch/middleware/errors.js +++ b/app/javascript/flavours/glitch/middleware/errors.js @@ -14,4 +14,4 @@ export default function errorsMiddleware() { return next(action); }; -}; +} diff --git a/app/javascript/flavours/glitch/middleware/loading_bar.js b/app/javascript/flavours/glitch/middleware/loading_bar.js index a98f1bb2b..da8cc4c7d 100644 --- a/app/javascript/flavours/glitch/middleware/loading_bar.js +++ b/app/javascript/flavours/glitch/middleware/loading_bar.js @@ -22,4 +22,4 @@ export default function loadingBarMiddleware(config = {}) { return next(action); }; -}; +} diff --git a/app/javascript/flavours/glitch/middleware/sounds.js b/app/javascript/flavours/glitch/middleware/sounds.js index 9f1bc02b9..7f2388983 100644 --- a/app/javascript/flavours/glitch/middleware/sounds.js +++ b/app/javascript/flavours/glitch/middleware/sounds.js @@ -43,4 +43,4 @@ export default function soundsMiddleware() { return next(action); }; -}; +} diff --git a/app/javascript/flavours/glitch/reducers/accounts.js b/app/javascript/flavours/glitch/reducers/accounts.js index e02a5592e..07f45f98b 100644 --- a/app/javascript/flavours/glitch/reducers/accounts.js +++ b/app/javascript/flavours/glitch/reducers/accounts.js @@ -35,4 +35,4 @@ export default function accounts(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/accounts_counters.js b/app/javascript/flavours/glitch/reducers/accounts_counters.js index 9ebf72af9..4e1256d1b 100644 --- a/app/javascript/flavours/glitch/reducers/accounts_counters.js +++ b/app/javascript/flavours/glitch/reducers/accounts_counters.js @@ -35,4 +35,4 @@ export default function accountsCounters(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/accounts_map.js b/app/javascript/flavours/glitch/reducers/accounts_map.js index 444bbda19..8412ad4d0 100644 --- a/app/javascript/flavours/glitch/reducers/accounts_map.js +++ b/app/javascript/flavours/glitch/reducers/accounts_map.js @@ -17,4 +17,4 @@ export default function accountsMap(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/alerts.js b/app/javascript/flavours/glitch/reducers/alerts.js index ee3d54ab0..f0a696164 100644 --- a/app/javascript/flavours/glitch/reducers/alerts.js +++ b/app/javascript/flavours/glitch/reducers/alerts.js @@ -23,4 +23,4 @@ export default function alerts(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/announcements.js b/app/javascript/flavours/glitch/reducers/announcements.js index 34e08eac8..b53f93a4a 100644 --- a/app/javascript/flavours/glitch/reducers/announcements.js +++ b/app/javascript/flavours/glitch/reducers/announcements.js @@ -99,4 +99,4 @@ export default function announcementsReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index a69c0f7f2..da38b201f 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -140,7 +140,7 @@ function statusToTextMentions(state, status) { } return set.union(status.get('mentions').filterNot(mention => mention.get('id') === me).map(mention => `@${mention.get('acct')} `)).join(''); -}; +} function apiStatusToTextMentions (state, status) { let set = ImmutableOrderedSet([]); @@ -150,16 +150,16 @@ function apiStatusToTextMentions (state, status) { } return set.union(status.mentions.filter( - mention => mention.id !== me + mention => mention.id !== me, ).map( - mention => `@${mention.acct} ` + mention => `@${mention.acct} `, )).join(''); } function apiStatusToTextHashtags (state, status) { const text = unescapeHTML(status.content); return ImmutableOrderedSet([]).union(recoverHashtags(status.tags, text).map( - (name) => `#${name} ` + (name) => `#${name} `, )).join(''); } @@ -175,7 +175,7 @@ function clearAll(state) { map.set('in_reply_to', null); map.update( 'advanced_options', - map => map.mergeWith(overwrite, state.get('default_advanced_options')) + map => map.mergeWith(overwrite, state.get('default_advanced_options')), ); map.set('privacy', state.get('default_privacy')); map.set('sensitive', state.get('default_sensitive')); @@ -184,7 +184,7 @@ function clearAll(state) { map.set('poll', null); map.set('idempotencyKey', uuid()); }); -}; +} function continueThread (state, status) { return state.withMutations(function (map) { @@ -202,7 +202,7 @@ function continueThread (state, status) { map.set('in_reply_to', status.id); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate: status.local_only })) + map => map.merge(new ImmutableMap({ do_not_federate: status.local_only })), ); map.set('privacy', status.visibility); map.set('sensitive', false); @@ -233,7 +233,7 @@ function appendMedia(state, media, file) { map.set('sensitive', true); } }); -}; +} function removeMedia(state, mediaId) { const prevSize = state.get('media_attachments').size; @@ -246,7 +246,7 @@ function removeMedia(state, mediaId) { map.set('sensitive', false); } }); -}; +} const insertSuggestion = (state, position, token, completion, path) => { return state.withMutations(map => { @@ -414,7 +414,7 @@ export default function compose(state = initialState, action) { map.set('privacy', privacyPreference(action.status.get('visibility'), state.get('default_privacy'))); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate: !!action.status.get('local_only') })) + map => map.merge(new ImmutableMap({ do_not_federate: !!action.status.get('local_only') })), ); map.set('focusDate', new Date()); map.set('caretPosition', null); @@ -453,7 +453,7 @@ export default function compose(state = initialState, action) { map.set('poll', null); map.update( 'advanced_options', - map => map.mergeWith(overwrite, state.get('default_advanced_options')) + map => map.mergeWith(overwrite, state.get('default_advanced_options')), ); map.set('idempotencyKey', uuid()); }); @@ -575,7 +575,7 @@ export default function compose(state = initialState, action) { map.set('language', action.status.get('language')); map.update( 'advanced_options', - map => map.merge(new ImmutableMap({ do_not_federate })) + map => map.merge(new ImmutableMap({ do_not_federate })), ); map.set('id', null); @@ -646,4 +646,4 @@ export default function compose(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/contexts.js b/app/javascript/flavours/glitch/reducers/contexts.js index a0fcc4158..aea77ae41 100644 --- a/app/javascript/flavours/glitch/reducers/contexts.js +++ b/app/javascript/flavours/glitch/reducers/contexts.js @@ -67,7 +67,7 @@ const deleteFromContexts = (immutableState, ids) => immutableState.withMutations const filterContexts = (state, relationship, statuses) => { const ownedStatusIds = statuses.filter(status => status.get('account') === relationship.id) - .map(status => status.get('id')); + .map(status => status.get('id')); return deleteFromContexts(state, ownedStatusIds); }; @@ -102,4 +102,4 @@ export default function replies(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/conversations.js b/app/javascript/flavours/glitch/reducers/conversations.js index 4407dcf04..48b70cc33 100644 --- a/app/javascript/flavours/glitch/reducers/conversations.js +++ b/app/javascript/flavours/glitch/reducers/conversations.js @@ -113,4 +113,4 @@ export default function conversations(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/custom_emojis.js b/app/javascript/flavours/glitch/reducers/custom_emojis.js index f490d0db1..7f71ab791 100644 --- a/app/javascript/flavours/glitch/reducers/custom_emojis.js +++ b/app/javascript/flavours/glitch/reducers/custom_emojis.js @@ -12,4 +12,4 @@ export default function custom_emojis(state = initialState, action) { } return state; -}; +} diff --git a/app/javascript/flavours/glitch/reducers/domain_lists.js b/app/javascript/flavours/glitch/reducers/domain_lists.js index eff97fbd6..6bf8cee68 100644 --- a/app/javascript/flavours/glitch/reducers/domain_lists.js +++ b/app/javascript/flavours/glitch/reducers/domain_lists.js @@ -22,4 +22,4 @@ export default function domainLists(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/filters.js b/app/javascript/flavours/glitch/reducers/filters.js index f4f97cd3a..e1f014046 100644 --- a/app/javascript/flavours/glitch/reducers/filters.js +++ b/app/javascript/flavours/glitch/reducers/filters.js @@ -41,4 +41,4 @@ export default function filters(state = ImmutableMap(), action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/height_cache.js b/app/javascript/flavours/glitch/reducers/height_cache.js index 8b05e0b19..660a2d1d7 100644 --- a/app/javascript/flavours/glitch/reducers/height_cache.js +++ b/app/javascript/flavours/glitch/reducers/height_cache.js @@ -20,4 +20,4 @@ export default function statuses(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/list_adder.js b/app/javascript/flavours/glitch/reducers/list_adder.js index b8c1b0e26..b144610a5 100644 --- a/app/javascript/flavours/glitch/reducers/list_adder.js +++ b/app/javascript/flavours/glitch/reducers/list_adder.js @@ -44,4 +44,4 @@ export default function listAdderReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/list_editor.js b/app/javascript/flavours/glitch/reducers/list_editor.js index 5427ac098..6e020dbe6 100644 --- a/app/javascript/flavours/glitch/reducers/list_editor.js +++ b/app/javascript/flavours/glitch/reducers/list_editor.js @@ -54,10 +54,10 @@ export default function listEditorReducer(state = initialState, action) { }); case LIST_CREATE_REQUEST: case LIST_UPDATE_REQUEST: - return state.withMutations(map => { - map.set('isSubmitting', true); - map.set('isChanged', false); - }); + return state.withMutations(map => { + map.set('isSubmitting', true); + map.set('isChanged', false); + }); case LIST_CREATE_FAIL: case LIST_UPDATE_FAIL: return state.set('isSubmitting', false); @@ -93,4 +93,4 @@ export default function listEditorReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/lists.js b/app/javascript/flavours/glitch/reducers/lists.js index f30ffbcbd..ba3e2b3cb 100644 --- a/app/javascript/flavours/glitch/reducers/lists.js +++ b/app/javascript/flavours/glitch/reducers/lists.js @@ -34,4 +34,4 @@ export default function lists(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/local_settings.js b/app/javascript/flavours/glitch/reducers/local_settings.js index 9075146f3..887e0e135 100644 --- a/app/javascript/flavours/glitch/reducers/local_settings.js +++ b/app/javascript/flavours/glitch/reducers/local_settings.js @@ -78,4 +78,4 @@ export default function localSettings(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/markers.js b/app/javascript/flavours/glitch/reducers/markers.js index fb1572ff5..e3d1b1936 100644 --- a/app/javascript/flavours/glitch/reducers/markers.js +++ b/app/javascript/flavours/glitch/reducers/markers.js @@ -22,4 +22,4 @@ export default function markers(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/media_attachments.js b/app/javascript/flavours/glitch/reducers/media_attachments.js index 6e6058576..dfd8ea42d 100644 --- a/app/javascript/flavours/glitch/reducers/media_attachments.js +++ b/app/javascript/flavours/glitch/reducers/media_attachments.js @@ -12,4 +12,4 @@ export default function meta(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/meta.js b/app/javascript/flavours/glitch/reducers/meta.js index b1482777a..9f9b89fc0 100644 --- a/app/javascript/flavours/glitch/reducers/meta.js +++ b/app/javascript/flavours/glitch/reducers/meta.js @@ -15,12 +15,12 @@ export default function meta(state = initialState, action) { case STORE_HYDRATE: return state.merge( action.state.get('meta')) - .set('permissions', action.state.getIn(['role', 'permissions'])) - .set('layout', layoutFromWindow(action.state.getIn(['local_settings', 'layout'])) + .set('permissions', action.state.getIn(['role', 'permissions'])) + .set('layout', layoutFromWindow(action.state.getIn(['local_settings', 'layout'])), ); case APP_LAYOUT_CHANGE: return state.set('layout', action.layout); default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/modal.js b/app/javascript/flavours/glitch/reducers/modal.js index 2ef0aef24..c48117181 100644 --- a/app/javascript/flavours/glitch/reducers/modal.js +++ b/app/javascript/flavours/glitch/reducers/modal.js @@ -36,4 +36,4 @@ export default function modal(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/notifications.js b/app/javascript/flavours/glitch/reducers/notifications.js index 18610e758..d5b1568e9 100644 --- a/app/javascript/flavours/glitch/reducers/notifications.js +++ b/app/javascript/flavours/glitch/reducers/notifications.js @@ -371,4 +371,4 @@ export default function notifications(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/picture_in_picture.js b/app/javascript/flavours/glitch/reducers/picture_in_picture.js index 13a3d1aa2..395c21245 100644 --- a/app/javascript/flavours/glitch/reducers/picture_in_picture.js +++ b/app/javascript/flavours/glitch/reducers/picture_in_picture.js @@ -22,4 +22,4 @@ export default function pictureInPicture(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/pinned_accounts_editor.js b/app/javascript/flavours/glitch/reducers/pinned_accounts_editor.js index 267521bb8..144418d12 100644 --- a/app/javascript/flavours/glitch/reducers/pinned_accounts_editor.js +++ b/app/javascript/flavours/glitch/reducers/pinned_accounts_editor.js @@ -54,4 +54,4 @@ export default function listEditorReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/push_notifications.js b/app/javascript/flavours/glitch/reducers/push_notifications.js index 117fb5167..116c3732f 100644 --- a/app/javascript/flavours/glitch/reducers/push_notifications.js +++ b/app/javascript/flavours/glitch/reducers/push_notifications.js @@ -50,4 +50,4 @@ export default function push_subscriptions(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/relationships.js b/app/javascript/flavours/glitch/reducers/relationships.js index e4b9acea2..b53f0238c 100644 --- a/app/javascript/flavours/glitch/reducers/relationships.js +++ b/app/javascript/flavours/glitch/reducers/relationships.js @@ -82,4 +82,4 @@ export default function relationships(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/search.js b/app/javascript/flavours/glitch/reducers/search.js index 4b8913e96..bc0433d1f 100644 --- a/app/javascript/flavours/glitch/reducers/search.js +++ b/app/javascript/flavours/glitch/reducers/search.js @@ -64,4 +64,4 @@ export default function search(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/settings.js b/app/javascript/flavours/glitch/reducers/settings.js index 82927f7cd..e69eee966 100644 --- a/app/javascript/flavours/glitch/reducers/settings.js +++ b/app/javascript/flavours/glitch/reducers/settings.js @@ -176,4 +176,4 @@ export default function settings(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/status_lists.js b/app/javascript/flavours/glitch/reducers/status_lists.js index 7ac0dab47..a279d3d34 100644 --- a/app/javascript/flavours/glitch/reducers/status_lists.js +++ b/app/javascript/flavours/glitch/reducers/status_lists.js @@ -145,4 +145,4 @@ export default function statusLists(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/statuses.js b/app/javascript/flavours/glitch/reducers/statuses.js index f0c4c804b..ca220c54d 100644 --- a/app/javascript/flavours/glitch/reducers/statuses.js +++ b/app/javascript/flavours/glitch/reducers/statuses.js @@ -94,4 +94,4 @@ export default function statuses(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/suggestions.js b/app/javascript/flavours/glitch/reducers/suggestions.js index 2bc30d2c6..3c1ea3fa8 100644 --- a/app/javascript/flavours/glitch/reducers/suggestions.js +++ b/app/javascript/flavours/glitch/reducers/suggestions.js @@ -34,4 +34,4 @@ export default function suggestionsReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/tags.js b/app/javascript/flavours/glitch/reducers/tags.js index 266b21177..b280bc4dd 100644 --- a/app/javascript/flavours/glitch/reducers/tags.js +++ b/app/javascript/flavours/glitch/reducers/tags.js @@ -22,4 +22,4 @@ export default function tags(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/timelines.js b/app/javascript/flavours/glitch/reducers/timelines.js index 407293c62..96a6ca961 100644 --- a/app/javascript/flavours/glitch/reducers/timelines.js +++ b/app/javascript/flavours/glitch/reducers/timelines.js @@ -229,4 +229,4 @@ export default function timelines(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/trends.js b/app/javascript/flavours/glitch/reducers/trends.js index e2bac6199..0b8e0882d 100644 --- a/app/javascript/flavours/glitch/reducers/trends.js +++ b/app/javascript/flavours/glitch/reducers/trends.js @@ -43,4 +43,4 @@ export default function trendsReducer(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/reducers/user_lists.js b/app/javascript/flavours/glitch/reducers/user_lists.js index 0a75e85c1..9e020fd91 100644 --- a/app/javascript/flavours/glitch/reducers/user_lists.js +++ b/app/javascript/flavours/glitch/reducers/user_lists.js @@ -187,4 +187,4 @@ export default function userLists(state = initialState, action) { default: return state; } -}; +} diff --git a/app/javascript/flavours/glitch/store/configureStore.js b/app/javascript/flavours/glitch/store/configureStore.js index e18af842f..0e0d45c66 100644 --- a/app/javascript/flavours/glitch/store/configureStore.js +++ b/app/javascript/flavours/glitch/store/configureStore.js @@ -12,4 +12,4 @@ export default function configureStore() { errorsMiddleware(), soundsMiddleware(), ), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f)); -}; +} diff --git a/app/javascript/flavours/glitch/utils/hashtag.js b/app/javascript/flavours/glitch/utils/hashtag.js index 9b663487f..2024a665c 100644 --- a/app/javascript/flavours/glitch/utils/hashtag.js +++ b/app/javascript/flavours/glitch/utils/hashtag.js @@ -1,8 +1,8 @@ export function recoverHashtags (recognizedTags, text) { return recognizedTags.map(tag => { - const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i'); - const matched_hashtag = text.match(re); - return matched_hashtag ? matched_hashtag[1] : null; - } + const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i'); + const matched_hashtag = text.match(re); + return matched_hashtag ? matched_hashtag[1] : null; + }, ).filter(x => x !== null); } diff --git a/app/javascript/flavours/glitch/utils/privacy_preference.js b/app/javascript/flavours/glitch/utils/privacy_preference.js index 7781ca7fa..51bdf072d 100644 --- a/app/javascript/flavours/glitch/utils/privacy_preference.js +++ b/app/javascript/flavours/glitch/utils/privacy_preference.js @@ -2,4 +2,4 @@ export const order = ['public', 'unlisted', 'private', 'direct']; export function privacyPreference (a, b) { return order[Math.max(order.indexOf(a), order.indexOf(b), 0)]; -}; +} diff --git a/app/javascript/flavours/glitch/utils/react_helpers.js b/app/javascript/flavours/glitch/utils/react_helpers.js index 082a58e62..ea11acdb6 100644 --- a/app/javascript/flavours/glitch/utils/react_helpers.js +++ b/app/javascript/flavours/glitch/utils/react_helpers.js @@ -7,7 +7,7 @@ export function assignHandlers (target, handlers) { // We just bind each handler to the `target`. const handle = target.handlers = {}; Object.keys(handlers).forEach( - key => handle[key] = handlers[key].bind(target) + key => handle[key] = handlers[key].bind(target), ); } diff --git a/app/javascript/flavours/glitch/uuid.js b/app/javascript/flavours/glitch/uuid.js index be1899305..0d2cfaa77 100644 --- a/app/javascript/flavours/glitch/uuid.js +++ b/app/javascript/flavours/glitch/uuid.js @@ -1,3 +1,3 @@ export default function uuid(a) { return a ? (a^Math.random() * 16 >> a / 4).toString(16) : ([1e7]+-1e3+-4e3+-8e3+-1e11).replace(/[018]/g, uuid); -}; +} -- cgit From 372fa3fe368714047e06bea5465f9e8f6926ac59 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 29 Jan 2023 21:07:51 -0500 Subject: [Glitch] Update hasOwnProperty calls for ESLint Port 131e6403ccd59693e8498d175acba4fdd28268b9 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/emoji/emoji_utils.js | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_utils.js b/app/javascript/flavours/glitch/features/emoji/emoji_utils.js index dbf725c1f..571907a50 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji_utils.js +++ b/app/javascript/flavours/glitch/features/emoji/emoji_utils.js @@ -135,19 +135,19 @@ function getData(emoji, skin, set) { } } - if (data.short_names.hasOwnProperty(emoji)) { + if (Object.prototype.hasOwnProperty.call(data.short_names, emoji)) { emoji = data.short_names[emoji]; } - if (data.emojis.hasOwnProperty(emoji)) { + if (Object.prototype.hasOwnProperty.call(data.emojis, emoji)) { emojiData = data.emojis[emoji]; } } else if (emoji.id) { - if (data.short_names.hasOwnProperty(emoji.id)) { + if (Object.prototype.hasOwnProperty.call(data.short_names, emoji.id)) { emoji.id = data.short_names[emoji.id]; } - if (data.emojis.hasOwnProperty(emoji.id)) { + if (Object.prototype.hasOwnProperty.call(data.emojis, emoji.id)) { emojiData = data.emojis[emoji.id]; skin = skin || emoji.skin; } @@ -216,7 +216,7 @@ function deepMerge(a, b) { let originalValue = a[key], value = originalValue; - if (b.hasOwnProperty(key)) { + if (Object.prototype.hasOwnProperty.call(b, key)) { value = b[key]; } -- cgit From 8ce02aa6e82d40d7a9e7c842ae2b67dcf31e8a79 Mon Sep 17 00:00:00 2001 From: Akira Ouchi Date: Mon, 30 Jan 2023 22:49:10 +0900 Subject: [Glitch] autofocus the compose form again on /share Port e73b55184b37e7f29e5bcb16c980dc8dbdb9a7d1 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/standalone/compose/index.js | 2 +- app/javascript/flavours/glitch/reducers/compose.js | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/standalone/compose/index.js b/app/javascript/flavours/glitch/features/standalone/compose/index.js index b33c21cb5..c53442435 100644 --- a/app/javascript/flavours/glitch/features/standalone/compose/index.js +++ b/app/javascript/flavours/glitch/features/standalone/compose/index.js @@ -9,7 +9,7 @@ export default class Compose extends React.PureComponent { render () { return (
- + diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index da38b201f..bb42580d4 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -303,8 +303,8 @@ const insertEmoji = (state, position, emojiData) => { const hydrate = (state, hydratedState) => { state = clearAll(state.merge(hydratedState)); - if (hydratedState.has('text')) { - state = state.set('text', hydratedState.get('text')); + if (hydratedState.get('text')) { + state = state.set('text', hydratedState.get('text')).set('focusDate', new Date()); } return state; -- cgit From 3c451cf88f5bbdfe8459f61bb8167872e32e2297 Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 3 Feb 2023 21:14:22 +0100 Subject: [Glitch] Fix useless regular-expression character escape detected by CodeQL --- app/javascript/flavours/glitch/utils/hashtag.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/utils/hashtag.js b/app/javascript/flavours/glitch/utils/hashtag.js index 2024a665c..8f5665c46 100644 --- a/app/javascript/flavours/glitch/utils/hashtag.js +++ b/app/javascript/flavours/glitch/utils/hashtag.js @@ -1,6 +1,6 @@ export function recoverHashtags (recognizedTags, text) { return recognizedTags.map(tag => { - const re = new RegExp(`(?:^|[^\/\)\w])#(${tag.name})`, 'i'); + const re = new RegExp(`(?:^|[^\/)\w])#(${tag.name})`, 'i'); const matched_hashtag = text.match(re); return matched_hashtag ? matched_hashtag[1] : null; }, -- cgit From fa433ac5a638b00f5bf77ee52955696d7aa842d6 Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 4 Feb 2023 11:09:05 +0100 Subject: Further JS code style changes --- .../glitch/features/compose/components/compose_form.js | 12 ++++++++---- .../compose/containers/compose_form_container.js | 18 ++++++++++++------ app/javascript/flavours/glitch/reducers/meta.js | 6 ++---- 3 files changed, 22 insertions(+), 14 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index c5655c4f2..9f57d7b1b 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -21,10 +21,14 @@ import { length } from 'stringz'; const messages = defineMessages({ placeholder: { id: 'compose_form.placeholder', defaultMessage: 'What is on your mind?' }, - missingDescriptionMessage: { id: 'confirmations.missing_media_description.message', - defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, - missingDescriptionConfirm: { id: 'confirmations.missing_media_description.confirm', - defaultMessage: 'Send anyway' }, + missingDescriptionMessage: { + id: 'confirmations.missing_media_description.message', + defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.', + }, + missingDescriptionConfirm: { + id: 'confirmations.missing_media_description.confirm', + defaultMessage: 'Send anyway', + }, spoiler_placeholder: { id: 'compose_form.spoiler_placeholder', defaultMessage: 'Write your warning here' }, }); diff --git a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js index 56eaaf920..ddcdb367a 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/compose_form_container.js @@ -21,12 +21,18 @@ import { changeLocalSetting } from 'flavours/glitch/actions/local_settings'; import { privacyPreference } from 'flavours/glitch/utils/privacy_preference'; const messages = defineMessages({ - missingDescriptionMessage: { id: 'confirmations.missing_media_description.message', - defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.' }, - missingDescriptionConfirm: { id: 'confirmations.missing_media_description.confirm', - defaultMessage: 'Send anyway' }, - missingDescriptionEdit: { id: 'confirmations.missing_media_description.edit', - defaultMessage: 'Edit media' }, + missingDescriptionMessage: { + id: 'confirmations.missing_media_description.message', + defaultMessage: 'At least one media attachment is lacking a description. Consider describing all media attachments for the visually impaired before sending your toot.', + }, + missingDescriptionConfirm: { + id: 'confirmations.missing_media_description.confirm', + defaultMessage: 'Send anyway', + }, + missingDescriptionEdit: { + id: 'confirmations.missing_media_description.edit', + defaultMessage: 'Edit media', + }, }); // State mapping. diff --git a/app/javascript/flavours/glitch/reducers/meta.js b/app/javascript/flavours/glitch/reducers/meta.js index 9f9b89fc0..7a38a9090 100644 --- a/app/javascript/flavours/glitch/reducers/meta.js +++ b/app/javascript/flavours/glitch/reducers/meta.js @@ -13,11 +13,9 @@ const initialState = ImmutableMap({ export default function meta(state = initialState, action) { switch(action.type) { case STORE_HYDRATE: - return state.merge( - action.state.get('meta')) + return state.merge(action.state.get('meta')) .set('permissions', action.state.getIn(['role', 'permissions'])) - .set('layout', layoutFromWindow(action.state.getIn(['local_settings', 'layout'])), - ); + .set('layout', layoutFromWindow(action.state.getIn(['local_settings', 'layout']))); case APP_LAYOUT_CHANGE: return state.set('layout', action.layout); default: -- cgit From 95e2cab22ed4fdd68ca6422190aaffd11c4cb8ee Mon Sep 17 00:00:00 2001 From: Eugen Rochko Date: Sat, 4 Feb 2023 04:56:06 +0100 Subject: [Glitch] Add setting for status page URL Port 8f590b0a211716bcbfc0f2278a452469f3346f55 to glitch-soc Signed-off-by: Claire --- .../glitch/features/ui/components/link_footer.js | 16 +++++++++++----- app/javascript/flavours/glitch/initial_state.js | 1 + 2 files changed, 12 insertions(+), 5 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/ui/components/link_footer.js b/app/javascript/flavours/glitch/features/ui/components/link_footer.js index c4bea9f31..0d1d4040f 100644 --- a/app/javascript/flavours/glitch/features/ui/components/link_footer.js +++ b/app/javascript/flavours/glitch/features/ui/components/link_footer.js @@ -3,7 +3,7 @@ import React from 'react'; import PropTypes from 'prop-types'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import { Link } from 'react-router-dom'; -import { domain, version, source_url, profile_directory as profileDirectory } from 'flavours/glitch/initial_state'; +import { domain, version, source_url, statusPageUrl, profile_directory as profileDirectory } from 'flavours/glitch/initial_state'; import { logOut } from 'flavours/glitch/utils/log_out'; import { openModal } from 'flavours/glitch/actions/modal'; import { PERMISSION_INVITE_USERS } from 'flavours/glitch/permissions'; @@ -59,21 +59,27 @@ class LinkFooter extends React.PureComponent {

{domain}: {' '} - + + {statusPageUrl && ( + <> + {DividingCircle} + + + )} {canInvite && ( <> {DividingCircle} - + )} {canProfileDirectory && ( <> {DividingCircle} - + )} {DividingCircle} - +

diff --git a/app/javascript/flavours/glitch/initial_state.js b/app/javascript/flavours/glitch/initial_state.js index eefbdca80..c4b249db8 100644 --- a/app/javascript/flavours/glitch/initial_state.js +++ b/app/javascript/flavours/glitch/initial_state.js @@ -142,6 +142,7 @@ export const usePendingItems = getMeta('use_pending_items'); export const version = getMeta('version'); export const translationEnabled = getMeta('translation_enabled'); export const languages = initialState?.languages; +export const statusPageUrl = getMeta('status_page_url'); // Glitch-soc-specific settings export const maxChars = (initialState && initialState.max_toot_chars) || 500; -- cgit From 8fd6c362438b8549abc3c95389c55576af159326 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Sat, 4 Feb 2023 16:34:21 +0100 Subject: [Glitch] Spell check input fields Port 67744ee779b97ea07e91dd076e1df25e362ff33d to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/autosuggest_input.js | 4 +++- .../flavours/glitch/features/compose/components/compose_form.js | 1 + .../flavours/glitch/features/compose/components/poll_form.js | 1 + 3 files changed, 5 insertions(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.js b/app/javascript/flavours/glitch/components/autosuggest_input.js index 4d751e281..1a030fb85 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_input.js +++ b/app/javascript/flavours/glitch/components/autosuggest_input.js @@ -51,6 +51,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { searchTokens: PropTypes.arrayOf(PropTypes.string), maxLength: PropTypes.number, lang: PropTypes.string, + spellCheck: PropTypes.string, }; static defaultProps = { @@ -186,7 +187,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { }; render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang } = this.props; + const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang, spellCheck } = this.props; const { suggestionsHidden } = this.state; return ( @@ -212,6 +213,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { className={className} maxLength={maxLength} lang={lang} + spellCheck={spellCheck} /> diff --git a/app/javascript/flavours/glitch/features/compose/components/compose_form.js b/app/javascript/flavours/glitch/features/compose/components/compose_form.js index 9f57d7b1b..696188f31 100644 --- a/app/javascript/flavours/glitch/features/compose/components/compose_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/compose_form.js @@ -332,6 +332,7 @@ class ComposeForm extends ImmutablePureComponent { className='spoiler-input__input' lang={this.props.lang} autoFocus={false} + spellCheck />

diff --git a/app/javascript/flavours/glitch/features/compose/components/poll_form.js b/app/javascript/flavours/glitch/features/compose/components/poll_form.js index 13b7322d3..cb6b577bf 100644 --- a/app/javascript/flavours/glitch/features/compose/components/poll_form.js +++ b/app/javascript/flavours/glitch/features/compose/components/poll_form.js @@ -72,6 +72,7 @@ class Option extends React.PureComponent { maxLength={pollLimits.max_option_chars} value={title} lang={lang} + spellCheck onChange={this.handleOptionTitleChange} suggestions={this.props.suggestions} onSuggestionsFetchRequested={this.onSuggestionsFetchRequested} -- cgit From 2dfbdc3f9dbca574fbeb5e27de1515a09021b9a7 Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Mon, 6 Feb 2023 16:50:08 +0100 Subject: [Glitch] Show spinner while loading follow requests Port c1f32c9c1470d7d38342e211ff5ca326e12494fb to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/features/follow_requests/index.js | 12 ++---------- 1 file changed, 2 insertions(+), 10 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/follow_requests/index.js b/app/javascript/flavours/glitch/features/follow_requests/index.js index 7b35e3ec9..aa60bd7b8 100644 --- a/app/javascript/flavours/glitch/features/follow_requests/index.js +++ b/app/javascript/flavours/glitch/features/follow_requests/index.js @@ -3,7 +3,6 @@ import { connect } from 'react-redux'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { debounce } from 'lodash'; -import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; import Column from 'flavours/glitch/features/ui/components/column'; import ColumnBackButtonSlim from 'flavours/glitch/components/column_back_button_slim'; import AccountAuthorizeContainer from './containers/account_authorize_container'; @@ -53,16 +52,8 @@ class FollowRequests extends ImmutablePureComponent { render () { const { intl, accountIds, hasMore, multiColumn, locked, domain, isLoading } = this.props; - if (!accountIds) { - return ( - - - - ); - } - const emptyMessage = ; - const unlockedPrependMessage = locked ? null : ( + const unlockedPrependMessage = !locked && accountIds.size > 0 && (
Date: Mon, 6 Feb 2023 16:53:31 +0100 Subject: [Glitch] Add scrolling to Compare history modal Port e8cb3ee827d3bd20b0ad28dfc7358afaa43b4dad to glitch-soc Co-authored-by: Claire Signed-off-by: Claire --- app/javascript/flavours/glitch/styles/components/modal.scss | 1 + 1 file changed, 1 insertion(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/styles/components/modal.scss b/app/javascript/flavours/glitch/styles/components/modal.scss index 972e01e7d..69d237dec 100644 --- a/app/javascript/flavours/glitch/styles/components/modal.scss +++ b/app/javascript/flavours/glitch/styles/components/modal.scss @@ -1071,6 +1071,7 @@ &__container { padding: 30px; pointer-events: all; + overflow-y: auto; } .status__content { -- cgit From 8eb74c88ec3a2d8cc1ec722e3b7a74023ea341a8 Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 12 Feb 2023 18:16:08 +0100 Subject: New Crowdin updates (#2100) * New translations en.json (Korean) [ci skip] * New translations en.json (Portuguese, Brazilian) [ci skip] * New translations en.yml (Spanish) [ci skip] * New translations en.yml (Portuguese) [ci skip] * New translations en.yml (Portuguese) [ci skip] * New translations en.json (Spanish) [ci skip] * New translations en.yml (Spanish) [ci skip] * New translations en.json (Spanish) [ci skip] --- app/javascript/flavours/glitch/locales/es.json | 16 +++++++++++++ app/javascript/flavours/glitch/locales/ko.json | 1 + app/javascript/flavours/glitch/locales/pt-BR.json | 5 ++-- config/locales-glitch/es.yml | 9 ++++++++ config/locales-glitch/pt-PT.yml | 28 ++++++++++++++++++++++- 5 files changed, 56 insertions(+), 3 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/locales/es.json b/app/javascript/flavours/glitch/locales/es.json index 07acbf914..7231fe135 100644 --- a/app/javascript/flavours/glitch/locales/es.json +++ b/app/javascript/flavours/glitch/locales/es.json @@ -1,4 +1,10 @@ { + "account.follows": "Sigue", + "account.suspended_disclaimer_full": "Este usuario ha sido suspendido por un moderador.", + "account.view_full_profile": "Ver perfil completo", + "account_note.cancel": "Cancelar", + "account_note.edit": "Editar", + "account_note.save": "Guardar", "advanced_options.icon_title": "Opciones avanzadas", "advanced_options.local-only.long": "No publicar a otras instancias", "advanced_options.local-only.short": "Local", @@ -6,9 +12,17 @@ "advanced_options.threaded_mode.long": "Al publicar abre automáticamente una respuesta", "advanced_options.threaded_mode.short": "Modo hilo", "advanced_options.threaded_mode.tooltip": "Modo hilo habilitado", + "column.favourited_by": "Marcado como favorito por", + "column.reblogged_by": "Retooteado por", + "column_header.profile": "Perfil", + "column_subheading.lists": "Listas", + "column_subheading.navigation": "Navegación", "compose.attach": "Adjuntar...", "compose.attach.doodle": "Dibujar algo", "compose.attach.upload": "Subir un archivo", + "compose.content-type.html": "HTML", + "compose.content-type.markdown": "Markdown", + "compose.content-type.plain": "Sin formato", "confirmations.unfilter.author": "Publicado por", "confirmations.unfilter.confirm": "Mostrar", "confirmations.unfilter.edit_filter": "Editar filtro", @@ -91,5 +105,7 @@ "settings.tag_misleading_links.hint": "Añadir una indicación visual indicando el destino de los enlace que no los mencionen explícitamente", "settings.wide_view": "Vista amplia (solo modo de escritorio)", "status.collapse": "Colapsar", + "status.in_reply_to": "Este toot es una respuesta", + "status.is_poll": "Este toot es una encuesta", "status.uncollapse": "Descolapsar" } diff --git a/app/javascript/flavours/glitch/locales/ko.json b/app/javascript/flavours/glitch/locales/ko.json index f17f32a9d..045a3894b 100644 --- a/app/javascript/flavours/glitch/locales/ko.json +++ b/app/javascript/flavours/glitch/locales/ko.json @@ -103,6 +103,7 @@ "settings.auto_collapse_all": "모두", "settings.auto_collapse_lengthy": "긴 글", "settings.auto_collapse_media": "미디어 포함 글", + "settings.auto_collapse_height": "길이가 긴 것으로 간주할 툿이 높이 (픽셀 단위)", "settings.auto_collapse_notifications": "알림", "settings.auto_collapse_reblogs": "부스트", "settings.auto_collapse_replies": "답글", diff --git a/app/javascript/flavours/glitch/locales/pt-BR.json b/app/javascript/flavours/glitch/locales/pt-BR.json index 0bc0d2bea..f658d3bdc 100644 --- a/app/javascript/flavours/glitch/locales/pt-BR.json +++ b/app/javascript/flavours/glitch/locales/pt-BR.json @@ -103,6 +103,7 @@ "settings.auto_collapse_all": "Tudo", "settings.auto_collapse_lengthy": "Toots longos", "settings.auto_collapse_media": "Toots com mídia", + "settings.auto_collapse_height": "Altura (em pixels) para um toot ser considerado longo", "settings.auto_collapse_notifications": "Notificações", "settings.auto_collapse_reblogs": "Impulsos", "settings.auto_collapse_replies": "Respostas", @@ -112,7 +113,7 @@ "settings.confirm_before_clearing_draft": "Mostrar diálogo de confirmação antes de sobrescrever a mensagem que está sendo composta", "settings.confirm_boost_missing_media_description": "Mostrar diálogo antes de inpulsionar os toots sem descrições de mídia", "settings.confirm_missing_media_description": "Mostrar diálogo antes de enviar toots sem descrições de mídia", - "settings.content_warnings": "Content warnings", + "settings.content_warnings": "Aviso de Conteúdo", "settings.content_warnings.regexp": "Expressão regular", "settings.content_warnings_filter": "Avisos de conteúdo para não revelar automaticamente:", "settings.content_warnings_media_outside": "Exibir anexos de mídia fora avisos de conteúdo", @@ -148,7 +149,7 @@ "settings.pop_in_player": "Ativar player pop-in", "settings.pop_in_position": "Posição do player:", "settings.pop_in_right": "Direita", - "settings.preferences": "Preferences", + "settings.preferences": "Preferências do usuário", "settings.prepend_cw_re": "Preparar \"re: \" para avisos de conteúdo quando responder", "settings.preselect_on_reply": "Nome de usuário pré-selecionado na resposta", "settings.preselect_on_reply_hint": "Ao responder a uma conversa com vários participantes, pré-selecionar nomes de usuários após o primeiro", diff --git a/config/locales-glitch/es.yml b/config/locales-glitch/es.yml index d842deb67..f7f068faa 100644 --- a/config/locales-glitch/es.yml +++ b/config/locales-glitch/es.yml @@ -1,6 +1,9 @@ --- es: admin: + custom_emojis: + batch_copy_error: 'Se produjo un error cuando se copian algunos emojis seleccionados %{message}' + batch_error: 'Ocurrió un error %{message}' settings: hide_followers_count: desc_html: No mostrar el conteo de seguidorxs en perfiles de usuarix @@ -14,6 +17,12 @@ es: show_replies_in_public_timelines: desc_html: Además de auto-respuestas públicas (hilos), mostrar respuestas públicas en las línea de tiempo local y pública. title: Mostrar respuestas en líneas de tiempo públicas + trending_status_cw: + title: Permitir que toots con advertencias de contenido sean tendencia + appearance: + localization: + glitch_guide_link: https://crowdin.com/project/glitch-soc + glitch_guide_link_text: Al igual que para glitch-soc! generic: use_this: Usar settings: diff --git a/config/locales-glitch/pt-PT.yml b/config/locales-glitch/pt-PT.yml index a1a2dc36b..6af5de0a7 100644 --- a/config/locales-glitch/pt-PT.yml +++ b/config/locales-glitch/pt-PT.yml @@ -1 +1,27 @@ -pt-PT: +--- +pt: + admin: + custom_emojis: + batch_copy_error: 'Houve um erro ao copiar alguns dos emoji selecionados: %{message}' + batch_error: 'Houve um erro: %{message}' + settings: + captcha_enabled: + desc_html: Isto depende de scripts externos da hCaptcha, o que pode ser uma preocupação de segurança e privacidade. Além disso, isto pode tornar o processo de registo menos acessível para algumas pessoas (especialmente as com limitações físicas). Por isto, considera medidas alternativas tais como registo mediante aprovação ou sob convite.
Pessoas que se registam com um convite não precisam de resolver um CAPTCHA + title: Exigir que novas contas resolvam um CAPTCHA para validar o registo + flavour_and_skin: + title: Sabor e tema + hide_followers_count: + desc_html: Não mostrar o número de seguidores nos perfis + title: Esconder o número de seguidores + other: + preamble: Várias opções do glitch-soc que não cabem noutras categorias. + title: Outras opções + outgoing_spoilers: + desc_html: Ao federar toots, juntar este aviso de conteúdo aos toots que não têm aviso. Isto é útil se o teu servidor for especializado em conteúdos que outros servidores podem querer ter sob um Aviso de Conteúdo. Os media também vão ser marcados como sensíveis. + title: Aviso de conteúdo para toots enviados + show_reblogs_in_public_timelines: + desc_html: Mostrar boosts públicos de toots públicos nas linhas de tempo locais e públicas. + title: Mostrar boosts nas timelines públicas + show_replies_in_public_timelines: + desc_html: Além de auto-respostas públicas (fios), mostrar as respostas públicas em linhas de tempo locais e públicas. + title: Mostrar respostas nas linhas de tempo públicas -- cgit From ee4250545236e4330c46b43f4abfe94ad323d4d4 Mon Sep 17 00:00:00 2001 From: Dean Bassett Date: Sun, 12 Feb 2023 09:58:02 -0800 Subject: fix hashtag ordering (#2107) Co-authored-by: Eugen Rochko --- app/javascript/flavours/glitch/reducers/compose.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index bb42580d4..57ab36b3d 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -282,9 +282,9 @@ const sortHashtagsByUse = (state, tags) => { if (usedA === usedB) { return 0; } else if (usedA && !usedB) { - return 1; - } else { return -1; + } else { + return 1; } }); }; -- cgit From 58291b31fa8eff7bb5dd76b605377a33a977fa5a Mon Sep 17 00:00:00 2001 From: Claire Date: Fri, 10 Feb 2023 22:03:35 +0100 Subject: [Glitch] Fix attached media uploads not being cleared when replying to a post Port bae17ebe5eab02879599ae8516cf6b3f6736b450 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/features/compose/components/upload.js | 5 +++++ app/javascript/flavours/glitch/reducers/compose.js | 2 ++ 2 files changed, 7 insertions(+) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/compose/components/upload.js b/app/javascript/flavours/glitch/features/compose/components/upload.js index c82b8d55a..63582c636 100644 --- a/app/javascript/flavours/glitch/features/compose/components/upload.js +++ b/app/javascript/flavours/glitch/features/compose/components/upload.js @@ -32,6 +32,11 @@ export default class Upload extends ImmutablePureComponent { render () { const { media } = this.props; + + if (!media) { + return null; + } + const focusX = media.getIn(['meta', 'focus', 'x']); const focusY = media.getIn(['meta', 'focus', 'y']); const x = ((focusX / 2) + .5) * 100; diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index 57ab36b3d..c31cc5694 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -421,6 +421,8 @@ export default function compose(state = initialState, action) { map.set('preselectDate', new Date()); map.set('idempotencyKey', uuid()); + map.update('media_attachments', list => list.filter(media => media.get('unattached'))); + if (action.status.get('language') && !action.status.has('translation')) { map.set('language', action.status.get('language')); } else { -- cgit From 40fc917a8616898b842ab9f59c81e67a464c3483 Mon Sep 17 00:00:00 2001 From: Dean Bassett Date: Mon, 13 Feb 2023 05:54:08 -0800 Subject: [Glitch] Fix case-sensitive check for previously used hashtags Port 4da5f77d929d6b83c134cae1eefbc8ba2db752f8 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/reducers/compose.js | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/reducers/compose.js b/app/javascript/flavours/glitch/reducers/compose.js index c31cc5694..109e4c723 100644 --- a/app/javascript/flavours/glitch/reducers/compose.js +++ b/app/javascript/flavours/glitch/reducers/compose.js @@ -273,11 +273,12 @@ const ignoreSuggestion = (state, position, token, completion, path) => { }; const sortHashtagsByUse = (state, tags) => { - const personalHistory = state.get('tagHistory'); + const personalHistory = state.get('tagHistory').map(tag => tag.toLowerCase()); - return tags.sort((a, b) => { - const usedA = personalHistory.includes(a.name); - const usedB = personalHistory.includes(b.name); + const tagsWithLowercase = tags.map(t => ({ ...t, lowerName: t.name.toLowerCase() })); + const sorted = tagsWithLowercase.sort((a, b) => { + const usedA = personalHistory.includes(a.lowerName); + const usedB = personalHistory.includes(b.lowerName); if (usedA === usedB) { return 0; @@ -287,6 +288,8 @@ const sortHashtagsByUse = (state, tags) => { return 1; } }); + sorted.forEach(tag => delete tag.lowerName); + return sorted; }; const insertEmoji = (state, position, emojiData) => { -- cgit From 2be88d1930433f55e5ae17174f3711cefb3d5158 Mon Sep 17 00:00:00 2001 From: Claire Date: Sat, 18 Feb 2023 11:16:30 +0100 Subject: New Crowdin updates (#2111) * New translations en.json (Korean) [ci skip] * New translations en.json (Portuguese, Brazilian) [ci skip] * New translations en.json (Portuguese, Brazilian) [ci skip] * New translations en.yml (Portuguese) [ci skip] * New translations en.json (Portuguese) [ci skip] * Fix root key name in pt-PT translation file * Fix normalization issue with ES translation * Fix issue with `no` locale in glitch-soc --- app/javascript/flavours/glitch/locales/ko.json | 2 +- app/javascript/flavours/glitch/locales/pt-BR.json | 2 +- app/javascript/flavours/glitch/locales/pt-PT.json | 19 +++++++++++++++++++ config/locales-glitch/es.yml | 4 ++-- config/locales-glitch/no.yml | 3 ++- config/locales-glitch/pt-PT.yml | 17 ++++++++++++++++- config/locales-glitch/simple_form.no.yml | 3 ++- 7 files changed, 43 insertions(+), 7 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/locales/ko.json b/app/javascript/flavours/glitch/locales/ko.json index 045a3894b..ceaccf8b4 100644 --- a/app/javascript/flavours/glitch/locales/ko.json +++ b/app/javascript/flavours/glitch/locales/ko.json @@ -103,7 +103,7 @@ "settings.auto_collapse_all": "모두", "settings.auto_collapse_lengthy": "긴 글", "settings.auto_collapse_media": "미디어 포함 글", - "settings.auto_collapse_height": "길이가 긴 것으로 간주할 툿이 높이 (픽셀 단위)", + "settings.auto_collapse_height": "길이가 긴 것으로 간주할 툿의 높이 (픽셀 단위)", "settings.auto_collapse_notifications": "알림", "settings.auto_collapse_reblogs": "부스트", "settings.auto_collapse_replies": "답글", diff --git a/app/javascript/flavours/glitch/locales/pt-BR.json b/app/javascript/flavours/glitch/locales/pt-BR.json index f658d3bdc..c73947819 100644 --- a/app/javascript/flavours/glitch/locales/pt-BR.json +++ b/app/javascript/flavours/glitch/locales/pt-BR.json @@ -2,7 +2,7 @@ "about.fork_disclaimer": "O Glitch-soc é um software gratuito de código aberto bifurcado a partir do Mastodon.", "account.add_account_note": "Adicionar nota para @{name}", "account.disclaimer_full": "As informações abaixo podem refletir o perfil do usuário de forma incompleta.", - "account.follows": "Seguidores", + "account.follows": "Segue", "account.joined": "Entrou em {date}", "account.suspended_disclaimer_full": "Este usuário foi suspenso por um moderador.", "account.view_full_profile": "Ver o perfil completo", diff --git a/app/javascript/flavours/glitch/locales/pt-PT.json b/app/javascript/flavours/glitch/locales/pt-PT.json index 4d243f94c..fc3cdc621 100644 --- a/app/javascript/flavours/glitch/locales/pt-PT.json +++ b/app/javascript/flavours/glitch/locales/pt-PT.json @@ -1,4 +1,23 @@ { + "about.fork_disclaimer": "O Glitch-soc é um software livre de código aberto, derivado (fork) do Mastodon.", + "account.add_account_note": "Juntar uma nota sobre @{name}", + "account.disclaimer_full": "As informações abaixo podem não refletir completamente o perfil do utilizador.", + "account.follows": "A seguir", + "account.joined": "Juntou-se em {date}", + "account.suspended_disclaimer_full": "Este utilizador foi suspenso por um elemento da moderação.", + "account.view_full_profile": "Ver o perfil completo", + "account_note.cancel": "Cancelar", + "account_note.edit": "Editar", + "account_note.glitch_placeholder": "Nenhum comentário dado", + "account_note.save": "Gravar", + "advanced_options.icon_title": "Opções avançadas", + "advanced_options.local-only.long": "Não publicar noutras instâncias", + "advanced_options.local-only.short": "Apenas local", + "advanced_options.local-only.tooltip": "Este post é apenas local", + "advanced_options.threaded_mode.long": "Abrir automaticamente uma resposta ao publicar", + "advanced_options.threaded_mode.short": "Modo de fio", + "advanced_options.threaded_mode.tooltip": "Modo de fio ativado", + "boost_modal.missing_description": "Este post contém alguns media sem descrição", "onboarding.page_one.federation": "{domain} is an \"instance\" of Mastodon. Mastodon is a network of independent servers joining up to make one larger social network. We call these servers instances.", "onboarding.page_six.github": "{domain} runs on Glitchsoc. Glitchsoc is a friendly {fork} of {Mastodon}. Glitchsoc is fully compatible with all Mastodon apps and instances. Glitchsoc is free open-source software. You can report bugs, request features, or contribute to the code on {github}.", "settings.content_warnings": "Content warnings", diff --git a/config/locales-glitch/es.yml b/config/locales-glitch/es.yml index f7f068faa..c03cea6c6 100644 --- a/config/locales-glitch/es.yml +++ b/config/locales-glitch/es.yml @@ -2,8 +2,8 @@ es: admin: custom_emojis: - batch_copy_error: 'Se produjo un error cuando se copian algunos emojis seleccionados %{message}' - batch_error: 'Ocurrió un error %{message}' + batch_copy_error: Se produjo un error cuando se copian algunos emojis seleccionados %{message} + batch_error: Ocurrió un error %{message} settings: hide_followers_count: desc_html: No mostrar el conteo de seguidorxs en perfiles de usuarix diff --git a/config/locales-glitch/no.yml b/config/locales-glitch/no.yml index d2a4697e5..1dcec34b6 100644 --- a/config/locales-glitch/no.yml +++ b/config/locales-glitch/no.yml @@ -1 +1,2 @@ -no: +--- +'no': diff --git a/config/locales-glitch/pt-PT.yml b/config/locales-glitch/pt-PT.yml index 6af5de0a7..18e41a056 100644 --- a/config/locales-glitch/pt-PT.yml +++ b/config/locales-glitch/pt-PT.yml @@ -1,5 +1,5 @@ --- -pt: +pt-PT: admin: custom_emojis: batch_copy_error: 'Houve um erro ao copiar alguns dos emoji selecionados: %{message}' @@ -25,3 +25,18 @@ pt: show_replies_in_public_timelines: desc_html: Além de auto-respostas públicas (fios), mostrar as respostas públicas em linhas de tempo locais e públicas. title: Mostrar respostas nas linhas de tempo públicas + trending_status_cw: + desc_html: Quando os posts em tendência estão ativados, permitir que posts com Avisos de Conteúdo também possam aparecer. As alterações nesta opção não são retroativas. + title: Permitir que posts com Avisos de Conteúdo possam aparecer nos posts em tendência + appearance: + localization: + glitch_guide_link: https://crowdin.com/project/glitch-soc + glitch_guide_link_text: E também para o glitch-soc! + auth: + captcha_confirmation: + hint_html: Só mais um passo! Para confirmares a tua conta, este servidor exige que resolvas um CAPTCHA. Podes entrar em contacto com o administrador do servidor se tiveres dúvidas ou precisares de ajuda. + title: Verificação + generic: + use_this: Usar isto + settings: + flavours: Sabores diff --git a/config/locales-glitch/simple_form.no.yml b/config/locales-glitch/simple_form.no.yml index d2a4697e5..1dcec34b6 100644 --- a/config/locales-glitch/simple_form.no.yml +++ b/config/locales-glitch/simple_form.no.yml @@ -1 +1,2 @@ -no: +--- +'no': -- cgit From 587f6b3b066360da37066063d659194d43fd7a59 Mon Sep 17 00:00:00 2001 From: Claire Date: Mon, 13 Feb 2023 20:09:01 +0100 Subject: [Glitch] Enable ESLint import recommended rules Port eddfb33dfea6a17e71377d95498b557dd0194477 to glitch-soc --- .../flavours/glitch/features/audio/index.js | 6 ++---- .../compose/containers/poll_form_container.js | 5 ++++- .../compose/containers/upload_container.js | 3 +-- .../flavours/glitch/features/compose/index.js | 3 +-- .../getting_started/components/announcements.js | 3 +-- .../containers/column_settings_container.js | 3 +-- .../flavours/glitch/features/status/index.js | 22 +++++++++++----------- .../features/ui/components/focal_point_modal.js | 3 +-- 8 files changed, 22 insertions(+), 26 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/features/audio/index.js b/app/javascript/flavours/glitch/features/audio/index.js index 1a1d438c0..c4aa98962 100644 --- a/app/javascript/flavours/glitch/features/audio/index.js +++ b/app/javascript/flavours/glitch/features/audio/index.js @@ -1,12 +1,10 @@ import React from 'react'; import PropTypes from 'prop-types'; import { defineMessages, FormattedMessage, injectIntl } from 'react-intl'; -import { formatTime } from 'flavours/glitch/features/video'; +import { formatTime, getPointerPosition, fileNameFromURL } from 'flavours/glitch/features/video'; import Icon from 'flavours/glitch/components/icon'; import classNames from 'classnames'; -import { throttle } from 'lodash'; -import { getPointerPosition, fileNameFromURL } from 'flavours/glitch/features/video'; -import { debounce } from 'lodash'; +import { throttle, debounce } from 'lodash'; import Visualizer from './visualizer'; import { displayMedia, useBlurhash } from 'flavours/glitch/initial_state'; import Blurhash from 'flavours/glitch/components/blurhash'; diff --git a/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js b/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js index 1e0058341..14038b3e8 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/poll_form_container.js @@ -1,7 +1,10 @@ import { connect } from 'react-redux'; import PollForm from '../components/poll_form'; -import { addPollOption, removePollOption, changePollOption, changePollSettings } from 'flavours/glitch/actions/compose'; import { + addPollOption, + removePollOption, + changePollOption, + changePollSettings, clearComposeSuggestions, fetchComposeSuggestions, selectComposeSuggestion, diff --git a/app/javascript/flavours/glitch/features/compose/containers/upload_container.js b/app/javascript/flavours/glitch/features/compose/containers/upload_container.js index f3ca4ce7b..2189c870b 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/upload_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/upload_container.js @@ -1,7 +1,6 @@ import { connect } from 'react-redux'; import Upload from '../components/upload'; -import { undoUploadCompose, initMediaEditModal } from 'flavours/glitch/actions/compose'; -import { submitCompose } from 'flavours/glitch/actions/compose'; +import { undoUploadCompose, initMediaEditModal, submitCompose } from 'flavours/glitch/actions/compose'; const mapStateToProps = (state, { id }) => ({ media: state.getIn(['compose', 'media_attachments']).find(item => item.get('id') === id), diff --git a/app/javascript/flavours/glitch/features/compose/index.js b/app/javascript/flavours/glitch/features/compose/index.js index 68eb05e2c..241caa03b 100644 --- a/app/javascript/flavours/glitch/features/compose/index.js +++ b/app/javascript/flavours/glitch/features/compose/index.js @@ -4,7 +4,7 @@ import NavigationContainer from './containers/navigation_container'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { connect } from 'react-redux'; -import { mountCompose, unmountCompose } from 'flavours/glitch/actions/compose'; +import { mountCompose, unmountCompose, cycleElefriendCompose } from 'flavours/glitch/actions/compose'; import { injectIntl, defineMessages } from 'react-intl'; import classNames from 'classnames'; import SearchContainer from './containers/search_container'; @@ -12,7 +12,6 @@ import Motion from '../ui/util/optional_motion'; import spring from 'react-motion/lib/spring'; import SearchResultsContainer from './containers/search_results_container'; import { me, mascot } from 'flavours/glitch/initial_state'; -import { cycleElefriendCompose } from 'flavours/glitch/actions/compose'; import HeaderContainer from './containers/header_container'; import Column from 'flavours/glitch/components/column'; import { Helmet } from 'react-helmet'; diff --git a/app/javascript/flavours/glitch/features/getting_started/components/announcements.js b/app/javascript/flavours/glitch/features/getting_started/components/announcements.js index 5ff4f0523..fb9024447 100644 --- a/app/javascript/flavours/glitch/features/getting_started/components/announcements.js +++ b/app/javascript/flavours/glitch/features/getting_started/components/announcements.js @@ -6,9 +6,8 @@ import PropTypes from 'prop-types'; import IconButton from 'flavours/glitch/components/icon_button'; import Icon from 'flavours/glitch/components/icon'; import { defineMessages, injectIntl, FormattedMessage, FormattedDate } from 'react-intl'; -import { autoPlayGif, reduceMotion, disableSwiping } from 'flavours/glitch/initial_state'; +import { autoPlayGif, reduceMotion, disableSwiping, mascot } from 'flavours/glitch/initial_state'; import elephantUIPlane from 'mastodon/../images/elephant_ui_plane.svg'; -import { mascot } from 'flavours/glitch/initial_state'; import unicodeMapping from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; import classNames from 'classnames'; import EmojiPickerDropdown from 'flavours/glitch/features/compose/containers/emoji_picker_dropdown_container'; diff --git a/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js b/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js index c2564f44e..27c2f96fe 100644 --- a/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js +++ b/app/javascript/flavours/glitch/features/notifications/containers/column_settings_container.js @@ -2,8 +2,7 @@ import { connect } from 'react-redux'; import { defineMessages, injectIntl } from 'react-intl'; import ColumnSettings from '../components/column_settings'; import { changeSetting } from 'flavours/glitch/actions/settings'; -import { setFilter } from 'flavours/glitch/actions/notifications'; -import { clearNotifications, requestBrowserPermission } from 'flavours/glitch/actions/notifications'; +import { setFilter, clearNotifications, requestBrowserPermission } from 'flavours/glitch/actions/notifications'; import { changeAlerts as changePushNotifications } from 'flavours/glitch/actions/push_notifications'; import { openModal } from 'flavours/glitch/actions/modal'; import { showAlert } from 'flavours/glitch/actions/alerts'; diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js index 9b49d41e4..cbab90e81 100644 --- a/app/javascript/flavours/glitch/features/status/index.js +++ b/app/javascript/flavours/glitch/features/status/index.js @@ -5,7 +5,17 @@ import PropTypes from 'prop-types'; import classNames from 'classnames'; import ImmutablePropTypes from 'react-immutable-proptypes'; import { createSelector } from 'reselect'; -import { fetchStatus } from 'flavours/glitch/actions/statuses'; +import { + fetchStatus, + muteStatus, + unmuteStatus, + deleteStatus, + editStatus, + hideStatus, + revealStatus, + translateStatus, + undoStatusTranslation, +} from 'flavours/glitch/actions/statuses'; import MissingIndicator from 'flavours/glitch/components/missing_indicator'; import LoadingIndicator from 'flavours/glitch/components/loading_indicator'; import DetailedStatus from './components/detailed_status'; @@ -27,16 +37,6 @@ import { directCompose, } from 'flavours/glitch/actions/compose'; import { changeLocalSetting } from 'flavours/glitch/actions/local_settings'; -import { - muteStatus, - unmuteStatus, - deleteStatus, - editStatus, - hideStatus, - revealStatus, - translateStatus, - undoStatusTranslation, -} from 'flavours/glitch/actions/statuses'; import { initMuteModal } from 'flavours/glitch/actions/mutes'; import { initBlockModal } from 'flavours/glitch/actions/blocks'; import { initReport } from 'flavours/glitch/actions/reports'; diff --git a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js index e36657fab..8e624adb3 100644 --- a/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js @@ -5,11 +5,10 @@ import ImmutablePureComponent from 'react-immutable-pure-component'; import { connect } from 'react-redux'; import classNames from 'classnames'; import { changeUploadCompose, uploadThumbnail, onChangeMediaDescription, onChangeMediaFocus } from 'flavours/glitch/actions/compose'; -import { getPointerPosition } from 'flavours/glitch/features/video'; +import Video, { getPointerPosition } from 'flavours/glitch/features/video'; import { FormattedMessage, defineMessages, injectIntl } from 'react-intl'; import IconButton from 'flavours/glitch/components/icon_button'; import Button from 'flavours/glitch/components/button'; -import Video from 'flavours/glitch/features/video'; import Audio from 'flavours/glitch/features/audio'; import Textarea from 'react-textarea-autosize'; import UploadProgress from 'flavours/glitch/features/compose/components/upload_progress'; -- cgit From 7e64eef73b62fcb1537181e66bcd3e5e25fcc665 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Mon, 13 Feb 2023 09:12:14 -0500 Subject: [Glitch] Enable ESLint no-useless-escape Port db2c58d47ae0db8490a30cd3846f30e615c382b5 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/actions/push_notifications/registerer.js | 2 +- .../flavours/glitch/features/compose/containers/warning_container.js | 2 +- app/javascript/flavours/glitch/features/compose/util/counter.js | 2 +- app/javascript/flavours/glitch/features/emoji/emoji_utils.js | 2 +- .../glitch/features/follow_recommendations/components/account.js | 2 +- app/javascript/flavours/glitch/utils/hashtag.js | 2 +- 6 files changed, 6 insertions(+), 6 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/actions/push_notifications/registerer.js b/app/javascript/flavours/glitch/actions/push_notifications/registerer.js index 762fe260c..bc5634233 100644 --- a/app/javascript/flavours/glitch/actions/push_notifications/registerer.js +++ b/app/javascript/flavours/glitch/actions/push_notifications/registerer.js @@ -6,7 +6,7 @@ import { setBrowserSupport, setSubscription, clearSubscription } from './setter' const urlBase64ToUint8Array = (base64String) => { const padding = '='.repeat((4 - base64String.length % 4) % 4); const base64 = (base64String + padding) - .replace(/\-/g, '+') + .replace(/-/g, '+') .replace(/_/g, '/'); const rawData = window.atob(base64); diff --git a/app/javascript/flavours/glitch/features/compose/containers/warning_container.js b/app/javascript/flavours/glitch/features/compose/containers/warning_container.js index 9402601f8..5b48c45e4 100644 --- a/app/javascript/flavours/glitch/features/compose/containers/warning_container.js +++ b/app/javascript/flavours/glitch/features/compose/containers/warning_container.js @@ -25,7 +25,7 @@ const buildHashtagRE = () => { '))', 'iu', ); } catch { - return /(?:^|[^\/\)\w])#(\w*[a-zA-Z·]\w*)/i; + return /(?:^|[^/)\w])#(\w*[a-zA-Z·]\w*)/i; } }; diff --git a/app/javascript/flavours/glitch/features/compose/util/counter.js b/app/javascript/flavours/glitch/features/compose/util/counter.js index 5a68bad99..ec2431096 100644 --- a/app/javascript/flavours/glitch/features/compose/util/counter.js +++ b/app/javascript/flavours/glitch/features/compose/util/counter.js @@ -5,5 +5,5 @@ const urlPlaceholder = '$2xxxxxxxxxxxxxxxxxxxxxxx'; export function countableText(inputText) { return inputText .replace(urlRegex, urlPlaceholder) - .replace(/(^|[^\/\w])@(([a-z0-9_]+)@[a-z0-9\.\-]+[a-z0-9]+)/ig, '$1@$3'); + .replace(/(^|[^/\w])@(([a-z0-9_]+)@[a-z0-9.-]+[a-z0-9]+)/ig, '$1@$3'); } diff --git a/app/javascript/flavours/glitch/features/emoji/emoji_utils.js b/app/javascript/flavours/glitch/features/emoji/emoji_utils.js index 571907a50..be793526d 100644 --- a/app/javascript/flavours/glitch/features/emoji/emoji_utils.js +++ b/app/javascript/flavours/glitch/features/emoji/emoji_utils.js @@ -73,7 +73,7 @@ const stringFromCodePoint = _String.fromCodePoint || function () { const _JSON = JSON; -const COLONS_REGEX = /^(?:\:([^\:]+)\:)(?:\:skin-tone-(\d)\:)?$/; +const COLONS_REGEX = /^(?::([^:]+):)(?::skin-tone-(\d):)?$/; const SKINS = [ '1F3FA', '1F3FB', '1F3FC', '1F3FD', '1F3FE', '1F3FF', diff --git a/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js b/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js index 7c8a71879..81d39bd49 100644 --- a/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js +++ b/app/javascript/flavours/glitch/features/follow_recommendations/components/account.js @@ -27,7 +27,7 @@ const makeMapStateToProps = () => { }; const getFirstSentence = str => { - const arr = str.split(/(([\.\?!]+\s)|[.。?!\n•])/); + const arr = str.split(/(([.?!]+\s)|[.。?!\n•])/); return arr[0]; }; diff --git a/app/javascript/flavours/glitch/utils/hashtag.js b/app/javascript/flavours/glitch/utils/hashtag.js index 8f5665c46..d91cd5591 100644 --- a/app/javascript/flavours/glitch/utils/hashtag.js +++ b/app/javascript/flavours/glitch/utils/hashtag.js @@ -1,6 +1,6 @@ export function recoverHashtags (recognizedTags, text) { return recognizedTags.map(tag => { - const re = new RegExp(`(?:^|[^\/)\w])#(${tag.name})`, 'i'); + const re = new RegExp(`(?:^|[^/)\w])#(${tag.name})`, 'i'); const matched_hashtag = text.match(re); return matched_hashtag ? matched_hashtag[1] : null; }, -- cgit From ea9a1d79df60749eb21fb592c608dcaa4c935c75 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Sun, 12 Feb 2023 22:57:03 -0500 Subject: [Glitch] Upgrade to Stylelint 15 with Prettier Port 0c9d455ea5540e854c2d879cd1df015ea493f622 to glitch-soc Signed-off-by: Claire --- .prettierignore | 10 ++- app/javascript/flavours/glitch/styles/_mixins.scss | 5 +- .../flavours/glitch/styles/accessibility.scss | 7 +- app/javascript/flavours/glitch/styles/admin.scss | 25 ++++-- app/javascript/flavours/glitch/styles/basics.scss | 10 ++- .../glitch/styles/components/accounts.scss | 34 ++++---- .../glitch/styles/components/announcements.scss | 6 +- .../flavours/glitch/styles/components/columns.scss | 17 ++-- .../glitch/styles/components/compose_form.scss | 99 ++++++++++++++++------ .../glitch/styles/components/directory.scss | 10 ++- .../flavours/glitch/styles/components/doodle.scss | 12 +-- .../flavours/glitch/styles/components/drawer.scss | 41 +++++++-- .../flavours/glitch/styles/components/emoji.scss | 2 +- .../glitch/styles/components/emoji_picker.scss | 8 +- .../flavours/glitch/styles/components/index.scss | 36 +++++--- .../glitch/styles/components/local_settings.scss | 11 ++- .../flavours/glitch/styles/components/media.scss | 18 ++-- .../flavours/glitch/styles/components/modal.scss | 12 ++- .../glitch/styles/components/privacy_policy.scss | 4 +- .../glitch/styles/components/sensitive.scss | 8 +- .../glitch/styles/components/single_column.scss | 2 +- .../flavours/glitch/styles/components/status.scss | 73 +++++++++++----- .../flavours/glitch/styles/contrast/variables.scss | 2 +- app/javascript/flavours/glitch/styles/forms.scss | 48 ++++++----- .../glitch/styles/mastodon-light/diff.scss | 43 +++++++--- app/javascript/flavours/glitch/styles/modal.scss | 4 +- app/javascript/flavours/glitch/styles/polls.scss | 12 +-- app/javascript/flavours/glitch/styles/rtl.scss | 18 ++-- .../flavours/glitch/styles/statuses.scss | 2 +- .../flavours/glitch/styles/variables.scss | 31 ++++--- app/javascript/flavours/glitch/styles/widgets.scss | 2 +- 31 files changed, 406 insertions(+), 206 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/.prettierignore b/.prettierignore index d04207d39..e55c28416 100644 --- a/.prettierignore +++ b/.prettierignore @@ -74,9 +74,15 @@ docker-compose.override.yml # Ignore vendored CSS reset app/javascript/styles/mastodon/reset.scss +# Ignore glitch-soc emoji map file +/app/javascript/flavours/glitch/features/emoji/emoji_map.json + # Ignore glitch-soc locale files /app/javascript/flavours/glitch/locales /config/locales-glitch -# Ignore glitch-soc emoji map file -/app/javascript/flavours/glitch/features/emoji/emoji_map.json +# Ignore glitch-soc vendored CSS reset +app/javascript/flavours/glitch/styles/reset.scss + +# Ignore win95 theme +app/javascript/styles/win95.scss diff --git a/app/javascript/flavours/glitch/styles/_mixins.scss b/app/javascript/flavours/glitch/styles/_mixins.scss index 9f6314f3f..90f748c51 100644 --- a/app/javascript/flavours/glitch/styles/_mixins.scss +++ b/app/javascript/flavours/glitch/styles/_mixins.scss @@ -4,7 +4,7 @@ background-clip: padding-box; } -@mixin avatar-size($size:48px) { +@mixin avatar-size($size: 48px) { width: $size; height: $size; background-size: $size $size; @@ -22,7 +22,8 @@ } @mixin limited-single-column($media, $parent: '&') { - .auto-columns #{$parent}, .single-column #{$parent} { + .auto-columns #{$parent}, + .single-column #{$parent} { @media #{$media} { @content; } diff --git a/app/javascript/flavours/glitch/styles/accessibility.scss b/app/javascript/flavours/glitch/styles/accessibility.scss index 7bffb2e26..fb2376abf 100644 --- a/app/javascript/flavours/glitch/styles/accessibility.scss +++ b/app/javascript/flavours/glitch/styles/accessibility.scss @@ -1,4 +1,7 @@ -$emojis-requiring-inversion: 'back' 'copyright' 'curly_loop' 'currency_exchange' 'end' 'heavy_check_mark' 'heavy_division_sign' 'heavy_dollar_sign' 'heavy_minus_sign' 'heavy_multiplication_x' 'heavy_plus_sign' 'on' 'registered' 'soon' 'spider' 'telephone_receiver' 'tm' 'top' 'wavy_dash' !default; +$emojis-requiring-inversion: 'back' 'copyright' 'curly_loop' 'currency_exchange' + 'end' 'heavy_check_mark' 'heavy_division_sign' 'heavy_dollar_sign' + 'heavy_minus_sign' 'heavy_multiplication_x' 'heavy_plus_sign' 'on' + 'registered' 'soon' 'spider' 'telephone_receiver' 'tm' 'top' 'wavy_dash' !default; %emoji-color-inversion { filter: invert(1); @@ -19,7 +22,7 @@ $emojis-requiring-inversion: 'back' 'copyright' 'curly_loop' 'currency_exchange' &.active::after { position: absolute; - content: "\F00C"; + content: '\F00C'; font-size: 50%; font-family: FontAwesome; right: -0.55em; diff --git a/app/javascript/flavours/glitch/styles/admin.scss b/app/javascript/flavours/glitch/styles/admin.scss index 9aa2318ce..61036fc70 100644 --- a/app/javascript/flavours/glitch/styles/admin.scss +++ b/app/javascript/flavours/glitch/styles/admin.scss @@ -1,4 +1,4 @@ -@use "sass:math"; +@use 'sass:math'; $no-columns-breakpoint: 600px; $sidebar-width: 240px; @@ -350,7 +350,7 @@ $content-width: 840px; width: 100%; height: 0; border: 0; - border-bottom: 1px solid rgba($ui-base-lighter-color, .6); + border-bottom: 1px solid rgba($ui-base-lighter-color, 0.6); margin: 20px 0; &.spacer { @@ -1147,7 +1147,10 @@ a.name-tag, @for $i from 0 through 10 { &--#{10 * $i} { - background-color: rgba($ui-highlight-color, 1 * (math.div(max(1, $i), 10))); + background-color: rgba( + $ui-highlight-color, + 1 * (math.div(max(1, $i), 10)) + ); } } } @@ -1236,7 +1239,12 @@ a.sparkline { .skeleton { background-color: lighten($ui-base-color, 8%); - background-image: linear-gradient(90deg, lighten($ui-base-color, 8%), lighten($ui-base-color, 12%), lighten($ui-base-color, 8%)); + background-image: linear-gradient( + 90deg, + lighten($ui-base-color, 8%), + lighten($ui-base-color, 12%), + lighten($ui-base-color, 8%) + ); background-size: 200px 100%; background-repeat: no-repeat; border-radius: 4px; @@ -1285,7 +1293,10 @@ a.sparkline { @for $i from 0 through 10 { &--#{10 * $i} { - background-color: rgba($ui-highlight-color, 1 * (math.div(max(1, $i), 10))); + background-color: rgba( + $ui-highlight-color, + 1 * (math.div(max(1, $i), 10)) + ); } } } @@ -1431,7 +1442,7 @@ a.sparkline { &::after { display: block; - content: ""; + content: ''; width: 50px; height: 21px; position: absolute; @@ -1825,7 +1836,7 @@ a.sparkline { &::after { position: absolute; - content: ""; + content: ''; width: 1px; background: $highlight-text-color; bottom: 0; diff --git a/app/javascript/flavours/glitch/styles/basics.scss b/app/javascript/flavours/glitch/styles/basics.scss index a00b2936f..25aa68f7e 100644 --- a/app/javascript/flavours/glitch/styles/basics.scss +++ b/app/javascript/flavours/glitch/styles/basics.scss @@ -2,7 +2,7 @@ @if type-of($color) == 'color' { $color: str-slice(ie-hex-str($color), 4); } - @return '%23' + unquote($color) + @return '%23' + unquote($color); } body { @@ -13,9 +13,9 @@ body { font-weight: 400; color: $primary-text-color; text-rendering: optimizelegibility; - font-feature-settings: "kern"; + font-feature-settings: 'kern'; text-size-adjust: none; - -webkit-tap-highlight-color: rgba(0,0,0,0); + -webkit-tap-highlight-color: rgba(0, 0, 0, 0); -webkit-tap-highlight-color: transparent; &.system-font { @@ -30,7 +30,9 @@ body { // Droid Sans => Older Androids (<4.0) // Helvetica Neue => Older macOS <10.11 // $font-sans-serif => web-font (Roboto) fallback and newer Androids (>=4.0) - font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", $font-sans-serif, sans-serif; + font-family: system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', + 'Oxygen', 'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', + 'Helvetica Neue', $font-sans-serif, sans-serif; } &.app-body { diff --git a/app/javascript/flavours/glitch/styles/components/accounts.scss b/app/javascript/flavours/glitch/styles/components/accounts.scss index c2a6593b1..89faaae6a 100644 --- a/app/javascript/flavours/glitch/styles/components/accounts.scss +++ b/app/javascript/flavours/glitch/styles/components/accounts.scss @@ -30,7 +30,9 @@ border: 0; padding: 0; - & > .account__avatar-wrapper { margin: 0 8px 0 0 } + & > .account__avatar-wrapper { + margin: 0 8px 0 0; + } & > .display-name { height: 24px; @@ -379,7 +381,7 @@ &::before, &::after { display: block; - content: ""; + content: ''; position: absolute; bottom: 0; left: 50%; @@ -710,22 +712,22 @@ padding: 2px 6px; color: $darker-text-color; - &:hover, - &:active, - &:focus { - color: lighten($darker-text-color, 7%); - background-color: rgba($darker-text-color, 0.15); - } + &:hover, + &:active, + &:focus { + color: lighten($darker-text-color, 7%); + background-color: rgba($darker-text-color, 0.15); + } - &:focus { - background-color: rgba($darker-text-color, 0.3); - } + &:focus { + background-color: rgba($darker-text-color, 0.3); + } - &[disabled] { - color: darken($darker-text-color, 13%); - background-color: transparent; - cursor: default; - } + &[disabled] { + color: darken($darker-text-color, 13%); + background-color: transparent; + cursor: default; + } } .flex-spacer { diff --git a/app/javascript/flavours/glitch/styles/components/announcements.scss b/app/javascript/flavours/glitch/styles/components/announcements.scss index 85af9afc8..feaff81f5 100644 --- a/app/javascript/flavours/glitch/styles/components/announcements.scss +++ b/app/javascript/flavours/glitch/styles/components/announcements.scss @@ -181,7 +181,11 @@ &.active { transition: all 100ms ease-in; transition-property: background-color, color; - background-color: mix(lighten($ui-base-color, 12%), $ui-highlight-color, 80%); + background-color: mix( + lighten($ui-base-color, 12%), + $ui-highlight-color, + 80% + ); .reactions-bar__item__count { color: lighten($highlight-text-color, 8%); diff --git a/app/javascript/flavours/glitch/styles/components/columns.scss b/app/javascript/flavours/glitch/styles/components/columns.scss index 42a591931..263a9ce78 100644 --- a/app/javascript/flavours/glitch/styles/components/columns.scss +++ b/app/javascript/flavours/glitch/styles/components/columns.scss @@ -286,7 +286,7 @@ $ui-header-height: 55px; &::before { display: block; - content: ""; + content: ''; position: absolute; bottom: -13px; left: 0; @@ -296,7 +296,11 @@ $ui-header-height: 55px; pointer-events: none; height: 28px; z-index: 1; - background: radial-gradient(ellipse, rgba($ui-highlight-color, 0.23) 0%, rgba($ui-highlight-color, 0) 60%); + background: radial-gradient( + ellipse, + rgba($ui-highlight-color, 0.23) 0%, + rgba($ui-highlight-color, 0) 60% + ); } } @@ -435,10 +439,10 @@ $ui-header-height: 55px; } } - .layout-single-column .column-header__notif-cleaning-buttons { @media screen and (min-width: $no-gap-breakpoint) { - b, i { + b, + i { margin-right: 5px; } @@ -622,7 +626,8 @@ $ui-header-height: 55px; flex: 1 1 auto; align-items: center; justify-content: center; - @supports(display: grid) { // hack to fix Chrome <57 + @supports (display: grid) { + // hack to fix Chrome <57 contain: strict; } @@ -916,7 +921,7 @@ $ui-header-height: 55px; p { font-size: 16px; - line-height: 24px; + line-height: 24px; font-weight: 400; color: $darker-text-color; } diff --git a/app/javascript/flavours/glitch/styles/components/compose_form.scss b/app/javascript/flavours/glitch/styles/components/compose_form.scss index 40adf28c9..4b800dcd8 100644 --- a/app/javascript/flavours/glitch/styles/components/compose_form.scss +++ b/app/javascript/flavours/glitch/styles/components/compose_form.scss @@ -32,12 +32,12 @@ .spoiler-input { height: 0; transform-origin: bottom; - opacity: 0.0; + opacity: 0; &.spoiler-input--visible { height: 36px; margin-bottom: 11px; - opacity: 1.0; + opacity: 1; } input { @@ -59,8 +59,12 @@ color: $dark-text-color; } - &:focus { outline: 0 } - @include single-column('screen and (max-width: 630px)') { font-size: 16px } + &:focus { + outline: 0; + } + @include single-column('screen and (max-width: 630px)') { + font-size: 16px; + } } } @@ -98,7 +102,7 @@ color: $highlight-text-color; } - input[type=checkbox] { + input[type='checkbox'] { display: none; } @@ -118,7 +122,9 @@ &.active { border-color: $highlight-text-color; - background: $highlight-text-color url("data:image/svg+xml;utf8,") center center no-repeat; + background: $highlight-text-color + url("data:image/svg+xml;utf8,") + center center no-repeat; } } } @@ -137,7 +143,9 @@ margin-bottom: 5px; overflow: hidden; - & > .account.small { color: $inverted-text-color; } + & > .account.small { + color: $inverted-text-color; + } } .reply-indicator__cancel { @@ -159,7 +167,9 @@ padding-top: 5px; overflow: hidden; - p, pre, blockquote { + p, + pre, + blockquote { margin-bottom: 20px; white-space: pre-wrap; @@ -168,12 +178,17 @@ } } - h1, h2, h3, h4, h5 { + h1, + h2, + h3, + h4, + h5 { margin-top: 20px; margin-bottom: 20px; } - h1, h2 { + h1, + h2 { font-weight: 700; font-size: 18px; } @@ -182,7 +197,9 @@ font-size: 16px; } - h3, h4, h5 { + h3, + h4, + h5 { font-weight: 500; } @@ -197,11 +214,13 @@ } } - b, strong { + b, + strong { font-weight: 700; } - em, i { + em, + i { font-style: italic; } @@ -215,7 +234,8 @@ vertical-align: super; } - ul, ol { + ul, + ol { margin-left: 1em; p { @@ -235,13 +255,17 @@ color: $lighter-text-color; text-decoration: none; - &:hover { text-decoration: underline } + &:hover { + text-decoration: underline; + } &.mention { &:hover { text-decoration: none; - span { text-decoration: underline } + span { + text-decoration: underline; + } } } } @@ -321,7 +345,7 @@ font-size: 18px; line-height: 24px; text-align: center; - opacity: .8; + opacity: 0.8; } } @@ -358,7 +382,9 @@ &:hover, &:focus, &:active, - &.selected { background: darken($ui-secondary-color, 10%) } + &.selected { + background: darken($ui-secondary-color, 10%); + } > .account, > .emoji, @@ -396,7 +422,9 @@ & > .account.small { .display-name { - & > span { color: $lighter-text-color } + & > span { + color: $lighter-text-color; + } } } } @@ -430,7 +458,9 @@ background-repeat: no-repeat; overflow: hidden; - & > .close { mix-blend-mode: difference } + & > .close { + mix-blend-mode: difference; + } } .icon-button { @@ -455,12 +485,22 @@ left: 0; right: 0; box-sizing: border-box; - background: linear-gradient(0deg, rgba($base-shadow-color, 0.8) 0, rgba($base-shadow-color, 0.35) 80%, transparent); + background: linear-gradient( + 0deg, + rgba($base-shadow-color, 0.8) 0, + rgba($base-shadow-color, 0.35) 80%, + transparent + ); } } .compose-form__upload__actions { - background: linear-gradient(180deg, rgba($base-shadow-color, 0.8) 0, rgba($base-shadow-color, 0.35) 80%, transparent); + background: linear-gradient( + 180deg, + rgba($base-shadow-color, 0.8) 0, + rgba($base-shadow-color, 0.35) 80%, + transparent + ); display: flex; align-items: flex-start; justify-content: space-between; @@ -543,7 +583,8 @@ margin: 0 3px; border-width: 0 0 0 1px; border-style: none none none solid; - border-color: transparent transparent transparent darken($simple-background-color, 24%); + border-color: transparent transparent transparent + darken($simple-background-color, 24%); padding: 0; width: 0; height: 27px; @@ -604,7 +645,9 @@ flex: 1 1 auto; color: $lighter-text-color; - &:not(:first-child) { margin-left: 10px } + &:not(:first-child) { + margin-left: 10px; + } strong { display: block; @@ -621,11 +664,15 @@ .privacy-dropdown__option__content { color: $primary-text-color; - strong { color: $primary-text-color } + strong { + color: $primary-text-color; + } } } - &.active:hover { background: lighten($ui-highlight-color, 4%) } + &.active:hover { + background: lighten($ui-highlight-color, 4%); + } } .compose-form__publish { diff --git a/app/javascript/flavours/glitch/styles/components/directory.scss b/app/javascript/flavours/glitch/styles/components/directory.scss index 803e075c9..4c914f163 100644 --- a/app/javascript/flavours/glitch/styles/components/directory.scss +++ b/app/javascript/flavours/glitch/styles/components/directory.scss @@ -11,7 +11,11 @@ } .scrollable .account-card__bio::after { - background: linear-gradient(to left, lighten($ui-base-color, 8%), transparent); + background: linear-gradient( + to left, + lighten($ui-base-color, 8%), + transparent + ); } .filter-form { @@ -39,8 +43,8 @@ text-overflow: ellipsis; cursor: pointer; - input[type=radio], - input[type=checkbox] { + input[type='radio'], + input[type='checkbox'] { display: none; } diff --git a/app/javascript/flavours/glitch/styles/components/doodle.scss b/app/javascript/flavours/glitch/styles/components/doodle.scss index a4a1cfc84..eddc1a2a8 100644 --- a/app/javascript/flavours/glitch/styles/components/doodle.scss +++ b/app/javascript/flavours/glitch/styles/components/doodle.scss @@ -38,7 +38,8 @@ $doodleBg: #d9e1e8; margin-right: 2px; } - input[type="number"],input[type="text"] { + input[type='number'], + input[type='text'] { width: 40px; } span.val { @@ -52,7 +53,7 @@ $doodleBg: #d9e1e8; .doodle-palette { padding-right: 0 !important; border: 1px solid black; - line-height: .2rem; + line-height: 0.2rem; flex-grow: 0; background: white; @@ -60,14 +61,15 @@ $doodleBg: #d9e1e8; appearance: none; width: 1rem; height: 1rem; - margin: 0; padding: 0; + margin: 0; + padding: 0; text-align: center; color: black; text-shadow: 0 0 1px white; cursor: pointer; - box-shadow: inset 0 0 1px rgba(white, .5); + box-shadow: inset 0 0 1px rgba(white, 0.5); border: 1px solid black; - outline-offset:-1px; + outline-offset: -1px; &.foreground { outline: 1px dashed white; diff --git a/app/javascript/flavours/glitch/styles/components/drawer.scss b/app/javascript/flavours/glitch/styles/components/drawer.scss index cf996fb71..2c2f25168 100644 --- a/app/javascript/flavours/glitch/styles/components/drawer.scss +++ b/app/javascript/flavours/glitch/styles/components/drawer.scss @@ -34,7 +34,8 @@ } @include single-column('screen and (max-width: 630px)') { - :root & { // Overrides `.wide` for single-column view + :root & { + // Overrides `.wide` for single-column view flex: auto; width: 100%; min-width: 0; @@ -43,7 +44,9 @@ } } - .react-swipeable-view-container & { height: 100% } + .react-swipeable-view-container & { + height: 100%; + } } .drawer--header { @@ -84,8 +87,14 @@ margin-bottom: 10px; flex: none; - @include limited-single-column('screen and (max-width: #{$no-gap-breakpoint})') { margin-bottom: 0 } - @include single-column('screen and (max-width: 630px)') { font-size: 16px } + @include limited-single-column( + 'screen and (max-width: #{$no-gap-breakpoint})' + ) { + margin-bottom: 0; + } + @include single-column('screen and (max-width: 630px)') { + font-size: 16px; + } } .search-popout { @@ -192,7 +201,9 @@ } .drawer__inner__mastodon { - background: lighten($ui-base-color, 13%) url('data:image/svg+xml;utf8,') no-repeat bottom / 100% auto; + background: lighten($ui-base-color, 13%) + url('data:image/svg+xml;utf8,') + no-repeat bottom / 100% auto; flex: 1; min-height: 47px; display: none; @@ -240,13 +251,27 @@ @for $i from 0 through 3 { .mbstobon-#{$i} .drawer__inner__mastodon { @if $i == 3 { - background: url('~flavours/glitch/images/wave-drawer.png') no-repeat bottom / 100% auto, lighten($ui-base-color, 13%); + background: url('~flavours/glitch/images/wave-drawer.png') + no-repeat + bottom / + 100% + auto, + lighten($ui-base-color, 13%); } @else { - background: url('~flavours/glitch/images/wave-drawer-glitched.png') no-repeat bottom / 100% auto, lighten($ui-base-color, 13%); + background: url('~flavours/glitch/images/wave-drawer-glitched.png') + no-repeat + bottom / + 100% + auto, + lighten($ui-base-color, 13%); } & > .mastodon { - background: url("~flavours/glitch/images/mbstobon-ui-#{$i}.png") no-repeat left bottom / contain; + background: url('~flavours/glitch/images/mbstobon-ui-#{$i}.png') + no-repeat + left + bottom / + contain; @if $i != 3 { filter: contrast(50%) brightness(50%); diff --git a/app/javascript/flavours/glitch/styles/components/emoji.scss b/app/javascript/flavours/glitch/styles/components/emoji.scss index c037e03f9..4427f2080 100644 --- a/app/javascript/flavours/glitch/styles/components/emoji.scss +++ b/app/javascript/flavours/glitch/styles/components/emoji.scss @@ -2,7 +2,7 @@ font-size: inherit; vertical-align: middle; object-fit: contain; - margin: -.2ex .15em .2ex; + margin: -0.2ex 0.15em 0.2ex; width: 16px; height: 16px; diff --git a/app/javascript/flavours/glitch/styles/components/emoji_picker.scss b/app/javascript/flavours/glitch/styles/components/emoji_picker.scss index 790650cfa..6bb9827b3 100644 --- a/app/javascript/flavours/glitch/styles/components/emoji_picker.scss +++ b/app/javascript/flavours/glitch/styles/components/emoji_picker.scss @@ -46,7 +46,7 @@ text-align: center; padding: 12px 4px; overflow: hidden; - transition: color .1s ease-out; + transition: color 0.1s ease-out; cursor: pointer; background: transparent; border: 0; @@ -174,7 +174,7 @@ &:hover::before { z-index: 0; - content: ""; + content: ''; position: absolute; top: 0; left: 0; @@ -246,8 +246,8 @@ padding: 5px 6px; padding-top: 70px; - .emoji-mart-no-results-label { - margin-top: .2em; + .emoji-mart-no-results-label { + margin-top: 0.2em; } .emoji-mart-emoji:hover::before { diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index d4c0d77c8..c52f39512 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -370,7 +370,7 @@ body > [data-popper-placement] { .ellipsis { &::after { - content: "…"; + content: '…'; } } @@ -480,11 +480,11 @@ body > [data-popper-placement] { justify-content: center; flex-direction: column; scrollbar-width: none; /* Firefox */ - -ms-overflow-style: none; /* IE 10+ */ + -ms-overflow-style: none; /* IE 10+ */ * { scrollbar-width: none; /* Firefox */ - -ms-overflow-style: none; /* IE 10+ */ + -ms-overflow-style: none; /* IE 10+ */ } &::-webkit-scrollbar, @@ -950,7 +950,8 @@ body > [data-popper-placement] { overflow-y: auto; } - @supports(display: grid) { // hack to fix Chrome <57 + @supports (display: grid) { + // hack to fix Chrome <57 contain: strict; } @@ -971,7 +972,8 @@ body > [data-popper-placement] { } .scrollable.fullscreen { - @supports(display: grid) { // hack to fix Chrome <57 + @supports (display: grid) { + // hack to fix Chrome <57 contain: none; } } @@ -1014,7 +1016,8 @@ body > [data-popper-placement] { transition: background-color 0.2s ease; } -.react-toggle:is(:hover, :focus-within):not(.react-toggle--disabled) .react-toggle-track { +.react-toggle:is(:hover, :focus-within):not(.react-toggle--disabled) + .react-toggle-track { background-color: darken($ui-base-color, 10%); } @@ -1022,7 +1025,8 @@ body > [data-popper-placement] { background-color: darken($ui-highlight-color, 2%); } -.react-toggle--checked:is(:hover, :focus-within):not(.react-toggle--disabled) .react-toggle-track { +.react-toggle--checked:is(:hover, :focus-within):not(.react-toggle--disabled) + .react-toggle-track { background-color: $ui-highlight-color; } @@ -1654,8 +1658,8 @@ button.icon-button.active i.fa-retweet { .icon-badge { position: absolute; display: block; - right: -.25em; - top: -.25em; + right: -0.25em; + top: -0.25em; background-color: $ui-highlight-color; border-radius: 50%; font-size: 75%; @@ -1688,7 +1692,7 @@ button.icon-button.active i.fa-retweet { border-radius: 50%; width: 0.625rem; height: 0.625rem; - margin: -.1ex .15em .1ex; + margin: -0.1ex 0.15em 0.1ex; } &__content { @@ -1797,9 +1801,15 @@ noscript { } @keyframes flicker { - 0% { opacity: 1; } - 30% { opacity: 0.75; } - 100% { opacity: 1; } + 0% { + opacity: 1; + } + 30% { + opacity: 0.75; + } + 100% { + opacity: 1; + } } @import 'boost'; diff --git a/app/javascript/flavours/glitch/styles/components/local_settings.scss b/app/javascript/flavours/glitch/styles/components/local_settings.scss index f36b21e1c..cd441a0c0 100644 --- a/app/javascript/flavours/glitch/styles/components/local_settings.scss +++ b/app/javascript/flavours/glitch/styles/components/local_settings.scss @@ -11,12 +11,14 @@ max-height: 450px; overflow: hidden; - label, legend { + label, + legend { display: block; font-size: 14px; } - .boolean label, .radio_buttons label { + .boolean label, + .radio_buttons label { position: relative; padding-left: 28px; padding-top: 3px; @@ -58,7 +60,7 @@ cursor: pointer; text-decoration: none; outline: none; - transition: background .3s; + transition: background 0.3s; .text-icon-button { color: inherit; @@ -74,7 +76,8 @@ color: $primary-text-color; } - &.close, &.close:hover { + &.close, + &.close:hover { background: $error-value-color; color: $primary-text-color; } diff --git a/app/javascript/flavours/glitch/styles/components/media.scss b/app/javascript/flavours/glitch/styles/components/media.scss index 9776e2265..0216daa12 100644 --- a/app/javascript/flavours/glitch/styles/components/media.scss +++ b/app/javascript/flavours/glitch/styles/components/media.scss @@ -348,7 +348,7 @@ padding: 0; border: 0; font-size: 0; - transition: opacity .2s ease-in-out; + transition: opacity 0.2s ease-in-out; &.active { opacity: 1; @@ -372,7 +372,6 @@ .video-player__volume__handle { bottom: 23px; } - } .audio-player { @@ -506,10 +505,15 @@ left: 0; right: 0; box-sizing: border-box; - background: linear-gradient(0deg, rgba($base-shadow-color, 0.85) 0, rgba($base-shadow-color, 0.45) 60%, transparent); + background: linear-gradient( + 0deg, + rgba($base-shadow-color, 0.85) 0, + rgba($base-shadow-color, 0.45) 60%, + transparent + ); padding: 0 15px; opacity: 0; - transition: opacity .1s ease; + transition: opacity 0.1s ease; &.active { opacity: 1; @@ -655,7 +659,7 @@ } &::before { - content: ""; + content: ''; width: 50px; background: rgba($white, 0.35); border-radius: 4px; @@ -725,7 +729,7 @@ position: relative; &::before { - content: ""; + content: ''; width: 100%; background: rgba($white, 0.35); border-radius: 4px; @@ -762,7 +766,7 @@ box-shadow: 1px 2px 6px rgba($base-shadow-color, 0.2); .no-reduce-motion & { - transition: opacity .1s ease; + transition: opacity 0.1s ease; } &.active { diff --git a/app/javascript/flavours/glitch/styles/components/modal.scss b/app/javascript/flavours/glitch/styles/components/modal.scss index 69d237dec..fc9ba3a18 100644 --- a/app/javascript/flavours/glitch/styles/components/modal.scss +++ b/app/javascript/flavours/glitch/styles/components/modal.scss @@ -269,7 +269,8 @@ } .onboarding-modal__page__wrapper-0 { - background: url('~images/elephant_ui_greeting.svg') no-repeat left bottom / auto 250px; + background: url('~images/elephant_ui_greeting.svg') no-repeat left bottom / + auto 250px; height: 100%; padding: 0; } @@ -989,7 +990,8 @@ font-size: 14px; - label, input { + label, + input { vertical-align: middle; } } @@ -1020,7 +1022,9 @@ width: auto; outline: 0; font-family: inherit; - background: $simple-background-color url("data:image/svg+xml;utf8,") no-repeat right 8px center / auto 16px; + background: $simple-background-color + url("data:image/svg+xml;utf8,") + no-repeat right 8px center / auto 16px; border: 1px solid darken($simple-background-color, 14%); border-radius: 4px; padding: 6px 10px; @@ -1280,7 +1284,7 @@ text-decoration: none; &:hover { - text-decoration: underline + text-decoration: underline; } } } diff --git a/app/javascript/flavours/glitch/styles/components/privacy_policy.scss b/app/javascript/flavours/glitch/styles/components/privacy_policy.scss index 96cf06742..c99e99131 100644 --- a/app/javascript/flavours/glitch/styles/components/privacy_policy.scss +++ b/app/javascript/flavours/glitch/styles/components/privacy_policy.scss @@ -85,14 +85,14 @@ counter-increment: list-counter; &::before { - content: counter(list-counter) "."; + content: counter(list-counter) '.'; position: absolute; left: 0; } } ul > li::before { - content: ""; + content: ''; position: absolute; background-color: $darker-text-color; border-radius: 50%; diff --git a/app/javascript/flavours/glitch/styles/components/sensitive.scss b/app/javascript/flavours/glitch/styles/components/sensitive.scss index 67b01c886..490951fb4 100644 --- a/app/javascript/flavours/glitch/styles/components/sensitive.scss +++ b/app/javascript/flavours/glitch/styles/components/sensitive.scss @@ -17,8 +17,10 @@ font-size: 12px; line-height: 18px; text-transform: uppercase; - opacity: .9; - transition: opacity .1s ease; + opacity: 0.9; + transition: opacity 0.1s ease; - .media-gallery:hover & { opacity: 1 } + .media-gallery:hover & { + opacity: 1; + } } diff --git a/app/javascript/flavours/glitch/styles/components/single_column.scss b/app/javascript/flavours/glitch/styles/components/single_column.scss index 74e5d0884..036b3f6ef 100644 --- a/app/javascript/flavours/glitch/styles/components/single_column.scss +++ b/app/javascript/flavours/glitch/styles/components/single_column.scss @@ -140,7 +140,7 @@ .scrollable { overflow: visible; - @supports(display: grid) { + @supports (display: grid) { contain: content; } } diff --git a/app/javascript/flavours/glitch/styles/components/status.scss b/app/javascript/flavours/glitch/styles/components/status.scss index bb5bbc0ac..9280ef836 100644 --- a/app/javascript/flavours/glitch/styles/components/status.scss +++ b/app/javascript/flavours/glitch/styles/components/status.scss @@ -67,7 +67,9 @@ margin: -3px 0 0; } - p, pre, blockquote { + p, + pre, + blockquote { margin-bottom: 20px; white-space: pre-wrap; unicode-bidi: plaintext; @@ -86,12 +88,17 @@ margin-bottom: 20px; } - h1, h2, h3, h4, h5 { + h1, + h2, + h3, + h4, + h5 { margin-top: 20px; margin-bottom: 20px; } - h1, h2 { + h1, + h2 { font-weight: 700; font-size: 1.2em; } @@ -100,7 +107,9 @@ font-size: 1.1em; } - h3, h4, h5 { + h3, + h4, + h5 { font-weight: 500; } @@ -115,11 +124,13 @@ } } - b, strong { + b, + strong { font-weight: 700; } - em, i { + em, + i { font-style: italic; } @@ -133,7 +144,8 @@ vertical-align: super; } - ul, ol { + ul, + ol { margin-left: 2em; p { @@ -317,8 +329,12 @@ } @keyframes fade { - 0% { opacity: 0; } - 100% { opacity: 1; } + 0% { + opacity: 0; + } + 100% { + opacity: 1; + } } opacity: 1; @@ -381,9 +397,14 @@ right: 0; top: 0; bottom: 0; - background-image: linear-gradient(to bottom, rgba($base-shadow-color, .75), rgba($base-shadow-color, .65) 24px, rgba($base-shadow-color, .8)); + background-image: linear-gradient( + to bottom, + rgba($base-shadow-color, 0.75), + rgba($base-shadow-color, 0.65) 24px, + rgba($base-shadow-color, 0.8) + ); pointer-events: none; - content: ""; + content: ''; } .display-name:hover .display-name__html { @@ -397,25 +418,34 @@ padding-top: 0; &:after { - content: ""; + content: ''; position: absolute; top: 0; bottom: 0; left: 0; right: 0; - background: linear-gradient(rgba($ui-base-color, 0), rgba($ui-base-color, 1)); + background: linear-gradient( + rgba($ui-base-color, 0), + rgba($ui-base-color, 1) + ); pointer-events: none; } - + a:hover { text-decoration: none; } } &:focus > .status__content:after { - background: linear-gradient(rgba(lighten($ui-base-color, 4%), 0), rgba(lighten($ui-base-color, 4%), 1)); + background: linear-gradient( + rgba(lighten($ui-base-color, 4%), 0), + rgba(lighten($ui-base-color, 4%), 1) + ); } &.status-direct > .status__content:after { - background: linear-gradient(rgba(lighten($ui-base-color, 8%), 0), rgba(lighten($ui-base-color, 8%), 1)); + background: linear-gradient( + rgba(lighten($ui-base-color, 8%), 0), + rgba(lighten($ui-base-color, 8%), 1) + ); } .notification__message { @@ -832,7 +862,8 @@ a.status__display-name, bottom: -1px; } - a .fa, a:hover .fa { + a .fa, + a:hover .fa { color: inherit; } } @@ -850,9 +881,9 @@ a.status-card { cursor: zoom-in; display: block; text-decoration: none; - width: 100%; - height: auto; - margin: 0; + width: 100%; + height: auto; + margin: 0; } .status-card-video { @@ -1063,7 +1094,7 @@ a.status-card.compact:hover { &.unread { &::before { - content: ""; + content: ''; position: absolute; top: 0; left: 0; diff --git a/app/javascript/flavours/glitch/styles/contrast/variables.scss b/app/javascript/flavours/glitch/styles/contrast/variables.scss index e272b6ca3..e38d24b27 100644 --- a/app/javascript/flavours/glitch/styles/contrast/variables.scss +++ b/app/javascript/flavours/glitch/styles/contrast/variables.scss @@ -18,5 +18,5 @@ $highlight-text-color: lighten($ui-highlight-color, 10%) !default; $action-button-color: lighten($ui-base-color, 50%); $inverted-text-color: $black !default; -$lighter-text-color: darken($ui-base-color,6%) !default; +$lighter-text-color: darken($ui-base-color, 6%) !default; $light-text-color: darken($ui-primary-color, 40%) !default; diff --git a/app/javascript/flavours/glitch/styles/forms.scss b/app/javascript/flavours/glitch/styles/forms.scss index 6a73b3a2c..602de9002 100644 --- a/app/javascript/flavours/glitch/styles/forms.scss +++ b/app/javascript/flavours/glitch/styles/forms.scss @@ -300,7 +300,7 @@ code { max-width: 100%; height: auto; border-radius: 4px; - background: url("images/void.png"); + background: url('images/void.png'); &:last-child { margin-bottom: 0; @@ -385,7 +385,7 @@ code { flex: 1 1 auto; } - input[type=checkbox] { + input[type='checkbox'] { position: absolute; left: 0; top: 5px; @@ -401,12 +401,12 @@ code { border-radius: 4px; } - input[type=text], - input[type=number], - input[type=email], - input[type=password], - input[type=url], - input[type=datetime-local], + input[type='text'], + input[type='number'], + input[type='email'], + input[type='password'], + input[type='url'], + input[type='datetime-local'], textarea { box-sizing: border-box; font-size: 16px; @@ -444,11 +444,11 @@ code { } } - input[type=text], - input[type=number], - input[type=email], - input[type=password], - input[type=datetime-local] { + input[type='text'], + input[type='number'], + input[type='email'], + input[type='password'], + input[type='datetime-local'] { &:focus:invalid:not(:placeholder-shown), &:required:invalid:not(:placeholder-shown) { border-color: lighten($error-red, 12%); @@ -460,11 +460,11 @@ code { color: lighten($error-red, 12%); } - input[type=text], - input[type=number], - input[type=email], - input[type=password], - input[type=datetime-local], + input[type='text'], + input[type='number'], + input[type='email'], + input[type='password'], + input[type='datetime-local'], textarea, select { border-color: lighten($error-red, 12%); @@ -568,7 +568,9 @@ code { outline: 0; font-family: inherit; resize: vertical; - background: darken($ui-base-color, 10%) url("data:image/svg+xml;utf8,") no-repeat right 8px center / auto 16px; + background: darken($ui-base-color, 10%) + url("data:image/svg+xml;utf8,") + no-repeat right 8px center / auto 16px; border: 1px solid darken($ui-base-color, 14%); border-radius: 4px; padding-left: 10px; @@ -608,7 +610,11 @@ code { right: 0; bottom: 1px; width: 5px; - background-image: linear-gradient(to right, rgba(darken($ui-base-color, 10%), 0), darken($ui-base-color, 10%)); + background-image: linear-gradient( + to right, + rgba(darken($ui-base-color, 10%), 0), + darken($ui-base-color, 10%) + ); } } } @@ -996,7 +1002,7 @@ code { flex: 1 1 auto; } - input[type=text] { + input[type='text'] { background: transparent; border: 0; padding: 10px; diff --git a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss index b97c6c5ad..bb97ecb5f 100644 --- a/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss +++ b/app/javascript/flavours/glitch/styles/mastodon-light/diff.scss @@ -152,7 +152,7 @@ html { } .compose-form__autosuggest-wrapper, -.poll__option input[type="text"], +.poll__option input[type='text'], .compose-form .spoiler-input__input, .compose-form__poll-wrapper select, .search__input, @@ -179,7 +179,9 @@ html { } .compose-form__poll-wrapper select { - background: $simple-background-color url("data:image/svg+xml;utf8,") no-repeat right 8px center / auto 16px; + background: $simple-background-color + url("data:image/svg+xml;utf8,") + no-repeat right 8px center / auto 16px; } .compose-form__poll-wrapper, @@ -205,7 +207,9 @@ html { } .drawer__inner__mastodon { - background: $white url('data:image/svg+xml;utf8,') no-repeat bottom / 100% auto; + background: $white + url('data:image/svg+xml;utf8,') + no-repeat bottom / 100% auto; } // Change the colors used in compose-form @@ -332,11 +336,13 @@ html { color: $white; } -.language-dropdown__dropdown__results__item .language-dropdown__dropdown__results__item__common-name { +.language-dropdown__dropdown__results__item + .language-dropdown__dropdown__results__item__common-name { color: lighten($ui-base-color, 8%); } -.language-dropdown__dropdown__results__item.active .language-dropdown__dropdown__results__item__common-name { +.language-dropdown__dropdown__results__item.active + .language-dropdown__dropdown__results__item__common-name { color: darken($ui-base-color, 12%); } @@ -490,7 +496,8 @@ html { background: darken($ui-secondary-color, 10%); } -.react-toggle.react-toggle--checked:hover:not(.react-toggle--disabled) .react-toggle-track { +.react-toggle.react-toggle--checked:hover:not(.react-toggle--disabled) + .react-toggle-track { background: lighten($ui-highlight-color, 10%); } @@ -522,10 +529,10 @@ html { } .simple_form { - input[type="text"], - input[type="number"], - input[type="email"], - input[type="password"], + input[type='text'], + input[type='number'], + input[type='email'], + input[type='password'], textarea { &:hover { border-color: lighten($ui-base-color, 12%); @@ -682,7 +689,9 @@ html { .mute-modal select { border: 1px solid lighten($ui-base-color, 8%); - background: $simple-background-color url("data:image/svg+xml;utf8,") no-repeat right 8px center / auto 16px; + background: $simple-background-color + url("data:image/svg+xml;utf8,") + no-repeat right 8px center / auto 16px; } // Glitch-soc-specific changes @@ -729,7 +738,8 @@ html { color: $white; } - &.close, &.close:hover { + &.close, + &.close:hover { background: $error-value-color; color: $primary-text-color; } @@ -746,11 +756,16 @@ html { } .status.collapsed .status__content:after { - background: linear-gradient(rgba(darken($ui-base-color, 13%), 0), rgba(darken($ui-base-color, 13%), 1)); + background: linear-gradient( + rgba(darken($ui-base-color, 13%), 0), + rgba(darken($ui-base-color, 13%), 1) + ); } .drawer__inner__mastodon { - background: $white url('data:image/svg+xml;utf8,') no-repeat bottom / 100% auto !important; + background: $white + url('data:image/svg+xml;utf8,') + no-repeat bottom / 100% auto !important; .mastodon { filter: contrast(75%) brightness(75%) !important; diff --git a/app/javascript/flavours/glitch/styles/modal.scss b/app/javascript/flavours/glitch/styles/modal.scss index a333926dd..6170877b2 100644 --- a/app/javascript/flavours/glitch/styles/modal.scss +++ b/app/javascript/flavours/glitch/styles/modal.scss @@ -1,5 +1,7 @@ .modal-layout { - background: $ui-base-color url('data:image/svg+xml;utf8,') repeat-x bottom fixed; + background: $ui-base-color + url('data:image/svg+xml;utf8,') + repeat-x bottom fixed; display: flex; flex-direction: column; height: 100vh; diff --git a/app/javascript/flavours/glitch/styles/polls.scss b/app/javascript/flavours/glitch/styles/polls.scss index 407d71888..5b40aaebe 100644 --- a/app/javascript/flavours/glitch/styles/polls.scss +++ b/app/javascript/flavours/glitch/styles/polls.scss @@ -70,8 +70,8 @@ max-width: calc(100% - 45px - 25px); } - input[type=radio], - input[type=checkbox] { + input[type='radio'], + input[type='checkbox'] { display: none; } @@ -79,7 +79,7 @@ flex: 1 1 auto; } - input[type=text] { + input[type='text'] { display: block; box-sizing: border-box; width: 100%; @@ -205,7 +205,7 @@ &:active, &:focus { - background-color: rgba($dark-text-color, .1); + background-color: rgba($dark-text-color, 0.1); } } @@ -273,7 +273,9 @@ width: auto; outline: 0; font-family: inherit; - background: $simple-background-color url("data:image/svg+xml;utf8,") no-repeat right 8px center / auto 16px; + background: $simple-background-color + url("data:image/svg+xml;utf8,") + no-repeat right 8px center / auto 16px; border: 1px solid darken($simple-background-color, 14%); border-radius: 4px; padding: 6px 10px; diff --git a/app/javascript/flavours/glitch/styles/rtl.scss b/app/javascript/flavours/glitch/styles/rtl.scss index c14c07cb9..64a5c2c03 100644 --- a/app/javascript/flavours/glitch/styles/rtl.scss +++ b/app/javascript/flavours/glitch/styles/rtl.scss @@ -255,8 +255,8 @@ body.rtl { padding-right: 0; } - .simple_form .check_boxes .checkbox input[type="checkbox"], - .simple_form .input.boolean input[type="checkbox"] { + .simple_form .check_boxes .checkbox input[type='checkbox'], + .simple_form .input.boolean input[type='checkbox'] { left: auto; right: 0; } @@ -294,12 +294,18 @@ body.rtl { &::after { right: auto; left: 0; - background-image: linear-gradient(to left, rgba(darken($ui-base-color, 10%), 0), darken($ui-base-color, 10%)); + background-image: linear-gradient( + to left, + rgba(darken($ui-base-color, 10%), 0), + darken($ui-base-color, 10%) + ); } } .simple_form select { - background: darken($ui-base-color, 10%) url("data:image/svg+xml;utf8,") no-repeat left 8px center / auto 16px; + background: darken($ui-base-color, 10%) + url("data:image/svg+xml;utf8,") + no-repeat left 8px center / auto 16px; } .table th, @@ -346,11 +352,11 @@ body.rtl { } .fa-chevron-left::before { - content: "\F054"; + content: '\F054'; } .fa-chevron-right::before { - content: "\F053"; + content: '\F053'; } .column-back-button__icon { diff --git a/app/javascript/flavours/glitch/styles/statuses.scss b/app/javascript/flavours/glitch/styles/statuses.scss index 88fa3ffa0..f7037d9dc 100644 --- a/app/javascript/flavours/glitch/styles/statuses.scss +++ b/app/javascript/flavours/glitch/styles/statuses.scss @@ -134,7 +134,7 @@ a.button.logo-button { } .embed { - .status__content[data-spoiler=folded] { + .status__content[data-spoiler='folded'] { .e-content { display: none; } diff --git a/app/javascript/flavours/glitch/styles/variables.scss b/app/javascript/flavours/glitch/styles/variables.scss index b865b5a2d..25658bb0c 100644 --- a/app/javascript/flavours/glitch/styles/variables.scss +++ b/app/javascript/flavours/glitch/styles/variables.scss @@ -1,18 +1,18 @@ // Commonly used web colors -$black: #000000; // Black -$white: #ffffff; // White -$success-green: #79bd9a; // Padua -$error-red: #df405a; // Cerise -$warning-red: #ff5050; // Sunset Orange -$gold-star: #ca8f04; // Dark Goldenrod +$black: #000000; // Black +$white: #ffffff; // White +$success-green: #79bd9a; // Padua +$error-red: #df405a; // Cerise +$warning-red: #ff5050; // Sunset Orange +$gold-star: #ca8f04; // Dark Goldenrod $red-bookmark: $warning-red; // Values from the classic Mastodon UI -$classic-base-color: #282c37; // Midnight Express -$classic-primary-color: #9baec8; // Echo Blue -$classic-secondary-color: #d9e1e8; // Pattens Blue -$classic-highlight-color: #6364ff; // Brand purple +$classic-base-color: #282c37; // Midnight Express +$classic-primary-color: #9baec8; // Echo Blue +$classic-secondary-color: #d9e1e8; // Pattens Blue +$classic-highlight-color: #6364ff; // Brand purple // Variables for defaults in UI $base-shadow-color: $black !default; @@ -23,10 +23,13 @@ $valid-value-color: $success-green !default; $error-value-color: $error-red !default; // Tell UI to use selected colors -$ui-base-color: $classic-base-color !default; // Darkest -$ui-base-lighter-color: lighten($ui-base-color, 26%) !default; // Lighter darkest -$ui-primary-color: $classic-primary-color !default; // Lighter -$ui-secondary-color: $classic-secondary-color !default; // Lightest +$ui-base-color: $classic-base-color !default; // Darkest +$ui-base-lighter-color: lighten( + $ui-base-color, + 26% +) !default; // Lighter darkest +$ui-primary-color: $classic-primary-color !default; // Lighter +$ui-secondary-color: $classic-secondary-color !default; // Lightest $ui-highlight-color: $classic-highlight-color !default; // Variables for texts diff --git a/app/javascript/flavours/glitch/styles/widgets.scss b/app/javascript/flavours/glitch/styles/widgets.scss index fd091ee89..0f2b7ac5b 100644 --- a/app/javascript/flavours/glitch/styles/widgets.scss +++ b/app/javascript/flavours/glitch/styles/widgets.scss @@ -1,4 +1,4 @@ -@use "sass:math"; +@use 'sass:math'; .hero-widget { margin-bottom: 10px; -- cgit From 6fdd596cc88622abc585ef3da96699f8f987dfb5 Mon Sep 17 00:00:00 2001 From: Nick Schonning Date: Thu, 16 Feb 2023 01:30:56 -0500 Subject: [Glitch] Enable ESLint Promise plugin defaults Port 5e1c0c3d946bef488f8e156ed3b5034740e731df to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/utils/notifications.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/utils/notifications.js b/app/javascript/flavours/glitch/utils/notifications.js index 7634cac21..3cdf7caea 100644 --- a/app/javascript/flavours/glitch/utils/notifications.js +++ b/app/javascript/flavours/glitch/utils/notifications.js @@ -3,7 +3,7 @@ const checkNotificationPromise = () => { try { - // eslint-disable-next-line promise/catch-or-return + // eslint-disable-next-line promise/catch-or-return, promise/valid-params Notification.requestPermission().then(); } catch(e) { return false; -- cgit From 229ab559dc96f53d05600514dc9f93d1cdc006bd Mon Sep 17 00:00:00 2001 From: Christian Schmidt Date: Fri, 17 Feb 2023 09:51:27 +0100 Subject: [Glitch] Fix bad type for spellCheck attribute Port cde13349cb0ad8e280156cef7fc50692f943b0b2 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/components/autosuggest_input.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.js b/app/javascript/flavours/glitch/components/autosuggest_input.js index 1a030fb85..90ff298c0 100644 --- a/app/javascript/flavours/glitch/components/autosuggest_input.js +++ b/app/javascript/flavours/glitch/components/autosuggest_input.js @@ -51,7 +51,7 @@ export default class AutosuggestInput extends ImmutablePureComponent { searchTokens: PropTypes.arrayOf(PropTypes.string), maxLength: PropTypes.number, lang: PropTypes.string, - spellCheck: PropTypes.string, + spellCheck: PropTypes.bool, }; static defaultProps = { -- cgit From 8c8358b3cf514ee4f56f6273948d36bb92c99ac1 Mon Sep 17 00:00:00 2001 From: Claire Date: Sun, 19 Feb 2023 07:11:18 +0100 Subject: [Glitch] Fix focus point of already-attached media not saving after edit Port b2283b68388bf5ec03da1ed367566a21a5e957f2 to glitch-soc Signed-off-by: Claire --- app/javascript/flavours/glitch/actions/compose.js | 18 +++++++++++++----- 1 file changed, 13 insertions(+), 5 deletions(-) (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/actions/compose.js b/app/javascript/flavours/glitch/actions/compose.js index 01f0f3666..9c0ef83df 100644 --- a/app/javascript/flavours/glitch/actions/compose.js +++ b/app/javascript/flavours/glitch/actions/compose.js @@ -186,11 +186,19 @@ export function submitCompose(routerHistory) { // API call. let media_attributes; if (statusId !== null) { - media_attributes = media.map(item => ({ - id: item.get('id'), - description: item.get('description'), - focus: item.get('focus'), - })); + media_attributes = media.map(item => { + let focus; + + if (item.getIn(['meta', 'focus'])) { + focus = `${item.getIn(['meta', 'focus', 'x']).toFixed(2)},${item.getIn(['meta', 'focus', 'y']).toFixed(2)}`; + } + + return { + id: item.get('id'), + description: item.get('description'), + focus, + }; + }); } api(getState).request({ -- cgit From 81ef21a0c802f1d905f37a2a818544a8b400793c Mon Sep 17 00:00:00 2001 From: Renaud Chaput Date: Sat, 25 Feb 2023 14:34:32 +0100 Subject: [Glitch] Rename JSX files with proper `.jsx` extension Port 44a7d87cb1f5df953b6c14c16c59e2e4ead1bcb9 to glitch-soc Signed-off-by: Claire --- .../flavours/glitch/components/account.js | 186 ----- .../flavours/glitch/components/account.jsx | 186 +++++ .../flavours/glitch/components/admin/Counter.js | 117 --- .../flavours/glitch/components/admin/Counter.jsx | 117 +++ .../flavours/glitch/components/admin/Dimension.js | 93 --- .../flavours/glitch/components/admin/Dimension.jsx | 93 +++ .../components/admin/ReportReasonSelector.js | 159 ---- .../components/admin/ReportReasonSelector.jsx | 159 ++++ .../flavours/glitch/components/admin/Retention.js | 151 ---- .../flavours/glitch/components/admin/Retention.jsx | 151 ++++ .../flavours/glitch/components/admin/Trends.js | 73 -- .../flavours/glitch/components/admin/Trends.jsx | 73 ++ .../flavours/glitch/components/animated_number.js | 76 -- .../flavours/glitch/components/animated_number.jsx | 76 ++ .../flavours/glitch/components/attachment_list.js | 48 -- .../flavours/glitch/components/attachment_list.jsx | 48 ++ .../glitch/components/autosuggest_emoji.js | 42 -- .../glitch/components/autosuggest_emoji.jsx | 42 ++ .../glitch/components/autosuggest_hashtag.js | 42 -- .../glitch/components/autosuggest_hashtag.jsx | 42 ++ .../glitch/components/autosuggest_input.js | 227 ------ .../glitch/components/autosuggest_input.jsx | 227 ++++++ .../glitch/components/autosuggest_textarea.js | 235 ------ .../glitch/components/autosuggest_textarea.jsx | 235 ++++++ .../flavours/glitch/components/avatar.js | 79 -- .../flavours/glitch/components/avatar.jsx | 79 ++ .../flavours/glitch/components/avatar_composite.js | 110 --- .../glitch/components/avatar_composite.jsx | 110 +++ .../flavours/glitch/components/avatar_overlay.js | 37 - .../flavours/glitch/components/avatar_overlay.jsx | 37 + .../flavours/glitch/components/blurhash.js | 65 -- .../flavours/glitch/components/blurhash.jsx | 65 ++ .../flavours/glitch/components/button.js | 52 -- .../flavours/glitch/components/button.jsx | 52 ++ app/javascript/flavours/glitch/components/check.js | 9 - .../flavours/glitch/components/check.jsx | 9 + .../flavours/glitch/components/column.js | 64 -- .../flavours/glitch/components/column.jsx | 64 ++ .../glitch/components/column_back_button.js | 60 -- .../glitch/components/column_back_button.jsx | 60 ++ .../glitch/components/column_back_button_slim.js | 37 - .../glitch/components/column_back_button_slim.jsx | 37 + .../flavours/glitch/components/column_header.js | 220 ------ .../flavours/glitch/components/column_header.jsx | 220 ++++++ .../flavours/glitch/components/common_counter.js | 62 -- .../flavours/glitch/components/common_counter.jsx | 62 ++ .../glitch/components/dismissable_banner.js | 51 -- .../glitch/components/dismissable_banner.jsx | 51 ++ .../flavours/glitch/components/display_name.js | 102 --- .../flavours/glitch/components/display_name.jsx | 102 +++ .../flavours/glitch/components/domain.js | 42 -- .../flavours/glitch/components/domain.jsx | 42 ++ .../flavours/glitch/components/dropdown_menu.js | 335 --------- .../flavours/glitch/components/dropdown_menu.jsx | 335 +++++++++ .../glitch/components/edited_timestamp/index.js | 70 -- .../glitch/components/edited_timestamp/index.jsx | 70 ++ .../flavours/glitch/components/error_boundary.js | 134 ---- .../flavours/glitch/components/error_boundary.jsx | 134 ++++ app/javascript/flavours/glitch/components/gifv.js | 73 -- app/javascript/flavours/glitch/components/gifv.jsx | 73 ++ .../flavours/glitch/components/hashtag.js | 115 --- .../flavours/glitch/components/hashtag.jsx | 115 +++ app/javascript/flavours/glitch/components/icon.js | 21 - app/javascript/flavours/glitch/components/icon.jsx | 21 + .../flavours/glitch/components/icon_button.js | 177 ----- .../flavours/glitch/components/icon_button.jsx | 177 +++++ .../flavours/glitch/components/icon_with_badge.js | 22 - .../flavours/glitch/components/icon_with_badge.jsx | 22 + app/javascript/flavours/glitch/components/image.js | 33 - .../flavours/glitch/components/image.jsx | 33 + .../flavours/glitch/components/inline_account.js | 34 - .../flavours/glitch/components/inline_account.jsx | 34 + .../components/intersection_observer_article.js | 131 ---- .../components/intersection_observer_article.jsx | 131 ++++ app/javascript/flavours/glitch/components/link.js | 97 --- app/javascript/flavours/glitch/components/link.jsx | 97 +++ .../flavours/glitch/components/load_gap.js | 34 - .../flavours/glitch/components/load_gap.jsx | 34 + .../flavours/glitch/components/load_more.js | 27 - .../flavours/glitch/components/load_more.jsx | 27 + .../flavours/glitch/components/load_pending.js | 22 - .../flavours/glitch/components/load_pending.jsx | 22 + .../glitch/components/loading_indicator.js | 32 - .../glitch/components/loading_indicator.jsx | 32 + app/javascript/flavours/glitch/components/logo.js | 10 - app/javascript/flavours/glitch/components/logo.jsx | 10 + .../glitch/components/media_attachments.js | 119 --- .../glitch/components/media_attachments.jsx | 119 +++ .../flavours/glitch/components/media_gallery.js | 404 ---------- .../flavours/glitch/components/media_gallery.jsx | 404 ++++++++++ .../glitch/components/missing_indicator.js | 29 - .../glitch/components/missing_indicator.jsx | 29 + .../flavours/glitch/components/modal_root.js | 161 ---- .../flavours/glitch/components/modal_root.jsx | 161 ++++ .../glitch/components/navigation_portal.js | 35 - .../glitch/components/navigation_portal.jsx | 35 + .../glitch/components/not_signed_in_indicator.js | 12 - .../glitch/components/not_signed_in_indicator.jsx | 12 + .../components/notification_purge_buttons.js | 59 -- .../components/notification_purge_buttons.jsx | 59 ++ .../flavours/glitch/components/permalink.js | 51 -- .../flavours/glitch/components/permalink.jsx | 51 ++ .../components/picture_in_picture_placeholder.js | 69 -- .../components/picture_in_picture_placeholder.jsx | 69 ++ app/javascript/flavours/glitch/components/poll.js | 233 ------ app/javascript/flavours/glitch/components/poll.jsx | 233 ++++++ .../flavours/glitch/components/radio_button.js | 35 - .../flavours/glitch/components/radio_button.jsx | 35 + .../glitch/components/regeneration_indicator.js | 18 - .../glitch/components/regeneration_indicator.jsx | 18 + .../glitch/components/relative_timestamp.js | 199 ----- .../glitch/components/relative_timestamp.jsx | 199 +++++ .../flavours/glitch/components/scrollable_list.js | 354 --------- .../flavours/glitch/components/scrollable_list.jsx | 354 +++++++++ .../flavours/glitch/components/server_banner.js | 93 --- .../flavours/glitch/components/server_banner.jsx | 93 +++ .../flavours/glitch/components/setting_text.js | 34 - .../flavours/glitch/components/setting_text.jsx | 34 + .../flavours/glitch/components/short_number.js | 117 --- .../flavours/glitch/components/short_number.jsx | 117 +++ .../flavours/glitch/components/skeleton.js | 11 - .../flavours/glitch/components/skeleton.jsx | 11 + .../flavours/glitch/components/spoilers.js | 52 -- .../flavours/glitch/components/spoilers.jsx | 52 ++ .../flavours/glitch/components/status.js | 829 --------------------- .../flavours/glitch/components/status.jsx | 829 +++++++++++++++++++++ .../glitch/components/status_action_bar.js | 341 --------- .../glitch/components/status_action_bar.jsx | 341 +++++++++ .../flavours/glitch/components/status_content.js | 461 ------------ .../flavours/glitch/components/status_content.jsx | 461 ++++++++++++ .../flavours/glitch/components/status_header.js | 71 -- .../flavours/glitch/components/status_header.jsx | 71 ++ .../flavours/glitch/components/status_icons.js | 145 ---- .../flavours/glitch/components/status_icons.jsx | 145 ++++ .../flavours/glitch/components/status_list.js | 131 ---- .../flavours/glitch/components/status_list.jsx | 131 ++++ .../flavours/glitch/components/status_prepend.js | 144 ---- .../flavours/glitch/components/status_prepend.jsx | 144 ++++ .../glitch/components/status_visibility_icon.js | 51 -- .../glitch/components/status_visibility_icon.jsx | 51 ++ .../flavours/glitch/components/timeline_hint.js | 18 - .../flavours/glitch/components/timeline_hint.jsx | 18 + .../glitch/containers/account_container.js | 72 -- .../glitch/containers/account_container.jsx | 72 ++ .../flavours/glitch/containers/admin_component.js | 26 - .../flavours/glitch/containers/admin_component.jsx | 26 + .../glitch/containers/compose_container.js | 41 - .../glitch/containers/compose_container.jsx | 41 + .../flavours/glitch/containers/domain_container.js | 33 - .../glitch/containers/domain_container.jsx | 33 + .../flavours/glitch/containers/mastodon.js | 102 --- .../flavours/glitch/containers/mastodon.jsx | 102 +++ .../flavours/glitch/containers/media_container.js | 121 --- .../flavours/glitch/containers/media_container.jsx | 121 +++ .../flavours/glitch/features/about/index.js | 220 ------ .../flavours/glitch/features/about/index.jsx | 220 ++++++ .../features/account/components/account_note.js | 104 --- .../features/account/components/account_note.jsx | 104 +++ .../features/account/components/action_bar.js | 85 --- .../features/account/components/action_bar.jsx | 85 +++ .../features/account/components/featured_tags.js | 53 -- .../features/account/components/featured_tags.jsx | 53 ++ .../account/components/follow_request_note.js | 37 - .../account/components/follow_request_note.jsx | 37 + .../glitch/features/account/components/header.js | 405 ---------- .../glitch/features/account/components/header.jsx | 405 ++++++++++ .../account/components/profile_column_header.js | 33 - .../account/components/profile_column_header.jsx | 33 + .../flavours/glitch/features/account/navigation.js | 52 -- .../glitch/features/account/navigation.jsx | 52 ++ .../account_gallery/components/media_item.js | 146 ---- .../account_gallery/components/media_item.jsx | 146 ++++ .../glitch/features/account_gallery/index.js | 225 ------ .../glitch/features/account_gallery/index.jsx | 225 ++++++ .../features/account_timeline/components/header.js | 158 ---- .../account_timeline/components/header.jsx | 158 ++++ .../components/limited_account_hint.js | 36 - .../components/limited_account_hint.jsx | 36 + .../account_timeline/components/moved_note.js | 51 -- .../account_timeline/components/moved_note.jsx | 51 ++ .../containers/header_container.js | 173 ----- .../containers/header_container.jsx | 173 +++++ .../glitch/features/account_timeline/index.js | 209 ------ .../glitch/features/account_timeline/index.jsx | 209 ++++++ .../flavours/glitch/features/audio/index.js | 575 -------------- .../flavours/glitch/features/audio/index.jsx | 575 ++++++++++++++ .../flavours/glitch/features/blocks/index.js | 79 -- .../flavours/glitch/features/blocks/index.jsx | 79 ++ .../glitch/features/bookmarked_statuses/index.js | 108 --- .../glitch/features/bookmarked_statuses/index.jsx | 108 +++ .../features/closed_registrations_modal/index.js | 75 -- .../features/closed_registrations_modal/index.jsx | 75 ++ .../components/column_settings.js | 41 - .../components/column_settings.jsx | 41 + .../glitch/features/community_timeline/index.js | 164 ---- .../glitch/features/community_timeline/index.jsx | 164 ++++ .../features/compose/components/action_bar.js | 68 -- .../features/compose/components/action_bar.jsx | 68 ++ .../compose/components/autosuggest_account.js | 24 - .../compose/components/autosuggest_account.jsx | 24 + .../compose/components/character_counter.js | 25 - .../compose/components/character_counter.jsx | 25 + .../features/compose/components/compose_form.js | 391 ---------- .../features/compose/components/compose_form.jsx | 391 ++++++++++ .../glitch/features/compose/components/dropdown.js | 243 ------ .../features/compose/components/dropdown.jsx | 243 ++++++ .../features/compose/components/dropdown_menu.js | 199 ----- .../features/compose/components/dropdown_menu.jsx | 199 +++++ .../compose/components/emoji_picker_dropdown.js | 413 ---------- .../compose/components/emoji_picker_dropdown.jsx | 413 ++++++++++ .../glitch/features/compose/components/header.js | 136 ---- .../glitch/features/compose/components/header.jsx | 136 ++++ .../compose/components/language_dropdown.js | 327 -------- .../compose/components/language_dropdown.jsx | 327 ++++++++ .../features/compose/components/navigation_bar.js | 46 -- .../features/compose/components/navigation_bar.jsx | 46 ++ .../glitch/features/compose/components/options.js | 317 -------- .../glitch/features/compose/components/options.jsx | 317 ++++++++ .../features/compose/components/poll_form.js | 170 ----- .../features/compose/components/poll_form.jsx | 170 +++++ .../compose/components/privacy_dropdown.js | 88 --- .../compose/components/privacy_dropdown.jsx | 88 +++ .../features/compose/components/publisher.js | 99 --- .../features/compose/components/publisher.jsx | 99 +++ .../features/compose/components/reply_indicator.js | 82 -- .../compose/components/reply_indicator.jsx | 82 ++ .../glitch/features/compose/components/search.js | 168 ----- .../glitch/features/compose/components/search.jsx | 168 +++++ .../features/compose/components/search_results.js | 141 ---- .../features/compose/components/search_results.jsx | 141 ++++ .../compose/components/text_icon_button.js | 38 - .../compose/components/text_icon_button.jsx | 38 + .../features/compose/components/textarea_icons.js | 60 -- .../features/compose/components/textarea_icons.jsx | 60 ++ .../glitch/features/compose/components/upload.js | 67 -- .../glitch/features/compose/components/upload.jsx | 67 ++ .../features/compose/components/upload_form.js | 34 - .../features/compose/components/upload_form.jsx | 34 + .../features/compose/components/upload_progress.js | 52 -- .../compose/components/upload_progress.jsx | 52 ++ .../glitch/features/compose/components/warning.js | 26 - .../glitch/features/compose/components/warning.jsx | 26 + .../containers/sensitive_button_container.js | 75 -- .../containers/sensitive_button_container.jsx | 75 ++ .../compose/containers/warning_container.js | 68 -- .../compose/containers/warning_container.jsx | 68 ++ .../flavours/glitch/features/compose/index.js | 116 --- .../flavours/glitch/features/compose/index.jsx | 116 +++ .../direct_timeline/components/column_settings.js | 42 -- .../direct_timeline/components/column_settings.jsx | 42 ++ .../direct_timeline/components/conversation.js | 232 ------ .../direct_timeline/components/conversation.jsx | 232 ++++++ .../components/conversations_list.js | 75 -- .../components/conversations_list.jsx | 75 ++ .../glitch/features/direct_timeline/index.js | 156 ---- .../glitch/features/direct_timeline/index.jsx | 156 ++++ .../features/directory/components/account_card.js | 248 ------ .../features/directory/components/account_card.jsx | 248 ++++++ .../flavours/glitch/features/directory/index.js | 178 ----- .../flavours/glitch/features/directory/index.jsx | 178 +++++ .../glitch/features/domain_blocks/index.js | 83 --- .../glitch/features/domain_blocks/index.jsx | 83 +++ .../glitch/features/explore/components/story.js | 51 -- .../glitch/features/explore/components/story.jsx | 51 ++ .../flavours/glitch/features/explore/index.js | 107 --- .../flavours/glitch/features/explore/index.jsx | 107 +++ .../flavours/glitch/features/explore/links.js | 70 -- .../flavours/glitch/features/explore/links.jsx | 70 ++ .../flavours/glitch/features/explore/results.js | 126 ---- .../flavours/glitch/features/explore/results.jsx | 126 ++++ .../flavours/glitch/features/explore/statuses.js | 64 -- .../flavours/glitch/features/explore/statuses.jsx | 64 ++ .../glitch/features/explore/suggestions.js | 56 -- .../glitch/features/explore/suggestions.jsx | 56 ++ .../flavours/glitch/features/explore/tags.js | 62 -- .../flavours/glitch/features/explore/tags.jsx | 62 ++ .../glitch/features/favourited_statuses/index.js | 108 --- .../glitch/features/favourited_statuses/index.jsx | 108 +++ .../flavours/glitch/features/favourites/index.js | 103 --- .../flavours/glitch/features/favourites/index.jsx | 103 +++ .../glitch/features/filters/added_to_filter.js | 102 --- .../glitch/features/filters/added_to_filter.jsx | 102 +++ .../glitch/features/filters/select_filter.js | 192 ----- .../glitch/features/filters/select_filter.jsx | 192 +++++ .../follow_recommendations/components/account.js | 85 --- .../follow_recommendations/components/account.jsx | 85 +++ .../features/follow_recommendations/index.js | 116 --- .../features/follow_recommendations/index.jsx | 116 +++ .../components/account_authorize.js | 49 -- .../components/account_authorize.jsx | 49 ++ .../glitch/features/follow_requests/index.js | 92 --- .../glitch/features/follow_requests/index.jsx | 92 +++ .../glitch/features/followed_tags/index.js | 89 --- .../glitch/features/followed_tags/index.jsx | 89 +++ .../flavours/glitch/features/followers/index.js | 174 ----- .../flavours/glitch/features/followers/index.jsx | 174 +++++ .../flavours/glitch/features/following/index.js | 174 ----- .../flavours/glitch/features/following/index.jsx | 174 +++++ .../glitch/features/generic_not_found/index.js | 11 - .../glitch/features/generic_not_found/index.jsx | 11 + .../getting_started/components/announcements.js | 449 ----------- .../getting_started/components/announcements.jsx | 449 +++++++++++ .../features/getting_started/components/trends.js | 51 -- .../features/getting_started/components/trends.jsx | 51 ++ .../glitch/features/getting_started/index.js | 204 ----- .../glitch/features/getting_started/index.jsx | 204 +++++ .../glitch/features/getting_started_misc/index.js | 69 -- .../glitch/features/getting_started_misc/index.jsx | 69 ++ .../hashtag_timeline/components/column_settings.js | 133 ---- .../components/column_settings.jsx | 133 ++++ .../glitch/features/hashtag_timeline/index.js | 237 ------ .../glitch/features/hashtag_timeline/index.jsx | 237 ++++++ .../home_timeline/components/column_settings.js | 50 -- .../home_timeline/components/column_settings.jsx | 50 ++ .../glitch/features/home_timeline/index.js | 178 ----- .../glitch/features/home_timeline/index.jsx | 178 +++++ .../glitch/features/interaction_modal/index.js | 161 ---- .../glitch/features/interaction_modal/index.jsx | 161 ++++ .../glitch/features/keyboard_shortcuts/index.js | 149 ---- .../glitch/features/keyboard_shortcuts/index.jsx | 149 ++++ .../features/list_adder/components/account.js | 43 -- .../features/list_adder/components/account.jsx | 43 ++ .../glitch/features/list_adder/components/list.js | 69 -- .../glitch/features/list_adder/components/list.jsx | 69 ++ .../flavours/glitch/features/list_adder/index.js | 73 -- .../flavours/glitch/features/list_adder/index.jsx | 73 ++ .../features/list_editor/components/account.js | 56 -- .../features/list_editor/components/account.jsx | 56 ++ .../list_editor/components/edit_list_form.js | 70 -- .../list_editor/components/edit_list_form.jsx | 70 ++ .../features/list_editor/components/search.js | 62 -- .../features/list_editor/components/search.jsx | 62 ++ .../flavours/glitch/features/list_editor/index.js | 79 -- .../flavours/glitch/features/list_editor/index.jsx | 79 ++ .../glitch/features/list_timeline/index.js | 224 ------ .../glitch/features/list_timeline/index.jsx | 224 ++++++ .../features/lists/components/new_list_form.js | 78 -- .../features/lists/components/new_list_form.jsx | 78 ++ .../flavours/glitch/features/lists/index.js | 89 --- .../flavours/glitch/features/lists/index.jsx | 89 +++ .../glitch/features/local_settings/index.js | 65 -- .../glitch/features/local_settings/index.jsx | 65 ++ .../features/local_settings/navigation/index.js | 92 --- .../features/local_settings/navigation/index.jsx | 92 +++ .../local_settings/navigation/item/index.js | 74 -- .../local_settings/navigation/item/index.jsx | 74 ++ .../local_settings/page/deprecated_item/index.js | 83 --- .../local_settings/page/deprecated_item/index.jsx | 83 +++ .../glitch/features/local_settings/page/index.js | 515 ------------- .../glitch/features/local_settings/page/index.jsx | 515 +++++++++++++ .../features/local_settings/page/item/index.js | 119 --- .../features/local_settings/page/item/index.jsx | 119 +++ .../flavours/glitch/features/mutes/index.js | 84 --- .../flavours/glitch/features/mutes/index.jsx | 84 +++ .../notifications/components/admin_report.js | 112 --- .../notifications/components/admin_report.jsx | 112 +++ .../notifications/components/admin_signup.js | 101 --- .../notifications/components/admin_signup.jsx | 101 +++ .../components/clear_column_button.js | 18 - .../components/clear_column_button.jsx | 18 + .../notifications/components/column_settings.js | 203 ----- .../notifications/components/column_settings.jsx | 203 +++++ .../notifications/components/filter_bar.js | 110 --- .../notifications/components/filter_bar.jsx | 110 +++ .../features/notifications/components/follow.js | 101 --- .../features/notifications/components/follow.jsx | 101 +++ .../notifications/components/follow_request.js | 132 ---- .../notifications/components/follow_request.jsx | 132 ++++ .../components/grant_permission_button.js | 19 - .../components/grant_permission_button.jsx | 19 + .../notifications/components/notification.js | 234 ------ .../notifications/components/notification.jsx | 234 ++++++ .../components/notifications_permission_banner.js | 48 -- .../components/notifications_permission_banner.jsx | 48 ++ .../features/notifications/components/overlay.js | 58 -- .../features/notifications/components/overlay.jsx | 58 ++ .../notifications/components/pill_bar_button.js | 41 - .../notifications/components/pill_bar_button.jsx | 41 + .../features/notifications/components/report.js | 62 -- .../features/notifications/components/report.jsx | 62 ++ .../notifications/components/setting_toggle.js | 36 - .../notifications/components/setting_toggle.jsx | 36 + .../glitch/features/notifications/index.js | 382 ---------- .../glitch/features/notifications/index.jsx | 382 ++++++++++ .../picture_in_picture/components/footer.js | 217 ------ .../picture_in_picture/components/footer.jsx | 217 ++++++ .../picture_in_picture/components/header.js | 47 -- .../picture_in_picture/components/header.jsx | 47 ++ .../glitch/features/picture_in_picture/index.js | 88 --- .../glitch/features/picture_in_picture/index.jsx | 88 +++ .../features/pinned_accounts_editor/index.js | 78 -- .../features/pinned_accounts_editor/index.jsx | 78 ++ .../glitch/features/pinned_statuses/index.js | 65 -- .../glitch/features/pinned_statuses/index.jsx | 65 ++ .../glitch/features/privacy_policy/index.js | 61 -- .../glitch/features/privacy_policy/index.jsx | 61 ++ .../public_timeline/components/column_settings.js | 42 -- .../public_timeline/components/column_settings.jsx | 42 ++ .../glitch/features/public_timeline/index.js | 168 ----- .../glitch/features/public_timeline/index.jsx | 168 +++++ .../flavours/glitch/features/reblogs/index.js | 104 --- .../flavours/glitch/features/reblogs/index.jsx | 104 +++ .../flavours/glitch/features/report/category.js | 104 --- .../flavours/glitch/features/report/category.jsx | 104 +++ .../flavours/glitch/features/report/comment.js | 83 --- .../flavours/glitch/features/report/comment.jsx | 83 +++ .../glitch/features/report/components/option.js | 60 -- .../glitch/features/report/components/option.jsx | 60 ++ .../features/report/components/status_check_box.js | 60 -- .../report/components/status_check_box.jsx | 60 ++ .../flavours/glitch/features/report/rules.js | 64 -- .../flavours/glitch/features/report/rules.jsx | 64 ++ .../flavours/glitch/features/report/statuses.js | 61 -- .../flavours/glitch/features/report/statuses.jsx | 61 ++ .../flavours/glitch/features/report/thanks.js | 84 --- .../flavours/glitch/features/report/thanks.jsx | 84 +++ .../glitch/features/standalone/compose/index.js | 20 - .../glitch/features/standalone/compose/index.jsx | 20 + .../features/status/components/action_bar.js | 230 ------ .../features/status/components/action_bar.jsx | 230 ++++++ .../glitch/features/status/components/card.js | 281 ------- .../glitch/features/status/components/card.jsx | 281 +++++++ .../features/status/components/detailed_status.js | 335 --------- .../features/status/components/detailed_status.jsx | 335 +++++++++ .../flavours/glitch/features/status/index.js | 726 ------------------ .../flavours/glitch/features/status/index.jsx | 726 ++++++++++++++++++ .../features/subscribed_languages_modal/index.js | 125 ---- .../features/subscribed_languages_modal/index.jsx | 125 ++++ .../glitch/features/ui/components/actions_modal.js | 91 --- .../features/ui/components/actions_modal.jsx | 91 +++ .../glitch/features/ui/components/audio_modal.js | 58 -- .../glitch/features/ui/components/audio_modal.jsx | 58 ++ .../glitch/features/ui/components/block_modal.js | 103 --- .../glitch/features/ui/components/block_modal.jsx | 103 +++ .../glitch/features/ui/components/boost_modal.js | 139 ---- .../glitch/features/ui/components/boost_modal.jsx | 139 ++++ .../glitch/features/ui/components/bundle.js | 107 --- .../glitch/features/ui/components/bundle.jsx | 107 +++ .../features/ui/components/bundle_column_error.js | 162 ---- .../features/ui/components/bundle_column_error.jsx | 162 ++++ .../features/ui/components/bundle_modal_error.js | 53 -- .../features/ui/components/bundle_modal_error.jsx | 53 ++ .../glitch/features/ui/components/column.js | 75 -- .../glitch/features/ui/components/column.jsx | 75 ++ .../glitch/features/ui/components/column_header.js | 38 - .../features/ui/components/column_header.jsx | 38 + .../glitch/features/ui/components/column_link.js | 55 -- .../glitch/features/ui/components/column_link.jsx | 55 ++ .../features/ui/components/column_loading.js | 32 - .../features/ui/components/column_loading.jsx | 32 + .../features/ui/components/column_subheading.js | 16 - .../features/ui/components/column_subheading.jsx | 16 + .../glitch/features/ui/components/columns_area.js | 183 ----- .../glitch/features/ui/components/columns_area.jsx | 183 +++++ .../ui/components/compare_history_modal.js | 99 --- .../ui/components/compare_history_modal.jsx | 99 +++ .../glitch/features/ui/components/compose_panel.js | 58 -- .../features/ui/components/compose_panel.jsx | 58 ++ .../features/ui/components/confirmation_modal.js | 88 --- .../features/ui/components/confirmation_modal.jsx | 88 +++ .../ui/components/deprecated_settings_modal.js | 86 --- .../ui/components/deprecated_settings_modal.jsx | 86 +++ .../ui/components/disabled_account_banner.js | 92 --- .../ui/components/disabled_account_banner.jsx | 92 +++ .../glitch/features/ui/components/doodle_modal.js | 614 --------------- .../glitch/features/ui/components/doodle_modal.jsx | 614 +++++++++++++++ .../features/ui/components/drawer_loading.js | 11 - .../features/ui/components/drawer_loading.jsx | 11 + .../glitch/features/ui/components/embed_modal.js | 97 --- .../glitch/features/ui/components/embed_modal.jsx | 97 +++ .../features/ui/components/favourite_modal.js | 101 --- .../features/ui/components/favourite_modal.jsx | 101 +++ .../glitch/features/ui/components/filter_modal.js | 134 ---- .../glitch/features/ui/components/filter_modal.jsx | 134 ++++ .../features/ui/components/focal_point_modal.js | 418 ----------- .../features/ui/components/focal_point_modal.jsx | 418 +++++++++++ .../ui/components/follow_requests_column_link.js | 51 -- .../ui/components/follow_requests_column_link.jsx | 51 ++ .../glitch/features/ui/components/header.js | 88 --- .../glitch/features/ui/components/header.jsx | 88 +++ .../glitch/features/ui/components/image_loader.js | 168 ----- .../glitch/features/ui/components/image_loader.jsx | 168 +++++ .../glitch/features/ui/components/image_modal.js | 59 -- .../glitch/features/ui/components/image_modal.jsx | 59 ++ .../glitch/features/ui/components/link_footer.js | 102 --- .../glitch/features/ui/components/link_footer.jsx | 102 +++ .../glitch/features/ui/components/list_panel.js | 55 -- .../glitch/features/ui/components/list_panel.jsx | 55 ++ .../glitch/features/ui/components/media_modal.js | 252 ------- .../glitch/features/ui/components/media_modal.jsx | 252 +++++++ .../glitch/features/ui/components/modal_loading.js | 20 - .../features/ui/components/modal_loading.jsx | 20 + .../glitch/features/ui/components/modal_root.js | 144 ---- .../glitch/features/ui/components/modal_root.jsx | 144 ++++ .../glitch/features/ui/components/mute_modal.js | 140 ---- .../glitch/features/ui/components/mute_modal.jsx | 140 ++++ .../features/ui/components/navigation_panel.js | 104 --- .../features/ui/components/navigation_panel.jsx | 104 +++ .../features/ui/components/onboarding_modal.js | 321 -------- .../features/ui/components/onboarding_modal.jsx | 321 ++++++++ .../glitch/features/ui/components/report_modal.js | 221 ------ .../glitch/features/ui/components/report_modal.jsx | 221 ++++++ .../features/ui/components/sign_in_banner.js | 40 - .../features/ui/components/sign_in_banner.jsx | 40 + .../glitch/features/ui/components/upload_area.js | 52 -- .../glitch/features/ui/components/upload_area.jsx | 52 ++ .../glitch/features/ui/components/video_modal.js | 66 -- .../glitch/features/ui/components/video_modal.jsx | 66 ++ .../features/ui/components/zoomable_image.js | 450 ----------- .../features/ui/components/zoomable_image.jsx | 450 +++++++++++ .../flavours/glitch/features/ui/index.js | 684 ----------------- .../flavours/glitch/features/ui/index.jsx | 684 +++++++++++++++++ .../features/ui/util/react_router_helpers.js | 101 --- .../features/ui/util/react_router_helpers.jsx | 101 +++ .../glitch/features/ui/util/reduced_motion.js | 44 -- .../glitch/features/ui/util/reduced_motion.jsx | 44 ++ .../flavours/glitch/features/video/index.js | 673 ----------------- .../flavours/glitch/features/video/index.jsx | 673 +++++++++++++++++ app/javascript/flavours/glitch/main.js | 46 -- app/javascript/flavours/glitch/main.jsx | 46 ++ app/javascript/flavours/glitch/packs/admin.js | 24 - app/javascript/flavours/glitch/packs/admin.jsx | 24 + app/javascript/flavours/glitch/packs/public.js | 224 ------ app/javascript/flavours/glitch/packs/public.jsx | 224 ++++++ app/javascript/flavours/glitch/packs/share.js | 23 - app/javascript/flavours/glitch/packs/share.jsx | 23 + app/javascript/flavours/glitch/theme.yml | 12 +- app/javascript/flavours/glitch/utils/icons.js | 15 - app/javascript/flavours/glitch/utils/icons.jsx | 15 + 529 files changed, 33223 insertions(+), 33223 deletions(-) delete mode 100644 app/javascript/flavours/glitch/components/account.js create mode 100644 app/javascript/flavours/glitch/components/account.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/Counter.js create mode 100644 app/javascript/flavours/glitch/components/admin/Counter.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/Dimension.js create mode 100644 app/javascript/flavours/glitch/components/admin/Dimension.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/ReportReasonSelector.js create mode 100644 app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/Retention.js create mode 100644 app/javascript/flavours/glitch/components/admin/Retention.jsx delete mode 100644 app/javascript/flavours/glitch/components/admin/Trends.js create mode 100644 app/javascript/flavours/glitch/components/admin/Trends.jsx delete mode 100644 app/javascript/flavours/glitch/components/animated_number.js create mode 100644 app/javascript/flavours/glitch/components/animated_number.jsx delete mode 100644 app/javascript/flavours/glitch/components/attachment_list.js create mode 100644 app/javascript/flavours/glitch/components/attachment_list.jsx delete mode 100644 app/javascript/flavours/glitch/components/autosuggest_emoji.js create mode 100644 app/javascript/flavours/glitch/components/autosuggest_emoji.jsx delete mode 100644 app/javascript/flavours/glitch/components/autosuggest_hashtag.js create mode 100644 app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx delete mode 100644 app/javascript/flavours/glitch/components/autosuggest_input.js create mode 100644 app/javascript/flavours/glitch/components/autosuggest_input.jsx delete mode 100644 app/javascript/flavours/glitch/components/autosuggest_textarea.js create mode 100644 app/javascript/flavours/glitch/components/autosuggest_textarea.jsx delete mode 100644 app/javascript/flavours/glitch/components/avatar.js create mode 100644 app/javascript/flavours/glitch/components/avatar.jsx delete mode 100644 app/javascript/flavours/glitch/components/avatar_composite.js create mode 100644 app/javascript/flavours/glitch/components/avatar_composite.jsx delete mode 100644 app/javascript/flavours/glitch/components/avatar_overlay.js create mode 100644 app/javascript/flavours/glitch/components/avatar_overlay.jsx delete mode 100644 app/javascript/flavours/glitch/components/blurhash.js create mode 100644 app/javascript/flavours/glitch/components/blurhash.jsx delete mode 100644 app/javascript/flavours/glitch/components/button.js create mode 100644 app/javascript/flavours/glitch/components/button.jsx delete mode 100644 app/javascript/flavours/glitch/components/check.js create mode 100644 app/javascript/flavours/glitch/components/check.jsx delete mode 100644 app/javascript/flavours/glitch/components/column.js create mode 100644 app/javascript/flavours/glitch/components/column.jsx delete mode 100644 app/javascript/flavours/glitch/components/column_back_button.js create mode 100644 app/javascript/flavours/glitch/components/column_back_button.jsx delete mode 100644 app/javascript/flavours/glitch/components/column_back_button_slim.js create mode 100644 app/javascript/flavours/glitch/components/column_back_button_slim.jsx delete mode 100644 app/javascript/flavours/glitch/components/column_header.js create mode 100644 app/javascript/flavours/glitch/components/column_header.jsx delete mode 100644 app/javascript/flavours/glitch/components/common_counter.js create mode 100644 app/javascript/flavours/glitch/components/common_counter.jsx delete mode 100644 app/javascript/flavours/glitch/components/dismissable_banner.js create mode 100644 app/javascript/flavours/glitch/components/dismissable_banner.jsx delete mode 100644 app/javascript/flavours/glitch/components/display_name.js create mode 100644 app/javascript/flavours/glitch/components/display_name.jsx delete mode 100644 app/javascript/flavours/glitch/components/domain.js create mode 100644 app/javascript/flavours/glitch/components/domain.jsx delete mode 100644 app/javascript/flavours/glitch/components/dropdown_menu.js create mode 100644 app/javascript/flavours/glitch/components/dropdown_menu.jsx delete mode 100644 app/javascript/flavours/glitch/components/edited_timestamp/index.js create mode 100644 app/javascript/flavours/glitch/components/edited_timestamp/index.jsx delete mode 100644 app/javascript/flavours/glitch/components/error_boundary.js create mode 100644 app/javascript/flavours/glitch/components/error_boundary.jsx delete mode 100644 app/javascript/flavours/glitch/components/gifv.js create mode 100644 app/javascript/flavours/glitch/components/gifv.jsx delete mode 100644 app/javascript/flavours/glitch/components/hashtag.js create mode 100644 app/javascript/flavours/glitch/components/hashtag.jsx delete mode 100644 app/javascript/flavours/glitch/components/icon.js create mode 100644 app/javascript/flavours/glitch/components/icon.jsx delete mode 100644 app/javascript/flavours/glitch/components/icon_button.js create mode 100644 app/javascript/flavours/glitch/components/icon_button.jsx delete mode 100644 app/javascript/flavours/glitch/components/icon_with_badge.js create mode 100644 app/javascript/flavours/glitch/components/icon_with_badge.jsx delete mode 100644 app/javascript/flavours/glitch/components/image.js create mode 100644 app/javascript/flavours/glitch/components/image.jsx delete mode 100644 app/javascript/flavours/glitch/components/inline_account.js create mode 100644 app/javascript/flavours/glitch/components/inline_account.jsx delete mode 100644 app/javascript/flavours/glitch/components/intersection_observer_article.js create mode 100644 app/javascript/flavours/glitch/components/intersection_observer_article.jsx delete mode 100644 app/javascript/flavours/glitch/components/link.js create mode 100644 app/javascript/flavours/glitch/components/link.jsx delete mode 100644 app/javascript/flavours/glitch/components/load_gap.js create mode 100644 app/javascript/flavours/glitch/components/load_gap.jsx delete mode 100644 app/javascript/flavours/glitch/components/load_more.js create mode 100644 app/javascript/flavours/glitch/components/load_more.jsx delete mode 100644 app/javascript/flavours/glitch/components/load_pending.js create mode 100644 app/javascript/flavours/glitch/components/load_pending.jsx delete mode 100644 app/javascript/flavours/glitch/components/loading_indicator.js create mode 100644 app/javascript/flavours/glitch/components/loading_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/components/logo.js create mode 100644 app/javascript/flavours/glitch/components/logo.jsx delete mode 100644 app/javascript/flavours/glitch/components/media_attachments.js create mode 100644 app/javascript/flavours/glitch/components/media_attachments.jsx delete mode 100644 app/javascript/flavours/glitch/components/media_gallery.js create mode 100644 app/javascript/flavours/glitch/components/media_gallery.jsx delete mode 100644 app/javascript/flavours/glitch/components/missing_indicator.js create mode 100644 app/javascript/flavours/glitch/components/missing_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/components/modal_root.js create mode 100644 app/javascript/flavours/glitch/components/modal_root.jsx delete mode 100644 app/javascript/flavours/glitch/components/navigation_portal.js create mode 100644 app/javascript/flavours/glitch/components/navigation_portal.jsx delete mode 100644 app/javascript/flavours/glitch/components/not_signed_in_indicator.js create mode 100644 app/javascript/flavours/glitch/components/not_signed_in_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/components/notification_purge_buttons.js create mode 100644 app/javascript/flavours/glitch/components/notification_purge_buttons.jsx delete mode 100644 app/javascript/flavours/glitch/components/permalink.js create mode 100644 app/javascript/flavours/glitch/components/permalink.jsx delete mode 100644 app/javascript/flavours/glitch/components/picture_in_picture_placeholder.js create mode 100644 app/javascript/flavours/glitch/components/picture_in_picture_placeholder.jsx delete mode 100644 app/javascript/flavours/glitch/components/poll.js create mode 100644 app/javascript/flavours/glitch/components/poll.jsx delete mode 100644 app/javascript/flavours/glitch/components/radio_button.js create mode 100644 app/javascript/flavours/glitch/components/radio_button.jsx delete mode 100644 app/javascript/flavours/glitch/components/regeneration_indicator.js create mode 100644 app/javascript/flavours/glitch/components/regeneration_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/components/relative_timestamp.js create mode 100644 app/javascript/flavours/glitch/components/relative_timestamp.jsx delete mode 100644 app/javascript/flavours/glitch/components/scrollable_list.js create mode 100644 app/javascript/flavours/glitch/components/scrollable_list.jsx delete mode 100644 app/javascript/flavours/glitch/components/server_banner.js create mode 100644 app/javascript/flavours/glitch/components/server_banner.jsx delete mode 100644 app/javascript/flavours/glitch/components/setting_text.js create mode 100644 app/javascript/flavours/glitch/components/setting_text.jsx delete mode 100644 app/javascript/flavours/glitch/components/short_number.js create mode 100644 app/javascript/flavours/glitch/components/short_number.jsx delete mode 100644 app/javascript/flavours/glitch/components/skeleton.js create mode 100644 app/javascript/flavours/glitch/components/skeleton.jsx delete mode 100644 app/javascript/flavours/glitch/components/spoilers.js create mode 100644 app/javascript/flavours/glitch/components/spoilers.jsx delete mode 100644 app/javascript/flavours/glitch/components/status.js create mode 100644 app/javascript/flavours/glitch/components/status.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_action_bar.js create mode 100644 app/javascript/flavours/glitch/components/status_action_bar.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_content.js create mode 100644 app/javascript/flavours/glitch/components/status_content.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_header.js create mode 100644 app/javascript/flavours/glitch/components/status_header.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_icons.js create mode 100644 app/javascript/flavours/glitch/components/status_icons.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_list.js create mode 100644 app/javascript/flavours/glitch/components/status_list.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_prepend.js create mode 100644 app/javascript/flavours/glitch/components/status_prepend.jsx delete mode 100644 app/javascript/flavours/glitch/components/status_visibility_icon.js create mode 100644 app/javascript/flavours/glitch/components/status_visibility_icon.jsx delete mode 100644 app/javascript/flavours/glitch/components/timeline_hint.js create mode 100644 app/javascript/flavours/glitch/components/timeline_hint.jsx delete mode 100644 app/javascript/flavours/glitch/containers/account_container.js create mode 100644 app/javascript/flavours/glitch/containers/account_container.jsx delete mode 100644 app/javascript/flavours/glitch/containers/admin_component.js create mode 100644 app/javascript/flavours/glitch/containers/admin_component.jsx delete mode 100644 app/javascript/flavours/glitch/containers/compose_container.js create mode 100644 app/javascript/flavours/glitch/containers/compose_container.jsx delete mode 100644 app/javascript/flavours/glitch/containers/domain_container.js create mode 100644 app/javascript/flavours/glitch/containers/domain_container.jsx delete mode 100644 app/javascript/flavours/glitch/containers/mastodon.js create mode 100644 app/javascript/flavours/glitch/containers/mastodon.jsx delete mode 100644 app/javascript/flavours/glitch/containers/media_container.js create mode 100644 app/javascript/flavours/glitch/containers/media_container.jsx delete mode 100644 app/javascript/flavours/glitch/features/about/index.js create mode 100644 app/javascript/flavours/glitch/features/about/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/account_note.js create mode 100644 app/javascript/flavours/glitch/features/account/components/account_note.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/action_bar.js create mode 100644 app/javascript/flavours/glitch/features/account/components/action_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/featured_tags.js create mode 100644 app/javascript/flavours/glitch/features/account/components/featured_tags.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/follow_request_note.js create mode 100644 app/javascript/flavours/glitch/features/account/components/follow_request_note.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/header.js create mode 100644 app/javascript/flavours/glitch/features/account/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/components/profile_column_header.js create mode 100644 app/javascript/flavours/glitch/features/account/components/profile_column_header.jsx delete mode 100644 app/javascript/flavours/glitch/features/account/navigation.js create mode 100644 app/javascript/flavours/glitch/features/account/navigation.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_gallery/components/media_item.js create mode 100644 app/javascript/flavours/glitch/features/account_gallery/components/media_item.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_gallery/index.js create mode 100644 app/javascript/flavours/glitch/features/account_gallery/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/header.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/limited_account_hint.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/moved_note.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/components/moved_note.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/containers/header_container.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/containers/header_container.jsx delete mode 100644 app/javascript/flavours/glitch/features/account_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/account_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/audio/index.js create mode 100644 app/javascript/flavours/glitch/features/audio/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/blocks/index.js create mode 100644 app/javascript/flavours/glitch/features/blocks/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/bookmarked_statuses/index.js create mode 100644 app/javascript/flavours/glitch/features/bookmarked_statuses/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/closed_registrations_modal/index.js create mode 100644 app/javascript/flavours/glitch/features/closed_registrations_modal/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/community_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/community_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/community_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/community_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/action_bar.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/action_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/autosuggest_account.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/autosuggest_account.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/character_counter.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/character_counter.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/compose_form.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/compose_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/dropdown.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/dropdown.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/dropdown_menu.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/dropdown_menu.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/emoji_picker_dropdown.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/header.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/language_dropdown.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/language_dropdown.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/navigation_bar.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/navigation_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/options.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/options.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/poll_form.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/poll_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/privacy_dropdown.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/publisher.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/publisher.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/reply_indicator.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/reply_indicator.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/search.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/search.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/search_results.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/search_results.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/text_icon_button.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/text_icon_button.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/textarea_icons.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/textarea_icons.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/upload.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/upload.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/upload_form.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/upload_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/upload_progress.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/upload_progress.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/components/warning.js create mode 100644 app/javascript/flavours/glitch/features/compose/components/warning.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.js create mode 100644 app/javascript/flavours/glitch/features/compose/containers/sensitive_button_container.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/containers/warning_container.js create mode 100644 app/javascript/flavours/glitch/features/compose/containers/warning_container.jsx delete mode 100644 app/javascript/flavours/glitch/features/compose/index.js create mode 100644 app/javascript/flavours/glitch/features/compose/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/conversation.js create mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/conversation.jsx delete mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.js create mode 100644 app/javascript/flavours/glitch/features/direct_timeline/components/conversations_list.jsx delete mode 100644 app/javascript/flavours/glitch/features/direct_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/direct_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/directory/components/account_card.js create mode 100644 app/javascript/flavours/glitch/features/directory/components/account_card.jsx delete mode 100644 app/javascript/flavours/glitch/features/directory/index.js create mode 100644 app/javascript/flavours/glitch/features/directory/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/domain_blocks/index.js create mode 100644 app/javascript/flavours/glitch/features/domain_blocks/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/components/story.js create mode 100644 app/javascript/flavours/glitch/features/explore/components/story.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/index.js create mode 100644 app/javascript/flavours/glitch/features/explore/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/links.js create mode 100644 app/javascript/flavours/glitch/features/explore/links.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/results.js create mode 100644 app/javascript/flavours/glitch/features/explore/results.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/statuses.js create mode 100644 app/javascript/flavours/glitch/features/explore/statuses.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/suggestions.js create mode 100644 app/javascript/flavours/glitch/features/explore/suggestions.jsx delete mode 100644 app/javascript/flavours/glitch/features/explore/tags.js create mode 100644 app/javascript/flavours/glitch/features/explore/tags.jsx delete mode 100644 app/javascript/flavours/glitch/features/favourited_statuses/index.js create mode 100644 app/javascript/flavours/glitch/features/favourited_statuses/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/favourites/index.js create mode 100644 app/javascript/flavours/glitch/features/favourites/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/filters/added_to_filter.js create mode 100644 app/javascript/flavours/glitch/features/filters/added_to_filter.jsx delete mode 100644 app/javascript/flavours/glitch/features/filters/select_filter.js create mode 100644 app/javascript/flavours/glitch/features/filters/select_filter.jsx delete mode 100644 app/javascript/flavours/glitch/features/follow_recommendations/components/account.js create mode 100644 app/javascript/flavours/glitch/features/follow_recommendations/components/account.jsx delete mode 100644 app/javascript/flavours/glitch/features/follow_recommendations/index.js create mode 100644 app/javascript/flavours/glitch/features/follow_recommendations/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.js create mode 100644 app/javascript/flavours/glitch/features/follow_requests/components/account_authorize.jsx delete mode 100644 app/javascript/flavours/glitch/features/follow_requests/index.js create mode 100644 app/javascript/flavours/glitch/features/follow_requests/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/followed_tags/index.js create mode 100644 app/javascript/flavours/glitch/features/followed_tags/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/followers/index.js create mode 100644 app/javascript/flavours/glitch/features/followers/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/following/index.js create mode 100644 app/javascript/flavours/glitch/features/following/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/generic_not_found/index.js create mode 100644 app/javascript/flavours/glitch/features/generic_not_found/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/getting_started/components/announcements.js create mode 100644 app/javascript/flavours/glitch/features/getting_started/components/announcements.jsx delete mode 100644 app/javascript/flavours/glitch/features/getting_started/components/trends.js create mode 100644 app/javascript/flavours/glitch/features/getting_started/components/trends.jsx delete mode 100644 app/javascript/flavours/glitch/features/getting_started/index.js create mode 100644 app/javascript/flavours/glitch/features/getting_started/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/getting_started_misc/index.js create mode 100644 app/javascript/flavours/glitch/features/getting_started_misc/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/hashtag_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/hashtag_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/hashtag_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/home_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/home_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/home_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/home_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/interaction_modal/index.js create mode 100644 app/javascript/flavours/glitch/features/interaction_modal/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/keyboard_shortcuts/index.js create mode 100644 app/javascript/flavours/glitch/features/keyboard_shortcuts/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_adder/components/account.js create mode 100644 app/javascript/flavours/glitch/features/list_adder/components/account.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_adder/components/list.js create mode 100644 app/javascript/flavours/glitch/features/list_adder/components/list.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_adder/index.js create mode 100644 app/javascript/flavours/glitch/features/list_adder/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_editor/components/account.js create mode 100644 app/javascript/flavours/glitch/features/list_editor/components/account.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.js create mode 100644 app/javascript/flavours/glitch/features/list_editor/components/edit_list_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_editor/components/search.js create mode 100644 app/javascript/flavours/glitch/features/list_editor/components/search.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_editor/index.js create mode 100644 app/javascript/flavours/glitch/features/list_editor/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/list_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/list_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/lists/components/new_list_form.js create mode 100644 app/javascript/flavours/glitch/features/lists/components/new_list_form.jsx delete mode 100644 app/javascript/flavours/glitch/features/lists/index.js create mode 100644 app/javascript/flavours/glitch/features/lists/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/navigation/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/navigation/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/navigation/item/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/navigation/item/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/page/deprecated_item/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/page/deprecated_item/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/page/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/page/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/local_settings/page/item/index.js create mode 100644 app/javascript/flavours/glitch/features/local_settings/page/item/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/mutes/index.js create mode 100644 app/javascript/flavours/glitch/features/mutes/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_report.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_report.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_signup.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/admin_signup.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/clear_column_button.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/clear_column_button.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/filter_bar.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/filter_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/follow.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/follow.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/follow_request.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/follow_request.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/grant_permission_button.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/notification.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/notification.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/notifications_permission_banner.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/overlay.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/overlay.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/pill_bar_button.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/report.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/report.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/components/setting_toggle.js create mode 100644 app/javascript/flavours/glitch/features/notifications/components/setting_toggle.jsx delete mode 100644 app/javascript/flavours/glitch/features/notifications/index.js create mode 100644 app/javascript/flavours/glitch/features/notifications/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/components/footer.js create mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/components/footer.jsx delete mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/components/header.js create mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/index.js create mode 100644 app/javascript/flavours/glitch/features/picture_in_picture/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/pinned_accounts_editor/index.js create mode 100644 app/javascript/flavours/glitch/features/pinned_accounts_editor/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/pinned_statuses/index.js create mode 100644 app/javascript/flavours/glitch/features/pinned_statuses/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/privacy_policy/index.js create mode 100644 app/javascript/flavours/glitch/features/privacy_policy/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/public_timeline/components/column_settings.js create mode 100644 app/javascript/flavours/glitch/features/public_timeline/components/column_settings.jsx delete mode 100644 app/javascript/flavours/glitch/features/public_timeline/index.js create mode 100644 app/javascript/flavours/glitch/features/public_timeline/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/reblogs/index.js create mode 100644 app/javascript/flavours/glitch/features/reblogs/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/category.js create mode 100644 app/javascript/flavours/glitch/features/report/category.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/comment.js create mode 100644 app/javascript/flavours/glitch/features/report/comment.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/components/option.js create mode 100644 app/javascript/flavours/glitch/features/report/components/option.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/components/status_check_box.js create mode 100644 app/javascript/flavours/glitch/features/report/components/status_check_box.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/rules.js create mode 100644 app/javascript/flavours/glitch/features/report/rules.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/statuses.js create mode 100644 app/javascript/flavours/glitch/features/report/statuses.jsx delete mode 100644 app/javascript/flavours/glitch/features/report/thanks.js create mode 100644 app/javascript/flavours/glitch/features/report/thanks.jsx delete mode 100644 app/javascript/flavours/glitch/features/standalone/compose/index.js create mode 100644 app/javascript/flavours/glitch/features/standalone/compose/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/status/components/action_bar.js create mode 100644 app/javascript/flavours/glitch/features/status/components/action_bar.jsx delete mode 100644 app/javascript/flavours/glitch/features/status/components/card.js create mode 100644 app/javascript/flavours/glitch/features/status/components/card.jsx delete mode 100644 app/javascript/flavours/glitch/features/status/components/detailed_status.js create mode 100644 app/javascript/flavours/glitch/features/status/components/detailed_status.jsx delete mode 100644 app/javascript/flavours/glitch/features/status/index.js create mode 100644 app/javascript/flavours/glitch/features/status/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/subscribed_languages_modal/index.js create mode 100644 app/javascript/flavours/glitch/features/subscribed_languages_modal/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/actions_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/actions_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/audio_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/audio_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/block_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/block_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/boost_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/boost_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle_column_error.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle_column_error.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/bundle_modal_error.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column_header.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column_header.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column_link.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column_link.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column_loading.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column_loading.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/column_subheading.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/column_subheading.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/columns_area.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/columns_area.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/compare_history_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/compare_history_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/compose_panel.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/compose_panel.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/confirmation_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/confirmation_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/deprecated_settings_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/disabled_account_banner.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/doodle_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/doodle_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/drawer_loading.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/drawer_loading.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/embed_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/embed_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/favourite_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/favourite_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/filter_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/filter_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/focal_point_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/focal_point_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/follow_requests_column_link.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/follow_requests_column_link.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/header.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/header.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/image_loader.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/image_loader.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/image_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/image_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/link_footer.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/link_footer.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/list_panel.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/list_panel.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/media_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/media_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/modal_loading.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/modal_loading.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/modal_root.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/modal_root.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/mute_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/mute_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/navigation_panel.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/navigation_panel.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/onboarding_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/onboarding_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/report_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/report_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/sign_in_banner.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/sign_in_banner.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/upload_area.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/upload_area.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/video_modal.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/video_modal.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/components/zoomable_image.js create mode 100644 app/javascript/flavours/glitch/features/ui/components/zoomable_image.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/index.js create mode 100644 app/javascript/flavours/glitch/features/ui/index.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/util/react_router_helpers.js create mode 100644 app/javascript/flavours/glitch/features/ui/util/react_router_helpers.jsx delete mode 100644 app/javascript/flavours/glitch/features/ui/util/reduced_motion.js create mode 100644 app/javascript/flavours/glitch/features/ui/util/reduced_motion.jsx delete mode 100644 app/javascript/flavours/glitch/features/video/index.js create mode 100644 app/javascript/flavours/glitch/features/video/index.jsx delete mode 100644 app/javascript/flavours/glitch/main.js create mode 100644 app/javascript/flavours/glitch/main.jsx delete mode 100644 app/javascript/flavours/glitch/packs/admin.js create mode 100644 app/javascript/flavours/glitch/packs/admin.jsx delete mode 100644 app/javascript/flavours/glitch/packs/public.js create mode 100644 app/javascript/flavours/glitch/packs/public.jsx delete mode 100644 app/javascript/flavours/glitch/packs/share.js create mode 100644 app/javascript/flavours/glitch/packs/share.jsx delete mode 100644 app/javascript/flavours/glitch/utils/icons.js create mode 100644 app/javascript/flavours/glitch/utils/icons.jsx (limited to 'app/javascript/flavours/glitch') diff --git a/app/javascript/flavours/glitch/components/account.js b/app/javascript/flavours/glitch/components/account.js deleted file mode 100644 index 7ce4b65aa..000000000 --- a/app/javascript/flavours/glitch/components/account.js +++ /dev/null @@ -1,186 +0,0 @@ -import React, { Fragment } from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import Avatar from './avatar'; -import DisplayName from './display_name'; -import Permalink from './permalink'; -import IconButton from './icon_button'; -import { defineMessages, injectIntl } from 'react-intl'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { me } from 'flavours/glitch/initial_state'; -import RelativeTimestamp from './relative_timestamp'; -import Skeleton from 'flavours/glitch/components/skeleton'; - -const messages = defineMessages({ - follow: { id: 'account.follow', defaultMessage: 'Follow' }, - unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, - requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' }, - unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, - unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, - mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' }, - unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' }, - mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' }, - block: { id: 'account.block', defaultMessage: 'Block @{name}' }, -}); - -export default @injectIntl -class Account extends ImmutablePureComponent { - - static propTypes = { - size: PropTypes.number, - account: ImmutablePropTypes.map, - onFollow: PropTypes.func.isRequired, - onBlock: PropTypes.func.isRequired, - onMute: PropTypes.func.isRequired, - onMuteNotifications: PropTypes.func.isRequired, - intl: PropTypes.object.isRequired, - hidden: PropTypes.bool, - small: PropTypes.bool, - actionIcon: PropTypes.string, - actionTitle: PropTypes.string, - defaultAction: PropTypes.string, - onActionClick: PropTypes.func, - }; - - static defaultProps = { - size: 36, - }; - - handleFollow = () => { - this.props.onFollow(this.props.account); - }; - - handleBlock = () => { - this.props.onBlock(this.props.account); - }; - - handleMute = () => { - this.props.onMute(this.props.account); - }; - - handleMuteNotifications = () => { - this.props.onMuteNotifications(this.props.account, true); - }; - - handleUnmuteNotifications = () => { - this.props.onMuteNotifications(this.props.account, false); - }; - - handleAction = () => { - this.props.onActionClick(this.props.account); - }; - - render () { - const { - account, - hidden, - intl, - small, - onActionClick, - actionIcon, - actionTitle, - defaultAction, - size, - } = this.props; - - if (!account) { - return ( -
-
-
-
- -
-
-
- ); - } - - if (hidden) { - return ( - - {account.get('display_name')} - {account.get('username')} - - ); - } - - let buttons; - - if (onActionClick) { - if (actionIcon) { - buttons = ; - } - } else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) { - const following = account.getIn(['relationship', 'following']); - const requested = account.getIn(['relationship', 'requested']); - const blocking = account.getIn(['relationship', 'blocking']); - const muting = account.getIn(['relationship', 'muting']); - - if (requested) { - buttons = ; - } else if (blocking) { - buttons = ; - } else if (muting) { - let hidingNotificationsButton; - if (account.getIn(['relationship', 'muting_notifications'])) { - hidingNotificationsButton = ; - } else { - hidingNotificationsButton = ; - } - buttons = ( - - - {hidingNotificationsButton} - - ); - } else if (defaultAction === 'mute') { - buttons = ; - } else if (defaultAction === 'block') { - buttons = ; - } else if (!account.get('moved') || following) { - buttons = ; - } - } - - let mute_expires_at; - if (account.get('mute_expires_at')) { - mute_expires_at =
; - } - - return small ? ( - -
- -
- -
- ) : ( -
-
- -
- {mute_expires_at} - -
- {buttons ? -
- {buttons} -
- : null} -
-
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/account.jsx b/app/javascript/flavours/glitch/components/account.jsx new file mode 100644 index 000000000..7ce4b65aa --- /dev/null +++ b/app/javascript/flavours/glitch/components/account.jsx @@ -0,0 +1,186 @@ +import React, { Fragment } from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import Avatar from './avatar'; +import DisplayName from './display_name'; +import Permalink from './permalink'; +import IconButton from './icon_button'; +import { defineMessages, injectIntl } from 'react-intl'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { me } from 'flavours/glitch/initial_state'; +import RelativeTimestamp from './relative_timestamp'; +import Skeleton from 'flavours/glitch/components/skeleton'; + +const messages = defineMessages({ + follow: { id: 'account.follow', defaultMessage: 'Follow' }, + unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' }, + requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' }, + unblock: { id: 'account.unblock', defaultMessage: 'Unblock @{name}' }, + unmute: { id: 'account.unmute', defaultMessage: 'Unmute @{name}' }, + mute_notifications: { id: 'account.mute_notifications', defaultMessage: 'Mute notifications from @{name}' }, + unmute_notifications: { id: 'account.unmute_notifications', defaultMessage: 'Unmute notifications from @{name}' }, + mute: { id: 'account.mute', defaultMessage: 'Mute @{name}' }, + block: { id: 'account.block', defaultMessage: 'Block @{name}' }, +}); + +export default @injectIntl +class Account extends ImmutablePureComponent { + + static propTypes = { + size: PropTypes.number, + account: ImmutablePropTypes.map, + onFollow: PropTypes.func.isRequired, + onBlock: PropTypes.func.isRequired, + onMute: PropTypes.func.isRequired, + onMuteNotifications: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + hidden: PropTypes.bool, + small: PropTypes.bool, + actionIcon: PropTypes.string, + actionTitle: PropTypes.string, + defaultAction: PropTypes.string, + onActionClick: PropTypes.func, + }; + + static defaultProps = { + size: 36, + }; + + handleFollow = () => { + this.props.onFollow(this.props.account); + }; + + handleBlock = () => { + this.props.onBlock(this.props.account); + }; + + handleMute = () => { + this.props.onMute(this.props.account); + }; + + handleMuteNotifications = () => { + this.props.onMuteNotifications(this.props.account, true); + }; + + handleUnmuteNotifications = () => { + this.props.onMuteNotifications(this.props.account, false); + }; + + handleAction = () => { + this.props.onActionClick(this.props.account); + }; + + render () { + const { + account, + hidden, + intl, + small, + onActionClick, + actionIcon, + actionTitle, + defaultAction, + size, + } = this.props; + + if (!account) { + return ( +
+
+
+
+ +
+
+
+ ); + } + + if (hidden) { + return ( + + {account.get('display_name')} + {account.get('username')} + + ); + } + + let buttons; + + if (onActionClick) { + if (actionIcon) { + buttons = ; + } + } else if (account.get('id') !== me && !small && account.get('relationship', null) !== null) { + const following = account.getIn(['relationship', 'following']); + const requested = account.getIn(['relationship', 'requested']); + const blocking = account.getIn(['relationship', 'blocking']); + const muting = account.getIn(['relationship', 'muting']); + + if (requested) { + buttons = ; + } else if (blocking) { + buttons = ; + } else if (muting) { + let hidingNotificationsButton; + if (account.getIn(['relationship', 'muting_notifications'])) { + hidingNotificationsButton = ; + } else { + hidingNotificationsButton = ; + } + buttons = ( + + + {hidingNotificationsButton} + + ); + } else if (defaultAction === 'mute') { + buttons = ; + } else if (defaultAction === 'block') { + buttons = ; + } else if (!account.get('moved') || following) { + buttons = ; + } + } + + let mute_expires_at; + if (account.get('mute_expires_at')) { + mute_expires_at =
; + } + + return small ? ( + +
+ +
+ +
+ ) : ( +
+
+ +
+ {mute_expires_at} + +
+ {buttons ? +
+ {buttons} +
+ : null} +
+
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/Counter.js b/app/javascript/flavours/glitch/components/admin/Counter.js deleted file mode 100644 index 5b6a19f8d..000000000 --- a/app/javascript/flavours/glitch/components/admin/Counter.js +++ /dev/null @@ -1,117 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import api from 'flavours/glitch/api'; -import { FormattedNumber } from 'react-intl'; -import { Sparklines, SparklinesCurve } from 'react-sparklines'; -import classNames from 'classnames'; -import Skeleton from 'flavours/glitch/components/skeleton'; - -const percIncrease = (a, b) => { - let percent; - - if (b !== 0) { - if (a !== 0) { - percent = (b - a) / a; - } else { - percent = 1; - } - } else if (b === 0 && a === 0) { - percent = 0; - } else { - percent = - 1; - } - - return percent; -}; - -export default class Counter extends React.PureComponent { - - static propTypes = { - measure: PropTypes.string.isRequired, - start_at: PropTypes.string.isRequired, - end_at: PropTypes.string.isRequired, - label: PropTypes.string.isRequired, - href: PropTypes.string, - params: PropTypes.object, - target: PropTypes.string, - }; - - state = { - loading: true, - data: null, - }; - - componentDidMount () { - const { measure, start_at, end_at, params } = this.props; - - api().post('/api/v1/admin/measures', { keys: [measure], start_at, end_at, [measure]: params }).then(res => { - this.setState({ - loading: false, - data: res.data, - }); - }).catch(err => { - console.error(err); - }); - } - - render () { - const { label, href, target } = this.props; - const { loading, data } = this.state; - - let content; - - if (loading) { - content = ( - - - - - ); - } else { - const measure = data[0]; - const percentChange = measure.previous_total && percIncrease(measure.previous_total * 1, measure.total * 1); - - content = ( - - {measure.human_value || } - {measure.previous_total && ( 0, negative: percentChange < 0 })}>{percentChange > 0 && '+'})} - - ); - } - - const inner = ( - -
- {content} -
- -
- {label} -
- -
- {!loading && ( - x.value * 1)}> - - - )} -
-
- ); - - if (href) { - return ( - - {inner} - - ); - } else { - return ( -
- {inner} -
- ); - } - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/Counter.jsx b/app/javascript/flavours/glitch/components/admin/Counter.jsx new file mode 100644 index 000000000..5b6a19f8d --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/Counter.jsx @@ -0,0 +1,117 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import api from 'flavours/glitch/api'; +import { FormattedNumber } from 'react-intl'; +import { Sparklines, SparklinesCurve } from 'react-sparklines'; +import classNames from 'classnames'; +import Skeleton from 'flavours/glitch/components/skeleton'; + +const percIncrease = (a, b) => { + let percent; + + if (b !== 0) { + if (a !== 0) { + percent = (b - a) / a; + } else { + percent = 1; + } + } else if (b === 0 && a === 0) { + percent = 0; + } else { + percent = - 1; + } + + return percent; +}; + +export default class Counter extends React.PureComponent { + + static propTypes = { + measure: PropTypes.string.isRequired, + start_at: PropTypes.string.isRequired, + end_at: PropTypes.string.isRequired, + label: PropTypes.string.isRequired, + href: PropTypes.string, + params: PropTypes.object, + target: PropTypes.string, + }; + + state = { + loading: true, + data: null, + }; + + componentDidMount () { + const { measure, start_at, end_at, params } = this.props; + + api().post('/api/v1/admin/measures', { keys: [measure], start_at, end_at, [measure]: params }).then(res => { + this.setState({ + loading: false, + data: res.data, + }); + }).catch(err => { + console.error(err); + }); + } + + render () { + const { label, href, target } = this.props; + const { loading, data } = this.state; + + let content; + + if (loading) { + content = ( + + + + + ); + } else { + const measure = data[0]; + const percentChange = measure.previous_total && percIncrease(measure.previous_total * 1, measure.total * 1); + + content = ( + + {measure.human_value || } + {measure.previous_total && ( 0, negative: percentChange < 0 })}>{percentChange > 0 && '+'})} + + ); + } + + const inner = ( + +
+ {content} +
+ +
+ {label} +
+ +
+ {!loading && ( + x.value * 1)}> + + + )} +
+
+ ); + + if (href) { + return ( + + {inner} + + ); + } else { + return ( +
+ {inner} +
+ ); + } + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/Dimension.js b/app/javascript/flavours/glitch/components/admin/Dimension.js deleted file mode 100644 index 3dac8c6c2..000000000 --- a/app/javascript/flavours/glitch/components/admin/Dimension.js +++ /dev/null @@ -1,93 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import api from 'flavours/glitch/api'; -import { FormattedNumber } from 'react-intl'; -import { roundTo10 } from 'flavours/glitch/utils/numbers'; -import Skeleton from 'flavours/glitch/components/skeleton'; - -export default class Dimension extends React.PureComponent { - - static propTypes = { - dimension: PropTypes.string.isRequired, - start_at: PropTypes.string.isRequired, - end_at: PropTypes.string.isRequired, - limit: PropTypes.number.isRequired, - label: PropTypes.string.isRequired, - params: PropTypes.object, - }; - - state = { - loading: true, - data: null, - }; - - componentDidMount () { - const { start_at, end_at, dimension, limit, params } = this.props; - - api().post('/api/v1/admin/dimensions', { keys: [dimension], start_at, end_at, limit, [dimension]: params }).then(res => { - this.setState({ - loading: false, - data: res.data, - }); - }).catch(err => { - console.error(err); - }); - } - - render () { - const { label, limit } = this.props; - const { loading, data } = this.state; - - let content; - - if (loading) { - content = ( - - - {Array.from(Array(limit)).map((_, i) => ( - - - - - - ))} - -
- - - -
- ); - } else { - const sum = data[0].data.reduce((sum, cur) => sum + (cur.value * 1), 0); - - content = ( - - - {data[0].data.map(item => ( - - - - - - ))} - -
- - {item.human_key} - - {typeof item.human_value !== 'undefined' ? item.human_value : } -
- ); - } - - return ( -
-

{label}

- - {content} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/Dimension.jsx b/app/javascript/flavours/glitch/components/admin/Dimension.jsx new file mode 100644 index 000000000..3dac8c6c2 --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/Dimension.jsx @@ -0,0 +1,93 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import api from 'flavours/glitch/api'; +import { FormattedNumber } from 'react-intl'; +import { roundTo10 } from 'flavours/glitch/utils/numbers'; +import Skeleton from 'flavours/glitch/components/skeleton'; + +export default class Dimension extends React.PureComponent { + + static propTypes = { + dimension: PropTypes.string.isRequired, + start_at: PropTypes.string.isRequired, + end_at: PropTypes.string.isRequired, + limit: PropTypes.number.isRequired, + label: PropTypes.string.isRequired, + params: PropTypes.object, + }; + + state = { + loading: true, + data: null, + }; + + componentDidMount () { + const { start_at, end_at, dimension, limit, params } = this.props; + + api().post('/api/v1/admin/dimensions', { keys: [dimension], start_at, end_at, limit, [dimension]: params }).then(res => { + this.setState({ + loading: false, + data: res.data, + }); + }).catch(err => { + console.error(err); + }); + } + + render () { + const { label, limit } = this.props; + const { loading, data } = this.state; + + let content; + + if (loading) { + content = ( + + + {Array.from(Array(limit)).map((_, i) => ( + + + + + + ))} + +
+ + + +
+ ); + } else { + const sum = data[0].data.reduce((sum, cur) => sum + (cur.value * 1), 0); + + content = ( + + + {data[0].data.map(item => ( + + + + + + ))} + +
+ + {item.human_key} + + {typeof item.human_value !== 'undefined' ? item.human_value : } +
+ ); + } + + return ( +
+

{label}

+ + {content} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.js b/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.js deleted file mode 100644 index 771dbb452..000000000 --- a/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.js +++ /dev/null @@ -1,159 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import api from 'flavours/glitch/api'; -import { injectIntl, defineMessages } from 'react-intl'; -import classNames from 'classnames'; - -const messages = defineMessages({ - other: { id: 'report.categories.other', defaultMessage: 'Other' }, - spam: { id: 'report.categories.spam', defaultMessage: 'Spam' }, - violation: { id: 'report.categories.violation', defaultMessage: 'Content violates one or more server rules' }, -}); - -class Category extends React.PureComponent { - - static propTypes = { - id: PropTypes.string.isRequired, - text: PropTypes.string.isRequired, - selected: PropTypes.bool, - disabled: PropTypes.bool, - onSelect: PropTypes.func, - children: PropTypes.node, - }; - - handleClick = () => { - const { id, disabled, onSelect } = this.props; - - if (!disabled) { - onSelect(id); - } - }; - - render () { - const { id, text, disabled, selected, children } = this.props; - - return ( -
- {selected && } - -
- - {text} -
- - {(selected && children) && ( -
- {children} -
- )} -
- ); - } - -} - -class Rule extends React.PureComponent { - - static propTypes = { - id: PropTypes.string.isRequired, - text: PropTypes.string.isRequired, - selected: PropTypes.bool, - disabled: PropTypes.bool, - onToggle: PropTypes.func, - }; - - handleClick = () => { - const { id, disabled, onToggle } = this.props; - - if (!disabled) { - onToggle(id); - } - }; - - render () { - const { id, text, disabled, selected } = this.props; - - return ( -
- - {selected && } - {text} -
- ); - } - -} - -export default @injectIntl -class ReportReasonSelector extends React.PureComponent { - - static propTypes = { - id: PropTypes.string.isRequired, - category: PropTypes.string.isRequired, - rule_ids: PropTypes.arrayOf(PropTypes.string), - disabled: PropTypes.bool, - intl: PropTypes.object.isRequired, - }; - - state = { - category: this.props.category, - rule_ids: this.props.rule_ids || [], - rules: [], - }; - - componentDidMount() { - api().get('/api/v1/instance').then(res => { - this.setState({ - rules: res.data.rules, - }); - }).catch(err => { - console.error(err); - }); - } - - _save = () => { - const { id, disabled } = this.props; - const { category, rule_ids } = this.state; - - if (disabled) { - return; - } - - api().put(`/api/v1/admin/reports/${id}`, { - category, - rule_ids, - }).catch(err => { - console.error(err); - }); - }; - - handleSelect = id => { - this.setState({ category: id }, () => this._save()); - }; - - handleToggle = id => { - const { rule_ids } = this.state; - - if (rule_ids.includes(id)) { - this.setState({ rule_ids: rule_ids.filter(x => x !== id ) }, () => this._save()); - } else { - this.setState({ rule_ids: [...rule_ids, id] }, () => this._save()); - } - }; - - render () { - const { disabled, intl } = this.props; - const { rules, category, rule_ids } = this.state; - - return ( -
- - - - {rules.map(rule => )} - -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx b/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx new file mode 100644 index 000000000..771dbb452 --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/ReportReasonSelector.jsx @@ -0,0 +1,159 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import api from 'flavours/glitch/api'; +import { injectIntl, defineMessages } from 'react-intl'; +import classNames from 'classnames'; + +const messages = defineMessages({ + other: { id: 'report.categories.other', defaultMessage: 'Other' }, + spam: { id: 'report.categories.spam', defaultMessage: 'Spam' }, + violation: { id: 'report.categories.violation', defaultMessage: 'Content violates one or more server rules' }, +}); + +class Category extends React.PureComponent { + + static propTypes = { + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + selected: PropTypes.bool, + disabled: PropTypes.bool, + onSelect: PropTypes.func, + children: PropTypes.node, + }; + + handleClick = () => { + const { id, disabled, onSelect } = this.props; + + if (!disabled) { + onSelect(id); + } + }; + + render () { + const { id, text, disabled, selected, children } = this.props; + + return ( +
+ {selected && } + +
+ + {text} +
+ + {(selected && children) && ( +
+ {children} +
+ )} +
+ ); + } + +} + +class Rule extends React.PureComponent { + + static propTypes = { + id: PropTypes.string.isRequired, + text: PropTypes.string.isRequired, + selected: PropTypes.bool, + disabled: PropTypes.bool, + onToggle: PropTypes.func, + }; + + handleClick = () => { + const { id, disabled, onToggle } = this.props; + + if (!disabled) { + onToggle(id); + } + }; + + render () { + const { id, text, disabled, selected } = this.props; + + return ( +
+ + {selected && } + {text} +
+ ); + } + +} + +export default @injectIntl +class ReportReasonSelector extends React.PureComponent { + + static propTypes = { + id: PropTypes.string.isRequired, + category: PropTypes.string.isRequired, + rule_ids: PropTypes.arrayOf(PropTypes.string), + disabled: PropTypes.bool, + intl: PropTypes.object.isRequired, + }; + + state = { + category: this.props.category, + rule_ids: this.props.rule_ids || [], + rules: [], + }; + + componentDidMount() { + api().get('/api/v1/instance').then(res => { + this.setState({ + rules: res.data.rules, + }); + }).catch(err => { + console.error(err); + }); + } + + _save = () => { + const { id, disabled } = this.props; + const { category, rule_ids } = this.state; + + if (disabled) { + return; + } + + api().put(`/api/v1/admin/reports/${id}`, { + category, + rule_ids, + }).catch(err => { + console.error(err); + }); + }; + + handleSelect = id => { + this.setState({ category: id }, () => this._save()); + }; + + handleToggle = id => { + const { rule_ids } = this.state; + + if (rule_ids.includes(id)) { + this.setState({ rule_ids: rule_ids.filter(x => x !== id ) }, () => this._save()); + } else { + this.setState({ rule_ids: [...rule_ids, id] }, () => this._save()); + } + }; + + render () { + const { disabled, intl } = this.props; + const { rules, category, rule_ids } = this.state; + + return ( +
+ + + + {rules.map(rule => )} + +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/Retention.js b/app/javascript/flavours/glitch/components/admin/Retention.js deleted file mode 100644 index e1ba3f6c9..000000000 --- a/app/javascript/flavours/glitch/components/admin/Retention.js +++ /dev/null @@ -1,151 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import api from 'flavours/glitch/api'; -import { FormattedMessage, FormattedNumber, FormattedDate } from 'react-intl'; -import classNames from 'classnames'; -import { roundTo10 } from 'flavours/glitch/utils/numbers'; - -const dateForCohort = cohort => { - switch(cohort.frequency) { - case 'day': - return ; - default: - return ; - } -}; - -export default class Retention extends React.PureComponent { - - static propTypes = { - start_at: PropTypes.string, - end_at: PropTypes.string, - frequency: PropTypes.string, - }; - - state = { - loading: true, - data: null, - }; - - componentDidMount () { - const { start_at, end_at, frequency } = this.props; - - api().post('/api/v1/admin/retention', { start_at, end_at, frequency }).then(res => { - this.setState({ - loading: false, - data: res.data, - }); - }).catch(err => { - console.error(err); - }); - } - - render () { - const { loading, data } = this.state; - const { frequency } = this.props; - - let content; - - if (loading) { - content = ; - } else { - content = ( - - - - - - - - {data[0].data.slice(1).map((retention, i) => ( - - ))} - - - - - - - - {data[0].data.slice(1).map((retention, i) => { - const average = data.reduce((sum, cohort, k) => cohort.data[i + 1] ? sum + (cohort.data[i + 1].rate - sum)/(k + 1) : sum, 0); - - return ( - - ); - })} - - - - - {data.slice(0, -1).map(cohort => ( - - - - - - {cohort.data.slice(1).map(retention => ( - - ))} - - ))} - -
-
- -
-
-
- -
-
-
- {i + 1} -
-
-
- -
-
-
- sum + ((cohort.data[0].value * 1) - sum) / (i + 1), 0)} maximumFractionDigits={0} /> -
-
-
- -
-
-
- {dateForCohort(cohort)} -
-
-
- -
-
-
- -
-
- ); - } - - let title = null; - switch(frequency) { - case 'day': - title = ; - break; - default: - title = ; - } - - return ( -
-

{title}

- - {content} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/Retention.jsx b/app/javascript/flavours/glitch/components/admin/Retention.jsx new file mode 100644 index 000000000..e1ba3f6c9 --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/Retention.jsx @@ -0,0 +1,151 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import api from 'flavours/glitch/api'; +import { FormattedMessage, FormattedNumber, FormattedDate } from 'react-intl'; +import classNames from 'classnames'; +import { roundTo10 } from 'flavours/glitch/utils/numbers'; + +const dateForCohort = cohort => { + switch(cohort.frequency) { + case 'day': + return ; + default: + return ; + } +}; + +export default class Retention extends React.PureComponent { + + static propTypes = { + start_at: PropTypes.string, + end_at: PropTypes.string, + frequency: PropTypes.string, + }; + + state = { + loading: true, + data: null, + }; + + componentDidMount () { + const { start_at, end_at, frequency } = this.props; + + api().post('/api/v1/admin/retention', { start_at, end_at, frequency }).then(res => { + this.setState({ + loading: false, + data: res.data, + }); + }).catch(err => { + console.error(err); + }); + } + + render () { + const { loading, data } = this.state; + const { frequency } = this.props; + + let content; + + if (loading) { + content = ; + } else { + content = ( + + + + + + + + {data[0].data.slice(1).map((retention, i) => ( + + ))} + + + + + + + + {data[0].data.slice(1).map((retention, i) => { + const average = data.reduce((sum, cohort, k) => cohort.data[i + 1] ? sum + (cohort.data[i + 1].rate - sum)/(k + 1) : sum, 0); + + return ( + + ); + })} + + + + + {data.slice(0, -1).map(cohort => ( + + + + + + {cohort.data.slice(1).map(retention => ( + + ))} + + ))} + +
+
+ +
+
+
+ +
+
+
+ {i + 1} +
+
+
+ +
+
+
+ sum + ((cohort.data[0].value * 1) - sum) / (i + 1), 0)} maximumFractionDigits={0} /> +
+
+
+ +
+
+
+ {dateForCohort(cohort)} +
+
+
+ +
+
+
+ +
+
+ ); + } + + let title = null; + switch(frequency) { + case 'day': + title = ; + break; + default: + title = ; + } + + return ( +
+

{title}

+ + {content} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/admin/Trends.js b/app/javascript/flavours/glitch/components/admin/Trends.js deleted file mode 100644 index 774bf36e6..000000000 --- a/app/javascript/flavours/glitch/components/admin/Trends.js +++ /dev/null @@ -1,73 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import api from 'flavours/glitch/api'; -import { FormattedMessage } from 'react-intl'; -import classNames from 'classnames'; -import Hashtag from 'flavours/glitch/components/hashtag'; - -export default class Trends extends React.PureComponent { - - static propTypes = { - limit: PropTypes.number.isRequired, - }; - - state = { - loading: true, - data: null, - }; - - componentDidMount () { - const { limit } = this.props; - - api().get('/api/v1/admin/trends/tags', { params: { limit } }).then(res => { - this.setState({ - loading: false, - data: res.data, - }); - }).catch(err => { - console.error(err); - }); - } - - render () { - const { limit } = this.props; - const { loading, data } = this.state; - - let content; - - if (loading) { - content = ( -
- {Array.from(Array(limit)).map((_, i) => ( - - ))} -
- ); - } else { - content = ( -
- {data.map(hashtag => ( - day.uses)} - className={classNames(hashtag.requires_review && 'trends__item--requires-review', !hashtag.trendable && !hashtag.requires_review && 'trends__item--disabled')} - /> - ))} -
- ); - } - - return ( -
-

- - {content} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/admin/Trends.jsx b/app/javascript/flavours/glitch/components/admin/Trends.jsx new file mode 100644 index 000000000..774bf36e6 --- /dev/null +++ b/app/javascript/flavours/glitch/components/admin/Trends.jsx @@ -0,0 +1,73 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import api from 'flavours/glitch/api'; +import { FormattedMessage } from 'react-intl'; +import classNames from 'classnames'; +import Hashtag from 'flavours/glitch/components/hashtag'; + +export default class Trends extends React.PureComponent { + + static propTypes = { + limit: PropTypes.number.isRequired, + }; + + state = { + loading: true, + data: null, + }; + + componentDidMount () { + const { limit } = this.props; + + api().get('/api/v1/admin/trends/tags', { params: { limit } }).then(res => { + this.setState({ + loading: false, + data: res.data, + }); + }).catch(err => { + console.error(err); + }); + } + + render () { + const { limit } = this.props; + const { loading, data } = this.state; + + let content; + + if (loading) { + content = ( +
+ {Array.from(Array(limit)).map((_, i) => ( + + ))} +
+ ); + } else { + content = ( +
+ {data.map(hashtag => ( + day.uses)} + className={classNames(hashtag.requires_review && 'trends__item--requires-review', !hashtag.trendable && !hashtag.requires_review && 'trends__item--disabled')} + /> + ))} +
+ ); + } + + return ( +
+

+ + {content} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/animated_number.js b/app/javascript/flavours/glitch/components/animated_number.js deleted file mode 100644 index dd21d97f0..000000000 --- a/app/javascript/flavours/glitch/components/animated_number.js +++ /dev/null @@ -1,76 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ShortNumber from 'mastodon/components/short_number'; -import TransitionMotion from 'react-motion/lib/TransitionMotion'; -import spring from 'react-motion/lib/spring'; -import { reduceMotion } from 'flavours/glitch/initial_state'; - -const obfuscatedCount = count => { - if (count < 0) { - return 0; - } else if (count <= 1) { - return count; - } else { - return '1+'; - } -}; - -export default class AnimatedNumber extends React.PureComponent { - - static propTypes = { - value: PropTypes.number.isRequired, - obfuscate: PropTypes.bool, - }; - - state = { - direction: 1, - }; - - componentWillReceiveProps (nextProps) { - if (nextProps.value > this.props.value) { - this.setState({ direction: 1 }); - } else if (nextProps.value < this.props.value) { - this.setState({ direction: -1 }); - } - } - - willEnter = () => { - const { direction } = this.state; - - return { y: -1 * direction }; - }; - - willLeave = () => { - const { direction } = this.state; - - return { y: spring(1 * direction, { damping: 35, stiffness: 400 }) }; - }; - - render () { - const { value, obfuscate } = this.props; - const { direction } = this.state; - - if (reduceMotion) { - return obfuscate ? obfuscatedCount(value) : ; - } - - const styles = [{ - key: `${value}`, - data: value, - style: { y: spring(0, { damping: 35, stiffness: 400 }) }, - }]; - - return ( - - {items => ( - - {items.map(({ key, data, style }) => ( - 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}>{obfuscate ? obfuscatedCount(data) : } - ))} - - )} - - ); - } - -} diff --git a/app/javascript/flavours/glitch/components/animated_number.jsx b/app/javascript/flavours/glitch/components/animated_number.jsx new file mode 100644 index 000000000..dd21d97f0 --- /dev/null +++ b/app/javascript/flavours/glitch/components/animated_number.jsx @@ -0,0 +1,76 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ShortNumber from 'mastodon/components/short_number'; +import TransitionMotion from 'react-motion/lib/TransitionMotion'; +import spring from 'react-motion/lib/spring'; +import { reduceMotion } from 'flavours/glitch/initial_state'; + +const obfuscatedCount = count => { + if (count < 0) { + return 0; + } else if (count <= 1) { + return count; + } else { + return '1+'; + } +}; + +export default class AnimatedNumber extends React.PureComponent { + + static propTypes = { + value: PropTypes.number.isRequired, + obfuscate: PropTypes.bool, + }; + + state = { + direction: 1, + }; + + componentWillReceiveProps (nextProps) { + if (nextProps.value > this.props.value) { + this.setState({ direction: 1 }); + } else if (nextProps.value < this.props.value) { + this.setState({ direction: -1 }); + } + } + + willEnter = () => { + const { direction } = this.state; + + return { y: -1 * direction }; + }; + + willLeave = () => { + const { direction } = this.state; + + return { y: spring(1 * direction, { damping: 35, stiffness: 400 }) }; + }; + + render () { + const { value, obfuscate } = this.props; + const { direction } = this.state; + + if (reduceMotion) { + return obfuscate ? obfuscatedCount(value) : ; + } + + const styles = [{ + key: `${value}`, + data: value, + style: { y: spring(0, { damping: 35, stiffness: 400 }) }, + }]; + + return ( + + {items => ( + + {items.map(({ key, data, style }) => ( + 0 ? 'absolute' : 'static', transform: `translateY(${style.y * 100}%)` }}>{obfuscate ? obfuscatedCount(data) : } + ))} + + )} + + ); + } + +} diff --git a/app/javascript/flavours/glitch/components/attachment_list.js b/app/javascript/flavours/glitch/components/attachment_list.js deleted file mode 100644 index 68b80b19f..000000000 --- a/app/javascript/flavours/glitch/components/attachment_list.js +++ /dev/null @@ -1,48 +0,0 @@ -import React from 'react'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import { FormattedMessage } from 'react-intl'; -import classNames from 'classnames'; -import Icon from 'flavours/glitch/components/icon'; - -const filename = url => url.split('/').pop().split('#')[0].split('?')[0]; - -export default class AttachmentList extends ImmutablePureComponent { - - static propTypes = { - media: ImmutablePropTypes.list.isRequired, - compact: PropTypes.bool, - }; - - render () { - const { media, compact } = this.props; - - return ( -
- {!compact && ( -
- -
- )} - - -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/attachment_list.jsx b/app/javascript/flavours/glitch/components/attachment_list.jsx new file mode 100644 index 000000000..68b80b19f --- /dev/null +++ b/app/javascript/flavours/glitch/components/attachment_list.jsx @@ -0,0 +1,48 @@ +import React from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import { FormattedMessage } from 'react-intl'; +import classNames from 'classnames'; +import Icon from 'flavours/glitch/components/icon'; + +const filename = url => url.split('/').pop().split('#')[0].split('?')[0]; + +export default class AttachmentList extends ImmutablePureComponent { + + static propTypes = { + media: ImmutablePropTypes.list.isRequired, + compact: PropTypes.bool, + }; + + render () { + const { media, compact } = this.props; + + return ( +
+ {!compact && ( +
+ +
+ )} + + +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/autosuggest_emoji.js b/app/javascript/flavours/glitch/components/autosuggest_emoji.js deleted file mode 100644 index 83fafbd10..000000000 --- a/app/javascript/flavours/glitch/components/autosuggest_emoji.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import unicodeMapping from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; - -import { assetHost } from 'flavours/glitch/utils/config'; - -export default class AutosuggestEmoji extends React.PureComponent { - - static propTypes = { - emoji: PropTypes.object.isRequired, - }; - - render () { - const { emoji } = this.props; - let url; - - if (emoji.custom) { - url = emoji.imageUrl; - } else { - const mapping = unicodeMapping[emoji.native] || unicodeMapping[emoji.native.replace(/\uFE0F$/, '')]; - - if (!mapping) { - return null; - } - - url = `${assetHost}/emoji/${mapping.filename}.svg`; - } - - return ( -
- {emoji.native - - {emoji.colons} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx new file mode 100644 index 000000000..83fafbd10 --- /dev/null +++ b/app/javascript/flavours/glitch/components/autosuggest_emoji.jsx @@ -0,0 +1,42 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import unicodeMapping from 'flavours/glitch/features/emoji/emoji_unicode_mapping_light'; + +import { assetHost } from 'flavours/glitch/utils/config'; + +export default class AutosuggestEmoji extends React.PureComponent { + + static propTypes = { + emoji: PropTypes.object.isRequired, + }; + + render () { + const { emoji } = this.props; + let url; + + if (emoji.custom) { + url = emoji.imageUrl; + } else { + const mapping = unicodeMapping[emoji.native] || unicodeMapping[emoji.native.replace(/\uFE0F$/, '')]; + + if (!mapping) { + return null; + } + + url = `${assetHost}/emoji/${mapping.filename}.svg`; + } + + return ( +
+ {emoji.native + + {emoji.colons} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/autosuggest_hashtag.js b/app/javascript/flavours/glitch/components/autosuggest_hashtag.js deleted file mode 100644 index d787ed07a..000000000 --- a/app/javascript/flavours/glitch/components/autosuggest_hashtag.js +++ /dev/null @@ -1,42 +0,0 @@ -import React from 'react'; -import PropTypes from 'prop-types'; -import ShortNumber from 'flavours/glitch/components/short_number'; -import { FormattedMessage } from 'react-intl'; - -export default class AutosuggestHashtag extends React.PureComponent { - - static propTypes = { - tag: PropTypes.shape({ - name: PropTypes.string.isRequired, - url: PropTypes.string, - history: PropTypes.array, - }).isRequired, - }; - - render() { - const { tag } = this.props; - const weeklyUses = tag.history && ( - total + day.uses * 1, 0)} - /> - ); - - return ( -
-
- #{tag.name} -
- {tag.history !== undefined && ( -
- -
- )} -
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx b/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx new file mode 100644 index 000000000..d787ed07a --- /dev/null +++ b/app/javascript/flavours/glitch/components/autosuggest_hashtag.jsx @@ -0,0 +1,42 @@ +import React from 'react'; +import PropTypes from 'prop-types'; +import ShortNumber from 'flavours/glitch/components/short_number'; +import { FormattedMessage } from 'react-intl'; + +export default class AutosuggestHashtag extends React.PureComponent { + + static propTypes = { + tag: PropTypes.shape({ + name: PropTypes.string.isRequired, + url: PropTypes.string, + history: PropTypes.array, + }).isRequired, + }; + + render() { + const { tag } = this.props; + const weeklyUses = tag.history && ( + total + day.uses * 1, 0)} + /> + ); + + return ( +
+
+ #{tag.name} +
+ {tag.history !== undefined && ( +
+ +
+ )} +
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.js b/app/javascript/flavours/glitch/components/autosuggest_input.js deleted file mode 100644 index 90ff298c0..000000000 --- a/app/javascript/flavours/glitch/components/autosuggest_input.js +++ /dev/null @@ -1,227 +0,0 @@ -import React from 'react'; -import AutosuggestAccountContainer from 'flavours/glitch/features/compose/containers/autosuggest_account_container'; -import AutosuggestEmoji from './autosuggest_emoji'; -import AutosuggestHashtag from './autosuggest_hashtag'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import classNames from 'classnames'; - -const textAtCursorMatchesToken = (str, caretPosition, searchTokens) => { - let word; - - let left = str.slice(0, caretPosition).search(/[^\s\u200B]+$/); - let right = str.slice(caretPosition).search(/[\s\u200B]/); - - if (right < 0) { - word = str.slice(left); - } else { - word = str.slice(left, right + caretPosition); - } - - if (!word || word.trim().length < 3 || searchTokens.indexOf(word[0]) === -1) { - return [null, null]; - } - - word = word.trim().toLowerCase(); - - if (word.length > 0) { - return [left, word]; - } else { - return [null, null]; - } -}; - -export default class AutosuggestInput extends ImmutablePureComponent { - - static propTypes = { - value: PropTypes.string, - suggestions: ImmutablePropTypes.list, - disabled: PropTypes.bool, - placeholder: PropTypes.string, - onSuggestionSelected: PropTypes.func.isRequired, - onSuggestionsClearRequested: PropTypes.func.isRequired, - onSuggestionsFetchRequested: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onKeyUp: PropTypes.func, - onKeyDown: PropTypes.func, - autoFocus: PropTypes.bool, - className: PropTypes.string, - id: PropTypes.string, - searchTokens: PropTypes.arrayOf(PropTypes.string), - maxLength: PropTypes.number, - lang: PropTypes.string, - spellCheck: PropTypes.bool, - }; - - static defaultProps = { - autoFocus: true, - searchTokens: ['@', ':', '#'], - }; - - state = { - suggestionsHidden: true, - focused: false, - selectedSuggestion: 0, - lastToken: null, - tokenStart: 0, - }; - - onChange = (e) => { - const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens); - - if (token !== null && this.state.lastToken !== token) { - this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); - this.props.onSuggestionsFetchRequested(token); - } else if (token === null) { - this.setState({ lastToken: null }); - this.props.onSuggestionsClearRequested(); - } - - this.props.onChange(e); - }; - - onKeyDown = (e) => { - const { suggestions, disabled } = this.props; - const { selectedSuggestion, suggestionsHidden } = this.state; - - if (disabled) { - e.preventDefault(); - return; - } - - if (e.which === 229 || e.isComposing) { - // Ignore key events during text composition - // e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac) - return; - } - - switch(e.key) { - case 'Escape': - if (suggestions.size === 0 || suggestionsHidden) { - document.querySelector('.ui').parentElement.focus(); - } else { - e.preventDefault(); - this.setState({ suggestionsHidden: true }); - } - - break; - case 'ArrowDown': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); - } - - break; - case 'ArrowUp': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); - } - - break; - case 'Enter': - case 'Tab': - // Select suggestion - if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - e.stopPropagation(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); - } - - break; - } - - if (e.defaultPrevented || !this.props.onKeyDown) { - return; - } - - this.props.onKeyDown(e); - }; - - onBlur = () => { - this.setState({ suggestionsHidden: true, focused: false }); - }; - - onFocus = () => { - this.setState({ focused: true }); - }; - - onSuggestionClick = (e) => { - const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); - e.preventDefault(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); - this.input.focus(); - }; - - componentWillReceiveProps (nextProps) { - if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { - this.setState({ suggestionsHidden: false }); - } - } - - setInput = (c) => { - this.input = c; - }; - - renderSuggestion = (suggestion, i) => { - const { selectedSuggestion } = this.state; - let inner, key; - - if (suggestion.type === 'emoji') { - inner = ; - key = suggestion.id; - } else if (suggestion.type ==='hashtag') { - inner = ; - key = suggestion.name; - } else if (suggestion.type === 'account') { - inner = ; - key = suggestion.id; - } - - return ( -
- {inner} -
- ); - }; - - render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang, spellCheck } = this.props; - const { suggestionsHidden } = this.state; - - return ( -
- - -
- {suggestions.map(this.renderSuggestion)} -
-
- ); - } - -} diff --git a/app/javascript/flavours/glitch/components/autosuggest_input.jsx b/app/javascript/flavours/glitch/components/autosuggest_input.jsx new file mode 100644 index 000000000..90ff298c0 --- /dev/null +++ b/app/javascript/flavours/glitch/components/autosuggest_input.jsx @@ -0,0 +1,227 @@ +import React from 'react'; +import AutosuggestAccountContainer from 'flavours/glitch/features/compose/containers/autosuggest_account_container'; +import AutosuggestEmoji from './autosuggest_emoji'; +import AutosuggestHashtag from './autosuggest_hashtag'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import ImmutablePureComponent from 'react-immutable-pure-component'; +import classNames from 'classnames'; + +const textAtCursorMatchesToken = (str, caretPosition, searchTokens) => { + let word; + + let left = str.slice(0, caretPosition).search(/[^\s\u200B]+$/); + let right = str.slice(caretPosition).search(/[\s\u200B]/); + + if (right < 0) { + word = str.slice(left); + } else { + word = str.slice(left, right + caretPosition); + } + + if (!word || word.trim().length < 3 || searchTokens.indexOf(word[0]) === -1) { + return [null, null]; + } + + word = word.trim().toLowerCase(); + + if (word.length > 0) { + return [left, word]; + } else { + return [null, null]; + } +}; + +export default class AutosuggestInput extends ImmutablePureComponent { + + static propTypes = { + value: PropTypes.string, + suggestions: ImmutablePropTypes.list, + disabled: PropTypes.bool, + placeholder: PropTypes.string, + onSuggestionSelected: PropTypes.func.isRequired, + onSuggestionsClearRequested: PropTypes.func.isRequired, + onSuggestionsFetchRequested: PropTypes.func.isRequired, + onChange: PropTypes.func.isRequired, + onKeyUp: PropTypes.func, + onKeyDown: PropTypes.func, + autoFocus: PropTypes.bool, + className: PropTypes.string, + id: PropTypes.string, + searchTokens: PropTypes.arrayOf(PropTypes.string), + maxLength: PropTypes.number, + lang: PropTypes.string, + spellCheck: PropTypes.bool, + }; + + static defaultProps = { + autoFocus: true, + searchTokens: ['@', ':', '#'], + }; + + state = { + suggestionsHidden: true, + focused: false, + selectedSuggestion: 0, + lastToken: null, + tokenStart: 0, + }; + + onChange = (e) => { + const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart, this.props.searchTokens); + + if (token !== null && this.state.lastToken !== token) { + this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); + this.props.onSuggestionsFetchRequested(token); + } else if (token === null) { + this.setState({ lastToken: null }); + this.props.onSuggestionsClearRequested(); + } + + this.props.onChange(e); + }; + + onKeyDown = (e) => { + const { suggestions, disabled } = this.props; + const { selectedSuggestion, suggestionsHidden } = this.state; + + if (disabled) { + e.preventDefault(); + return; + } + + if (e.which === 229 || e.isComposing) { + // Ignore key events during text composition + // e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac) + return; + } + + switch(e.key) { + case 'Escape': + if (suggestions.size === 0 || suggestionsHidden) { + document.querySelector('.ui').parentElement.focus(); + } else { + e.preventDefault(); + this.setState({ suggestionsHidden: true }); + } + + break; + case 'ArrowDown': + if (suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); + } + + break; + case 'ArrowUp': + if (suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); + } + + break; + case 'Enter': + case 'Tab': + // Select suggestion + if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { + e.preventDefault(); + e.stopPropagation(); + this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); + } + + break; + } + + if (e.defaultPrevented || !this.props.onKeyDown) { + return; + } + + this.props.onKeyDown(e); + }; + + onBlur = () => { + this.setState({ suggestionsHidden: true, focused: false }); + }; + + onFocus = () => { + this.setState({ focused: true }); + }; + + onSuggestionClick = (e) => { + const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); + e.preventDefault(); + this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); + this.input.focus(); + }; + + componentWillReceiveProps (nextProps) { + if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { + this.setState({ suggestionsHidden: false }); + } + } + + setInput = (c) => { + this.input = c; + }; + + renderSuggestion = (suggestion, i) => { + const { selectedSuggestion } = this.state; + let inner, key; + + if (suggestion.type === 'emoji') { + inner = ; + key = suggestion.id; + } else if (suggestion.type ==='hashtag') { + inner = ; + key = suggestion.name; + } else if (suggestion.type === 'account') { + inner = ; + key = suggestion.id; + } + + return ( +
+ {inner} +
+ ); + }; + + render () { + const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, className, id, maxLength, lang, spellCheck } = this.props; + const { suggestionsHidden } = this.state; + + return ( +
+ + +
+ {suggestions.map(this.renderSuggestion)} +
+
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/components/autosuggest_textarea.js b/app/javascript/flavours/glitch/components/autosuggest_textarea.js deleted file mode 100644 index 6e6e567b9..000000000 --- a/app/javascript/flavours/glitch/components/autosuggest_textarea.js +++ /dev/null @@ -1,235 +0,0 @@ -import React from 'react'; -import AutosuggestAccountContainer from 'flavours/glitch/features/compose/containers/autosuggest_account_container'; -import AutosuggestEmoji from './autosuggest_emoji'; -import AutosuggestHashtag from './autosuggest_hashtag'; -import ImmutablePropTypes from 'react-immutable-proptypes'; -import PropTypes from 'prop-types'; -import ImmutablePureComponent from 'react-immutable-pure-component'; -import Textarea from 'react-textarea-autosize'; -import classNames from 'classnames'; - -const textAtCursorMatchesToken = (str, caretPosition) => { - let word; - - let left = str.slice(0, caretPosition).search(/[^\s\u200B]+$/); - let right = str.slice(caretPosition).search(/[\s\u200B]/); - - if (right < 0) { - word = str.slice(left); - } else { - word = str.slice(left, right + caretPosition); - } - - if (!word || word.trim().length < 3 || ['@', ':', '#'].indexOf(word[0]) === -1) { - return [null, null]; - } - - word = word.trim().toLowerCase(); - - if (word.length > 0) { - return [left, word]; - } else { - return [null, null]; - } -}; - -export default class AutosuggestTextarea extends ImmutablePureComponent { - - static propTypes = { - value: PropTypes.string, - suggestions: ImmutablePropTypes.list, - disabled: PropTypes.bool, - placeholder: PropTypes.string, - onSuggestionSelected: PropTypes.func.isRequired, - onSuggestionsClearRequested: PropTypes.func.isRequired, - onSuggestionsFetchRequested: PropTypes.func.isRequired, - onChange: PropTypes.func.isRequired, - onKeyUp: PropTypes.func, - onKeyDown: PropTypes.func, - onPaste: PropTypes.func.isRequired, - autoFocus: PropTypes.bool, - lang: PropTypes.string, - }; - - static defaultProps = { - autoFocus: true, - }; - - state = { - suggestionsHidden: true, - focused: false, - selectedSuggestion: 0, - lastToken: null, - tokenStart: 0, - }; - - onChange = (e) => { - const [ tokenStart, token ] = textAtCursorMatchesToken(e.target.value, e.target.selectionStart); - - if (token !== null && this.state.lastToken !== token) { - this.setState({ lastToken: token, selectedSuggestion: 0, tokenStart }); - this.props.onSuggestionsFetchRequested(token); - } else if (token === null) { - this.setState({ lastToken: null }); - this.props.onSuggestionsClearRequested(); - } - - this.props.onChange(e); - }; - - onKeyDown = (e) => { - const { suggestions, disabled } = this.props; - const { selectedSuggestion, suggestionsHidden } = this.state; - - if (disabled) { - e.preventDefault(); - return; - } - - if (e.which === 229 || e.isComposing) { - // Ignore key events during text composition - // e.key may be a name of the physical key even in this case (e.x. Safari / Chrome on Mac) - return; - } - - switch(e.key) { - case 'Escape': - if (suggestions.size === 0 || suggestionsHidden) { - document.querySelector('.ui').parentElement.focus(); - } else { - e.preventDefault(); - this.setState({ suggestionsHidden: true }); - } - - break; - case 'ArrowDown': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.min(selectedSuggestion + 1, suggestions.size - 1) }); - } - - break; - case 'ArrowUp': - if (suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - this.setState({ selectedSuggestion: Math.max(selectedSuggestion - 1, 0) }); - } - - break; - case 'Enter': - case 'Tab': - // Select suggestion - if (this.state.lastToken !== null && suggestions.size > 0 && !suggestionsHidden) { - e.preventDefault(); - e.stopPropagation(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestions.get(selectedSuggestion)); - } - - break; - } - - if (e.defaultPrevented || !this.props.onKeyDown) { - return; - } - - this.props.onKeyDown(e); - }; - - onBlur = () => { - this.setState({ suggestionsHidden: true, focused: false }); - }; - - onFocus = (e) => { - this.setState({ focused: true }); - if (this.props.onFocus) { - this.props.onFocus(e); - } - }; - - onSuggestionClick = (e) => { - const suggestion = this.props.suggestions.get(e.currentTarget.getAttribute('data-index')); - e.preventDefault(); - this.props.onSuggestionSelected(this.state.tokenStart, this.state.lastToken, suggestion); - this.textarea.focus(); - }; - - componentWillReceiveProps (nextProps) { - if (nextProps.suggestions !== this.props.suggestions && nextProps.suggestions.size > 0 && this.state.suggestionsHidden && this.state.focused) { - this.setState({ suggestionsHidden: false }); - } - } - - setTextarea = (c) => { - this.textarea = c; - }; - - onPaste = (e) => { - if (e.clipboardData && e.clipboardData.files.length === 1) { - this.props.onPaste(e.clipboardData.files); - e.preventDefault(); - } - }; - - renderSuggestion = (suggestion, i) => { - const { selectedSuggestion } = this.state; - let inner, key; - - if (suggestion.type === 'emoji') { - inner = ; - key = suggestion.id; - } else if (suggestion.type === 'hashtag') { - inner = ; - key = suggestion.name; - } else if (suggestion.type === 'account') { - inner = ; - key = suggestion.id; - } - - return ( -
- {inner} -
- ); - }; - - render () { - const { value, suggestions, disabled, placeholder, onKeyUp, autoFocus, lang, children } = this.props; - const { suggestionsHidden } = this.state; - - return [ -
-
-