Formatting toolbar

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.

I think you should just repurpose this plugin and call it a “Extended WYSIWYG Editor” or something along those lines.

It seems you added visuals for a lot that the other BBCode plugin adds, but they conflict with each other, which means people can’t use both unfortunately.

No, absolutely not. It’s not a WYSIWYG in any sense of the term. Discourse has a Markdown editor with a preview pane.

A WYSIWYG editor previews the styles and formatting in-line - think Microsoft Word or the TinyMCE editor.

4 Likes

Essentially the same thing when using the preview. I’m sure he understands what I mean even if terminology are different between others.

No, they aren’t, not even remotely close. This isn’t a point of debate, it’s the meaning of the term and it’s not something you can redefine at will.

Okay, well, my suggestion still stands.

I think WYSIWYG will be misleading, as Stephen said. My plugin is not that advanced

I don’t think there’s a bbcode that’s not in my plugin, I used the official as a base for mine at the time. I needed to add some bbcodes (float left and right, justify) myself for the plugin, so it’s easier to use all bbcodes in this plugin instead of asking users to install both.

1 Like