pleroma/priv/static/packs/features/community_timeline.js.map
Haelwenn (lanodan) Monnier 83e3afac2c Update mastodon frontend
2018-09-20 16:13:13 +00:00

1 line
No EOL
8.9 KiB
Text

{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/community_timeline/containers/column_settings_container.js","webpack:///./app/javascript/mastodon/features/community_timeline/index.js"],"names":["column_settings_container","Object","es","state","_ref","uuid","columnId","columns","getIn","index","findIndex","c","get","settings","dispatch","_ref2","onChange","key","checked","concat","column_settings","messages","index_es","title","id","defaultMessage","community_timeline_CommunityTimeline","onlyMedia","hasUnread","handlePin","_this$props","_this","props","other","handleMove","dir","_this$props2","handleHeaderClick","column","scrollTop","setRef","handleLoadMore","maxId","_this$props3","timelines","componentDidMount","_props","this","disconnect","streaming","componentDidUpdate","prevProps","_props2","componentWillUnmount","render","_props3","intl","shouldUpdateScroll","multiColumn","pinned","react_default","a","createElement","ref","label","formatMessage","jsx_default","column_header","icon","active","onPin","onMove","onClick","status_list_container","trackScroll","scrollKey","timelineId","onLoadMore","emptyMessage","PureComponent","contextTypes","router","prop_types_default","object","defaultProps"],"mappings":"qRA2BAA,EAAeC,OAAAC,EAAA,QAAAD,CAtBS,SAACE,EAADC,GAAyB,IACzCC,EADyCD,EAAfE,SAE1BC,EAAUJ,EAAMK,OAAO,WAAY,YACnCC,EAAQF,EAAQG,UAAU,SAAAC,GAAA,OAAKA,EAAEC,IAAI,UAAYP,IAEvD,OACEQ,SAAWR,GAAQI,GAAS,EAAKF,EAAQK,IAAIH,GAAOG,IAAI,UAAYT,EAAMK,OAAO,WAAY,gBAItE,SAACM,EAADC,GAA4B,IAAfT,EAAeS,EAAfT,SACtC,OACEU,SADK,SACKC,EAAKC,GAEXJ,EADER,EACOL,OAAAM,EAAA,EAAAN,CAAmBK,EAAUW,EAAKC,GAElCjB,OAAAY,EAAA,EAAAZ,EAAe,aAAfkB,OAA+BF,GAAMC,OAMtD,CAA4DE,EAAA,iDCf5D,IAAMC,EAAWpB,OAAAqB,EA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community_timeline.js","sourcesContent":["import { connect } from 'react-redux';\nimport ColumnSettings from '../components/column_settings';\nimport { changeSetting } from '../../../actions/settings';\nimport { changeColumnParams } from '../../../actions/columns';\n\nconst mapStateToProps = (state, { columnId }) => {\n const uuid = columnId;\n const columns = state.getIn(['settings', 'columns']);\n const index = columns.findIndex(c => c.get('uuid') === uuid);\n\n return {\n settings: (uuid && index >= 0) ? columns.get(index).get('params') : state.getIn(['settings', 'community']),\n };\n};\n\nconst mapDispatchToProps = (dispatch, { columnId }) => {\n return {\n onChange (key, checked) {\n if (columnId) {\n dispatch(changeColumnParams(columnId, key, checked));\n } else {\n dispatch(changeSetting(['community', ...key], checked));\n }\n },\n };\n};\n\nexport default connect(mapStateToProps, mapDispatchToProps)(ColumnSettings);\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport { defineMessages, injectIntl, FormattedMessage } from 'react-intl';\nimport PropTypes from 'prop-types';\nimport StatusListContainer from '../ui/containers/status_list_container';\nimport Column from '../../components/column';\nimport ColumnHeader from '../../components/column_header';\nimport { expandCommunityTimeline } from '../../actions/timelines';\nimport { addColumn, removeColumn, moveColumn } from '../../actions/columns';\nimport ColumnSettingsContainer from './containers/column_settings_container';\nimport { connectCommunityStream } from '../../actions/streaming';\n\nconst messages = defineMessages({\n title: { id: 'column.community', defaultMessage: 'Local timeline' },\n});\n\nconst mapStateToProps = (state, { onlyMedia, columnId }) => {\n const uuid = columnId;\n const columns = state.getIn(['settings', 'columns']);\n const index = columns.findIndex(c => c.get('uuid') === uuid);\n\n return {\n hasUnread: state.getIn(['timelines', `community${onlyMedia ? ':media' : ''}`, 'unread']) > 0,\n onlyMedia: (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyMedia']) : state.getIn(['settings', 'community', 'other', 'onlyMedia']),\n };\n};\n\n@connect(mapStateToProps)\n@injectIntl\nexport default class CommunityTimeline extends React.PureComponent {\n\n static contextTypes = {\n router: PropTypes.object,\n };\n\n static defaultProps = {\n onlyMedia: false,\n };\n\n static propTypes = {\n dispatch: PropTypes.func.isRequired,\n shouldUpdateScroll: PropTypes.func,\n columnId: PropTypes.string,\n intl: PropTypes.object.isRequired,\n hasUnread: PropTypes.bool,\n multiColumn: PropTypes.bool,\n onlyMedia: PropTypes.bool,\n };\n\n handlePin = () => {\n const { columnId, dispatch, onlyMedia } = this.props;\n\n if (columnId) {\n dispatch(removeColumn(columnId));\n } else {\n dispatch(addColumn('COMMUNITY', { other: { onlyMedia } }));\n }\n }\n\n handleMove = (dir) => {\n const { columnId, dispatch } = this.props;\n dispatch(moveColumn(columnId, dir));\n }\n\n handleHeaderClick = () => {\n this.column.scrollTop();\n }\n\n componentDidMount () {\n const { dispatch, onlyMedia } = this.props;\n\n dispatch(expandCommunityTimeline({ onlyMedia }));\n this.disconnect = dispatch(connectCommunityStream({ onlyMedia }));\n }\n\n componentDidUpdate (prevProps) {\n if (prevProps.onlyMedia !== this.props.onlyMedia) {\n const { dispatch, onlyMedia } = this.props;\n\n this.disconnect();\n dispatch(expandCommunityTimeline({ onlyMedia }));\n this.disconnect = dispatch(connectCommunityStream({ onlyMedia }));\n }\n }\n\n componentWillUnmount () {\n if (this.disconnect) {\n this.disconnect();\n this.disconnect = null;\n }\n }\n\n setRef = c => {\n this.column = c;\n }\n\n handleLoadMore = maxId => {\n const { dispatch, onlyMedia } = this.props;\n\n dispatch(expandCommunityTimeline({ maxId, onlyMedia }));\n }\n\n render () {\n const { intl, shouldUpdateScroll, hasUnread, columnId, multiColumn, onlyMedia } = this.props;\n const pinned = !!columnId;\n\n return (\n <Column ref={this.setRef} label={intl.formatMessage(messages.title)}>\n <ColumnHeader\n icon='users'\n active={hasUnread}\n title={intl.formatMessage(messages.title)}\n onPin={this.handlePin}\n onMove={this.handleMove}\n onClick={this.handleHeaderClick}\n pinned={pinned}\n multiColumn={multiColumn}\n >\n <ColumnSettingsContainer columnId={columnId} />\n </ColumnHeader>\n\n <StatusListContainer\n trackScroll={!pinned}\n scrollKey={`community_timeline-${columnId}`}\n timelineId={`community${onlyMedia ? ':media' : ''}`}\n onLoadMore={this.handleLoadMore}\n emptyMessage={<FormattedMessage id='empty_column.community' defaultMessage='The local timeline is empty. Write something publicly to get the ball rolling!' />}\n shouldUpdateScroll={shouldUpdateScroll}\n />\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""}