Browse Source

Moved glitch files to their own location ;)

closed-social-glitch-2
kibigo! 7 years ago
parent
commit
297921fce5
33 changed files with 315 additions and 263 deletions
  1. +0
    -0
      app/javascript/glitch/actions/local_settings.js
  2. +9
    -4
      app/javascript/glitch/components/account/header.js
  3. +5
    -2
      app/javascript/glitch/components/compose/advanced_options.js
  4. +9
    -4
      app/javascript/glitch/components/notification/index.js
  5. +11
    -81
      app/javascript/glitch/components/settings/index.js
  6. +79
    -0
      app/javascript/glitch/components/settings/item.js
  7. +6
    -3
      app/javascript/glitch/components/status/action_bar.js
  8. +6
    -3
      app/javascript/glitch/components/status/content.js
  9. +79
    -0
      app/javascript/glitch/components/status/gallery/index.js
  10. +4
    -71
      app/javascript/glitch/components/status/gallery/item.js
  11. +6
    -8
      app/javascript/glitch/components/status/header.js
  12. +12
    -17
      app/javascript/glitch/components/status/index.js
  13. +4
    -4
      app/javascript/glitch/components/status/prepend.js
  14. +6
    -3
      app/javascript/glitch/components/status/video_player.js
  15. +22
    -0
      app/javascript/glitch/containers/compose/advanced_options.js
  16. +7
    -2
      app/javascript/glitch/containers/notification/index.js
  17. +9
    -4
      app/javascript/glitch/containers/settings/index.js
  18. +16
    -20
      app/javascript/glitch/containers/status/index.js
  19. +7
    -2
      app/javascript/glitch/reducers/local_settings.js
  20. +0
    -0
      app/javascript/glitch/util/bio_metadata.js
  21. +1
    -1
      app/javascript/mastodon/components/status_list.js
  22. +1
    -1
      app/javascript/mastodon/features/account_timeline/components/header.js
  23. +2
    -2
      app/javascript/mastodon/features/compose/components/compose_form.js
  24. +1
    -1
      app/javascript/mastodon/features/compose/components/search_results.js
  25. +0
    -17
      app/javascript/mastodon/features/compose/containers/advanced_options_container.js
  26. +1
    -1
      app/javascript/mastodon/features/compose/index.js
  27. +1
    -1
      app/javascript/mastodon/features/notifications/index.js
  28. +5
    -5
      app/javascript/mastodon/features/status/components/detailed_status.js
  29. +1
    -1
      app/javascript/mastodon/features/status/index.js
  30. +1
    -1
      app/javascript/mastodon/features/ui/components/boost_modal.js
  31. +2
    -2
      app/javascript/mastodon/features/ui/components/modal_root.js
  32. +1
    -1
      app/javascript/mastodon/reducers/index.js
  33. +1
    -1
      app/javascript/packs/public.js

app/javascript/mastodon/actions/local_settings.js → app/javascript/glitch/actions/local_settings.js View File


app/javascript/mastodon/features/account/components/header.js → app/javascript/glitch/components/account/header.js View File

