Skip to content
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 toolbar and formatting attributes #143

Closed
wants to merge 13 commits into from
Closed

Conversation

javan
Copy link
Contributor

@javan javan commented Dec 23, 2015

  • API for extending and customizing the toolbar
  • Documentation

@existent-ltd
Copy link

Any idea when this is likely to be merged? Waiting for this feature is blocking us from switching to Trix from our existing editor.

@HLuthi
Copy link

HLuthi commented Jan 22, 2016

Same as @existent-co-uk. Any word on this?

@hmaesta
Copy link

hmaesta commented Mar 28, 2016

Is this ready to use?

@javan javan mentioned this pull request Apr 13, 2016
@Anaphase
Copy link

Anaphase commented Aug 3, 2016

What's the status of this PR? Would be a great addition to an already great tool.

@javan
Copy link
Contributor Author

javan commented Aug 4, 2016

I still plan on seeing this through, but don't have an ETA. #263 and #268 will come first.

@wwwslinger
Copy link

wwwslinger commented Sep 30, 2016

@javan #263 is merged -- what's holding back #268? Would love to get this in and have an easier way to configure the toolbar (and get the config into the editor since I'm using this in a React component, thus not the global Trix).

@joeldrapper
Copy link

Hey @javan, is there anything blocking this PR, or #268, that we could help with?

@spruce
Copy link

spruce commented Jan 17, 2017

As it seems only the docs are missing. Is that correct? I would like to see this feature be merge soonish into trix. How can I help?

@aerosol
Copy link

aerosol commented Apr 21, 2017

Any chance of getting that merged?

@abulrim
Copy link

abulrim commented Apr 27, 2017

For people coming across this like I was, the following solution worked for me: I basically overwrote Trick.config.toolbar as defined here as such:

let { makeFragment } = Trix;
let { lang } = Trix.config;

Trix.config.toolbar = {
  content: makeFragment(`
    <div class="button_groups">
      <span class="button_group text_tools">
        <button type="button" class="bold" data-attribute="bold" data-key="b" title="${lang.bold}">${lang.bold}</button>
        <button type="button" class="italic" data-attribute="italic" data-key="i" title="${lang.italic}">${lang.italic}</button>
        <button type="button" class="link" data-attribute="href" data-action="link" data-key="k" title="${lang.link}">${lang.link}</button>
      </span>
      [...custom html]
    </div>
  `)
};

this will also give you control over the naming of the css classes in case they conflict with your code.

@adrianoresende
Copy link

PR dead? =/

@frystpingvin
Copy link

Any updates on this?

@javan
Copy link
Contributor Author

javan commented Sep 29, 2017

Hello, so sorry for letting this linger, and even more sorry to say that it's not going to be merged.

We do really want the toolbar to be more customizable, but we'd like to rethink how the toolbar integrates with the editor first.<trix-toolbar> and ToolbarController are too entwined with Trix currently, and we don't want to deepen that relationship by building more on top.

Our ideal toolbar would be a standalone component that works with Trix's Editor API and/or events. That's all we know for now.

@javan javan closed this Sep 29, 2017
@javan javan deleted the customize-toolbar branch September 29, 2017 21:30
@javan
Copy link
Contributor Author

javan commented Sep 29, 2017

If you're interested, let's figure out what API Trix should expose to best allow you to build your own toolbar component. I'm pretty sure Trix will always ship with a default toolbar, but the ultimate path to customization is making it easy and straightforward to BYO.

@unikitty37
Copy link

Since this has been quiet for over a year now, can somebody tell me what I can do now to customise the toolbar? Specifically, to replace the <h1> button with <h4> and <h5> buttons, and delete the <pre> button?

@auscaster
Copy link

https://github.com/basecamp/trix/wiki/Configuration

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.