X-Git-Url: https://git.squeep.com/?a=blobdiff_plain;ds=sidebyside;f=priv%2Fstatic%2Fpacks%2Ffeatures%2Faccount_gallery.js.map;h=c3ca6a4d6697020089c164fed9a510b9704a5730;hb=2286f62a36a0f5d738892a9283a696b8a45b45a6;hp=811c33ef6a572ce85e35dc27e00eacec44c8d09e;hpb=ac72b578da673282b927b945bfe03cd3012444b6;p=akkoma
diff --git a/priv/static/packs/features/account_gallery.js.map b/priv/static/packs/features/account_gallery.js.map
index 811c33ef6..c3ca6a4d6 100644
--- a/priv/static/packs/features/account_gallery.js.map
+++ b/priv/static/packs/features/account_gallery.js.map
@@ -1 +1 @@
-{"version":3,"sources":["webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/account_gallery/components/media_item.js","webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/account_gallery/index.js"],"names":["MediaItem","visible","displayMedia","_this","props","media","getIn","state","setState","render","label","icon","this","status","get","x","y","style","Object","jsx","className","backgroundImage","backgroundPosition","components_icon","id","permalink","to","href","onInterceptClick","handleClick","ImmutablePureComponent","ImmutablePropTypes","map","isRequired","LoadMoreMedia","onLoadMore","maxId","load_more","disabled","onClick","handleLoadMore","shouldUpdateScroll","PropTypes","func","string","AccountGallery","connect","medias","getAccountGallery","params","accountId","isLoading","hasMore","_this2","size","last","undefined","e","_e$target","target","scrollTop","scrollHeight","clientHeight","handleScrollToBottom","dispatch","expandAccountMediaTimeline","preventDefault","componentDidMount","fetchAccount","componentWillReceiveProps","nextProps","_this3","_this$props","loadOlder","column","loading_indicator","handleLoadOlder","column_back_button","react_router_scroll_4_es","scrollKey","onScroll","handleScroll","header_container","role","index","account_gallery_LoadMoreMedia","media_item_MediaItem","object","list","bool"],"mappings":"uQAOqBA,qMAMX,CACNC,QAA0B,aAAjBC,MAAgCC,EAAKC,MAAMC,MAAMC,MAAM,CAAC,SAAU,eAAkC,aAAjBJ,4DAGhF,WACZ,OAAKC,EAAKI,MAAMN,UACdE,EAAK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AWT,IAAU+C,KACrBrC,QAASV,IAAU+C","file":"features/account_gallery.js","sourcesContent":["import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport Permalink from '../../../components/permalink';\nimport { displayMedia } from '../../../initial_state';\nimport Icon from 'mastodon/components/icon';\n\nexport default class MediaItem extends ImmutablePureComponent {\n\n static propTypes = {\n media: ImmutablePropTypes.map.isRequired,\n };\n\n state = {\n visible: displayMedia !== 'hide_all' && !this.props.media.getIn(['status', 'sensitive']) || displayMedia === 'show_all',\n };\n\n handleClick = () => {\n if (!this.state.visible) {\n this.setState({ visible: true });\n return true;\n }\n\n return false;\n }\n\n render () {\n const { media } = this.props;\n const { visible } = this.state;\n const status = media.get('status');\n const focusX = media.getIn(['meta', 'focus', 'x']);\n const focusY = media.getIn(['meta', 'focus', 'y']);\n const x = ((focusX / 2) + .5) * 100;\n const y = ((focusY / -2) + .5) * 100;\n const style = {};\n\n let label, icon;\n\n if (media.get('type') === 'gifv') {\n label = GIF;\n }\n\n if (visible) {\n style.backgroundImage = `url(${media.get('preview_url')})`;\n style.backgroundPosition = `${x}% ${y}%`;\n } else {\n icon = (\n \n \n \n );\n }\n\n return (\n
\n
\n {icon}\n {label}\n \n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport { fetchAccount } from '../../actions/accounts';\nimport { expandAccountMediaTimeline } from '../../actions/timelines';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport Column from '../ui/components/column';\nimport ColumnBackButton from '../../components/column_back_button';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { getAccountGallery } from '../../selectors';\nimport MediaItem from './components/media_item';\nimport HeaderContainer from '../account_timeline/containers/header_container';\nimport { ScrollContainer } from 'react-router-scroll-4';\nimport LoadMore from '../../components/load_more';\n\nconst mapStateToProps = (state, props) => ({\n medias: getAccountGallery(state, props.params.accountId),\n isLoading: state.getIn(['timelines', `account:${props.params.accountId}:media`, 'isLoading']),\n hasMore: state.getIn(['timelines', `account:${props.params.accountId}:media`, 'hasMore']),\n});\n\nclass LoadMoreMedia extends ImmutablePureComponent {\n\n static propTypes = {\n shouldUpdateScroll: PropTypes.func,\n maxId: PropTypes.string,\n onLoadMore: PropTypes.func.isRequired,\n };\n\n handleLoadMore = () => {\n this.props.onLoadMore(this.props.maxId);\n }\n\n render () {\n return (\n \n );\n }\n\n}\n\nexport default @connect(mapStateToProps)\nclass AccountGallery extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n medias: ImmutablePropTypes.list.isRequired,\n isLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n };\n\n componentDidMount () {\n this.props.dispatch(fetchAccount(this.props.params.accountId));\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId));\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {\n this.props.dispatch(fetchAccount(nextProps.params.accountId));\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId));\n }\n }\n\n handleScrollToBottom = () => {\n if (this.props.hasMore) {\n this.handleLoadMore(this.props.medias.size > 0 ? this.props.medias.last().getIn(['status', 'id']) : undefined);\n }\n }\n\n handleScroll = (e) => {\n const { scrollTop, scrollHeight, clientHeight } = e.target;\n const offset = scrollHeight - scrollTop - clientHeight;\n\n if (150 > offset && !this.props.isLoading) {\n this.handleScrollToBottom();\n }\n }\n\n handleLoadMore = maxId => {\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId, { maxId }));\n };\n\n handleLoadOlder = (e) => {\n e.preventDefault();\n this.handleScrollToBottom();\n }\n\n render () {\n const { medias, shouldUpdateScroll, isLoading, hasMore } = this.props;\n\n let loadOlder = null;\n\n if (!medias && isLoading) {\n return (\n \n \n \n );\n }\n\n if (hasMore && !(isLoading && medias.size === 0)) {\n loadOlder = ;\n }\n\n return (\n \n \n\n \n \n
\n\n
\n {medias.map((media, index) => media === null ? (\n 0 ? medias.getIn(index - 1, 'id') : null}\n onLoadMore={this.handleLoadMore}\n />\n ) : (\n \n ))}\n {loadOlder}\n
\n\n {isLoading && medias.size === 0 && (\n
\n \n
\n )}\n
\n \n \n );\n }\n\n}\n"],"sourceRoot":""}
\ No newline at end of file
+{"version":3,"sources":["webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/account_gallery/components/media_item.js","webpack:///app/javascript/builds/pleroma/mastofe/app/javascript/mastodon/features/account_gallery/index.js"],"names":["MediaItem","visible","displayMedia","_this","props","media","getIn","state","setState","render","label","icon","this","status","get","x","y","style","Object","jsx","className","backgroundImage","backgroundPosition","components_icon","id","permalink","to","href","onInterceptClick","handleClick","ImmutablePureComponent","ImmutablePropTypes","map","isRequired","LoadMoreMedia","onLoadMore","maxId","load_more","disabled","onClick","handleLoadMore","shouldUpdateScroll","PropTypes","func","string","AccountGallery","connect","isAccount","params","accountId","medias","getAccountGallery","isLoading","hasMore","_this2","size","last","undefined","e","_e$target","target","scrollTop","scrollHeight","clientHeight","handleScrollToBottom","dispatch","expandAccountMediaTimeline","preventDefault","componentDidMount","fetchAccount","componentWillReceiveProps","nextProps","_this3","_this$props","column","missing_indicator","loadOlder","loading_indicator","handleLoadOlder","column_back_button","react_router_scroll_4_es","scrollKey","onScroll","handleScroll","header_container","role","index","account_gallery_LoadMoreMedia","media_item_MediaItem","object","list","bool"],"mappings":"uQAOqBA,wLAMX,CACNC,QAA0B,aAAjBC,MAAgCC,EAAKC,MAAMC,MAAMC,MAAM,CAAC,SAAU,eAAkC,aAAjBJ,+CAGhF,WACZ,OAAKC,EAAKI,MAAMN,UACdE,EAAKK,SAAS,CAAEP,SAAS,KAClB,2CAMXQ,OAAA,WAAU,IAUJC,EAAOC,EATHN,EAAUO,KAAKR,MAAfC,MACAJ,EAAYW,KAAKL,MAAjBN,QACFY,EA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C,KAAKV,WACzBiB,OAAQnB,IAAmB2D,KAAKzD,WAChCmB,UAAWV,IAAUiD,KACrBtC,QAASX,IAAUiD,KACnB5C,UAAWL,IAAUiD","file":"features/account_gallery.js","sourcesContent":["import React from 'react';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport Permalink from '../../../components/permalink';\nimport { displayMedia } from '../../../initial_state';\nimport Icon from 'mastodon/components/icon';\n\nexport default class MediaItem extends ImmutablePureComponent {\n\n static propTypes = {\n media: ImmutablePropTypes.map.isRequired,\n };\n\n state = {\n visible: displayMedia !== 'hide_all' && !this.props.media.getIn(['status', 'sensitive']) || displayMedia === 'show_all',\n };\n\n handleClick = () => {\n if (!this.state.visible) {\n this.setState({ visible: true });\n return true;\n }\n\n return false;\n }\n\n render () {\n const { media } = this.props;\n const { visible } = this.state;\n const status = media.get('status');\n const focusX = media.getIn(['meta', 'focus', 'x']);\n const focusY = media.getIn(['meta', 'focus', 'y']);\n const x = ((focusX / 2) + .5) * 100;\n const y = ((focusY / -2) + .5) * 100;\n const style = {};\n\n let label, icon;\n\n if (media.get('type') === 'gifv') {\n label = GIF;\n }\n\n if (visible) {\n style.backgroundImage = `url(${media.get('preview_url')})`;\n style.backgroundPosition = `${x}% ${y}%`;\n } else {\n icon = (\n \n \n \n );\n }\n\n return (\n \n
\n {icon}\n {label}\n \n
\n );\n }\n\n}\n","import React from 'react';\nimport { connect } from 'react-redux';\nimport ImmutablePropTypes from 'react-immutable-proptypes';\nimport PropTypes from 'prop-types';\nimport { fetchAccount } from '../../actions/accounts';\nimport { expandAccountMediaTimeline } from '../../actions/timelines';\nimport LoadingIndicator from '../../components/loading_indicator';\nimport Column from '../ui/components/column';\nimport ColumnBackButton from '../../components/column_back_button';\nimport ImmutablePureComponent from 'react-immutable-pure-component';\nimport { getAccountGallery } from '../../selectors';\nimport MediaItem from './components/media_item';\nimport HeaderContainer from '../account_timeline/containers/header_container';\nimport { ScrollContainer } from 'react-router-scroll-4';\nimport LoadMore from '../../components/load_more';\nimport MissingIndicator from 'mastodon/components/missing_indicator';\n\nconst mapStateToProps = (state, props) => ({\n isAccount: !!state.getIn(['accounts', props.params.accountId]),\n medias: getAccountGallery(state, props.params.accountId),\n isLoading: state.getIn(['timelines', `account:${props.params.accountId}:media`, 'isLoading']),\n hasMore: state.getIn(['timelines', `account:${props.params.accountId}:media`, 'hasMore']),\n});\n\nclass LoadMoreMedia extends ImmutablePureComponent {\n\n static propTypes = {\n shouldUpdateScroll: PropTypes.func,\n maxId: PropTypes.string,\n onLoadMore: PropTypes.func.isRequired,\n };\n\n handleLoadMore = () => {\n this.props.onLoadMore(this.props.maxId);\n }\n\n render () {\n return (\n \n );\n }\n\n}\n\nexport default @connect(mapStateToProps)\nclass AccountGallery extends ImmutablePureComponent {\n\n static propTypes = {\n params: PropTypes.object.isRequired,\n dispatch: PropTypes.func.isRequired,\n medias: ImmutablePropTypes.list.isRequired,\n isLoading: PropTypes.bool,\n hasMore: PropTypes.bool,\n isAccount: PropTypes.bool,\n };\n\n componentDidMount () {\n this.props.dispatch(fetchAccount(this.props.params.accountId));\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId));\n }\n\n componentWillReceiveProps (nextProps) {\n if (nextProps.params.accountId !== this.props.params.accountId && nextProps.params.accountId) {\n this.props.dispatch(fetchAccount(nextProps.params.accountId));\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId));\n }\n }\n\n handleScrollToBottom = () => {\n if (this.props.hasMore) {\n this.handleLoadMore(this.props.medias.size > 0 ? this.props.medias.last().getIn(['status', 'id']) : undefined);\n }\n }\n\n handleScroll = (e) => {\n const { scrollTop, scrollHeight, clientHeight } = e.target;\n const offset = scrollHeight - scrollTop - clientHeight;\n\n if (150 > offset && !this.props.isLoading) {\n this.handleScrollToBottom();\n }\n }\n\n handleLoadMore = maxId => {\n this.props.dispatch(expandAccountMediaTimeline(this.props.params.accountId, { maxId }));\n };\n\n handleLoadOlder = (e) => {\n e.preventDefault();\n this.handleScrollToBottom();\n }\n\n render () {\n const { medias, shouldUpdateScroll, isLoading, hasMore, isAccount } = this.props;\n\n if (!isAccount) {\n return (\n \n \n \n );\n }\n\n let loadOlder = null;\n\n if (!medias && isLoading) {\n return (\n \n \n \n );\n }\n\n if (hasMore && !(isLoading && medias.size === 0)) {\n loadOlder = ;\n }\n\n return (\n \n \n\n \n \n
\n\n
\n {medias.map((media, index) => media === null ? (\n 0 ? medias.getIn(index - 1, 'id') : null}\n onLoadMore={this.handleLoadMore}\n />\n ) : (\n \n ))}\n {loadOlder}\n
\n\n {isLoading && medias.size === 0 && (\n
\n \n
\n )}\n
\n \n \n );\n }\n\n}\n"],"sourceRoot":""}
\ No newline at end of file