New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Configurable attachment captions #434

Merged
merged 4 commits into from Aug 4, 2017

Conversation

Projects
None yet
3 participants
@javan
Member

javan commented Aug 4, 2017

Trix.config.attachments.preview.caption = { name: true, size: true } // The default

default

Trix.config.attachments.preview.caption = { name: true, size: false } 

no-size

Trix.config.attachments.preview.caption = { name: false, size: true }

no-name

Trix.config.attachments.preview.caption = { name: false, size: false }

blank

Fixes #87

@javan javan merged commit f2b7720 into master Aug 4, 2017

1 check passed

continuous-integration/travis-ci/pr The Travis CI build passed
Details

@javan javan deleted the caption-config branch Aug 4, 2017

@toxin20

This comment has been minimized.

Show comment
Hide comment
@toxin20

toxin20 Aug 14, 2017

How can I override the configuration options for the caption?

I tried setting Trix.config.attachments.preview.caption but I get the following error because the attachment object in the config doesn't seem to be defined:
Uncaught TypeError: Cannot read property 'preview' of undefined

I tried to wrap the config change in a "trix-initialize" event listener but that didn't work either.

I'm not sure how & when to override config options since it hasn't really been featured in the documentation so far.
Would be awesome if you could point me in the right direction :).

toxin20 commented Aug 14, 2017

How can I override the configuration options for the caption?

I tried setting Trix.config.attachments.preview.caption but I get the following error because the attachment object in the config doesn't seem to be defined:
Uncaught TypeError: Cannot read property 'preview' of undefined

I tried to wrap the config change in a "trix-initialize" event listener but that didn't work either.

I'm not sure how & when to override config options since it hasn't really been featured in the documentation so far.
Would be awesome if you could point me in the right direction :).

@javan

This comment has been minimized.

Show comment
Hide comment
@javan

javan Aug 14, 2017

Member

This feature hasn't shipped in an official release yet so the commits are only in master. I hope to cut a new release soon. In the meantime, you can check out Trix and build it from source if you'd like: https://github.com/basecamp/trix#building-from-source.

Member

javan commented Aug 14, 2017

This feature hasn't shipped in an official release yet so the commits are only in master. I hope to cut a new release soon. In the meantime, you can check out Trix and build it from source if you'd like: https://github.com/basecamp/trix#building-from-source.

@toxin20

This comment has been minimized.

Show comment
Hide comment
@toxin20

toxin20 Aug 14, 2017

I checked out the master branch via yarn add basecamp/trix#master so the latest commit should be included, right? Or are the files in /dist/ not built from the latest commits?

Edit: Ah, I see. The files in /dist/ are built from the latest release version, not the master branch. I'll build it from source then.

toxin20 commented Aug 14, 2017

I checked out the master branch via yarn add basecamp/trix#master so the latest commit should be included, right? Or are the files in /dist/ not built from the latest commits?

Edit: Ah, I see. The files in /dist/ are built from the latest release version, not the master branch. I'll build it from source then.

@javan

This comment has been minimized.

Show comment
Hide comment
@javan

javan Aug 16, 2017

Member

FYI these changes are in Trix 0.11.0 now. Released yesterday. https://github.com/basecamp/trix/releases/tag/0.11.0

Member

javan commented Aug 16, 2017

FYI these changes are in Trix 0.11.0 now. Released yesterday. https://github.com/basecamp/trix/releases/tag/0.11.0

@kylefox

This comment has been minimized.

Show comment
Hide comment
@kylefox

kylefox Aug 17, 2017

This is awesome 👍

Any thoughts on adding the ability to turn off captions completely?

Related: #87: Make caption for previewable attachments optional

kylefox commented Aug 17, 2017

This is awesome 👍

Any thoughts on adding the ability to turn off captions completely?

Related: #87: Make caption for previewable attachments optional

@javan

This comment has been minimized.

Show comment
Hide comment
@javan

javan Aug 18, 2017

Member

@kylefox do you mean something different than Trix.config.attachments.preview.caption = { name: false, size: false }? That's what https://trix-editor.org/ has set, currently.

Member

javan commented Aug 18, 2017

@kylefox do you mean something different than Trix.config.attachments.preview.caption = { name: false, size: false }? That's what https://trix-editor.org/ has set, currently.

@kylefox

This comment has been minimized.

Show comment
Hide comment
@kylefox

kylefox Aug 18, 2017

@javan Thanks — turns out I just made a silly mistake.

kylefox commented Aug 18, 2017

@javan Thanks — turns out I just made a silly mistake.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment