mirror of
https://framagit.org/tykayn/mastodon.git
synced 2023-08-25 08:33:12 +02:00
hop
This commit is contained in:
parent
27fe6cb789
commit
bf965b4d3e
@ -106,7 +106,7 @@ export function fetchAccount(id) {
|
|||||||
dispatch,
|
dispatch,
|
||||||
getState,
|
getState,
|
||||||
db.transaction('accounts', 'read').objectStore('accounts').index('id'),
|
db.transaction('accounts', 'read').objectStore('accounts').index('id'),
|
||||||
id
|
id,
|
||||||
).then(() => db.close(), error => {
|
).then(() => db.close(), error => {
|
||||||
db.close();
|
db.close();
|
||||||
throw error;
|
throw error;
|
||||||
|
@ -121,11 +121,11 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
className='text-btn column-header__setting-btn'
|
className='text-btn column-header__setting-btn'
|
||||||
onClick={this.handlePin}
|
onClick={this.handlePin}
|
||||||
><Icon
|
><Icon
|
||||||
id='times'
|
id='times'
|
||||||
/> <FormattedMessage
|
/> <FormattedMessage
|
||||||
id='column_header.unpin'
|
id='column_header.unpin'
|
||||||
defaultMessage='Unpin'
|
defaultMessage='Unpin'
|
||||||
/></button >);
|
/></button >);
|
||||||
|
|
||||||
moveButtons = (
|
moveButtons = (
|
||||||
<div
|
<div
|
||||||
@ -138,7 +138,7 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
className='text-btn column-header__setting-btn'
|
className='text-btn column-header__setting-btn'
|
||||||
onClick={this.handleMoveLeft}
|
onClick={this.handleMoveLeft}
|
||||||
><Icon
|
><Icon
|
||||||
id='chevron-left'
|
id='chevron-left'
|
||||||
/></button >
|
/></button >
|
||||||
<button
|
<button
|
||||||
title={formatMessage(messages.moveRight)}
|
title={formatMessage(messages.moveRight)}
|
||||||
@ -146,7 +146,7 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
className='text-btn column-header__setting-btn'
|
className='text-btn column-header__setting-btn'
|
||||||
onClick={this.handleMoveRight}
|
onClick={this.handleMoveRight}
|
||||||
><Icon
|
><Icon
|
||||||
id='chevron-right'
|
id='chevron-right'
|
||||||
/></button >
|
/></button >
|
||||||
</div >
|
</div >
|
||||||
);
|
);
|
||||||
@ -157,11 +157,11 @@ class ColumnHeader extends React.PureComponent {
|
|||||||
className='text-btn column-header__setting-btn'
|
className='text-btn column-header__setting-btn'
|
||||||
onClick={this.handlePin}
|
onClick={this.handlePin}
|
||||||
><Icon
|
><Icon
|
||||||
id='plus'
|
id='plus'
|
||||||
/> <FormattedMessage
|
/> <FormattedMessage
|
||||||
id='column_header.pin'
|
id='column_header.pin'
|
||||||
defaultMessage='Pin'
|
defaultMessage='Pin'
|
||||||
/>
|
/>
|
||||||
</button >);
|
</button >);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -44,7 +44,7 @@ export default class IntersectionObserverArticle extends React.Component {
|
|||||||
intersectionObserverWrapper.observe(
|
intersectionObserverWrapper.observe(
|
||||||
id,
|
id,
|
||||||
this.node,
|
this.node,
|
||||||
this.handleIntersection
|
this.handleIntersection,
|
||||||
);
|
);
|
||||||
|
|
||||||
this.componentMounted = true;
|
this.componentMounted = true;
|
||||||
|
@ -557,12 +557,12 @@ class Status extends ImmutablePureComponent {
|
|||||||
<div className='status__info'>
|
<div className='status__info'>
|
||||||
|
|
||||||
{isStaff && (<div className='administrate-stuff pull-left'>
|
{isStaff && (<div className='administrate-stuff pull-left'>
|
||||||
<a
|
<a
|
||||||
href={`/admin/accounts/${status.getIn(['account', 'id'])}`}
|
href={`/admin/accounts/${status.getIn(['account', 'id'])}`}
|
||||||
>
|
>
|
||||||
<i className='fa fa-gears' />
|
<i className='fa fa-gears' />
|
||||||
</a >
|
</a >
|
||||||
</div >
|
</div >
|
||||||
)}
|
)}
|
||||||
<a
|
<a
|
||||||
href={status.get('url')}
|
href={status.get('url')}
|
||||||
|
@ -68,7 +68,7 @@ class Blocks extends ImmutablePureComponent {
|
|||||||
bindToDocument={!multiColumn}
|
bindToDocument={!multiColumn}
|
||||||
>
|
>
|
||||||
{accountIds.map(id =>
|
{accountIds.map(id =>
|
||||||
<AccountContainer key={id} id={id} />
|
<AccountContainer key={id} id={id} />,
|
||||||
)}
|
)}
|
||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
</Column>
|
</Column>
|
||||||
|
@ -42,7 +42,7 @@ export default class NavigationBar extends ImmutablePureComponent {
|
|||||||
href='/settings/profile'
|
href='/settings/profile'
|
||||||
className='navigation-bar__profile-edit'
|
className='navigation-bar__profile-edit'
|
||||||
>
|
>
|
||||||
<i className='fa fa-pencil'></i >
|
<i className='fa fa-pencil' />
|
||||||
<FormattedMessage
|
<FormattedMessage
|
||||||
id='navigation_bar.edit_profile'
|
id='navigation_bar.edit_profile'
|
||||||
defaultMessage='Edit profile'
|
defaultMessage='Edit profile'
|
||||||
|
@ -69,7 +69,7 @@ class Blocks extends ImmutablePureComponent {
|
|||||||
bindToDocument={!multiColumn}
|
bindToDocument={!multiColumn}
|
||||||
>
|
>
|
||||||
{domains.map(domain =>
|
{domains.map(domain =>
|
||||||
<DomainContainer key={domain} domain={domain} />
|
<DomainContainer key={domain} domain={domain} />,
|
||||||
)}
|
)}
|
||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
</Column>
|
</Column>
|
||||||
|
@ -79,7 +79,7 @@ class Favourites extends ImmutablePureComponent {
|
|||||||
bindToDocument={!multiColumn}
|
bindToDocument={!multiColumn}
|
||||||
>
|
>
|
||||||
{accountIds.map(id =>
|
{accountIds.map(id =>
|
||||||
<AccountContainer key={id} id={id} withNote={false} />
|
<AccountContainer key={id} id={id} withNote={false} />,
|
||||||
)}
|
)}
|
||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
</Column>
|
</Column>
|
||||||
|
@ -56,9 +56,9 @@ class AccountAuthorize extends ImmutablePureComponent {
|
|||||||
>
|
>
|
||||||
<i className='fa fa-comment' />
|
<i className='fa fa-comment' />
|
||||||
<strong >{shortNumberFormat(account.get('statuses_count'))}</strong > <FormattedMessage
|
<strong >{shortNumberFormat(account.get('statuses_count'))}</strong > <FormattedMessage
|
||||||
id='account.posts'
|
id='account.posts'
|
||||||
defaultMessage='Toots'
|
defaultMessage='Toots'
|
||||||
/>
|
/>
|
||||||
</NavLink >
|
</NavLink >
|
||||||
|
|
||||||
<NavLink
|
<NavLink
|
||||||
@ -68,9 +68,9 @@ class AccountAuthorize extends ImmutablePureComponent {
|
|||||||
title={intl.formatNumber(account.get('following_count'))}
|
title={intl.formatNumber(account.get('following_count'))}
|
||||||
>
|
>
|
||||||
<strong >{shortNumberFormat(account.get('following_count'))}</strong > <FormattedMessage
|
<strong >{shortNumberFormat(account.get('following_count'))}</strong > <FormattedMessage
|
||||||
id='account.follows'
|
id='account.follows'
|
||||||
defaultMessage='Follows'
|
defaultMessage='Follows'
|
||||||
/>
|
/>
|
||||||
</NavLink >
|
</NavLink >
|
||||||
|
|
||||||
<NavLink
|
<NavLink
|
||||||
@ -80,12 +80,12 @@ class AccountAuthorize extends ImmutablePureComponent {
|
|||||||
title={intl.formatNumber(account.get('followers_count'))}
|
title={intl.formatNumber(account.get('followers_count'))}
|
||||||
>
|
>
|
||||||
<strong >{shortNumberFormat(account.get('followers_count'))}</strong > <FormattedMessage
|
<strong >{shortNumberFormat(account.get('followers_count'))}</strong > <FormattedMessage
|
||||||
id='account.followers'
|
id='account.followers'
|
||||||
defaultMessage='Followers'
|
defaultMessage='Followers'
|
||||||
/>
|
/>
|
||||||
</NavLink >
|
</NavLink >
|
||||||
|
|
||||||
</span >
|
</span >
|
||||||
|
|
||||||
<div
|
<div
|
||||||
className='account__header__content'
|
className='account__header__content'
|
||||||
@ -101,7 +101,7 @@ class AccountAuthorize extends ImmutablePureComponent {
|
|||||||
<i
|
<i
|
||||||
className='fa fa-check'
|
className='fa fa-check'
|
||||||
title={intl.formatMessage(messages.authorize)}
|
title={intl.formatMessage(messages.authorize)}
|
||||||
></i >
|
/>
|
||||||
{intl.formatMessage(messages.authorize)}
|
{intl.formatMessage(messages.authorize)}
|
||||||
</div >
|
</div >
|
||||||
<div
|
<div
|
||||||
@ -111,7 +111,7 @@ class AccountAuthorize extends ImmutablePureComponent {
|
|||||||
<i
|
<i
|
||||||
className='fa fa-times'
|
className='fa fa-times'
|
||||||
title={intl.formatMessage(messages.reject)}
|
title={intl.formatMessage(messages.reject)}
|
||||||
></i >
|
/>
|
||||||
{intl.formatMessage(messages.reject)}
|
{intl.formatMessage(messages.reject)}
|
||||||
</div >
|
</div >
|
||||||
</div >
|
</div >
|
||||||
|
@ -68,7 +68,7 @@ class FollowRequests extends ImmutablePureComponent {
|
|||||||
bindToDocument={!multiColumn}
|
bindToDocument={!multiColumn}
|
||||||
>
|
>
|
||||||
{accountIds.map(id =>
|
{accountIds.map(id =>
|
||||||
<AccountAuthorizeContainer key={id} id={id} />
|
<AccountAuthorizeContainer key={id} id={id} />,
|
||||||
)}
|
)}
|
||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
</Column>
|
</Column>
|
||||||
|
@ -72,13 +72,13 @@ class Followers extends ImmutablePureComponent {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
const emptyMessage = blockedBy ? <FormattedMessage
|
const emptyMessage = blockedBy ? (<FormattedMessage
|
||||||
id='empty_column.account_unavailable'
|
id='empty_column.account_unavailable'
|
||||||
defaultMessage='Profile unavailable'
|
defaultMessage='Profile unavailable'
|
||||||
/> : <FormattedMessage
|
/>) : (<FormattedMessage
|
||||||
id='account.followers.empty'
|
id='account.followers.empty'
|
||||||
defaultMessage='No one follows this user yet.'
|
defaultMessage='No one follows this user yet.'
|
||||||
/>;
|
/>);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Column >
|
<Column >
|
||||||
@ -98,11 +98,11 @@ class Followers extends ImmutablePureComponent {
|
|||||||
bindToDocument={!multiColumn}
|
bindToDocument={!multiColumn}
|
||||||
>
|
>
|
||||||
{blockedBy ? [] : accountIds.map(id =>
|
{blockedBy ? [] : accountIds.map(id =>
|
||||||
<AccountContainer
|
(<AccountContainer
|
||||||
key={id}
|
key={id}
|
||||||
id={id}
|
id={id}
|
||||||
withNote={false}
|
withNote={false}
|
||||||
/>,
|
/>),
|
||||||
)}
|
)}
|
||||||
</ScrollableList >
|
</ScrollableList >
|
||||||
</Column >
|
</Column >
|
||||||
|
@ -93,7 +93,7 @@ class Following extends ImmutablePureComponent {
|
|||||||
bindToDocument={!multiColumn}
|
bindToDocument={!multiColumn}
|
||||||
>
|
>
|
||||||
{blockedBy ? [] : accountIds.map(id =>
|
{blockedBy ? [] : accountIds.map(id =>
|
||||||
<AccountContainer key={id} id={id} withNote={false} />
|
<AccountContainer key={id} id={id} withNote={false} />,
|
||||||
)}
|
)}
|
||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
</Column>
|
</Column>
|
||||||
|
@ -106,20 +106,20 @@ class GettingStarted extends ImmutablePureComponent {
|
|||||||
|
|
||||||
if (profile_directory) {
|
if (profile_directory) {
|
||||||
navItems.push(
|
navItems.push(
|
||||||
<ColumnLink key={i++} icon='address-book' text={intl.formatMessage(messages.profile_directory)} to='/directory' />
|
<ColumnLink key={i++} icon='address-book' text={intl.formatMessage(messages.profile_directory)} to='/directory' />,
|
||||||
);
|
);
|
||||||
|
|
||||||
height += 48;
|
height += 48;
|
||||||
}
|
}
|
||||||
|
|
||||||
navItems.push(
|
navItems.push(
|
||||||
<ColumnSubheading key={i++} text={intl.formatMessage(messages.personal)} />
|
<ColumnSubheading key={i++} text={intl.formatMessage(messages.personal)} />,
|
||||||
);
|
);
|
||||||
|
|
||||||
height += 34;
|
height += 34;
|
||||||
} else if (profile_directory) {
|
} else if (profile_directory) {
|
||||||
navItems.push(
|
navItems.push(
|
||||||
<ColumnLink key={i++} icon='address-book' text={intl.formatMessage(messages.profile_directory)} to='/directory' />
|
<ColumnLink key={i++} icon='address-book' text={intl.formatMessage(messages.profile_directory)} to='/directory' />,
|
||||||
);
|
);
|
||||||
|
|
||||||
height += 48;
|
height += 48;
|
||||||
@ -129,7 +129,7 @@ class GettingStarted extends ImmutablePureComponent {
|
|||||||
<ColumnLink key={i++} icon='envelope' text={intl.formatMessage(messages.direct)} to='/timelines/direct' />,
|
<ColumnLink key={i++} icon='envelope' text={intl.formatMessage(messages.direct)} to='/timelines/direct' />,
|
||||||
<ColumnLink key={i++} icon='bookmark' text={intl.formatMessage(messages.bookmarks)} to='/bookmarks' />,
|
<ColumnLink key={i++} icon='bookmark' text={intl.formatMessage(messages.bookmarks)} to='/bookmarks' />,
|
||||||
<ColumnLink key={i++} icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />,
|
<ColumnLink key={i++} icon='star' text={intl.formatMessage(messages.favourites)} to='/favourites' />,
|
||||||
<ColumnLink key={i++} icon='list-ul' text={intl.formatMessage(messages.lists)} to='/lists' />
|
<ColumnLink key={i++} icon='list-ul' text={intl.formatMessage(messages.lists)} to='/lists' />,
|
||||||
);
|
);
|
||||||
|
|
||||||
height += 48*4;
|
height += 48*4;
|
||||||
|
@ -74,7 +74,7 @@ class Lists extends ImmutablePureComponent {
|
|||||||
bindToDocument={!multiColumn}
|
bindToDocument={!multiColumn}
|
||||||
>
|
>
|
||||||
{lists.map(list =>
|
{lists.map(list =>
|
||||||
<ColumnLink key={list.get('id')} to={`/timelines/list/${list.get('id')}`} icon='list-ul' text={list.get('title')} />
|
<ColumnLink key={list.get('id')} to={`/timelines/list/${list.get('id')}`} icon='list-ul' text={list.get('title')} />,
|
||||||
)}
|
)}
|
||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
</Column>
|
</Column>
|
||||||
|
@ -68,7 +68,7 @@ class Mutes extends ImmutablePureComponent {
|
|||||||
bindToDocument={!multiColumn}
|
bindToDocument={!multiColumn}
|
||||||
>
|
>
|
||||||
{accountIds.map(id =>
|
{accountIds.map(id =>
|
||||||
<AccountContainer key={id} id={id} />
|
<AccountContainer key={id} id={id} />,
|
||||||
)}
|
)}
|
||||||
</ScrollableList>
|
</ScrollableList>
|
||||||
</Column>
|
</Column>
|
||||||
|
@ -98,7 +98,7 @@ export default class Card extends React.PureComponent {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
]),
|
]),
|
||||||
0
|
0,
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -19,7 +19,7 @@ describe('<Column />', () => {
|
|||||||
const wrapper = mount(
|
const wrapper = mount(
|
||||||
<Column heading='notifications'>
|
<Column heading='notifications'>
|
||||||
<div className='scrollable' />
|
<div className='scrollable' />
|
||||||
</Column>
|
</Column>,
|
||||||
);
|
);
|
||||||
wrapper.find(ColumnHeader).find('button').simulate('click');
|
wrapper.find(ColumnHeader).find('button').simulate('click');
|
||||||
expect(global.requestAnimationFrame.mock.calls.length).toEqual(1);
|
expect(global.requestAnimationFrame.mock.calls.length).toEqual(1);
|
||||||
|
@ -270,7 +270,7 @@ class ColumnsArea extends ImmutablePureComponent {
|
|||||||
{React.Children.map(children, child => React.cloneElement(child, { multiColumn: true }))}
|
{React.Children.map(children, child => React.cloneElement(child, { multiColumn: true }))}
|
||||||
</div >
|
</div >
|
||||||
)
|
)
|
||||||
;
|
;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
@ -214,8 +214,8 @@ class LinkFooter extends React.PureComponent {
|
|||||||
href='/invites'
|
href='/invites'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
><FormattedMessage
|
><FormattedMessage
|
||||||
id='getting_started.invite'
|
id='getting_started.invite'
|
||||||
defaultMessage='Invite people'
|
defaultMessage='Invite people'
|
||||||
/></a > · </li >}
|
/></a > · </li >}
|
||||||
{withHotkeys && <li >
|
{withHotkeys && <li >
|
||||||
<Link to='/keyboard-shortcuts'><FormattedMessage
|
<Link to='/keyboard-shortcuts'><FormattedMessage
|
||||||
@ -231,48 +231,48 @@ class LinkFooter extends React.PureComponent {
|
|||||||
href='/about/more'
|
href='/about/more'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
><FormattedMessage
|
><FormattedMessage
|
||||||
id='navigation_bar.info'
|
id='navigation_bar.info'
|
||||||
defaultMessage='About this server'
|
defaultMessage='About this server'
|
||||||
/></a > ·
|
/></a > ·
|
||||||
</li >
|
</li >
|
||||||
<li ><a
|
<li ><a
|
||||||
href='https://joinmastodon.org/apps'
|
href='https://joinmastodon.org/apps'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
><FormattedMessage
|
><FormattedMessage
|
||||||
id='navigation_bar.apps'
|
id='navigation_bar.apps'
|
||||||
defaultMessage='Mobile apps'
|
defaultMessage='Mobile apps'
|
||||||
/></a > ·
|
/></a > ·
|
||||||
</li >
|
</li >
|
||||||
<li ><a
|
<li ><a
|
||||||
href='/terms'
|
href='/terms'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
><FormattedMessage
|
><FormattedMessage
|
||||||
id='getting_started.terms'
|
id='getting_started.terms'
|
||||||
defaultMessage='Terms of service'
|
defaultMessage='Terms of service'
|
||||||
/></a > ·
|
/></a > ·
|
||||||
</li >
|
</li >
|
||||||
<li ><a
|
<li ><a
|
||||||
href='/settings/applications'
|
href='/settings/applications'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
><FormattedMessage
|
><FormattedMessage
|
||||||
id='getting_started.developers'
|
id='getting_started.developers'
|
||||||
defaultMessage='Developers'
|
defaultMessage='Developers'
|
||||||
/></a > ·
|
/></a > ·
|
||||||
</li >
|
</li >
|
||||||
<li ><a
|
<li ><a
|
||||||
href='https://docs.joinmastodon.org'
|
href='https://docs.joinmastodon.org'
|
||||||
target='_blank'
|
target='_blank'
|
||||||
><FormattedMessage
|
><FormattedMessage
|
||||||
id='getting_started.documentation'
|
id='getting_started.documentation'
|
||||||
defaultMessage='Documentation'
|
defaultMessage='Documentation'
|
||||||
/></a > ·
|
/></a > ·
|
||||||
</li >
|
</li >
|
||||||
<li ><a
|
<li ><a
|
||||||
href='/auth/sign_out'
|
href='/auth/sign_out'
|
||||||
onClick={this.handleLogoutClick}
|
onClick={this.handleLogoutClick}
|
||||||
><FormattedMessage
|
><FormattedMessage
|
||||||
id='navigation_bar.logout'
|
id='navigation_bar.logout'
|
||||||
defaultMessage='Logout'
|
defaultMessage='Logout'
|
||||||
/></a ></li >
|
/></a ></li >
|
||||||
</ul >
|
</ul >
|
||||||
|
|
||||||
|
@ -17,26 +17,26 @@ const NavigationPanel = () => (
|
|||||||
data-preview-title-id='column.home'
|
data-preview-title-id='column.home'
|
||||||
data-preview-icon='home'
|
data-preview-icon='home'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='home'
|
id='home'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='tabs_bar.home'
|
id='tabs_bar.home'
|
||||||
defaultMessage='Home'
|
defaultMessage='Home'
|
||||||
/></NavLink >
|
/></NavLink >
|
||||||
<NavLink
|
<NavLink
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
to='/timelines/public/local'
|
to='/timelines/public/local'
|
||||||
data-preview-title-id='column.community'
|
data-preview-title-id='column.community'
|
||||||
data-preview-icon='users'
|
data-preview-icon='users'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='users'
|
id='users'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='tabs_bar.local_timeline'
|
id='tabs_bar.local_timeline'
|
||||||
defaultMessage='Local'
|
defaultMessage='Local'
|
||||||
/></NavLink >
|
/></NavLink >
|
||||||
|
|
||||||
<NavLink
|
<NavLink
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
@ -45,87 +45,87 @@ const NavigationPanel = () => (
|
|||||||
data-preview-title-id='column.public'
|
data-preview-title-id='column.public'
|
||||||
data-preview-icon='globe'
|
data-preview-icon='globe'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='globe'
|
id='globe'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='tabs_bar.federated_timeline'
|
id='tabs_bar.federated_timeline'
|
||||||
defaultMessage='Federated'
|
defaultMessage='Federated'
|
||||||
/></NavLink >
|
/></NavLink >
|
||||||
|
|
||||||
</div >
|
</div >
|
||||||
<div className='spacer'></div >
|
<div className='spacer' />
|
||||||
<NavLink
|
<NavLink
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
to='/notifications'
|
to='/notifications'
|
||||||
data-preview-title-id='column.notifications'
|
data-preview-title-id='column.notifications'
|
||||||
data-preview-icon='bell'
|
data-preview-icon='bell'
|
||||||
><NotificationsCounterIcon
|
><NotificationsCounterIcon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='tabs_bar.notifications'
|
id='tabs_bar.notifications'
|
||||||
defaultMessage='Notifications'
|
defaultMessage='Notifications'
|
||||||
/></NavLink >
|
/></NavLink >
|
||||||
<NavLink
|
<NavLink
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
to='/timelines/direct'
|
to='/timelines/direct'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='envelope'
|
id='envelope'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='navigation_bar.direct'
|
id='navigation_bar.direct'
|
||||||
defaultMessage='Direct messages'
|
defaultMessage='Direct messages'
|
||||||
/></NavLink >
|
/></NavLink >
|
||||||
<FollowRequestsNavLink />
|
<FollowRequestsNavLink />
|
||||||
|
|
||||||
<div className='spacer'></div >
|
<div className='spacer' />
|
||||||
|
|
||||||
<NavLink
|
<NavLink
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
to='/favourites'
|
to='/favourites'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='star'
|
id='star'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='navigation_bar.favourites'
|
id='navigation_bar.favourites'
|
||||||
defaultMessage='Favourites'
|
defaultMessage='Favourites'
|
||||||
/></NavLink >
|
/></NavLink >
|
||||||
<NavLink
|
<NavLink
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
to='/bookmarks'
|
to='/bookmarks'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='bookmark'
|
id='bookmark'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='navigation_bar.bookmarks'
|
id='navigation_bar.bookmarks'
|
||||||
defaultMessage='Bookmarks'
|
defaultMessage='Bookmarks'
|
||||||
/></NavLink >
|
/></NavLink >
|
||||||
<NavLink
|
<NavLink
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
to='/lists'
|
to='/lists'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='list-ul'
|
id='list-ul'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='navigation_bar.lists'
|
id='navigation_bar.lists'
|
||||||
defaultMessage='Lists'
|
defaultMessage='Lists'
|
||||||
/></NavLink >
|
/></NavLink >
|
||||||
{profile_directory &&
|
{profile_directory &&
|
||||||
<NavLink
|
<NavLink
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
to='/directory'
|
to='/directory'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='address-book-o'
|
id='address-book-o'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='getting_started.directory'
|
id='getting_started.directory'
|
||||||
defaultMessage='Profile directory'
|
defaultMessage='Profile directory'
|
||||||
/></NavLink >}
|
/></NavLink >}
|
||||||
|
|
||||||
<ListPanel />
|
<ListPanel />
|
||||||
|
|
||||||
@ -135,24 +135,24 @@ const NavigationPanel = () => (
|
|||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
href='/settings/preferences'
|
href='/settings/preferences'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='cog'
|
id='cog'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='navigation_bar.preferences'
|
id='navigation_bar.preferences'
|
||||||
defaultMessage='Preferences'
|
defaultMessage='Preferences'
|
||||||
/></a >
|
/></a >
|
||||||
<a
|
<a
|
||||||
className='column-link column-link--transparent'
|
className='column-link column-link--transparent'
|
||||||
href='/relationships'
|
href='/relationships'
|
||||||
><Icon
|
><Icon
|
||||||
className='column-link__icon'
|
className='column-link__icon'
|
||||||
id='users'
|
id='users'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='navigation_bar.follows_and_followers'
|
id='navigation_bar.follows_and_followers'
|
||||||
defaultMessage='Follows and followers'
|
defaultMessage='Follows and followers'
|
||||||
/></a >
|
/></a >
|
||||||
|
|
||||||
{showTrends && <div className='flex-spacer' />}
|
{showTrends && <div className='flex-spacer' />}
|
||||||
{showTrends && <TrendsContainer />}
|
{showTrends && <TrendsContainer />}
|
||||||
|
@ -14,20 +14,20 @@ export const links = [
|
|||||||
data-preview-title-id='column.home'
|
data-preview-title-id='column.home'
|
||||||
data-preview-icon='home'
|
data-preview-icon='home'
|
||||||
><Icon
|
><Icon
|
||||||
id='home'
|
id='home'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='tabs_bar.home'
|
id='tabs_bar.home'
|
||||||
defaultMessage='Home'
|
defaultMessage='Home'
|
||||||
/></NavLink >,
|
/></NavLink >,
|
||||||
<NavLink
|
<NavLink
|
||||||
className='tabs-bar__link'
|
className='tabs-bar__link'
|
||||||
to='/notifications'
|
to='/notifications'
|
||||||
data-preview-title-id='column.notifications'
|
data-preview-title-id='column.notifications'
|
||||||
data-preview-icon='bell'
|
data-preview-icon='bell'
|
||||||
><NotificationsCounterIcon /><FormattedMessage
|
><NotificationsCounterIcon /><FormattedMessage
|
||||||
id='tabs_bar.notifications'
|
id='tabs_bar.notifications'
|
||||||
defaultMessage='Notifications'
|
defaultMessage='Notifications'
|
||||||
/></NavLink >,
|
/></NavLink >,
|
||||||
<NavLink
|
<NavLink
|
||||||
className='tabs-bar__link'
|
className='tabs-bar__link'
|
||||||
@ -35,12 +35,12 @@ export const links = [
|
|||||||
data-preview-title-id='column.community'
|
data-preview-title-id='column.community'
|
||||||
data-preview-icon='users'
|
data-preview-icon='users'
|
||||||
><Icon
|
><Icon
|
||||||
id='users'
|
id='users'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='tabs_bar.local_timeline'
|
id='tabs_bar.local_timeline'
|
||||||
defaultMessage='Local'
|
defaultMessage='Local'
|
||||||
/></NavLink >,
|
/></NavLink >,
|
||||||
<NavLink
|
<NavLink
|
||||||
className='tabs-bar__link'
|
className='tabs-bar__link'
|
||||||
exact
|
exact
|
||||||
@ -48,24 +48,24 @@ export const links = [
|
|||||||
data-preview-title-id='column.public'
|
data-preview-title-id='column.public'
|
||||||
data-preview-icon='globe'
|
data-preview-icon='globe'
|
||||||
><Icon
|
><Icon
|
||||||
id='globe'
|
id='globe'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='tabs_bar.federated_timeline'
|
id='tabs_bar.federated_timeline'
|
||||||
defaultMessage='Federated'
|
defaultMessage='Federated'
|
||||||
/></NavLink >,
|
/></NavLink >,
|
||||||
<NavLink
|
<NavLink
|
||||||
className='tabs-bar__link optional'
|
className='tabs-bar__link optional'
|
||||||
to='/search'
|
to='/search'
|
||||||
data-preview-title-id='tabs_bar.search'
|
data-preview-title-id='tabs_bar.search'
|
||||||
data-preview-icon='bell'
|
data-preview-icon='bell'
|
||||||
><Icon
|
><Icon
|
||||||
id='search'
|
id='search'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/><FormattedMessage
|
/><FormattedMessage
|
||||||
id='tabs_bar.search'
|
id='tabs_bar.search'
|
||||||
defaultMessage='Search'
|
defaultMessage='Search'
|
||||||
/></NavLink >,
|
/></NavLink >,
|
||||||
<NavLink
|
<NavLink
|
||||||
className='tabs-bar__link'
|
className='tabs-bar__link'
|
||||||
style={{ flexGrow: '0', flexBasis: '30px' }}
|
style={{ flexGrow: '0', flexBasis: '30px' }}
|
||||||
@ -73,8 +73,8 @@ export const links = [
|
|||||||
data-preview-title-id='getting_started.heading'
|
data-preview-title-id='getting_started.heading'
|
||||||
data-preview-icon='bars'
|
data-preview-icon='bars'
|
||||||
><Icon
|
><Icon
|
||||||
id='bars'
|
id='bars'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/></NavLink >,
|
/></NavLink >,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
@ -522,16 +522,16 @@ class Video extends React.PureComponent {
|
|||||||
aria-label={intl.formatMessage(messages.hide)}
|
aria-label={intl.formatMessage(messages.hide)}
|
||||||
onClick={this.toggleReveal}
|
onClick={this.toggleReveal}
|
||||||
><Icon
|
><Icon
|
||||||
id='eye-slash'
|
id='eye-slash'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/></button >}
|
/></button >}
|
||||||
{(!fullscreen && onOpenVideo) && <button
|
{(!fullscreen && onOpenVideo) && <button
|
||||||
type='button'
|
type='button'
|
||||||
aria-label={intl.formatMessage(messages.expand)}
|
aria-label={intl.formatMessage(messages.expand)}
|
||||||
onClick={this.handleOpenVideo}
|
onClick={this.handleOpenVideo}
|
||||||
><Icon
|
><Icon
|
||||||
id='expand'
|
id='expand'
|
||||||
fixedWidth
|
fixedWidth
|
||||||
/></button >}
|
/></button >}
|
||||||
{onCloseVideo && <button type='button' aria-label={intl.formatMessage(messages.close)} onClick={this.handleCloseVideo}><Icon id='compress' fixedWidth /></button>}
|
{onCloseVideo && <button type='button' aria-label={intl.formatMessage(messages.close)} onClick={this.handleCloseVideo}><Icon id='compress' fixedWidth /></button>}
|
||||||
<button type='button' aria-label={intl.formatMessage(messages.download)}><a className='video-player__download__icon' href={this.props.src} download><Icon id={'download'} fixedWidth /></a></button>
|
<button type='button' aria-label={intl.formatMessage(messages.download)}><a className='video-player__download__icon' href={this.props.src} download><Icon id={'download'} fixedWidth /></a></button>
|
||||||
|
@ -72,11 +72,11 @@ const expandNormalizedNotifications = (state, notifications, next, isLoadingRece
|
|||||||
|
|
||||||
mutable.update(usePendingItems ? 'pendingItems' : 'items', list => {
|
mutable.update(usePendingItems ? 'pendingItems' : 'items', list => {
|
||||||
const lastIndex = 1 + list.findLastIndex(
|
const lastIndex = 1 + list.findLastIndex(
|
||||||
item => item !== null && (compareId(item.get('id'), items.last().get('id')) > 0 || item.get('id') === items.last().get('id'))
|
item => item !== null && (compareId(item.get('id'), items.last().get('id')) > 0 || item.get('id') === items.last().get('id')),
|
||||||
);
|
);
|
||||||
|
|
||||||
const firstIndex = 1 + list.take(lastIndex).findLastIndex(
|
const firstIndex = 1 + list.take(lastIndex).findLastIndex(
|
||||||
item => item !== null && compareId(item.get('id'), items.first().get('id')) > 0
|
item => item !== null && compareId(item.get('id'), items.first().get('id')) > 0,
|
||||||
);
|
);
|
||||||
|
|
||||||
return list.take(firstIndex).concat(items, list.skip(lastIndex));
|
return list.take(firstIndex).concat(items, list.skip(lastIndex));
|
||||||
|
@ -54,7 +54,7 @@ const expandNormalizedTimeline = (state, timeline, statuses, next, isPartial, is
|
|||||||
|
|
||||||
return oldIds.take(firstIndex + 1).concat(
|
return oldIds.take(firstIndex + 1).concat(
|
||||||
isPartial && oldIds.get(firstIndex) !== null ? newIds.unshift(null) : newIds,
|
isPartial && oldIds.get(firstIndex) !== null ? newIds.unshift(null) : newIds,
|
||||||
oldIds.skip(lastIndex)
|
oldIds.skip(lastIndex),
|
||||||
);
|
);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
@ -166,7 +166,7 @@ export default function timelines(state = initialState, action) {
|
|||||||
return state.update(
|
return state.update(
|
||||||
action.timeline,
|
action.timeline,
|
||||||
initialTimeline,
|
initialTimeline,
|
||||||
map => map.set('online', false).update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items)
|
map => map.set('online', false).update(action.usePendingItems ? 'pendingItems' : 'items', items => items.first() ? items.unshift(null) : items),
|
||||||
);
|
);
|
||||||
default:
|
default:
|
||||||
return state;
|
return state;
|
||||||
|
@ -117,7 +117,7 @@ export const makeGetStatus = () => {
|
|||||||
map.set('account', accountBase);
|
map.set('account', accountBase);
|
||||||
map.set('filtered', filtered);
|
map.set('filtered', filtered);
|
||||||
});
|
});
|
||||||
}
|
},
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ const handlePush = (event) => {
|
|||||||
badge: '/badge.png',
|
badge: '/badge.png',
|
||||||
data: { access_token, preferred_locale, url: '/web/notifications' },
|
data: { access_token, preferred_locale, url: '/web/notifications' },
|
||||||
});
|
});
|
||||||
})
|
}),
|
||||||
);
|
);
|
||||||
};
|
};
|
||||||
|
|
||||||
|
@ -10,6 +10,6 @@ export default function configureStore() {
|
|||||||
thunk,
|
thunk,
|
||||||
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
|
loadingBarMiddleware({ promiseTypeSuffixes: ['REQUEST', 'SUCCESS', 'FAIL'] }),
|
||||||
errorsMiddleware(),
|
errorsMiddleware(),
|
||||||
soundsMiddleware()
|
soundsMiddleware(),
|
||||||
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
|
), window.__REDUX_DEVTOOLS_EXTENSION__ ? window.__REDUX_DEVTOOLS_EXTENSION__() : f => f));
|
||||||
};
|
};
|
||||||
|
130
app/javascript/mastodon/utils/snowstorm-min.js
vendored
130
app/javascript/mastodon/utils/snowstorm-min.js
vendored
@ -8,22 +8,114 @@
|
|||||||
Code provided under the BSD License
|
Code provided under the BSD License
|
||||||
http://schillmania.com/projects/snowstorm/license.txt
|
http://schillmania.com/projects/snowstorm/license.txt
|
||||||
*/
|
*/
|
||||||
var snowStorm=function(g,f){function k(a,d){isNaN(d)&&(d=0);return Math.random()*a+d}function x(){g.setTimeout(function(){a.start(!0)},20);a.events.remove(m?f:g,"mousemove",x)}function y(){(!a.excludeMobile||!D)&&x();a.events.remove(g,"load",y)}this.excludeMobile=this.autoStart=!0;this.flakesMax=128;this.flakesMaxActive=64;this.animationInterval=33;this.useGPU=!0;this.className=null;this.excludeMobile=!0;this.flakeBottom=null;this.followMouse=!0;this.snowColor="#fff";this.snowCharacter="•";this.snowStick=
|
var snowStorm=function(g, f){
|
||||||
!0;this.targetElement=null;this.useMeltEffect=!0;this.usePixelPosition=this.usePositionFixed=this.useTwinkleEffect=!1;this.freezeOnBlur=!0;this.flakeRightOffset=this.flakeLeftOffset=0;this.flakeHeight=this.flakeWidth=8;this.vMaxX=5;this.vMaxY=4;this.zIndex=0;var a=this,q,m=navigator.userAgent.match(/msie/i),E=navigator.userAgent.match(/msie 6/i),D=navigator.userAgent.match(/mobile|opera m(ob|in)/i),r=m&&"BackCompat"===f.compatMode||E,h=null,n=null,l=null,p=null,s=null,z=null,A=null,v=1,t=!1,w=!1,
|
function k(a, d){
|
||||||
u;a:{try{f.createElement("div").style.opacity="0.5"}catch(F){u=!1;break a}u=!0}var B=!1,C=f.createDocumentFragment();q=function(){function c(b){g.setTimeout(b,1E3/(a.animationInterval||20))}function d(a){return void 0!==h.style[a]?a:null}var e,b=g.requestAnimationFrame||g.webkitRequestAnimationFrame||g.mozRequestAnimationFrame||g.oRequestAnimationFrame||g.msRequestAnimationFrame||c;e=b?function(){return b.apply(g,arguments)}:null;var h;h=f.createElement("div");e={transform:{ie:d("-ms-transform"),
|
isNaN(d)&&(d=0);return Math.random()*a+d;
|
||||||
moz:d("MozTransform"),opera:d("OTransform"),webkit:d("webkitTransform"),w3:d("transform"),prop:null},getAnimationFrame:e};e.transform.prop=e.transform.w3||e.transform.moz||e.transform.webkit||e.transform.ie||e.transform.opera;h=null;return e}();this.timer=null;this.flakes=[];this.active=this.disabled=!1;this.meltFrameCount=20;this.meltFrames=[];this.setXY=function(c,d,e){if(!c)return!1;a.usePixelPosition||w?(c.style.left=d-a.flakeWidth+"px",c.style.top=e-a.flakeHeight+"px"):r?(c.style.right=100-100*
|
}function x(){
|
||||||
(d/h)+"%",c.style.top=Math.min(e,s-a.flakeHeight)+"px"):a.flakeBottom?(c.style.right=100-100*(d/h)+"%",c.style.top=Math.min(e,s-a.flakeHeight)+"px"):(c.style.right=100-100*(d/h)+"%",c.style.bottom=100-100*(e/l)+"%")};this.events=function(){function a(c){c=b.call(c);var d=c.length;e?(c[1]="on"+c[1],3<d&&c.pop()):3===d&&c.push(!1);return c}function d(a,b){var c=a.shift(),d=[f[b]];if(e)c[d](a[0],a[1]);else c[d].apply(c,a)}var e=!g.addEventListener&&g.attachEvent,b=Array.prototype.slice,f={add:e?"attachEvent":
|
g.setTimeout(function(){
|
||||||
"addEventListener",remove:e?"detachEvent":"removeEventListener"};return{add:function(){d(a(arguments),"add")},remove:function(){d(a(arguments),"remove")}}}();this.randomizeWind=function(){var c;c=k(a.vMaxX,0.2);z=1===parseInt(k(2),10)?-1*c:c;A=k(a.vMaxY,0.2);if(this.flakes)for(c=0;c<this.flakes.length;c++)this.flakes[c].active&&this.flakes[c].setVelocities()};this.scrollHandler=function(){var c;p=a.flakeBottom?0:parseInt(g.scrollY||f.documentElement.scrollTop||(r?f.body.scrollTop:0),10);isNaN(p)&&
|
a.start(!0);
|
||||||
(p=0);if(!t&&!a.flakeBottom&&a.flakes)for(c=0;c<a.flakes.length;c++)0===a.flakes[c].active&&a.flakes[c].stick()};this.resizeHandler=function(){g.innerWidth||g.innerHeight?(h=g.innerWidth-16-a.flakeRightOffset,l=a.flakeBottom||g.innerHeight):(h=(f.documentElement.clientWidth||f.body.clientWidth||f.body.scrollWidth)-(!m?8:0)-a.flakeRightOffset,l=a.flakeBottom||f.documentElement.clientHeight||f.body.clientHeight||f.body.scrollHeight);s=f.body.offsetHeight;n=parseInt(h/2,10)};this.resizeHandlerAlt=function(){h=
|
}, 20);a.events.remove(m?f:g, 'mousemove', x);
|
||||||
a.targetElement.offsetWidth-a.flakeRightOffset;l=a.flakeBottom||a.targetElement.offsetHeight;n=parseInt(h/2,10);s=f.body.offsetHeight};this.freeze=function(){if(a.disabled)return!1;a.disabled=1;a.timer=null};this.resume=function(){if(a.disabled)a.disabled=0;else return!1;a.timerInit()};this.toggleSnow=function(){a.flakes.length?(a.active=!a.active,a.active?(a.show(),a.resume()):(a.stop(),a.freeze())):a.start()};this.stop=function(){var c;this.freeze();for(c=0;c<this.flakes.length;c++)this.flakes[c].o.style.display=
|
}function y(){
|
||||||
"none";a.events.remove(g,"scroll",a.scrollHandler);a.events.remove(g,"resize",a.resizeHandler);a.freezeOnBlur&&(m?(a.events.remove(f,"focusout",a.freeze),a.events.remove(f,"focusin",a.resume)):(a.events.remove(g,"blur",a.freeze),a.events.remove(g,"focus",a.resume)))};this.show=function(){var a;for(a=0;a<this.flakes.length;a++)this.flakes[a].o.style.display="block"};this.SnowFlake=function(c,d,e){var b=this;this.type=c;this.x=d||parseInt(k(h-20),10);this.y=!isNaN(e)?e:-k(l)-12;this.vY=this.vX=null;
|
(!a.excludeMobile||!D)&&x();a.events.remove(g, 'load', y);
|
||||||
this.vAmpTypes=[1,1.2,1.4,1.6,1.8];this.vAmp=this.vAmpTypes[this.type]||1;this.melting=!1;this.meltFrameCount=a.meltFrameCount;this.meltFrames=a.meltFrames;this.twinkleFrame=this.meltFrame=0;this.active=1;this.fontSize=10+10*(this.type/5);this.o=f.createElement("div");this.o.innerHTML=a.snowCharacter;a.className&&this.o.setAttribute("class",a.className);this.o.style.color=a.snowColor;this.o.style.position=t?"fixed":"absolute";a.useGPU&&q.transform.prop&&(this.o.style[q.transform.prop]="translate3d(0px, 0px, 0px)");
|
}this.excludeMobile=this.autoStart=!0;this.flakesMax=128;this.flakesMaxActive=64;this.animationInterval=33;this.useGPU=!0;this.className=null;this.excludeMobile=!0;this.flakeBottom=null;this.followMouse=!0;this.snowColor='#fff';this.snowCharacter='•';this.snowStick=
|
||||||
this.o.style.width=a.flakeWidth+"px";this.o.style.height=a.flakeHeight+"px";this.o.style.fontFamily="arial,verdana";this.o.style.cursor="default";this.o.style.overflow="hidden";this.o.style.fontWeight="normal";this.o.style.zIndex=a.zIndex;C.appendChild(this.o);this.refresh=function(){if(isNaN(b.x)||isNaN(b.y))return!1;a.setXY(b.o,b.x,b.y)};this.stick=function(){r||a.targetElement!==f.documentElement&&a.targetElement!==f.body?b.o.style.top=l+p-a.flakeHeight+"px":a.flakeBottom?b.o.style.top=a.flakeBottom+
|
!0;this.targetElement=null;this.useMeltEffect=!0;this.usePixelPosition=this.usePositionFixed=this.useTwinkleEffect=!1;this.freezeOnBlur=!0;this.flakeRightOffset=this.flakeLeftOffset=0;this.flakeHeight=this.flakeWidth=8;this.vMaxX=5;this.vMaxY=4;this.zIndex=0;var a=this, q, m=navigator.userAgent.match(/msie/i), E=navigator.userAgent.match(/msie 6/i), D=navigator.userAgent.match(/mobile|opera m(ob|in)/i), r=m&&'BackCompat'===f.compatMode||E, h=null, n=null, l=null, p=null, s=null, z=null, A=null, v=1, t=!1, w=!1,
|
||||||
"px":(b.o.style.display="none",b.o.style.bottom="0%",b.o.style.position="fixed",b.o.style.display="block")};this.vCheck=function(){0<=b.vX&&0.2>b.vX?b.vX=0.2:0>b.vX&&-0.2<b.vX&&(b.vX=-0.2);0<=b.vY&&0.2>b.vY&&(b.vY=0.2)};this.move=function(){var c=b.vX*v;b.x+=c;b.y+=b.vY*b.vAmp;b.x>=h||h-b.x<a.flakeWidth?b.x=0:0>c&&b.x-a.flakeLeftOffset<-a.flakeWidth&&(b.x=h-a.flakeWidth-1);b.refresh();l+p-b.y+a.flakeHeight<a.flakeHeight?(b.active=0,a.snowStick?b.stick():b.recycle()):(a.useMeltEffect&&(b.active&&3>
|
u;a:{
|
||||||
b.type&&!b.melting&&0.998<Math.random())&&(b.melting=!0,b.melt()),a.useTwinkleEffect&&(0>b.twinkleFrame?0.97<Math.random()&&(b.twinkleFrame=parseInt(8*Math.random(),10)):(b.twinkleFrame--,u?b.o.style.opacity=b.twinkleFrame&&0===b.twinkleFrame%2?0:1:b.o.style.visibility=b.twinkleFrame&&0===b.twinkleFrame%2?"hidden":"visible")))};this.animate=function(){b.move()};this.setVelocities=function(){b.vX=z+k(0.12*a.vMaxX,0.1);b.vY=A+k(0.12*a.vMaxY,0.1)};this.setOpacity=function(a,b){if(!u)return!1;a.style.opacity=
|
try{
|
||||||
b};this.melt=function(){!a.useMeltEffect||!b.melting?b.recycle():b.meltFrame<b.meltFrameCount?(b.setOpacity(b.o,b.meltFrames[b.meltFrame]),b.o.style.fontSize=b.fontSize-b.fontSize*(b.meltFrame/b.meltFrameCount)+"px",b.o.style.lineHeight=a.flakeHeight+2+0.75*a.flakeHeight*(b.meltFrame/b.meltFrameCount)+"px",b.meltFrame++):b.recycle()};this.recycle=function(){b.o.style.display="none";b.o.style.position=t?"fixed":"absolute";b.o.style.bottom="auto";b.setVelocities();b.vCheck();b.meltFrame=0;b.melting=
|
f.createElement('div').style.opacity='0.5';
|
||||||
!1;b.setOpacity(b.o,1);b.o.style.padding="0px";b.o.style.margin="0px";b.o.style.fontSize=b.fontSize+"px";b.o.style.lineHeight=a.flakeHeight+2+"px";b.o.style.textAlign="center";b.o.style.verticalAlign="baseline";b.x=parseInt(k(h-a.flakeWidth-20),10);b.y=parseInt(-1*k(l),10)-a.flakeHeight;b.refresh();b.o.style.display="block";b.active=1};this.recycle();this.refresh()};this.snow=function(){var c=0,d=null,e,d=0;for(e=a.flakes.length;d<e;d++)1===a.flakes[d].active&&(a.flakes[d].move(),c++),a.flakes[d].melting&&
|
}catch(F){
|
||||||
a.flakes[d].melt();c<a.flakesMaxActive&&(d=a.flakes[parseInt(k(a.flakes.length),10)],0===d.active&&(d.melting=!0));a.timer&&q.getAnimationFrame(a.snow)};this.mouseMove=function(c){if(!a.followMouse)return!0;c=parseInt(c.clientX,10);c<n?v=-2+2*(c/n):(c-=n,v=2*(c/n))};this.createSnow=function(c,d){var e;for(e=0;e<c;e++)if(a.flakes[a.flakes.length]=new a.SnowFlake(parseInt(k(6),10)),d||e>a.flakesMaxActive)a.flakes[a.flakes.length-1].active=-1;a.targetElement.appendChild(C)};this.timerInit=function(){a.timer=
|
u=!1;break a;
|
||||||
!0;a.snow()};this.init=function(){var c;for(c=0;c<a.meltFrameCount;c++)a.meltFrames.push(1-c/a.meltFrameCount);a.randomizeWind();a.createSnow(a.flakesMax);a.events.add(g,"resize",a.resizeHandler);a.events.add(g,"scroll",a.scrollHandler);a.freezeOnBlur&&(m?(a.events.add(f,"focusout",a.freeze),a.events.add(f,"focusin",a.resume)):(a.events.add(g,"blur",a.freeze),a.events.add(g,"focus",a.resume)));a.resizeHandler();a.scrollHandler();a.followMouse&&a.events.add(m?f:g,"mousemove",a.mouseMove);a.animationInterval=
|
}u=!0;
|
||||||
Math.max(20,a.animationInterval);a.timerInit()};this.start=function(c){if(B){if(c)return!0}else B=!0;if("string"===typeof a.targetElement&&(c=a.targetElement,a.targetElement=f.getElementById(c),!a.targetElement))throw Error('Snowstorm: Unable to get targetElement "'+c+'"');a.targetElement||(a.targetElement=f.body||f.documentElement);a.targetElement!==f.documentElement&&a.targetElement!==f.body&&(a.resizeHandler=a.resizeHandlerAlt,a.usePixelPosition=!0);a.resizeHandler();a.usePositionFixed=a.usePositionFixed&&
|
}var B=!1, C=f.createDocumentFragment();q=function(){
|
||||||
!r&&!a.flakeBottom;if(g.getComputedStyle)try{w="relative"===g.getComputedStyle(a.targetElement,null).getPropertyValue("position")}catch(d){w=!1}t=a.usePositionFixed;h&&(l&&!a.disabled)&&(a.init(),a.active=!0)};a.autoStart&&a.events.add(g,"load",y,!1);return this}(window, document);
|
function c(b){
|
||||||
|
g.setTimeout(b, 1E3/(a.animationInterval||20));
|
||||||
|
}function d(a){
|
||||||
|
return void 0!==h.style[a]?a:null;
|
||||||
|
}var e, b=g.requestAnimationFrame||g.webkitRequestAnimationFrame||g.mozRequestAnimationFrame||g.oRequestAnimationFrame||g.msRequestAnimationFrame||c;e=b?function(){
|
||||||
|
return b.apply(g, arguments);
|
||||||
|
}:null;var h;h=f.createElement('div');e={ transform:{ ie:d('-ms-transform'),
|
||||||
|
moz:d('MozTransform'), opera:d('OTransform'), webkit:d('webkitTransform'), w3:d('transform'), prop:null }, getAnimationFrame:e };e.transform.prop=e.transform.w3||e.transform.moz||e.transform.webkit||e.transform.ie||e.transform.opera;h=null;return e;
|
||||||
|
}();this.timer=null;this.flakes=[];this.active=this.disabled=!1;this.meltFrameCount=20;this.meltFrames=[];this.setXY=function(c, d, e){
|
||||||
|
if(!c)return!1;a.usePixelPosition||w?(c.style.left=d-a.flakeWidth+'px', c.style.top=e-a.flakeHeight+'px'):r?(c.style.right=100-100*
|
||||||
|
(d/h)+'%', c.style.top=Math.min(e, s-a.flakeHeight)+'px'):a.flakeBottom?(c.style.right=100-100*(d/h)+'%', c.style.top=Math.min(e, s-a.flakeHeight)+'px'):(c.style.right=100-100*(d/h)+'%', c.style.bottom=100-100*(e/l)+'%');
|
||||||
|
};this.events=function(){
|
||||||
|
function a(c){
|
||||||
|
c=b.call(c);var d=c.length;e?(c[1]='on'+c[1], 3<d&&c.pop()):3===d&&c.push(!1);return c;
|
||||||
|
}function d(a, b){
|
||||||
|
var c=a.shift(), d=[f[b]];if(e)c[d](a[0], a[1]);else c[d].apply(c, a);
|
||||||
|
}var e=!g.addEventListener&&g.attachEvent, b=Array.prototype.slice, f={ add:e?'attachEvent':
|
||||||
|
'addEventListener', remove:e?'detachEvent':'removeEventListener' };return{ add:function(){
|
||||||
|
d(a(arguments), 'add');
|
||||||
|
}, remove:function(){
|
||||||
|
d(a(arguments), 'remove');
|
||||||
|
} };
|
||||||
|
}();this.randomizeWind=function(){
|
||||||
|
var c;c=k(a.vMaxX, 0.2);z=1===parseInt(k(2), 10)?-1*c:c;A=k(a.vMaxY, 0.2);if(this.flakes)for(c=0;c<this.flakes.length;c++)this.flakes[c].active&&this.flakes[c].setVelocities();
|
||||||
|
};this.scrollHandler=function(){
|
||||||
|
var c;p=a.flakeBottom?0:parseInt(g.scrollY||f.documentElement.scrollTop||(r?f.body.scrollTop:0), 10);isNaN(p)&&
|
||||||
|
(p=0);if(!t&&!a.flakeBottom&&a.flakes)for(c=0;c<a.flakes.length;c++)0===a.flakes[c].active&&a.flakes[c].stick();
|
||||||
|
};this.resizeHandler=function(){
|
||||||
|
g.innerWidth||g.innerHeight?(h=g.innerWidth-16-a.flakeRightOffset, l=a.flakeBottom||g.innerHeight):(h=(f.documentElement.clientWidth||f.body.clientWidth||f.body.scrollWidth)-(!m?8:0)-a.flakeRightOffset, l=a.flakeBottom||f.documentElement.clientHeight||f.body.clientHeight||f.body.scrollHeight);s=f.body.offsetHeight;n=parseInt(h/2, 10);
|
||||||
|
};this.resizeHandlerAlt=function(){
|
||||||
|
h=
|
||||||
|
a.targetElement.offsetWidth-a.flakeRightOffset;l=a.flakeBottom||a.targetElement.offsetHeight;n=parseInt(h/2, 10);s=f.body.offsetHeight;
|
||||||
|
};this.freeze=function(){
|
||||||
|
if(a.disabled)return!1;a.disabled=1;a.timer=null;
|
||||||
|
};this.resume=function(){
|
||||||
|
if(a.disabled)a.disabled=0;else return!1;a.timerInit();
|
||||||
|
};this.toggleSnow=function(){
|
||||||
|
a.flakes.length?(a.active=!a.active, a.active?(a.show(), a.resume()):(a.stop(), a.freeze())):a.start();
|
||||||
|
};this.stop=function(){
|
||||||
|
var c;this.freeze();for(c=0;c<this.flakes.length;c++)this.flakes[c].o.style.display=
|
||||||
|
'none';a.events.remove(g, 'scroll', a.scrollHandler);a.events.remove(g, 'resize', a.resizeHandler);a.freezeOnBlur&&(m?(a.events.remove(f, 'focusout', a.freeze), a.events.remove(f, 'focusin', a.resume)):(a.events.remove(g, 'blur', a.freeze), a.events.remove(g, 'focus', a.resume)));
|
||||||
|
};this.show=function(){
|
||||||
|
var a;for(a=0;a<this.flakes.length;a++)this.flakes[a].o.style.display='block';
|
||||||
|
};this.SnowFlake=function(c, d, e){
|
||||||
|
var b=this;this.type=c;this.x=d||parseInt(k(h-20), 10);this.y=!isNaN(e)?e:-k(l)-12;this.vY=this.vX=null;
|
||||||
|
this.vAmpTypes=[1, 1.2, 1.4, 1.6, 1.8];this.vAmp=this.vAmpTypes[this.type]||1;this.melting=!1;this.meltFrameCount=a.meltFrameCount;this.meltFrames=a.meltFrames;this.twinkleFrame=this.meltFrame=0;this.active=1;this.fontSize=10+10*(this.type/5);this.o=f.createElement('div');this.o.innerHTML=a.snowCharacter;a.className&&this.o.setAttribute('class', a.className);this.o.style.color=a.snowColor;this.o.style.position=t?'fixed':'absolute';a.useGPU&&q.transform.prop&&(this.o.style[q.transform.prop]='translate3d(0px, 0px, 0px)');
|
||||||
|
this.o.style.width=a.flakeWidth+'px';this.o.style.height=a.flakeHeight+'px';this.o.style.fontFamily='arial,verdana';this.o.style.cursor='default';this.o.style.overflow='hidden';this.o.style.fontWeight='normal';this.o.style.zIndex=a.zIndex;C.appendChild(this.o);this.refresh=function(){
|
||||||
|
if(isNaN(b.x)||isNaN(b.y))return!1;a.setXY(b.o, b.x, b.y);
|
||||||
|
};this.stick=function(){
|
||||||
|
r||a.targetElement!==f.documentElement&&a.targetElement!==f.body?b.o.style.top=l+p-a.flakeHeight+'px':a.flakeBottom?b.o.style.top=a.flakeBottom+
|
||||||
|
'px':(b.o.style.display='none', b.o.style.bottom='0%', b.o.style.position='fixed', b.o.style.display='block');
|
||||||
|
};this.vCheck=function(){
|
||||||
|
0<=b.vX&&0.2>b.vX?b.vX=0.2:0>b.vX&&-0.2<b.vX&&(b.vX=-0.2);0<=b.vY&&0.2>b.vY&&(b.vY=0.2);
|
||||||
|
};this.move=function(){
|
||||||
|
var c=b.vX*v;b.x+=c;b.y+=b.vY*b.vAmp;b.x>=h||h-b.x<a.flakeWidth?b.x=0:0>c&&b.x-a.flakeLeftOffset<-a.flakeWidth&&(b.x=h-a.flakeWidth-1);b.refresh();l+p-b.y+a.flakeHeight<a.flakeHeight?(b.active=0, a.snowStick?b.stick():b.recycle()):(a.useMeltEffect&&(b.active&&3>
|
||||||
|
b.type&&!b.melting&&0.998<Math.random())&&(b.melting=!0, b.melt()), a.useTwinkleEffect&&(0>b.twinkleFrame?0.97<Math.random()&&(b.twinkleFrame=parseInt(8*Math.random(), 10)):(b.twinkleFrame--, u?b.o.style.opacity=b.twinkleFrame&&0===b.twinkleFrame%2?0:1:b.o.style.visibility=b.twinkleFrame&&0===b.twinkleFrame%2?'hidden':'visible')));
|
||||||
|
};this.animate=function(){
|
||||||
|
b.move();
|
||||||
|
};this.setVelocities=function(){
|
||||||
|
b.vX=z+k(0.12*a.vMaxX, 0.1);b.vY=A+k(0.12*a.vMaxY, 0.1);
|
||||||
|
};this.setOpacity=function(a, b){
|
||||||
|
if(!u)return!1;a.style.opacity=
|
||||||
|
b;
|
||||||
|
};this.melt=function(){
|
||||||
|
!a.useMeltEffect||!b.melting?b.recycle():b.meltFrame<b.meltFrameCount?(b.setOpacity(b.o, b.meltFrames[b.meltFrame]), b.o.style.fontSize=b.fontSize-b.fontSize*(b.meltFrame/b.meltFrameCount)+'px', b.o.style.lineHeight=a.flakeHeight+2+0.75*a.flakeHeight*(b.meltFrame/b.meltFrameCount)+'px', b.meltFrame++):b.recycle();
|
||||||
|
};this.recycle=function(){
|
||||||
|
b.o.style.display='none';b.o.style.position=t?'fixed':'absolute';b.o.style.bottom='auto';b.setVelocities();b.vCheck();b.meltFrame=0;b.melting=
|
||||||
|
!1;b.setOpacity(b.o, 1);b.o.style.padding='0px';b.o.style.margin='0px';b.o.style.fontSize=b.fontSize+'px';b.o.style.lineHeight=a.flakeHeight+2+'px';b.o.style.textAlign='center';b.o.style.verticalAlign='baseline';b.x=parseInt(k(h-a.flakeWidth-20), 10);b.y=parseInt(-1*k(l), 10)-a.flakeHeight;b.refresh();b.o.style.display='block';b.active=1;
|
||||||
|
};this.recycle();this.refresh();
|
||||||
|
};this.snow=function(){
|
||||||
|
var c=0, d=null, e, d=0;for(e=a.flakes.length;d<e;d++)1===a.flakes[d].active&&(a.flakes[d].move(), c++), a.flakes[d].melting&&
|
||||||
|
a.flakes[d].melt();c<a.flakesMaxActive&&(d=a.flakes[parseInt(k(a.flakes.length), 10)], 0===d.active&&(d.melting=!0));a.timer&&q.getAnimationFrame(a.snow);
|
||||||
|
};this.mouseMove=function(c){
|
||||||
|
if(!a.followMouse)return!0;c=parseInt(c.clientX, 10);c<n?v=-2+2*(c/n):(c-=n, v=2*(c/n));
|
||||||
|
};this.createSnow=function(c, d){
|
||||||
|
var e;for(e=0;e<c;e++)if(a.flakes[a.flakes.length]=new a.SnowFlake(parseInt(k(6), 10)), d||e>a.flakesMaxActive)a.flakes[a.flakes.length-1].active=-1;a.targetElement.appendChild(C);
|
||||||
|
};this.timerInit=function(){
|
||||||
|
a.timer=
|
||||||
|
!0;a.snow();
|
||||||
|
};this.init=function(){
|
||||||
|
var c;for(c=0;c<a.meltFrameCount;c++)a.meltFrames.push(1-c/a.meltFrameCount);a.randomizeWind();a.createSnow(a.flakesMax);a.events.add(g, 'resize', a.resizeHandler);a.events.add(g, 'scroll', a.scrollHandler);a.freezeOnBlur&&(m?(a.events.add(f, 'focusout', a.freeze), a.events.add(f, 'focusin', a.resume)):(a.events.add(g, 'blur', a.freeze), a.events.add(g, 'focus', a.resume)));a.resizeHandler();a.scrollHandler();a.followMouse&&a.events.add(m?f:g, 'mousemove', a.mouseMove);a.animationInterval=
|
||||||
|
Math.max(20, a.animationInterval);a.timerInit();
|
||||||
|
};this.start=function(c){
|
||||||
|
if(B){
|
||||||
|
if(c)return!0;
|
||||||
|
}else B=!0;if('string'===typeof a.targetElement&&(c=a.targetElement, a.targetElement=f.getElementById(c), !a.targetElement))throw Error('Snowstorm: Unable to get targetElement "'+c+'"');a.targetElement||(a.targetElement=f.body||f.documentElement);a.targetElement!==f.documentElement&&a.targetElement!==f.body&&(a.resizeHandler=a.resizeHandlerAlt, a.usePixelPosition=!0);a.resizeHandler();a.usePositionFixed=a.usePositionFixed&&
|
||||||
|
!r&&!a.flakeBottom;if(g.getComputedStyle)try{
|
||||||
|
w='relative'===g.getComputedStyle(a.targetElement, null).getPropertyValue('position');
|
||||||
|
}catch(d){
|
||||||
|
w=!1;
|
||||||
|
}t=a.usePositionFixed;h&&(l&&!a.disabled)&&(a.init(), a.active=!0);
|
||||||
|
};a.autoStart&&a.events.add(g, 'load', y, !1);return this;
|
||||||
|
}(window, document);
|
||||||
|
@ -4,9 +4,9 @@ module.exports = {
|
|||||||
require('postcss-flexbugs-fixes'),
|
require('postcss-flexbugs-fixes'),
|
||||||
require('postcss-preset-env')({
|
require('postcss-preset-env')({
|
||||||
autoprefixer: {
|
autoprefixer: {
|
||||||
flexbox: 'no-2009'
|
flexbox: 'no-2009',
|
||||||
},
|
},
|
||||||
stage: 3
|
stage: 3,
|
||||||
})
|
}),
|
||||||
]
|
],
|
||||||
}
|
};
|
||||||
|
Loading…
Reference in New Issue
Block a user