Giter Club home page Giter Club logo

nodebb-plugin-composer-redactor's Introduction

Redactor for NodeBB

This plugin activates the WYSIWYG Redactor composer for NodeBB. Please ensure that:

  • "Sanitise HTML" is disabled from the Markdown plugin (or the markdown plugin is disabled altogether)
  • Any other composers (i.e. nodebb-plugin-composer-default) is disabled

⚠️ Maintenance Alert

Please be advised that this composer has been superceded by the Quill Composer. This composer has entered maintenance mode, meaning it will continue to work on newer NodeBB versions, although at potentially reduced functionality.

Please file an issue on the issue tracker if there are regressions after NodeBB releases.

Screenshots

Desktop

Desktop

Mobile

Mobile

Attributions

  • Thank you to Drew Llewellyn (GitHub) for providing the OEM license that made this plugin possible!
  • Thank you to philburr for his serverside sanitization and z-index fixes.

nodebb-plugin-composer-redactor's People

Contributors

arasbm avatar barisusakli avatar dependabot[bot] avatar drewdotpro avatar exomarty avatar gasoved avatar julianlam avatar philburr avatar pichalite avatar pitaj avatar psychobunny avatar segura2010 avatar yariplus avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

nodebb-plugin-composer-redactor's Issues

Firefox issue - posting

I have found a bug in Firefox (which I can't replicate on Chrome, IE or Opera) - other users have reported it happening but I don't know what browser they use. I'm using the Persona theme on NodeBB, which is version 0.8.2.

After replying to a post or starting a new topic, I navigate to another topic, and try to click Reply. The "plus" button (used in Persona theme to hide/show the composer) appears bottom-right, but the Redactor composer doesn't, nor does clicking the "plus" button.

Checking the console in Firefox, it's displaying a "NS_ERROR_FAILURE:" error each time either is clicked. The console seems to point to nodebb.min.js with this error.

Refreshing the browser page seems to let you post again.

Topic Thumbnail

Hi guys,

I'm using NodeBB with Persona and I realized that I can't upload topic thumbnails when using redactor. Is there a way for doing it?

Thanks!

Firefox issues - highlighting, editing text

Using Firefox on Win7, I found the following issues:

Highlighting text (either by double-clicking a word or click-and-drag highlighting) doesn't work at all, unless done in HTML mode.
Highlighting text in HTML mode, then clicking "link" to add a hyperlink: the "selected" text isn't added to the "Text" box in the "Insert link" popup, and must be retyped.

No similar problems in Chrome.

NodeBB version 0.8.1

Needs server side html validation

nodebb-plugin-composer-redactor requires that you turn off HTML sanitization in the markdown plugin. Although redactor does provide client side sanitization, one can easily inject XSS into a site by opening up a dev console in chrome and calling socket.emit() to manually create a post with malicious javascript.

Injecting Javascript, etc

I found several ways to inject arbitrary Javascript into posts. The easiest two being the onmousedown/up/over attributes and using the url() css construct. With some tags, these are not parsed out whatsoever.

You are also not sanitizing on post edit at all, because the passed object is different from what you are expecting.

Emoticon on newline

With redactor, when i add an emoticon i see it normally through the text in the editor, but when i post the message every emoticon is showed in a newline.

temp

Cant edit post

Redactor not loading on post edit
tried previous commits and coudnt make it work
is it only me?

thank you

Not compatible with 0.9.4

This is a nice plugin every forum needs. It would be nice if you could update it and make it compatible with 0.9.4.

Markdown support

Currently when using Markdown in Redactor, it doesn't seem to be parsed by the Markdown plugin.

Would it be possible to support Markdown parsing alongside with HTML?

Pasting images does not work

Attempting to paste an image results in a Javascript error
image
and no image being pasted into the composer. This does not happen on the default composer.

gif -> webm

convert gif in to webm using ffmpeg(if installed)

Add support for Nodebb default quote system

When you press "quote" to reply to a thread it should have Redactor support so that you don't have to manually select the quote and click format -> quote to turn it into the actual quoting format.

Error after upgrading Nodebb to v1.0

9/3 11:12 [15788] - error: Error: Cannot find module './plugins' at Function.Module._resolveFilename (module.js:338:15) at Function.Module._load (module.js:280:25) at Module.require (module.js:364:17) at Object.<anonymous> (/home/minecraft/mynodebb/node_modules/nodebb-plugin-composer-default/library.js:3:29) at Module._compile (module.js:456:26) at Object.Module._extensions..js (module.js:474:10) at Module.load (module.js:356:32) at Function.Module._load (module.js:312:12) at Module.require (module.js:364:17) at Object.<anonymous> (/home/minecraft/mynodebb/node_modules/nodebb-plugin-composer-redactor/library.js:5:33) 9/3 11:12 [15788] - warn: [plugins] Unable to parse library for: nodebb-plugin-composer-redactor

Question: can you add some more features?

Hi,
Would it be possible to add code & spoilers?
I've tried all of the spoiler plugins, and none of them are working with your plugin (and I've tried with Markdown enabled and disabled, and Sanitization enabled and disabled) same with the code plugin.