@ -1,13 +1,18 @@
// Package imports //
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import emojify from '../../../emoji';
import escapeTextContentForBrowser from 'escape-html';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import IconButton from '../../../components/icon_button';
import Avatar from '../../../components/avatar';
import ImmutablePureComponent from 'react-immutable-pure-component';
import { processBio } from '../util/bio_metadata';
// Mastodon imports //
import emojify from '../../../mastodon/emoji';
import IconButton from '../../../mastodon/components/icon_button';
import Avatar from '../../../mastodon/components/avatar';
// Our imports //
import { processBio } from '../../util/bio_metadata';
const messages = defineMessages({
unfollow: { id: 'account.unfollow', defaultMessage: 'Unfollow' },

app/javascript/mastodon/features/compose/components/advanced_options_dropdown.js → app/javascript/glitch/components/compose/advanced_options.js View File

@ -1,10 +1,13 @@
// Package imports //
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import IconButton from '../../../components/icon_button';
import Toggle from 'react-toggle';
import { injectIntl, defineMessages } from 'react-intl';
// Mastodon imports //
import IconButton from '../../../mastodon/components/icon_button';
const messages = defineMessages({
local_only_short: { id: 'advanced-options.local-only.short', defaultMessage: 'Local-only' },
local_only_long: { id: 'advanced-options.local-only.long', defaultMessage: 'Do not post to other instances' },
@ -17,7 +20,7 @@ const iconStyle = {
};
@injectIntl
export default class AdvancedOptionsDropdown extends React.PureComponent {
export default class ComposeAdvancedOptions extends React.PureComponent {
static propTypes = {
values: ImmutablePropTypes.contains({

app/javascript/mastodon/features/notifications/components/notification.js → app/javascript/glitch/components/notification/index.js View File

@ -1,13 +1,18 @@
// Package imports //
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import StatusContainer from '../../../containers/status_container';
import AccountContainer from '../../../containers/account_container';
import { FormattedMessage } from 'react-intl';
import Permalink from '../../../components/permalink';
import emojify from '../../../emoji';
import escapeTextContentForBrowser from 'escape-html';
import ImmutablePureComponent from 'react-immutable-pure-component';
// Mastodon imports //
import AccountContainer from '../../../mastodon/containers/account_container';
import Permalink from '../../../mastodon/components/permalink';
import emojify from '../../../mastodon/emoji';
// Our imports //
import StatusContainer from '../../containers/status';
export default class Notification extends ImmutablePureComponent {
static propTypes = {

app/javascript/mastodon/features/ui/components/settings_modal.js → app/javascript/glitch/components/settings/index.js View File

@ -1,7 +1,11 @@
// Package imports //
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage, injectIntl, defineMessages } from 'react-intl';
import { injectIntl, defineMessages, FormattedMessage } from 'react-intl';
// Our imports //
import SettingsItem from './item';
const messages = defineMessages({
layout_auto: { id: 'layout.auto', defaultMessage: 'Auto' },
@ -10,89 +14,14 @@ const messages = defineMessages({
});
@injectIntl
class SettingsItem extends React.PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
item: PropTypes.array.isRequired,
id: PropTypes.string.isRequired,
options: PropTypes.arrayOf(PropTypes.shape({
value: PropTypes.string.isRequired,
message: PropTypes.object.isRequired,
})),
dependsOn: PropTypes.array,
dependsOnNot: PropTypes.array,
children: PropTypes.element.isRequired,
onChange: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
handleChange = (e) => {
const { item, onChange } = this.props;
onChange(item, e);
}
render () {
const { settings, item, id, options, children, dependsOn, dependsOnNot, intl } = this.props;
let enabled = true;
if (dependsOn) {
for (let i = 0; i < dependsOn.length; i++) {
enabled = enabled && settings.getIn(dependsOn[i]);
}
}
if (dependsOnNot) {
for (let i = 0; i < dependsOnNot.length; i++) {
enabled = enabled && !settings.getIn(dependsOnNot[i]);
}
}
if (options && options.length > 0) {
const currentValue = settings.getIn(item);
const optionElems = options && options.length > 0 && options.map((opt) => (
<option key={opt.value} selected={currentValue === opt.value} value={opt.value} >
{intl.formatMessage(opt.message)}
</option>
));
return (
<label htmlFor={id}>
<p>{children}</p>
<p>
<select
id={id}
disabled={!enabled}
onBlur={this.handleChange}
>
{optionElems}
</select>
</p>
</label>
);
} else {
return (
<label htmlFor={id}>
<input
id={id}
type='checkbox'
checked={settings.getIn(item)}
onChange={this.handleChange}
disabled={!enabled}
/>
{children}
</label>
);
}
}
}
export default class SettingsModal extends React.PureComponent {
export default class Settings extends React.PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
toggleSetting: PropTypes.func.isRequired,
changeSetting: PropTypes.func.isRequired,
onClose: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
};
state = {
@ -100,6 +29,7 @@ export default class SettingsModal extends React.PureComponent {
};
General = () => {
const { intl } = this.props;
return (
<div>
<h1><FormattedMessage id='settings.general' defaultMessage='General' /></h1>
@ -108,9 +38,9 @@ export default class SettingsModal extends React.PureComponent {
item={['layout']}
id='mastodon-settings--layout'
options={[
{ value: 'auto', message: messages.layout_auto },
{ value: 'multiple', message: messages.layout_desktop },
{ value: 'single', message: messages.layout_mobile },
{ value: 'auto', message: intl.formatMessage(messages.layout_auto) },
{ value: 'multiple', message: intl.formatMessage(messages.layout_desktop) },
{ value: 'single', message: intl.formatMessage(messages.layout_mobile) },
]}
onChange={this.props.changeSetting}
>

+ 79
- 0
app/javascript/glitch/components/settings/item.js View File

@ -0,0 +1,79 @@
// Package imports //
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
export default class SettingsItem extends React.PureComponent {
static propTypes = {
settings: ImmutablePropTypes.map.isRequired,
item: PropTypes.array.isRequired,
id: PropTypes.string.isRequired,
options: PropTypes.arrayOf(PropTypes.shape({
value: PropTypes.string.isRequired,
message: PropTypes.object.isRequired,
})),
dependsOn: PropTypes.array,
dependsOnNot: PropTypes.array,
children: PropTypes.element.isRequired,
onChange: PropTypes.func.isRequired,
};
handleChange = (e) => {
const { item, onChange } = this.props;
onChange(item, e);
}
render () {
const { settings, item, id, options, children, dependsOn, dependsOnNot } = this.props;
let enabled = true;
if (dependsOn) {
for (let i = 0; i < dependsOn.length; i++) {
enabled = enabled && settings.getIn(dependsOn[i]);
}
}
if (dependsOnNot) {
for (let i = 0; i < dependsOnNot.length; i++) {
enabled = enabled && !settings.getIn(dependsOnNot[i]);
}
}
if (options && options.length > 0) {
const currentValue = settings.getIn(item);
const optionElems = options && options.length > 0 && options.map((opt) => (
<option key={opt.value} selected={currentValue === opt.value} value={opt.value} >
{opt.message}
</option>
));
return (
<label htmlFor={id}>
<p>{children}</p>
<p>
<select
id={id}
disabled={!enabled}
onBlur={this.handleChange}
>
{optionElems}
</select>
</p>
</label>
);
} else {
return (
<label htmlFor={id}>
<input
id={id}
type='checkbox'
checked={settings.getIn(item)}
onChange={this.handleChange}
disabled={!enabled}
/>
{children}
</label>
);
}
}
}

app/javascript/mastodon/components/status_action_bar.js → app/javascript/glitch/components/status/action_bar.js View File

@ -1,11 +1,14 @@
// Package imports //
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import IconButton from './icon_button';
import DropdownMenu from './dropdown_menu';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';
import RelativeTimestamp from './relative_timestamp';
// Mastodon imports //
import RelativeTimestamp from '../../../mastodon/components/relative_timestamp';
import IconButton from '../../../mastodon/components/icon_button';
import DropdownMenu from '../../../mastodon/components/dropdown_menu';
const messages = defineMessages({
delete: { id: 'status.delete', defaultMessage: 'Delete' },

app/javascript/mastodon/components/status_content.js → app/javascript/glitch/components/status/content.js View File

@ -1,11 +1,14 @@
// Package imports //
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import escapeTextContentForBrowser from 'escape-html';
import PropTypes from 'prop-types';
import emojify from '../emoji';
import { isRtl } from '../rtl';
import { FormattedMessage } from 'react-intl';
import Permalink from './permalink';
// Mastodon imports //
import emojify from '../../../mastodon/emoji';
import { isRtl } from '../../../mastodon/rtl';
import Permalink from '../../../mastodon/components/permalink';
export default class StatusContent extends React.PureComponent {

+ 79
- 0
app/javascript/glitch/components/status/gallery/index.js View File

@ -0,0 +1,79 @@
// Package imports //
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
// Mastodon imports //
import IconButton from '../../../../mastodon/components/icon_button';
// Our imports //
import StatusGalleryItem from './item';
const messages = defineMessages({
toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: 'Toggle visibility' },
});
@injectIntl
export default class StatusGallery extends React.PureComponent {
static propTypes = {
sensitive: PropTypes.bool,
media: ImmutablePropTypes.list.isRequired,
letterbox: PropTypes.bool,
fullwidth: PropTypes.bool,
height: PropTypes.number.isRequired,
onOpenMedia: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
autoPlayGif: PropTypes.bool.isRequired,
};
state = {
visible: !this.props.sensitive,
};
handleOpen = () => {
this.setState({ visible: !this.state.visible });
}
handleClick = (index) => {
this.props.onOpenMedia(this.props.media, index);
}
render () {
const { media, intl, sensitive, letterbox, fullwidth } = this.props;
let children;
if (!this.state.visible) {
let warning;
if (sensitive) {
warning = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />;
} else {
warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />;
}
children = (
<div role='button' tabIndex='0' className='media-spoiler' onClick={this.handleOpen}>
<span className='media-spoiler__warning'>{warning}</span>
<span className='media-spoiler__trigger'><FormattedMessage id='status.sensitive_toggle' defaultMessage='Click to view' /></span>
</div>
);
} else {
const size = media.take(4).size;
children = media.take(4).map((attachment, i) => <StatusGalleryItem key={attachment.get('id')} onClick={this.handleClick} attachment={attachment} autoPlayGif={this.props.autoPlayGif} index={i} size={size} letterbox={letterbox} />);
}
return (
<div className={`media-gallery ${fullwidth ? 'full-width' : ''}`} style={{ height: `${this.props.height}px` }}>
<div className={`spoiler-button ${this.state.visible ? 'spoiler-button--visible' : ''}`}>
<IconButton title={intl.formatMessage(messages.toggle_visible)} icon={this.state.visible ? 'eye' : 'eye-slash'} overlay onClick={this.handleOpen} />
</div>
{children}
</div>
);
}
}

app/javascript/mastodon/components/media_gallery.js → app/javascript/glitch/components/status/gallery/item.js View File

@ -1,15 +1,12 @@
// Package imports //
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import IconButton from './icon_button';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { isIOS } from '../is_mobile';
const messages = defineMessages({
toggle_visible: { id: 'media_gallery.toggle_visible', defaultMessage: 'Toggle visibility' },
});
// Mastodon imports //
import { isIOS } from '../../../../mastodon/is_mobile';
class Item extends React.PureComponent {
export default class StatusGalleryItem extends React.PureComponent {
static propTypes = {
attachment: ImmutablePropTypes.map.isRequired,
@ -133,67 +130,3 @@ class Item extends React.PureComponent {
}
}
@injectIntl
export default class MediaGallery extends React.PureComponent {
static propTypes = {
sensitive: PropTypes.bool,
media: ImmutablePropTypes.list.isRequired,
letterbox: PropTypes.bool,
fullwidth: PropTypes.bool,
height: PropTypes.number.isRequired,
onOpenMedia: PropTypes.func.isRequired,
intl: PropTypes.object.isRequired,
autoPlayGif: PropTypes.bool.isRequired,
};
state = {
visible: !this.props.sensitive,
};
handleOpen = () => {
this.setState({ visible: !this.state.visible });
}
handleClick = (index) => {
this.props.onOpenMedia(this.props.media, index);
}
render () {
const { media, intl, sensitive, letterbox, fullwidth } = this.props;
let children;
if (!this.state.visible) {
let warning;
if (sensitive) {
warning = <FormattedMessage id='status.sensitive_warning' defaultMessage='Sensitive content' />;
} else {
warning = <FormattedMessage id='status.media_hidden' defaultMessage='Media hidden' />;
}
children = (
<div role='button' tabIndex='0' className='media-spoiler' onClick={this.handleOpen}>
<span className='media-spoiler__warning'>{warning}</span>
<span className='media-spoiler__trigger'><FormattedMessage id='status.sensitive_toggle' defaultMessage='Click to view' /></span>
</div>
);
} else {
const size = media.take(4).size;
children = media.take(4).map((attachment, i) => <Item key={attachment.get('id')} onClick={this.handleClick} attachment={attachment} autoPlayGif={this.props.autoPlayGif} index={i} size={size} letterbox={letterbox} />);
}
return (
<div className={`media-gallery ${fullwidth ? 'full-width' : ''}`} style={{ height: `${this.props.height}px` }}>
<div className={`spoiler-button ${this.state.visible ? 'spoiler-button--visible' : ''}`}>
<IconButton title={intl.formatMessage(messages.toggle_visible)} icon={this.state.visible ? 'eye' : 'eye-slash'} overlay onClick={this.handleOpen} />
</div>
{children}
</div>
);
}
}

app/javascript/mastodon/components/status_header.js → app/javascript/glitch/components/status/header.js View File

@ -18,19 +18,17 @@ Imports:
*/
// Our standard React imports:
// Package imports //
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
// We will need internationalization in this component:
import { defineMessages, injectIntl } from 'react-intl';
// The various components used when constructing our header:
import Avatar from './avatar';
import AvatarOverlay from './avatar_overlay';
import DisplayName from './display_name';
import IconButton from './icon_button';
// Mastodon imports //
import Avatar from '../../../mastodon/components/avatar';
import AvatarOverlay from '../../../mastodon/components/avatar_overlay';
import DisplayName from '../../../mastodon/components/display_name';
import IconButton from '../../../mastodon/components/icon_button';
/* * * * */

app/javascript/mastodon/components/status.js → app/javascript/glitch/components/status/index.js View File

@ -31,27 +31,22 @@ Imports:
*/
// Our standard React imports:
// Package imports //
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
// `ImmutablePureComponent` gives us `updateOnProps` and
// `updateOnStates`:
import ImmutablePureComponent from 'react-immutable-pure-component';
// These are our various media types:
import MediaGallery from './media_gallery';
import VideoPlayer from './video_player';
// These are our core status components:
import StatusPrepend from './status_prepend';
import StatusHeader from './status_header';
import StatusContent from './status_content';
import StatusActionBar from './status_action_bar';
// Mastodon imports //
import scheduleIdleTask from '../../../mastodon/features/ui/util/schedule_idle_task';
// This is used to schedule tasks at the browser's convenience:
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
// Our imports //
import StatusPrepend from './prepend';
import StatusHeader from './header';
import StatusContent from './content';
import StatusActionBar from './action_bar';
import StatusGallery from './gallery';
import StatusVideoPlayer from './video_player';
/* * * * */
@ -622,7 +617,7 @@ backgrounds for collapsed statuses are enabled.
attachments.getIn([0, 'type']) === 'video'
) {
media = ( // Media type is 'video'
<VideoPlayer
<StatusVideoPlayer
media={attachments.get(0)}
sensitive={status.get('sensitive')}
letterbox={settings.getIn(['media', 'letterbox'])}
@ -634,7 +629,7 @@ backgrounds for collapsed statuses are enabled.
mediaIcon = 'video-camera';
} else { // Media type is 'image' or 'gifv'
media = (
<MediaGallery
<StatusGallery
media={attachments}
sensitive={status.get('sensitive')}
letterbox={settings.getIn(['media', 'letterbox'])}

app/javascript/mastodon/components/status_prepend.js → app/javascript/glitch/components/status/prepend.js View File

@ -18,16 +18,16 @@ Imports:
*/
// Our standard React imports:
// Package imports //
import React from 'react';
import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
// This helps us process our text:
import emojify from '../emoji';
import escapeTextContentForBrowser from 'escape-html';
import { FormattedMessage } from 'react-intl';
// Mastodon imports //
import emojify from '../../../mastodon/emoji';
/* * * * */
/*

app/javascript/mastodon/components/video_player.js → app/javascript/glitch/components/status/video_player.js View File

@ -1,9 +1,12 @@
// Package imports //
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import IconButton from './icon_button';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import { isIOS } from '../is_mobile';
// Mastodon imports //
import IconButton from '../../../mastodon/components/icon_button';
import { isIOS } from '../../../mastodon/is_mobile';
const messages = defineMessages({
toggle_sound: { id: 'video_player.toggle_sound', defaultMessage: 'Toggle sound' },
@ -12,7 +15,7 @@ const messages = defineMessages({
});
@injectIntl
export default class VideoPlayer extends React.PureComponent {
export default class StatusVideoPlayer extends React.PureComponent {
static propTypes = {
media: ImmutablePropTypes.map.isRequired,

+ 22
- 0
app/javascript/glitch/containers/compose/advanced_options.js View File

@ -0,0 +1,22 @@
// Package imports //
import { connect } from 'react-redux';
// Mastodon imports //
import { changeComposeAdvancedOption } from '../../../mastodon/actions/compose';
// Our imports //
import ComposeAdvancedOptions from '../../components/compose/advanced_options';
const mapStateToProps = state => ({
values: state.getIn(['compose', 'advanced_options']),
});
const mapDispatchToProps = dispatch => ({
onChange (option) {
dispatch(changeComposeAdvancedOption(option));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(ComposeAdvancedOptions);

app/javascript/mastodon/features/notifications/containers/notification_container.js → app/javascript/glitch/containers/notification/index.js View File

@ -1,6 +1,11 @@
// Package imports //
import { connect } from 'react-redux';
import { makeGetNotification } from '../../../selectors';
import Notification from '../components/notification';
// Mastodon imports //
import { makeGetNotification } from '../../../mastodon/selectors';
// Our imports //
import Notification from '../../components/notification';
const makeMapStateToProps = () => {
const getNotification = makeGetNotification();

app/javascript/mastodon/features/ui/containers/settings_modal_container.js → app/javascript/glitch/containers/settings/index.js View File

@ -1,7 +1,12 @@
// Package imports //
import { connect } from 'react-redux';
import { changeLocalSetting } from '../../../actions/local_settings';
import { closeModal } from '../../../actions/modal';
import SettingsModal from '../components/settings_modal';
// Mastodon imports //
import { closeModal } from '../../../mastodon/actions/modal';
// Our imports //
import { changeLocalSetting } from '../../actions/local_settings';
import Settings from '../../components/settings';
const mapStateToProps = state => ({
settings: state.get('local_settings'),
@ -19,4 +24,4 @@ const mapDispatchToProps = dispatch => ({
},
});
export default connect(mapStateToProps, mapDispatchToProps)(SettingsModal);
export default connect(mapStateToProps, mapDispatchToProps)(Settings);

app/javascript/mastodon/containers/status_container.js → app/javascript/glitch/containers/status/index.js View File

@ -18,45 +18,41 @@ Imports:
*/
// Our standard React/Redux imports:
// Package imports //
import React from 'react';
import { connect } from 'react-redux';
import {
defineMessages,
injectIntl,
FormattedMessage,
} from 'react-intl';
// Our `<Status>`:
import Status from '../components/status';
// This selector helps us get our status from the store:
import { makeGetStatus } from '../selectors';
// These are our various `<Status>`-related actions:
// Mastodon imports //
import { makeGetStatus } from '../../../mastodon/selectors';
import {
replyCompose,
mentionCompose,
} from '../actions/compose';
} from '../../../mastodon/actions/compose';
import {
reblog,
favourite,
unreblog,
unfavourite,
} from '../actions/interactions';
} from '../../../mastodon/actions/interactions';
import {
blockAccount,
muteAccount,
} from '../actions/accounts';
} from '../../../mastodon/actions/accounts';
import {
muteStatus,
unmuteStatus,
deleteStatus,
} from '../actions/statuses';
import { initReport } from '../actions/reports';
import { openModal } from '../actions/modal';
} from '../../../mastodon/actions/statuses';
import { initReport } from '../../../mastodon/actions/reports';
import { openModal } from '../../../mastodon/actions/modal';
// We will need internationalization in this component:
import {
defineMessages,
injectIntl,
FormattedMessage,
} from 'react-intl';
// Our imports //
import Status from '../../components/status';
/* * * * */

app/javascript/mastodon/reducers/local_settings.js → app/javascript/glitch/reducers/local_settings.js View File

@ -1,7 +1,12 @@
import { LOCAL_SETTING_CHANGE } from '../actions/local_settings';
import { STORE_HYDRATE } from '../actions/store';
// Package imports //
import Immutable from 'immutable';
// Mastodon imports //
import { STORE_HYDRATE } from '../../mastodon/actions/store';
// Our imports //
import { LOCAL_SETTING_CHANGE } from '../actions/local_settings';
const initialState = Immutable.fromJS({
layout : 'auto',
stretch : true,

app/javascript/mastodon/features/account/util/bio_metadata.js → app/javascript/glitch/util/bio_metadata.js View File


+ 1
- 1
app/javascript/mastodon/components/status_list.js View File

@ -2,7 +2,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { ScrollContainer } from 'react-router-scroll';
import PropTypes from 'prop-types';
import StatusContainer from '../containers/status_container';
import StatusContainer from '../../glitch/containers/status';
import LoadMore from './load_more';
import ImmutablePureComponent from 'react-immutable-pure-component';
import IntersectionObserverWrapper from '../features/ui/util/intersection_observer_wrapper';

+ 1
- 1
app/javascript/mastodon/features/account_timeline/components/header.js View File

@ -1,7 +1,7 @@
import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import InnerHeader from '../../account/components/header';
import InnerHeader from '../../../../glitch/components/account/header';
import ActionBar from '../../account/components/action_bar';
import MissingIndicator from '../../../components/missing_indicator';
import ImmutablePureComponent from 'react-immutable-pure-component';

+ 2
- 2
app/javascript/mastodon/features/compose/components/compose_form.js View File

@ -11,7 +11,7 @@ import { defineMessages, injectIntl } from 'react-intl';
import Collapsable from '../../../components/collapsable';
import SpoilerButtonContainer from '../containers/spoiler_button_container';
import PrivacyDropdownContainer from '../containers/privacy_dropdown_container';
import AdvancedOptionsContainer from '../containers/advanced_options_container';
import ComposeAdvancedOptionsContainer from '../../../../glitch/containers/compose/advanced_options';
import SensitiveButtonContainer from '../containers/sensitive_button_container';
import EmojiPickerDropdown from './emoji_picker_dropdown';
import UploadFormContainer from '../containers/upload_form_container';
@ -196,7 +196,7 @@ export default class ComposeForm extends ImmutablePureComponent {
<div className='compose-form__buttons'>
<UploadButtonContainer />
<PrivacyDropdownContainer />
<AdvancedOptionsContainer />
<ComposeAdvancedOptionsContainer />
<SensitiveButtonContainer />
<SpoilerButtonContainer />
</div>

+ 1
- 1
app/javascript/mastodon/features/compose/components/search_results.js View File

@ -2,7 +2,7 @@ import React from 'react';
import ImmutablePropTypes from 'react-immutable-proptypes';
import { FormattedMessage } from 'react-intl';
import AccountContainer from '../../../containers/account_container';
import StatusContainer from '../../../containers/status_container';
import StatusContainer from '../../../../glitch/containers/status';
import Link from 'react-router-dom/Link';
import ImmutablePureComponent from 'react-immutable-pure-component';

+ 0
- 17
app/javascript/mastodon/features/compose/containers/advanced_options_container.js View File

@ -1,17 +0,0 @@
import { connect } from 'react-redux';
import AdvancedOptionsDropdown from '../components/advanced_options_dropdown';
import { changeComposeAdvancedOption } from '../../../actions/compose';
const mapStateToProps = state => ({
values: state.getIn(['compose', 'advanced_options']),
});
const mapDispatchToProps = dispatch => ({
onChange (option) {
dispatch(changeComposeAdvancedOption(option));
},
});
export default connect(mapStateToProps, mapDispatchToProps)(AdvancedOptionsDropdown);

+ 1
- 1
app/javascript/mastodon/features/compose/index.js View File

@ -5,7 +5,7 @@ import PropTypes from 'prop-types';
import { connect } from 'react-redux';
import { mountCompose, unmountCompose } from '../../actions/compose';
import { openModal } from '../../actions/modal';
import { changeLocalSetting } from '../../actions/local_settings';
import { changeLocalSetting } from '../../../glitch/actions/local_settings';
import Link from 'react-router-dom/Link';
import { injectIntl, defineMessages } from 'react-intl';
import SearchContainer from './containers/search_container';

+ 1
- 1
app/javascript/mastodon/features/notifications/index.js View File

@ -6,7 +6,7 @@ import Column from '../../components/column';
import ColumnHeader from '../../components/column_header';
import { expandNotifications, scrollTopNotifications } from '../../actions/notifications';
import { addColumn, removeColumn, moveColumn } from '../../actions/columns';
import NotificationContainer from './containers/notification_container';
import NotificationContainer from '../../../glitch/containers/notification';
import { ScrollContainer } from 'react-router-scroll';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import ColumnSettingsContainer from './containers/column_settings_container';

+ 5
- 5
app/javascript/mastodon/features/status/components/detailed_status.js View File

@ -3,9 +3,9 @@ import PropTypes from 'prop-types';
import ImmutablePropTypes from 'react-immutable-proptypes';
import Avatar from '../../../components/avatar';
import DisplayName from '../../../components/display_name';
import StatusContent from '../../../components/status_content';
import MediaGallery from '../../../components/media_gallery';
import VideoPlayer from '../../../components/video_player';
import StatusContent from '../../../../glitch/components/status/content';
import StatusGallery from '../../../../glitch/components/status/gallery';
import StatusVideoPlayer from '../../../../glitch/components/status/video_player';
import AttachmentList from '../../../components/attachment_list';
import Link from 'react-router-dom/Link';
import { FormattedDate, FormattedNumber } from 'react-intl';
@ -48,7 +48,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
media = <AttachmentList media={status.get('media_attachments')} />;
} else if (status.getIn(['media_attachments', 0, 'type']) === 'video') {
media = (
<VideoPlayer
<StatusVideoPlayer
sensitive={status.get('sensitive')}
media={status.getIn(['media_attachments', 0])}
letterbox={settings.getIn(['media', 'letterbox'])}
@ -60,7 +60,7 @@ export default class DetailedStatus extends ImmutablePureComponent {
mediaIcon = 'video-camera';
} else {
media = (
<MediaGallery
<StatusGallery
sensitive={status.get('sensitive')}
media={status.get('media_attachments')}
letterbox={settings.getIn(['media', 'letterbox'])}

+ 1
- 1
app/javascript/mastodon/features/status/index.js View File

@ -22,7 +22,7 @@ import { initReport } from '../../actions/reports';
import { makeGetStatus } from '../../selectors';
import { ScrollContainer } from 'react-router-scroll';
import ColumnBackButton from '../../components/column_back_button';
import StatusContainer from '../../containers/status_container';
import StatusContainer from '../../../glitch/containers/status';
import { openModal } from '../../actions/modal';
import { defineMessages, injectIntl } from 'react-intl';
import ImmutablePureComponent from 'react-immutable-pure-component';

+ 1
- 1
app/javascript/mastodon/features/ui/components/boost_modal.js View File

@ -3,7 +3,7 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
import PropTypes from 'prop-types';
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
import Button from '../../../components/button';
import StatusContent from '../../../components/status_content';
import StatusContent from '../../../../glitch/components/status/content';
import Avatar from '../../../components/avatar';
import RelativeTimestamp from '../../../components/relative_timestamp';
import DisplayName from '../../../components/display_name';

+ 2
- 2
app/javascript/mastodon/features/ui/components/modal_root.js View File

@ -6,7 +6,7 @@ import VideoModal from './video_modal';
import BoostModal from './boost_modal';
import ConfirmationModal from './confirmation_modal';
import ReportModal from './report_modal';
import SettingsModal from '../containers/settings_modal_container';
import SettingsContainer from '../../../../glitch/containers/settings';
import TransitionMotion from 'react-motion/lib/TransitionMotion';
import spring from 'react-motion/lib/spring';
@ -17,7 +17,7 @@ const MODAL_COMPONENTS = {
'BOOST': BoostModal,
'CONFIRM': ConfirmationModal,
'REPORT': ReportModal,
'SETTINGS': SettingsModal,
'SETTINGS': SettingsContainer,
};
export default class ModalRoot extends React.PureComponent {

+ 1
- 1
app/javascript/mastodon/reducers/index.js View File

@ -14,7 +14,7 @@ import relationships from './relationships';
import search from './search';
import notifications from './notifications';
import settings from './settings';
import local_settings from './local_settings';
import local_settings from '../../glitch/reducers/local_settings';
import status_lists from './status_lists';
import cards from './cards';
import reports from './reports';

+ 1
- 1
app/javascript/packs/public.js View File

@ -4,7 +4,7 @@ import { delegate } from 'rails-ujs';
import emojify from '../mastodon/emoji';
import { getLocale } from '../mastodon/locales';
import loadPolyfills from '../mastodon/load_polyfills';
import { processBio } from '../mastodon/features/account/util/bio_metadata';
import { processBio } from '../glitch/util/bio_metadata';
require.context('../images/', true);

Loading…
Cancel
Save