Quick Quote Theme Component

Repo: GitHub - merefield/discourse-quick-quote: A Theme component to change the behaviour of the Post Reply buttons to quote a Post automatically in a single click.

What it does

Simply: it changes the behaviour of the Post Reply buttons (not Topic reply) to quote a Post automatically in a single click.

There are several settings to refine what is quoted and when. You can even specify nesting of quotes for that ‘old skool’ feel.

Because the automated quote is delivered to the Composer, you can refine it manually from there if you so wish (but that kind of defeats the ‘quick’ part :snail:).

It doesn’t change the behaviour of the bottom Topic Reply button, nor the Quoting tool.

Why

  • Some have felt the act of quoting takes too many clicks in the base install. This is more of an issue on touch devices.

  • “Auto-quoting” is particularly useful when the reply is to a post quite a way back. This plugin counts how far back the referenced post was and will automatically enter a quote if far enough back. This helps people understand context a bit quicker.

  • It brings back ‘Nested Quotes’! (default OFF) The Component may be particularly attractive to those who are used to some of the ‘old skool’ forum platforms :space_invader: and is a matter of taste - if you like to see nested quotes you now can, but be aware of the consequences to space!

You don’t need it if

You are 100% happy with out-of-the-box Topic Post Reply behaviour. I am, but it’s great to have options, right?

Settings

quick_quote_post_location_threshold: “Number of posts back before quick quote enabled.”

Control how far back a post needs to be before the auto-quoting is actioned. Avoids unnecessary quotation of recent posts.

quick_quote_remove_links: “Remove all links (inc. pictures) from quotes”

Cleans things up and improves use of space

quick_quote_remove_prior_quotes: “Remove all prior (nested) quotes”

Enabled by default. Clear this setting for the ultimate nested old-skool experience. (Sorry Jeff! :wink: )

quick_quote_remove_contiguous_new_lines: “Remove unnecessary new lines”

New lines are over-rated.

quick_quote_character_limit: “Quote character limit (uses last x chars if total length is greater)”

Excerpts are pretty basic :slight_smile: Revert to Quote tool if you need a more targeted quote (which is not overridden by the plugin)

Known Limitations

The Theme Component is fairly simple in the way it handles the preparation of a quote. Some settings work better together than others and it’s up to the admin to determine what works for them. Some complexity is avoided, e.g. there is an excerpt character limit which can break words in half. Formatting is simplified as tags are removed to avoid the risk of truncating a tag and causing corruption - again this is to achieve simplicity. Quote processing relies heavily on regular expressions, not all of which are completely foolproof, but work ‘well enough’. These may be refined over the life of the Theme Component.

This was recently ported over from my identical Plugin, but may have picked up bugs in that process. Let me know if you come across any.

My sponsor and the inspiration for this Component

Please thank @Merlls_Rizzini for sponsoring this work. The functionality is a brain dump from both of us and is partially inspired by this post by @eesty.

NB This was based on my Fast Quote Plugin, but moved to a Theme Component format to give more site managers access if they are hosted by a third party. @sam suggested this was converted to a Theme Component as there was no back-end component and @sully gave me the final push to move this over having created his very own Theme version.

All feedback welcome.

29 Likes

If I’d of not skip read that I’d of spent less time trying to figure out the value,

I like it :+1:

3 Likes

Would be cool if you could use this by category, would love to have it in our AMA category, but otherwise it would be kinda messy.

2 Likes

A recent Git commit to topic.js seems to have broken this theme component:

Quote.build() no longer exists; they seem to be importing and using the buildQuote() function instead. A quick substitution didn’t do the trick; will have to ponder this a bit more.

2 Likes

My bad! The quick quote plugin wasn’t on the all-the-plugins list so I missed it when looking for regressions. I’ll add it and I’ve opened a PR with a fix to the plugin:

https://github.com/merefield/discourse-quick-quote/pull/1

(plus a small fix to settings: https://github.com/merefield/discourse-quick-quote/pull/2)

5 Likes

Awesome, thanks Jarek (and thanks for reporting @sully!) , merged! (and thanks for the bug fix!)

1 Like

I am running this theme, did the update yesterday and getting complaints today

upon creating a post to reply and explain I found if I’m replying to a post and I go up to another and
want to reply in whole I can not, the reply remains on the post I started with,

previously it would toggle, the quick quote still works though

For my full comprehension, would you mind breaking that down a bit more … can you explain it in finer steps and where you believe it goes wrong?

1 Like

Yeah its being discussed now and the inability to hit reply any further up than 3 posts is likely going to be one of those haunting, need to explain over and over problems

Quick quote is great, but can the reply function be restored?

I’m still not following you. Can you please go into greater detail and more steps?

I’ve retested the Component locally and it seems to be behaving fine?

1 Like

No problem, and maybe I’m misinterpreting function or some other oversight

but right now as it stands if I go up in a thread 4 posts in a thread the reply button is disabled,

this was only mentioned today and yesterday I did the update

So I believe its related, maybe there’s a setting involved?

Can you show me your Theme settings?

Can you also confirm you are on the latest discourse version and latest version of the Theme Component?

Also, can you please let me know if you see any Javascript errors on the console?

1 Like

in a random thread

this site doesn’t show version like my self hosted

1 Like

Thanks.

OK so I’ve set my settings the same and cannot replicate. The Reply button 4 posts back is working fine.

That’s highly suspicious though given your settings. (The ‘3’ jumps out!)

I’m on the latest version of Discourse and the TC. Make sure you are fully updated on both.

1 Like

view source says Discourse 2.5.0.beta2

and TC is theme component?

image

changing 3 to 5 allows me to reply up to the 5th post

so do I do a 9999 and does that short any other function?

OK so I’ve replicated your issue on a Production site …

v2.5.0.beta2 +459

Those changes that Jarek submitted were very specfically targetting the latest version of Discourse.

Is it possible you are on a Discourse commit prior to his changes? If so, it will not work with the latest TC. You need to upgrade both or neither.

Moreover, I’ve just upgraded that site (to latest-release +495) and all is well again.

So yeah, you need to upgrade your Discourse past his commit.

1 Like

Can you provide any css I can use to roll back?

then I’ll remove it after my site is updated?

Thank you :slightly_smiling_face:

or

@team is my site do for an update soon?

Ah, good idea, except I don’t think you can access the javascript folder contents from the UI (someone please correct me if I’m wrong!).

Unfortunately I don’t believe you can install a specific commit of a Theme Component either (ditto!).

So my suggestion is, yeah, change that 3 to 9999 and wait until your Discourse is more up-to-date.

1 Like

Can do, no worries and thanks for the cooperation, its greatly appreciated :+1:

1 Like

Hey all you Quick Quoting hip-shooting Discoursers … I’ve released a fix to make Quick Quote work again with latest Discourse.

I’m tracking tests-passed so do not update if you are not on that branch.

https://github.com/merefield/discourse-quick-quote/commit/c353d33bd0752d6de1cbd0ddc1d91fdb1413ea59

3 Likes