From abe95b614b6355e61dd2955e09115ac473417c84 Mon Sep 17 00:00:00 2001 From: cwm Date: Sat, 9 Dec 2017 10:26:22 -0600 Subject: [PATCH 01/11] add initial components based off of tootsuite pr #1507 --- .../settings/preferences_controller.rb | 1 + .../flavours/glitch/components/status.js | 5 +- .../glitch/containers/status_container.js | 16 +++- .../features/status/components/action_bar.js | 4 +- .../flavours/glitch/features/status/index.js | 16 +++- .../features/ui/components/favourite_modal.js | 84 +++++++++++++++++++ .../features/ui/components/modal_root.js | 4 +- .../glitch/styles/components/index.scss | 11 ++- .../flavours/glitch/util/initial_state.js | 1 + app/models/user.rb | 2 +- app/views/settings/preferences/show.html.haml | 1 + config/locales/simple_form.en.yml | 1 + config/settings.yml | 1 + 13 files changed, 130 insertions(+), 17 deletions(-) create mode 100644 app/javascript/flavours/glitch/features/ui/components/favourite_modal.js diff --git a/app/controllers/settings/preferences_controller.rb b/app/controllers/settings/preferences_controller.rb index 277f0f6573..9177d37da6 100644 --- a/app/controllers/settings/preferences_controller.rb +++ b/app/controllers/settings/preferences_controller.rb @@ -33,6 +33,7 @@ class Settings::PreferencesController < Settings::BaseController :setting_default_sensitive, :setting_unfollow_modal, :setting_boost_modal, + :setting_favourite_modal, :setting_delete_modal, :setting_auto_play_gif, :setting_reduce_motion, diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index b0d9e37576..6cfd05735d 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -58,6 +58,7 @@ export default class Status extends ImmutablePureComponent { 'settings', 'prepend', 'boostModal', + 'favouriteModal', 'muted', 'collapse', 'notification', @@ -204,8 +205,8 @@ export default class Status extends ImmutablePureComponent { this.props.onReply(this.props.status, this.context.router.history); } - handleHotkeyFavourite = () => { - this.props.onFavourite(this.props.status); + handleHotkeyFavourite = e => { + this.props.onFavourite(this.props.status, e); } handleHotkeyBoost = e => { diff --git a/app/javascript/flavours/glitch/containers/status_container.js b/app/javascript/flavours/glitch/containers/status_container.js index b753de7b3a..8bf33c70f4 100644 --- a/app/javascript/flavours/glitch/containers/status_container.js +++ b/app/javascript/flavours/glitch/containers/status_container.js @@ -20,7 +20,7 @@ import { initMuteModal } from 'flavours/glitch/actions/mutes'; import { initReport } from 'flavours/glitch/actions/reports'; import { openModal } from 'flavours/glitch/actions/modal'; import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; -import { boostModal, deleteModal } from 'flavours/glitch/util/initial_state'; +import { boostModal, favouriteModal, deleteModal } from 'flavours/glitch/util/initial_state'; const messages = defineMessages({ deleteConfirm: { id: 'confirmations.delete.confirm', defaultMessage: 'Delete' }, @@ -78,14 +78,22 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } }, - onFavourite (status) { + onModalFavourite (status) { + dispatch(favourite(status)); + }, + + onFavourite (status, e) { if (status.get('favourited')) { dispatch(unfavourite(status)); } else { - dispatch(favourite(status)); + if (e.shiftKey || !favouriteModal) { + this.onModalFavourite(status); + } else { + dispatch(openModal('FAVOURITE', { status, onFavourite: this.onModalFavourite })); + } } }, - + onPin (status) { if (status.get('pinned')) { dispatch(unpin(status)); diff --git a/app/javascript/flavours/glitch/features/status/components/action_bar.js b/app/javascript/flavours/glitch/features/status/components/action_bar.js index 4d660ee3c0..3190fd0be1 100644 --- a/app/javascript/flavours/glitch/features/status/components/action_bar.js +++ b/app/javascript/flavours/glitch/features/status/components/action_bar.js @@ -48,8 +48,8 @@ export default class ActionBar extends React.PureComponent { this.props.onReblog(this.props.status, e); } - handleFavouriteClick = () => { - this.props.onFavourite(this.props.status); + handleFavouriteClick = (e) => { + this.props.onFavourite(this.props.status, e); } handleDeleteClick = () => { diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js index 93b0fe9d98..8b81caa9a3 100644 --- a/app/javascript/flavours/glitch/features/status/index.js +++ b/app/javascript/flavours/glitch/features/status/index.js @@ -30,7 +30,7 @@ import { openModal } from 'flavours/glitch/actions/modal'; import { defineMessages, injectIntl } from 'react-intl'; import ImmutablePureComponent from 'react-immutable-pure-component'; import { HotKeys } from 'react-hotkeys'; -import { boostModal, deleteModal } from 'flavours/glitch/util/initial_state'; +import { boostModal, favouriteModal, deleteModal } from 'flavours/glitch/util/initial_state'; import { attachFullscreenListener, detachFullscreenListener, isFullscreen } from 'flavours/glitch/util/fullscreen'; const messages = defineMessages({ @@ -95,11 +95,19 @@ export default class Status extends ImmutablePureComponent { } }; - handleFavouriteClick = (status) => { + handleModalFavourite = (status) => { + this.props.dispatch(favourite(status)); + } + + handleFavouriteClick = (status, e) => { if (status.get('favourited')) { this.props.dispatch(unfavourite(status)); } else { - this.props.dispatch(favourite(status)); + if (e.shiftKey || !favoriteModal) { + this.handleModalFavourite(status); + } else { + this.props.dispatch(openModal('FAVOURITE', { status, onFavourite: this.handleModalFavourite })); + } } } @@ -118,7 +126,7 @@ export default class Status extends ImmutablePureComponent { handleModalReblog = (status) => { this.props.dispatch(reblog(status)); } - + handleReblogClick = (status, e) => { if (status.get('reblogged')) { this.props.dispatch(unreblog(status)); diff --git a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js new file mode 100644 index 0000000000..a2322d0b89 --- /dev/null +++ b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js @@ -0,0 +1,84 @@ +import React from 'react'; +import ImmutablePropTypes from 'react-immutable-proptypes'; +import PropTypes from 'prop-types'; +import { defineMessages, injectIntl, FormattedMessage } from 'react-intl'; +import Button from 'flavours/glitch/components/button'; +import StatusContent from 'flavours/glitch/components/status_content'; +import Avatar from 'flavours/glitch/components/avatar'; +import RelativeTimestamp from 'flavours/glitch/components/relative_timestamp'; +import DisplayName from 'flavours/glitch/components/display_name'; +import ImmutablePureComponent from 'react-immutable-pure-component'; + +const messages = defineMessages({ + reblog: { id: 'status.favourite', defaultMessage: 'Favourite' }, +}); + +@injectIntl +export default class BoostModal extends ImmutablePureComponent { + + static contextTypes = { + router: PropTypes.object, + }; + + static propTypes = { + status: ImmutablePropTypes.map.isRequired, + onReblog: PropTypes.func.isRequired, + onClose: PropTypes.func.isRequired, + intl: PropTypes.object.isRequired, + }; + + componentDidMount() { + this.button.focus(); + } + + handleFavourite = () => { + this.props.onFavourite(this.props.status); + this.props.onClose(); + } + + handleAccountClick = (e) => { + if (e.button === 0) { + e.preventDefault(); + this.props.onClose(); + this.context.router.history.push(`/accounts/${this.props.status.getIn(['account', 'id'])}`); + } + } + + setRef = (c) => { + this.button = c; + } + + render () { + const { status, intl } = this.props; + + return ( +
+
+
+
+
+ +
+ + +
+ +
+ + +
+
+ + +
+
+ +
+
Shift + }} />
+
+
+ ); + } + +} diff --git a/app/javascript/flavours/glitch/features/ui/components/modal_root.js b/app/javascript/flavours/glitch/features/ui/components/modal_root.js index 61b2392839..66acae68e7 100644 --- a/app/javascript/flavours/glitch/features/ui/components/modal_root.js +++ b/app/javascript/flavours/glitch/features/ui/components/modal_root.js @@ -7,6 +7,7 @@ import ActionsModal from './actions_modal'; import MediaModal from './media_modal'; import VideoModal from './video_modal'; import BoostModal from './boost_modal'; +import FavouriteModal from './favourite_modal'; import DoodleModal from './doodle_modal'; import ConfirmationModal from './confirmation_modal'; import { @@ -22,6 +23,7 @@ const MODAL_COMPONENTS = { 'ONBOARDING': OnboardingModal, 'VIDEO': () => Promise.resolve({ default: VideoModal }), 'BOOST': () => Promise.resolve({ default: BoostModal }), + 'FAVOURITE': () => Promise.resolve({ default: FavouriteModal }), 'DOODLE': () => Promise.resolve({ default: DoodleModal }), 'CONFIRM': () => Promise.resolve({ default: ConfirmationModal }), 'MUTE': MuteModal, @@ -90,7 +92,7 @@ export default class ModalRoot extends React.PureComponent { } renderLoading = modalId => () => { - return ['MEDIA', 'VIDEO', 'BOOST', 'DOODLE', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? : null; + return ['MEDIA', 'VIDEO', 'BOOST', 'FAVOURITE', 'DOODLE', 'CONFIRM', 'ACTIONS'].indexOf(modalId) === -1 ? : null; } renderError = (props) => { diff --git a/app/javascript/flavours/glitch/styles/components/index.scss b/app/javascript/flavours/glitch/styles/components/index.scss index 7aeab0a6af..eb8d8245f4 100644 --- a/app/javascript/flavours/glitch/styles/components/index.scss +++ b/app/javascript/flavours/glitch/styles/components/index.scss @@ -3901,6 +3901,7 @@ button.icon-button.active i.fa-retweet { } .boost-modal, +.favourite-modal, .confirmation-modal, .report-modal, .actions-modal, @@ -3932,7 +3933,8 @@ button.icon-button.active i.fa-retweet { } } -.boost-modal__container { +.boost-modal__container, +.favourite-modal__container{ overflow-x: scroll; padding: 10px; @@ -3943,6 +3945,7 @@ button.icon-button.active i.fa-retweet { } .boost-modal__action-bar, +.favourite-modal__action-bar, .confirmation-modal__action-bar, .mute-modal__action-bar, .report-modal__action-bar { @@ -3964,11 +3967,13 @@ button.icon-button.active i.fa-retweet { } } -.boost-modal__status-header { +.boost-modal__status-header, +.favourite-modal__status-header { font-size: 15px; } -.boost-modal__status-time { +.boost-modal__status-time, +.favourite-modal__status-time { float: right; font-size: 14px; } diff --git a/app/javascript/flavours/glitch/util/initial_state.js b/app/javascript/flavours/glitch/util/initial_state.js index ef5d8b0efc..607d6b9b04 100644 --- a/app/javascript/flavours/glitch/util/initial_state.js +++ b/app/javascript/flavours/glitch/util/initial_state.js @@ -15,6 +15,7 @@ export const reduceMotion = getMeta('reduce_motion'); export const autoPlayGif = getMeta('auto_play_gif'); export const unfollowModal = getMeta('unfollow_modal'); export const boostModal = getMeta('boost_modal'); +export const favouriteModal = getMeta('favourite_modal'); export const deleteModal = getMeta('delete_modal'); export const me = getMeta('me'); diff --git a/app/models/user.rb b/app/models/user.rb index 29bdcbd671..47bf22e177 100644 --- a/app/models/user.rb +++ b/app/models/user.rb @@ -75,7 +75,7 @@ class User < ApplicationRecord has_many :session_activations, dependent: :destroy - delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :delete_modal, + delegate :auto_play_gif, :default_sensitive, :unfollow_modal, :boost_modal, :favourite_modal, :delete_modal, :reduce_motion, :system_font_ui, :noindex, :flavour, :skin, to: :settings, prefix: :setting, allow_nil: false diff --git a/app/views/settings/preferences/show.html.haml b/app/views/settings/preferences/show.html.haml index 9564c03991..9e72e57349 100644 --- a/app/views/settings/preferences/show.html.haml +++ b/app/views/settings/preferences/show.html.haml @@ -32,6 +32,7 @@ = f.input :setting_unfollow_modal, as: :boolean, wrapper: :with_label = f.input :setting_boost_modal, as: :boolean, wrapper: :with_label + = f.input :setting_favourite_modal, as: :boolean, wrapper: :with_label = f.input :setting_delete_modal, as: :boolean, wrapper: :with_label .fields-group diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 756f6b1190..599df9e28e 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -43,6 +43,7 @@ en: password: Password setting_auto_play_gif: Auto-play animated GIFs setting_boost_modal: Show confirmation dialog before boosting + setting_favourite_modal: Show confirmation dialog before favouriting setting_default_privacy: Post privacy setting_default_sensitive: Always mark media as sensitive setting_delete_modal: Show confirmation dialog before deleting a toot diff --git a/config/settings.yml b/config/settings.yml index 5aad45da22..dbc5f6a265 100644 --- a/config/settings.yml +++ b/config/settings.yml @@ -22,6 +22,7 @@ defaults: &defaults default_sensitive: false unfollow_modal: false boost_modal: false + favourite_modal: false delete_modal: true auto_play_gif: false reduce_motion: false From a489e5d5cd33f52e4af38e6977a284b367f2f95e Mon Sep 17 00:00:00 2001 From: cwm Date: Sat, 9 Dec 2017 11:21:41 -0600 Subject: [PATCH 02/11] added a few more things --- .../features/ui/components/actions_modal.js | 18 +++++++++++++++++- .../mastodon/locales/defaultMessages.json | 15 ++++++++++++++- app/javascript/mastodon/locales/en.json | 2 ++ app/lib/user_settings_decorator.rb | 5 +++++ app/serializers/initial_state_serializer.rb | 1 + 5 files changed, 39 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js index 0873c282fa..1eb0e026e3 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js @@ -55,9 +55,25 @@ export default class ActionsModal extends ImmutablePureComponent { + + - + ); return ( diff --git a/app/javascript/mastodon/locales/defaultMessages.json b/app/javascript/mastodon/locales/defaultMessages.json index bb82cf5f58..65e20c17ae 100644 --- a/app/javascript/mastodon/locales/defaultMessages.json +++ b/app/javascript/mastodon/locales/defaultMessages.json @@ -1293,6 +1293,19 @@ ], "path": "app/javascript/mastodon/features/ui/components/boost_modal.json" }, + { + "descriptors": [ + { + "defaultMessage": "Favourite", + "id": "status.favourite" + }, + { + "defaultMessage": "You can press {combo} to skip this next time", + "id": "favourite_modal.combo" + } + ], + "path": "app/javascript/mastodon/features/ui/components/favourite_modal.json" + }, { "descriptors": [ { @@ -1601,4 +1614,4 @@ ], "path": "app/javascript/mastodon/features/video/index.json" } -] \ No newline at end of file +] diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 538124904a..5efd29b815 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -25,6 +25,7 @@ "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", "boost_modal.combo": "You can press {combo} to skip this next time", + "favourite_modal.combo": "You can press {combo} to skip this next time", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", "bundle_column_error.title": "Network error", @@ -109,6 +110,7 @@ "home.settings": "Column settings", "keyboard_shortcuts.back": "to navigate back", "keyboard_shortcuts.boost": "to boost", + "keyboard_shortcuts.favourite": "to favourite", "keyboard_shortcuts.column": "to focus a status in one of the columns", "keyboard_shortcuts.compose": "to focus the compose textarea", "keyboard_shortcuts.description": "Description", diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index 8af384a2d2..d69181b5d7 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -21,6 +21,7 @@ class UserSettingsDecorator user.settings['default_sensitive'] = default_sensitive_preference if change?('setting_default_sensitive') user.settings['unfollow_modal'] = unfollow_modal_preference if change?('setting_unfollow_modal') user.settings['boost_modal'] = boost_modal_preference if change?('setting_boost_modal') + user.settings['favourite_modal'] = boost_modal_preference if change?('setting_boost_modal') user.settings['delete_modal'] = delete_modal_preference if change?('setting_delete_modal') user.settings['auto_play_gif'] = auto_play_gif_preference if change?('setting_auto_play_gif') user.settings['reduce_motion'] = reduce_motion_preference if change?('setting_reduce_motion') @@ -53,6 +54,10 @@ class UserSettingsDecorator def boost_modal_preference boolean_cast_setting 'setting_boost_modal' end + + def favourite_modal_preference + boolean_cast_setting 'setting_favourite_modal' + end def delete_modal_preference boolean_cast_setting 'setting_delete_modal' diff --git a/app/serializers/initial_state_serializer.rb b/app/serializers/initial_state_serializer.rb index 9dfa019f59..904daa804d 100644 --- a/app/serializers/initial_state_serializer.rb +++ b/app/serializers/initial_state_serializer.rb @@ -28,6 +28,7 @@ class InitialStateSerializer < ActiveModel::Serializer store[:me] = object.current_account.id.to_s store[:unfollow_modal] = object.current_account.user.setting_unfollow_modal store[:boost_modal] = object.current_account.user.setting_boost_modal + store[:favourite_modal] = object.current_account.user.setting_favourite_modal store[:delete_modal] = object.current_account.user.setting_delete_modal store[:auto_play_gif] = object.current_account.user.setting_auto_play_gif store[:reduce_motion] = object.current_account.user.setting_reduce_motion From 22cdbca82c06cced9568f0bd9361593a2c0eba81 Mon Sep 17 00:00:00 2001 From: cwm Date: Sat, 9 Dec 2017 12:06:00 -0600 Subject: [PATCH 03/11] fixes, functioning now --- app/javascript/flavours/glitch/components/status.js | 2 +- .../flavours/glitch/components/status_action_bar.js | 4 ++-- app/javascript/flavours/glitch/features/status/index.js | 2 +- .../glitch/features/ui/components/favourite_modal.js | 8 ++++---- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/app/javascript/flavours/glitch/components/status.js b/app/javascript/flavours/glitch/components/status.js index 6cfd05735d..b8a0fd1803 100644 --- a/app/javascript/flavours/glitch/components/status.js +++ b/app/javascript/flavours/glitch/components/status.js @@ -205,7 +205,7 @@ export default class Status extends ImmutablePureComponent { this.props.onReply(this.props.status, this.context.router.history); } - handleHotkeyFavourite = e => { + handleHotkeyFavourite = (e) => { this.props.onFavourite(this.props.status, e); } diff --git a/app/javascript/flavours/glitch/components/status_action_bar.js b/app/javascript/flavours/glitch/components/status_action_bar.js index 5a06782bec..cb663e7738 100644 --- a/app/javascript/flavours/glitch/components/status_action_bar.js +++ b/app/javascript/flavours/glitch/components/status_action_bar.js @@ -71,8 +71,8 @@ export default class StatusActionBar extends ImmutablePureComponent { }); } - handleFavouriteClick = () => { - this.props.onFavourite(this.props.status); + handleFavouriteClick = (e) => { + this.props.onFavourite(this.props.status, e); } handleReblogClick = (e) => { diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js index 8b81caa9a3..4a019ce200 100644 --- a/app/javascript/flavours/glitch/features/status/index.js +++ b/app/javascript/flavours/glitch/features/status/index.js @@ -103,7 +103,7 @@ export default class Status extends ImmutablePureComponent { if (status.get('favourited')) { this.props.dispatch(unfavourite(status)); } else { - if (e.shiftKey || !favoriteModal) { + if (e.shiftKey || !favouriteModal) { this.handleModalFavourite(status); } else { this.props.dispatch(openModal('FAVOURITE', { status, onFavourite: this.handleModalFavourite })); diff --git a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js index a2322d0b89..70722411d2 100644 --- a/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/favourite_modal.js @@ -10,11 +10,11 @@ import DisplayName from 'flavours/glitch/components/display_name'; import ImmutablePureComponent from 'react-immutable-pure-component'; const messages = defineMessages({ - reblog: { id: 'status.favourite', defaultMessage: 'Favourite' }, + favourite: { id: 'status.favourite', defaultMessage: 'Favourite' }, }); @injectIntl -export default class BoostModal extends ImmutablePureComponent { +export default class FavouriteModal extends ImmutablePureComponent { static contextTypes = { router: PropTypes.object, @@ -22,7 +22,7 @@ export default class BoostModal extends ImmutablePureComponent { static propTypes = { status: ImmutablePropTypes.map.isRequired, - onReblog: PropTypes.func.isRequired, + onFavourite: PropTypes.func.isRequired, onClose: PropTypes.func.isRequired, intl: PropTypes.object.isRequired, }; @@ -75,7 +75,7 @@ export default class BoostModal extends ImmutablePureComponent {
Shift + }} />
-
); From 7284e36fbdd4d6084aa85e8b1eeb56247c3cab3d Mon Sep 17 00:00:00 2001 From: cwm Date: Sat, 9 Dec 2017 12:17:20 -0600 Subject: [PATCH 04/11] fixed fav setting change --- app/lib/user_settings_decorator.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/lib/user_settings_decorator.rb b/app/lib/user_settings_decorator.rb index d69181b5d7..5f0176f270 100644 --- a/app/lib/user_settings_decorator.rb +++ b/app/lib/user_settings_decorator.rb @@ -21,7 +21,7 @@ class UserSettingsDecorator user.settings['default_sensitive'] = default_sensitive_preference if change?('setting_default_sensitive') user.settings['unfollow_modal'] = unfollow_modal_preference if change?('setting_unfollow_modal') user.settings['boost_modal'] = boost_modal_preference if change?('setting_boost_modal') - user.settings['favourite_modal'] = boost_modal_preference if change?('setting_boost_modal') + user.settings['favourite_modal'] = favourite_modal_preference if change?('setting_favourite_modal') user.settings['delete_modal'] = delete_modal_preference if change?('setting_delete_modal') user.settings['auto_play_gif'] = auto_play_gif_preference if change?('setting_auto_play_gif') user.settings['reduce_motion'] = reduce_motion_preference if change?('setting_reduce_motion') From c5a688d70e4bea57ac87c71577fd6c7b9e5fa163 Mon Sep 17 00:00:00 2001 From: cwm Date: Sat, 9 Dec 2017 12:41:24 -0600 Subject: [PATCH 05/11] remove trailing spaces --- app/javascript/flavours/glitch/containers/status_container.js | 2 +- app/javascript/flavours/glitch/features/status/index.js | 2 +- .../flavours/glitch/features/ui/components/actions_modal.js | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/app/javascript/flavours/glitch/containers/status_container.js b/app/javascript/flavours/glitch/containers/status_container.js index 8bf33c70f4..c0b9b58002 100644 --- a/app/javascript/flavours/glitch/containers/status_container.js +++ b/app/javascript/flavours/glitch/containers/status_container.js @@ -93,7 +93,7 @@ const mapDispatchToProps = (dispatch, { intl }) => ({ } } }, - + onPin (status) { if (status.get('pinned')) { dispatch(unpin(status)); diff --git a/app/javascript/flavours/glitch/features/status/index.js b/app/javascript/flavours/glitch/features/status/index.js index 4a019ce200..40ae380ab6 100644 --- a/app/javascript/flavours/glitch/features/status/index.js +++ b/app/javascript/flavours/glitch/features/status/index.js @@ -126,7 +126,7 @@ export default class Status extends ImmutablePureComponent { handleModalReblog = (status) => { this.props.dispatch(reblog(status)); } - + handleReblogClick = (status, e) => { if (status.get('reblogged')) { this.props.dispatch(unreblog(status)); diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js index 1eb0e026e3..87a1498072 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js @@ -55,7 +55,7 @@ export default class ActionsModal extends ImmutablePureComponent { - + + ); return ( From fbd2a0127cb537e91508032a87bc82675f88d271 Mon Sep 17 00:00:00 2001 From: cwm Date: Sat, 9 Dec 2017 13:00:07 -0600 Subject: [PATCH 06/11] ran i18n-tasks normalize for simple_form.en.yml --- config/locales/simple_form.en.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/locales/simple_form.en.yml b/config/locales/simple_form.en.yml index 599df9e28e..1722eea7bd 100644 --- a/config/locales/simple_form.en.yml +++ b/config/locales/simple_form.en.yml @@ -43,10 +43,10 @@ en: password: Password setting_auto_play_gif: Auto-play animated GIFs setting_boost_modal: Show confirmation dialog before boosting - setting_favourite_modal: Show confirmation dialog before favouriting setting_default_privacy: Post privacy setting_default_sensitive: Always mark media as sensitive setting_delete_modal: Show confirmation dialog before deleting a toot + setting_favourite_modal: Show confirmation dialog before favouriting setting_flavour: Flavour setting_noindex: Opt-out of search engine indexing setting_reduce_motion: Reduce motion in animations From 8606e5338476cb7de21cb611d015e966f1cf48cc Mon Sep 17 00:00:00 2001 From: cwm Date: Sat, 9 Dec 2017 15:15:11 -0600 Subject: [PATCH 07/11] moved locales to glitch, created add settings entry --- .../glitch/features/local_settings/page/index.js | 9 +++++++++ app/javascript/flavours/glitch/features/ui/index.js | 2 ++ .../flavours/glitch/reducers/local_settings.js | 1 + app/javascript/glitch/locales/en.json | 2 ++ app/javascript/mastodon/locales/en.json | 2 -- 5 files changed, 14 insertions(+), 2 deletions(-) diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.js b/app/javascript/flavours/glitch/features/local_settings/page/index.js index 62bf410c69..b9b00b050b 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/page/index.js @@ -59,6 +59,15 @@ export default class LocalSettingsPage extends React.PureComponent { > + + + +

({ layout: state.getIn(['local_settings', 'layout']), isWide: state.getIn(['local_settings', 'stretch']), navbarUnder: state.getIn(['local_settings', 'navbar_under']), + favouriteModal: state.getIn(['local_settings', 'favourite_modal']), }); const keyMap = { @@ -103,6 +104,7 @@ export default class UI extends React.Component { isWide: PropTypes.bool, systemFontUi: PropTypes.bool, navbarUnder: PropTypes.bool, + favouriteModal: PropTypes.bool, isComposing: PropTypes.bool, hasComposingText: PropTypes.bool, location: PropTypes.object, diff --git a/app/javascript/flavours/glitch/reducers/local_settings.js b/app/javascript/flavours/glitch/reducers/local_settings.js index 69d98741b6..e4cdc49eeb 100644 --- a/app/javascript/flavours/glitch/reducers/local_settings.js +++ b/app/javascript/flavours/glitch/reducers/local_settings.js @@ -9,6 +9,7 @@ const initialState = ImmutableMap({ layout : 'auto', stretch : true, navbar_under : false, + favourite_modal : false, side_arm : 'none', collapsed : ImmutableMap({ enabled : true, diff --git a/app/javascript/glitch/locales/en.json b/app/javascript/glitch/locales/en.json index 0276cb8370..94011ffbe7 100644 --- a/app/javascript/glitch/locales/en.json +++ b/app/javascript/glitch/locales/en.json @@ -32,6 +32,8 @@ "status.collapse": "Collapse", "status.uncollapse": "Uncollapse", + "favourite_modal.combo": "You can press {combo} to skip this next time", + "home.column_settings.show_direct": "Show DMs", "notification.markForDeletion": "Mark for deletion", diff --git a/app/javascript/mastodon/locales/en.json b/app/javascript/mastodon/locales/en.json index 5efd29b815..538124904a 100644 --- a/app/javascript/mastodon/locales/en.json +++ b/app/javascript/mastodon/locales/en.json @@ -25,7 +25,6 @@ "account.unmute_notifications": "Unmute notifications from @{name}", "account.view_full_profile": "View full profile", "boost_modal.combo": "You can press {combo} to skip this next time", - "favourite_modal.combo": "You can press {combo} to skip this next time", "bundle_column_error.body": "Something went wrong while loading this component.", "bundle_column_error.retry": "Try again", "bundle_column_error.title": "Network error", @@ -110,7 +109,6 @@ "home.settings": "Column settings", "keyboard_shortcuts.back": "to navigate back", "keyboard_shortcuts.boost": "to boost", - "keyboard_shortcuts.favourite": "to favourite", "keyboard_shortcuts.column": "to focus a status in one of the columns", "keyboard_shortcuts.compose": "to focus the compose textarea", "keyboard_shortcuts.description": "Description", From 7a8711ccacafd675d27c5fbd07ce77a5c0dd3259 Mon Sep 17 00:00:00 2001 From: cwm Date: Sun, 10 Dec 2017 09:10:47 -0600 Subject: [PATCH 08/11] removed app settings additions --- app/javascript/flavours/glitch/features/ui/index.js | 2 -- app/javascript/flavours/glitch/reducers/local_settings.js | 1 - 2 files changed, 3 deletions(-) diff --git a/app/javascript/flavours/glitch/features/ui/index.js b/app/javascript/flavours/glitch/features/ui/index.js index 1e8de033c2..4a19829164 100644 --- a/app/javascript/flavours/glitch/features/ui/index.js +++ b/app/javascript/flavours/glitch/features/ui/index.js @@ -57,7 +57,6 @@ const mapStateToProps = state => ({ layout: state.getIn(['local_settings', 'layout']), isWide: state.getIn(['local_settings', 'stretch']), navbarUnder: state.getIn(['local_settings', 'navbar_under']), - favouriteModal: state.getIn(['local_settings', 'favourite_modal']), }); const keyMap = { @@ -104,7 +103,6 @@ export default class UI extends React.Component { isWide: PropTypes.bool, systemFontUi: PropTypes.bool, navbarUnder: PropTypes.bool, - favouriteModal: PropTypes.bool, isComposing: PropTypes.bool, hasComposingText: PropTypes.bool, location: PropTypes.object, diff --git a/app/javascript/flavours/glitch/reducers/local_settings.js b/app/javascript/flavours/glitch/reducers/local_settings.js index e4cdc49eeb..69d98741b6 100644 --- a/app/javascript/flavours/glitch/reducers/local_settings.js +++ b/app/javascript/flavours/glitch/reducers/local_settings.js @@ -9,7 +9,6 @@ const initialState = ImmutableMap({ layout : 'auto', stretch : true, navbar_under : false, - favourite_modal : false, side_arm : 'none', collapsed : ImmutableMap({ enabled : true, From 066458a6593cbb708db9b46dbda787ba440273b1 Mon Sep 17 00:00:00 2001 From: cwm Date: Sun, 10 Dec 2017 09:25:44 -0600 Subject: [PATCH 09/11] removed one last app settings addition --- .../glitch/features/local_settings/page/index.js | 9 --------- 1 file changed, 9 deletions(-) diff --git a/app/javascript/flavours/glitch/features/local_settings/page/index.js b/app/javascript/flavours/glitch/features/local_settings/page/index.js index b9b00b050b..62bf410c69 100644 --- a/app/javascript/flavours/glitch/features/local_settings/page/index.js +++ b/app/javascript/flavours/glitch/features/local_settings/page/index.js @@ -59,15 +59,6 @@ export default class LocalSettingsPage extends React.PureComponent { > - - - -

Date: Sun, 10 Dec 2017 15:14:56 -0600 Subject: [PATCH 10/11] removed unneeded actions_modal div --- .../features/ui/components/actions_modal.js | 16 ---------------- 1 file changed, 16 deletions(-) diff --git a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js index 87a1498072..0873c282fa 100644 --- a/app/javascript/flavours/glitch/features/ui/components/actions_modal.js +++ b/app/javascript/flavours/glitch/features/ui/components/actions_modal.js @@ -56,22 +56,6 @@ export default class ActionsModal extends ImmutablePureComponent {
- - ); From 0466aa8d08796a227b01b1f698911856a198c2ee Mon Sep 17 00:00:00 2001 From: cwm Date: Sun, 10 Dec 2017 15:39:23 -0600 Subject: [PATCH 11/11] use single quotes in locale entry --- app/javascript/flavours/glitch/locales/en.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/app/javascript/flavours/glitch/locales/en.js b/app/javascript/flavours/glitch/locales/en.js index 07d77e0e11..0681d27d8c 100644 --- a/app/javascript/flavours/glitch/locales/en.js +++ b/app/javascript/flavours/glitch/locales/en.js @@ -34,7 +34,7 @@ const messages = { 'status.collapse': 'Collapse', 'status.uncollapse': 'Uncollapse', - "favourite_modal.combo": "You can press {combo} to skip this next time", + 'favourite_modal.combo': 'You can press {combo} to skip this next time', 'home.column_settings.show_direct': 'Show DMs',