From d1c3e35d3fe707b916e428c376fa0d89e4824ec5 Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Sun, 16 Jul 2017 18:52:11 +0900 Subject: Fix style settings for images in media modal (#4220) * Shrink too wide single image modal Fix too wide react-swipeable-view-container Fix 0067f80 shrinking all react-swipeable-view-container Change to apply max-width of react-swipeable-view-container only under media-modal. Fix b30b03b just a typo * Centering contents in image-loader Centering small img, canvas, and video in image-loader. --- app/javascript/styles/components.scss | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/styles/components.scss b/app/javascript/styles/components.scss index fc797a508..1c4c97f18 100644 --- a/app/javascript/styles/components.scss +++ b/app/javascript/styles/components.scss @@ -1143,8 +1143,8 @@ top: 0; left: 0; right: 0; - width: 100%; - height: 100%; + max-width: 100%; + max-height: 100%; background-image: none; } @@ -2967,8 +2967,9 @@ button.icon-button.active i.fa-retweet { video { max-width: 80vw; max-height: 80vh; - width: 100%; + width: auto; height: auto; + margin: auto; } .extended-video-player, @@ -2984,6 +2985,10 @@ button.icon-button.active i.fa-retweet { background: url('../images/void.png') repeat; object-fit: contain; } + + .react-swipeable-view-container { + max-width: 80vw; + } } .media-modal__close { -- cgit From b15f790221cdccaac04abfb9a0115823fbad883f Mon Sep 17 00:00:00 2001 From: Akihiko Odaki Date: Mon, 17 Jul 2017 17:23:28 +0900 Subject: Require images in common.js (#4232) --- app/javascript/mastodon/main.js | 2 -- app/javascript/packs/common.js | 2 ++ app/javascript/packs/public.js | 2 -- 3 files changed, 2 insertions(+), 4 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/main.js b/app/javascript/mastodon/main.js index 1f8ebb721..cc422c109 100644 --- a/app/javascript/mastodon/main.js +++ b/app/javascript/mastodon/main.js @@ -8,8 +8,6 @@ function main() { const React = require('react'); const ReactDOM = require('react-dom'); - require.context('../images/', true); - if (window.history && history.replaceState) { const { pathname, search, hash } = window.location; const path = pathname + search + hash; diff --git a/app/javascript/packs/common.js b/app/javascript/packs/common.js index a0cb91ae4..ba7053f1f 100644 --- a/app/javascript/packs/common.js +++ b/app/javascript/packs/common.js @@ -4,4 +4,6 @@ import { start } from 'rails-ujs'; require('font-awesome/css/font-awesome.css'); require('mastodon-application-style'); +require.context('../images/', true); + start(); diff --git a/app/javascript/packs/public.js b/app/javascript/packs/public.js index 6e6ba3476..371e0f445 100644 --- a/app/javascript/packs/public.js +++ b/app/javascript/packs/public.js @@ -6,8 +6,6 @@ import { getLocale } from '../mastodon/locales'; import loadPolyfills from '../mastodon/load_polyfills'; import ready from '../mastodon/ready'; -require.context('../images/', true); - const { localeData } = getLocale(); localeData.forEach(IntlRelativeFormat.__addLocaleData); -- cgit From 1d2616b79b6bc5b433092c302967c0ee33bd9845 Mon Sep 17 00:00:00 2001 From: Sorin Davidoi Date: Mon, 17 Jul 2017 10:57:45 +0200 Subject: fix(emojis): Handle multipoint emojis (e.g. country flags) (#4221) --- app/javascript/mastodon/features/compose/components/compose_form.js | 2 +- app/javascript/mastodon/reducers/compose.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/features/compose/components/compose_form.js b/app/javascript/mastodon/features/compose/components/compose_form.js index f07552947..98e823555 100644 --- a/app/javascript/mastodon/features/compose/components/compose_form.js +++ b/app/javascript/mastodon/features/compose/components/compose_form.js @@ -136,7 +136,7 @@ export default class ComposeForm extends ImmutablePureComponent { handleEmojiPick = (data) => { const position = this.autosuggestTextarea.textarea.selectionStart; - const emojiChar = String.fromCodePoint(parseInt(data.unicode, 16)); + const emojiChar = data.unicode.split('-').map(code => String.fromCodePoint(parseInt(code, 16))).join(''); this._restoreCaret = position + emojiChar.length + 1; this.props.onPickEmoji(position, data); } diff --git a/app/javascript/mastodon/reducers/compose.js b/app/javascript/mastodon/reducers/compose.js index ea3b78b67..781e6e11b 100644 --- a/app/javascript/mastodon/reducers/compose.js +++ b/app/javascript/mastodon/reducers/compose.js @@ -118,7 +118,7 @@ const insertSuggestion = (state, position, token, completion) => { }; const insertEmoji = (state, position, emojiData) => { - const emoji = String.fromCodePoint(parseInt(emojiData.unicode, 16)); + const emoji = emojiData.unicode.split('-').map(code => String.fromCodePoint(parseInt(code, 16))).join(''); return state.withMutations(map => { map.update('text', oldText => `${oldText.slice(0, position)}${emoji} ${oldText.slice(position)}`); -- cgit From 681c33d1f4c395742918eb66f2db979b0d628118 Mon Sep 17 00:00:00 2001 From: Lynx Kotoura Date: Tue, 18 Jul 2017 02:05:29 +0900 Subject: Quit overwriting style of extended-video-player (#4237) Though size of extended-video-player is already fixed to 80vw*80vh in components.scss, player size was also set to original video size in extended_video_player.js. Video size is fixed to 80vw*80vh, so video player's size must also be fixed to 80vw*80vh. --- app/javascript/mastodon/components/extended_video_player.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'app/javascript') diff --git a/app/javascript/mastodon/components/extended_video_player.js b/app/javascript/mastodon/components/extended_video_player.js index b38a4b8ff..5ab5e9e58 100644 --- a/app/javascript/mastodon/components/extended_video_player.js +++ b/app/javascript/mastodon/components/extended_video_player.js @@ -32,7 +32,7 @@ export default class ExtendedVideoPlayer extends React.PureComponent { render () { return ( -
+