mirror of
https://github.com/glitch-soc/mastodon.git
synced 2025-12-13 07:49:29 +00:00
Compare commits
19 Commits
compose-re
...
more-front
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
da2b6dda6a | ||
|
|
ed82421870 | ||
|
|
b3904c2553 | ||
|
|
101a4c6913 | ||
|
|
11da74dbb7 | ||
|
|
51a86b32c3 | ||
|
|
51b783cdbc | ||
|
|
3915f06b02 | ||
|
|
07b1171c73 | ||
|
|
571576d6f7 | ||
|
|
7151ec7680 | ||
|
|
a4b3009c1c | ||
|
|
ef30a92c71 | ||
|
|
613aa55e03 | ||
|
|
88a08d54b6 | ||
|
|
3a69d70eae | ||
|
|
9c778f4abf | ||
|
|
ac61ce5826 | ||
|
|
73d6da32be |
71
README.md
71
README.md
@@ -1,70 +1,5 @@
|
|||||||
Mastodon
|
Mastodon Glitch Edition
|
||||||
========
|
========
|
||||||
|
Now with automated deploys!
|
||||||
|
|
||||||
[][travis]
|
So here's the deal: we all work on this code, and then it runs on dev.glitch.social and anyone who uses that does so absolutely at their own risk. can you dig it?
|
||||||
[][code_climate]
|
|
||||||
|
|
||||||
[travis]: https://travis-ci.org/tootsuite/mastodon
|
|
||||||
[code_climate]: https://codeclimate.com/github/tootsuite/mastodon
|
|
||||||
|
|
||||||
Mastodon is a free, open-source social network server. A decentralized solution to commercial platforms, it avoids the risks of a single company monopolizing your communication. Anyone can run Mastodon and participate in the social network seamlessly.
|
|
||||||
|
|
||||||
An alternative implementation of the GNU social project. Based on [ActivityStreams](https://en.wikipedia.org/wiki/Activity_Streams_(format)), [Webfinger](https://en.wikipedia.org/wiki/WebFinger), [PubsubHubbub](https://en.wikipedia.org/wiki/PubSubHubbub) and [Salmon](https://en.wikipedia.org/wiki/Salmon_(protocol)).
|
|
||||||
|
|
||||||
Click on the screenshot to watch a demo of the UI:
|
|
||||||
|
|
||||||
[][youtube_demo]
|
|
||||||
|
|
||||||
[youtube_demo]: https://www.youtube.com/watch?v=YO1jQ8_rAMU
|
|
||||||
|
|
||||||
The project focus is a clean REST API and a good user interface. Ruby on Rails is used for the back-end, while React.js and Redux are used for the dynamic front-end. A static front-end for public resources (profiles and statuses) is also provided.
|
|
||||||
|
|
||||||
If you would like, you can [support the development of this project on Patreon][patreon]. Alternatively, you can donate to this BTC address: `17j2g7vpgHhLuXhN4bueZFCvdxxieyRVWd`
|
|
||||||
|
|
||||||
[patreon]: https://www.patreon.com/user?u=619786
|
|
||||||
|
|
||||||
## Resources
|
|
||||||
|
|
||||||
- [List of Mastodon instances](https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/List-of-Mastodon-instances.md)
|
|
||||||
- [Use this tool to find Twitter friends on Mastodon](https://mastodon-bridge.herokuapp.com)
|
|
||||||
- [API overview](https://github.com/tootsuite/documentation/blob/master/Using-the-API/API.md)
|
|
||||||
- [Frequently Asked Questions](https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/FAQ.md)
|
|
||||||
- [List of apps](https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/Apps.md)
|
|
||||||
|
|
||||||
## Features
|
|
||||||
|
|
||||||
- **Fully interoperable with GNU social and any OStatus platform**
|
|
||||||
Whatever implements Atom feeds, ActivityStreams, Salmon, PubSubHubbub and Webfinger is part of the network
|
|
||||||
- **Real-time timeline updates**
|
|
||||||
See the updates of people you're following appear in real-time in the UI via WebSockets
|
|
||||||
- **Federated thread resolving**
|
|
||||||
If someone you follow replies to a user unknown to the server, the server fetches the full thread so you can view it without leaving the UI
|
|
||||||
- **Media attachments like images and WebM**
|
|
||||||
Upload and view images and WebM videos attached to the updates
|
|
||||||
- **OAuth2 and a straightforward REST API**
|
|
||||||
Mastodon acts as an OAuth2 provider so 3rd party apps can use the API, which is RESTful and simple
|
|
||||||
- **Background processing for long-running tasks**
|
|
||||||
Mastodon tries to be as fast and responsive as possible, so all long-running tasks that can be delegated to background processing, are
|
|
||||||
- **Deployable via Docker**
|
|
||||||
You don't need to mess with dependencies and configuration if you want to try Mastodon, if you have Docker and Docker Compose the deployment is extremely easy
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
Please follow the [development guide](https://github.com/tootsuite/documentation/blob/master/Running-Mastodon/Development-guide.md) from the documentation repository.
|
|
||||||
|
|
||||||
## Deployment
|
|
||||||
|
|
||||||
There are guides in the documentation repository for [deploying on various platforms](https://github.com/tootsuite/documentation#running-mastodon).
|
|
||||||
|
|
||||||
## Contributing
|
|
||||||
|
|
||||||
You can open issues for bugs you've found or features you think are missing. You can also submit pull requests to this repository. [Here are the guidelines for code contributions](CONTRIBUTING.md)
|
|
||||||
|
|
||||||
**IRC channel**: #mastodon on irc.freenode.net
|
|
||||||
|
|
||||||
## Extra credits
|
|
||||||
|
|
||||||
- The [Emoji One](https://github.com/Ranks/emojione) pack has been used for the emojis
|
|
||||||
- The error page image courtesy of [Dopatwo](https://www.youtube.com/user/dopatwo)
|
|
||||||
|
|
||||||

|
|
||||||
|
|||||||
@@ -9,6 +9,7 @@ class HomeController < ApplicationController
|
|||||||
@web_settings = Web::Setting.find_by(user: current_user)&.data || {}
|
@web_settings = Web::Setting.find_by(user: current_user)&.data || {}
|
||||||
@admin = Account.find_local(Setting.site_contact_username)
|
@admin = Account.find_local(Setting.site_contact_username)
|
||||||
@streaming_api_base_url = Rails.configuration.x.streaming_api_base_url
|
@streaming_api_base_url = Rails.configuration.x.streaming_api_base_url
|
||||||
|
@frontend = (params[:frontend] and Rails.configuration.x.available_frontends.include? params[:frontend] + '.js') ? params[:frontend] : 'mastodon'
|
||||||
end
|
end
|
||||||
|
|
||||||
private
|
private
|
||||||
|
|||||||
Binary file not shown.
|
Before Width: | Height: | Size: 34 KiB After Width: | Height: | Size: 45 KiB |
@@ -17,6 +17,7 @@ class IconButton extends React.PureComponent {
|
|||||||
disabled: PropTypes.bool,
|
disabled: PropTypes.bool,
|
||||||
inverted: PropTypes.bool,
|
inverted: PropTypes.bool,
|
||||||
animate: PropTypes.bool,
|
animate: PropTypes.bool,
|
||||||
|
flip: PropTypes.bool,
|
||||||
overlay: PropTypes.bool,
|
overlay: PropTypes.bool,
|
||||||
};
|
};
|
||||||
|
|
||||||
@@ -69,7 +70,7 @@ class IconButton extends React.PureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<Motion defaultStyle={{ rotate: this.props.active ? -360 : 0 }} style={{ rotate: this.props.animate ? spring(this.props.active ? -360 : 0, { stiffness: 120, damping: 7 }) : 0 }}>
|
<Motion defaultStyle={{ rotate: this.props.active ? (this.props.flip ? -180 : -360) : 0 }} style={{ rotate: this.props.animate ? spring(this.props.active ? (this.props.flip ? -180 : -360) : 0, { stiffness: this.props.flip ? 60 : 120, damping: 7 }) : 0 }}>
|
||||||
{({ rotate }) =>
|
{({ rotate }) =>
|
||||||
<button
|
<button
|
||||||
aria-label={this.props.title}
|
aria-label={this.props.title}
|
||||||
|
|||||||
@@ -3,19 +3,24 @@ import ImmutablePropTypes from 'react-immutable-proptypes';
|
|||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import Avatar from './avatar';
|
import Avatar from './avatar';
|
||||||
import AvatarOverlay from './avatar_overlay';
|
import AvatarOverlay from './avatar_overlay';
|
||||||
import RelativeTimestamp from './relative_timestamp';
|
|
||||||
import DisplayName from './display_name';
|
import DisplayName from './display_name';
|
||||||
import MediaGallery from './media_gallery';
|
import MediaGallery from './media_gallery';
|
||||||
import VideoPlayer from './video_player';
|
import VideoPlayer from './video_player';
|
||||||
import AttachmentList from './attachment_list';
|
import AttachmentList from './attachment_list';
|
||||||
import StatusContent from './status_content';
|
import StatusContent from './status_content';
|
||||||
import StatusActionBar from './status_action_bar';
|
import StatusActionBar from './status_action_bar';
|
||||||
import { FormattedMessage } from 'react-intl';
|
import IconButton from './icon_button';
|
||||||
|
import { defineMessages, injectIntl, FormattedMessage } from 'react-intl';
|
||||||
import emojify from '../emoji';
|
import emojify from '../emoji';
|
||||||
import escapeTextContentForBrowser from 'escape-html';
|
import escapeTextContentForBrowser from 'escape-html';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
|
import scheduleIdleTask from '../features/ui/util/schedule_idle_task';
|
||||||
|
|
||||||
|
const messages = defineMessages({
|
||||||
|
collapse: { id: 'status.collapse', defaultMessage: 'Collapse' },
|
||||||
|
uncollapse: { id: 'status.uncollapse', defaultMessage: 'Uncollapse' },
|
||||||
|
});
|
||||||
|
|
||||||
class Status extends ImmutablePureComponent {
|
class Status extends ImmutablePureComponent {
|
||||||
|
|
||||||
static contextTypes = {
|
static contextTypes = {
|
||||||
@@ -38,12 +43,14 @@ class Status extends ImmutablePureComponent {
|
|||||||
autoPlayGif: PropTypes.bool,
|
autoPlayGif: PropTypes.bool,
|
||||||
muted: PropTypes.bool,
|
muted: PropTypes.bool,
|
||||||
intersectionObserverWrapper: PropTypes.object,
|
intersectionObserverWrapper: PropTypes.object,
|
||||||
|
intl: PropTypes.object.isRequired,
|
||||||
};
|
};
|
||||||
|
|
||||||
state = {
|
state = {
|
||||||
isExpanded: false,
|
isExpanded: false,
|
||||||
isIntersecting: true, // assume intersecting until told otherwise
|
isIntersecting: true, // assume intersecting until told otherwise
|
||||||
isHidden: false, // set to true in requestIdleCallback to trigger un-render
|
isHidden: false, // set to true in requestIdleCallback to trigger un-render
|
||||||
|
isCollapsed: false,
|
||||||
}
|
}
|
||||||
|
|
||||||
// Avoid checking props that are functions (and whose equality will always
|
// Avoid checking props that are functions (and whose equality will always
|
||||||
@@ -61,7 +68,11 @@ class Status extends ImmutablePureComponent {
|
|||||||
updateOnStates = ['isExpanded']
|
updateOnStates = ['isExpanded']
|
||||||
|
|
||||||
shouldComponentUpdate (nextProps, nextState) {
|
shouldComponentUpdate (nextProps, nextState) {
|
||||||
if (!nextState.isIntersecting && nextState.isHidden) {
|
if (nextState.isCollapsed !== this.state.isCollapsed) {
|
||||||
|
// If the collapsed state of the element has changed then we definitely
|
||||||
|
// need to re-update.
|
||||||
|
return true;
|
||||||
|
} else if (!nextState.isIntersecting && nextState.isHidden) {
|
||||||
// It's only if we're not intersecting (i.e. offscreen) and isHidden is true
|
// It's only if we're not intersecting (i.e. offscreen) and isHidden is true
|
||||||
// that either "isIntersecting" or "isHidden" matter, and then they're
|
// that either "isIntersecting" or "isHidden" matter, and then they're
|
||||||
// the only things that matter.
|
// the only things that matter.
|
||||||
@@ -75,7 +86,13 @@ class Status extends ImmutablePureComponent {
|
|||||||
return super.shouldComponentUpdate(nextProps, nextState);
|
return super.shouldComponentUpdate(nextProps, nextState);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
componentDidUpdate (prevProps, prevState) {
|
||||||
|
if (prevState.isCollapsed !== this.state.isCollapsed) this.saveHeight();
|
||||||
|
}
|
||||||
|
|
||||||
componentDidMount () {
|
componentDidMount () {
|
||||||
|
const node = this.node;
|
||||||
|
|
||||||
if (!this.props.intersectionObserverWrapper) {
|
if (!this.props.intersectionObserverWrapper) {
|
||||||
// TODO: enable IntersectionObserver optimization for notification statuses.
|
// TODO: enable IntersectionObserver optimization for notification statuses.
|
||||||
// These are managed in notifications/index.js rather than status_list.js
|
// These are managed in notifications/index.js rather than status_list.js
|
||||||
@@ -87,6 +104,8 @@ class Status extends ImmutablePureComponent {
|
|||||||
this.handleIntersection
|
this.handleIntersection
|
||||||
);
|
);
|
||||||
|
|
||||||
|
if (node.clientHeight > 400) this.setState({ isCollapsed: true });
|
||||||
|
|
||||||
this.componentMounted = true;
|
this.componentMounted = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -151,11 +170,15 @@ class Status extends ImmutablePureComponent {
|
|||||||
this.setState({ isExpanded: !this.state.isExpanded });
|
this.setState({ isExpanded: !this.state.isExpanded });
|
||||||
};
|
};
|
||||||
|
|
||||||
|
handleCollapsedClick = () => {
|
||||||
|
this.setState({ isCollapsed: !this.state.isCollapsed });
|
||||||
|
}
|
||||||
|
|
||||||
render () {
|
render () {
|
||||||
let media = null;
|
let media = null;
|
||||||
let statusAvatar;
|
let statusAvatar;
|
||||||
const { status, account, ...other } = this.props;
|
const { status, account, intl, ...other } = this.props;
|
||||||
const { isExpanded, isIntersecting, isHidden } = this.state;
|
const { isExpanded, isIntersecting, isHidden, isCollapsed } = this.state;
|
||||||
|
|
||||||
if (status === null) {
|
if (status === null) {
|
||||||
return null;
|
return null;
|
||||||
@@ -208,9 +231,17 @@ class Status extends ImmutablePureComponent {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={`status ${this.props.muted ? 'muted' : ''} status-${status.get('visibility')}`} data-id={status.get('id')} ref={this.handleRef}>
|
<div className={`status ${this.props.muted ? 'muted' : ''} status-${status.get('visibility')} ${isCollapsed ? 'status-collapsed' : ''}`} data-id={status.get('id')} ref={this.handleRef}>
|
||||||
<div className='status__info'>
|
<div className='status__info'>
|
||||||
<a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener'><RelativeTimestamp timestamp={status.get('created_at')} /></a>
|
|
||||||
|
<IconButton
|
||||||
|
className='status__collapse-button'
|
||||||
|
animate flip
|
||||||
|
active={isCollapsed}
|
||||||
|
title={isCollapsed ? intl.formatMessage(messages.uncollapse) : intl.formatMessage(messages.collapse)}
|
||||||
|
icon='angle-double-up'
|
||||||
|
onClick={this.handleCollapsedClick}
|
||||||
|
/>
|
||||||
|
|
||||||
<a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} className='status__display-name'>
|
<a onClick={this.handleAccountClick} data-id={status.getIn(['account', 'id'])} href={status.getIn(['account', 'url'])} className='status__display-name'>
|
||||||
<div className='status__avatar'>
|
<div className='status__avatar'>
|
||||||
@@ -219,17 +250,18 @@ class Status extends ImmutablePureComponent {
|
|||||||
|
|
||||||
<DisplayName account={status.get('account')} />
|
<DisplayName account={status.get('account')} />
|
||||||
</a>
|
</a>
|
||||||
|
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<StatusContent status={status} onClick={this.handleClick} expanded={isExpanded} onExpandedToggle={this.handleExpandedToggle} onHeightUpdate={this.saveHeight} />
|
<StatusContent status={status} onClick={this.handleClick} expanded={isExpanded} onExpandedToggle={this.handleExpandedToggle} onHeightUpdate={this.saveHeight} />
|
||||||
|
|
||||||
{media}
|
{isCollapsed ? null : media}
|
||||||
|
|
||||||
<StatusActionBar {...this.props} />
|
{isCollapsed ? null : <StatusActionBar {...this.props} />}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
export default Status;
|
export default injectIntl(Status);
|
||||||
|
|||||||
@@ -5,6 +5,7 @@ import IconButton from './icon_button';
|
|||||||
import DropdownMenu from './dropdown_menu';
|
import DropdownMenu from './dropdown_menu';
|
||||||
import { defineMessages, injectIntl } from 'react-intl';
|
import { defineMessages, injectIntl } from 'react-intl';
|
||||||
import ImmutablePureComponent from 'react-immutable-pure-component';
|
import ImmutablePureComponent from 'react-immutable-pure-component';
|
||||||
|
import RelativeTimestamp from './relative_timestamp';
|
||||||
|
|
||||||
const messages = defineMessages({
|
const messages = defineMessages({
|
||||||
delete: { id: 'status.delete', defaultMessage: 'Delete' },
|
delete: { id: 'status.delete', defaultMessage: 'Delete' },
|
||||||
@@ -144,6 +145,8 @@ class StatusActionBar extends ImmutablePureComponent {
|
|||||||
<div className='status__action-bar-dropdown'>
|
<div className='status__action-bar-dropdown'>
|
||||||
<DropdownMenu items={menu} icon='ellipsis-h' size={18} direction='right' ariaLabel='More' />
|
<DropdownMenu items={menu} icon='ellipsis-h' size={18} direction='right' ariaLabel='More' />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<a href={status.get('url')} className='status__relative-time' target='_blank' rel='noopener'><RelativeTimestamp timestamp={status.get('created_at')} /></a>
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -16,6 +16,57 @@ const messages = defineMessages({
|
|||||||
requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' },
|
requested: { id: 'account.requested', defaultMessage: 'Awaiting approval' },
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/*
|
||||||
|
THIS IS A MESS BECAUSE EFFING MASTODON AND ITS EFFING HTML BIOS
|
||||||
|
INSTEAD OF JUST STORING EVERYTHING IN PLAIN EFFING TEXT ! ! ! !
|
||||||
|
BLANK LINES ALSO WON'T WORK BECAUSE RIGHT NOW MASTODON CONVERTS
|
||||||
|
THOSE INTO `<P>` ELEMENTS INSTEAD OF LEAVING IT AS `<BR><BR>` !
|
||||||
|
TL:DR; THIS IS LARGELY A HACK. WITH BETTER BACKEND STUFF WE CAN
|
||||||
|
IMPROVE THIS BY BETTER PREDICTING HOW THE METADATA WILL BE SENT
|
||||||
|
WHILE MAINTAINING BASIC PLAIN-TEXT PROCESSING. THE OTHER OPTION
|
||||||
|
IS TO TURN ALL BIOS INTO PLAIN-TEXT VIA A TREE-WALKER, AND THEN
|
||||||
|
PROCESS THE YAML AND LINKS AND EVERYTHING OURSELVES. THIS WOULD
|
||||||
|
BE INCREDIBLY COMPLICATED, AND IT WOULD BE A MILLION TIMES LESS
|
||||||
|
DIFFICULT IF MASTODON JUST GAVE US PLAIN-TEXT BIOS (WHICH QUITE
|
||||||
|
FRANKLY MAKES THE MOST SENSE SINCE THAT'S WHAT USERS PROVIDE IN
|
||||||
|
SETTINGS) TO BEGIN WITH AND LEFT ALL PROCESSING TO THE FRONTEND
|
||||||
|
TO HANDLE ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
|
||||||
|
ANYWAY I KNOW WHAT NEEDS TO BE DONE REGARDING BACKEND STUFF BUT
|
||||||
|
I'M NOT SMART ENOUGH TO FIGURE OUT HOW TO ACTUALLY IMPLEMENT IT
|
||||||
|
SO FEEL FREE TO @ ME IF YOU NEED MY IDEAS REGARDING THAT. UNTIL
|
||||||
|
THEN WE'LL JUST HAVE TO MAKE DO WITH THIS MESSY AND UNFORTUNATE
|
||||||
|
HACKING ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! ! !
|
||||||
|
|
||||||
|
with love,
|
||||||
|
@kibi@glitch.social <3
|
||||||
|
*/
|
||||||
|
|
||||||
|
const NEW_LINE = /(?:^|\r?\n|<br\s*\/?>)/g
|
||||||
|
const YAML_OPENER = /---/;
|
||||||
|
const YAML_CLOSER = /(?:---|\.\.\.)/;
|
||||||
|
const YAML_STRING = /(?:"(?:[^"\n]){1,32}"|'(?:[^'\n]){1,32}'|(?:[^'":\n]){1,32})/g;
|
||||||
|
const YAML_LINE = new RegExp("\\s*" + YAML_STRING.source + "\\s*:\\s*" + YAML_STRING.source + "\\s*", "g");
|
||||||
|
const BIO_REGEX = new RegExp(NEW_LINE.source + "*" + YAML_OPENER.source + NEW_LINE.source + "+(?:" + YAML_LINE.source + NEW_LINE.source + "+){0,4}" + YAML_CLOSER.source + NEW_LINE.source + "*");
|
||||||
|
|
||||||
|
const processBio = (data) => {
|
||||||
|
let props = {text: data, metadata: []};
|
||||||
|
let yaml = data.match(BIO_REGEX);
|
||||||
|
if (!yaml) return props;
|
||||||
|
else yaml = yaml[0];
|
||||||
|
let start = props.text.indexOf(yaml);
|
||||||
|
let end = start + yaml.length;
|
||||||
|
props.text = props.text.substr(0, start) + props.text.substr(end);
|
||||||
|
yaml = yaml.replace(NEW_LINE, "\n");
|
||||||
|
let metadata = (yaml ? yaml.match(YAML_LINE) : []) || [];
|
||||||
|
for (let i = 0; i < metadata.length; i++) {
|
||||||
|
let result = metadata[i].match(YAML_STRING);
|
||||||
|
if (result[0][0] === '"' || result[0][0] === "'") result[0] = result[0].substr(1, result[0].length - 2);
|
||||||
|
if (result[1][0] === '"' || result[1][0] === "'") result[0] = result[1].substr(1, result[1].length - 2);
|
||||||
|
props.metadata.push(result);
|
||||||
|
}
|
||||||
|
return props;
|
||||||
|
};
|
||||||
|
|
||||||
const makeMapStateToProps = () => {
|
const makeMapStateToProps = () => {
|
||||||
const mapStateToProps = (state, props) => ({
|
const mapStateToProps = (state, props) => ({
|
||||||
autoPlayGif: state.getIn(['meta', 'auto_play_gif']),
|
autoPlayGif: state.getIn(['meta', 'auto_play_gif']),
|
||||||
@@ -120,21 +171,44 @@ class Header extends ImmutablePureComponent {
|
|||||||
lockedIcon = <i className='fa fa-lock' />;
|
lockedIcon = <i className='fa fa-lock' />;
|
||||||
}
|
}
|
||||||
|
|
||||||
const content = { __html: emojify(account.get('note')) };
|
const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) };
|
||||||
const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) };
|
const { text, metadata } = processBio(account.get('note'));
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className='account__header' style={{ backgroundImage: `url(${account.get('header')})` }}>
|
<div className='account__header__wrapper'>
|
||||||
<div>
|
<div className='account__header' style={{ backgroundImage: `url(${account.get('header')})` }}>
|
||||||
<Avatar account={account} autoPlayGif={this.props.autoPlayGif} />
|
<div>
|
||||||
|
<Avatar account={account} autoPlayGif={this.props.autoPlayGif} />
|
||||||
|
|
||||||
<span className='account__header__display-name' dangerouslySetInnerHTML={displayNameHTML} />
|
<span className='account__header__display-name' dangerouslySetInnerHTML={displayNameHTML} />
|
||||||
<span className='account__header__username'>@{account.get('acct')} {lockedIcon}</span>
|
<span className='account__header__username'>@{account.get('acct')} {lockedIcon}</span>
|
||||||
<div className='account__header__content' dangerouslySetInnerHTML={content} />
|
<div className='account__header__content' dangerouslySetInnerHTML={{__html: emojify(text)}} />
|
||||||
|
|
||||||
{info}
|
{info}
|
||||||
{actionBtn}
|
{actionBtn}
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
{metadata.length && (
|
||||||
|
<div className='account__metadata'>
|
||||||
|
{(() => {
|
||||||
|
let data = [];
|
||||||
|
for (let i = 0; i < metadata.length; i++) {
|
||||||
|
data.push(
|
||||||
|
<div
|
||||||
|
className='account__metadata-item'
|
||||||
|
title={metadata[i][0] + ":" + metadata[i][1]}
|
||||||
|
key={i}
|
||||||
|
>
|
||||||
|
<span dangerouslySetInnerHTML={{__html: emojify(metadata[i][0])}} />
|
||||||
|
<strong dangerouslySetInnerHTML={{__html: emojify(metadata[i][1])}} />
|
||||||
|
</div>
|
||||||
|
);
|
||||||
|
}
|
||||||
|
return data;
|
||||||
|
})()}
|
||||||
|
</div>
|
||||||
|
) || null}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -191,6 +191,14 @@
|
|||||||
{
|
{
|
||||||
"defaultMessage": "{name} boosted",
|
"defaultMessage": "{name} boosted",
|
||||||
"id": "status.reblogged_by"
|
"id": "status.reblogged_by"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Collapse",
|
||||||
|
"id": "status.collapse"
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"defaultMessage": "Uncollapse",
|
||||||
|
"id": "status.uncollapse"
|
||||||
}
|
}
|
||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/components/status.json"
|
"path": "app/javascript/mastodon/components/status.json"
|
||||||
@@ -1170,4 +1178,4 @@
|
|||||||
],
|
],
|
||||||
"path": "app/javascript/mastodon/features/ui/components/video_modal.json"
|
"path": "app/javascript/mastodon/features/ui/components/video_modal.json"
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|||||||
@@ -143,6 +143,7 @@
|
|||||||
"search.placeholder": "Search",
|
"search.placeholder": "Search",
|
||||||
"search_results.total": "{count, number} {count, plural, one {result} other {results}}",
|
"search_results.total": "{count, number} {count, plural, one {result} other {results}}",
|
||||||
"status.cannot_reblog": "This post cannot be boosted",
|
"status.cannot_reblog": "This post cannot be boosted",
|
||||||
|
"status.collapse": "Collapse",
|
||||||
"status.delete": "Delete",
|
"status.delete": "Delete",
|
||||||
"status.favourite": "Favourite",
|
"status.favourite": "Favourite",
|
||||||
"status.load_more": "Load more",
|
"status.load_more": "Load more",
|
||||||
@@ -159,6 +160,7 @@
|
|||||||
"status.sensitive_warning": "Sensitive content",
|
"status.sensitive_warning": "Sensitive content",
|
||||||
"status.show_less": "Show less",
|
"status.show_less": "Show less",
|
||||||
"status.show_more": "Show more",
|
"status.show_more": "Show more",
|
||||||
|
"status.uncollapse": "Uncollapse",
|
||||||
"status.unmute_conversation": "Unmute conversation",
|
"status.unmute_conversation": "Unmute conversation",
|
||||||
"tabs_bar.compose": "Compose",
|
"tabs_bar.compose": "Compose",
|
||||||
"tabs_bar.federated_timeline": "Federated",
|
"tabs_bar.federated_timeline": "Federated",
|
||||||
|
|||||||
0
app/javascript/modules/.keep
Normal file
0
app/javascript/modules/.keep
Normal file
@@ -1,2 +1,3 @@
|
|||||||
import { start } from 'rails-ujs';
|
import { start } from 'rails-ujs';
|
||||||
|
require('../mastodon/locales');
|
||||||
start();
|
start();
|
||||||
|
|||||||
1
app/javascript/packs/custom.js
Normal file
1
app/javascript/packs/custom.js
Normal file
@@ -0,0 +1 @@
|
|||||||
|
require('../styles/custom.scss');
|
||||||
6
app/javascript/packs/frontends/mastodon.js
Normal file
6
app/javascript/packs/frontends/mastodon.js
Normal file
@@ -0,0 +1,6 @@
|
|||||||
|
import main from '../../mastodon/main';
|
||||||
|
import loadPolyfills from '../../mastodon/load_polyfills';
|
||||||
|
|
||||||
|
loadPolyfills().then(main).catch(e => {
|
||||||
|
console.error(e);
|
||||||
|
});
|
||||||
@@ -456,9 +456,11 @@
|
|||||||
.reply-indicator__content {
|
.reply-indicator__content {
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
line-height: 20px;
|
line-height: 20px;
|
||||||
|
color: $primary-text-color;
|
||||||
word-wrap: break-word;
|
word-wrap: break-word;
|
||||||
font-weight: 400;
|
font-weight: 400;
|
||||||
overflow: hidden;
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
white-space: pre-wrap;
|
white-space: pre-wrap;
|
||||||
|
|
||||||
.emojione {
|
.emojione {
|
||||||
@@ -542,8 +544,10 @@
|
|||||||
padding: 8px 10px;
|
padding: 8px 10px;
|
||||||
padding-left: 68px;
|
padding-left: 68px;
|
||||||
position: relative;
|
position: relative;
|
||||||
|
height: auto;
|
||||||
min-height: 48px;
|
min-height: 48px;
|
||||||
border-bottom: 1px solid lighten($ui-base-color, 8%);
|
border-bottom: 1px solid lighten($ui-base-color, 8%);
|
||||||
|
overflow: hidden;
|
||||||
cursor: default;
|
cursor: default;
|
||||||
|
|
||||||
@keyframes fade {
|
@keyframes fade {
|
||||||
@@ -598,6 +602,14 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
&.status-collapsed {
|
||||||
|
height: 48px;
|
||||||
|
|
||||||
|
.status__content {
|
||||||
|
height: 20px;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.notification-favourite {
|
.notification-favourite {
|
||||||
@@ -611,8 +623,8 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.status__relative-time {
|
.status__relative-time {
|
||||||
|
margin-left: auto;
|
||||||
color: lighten($ui-base-color, 26%);
|
color: lighten($ui-base-color, 26%);
|
||||||
float: right;
|
|
||||||
font-size: 14px;
|
font-size: 14px;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -627,7 +639,13 @@
|
|||||||
}
|
}
|
||||||
|
|
||||||
.status__info {
|
.status__info {
|
||||||
|
margin: 2px 0 0;
|
||||||
font-size: 15px;
|
font-size: 15px;
|
||||||
|
line-height: 24px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status__collapse-button {
|
||||||
|
float: right;
|
||||||
}
|
}
|
||||||
|
|
||||||
.status-check-box {
|
.status-check-box {
|
||||||
@@ -820,9 +838,12 @@
|
|||||||
padding: 10px;
|
padding: 10px;
|
||||||
}
|
}
|
||||||
|
|
||||||
.account__header {
|
.account__header__wrapper {
|
||||||
flex: 0 0 auto;
|
flex: 0 0 auto;
|
||||||
background: lighten($ui-base-color, 4%);
|
background: lighten($ui-base-color, 4%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.account__header {
|
||||||
text-align: center;
|
text-align: center;
|
||||||
background-size: cover;
|
background-size: cover;
|
||||||
background-position: center;
|
background-position: center;
|
||||||
@@ -887,6 +908,42 @@
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
.account__metadata {
|
||||||
|
display: block;
|
||||||
|
font-size: 15px;
|
||||||
|
line-height: 36px;
|
||||||
|
overflow: hidden;
|
||||||
|
|
||||||
|
.account__metadata-item {
|
||||||
|
display: flex;
|
||||||
|
flex-direction: row;
|
||||||
|
border-top: 1px solid lighten($ui-base-color, 8%);
|
||||||
|
|
||||||
|
& > span, & > strong {
|
||||||
|
display: inline-block;
|
||||||
|
padding: 10px 20px;
|
||||||
|
overflow: hidden;
|
||||||
|
text-overflow: ellipsis;
|
||||||
|
white-space: nowrap;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > span {
|
||||||
|
flex: 0 0 auto;
|
||||||
|
width: 120px;
|
||||||
|
color: $ui-primary-color;
|
||||||
|
background: lighten($ui-base-color, 13%);
|
||||||
|
font-variant: small-caps;
|
||||||
|
}
|
||||||
|
|
||||||
|
& > strong {
|
||||||
|
flex: auto;
|
||||||
|
color: $primary-text-color;
|
||||||
|
background: $ui-base-color;
|
||||||
|
font-weight: bold;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
.account__action-bar {
|
.account__action-bar {
|
||||||
border-top: 1px solid lighten($ui-base-color, 8%);
|
border-top: 1px solid lighten($ui-base-color, 8%);
|
||||||
border-bottom: 1px solid lighten($ui-base-color, 8%);
|
border-bottom: 1px solid lighten($ui-base-color, 8%);
|
||||||
|
|||||||
123
app/javascript/styles/custom.scss
Normal file
123
app/javascript/styles/custom.scss
Normal file
@@ -0,0 +1,123 @@
|
|||||||
|
@import 'application';
|
||||||
|
|
||||||
|
@media screen and (min-width: 1300px) {
|
||||||
|
.column {
|
||||||
|
flex-grow: 1 !important;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer {
|
||||||
|
flex-grow: 1 !important;
|
||||||
|
flex-basis: 200px !important;
|
||||||
|
min-width: 268px;
|
||||||
|
max-width: 400px;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.muted {
|
||||||
|
.status__content p, .status__content a {
|
||||||
|
color: lighten($ui-base-color, 35%);
|
||||||
|
}
|
||||||
|
|
||||||
|
.status__display-name strong {
|
||||||
|
color: lighten($ui-base-color, 35%);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
.status time:after,
|
||||||
|
.detailed-status__datetime span:after {
|
||||||
|
font: normal normal normal 14px/1 FontAwesome;
|
||||||
|
content: "\00a0\00a0\f08e";
|
||||||
|
}
|
||||||
|
|
||||||
|
.compose-form__buttons button.active:last-child {
|
||||||
|
color:$ui-secondary-color;
|
||||||
|
background-color: $ui-highlight-color;
|
||||||
|
border-radius:3px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.about-body .mascot {
|
||||||
|
display:none;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screenshot-with-signup {
|
||||||
|
min-height:300px;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screenshot-with-signup .closed-registrations-message,
|
||||||
|
.screenshot-with-signup form {
|
||||||
|
background-color: rgba(0,0,0,0.7);
|
||||||
|
margin:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.screenshot-with-signup .closed-registrations-message .clock {
|
||||||
|
font-size:150%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer .drawer__inner {
|
||||||
|
overflow: visible;
|
||||||
|
height:inherit;
|
||||||
|
}
|
||||||
|
|
||||||
|
.drawer__pager {
|
||||||
|
overflow-y:auto;
|
||||||
|
}
|
||||||
|
|
||||||
|
.column {
|
||||||
|
// trying to fix @mdhughes safari problem
|
||||||
|
max-height:100vh;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
.media-gallery {
|
||||||
|
height:auto !important;
|
||||||
|
max-height:30vh;
|
||||||
|
position:relative;
|
||||||
|
margin-top:20px;
|
||||||
|
margin-left:-68px;
|
||||||
|
width: calc(100% + 80px);
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-gallery:before{
|
||||||
|
content: "";
|
||||||
|
display: block;
|
||||||
|
padding-top: 100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-gallery__item,
|
||||||
|
.media-gallery .media-spoiler{
|
||||||
|
left: 0;
|
||||||
|
right: 0;
|
||||||
|
top: 0;
|
||||||
|
bottom: 0 !important;
|
||||||
|
position:absolute;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-spoiler-video:before {
|
||||||
|
content:"";
|
||||||
|
display:block;
|
||||||
|
padding-top:100%;
|
||||||
|
}
|
||||||
|
|
||||||
|
.media-spoiler-video,
|
||||||
|
.status__video-player,
|
||||||
|
.detailed-status > .media-spoiler,
|
||||||
|
.status > .media-spoiler {
|
||||||
|
height:auto !important;
|
||||||
|
max-height:30vh;
|
||||||
|
position:relative;
|
||||||
|
margin-top:20px;
|
||||||
|
margin-left:-68px;
|
||||||
|
width: calc(100% + 80px) !important;
|
||||||
|
}
|
||||||
|
|
||||||
|
.status__video-player-video {
|
||||||
|
transform:unset;
|
||||||
|
}
|
||||||
|
|
||||||
|
.detailed-status > .media-spoiler,
|
||||||
|
.status > .media-spoiler {
|
||||||
|
height:30vh !important;
|
||||||
|
vertical-align:middle;
|
||||||
|
}
|
||||||
@@ -1,7 +1,7 @@
|
|||||||
# frozen_string_literal: true
|
# frozen_string_literal: true
|
||||||
|
|
||||||
class StatusLengthValidator < ActiveModel::Validator
|
class StatusLengthValidator < ActiveModel::Validator
|
||||||
MAX_CHARS = 500
|
MAX_CHARS = 512
|
||||||
|
|
||||||
def validate(status)
|
def validate(status)
|
||||||
return unless status.local? && !status.reblog?
|
return unless status.local? && !status.reblog?
|
||||||
|
|||||||
@@ -9,4 +9,4 @@
|
|||||||
%li= link_to t('about.get_started'), new_user_registration_path
|
%li= link_to t('about.get_started'), new_user_registration_path
|
||||||
%li= link_to t('auth.login'), new_user_session_path
|
%li= link_to t('auth.login'), new_user_session_path
|
||||||
%li= link_to t('about.terms'), terms_path
|
%li= link_to t('about.terms'), terms_path
|
||||||
%li= link_to t('about.source_code'), 'https://github.com/tootsuite/mastodon'
|
%li= link_to t('about.source_code'), 'https://github.com/chronister/mastodon'
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
.info
|
.info
|
||||||
= link_to t('auth.login'), new_user_session_path, class: 'webapp-btn'
|
= link_to t('auth.login'), new_user_session_path, class: 'webapp-btn'
|
||||||
·
|
·
|
||||||
= link_to t('about.other_instances'), 'https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/List-of-Mastodon-instances.md'
|
= link_to t('about.other_instances'), 'https://instances.mastodon.xyz/'
|
||||||
·
|
·
|
||||||
= link_to t('about.about_this'), about_more_path
|
= link_to t('about.about_this'), about_more_path
|
||||||
|
|
||||||
@@ -82,6 +82,6 @@
|
|||||||
·
|
·
|
||||||
= link_to t('about.apps'), 'https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/Apps.md'
|
= link_to t('about.apps'), 'https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/Apps.md'
|
||||||
·
|
·
|
||||||
= link_to t('about.source_code'), 'https://github.com/tootsuite/mastodon'
|
= link_to t('about.source_code'), 'https://github.com/chronister/mastodon'
|
||||||
·
|
·
|
||||||
= link_to t('about.other_instances'), 'https://github.com/tootsuite/documentation/blob/master/Using-Mastodon/List-of-Mastodon-instances.md'
|
= link_to t('about.other_instances'), 'https://instances.mastodon.xyz/'
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
- content_for :header_tags do
|
- content_for :header_tags do
|
||||||
%script#initial-state{ type: 'application/json' }!= json_escape(render(file: 'home/initial_state', formats: :json))
|
%script#initial-state{ type: 'application/json' }!= json_escape(render(file: 'home/initial_state', formats: :json))
|
||||||
|
|
||||||
= javascript_pack_tag 'application', integrity: true, crossorigin: 'anonymous'
|
= javascript_pack_tag "frontends/#{@frontend}", integrity: true, crossorigin: 'anonymous'
|
||||||
|
= stylesheet_pack_tag "frontends/#{@frontend}", integrity: true, media: 'all'
|
||||||
|
|
||||||
.app-holder#mastodon{ data: { props: Oj.dump(default_props) } }
|
.app-holder#mastodon{ data: { props: Oj.dump(default_props) } }
|
||||||
%noscript
|
%noscript
|
||||||
|
|||||||
@@ -18,11 +18,13 @@
|
|||||||
= ' - '
|
= ' - '
|
||||||
= title
|
= title
|
||||||
|
|
||||||
= stylesheet_pack_tag 'application', media: 'all'
|
|
||||||
= javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
|
= javascript_pack_tag 'common', integrity: true, crossorigin: 'anonymous'
|
||||||
= javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
|
= javascript_pack_tag "locale_#{I18n.locale}", integrity: true, crossorigin: 'anonymous'
|
||||||
= csrf_meta_tags
|
= csrf_meta_tags
|
||||||
|
|
||||||
|
- if controller_name != 'home'
|
||||||
|
= stylesheet_pack_tag 'application', integrity: true, media: 'all'
|
||||||
|
|
||||||
= yield :header_tags
|
= yield :header_tags
|
||||||
|
|
||||||
- body_classes ||= @body_classes
|
- body_classes ||= @body_classes
|
||||||
|
|||||||
@@ -67,12 +67,17 @@ module Mastodon
|
|||||||
|
|
||||||
config.active_job.queue_adapter = :sidekiq
|
config.active_job.queue_adapter = :sidekiq
|
||||||
|
|
||||||
|
#config.middleware.insert_before 0, Rack::Cors, debug: true, logger: (-> { Rails.logger }) do
|
||||||
config.middleware.insert_before 0, Rack::Cors do
|
config.middleware.insert_before 0, Rack::Cors do
|
||||||
allow do
|
allow do
|
||||||
origins '*'
|
origins '*'
|
||||||
resource '/@:username', headers: :any, methods: [:get], credentials: false
|
resource '/@:username', headers: :any, methods: [:get], credentials: false
|
||||||
resource '/api/*', headers: :any, methods: [:post, :put, :delete, :get, :patch, :options], credentials: false, expose: ['Link', 'X-RateLimit-Reset', 'X-RateLimit-Limit', 'X-RateLimit-Remaining', 'X-Request-Id']
|
resource '/api/*', headers: :any, methods: [:post, :put, :delete, :get, :patch, :options], credentials: false, expose: ['Link', 'X-RateLimit-Reset', 'X-RateLimit-Limit', 'X-RateLimit-Remaining', 'X-Request-Id']
|
||||||
resource '/oauth/token', headers: :any, methods: [:post], credentials: false
|
resource '/oauth/token', headers: :any, methods: [:post], credentials: false
|
||||||
|
resource '/assets/*', headers: :any, methods: [:get, :head, :options]
|
||||||
|
resource '/stylesheets/*', headers: :any, methods: [:get, :head, :options]
|
||||||
|
resource '/javascripts/*', headers: :any, methods: [:get, :head, :options]
|
||||||
|
resource '/packs/*', headers: :any, methods: [:get, :head, :options]
|
||||||
end
|
end
|
||||||
end
|
end
|
||||||
|
|
||||||
|
|||||||
@@ -93,9 +93,12 @@ Rails.application.configure do
|
|||||||
end
|
end
|
||||||
|
|
||||||
config.action_dispatch.default_headers = {
|
config.action_dispatch.default_headers = {
|
||||||
'Server' => 'Mastodon',
|
'Server' => 'Mastodon',
|
||||||
'X-Frame-Options' => 'DENY',
|
'X-Frame-Options' => 'DENY',
|
||||||
'X-Content-Type-Options' => 'nosniff',
|
'X-Content-Type-Options' => 'nosniff',
|
||||||
'X-XSS-Protection' => '1; mode=block',
|
'X-XSS-Protection' => '1; mode=block',
|
||||||
|
'Content-Security-Policy' => "frame-ancestors 'none'; object-src 'none'; script-src 'self' https://dev-static.glitch.social 'unsafe-inline'; base-uri 'none';" ,
|
||||||
|
'Referrer-Policy' => 'no-referrer, strict-origin-when-cross-origin',
|
||||||
|
'Strict-Transport-Security' => 'max-age=63072000; includeSubDomains; preload'
|
||||||
}
|
}
|
||||||
end
|
end
|
||||||
|
|||||||
7
config/initializers/frontends.rb
Normal file
7
config/initializers/frontends.rb
Normal file
@@ -0,0 +1,7 @@
|
|||||||
|
# Be sure to restart your server when you modify this file.
|
||||||
|
|
||||||
|
Rails.application.configure do
|
||||||
|
frontends = []
|
||||||
|
Rails.root.join('app', 'javascript', 'packs', 'frontends').each_child(false) { |f| frontends.push f.to_s }
|
||||||
|
config.x.available_frontends = frontends
|
||||||
|
end
|
||||||
@@ -7,7 +7,7 @@
|
|||||||
# For more information, see docs/Running-Mastodon/Administration-guide.md
|
# For more information, see docs/Running-Mastodon/Administration-guide.md
|
||||||
#
|
#
|
||||||
defaults: &defaults
|
defaults: &defaults
|
||||||
site_title: Mastodon
|
site_title: 'dev.glitch.social'
|
||||||
site_description: ''
|
site_description: ''
|
||||||
site_extended_description: ''
|
site_extended_description: ''
|
||||||
site_contact_username: ''
|
site_contact_username: ''
|
||||||
|
|||||||
@@ -51,18 +51,7 @@ module.exports = {
|
|||||||
}),
|
}),
|
||||||
new webpack.optimize.CommonsChunkPlugin({
|
new webpack.optimize.CommonsChunkPlugin({
|
||||||
name: 'common',
|
name: 'common',
|
||||||
minChunks: (module, count) => {
|
minChunks: Infinity
|
||||||
const reactIntlPathRegexp = new RegExp(`node_modules\\${sep}react-intl`);
|
|
||||||
|
|
||||||
if (module.resource && reactIntlPathRegexp.test(module.resource)) {
|
|
||||||
// skip react-intl because it's useless to put in the common chunk,
|
|
||||||
// e.g. because "shared" modules between zh-TW and zh-CN will never
|
|
||||||
// be loaded together
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
return count >= 2;
|
|
||||||
},
|
|
||||||
}),
|
}),
|
||||||
],
|
],
|
||||||
|
|
||||||
|
|||||||
@@ -8,8 +8,8 @@
|
|||||||
<style>
|
<style>
|
||||||
body {
|
body {
|
||||||
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
|
||||||
background: #282c37;
|
background: #181818 url("/background-photo.png");
|
||||||
color: #9baec8;
|
color: #1ea21e;
|
||||||
text-align: center;
|
text-align: center;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
padding: 20px;
|
padding: 20px;
|
||||||
@@ -33,7 +33,7 @@
|
|||||||
|
|
||||||
<body>
|
<body>
|
||||||
<div class="dialog">
|
<div class="dialog">
|
||||||
<img src="/oops.png" alt="Mastodon" />
|
<img src="/logo.png" alt="dev.glitch.social" />
|
||||||
|
|
||||||
<div>
|
<div>
|
||||||
<h1>We're sorry, but something went wrong.</h1>
|
<h1>We're sorry, but something went wrong.</h1>
|
||||||
|
|||||||
BIN
public/background-cybre.png
Normal file
BIN
public/background-cybre.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 232 KiB |
@@ -3,7 +3,7 @@
|
|||||||
<msapplication>
|
<msapplication>
|
||||||
<tile>
|
<tile>
|
||||||
<square150x150logo src="/mstile-150x150.png"/>
|
<square150x150logo src="/mstile-150x150.png"/>
|
||||||
<TileColor>#2b5797</TileColor>
|
<TileColor>#1ea21e</TileColor>
|
||||||
</tile>
|
</tile>
|
||||||
</msapplication>
|
</msapplication>
|
||||||
</browserconfig>
|
</browserconfig>
|
||||||
|
|||||||
54
public/clock.js
Normal file
54
public/clock.js
Normal file
@@ -0,0 +1,54 @@
|
|||||||
|
document.addEventListener("DOMContentLoaded", function(event) {
|
||||||
|
updateClock();
|
||||||
|
setInterval(updateClock, 1000);
|
||||||
|
});
|
||||||
|
|
||||||
|
function getNextOpen(now) {
|
||||||
|
var days = [[0, 14], [4, 18], [8, 22], [12], [2, 16], [6, 20], [10]]
|
||||||
|
var nowday = now.getUTCDay();
|
||||||
|
var nour = now.getUTCHours();
|
||||||
|
|
||||||
|
var open_hour = -1;
|
||||||
|
var d = 0;
|
||||||
|
|
||||||
|
while (open_hour == -1) {
|
||||||
|
var times = days[(nowday + d) % 7];
|
||||||
|
for (var i = 0; i < times.length; ++i) {
|
||||||
|
var time = times[i];
|
||||||
|
if (time == nour) {
|
||||||
|
return "refresh";
|
||||||
|
} else if (time > nour || d > 0) {
|
||||||
|
open_hour = time;
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (open_hour == -1) {
|
||||||
|
d += 1;
|
||||||
|
nour = -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
var open = new Date(Date.UTC(now.getUTCFullYear(), now.getUTCMonth(), now.getUTCDate() + d));
|
||||||
|
var ts = open.setUTCHours(open_hour);
|
||||||
|
return open;
|
||||||
|
}
|
||||||
|
|
||||||
|
function updateClock() {
|
||||||
|
var clock = document.querySelector(".closed-registrations-message .clock");
|
||||||
|
var now = new Date();
|
||||||
|
var open = getNextOpen(now);
|
||||||
|
|
||||||
|
if (open == "refresh") {
|
||||||
|
location.reload();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
var until = open - now;
|
||||||
|
var ms = until % 1000;
|
||||||
|
var s = Math.floor((until / 1000)) % 60;
|
||||||
|
var m = Math.floor((until / 1000 / 60)) % 60;
|
||||||
|
var h = Math.floor((until / 1000 / 60 / 60));
|
||||||
|
if (m < 10) m = "0" + m;
|
||||||
|
if (s < 10) s = "0" + s;
|
||||||
|
clock.innerHTML = h + ":" + m + ":" + s;
|
||||||
|
}
|
||||||
BIN
public/logo-cybre-glitch.gif
Normal file
BIN
public/logo-cybre-glitch.gif
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 818 KiB |
BIN
public/riot-glitch.png
Normal file
BIN
public/riot-glitch.png
Normal file
Binary file not shown.
|
After Width: | Height: | Size: 24 KiB |
Reference in New Issue
Block a user