Formatting toolbar

I’m not sure it’s related to this plugin, when I use another button on the toolbar, CTRL+Z doesn’t work either.

1 Like

hmmmm, yes, it looks like it. a bug it is then.

so it seems that this is intended behavior

Is that possible that I can edit the “Color text” default color?

Hi, I really like this toolbar. Especially the color text tool. It upgraded the “too-simple” markdown fonts.

While on the other hand, I don’t want my text to be too colorful either, so I usually use one extra color expect for default black, like only red color.

But the tool default is [color=#]Text[/color]
That makes me have to change the “#” symbol to “red” everytime.
Can I simply change the code to set the default color to “red”?


This is the right solution

After a rebuild, it takes effects.

Are you familiar with github ? The best way would be to fork the plugin and edit, you’ll have to install your version of the plugin.

But another (and easier) solution would be to deactivate the color button and add this code in Customize </head> :

<script type="text/discourse-plugin" version="0.4">
    api.onToolbarCreate(toolbar => {
      toolbar.addButton({
        id: "color_ui_button",
        group: "extras",
        icon: "paint-brush",
        perform: e => e.applySurround('[color=red]', '[/color]', 'Color')
      });
    });
</script>

It will create another color button with the default you want

1 Like

Is the installation of the BBCode plugin a prerequisite to installing @Steven’s Formatting toolbar plugin discussed in this thread?

I integrated almost all the code used in bbcode plugin, so it’s highly not recommended to use both, it will probably break your forum.

1 Like

How would they conflict? One outputs code into the editor, the other parses it, right?

I integrated the code in my plugin, I needed the create some bbcode (float for example), it was easier to add everything, and a have “all in one” plugin.

So you’re saying that your plugin will clash with the official bbcode plugin?

If so, shouldn’t that be noted in the OP, and potentially on the topic for the official plugin?

If a plugin clashes with an official plugin, shouldn’t it be tagged as broken?

2 Likes

Good point, sam added a warning in the first post

3 Likes

I just installed this formatting toolbar (my first plugin!) and created a video to help any other neophytes, like me, who would like to see a demonstration of how to install this or any other plugins!

5 Likes

FYI git pull has nothing to do with the installation of a plugin :wink:

It pulls the changes (if any) from https://github.com/discourse/discourse_docker to your local copy.

The nice thing, is that it’s not even needed as it is included when you do ./launcher rebuild app (:raised_hands: for less work)

4 Likes

is it possible to add this feature?

I think so, I personnaly use the gallery theme component from the same author without any issue.

Does anyone know how to add a horizontal rule? I have some members doing it with the <hr> tag, but others ask, “How can they do that!?”

I love the plugin.

like


this?

vvvvvvvvvvv

like

---

this?

^^^^^^^^^^^^^

You can create a button in the Customize section, in </head>

<script type="text/discourse-plugin" version="0.4">
    api.onToolbarCreate(toolbar => {
      I18n.translations.en.js.hrule_timestamp = "Horizontal rule";
      toolbar.addButton({
        id: "hrule_button",
        group: "extras",
        icon: "level-down",
        title: "hrule_timestamp",
        perform: e => e.addText("<hr>")
      });
    });
</script>

When you click on the button, it will add a <hr>

The best way would be to create a github account, fork the plugin and edit it

Most of the action after that is in

:file_folder: assets/javascripts/discourse/initializers/ for the buttons
:file_folder: config/ for the language

4 Likes

Indeed, but I want something on the bar so the users who don’t know the secrets can easily do it.

That is beautiful. I can’t thank you enough. It’s up and running on all my themes.