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

1 line
No EOL
9.4 KiB
Text

{"version":3,"sources":["webpack:///./app/javascript/mastodon/features/public_timeline/containers/column_settings_container.js","webpack:///./app/javascript/mastodon/features/public_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","public_timeline_PublicTimeline","onlyMedia","hasUnread","handlePin","_this$props","_this","props","other","handleMove","dir","_this$props2","handleHeaderClick","column","scrollTop","setRef","handleLoadMore","maxId","_this$props3","timelines","handleSettingChanged","context","router","history","replace","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","timelineId","onLoadMore","trackScroll","scrollKey","emptyMessage","PureComponent","contextTypes","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,aAItE,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,UAAfkB,OAA4BF,GAAMC,OAMnD,CAA4DE,EAAA,iDCf5D,IAAMC,EA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B,EAjBlBkB,UAAA,mBAkBkC5E,EAlBlC6E,aAAAZ,IAmBmBjD,EAAA,GAnBnBE,GAmBuC,sBAnBvCC,eAmB4E,iHAnB5EqC,mBAoBwBA,SAzGcG,EAAAC,EAAMkB,iBAEzCC,cACLtC,OAAQuC,EAAApB,EAAUqB,UAGbC,cACL7D,WAAW","file":"features/public_timeline.js","sourcesContent":["import { connect } from 'react-redux';\nimport ColumnSettings from '../../community_timeline/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', 'public']),\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(['public', ...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 { expandPublicTimeline } from '../../actions/timelines';\nimport { addColumn, removeColumn, moveColumn } from '../../actions/columns';\nimport ColumnSettingsContainer from './containers/column_settings_container';\nimport { connectPublicStream } from '../../actions/streaming';\n\nconst messages = defineMessages({\n title: { id: 'column.public', defaultMessage: 'Federated 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', `public${onlyMedia ? ':media' : ''}`, 'unread']) > 0,\n onlyMedia: (columnId && index >= 0) ? columns.get(index).getIn(['params', 'other', 'onlyMedia']) : state.getIn(['settings', 'public', 'other', 'onlyMedia']),\n };\n};\n\n@connect(mapStateToProps)\n@injectIntl\nexport default class PublicTimeline 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 intl: PropTypes.object.isRequired,\n columnId: PropTypes.string,\n multiColumn: PropTypes.bool,\n hasUnread: 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('PUBLIC', { 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(expandPublicTimeline({ onlyMedia }));\n this.disconnect = dispatch(connectPublicStream({ 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(expandPublicTimeline({ onlyMedia }));\n this.disconnect = dispatch(connectPublicStream({ 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(expandPublicTimeline({ maxId, onlyMedia }));\n }\n\n handleSettingChanged = (key, checked) => {\n const { columnId } = this.props;\n if (!columnId && key[0] === 'other' && key[1] === 'onlyMedia') {\n this.context.router.history.replace(`/timelines/public${checked ? '/media' : ''}`);\n }\n }\n\n render () {\n const { intl, shouldUpdateScroll, columnId, hasUnread, 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='globe'\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 onChange={this.handleSettingChanged} columnId={columnId} />\n </ColumnHeader>\n\n <StatusListContainer\n timelineId={`public${onlyMedia ? ':media' : ''}`}\n onLoadMore={this.handleLoadMore}\n trackScroll={!pinned}\n scrollKey={`public_timeline-${columnId}`}\n emptyMessage={<FormattedMessage id='empty_column.public' defaultMessage='There is nothing here! Write something publicly, or manually follow users from other instances to fill it up' />}\n shouldUpdateScroll={shouldUpdateScroll}\n />\n </Column>\n );\n }\n\n}\n"],"sourceRoot":""}