]> cat aescling's git repositories - mastodon.git/commitdiff
Downsize originals in media attachments, small fixes
authorEugen Rochko <eugen@zeonfederated.com>
Mon, 5 Dec 2016 16:13:05 +0000 (17:13 +0100)
committerEugen Rochko <eugen@zeonfederated.com>
Mon, 5 Dec 2016 16:13:44 +0000 (17:13 +0100)
app/assets/javascripts/components/actions/compose.jsx
app/assets/javascripts/components/components/media_gallery.jsx
app/models/media_attachment.rb
app/views/api/v1/statuses/_media.rabl

index 23bcf8eac9de25adbd9827a383945ca692d6a491..ec5465381c4a0d98e9365ead1818c9b8422dda78 100644 (file)
@@ -74,7 +74,7 @@ export function submitCompose() {
       // To make the app more responsive, immediately get the status into the columns
       dispatch(updateTimeline('home', { ...response.data }));
 
-      if (response.data.in_reply_to_id === null) {
+      if (response.data.in_reply_to_id === null && !getState().getIn(['compose', 'unlisted'])) {
         dispatch(updateTimeline('public', { ...response.data }));
       }
     }).catch(function (error) {
index d04c7c869983675781efc3ca6617f427a540b378..9aafd81816568f6efa56b331b5bf423fdf7936bb 100644 (file)
@@ -129,7 +129,7 @@ const MediaGallery = React.createClass({
 
         return (
           <div key={attachment.get('id')} style={{ boxSizing: 'border-box', position: 'relative', left: left, top: top, right: right, bottom: bottom, float: 'left', border: 'none', display: 'block', width: `${width}%`, height: `${height}%` }}>
-            <a href={attachment.get('url')} onClick={this.handleClick.bind(this, attachment.get('url'))} target='_blank' style={{ display: 'block', width: '100%', height: '100%', background: `url(${attachment.get('preview_url')}) no-repeat center`, textDecoration: 'none', backgroundSize: 'cover', cursor: 'zoom-in' }} />
+            <a href={attachment.get('remote_url') ? attachment.get('remote_url') : attachment.get('url')} onClick={this.handleClick.bind(this, attachment.get('url'))} target='_blank' style={{ display: 'block', width: '100%', height: '100%', background: `url(${attachment.get('preview_url')}) no-repeat center`, textDecoration: 'none', backgroundSize: 'cover', cursor: 'zoom-in' }} />
           </div>
         );
       });
index d37ef99a85b75678286192a5d3bc0bac6c6c4996..7214ab88098a96a404f72bc28d31e075818ca89b 100644 (file)
@@ -44,7 +44,7 @@ class MediaAttachment < ApplicationRecord
     def file_styles(f)
       if f.instance.image?
         {
-          original: '100%',
+          original: '1280x1280>',
           small: '510x680>',
         }
       else
index af635dfecb8d605e68e817845ef90f2aeb7417e8..5c6be1ce779fa2272b56eb32beef28a468d32207 100644 (file)
@@ -1,4 +1,4 @@
 attributes :id, :remote_url, :type
 
-node(:url)         { |media| full_asset_url(media.file.url( :original)) }
-node(:preview_url) { |media| full_asset_url(media.file.url( :small)) }
+node(:url)         { |media| full_asset_url(media.file.url(:original)) }
+node(:preview_url) { |media| full_asset_url(media.file.url(:small)) }