Thanks

Save draft on reload

Reloading page loses composer content. Composer default does it so this is a possible enhancement.

Integrate Redactor II

We've received a new Redactor version from @drewdotpro, and it needs to be integrated properly into this plugin.

So far there are some breaking changes, including (but not limited to):

  • No more .setAwesome(), so all plugins with Redactor integration need fixing (/cc @yariplus )
  • Changes in API as per their new doc (things like focus, insertNode, etc...)
  • Emoji plugin not at all compatible anymore, so removed (/cc @exomarty )

The 2.0 branch is currently unusable, and is located in the redactor-ii branch.

Remove focus from Redactor & using Tab key

I tried to explain this in the NodeBB forums but it probably looked confusing. There's two points.

First point:

When you go to begin a new topic on NodeBB with the default composer, input is automatically focused on the Title field. You can then either tab to change categories and/or add tags, etc.

On Redactor composer, Redactor's text area itself is focused on. This means instead of the cursor starting in the topic title field, you're typing straight into Redactor composer.

Now this isn't a bad thing when replying to a topic (you're immediately typing a reply), but in starting a new topic you have to physically select the title field to do that where intuitively it should start there.

Second point:

If you do select the title input field, you cannot use the Tab key to navigate into Redactor composer from the tags. It skips it completely. You have to physically click on the composer to to type in a post.

Default composer, you'd press Tab to move from:
Title > Category dropdown > Tags > Composer > Submit button

In Redactor, using Tab to navigate goes like this (assuming you click on Title to begin):
Title > Category dropdown > Tags > Submit button > navigation bar at top of page

This may seem a minor annoyance, which it is, but if you're used to the original NodeBB composer it does catch you out somewhat.

Thanks guys!

Emoji size

Emojis (emoji-extended) are quite large when included in message. Is there a way to define emoji size?

Redactor 1.4.0 doesn't show up when making a new thread

NodeBB v1.0.0
Redactor 1.4.0

When you try to start a new thread Redactor editor pops up and then after 0.5 seconds on the screen it promptly hides itself.

You can then click the big red + sign on the lower right to make it pop up again for 0.5 seconds and then hiding itself again.

If you start banging random keys ie. "dddddddddd" etc. while the editor is on the screen for the 0.5 seconds - it will stay up and you are able to write your message.

Localisation

Hi,
did I miss something, or is the plugin currenty only in English?
I could help you with the german translation :)

Tables / Links / Lists not shown

Seems like none of the features I tried in the editor are actually showing up in the saved post. I created a table (looked perfectly in the editor) and in the post I just had the text. Same with links none are clickable. Lists also end up as text only.

White background

When using bootswatch dark skin (Cyborg, Darkly, etc) you can't see Heading (white text on white background).

How to add a button?

With the default composer its rather easy to add extra buttons, I cant figure how to do it properly with this?
Any tips would be appreciated.
The docs (I think) are showing how to add a button when starting redactor?
You can add one using external api stuff once redactor has started, but then the script has to wait....I know how to do that crap (I like making chrome extensions) but thats bleh.
I can add one using something like this....

        if ($ && $.Redactor) {
            $(function() {
                if (!$.Redactor.opts.plugins) $.Redactor.opts.plugins = [];
                $.Redactor.opts.plugins.push('advanced');
                $.Redactor.prototype.advanced = function() {
                    return {
                        init: function() {
                            var button = this.button.add('advanced', 'Advanced');
                            // make your added button as Font Awesome's icon
                            this.button.setAwesome('advanced', 'fa-tasks');
                            this.button.addCallback(button, this.advanced.testButton);
                        },
                        testButton: function(buttonName) {
                            alert(buttonName);
                        }
                    };
                };
                // This is how your MEANT to do it....
                // $('#redactor').redactor({
                //     plugins: ['advanced']
                // });
            });
    }

..but I just figured that out by mucking around and cant find it documented anywhere.
I don't know much about hooks yet, but isn't this somewhere that one could be useful?
One to register a plugin to be registered before the start of redactor as it seems your only meant to add them at the start of redactor?

If I'm just missing something simple...I'm sorry, I'm new and impatient ;)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.