From 86e617a839bd4eb45ace52ab226a4e93bb184ff0 Mon Sep 17 00:00:00 2001 From: kibigo! Date: Mon, 25 Sep 2017 19:24:32 -0700 Subject: Better themeing support!! --- .../glitch/components/local_settings/navigation/item/style.scss | 2 +- app/javascript/glitch/components/local_settings/navigation/style.scss | 2 +- app/javascript/glitch/components/local_settings/page/item/style.scss | 2 +- app/javascript/glitch/components/local_settings/page/style.scss | 2 +- app/javascript/glitch/components/local_settings/style.scss | 2 +- 5 files changed, 5 insertions(+), 5 deletions(-) (limited to 'app/javascript/glitch/components') diff --git a/app/javascript/glitch/components/local_settings/navigation/item/style.scss b/app/javascript/glitch/components/local_settings/navigation/item/style.scss index 505c86912..33d7d3744 100644 --- a/app/javascript/glitch/components/local_settings/navigation/item/style.scss +++ b/app/javascript/glitch/components/local_settings/navigation/item/style.scss @@ -1,4 +1,4 @@ -@import 'variables'; +@import 'styles/variables'; .glitch.local-settings__navigation__item { display: block; diff --git a/app/javascript/glitch/components/local_settings/navigation/style.scss b/app/javascript/glitch/components/local_settings/navigation/style.scss index 1cc39e3e9..a610a1212 100644 --- a/app/javascript/glitch/components/local_settings/navigation/style.scss +++ b/app/javascript/glitch/components/local_settings/navigation/style.scss @@ -1,4 +1,4 @@ -@import 'variables'; +@import 'styles/variables'; .glitch.local-settings__navigation { background: $primary-text-color; diff --git a/app/javascript/glitch/components/local_settings/page/item/style.scss b/app/javascript/glitch/components/local_settings/page/item/style.scss index e614030c0..da1941b99 100644 --- a/app/javascript/glitch/components/local_settings/page/item/style.scss +++ b/app/javascript/glitch/components/local_settings/page/item/style.scss @@ -1,4 +1,4 @@ -@import 'variables'; +@import 'styles/variables'; .glitch.local-settings__page__item { select { diff --git a/app/javascript/glitch/components/local_settings/page/style.scss b/app/javascript/glitch/components/local_settings/page/style.scss index 7269056c3..53c95ea40 100644 --- a/app/javascript/glitch/components/local_settings/page/style.scss +++ b/app/javascript/glitch/components/local_settings/page/style.scss @@ -1,4 +1,4 @@ -@import 'variables'; +@import 'styles/variables'; .glitch.local-settings__page { display: block; diff --git a/app/javascript/glitch/components/local_settings/style.scss b/app/javascript/glitch/components/local_settings/style.scss index 6f7fcbaa4..54fec47bd 100644 --- a/app/javascript/glitch/components/local_settings/style.scss +++ b/app/javascript/glitch/components/local_settings/style.scss @@ -1,4 +1,4 @@ -@import 'variables'; +@import 'styles/variables'; .glitch.local-settings { position: relative; -- cgit From 9a5418942c03f51176faaeec33d2fdc1acc5c30e Mon Sep 17 00:00:00 2001 From: Ondřej Hruška Date: Thu, 28 Sep 2017 10:04:20 +0200 Subject: fix some js errors due to number->string change of status ID --- app/javascript/glitch/components/notification/follow.js | 2 +- app/javascript/glitch/components/status/action_bar.js | 2 +- app/javascript/glitch/components/status/index.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) (limited to 'app/javascript/glitch/components') diff --git a/app/javascript/glitch/components/notification/follow.js b/app/javascript/glitch/components/notification/follow.js index f471307b9..99a5c6219 100644 --- a/app/javascript/glitch/components/notification/follow.js +++ b/app/javascript/glitch/components/notification/follow.js @@ -30,7 +30,7 @@ import NotificationOverlayContainer from '../notification/overlay/container'; export default class NotificationFollow extends ImmutablePureComponent { static propTypes = { - id : PropTypes.number.isRequired, + id : PropTypes.string.isRequired, account : ImmutablePropTypes.map.isRequired, notification : ImmutablePropTypes.map.isRequired, }; diff --git a/app/javascript/glitch/components/status/action_bar.js b/app/javascript/glitch/components/status/action_bar.js index d4d26c62c..f4450d31b 100644 --- a/app/javascript/glitch/components/status/action_bar.js +++ b/app/javascript/glitch/components/status/action_bar.js @@ -50,7 +50,7 @@ export default class StatusActionBar extends ImmutablePureComponent { onEmbed: PropTypes.func, onMuteConversation: PropTypes.func, onPin: PropTypes.func, - me: PropTypes.number, + me: PropTypes.string, withDismiss: PropTypes.bool, intl: PropTypes.object.isRequired, }; diff --git a/app/javascript/glitch/components/status/index.js b/app/javascript/glitch/components/status/index.js index 4a2a0e1d4..9e758793c 100644 --- a/app/javascript/glitch/components/status/index.js +++ b/app/javascript/glitch/components/status/index.js @@ -155,12 +155,12 @@ export default class Status extends ImmutablePureComponent { }; static propTypes = { - id : PropTypes.number, + id : PropTypes.string, status : ImmutablePropTypes.map, account : ImmutablePropTypes.map, settings : ImmutablePropTypes.map, notification : ImmutablePropTypes.map, - me : PropTypes.number, + me : PropTypes.string, onFavourite : PropTypes.func, onReblog : PropTypes.func, onModalReblog : PropTypes.func, -- cgit From 74e4fc8f8aea01159e7d24b978322545afb70e94 Mon Sep 17 00:00:00 2001 From: Ondřej Hruška Date: Thu, 28 Sep 2017 10:13:16 +0200 Subject: fix custom emoji not shown in statuses --- app/javascript/glitch/components/status/content.js | 6 ++---- 1 file changed, 2 insertions(+), 4 deletions(-) (limited to 'app/javascript/glitch/components') diff --git a/app/javascript/glitch/components/status/content.js b/app/javascript/glitch/components/status/content.js index 2aad55070..9dd34fcb2 100644 --- a/app/javascript/glitch/components/status/content.js +++ b/app/javascript/glitch/components/status/content.js @@ -131,11 +131,9 @@ export default class StatusContent extends React.PureComponent { this.state.hidden ); - const content = { __html: emojify(status.get('content')) }; + const content = { __html: status.get('contentHtml') }; const spoilerContent = { - __html: emojify(escapeTextContentForBrowser( - status.get('spoiler_text', '') - )), + __html: status.get('spoilerHtml'), }; const directionStyle = { direction: 'ltr' }; const classNames = classnames('status__content', { -- cgit From cf24ce7e0300b8280631efddd58ce576e5cccabf Mon Sep 17 00:00:00 2001 From: Ondřej Hruška Date: Thu, 28 Sep 2017 11:03:23 +0200 Subject: remove wrong emojify usage in old glitch components --- app/javascript/glitch/components/account/header.js | 14 ++++---------- app/javascript/glitch/components/notification/follow.js | 7 ++----- app/javascript/glitch/components/status/content.js | 8 ++------ app/javascript/glitch/components/status/prepend.js | 8 +------- 4 files changed, 9 insertions(+), 28 deletions(-) (limited to 'app/javascript/glitch/components') diff --git a/app/javascript/glitch/components/account/header.js b/app/javascript/glitch/components/account/header.js index a1197c4be..bc2ce30f6 100644 --- a/app/javascript/glitch/components/account/header.js +++ b/app/javascript/glitch/components/account/header.js @@ -44,7 +44,6 @@ Imports: import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; -import escapeTextContentForBrowser from 'escape-html'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; @@ -89,7 +88,7 @@ export default class AccountHeader extends ImmutablePureComponent { static propTypes = { account : ImmutablePropTypes.map, - me : PropTypes.number.isRequired, + me : PropTypes.string.isRequired, onFollow : PropTypes.func.isRequired, intl : PropTypes.object.isRequired, }; @@ -117,7 +116,7 @@ then we set the `displayName` to just be the `username` of the account. return null; } - let displayName = account.get('display_name'); + let displayName = account.get('display_name_html'); let info = ''; let actionBtn = ''; let following = false; @@ -167,16 +166,11 @@ appropriate icon. } /* - -`displayNameHTML` processes the `displayName` and prepares it for -insertion into the document. Meanwhile, we extract the `text` and + we extract the `text` and `metadata` from our account's `note` using `processBio()`. */ - const displayNameHTML = { - __html : emojify(escapeTextContentForBrowser(displayName)), - }; const { text, metadata } = processBio(account.get('note')); /* @@ -198,7 +192,7 @@ Here, we render our component using all the things we've defined above. diff --git a/app/javascript/glitch/components/notification/follow.js b/app/javascript/glitch/components/notification/follow.js index 99a5c6219..e2c21bf35 100644 --- a/app/javascript/glitch/components/notification/follow.js +++ b/app/javascript/glitch/components/notification/follow.js @@ -11,11 +11,9 @@ import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; -import escapeTextContentForBrowser from 'escape-html'; import ImmutablePureComponent from 'react-immutable-pure-component'; // Mastodon imports. -import emojify from '../../../mastodon/emoji'; import Permalink from '../../../mastodon/components/permalink'; import AccountContainer from '../../../mastodon/containers/account_container'; @@ -39,15 +37,14 @@ export default class NotificationFollow extends ImmutablePureComponent { const { account, notification } = this.props; // Links to the display name. - const displayName = account.get('display_name') || account.get('username'); - const displayNameHTML = { __html: emojify(escapeTextContentForBrowser(displayName)) }; + const displayName = account.get('display_name_html') || account.get('username'); const link = ( ); diff --git a/app/javascript/glitch/components/status/content.js b/app/javascript/glitch/components/status/content.js index 9dd34fcb2..06015619b 100644 --- a/app/javascript/glitch/components/status/content.js +++ b/app/javascript/glitch/components/status/content.js @@ -1,13 +1,11 @@ // Package imports // import React from 'react'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import escapeTextContentForBrowser from 'escape-html'; import PropTypes from 'prop-types'; import { FormattedMessage } from 'react-intl'; import classnames from 'classnames'; // Mastodon imports // -import emojify from '../../../mastodon/emoji'; import { isRtl } from '../../../mastodon/rtl'; import Permalink from '../../../mastodon/components/permalink'; @@ -32,7 +30,7 @@ export default class StatusContent extends React.PureComponent { const node = this.node; const links = node.querySelectorAll('a'); - for (var i = 0; i < links.length; ++i) { + for (let i = 0; i < links.length; ++i) { let link = links[i]; let mention = this.props.status.get('mentions').find(item => link.href === item.get('url')); @@ -132,9 +130,7 @@ export default class StatusContent extends React.PureComponent { ); const content = { __html: status.get('contentHtml') }; - const spoilerContent = { - __html: status.get('spoilerHtml'), - }; + const spoilerContent = { __html: status.get('spoilerHtml') }; const directionStyle = { direction: 'ltr' }; const classNames = classnames('status__content', { 'status__content--with-action': parseClick && !disabled, diff --git a/app/javascript/glitch/components/status/prepend.js b/app/javascript/glitch/components/status/prepend.js index 6213e4c8d..8c0aed0f4 100644 --- a/app/javascript/glitch/components/status/prepend.js +++ b/app/javascript/glitch/components/status/prepend.js @@ -22,12 +22,8 @@ Imports: import React from 'react'; import PropTypes from 'prop-types'; import ImmutablePropTypes from 'react-immutable-proptypes'; -import escapeTextContentForBrowser from 'escape-html'; import { FormattedMessage } from 'react-intl'; -// Mastodon imports // -import emojify from '../../../mastodon/emoji'; - /* * * * */ /* @@ -99,9 +95,7 @@ generate the message. > -- cgit