Skip to content
This repository has been archived by the owner on Jun 15, 2019. It is now read-only.

Mod macros: allow insert mode for macro text (currently overwriting initial reply box contents) #809

Open
multubunu opened this issue Feb 12, 2017 · 5 comments

Comments

@multubunu
Copy link

This is a feature request, I have more as a matter of fact, will open them separately.

Consider the following scenario:

  • reacting to someone insulting people; select offending text, press reply
  • the reply box opens with the offending text already quoted
  • activating the appropriate macro will overwrite the initially existing text; that needs to be copy/pasted in the macro dialog box.

This could be avoided if the macro text would be inserted after the existing text in the reply box, rather than overwriting the existing comments.This is a feature request, I have more as a matter of fact, will open them separately.

Consider the following scenario:

  • reacting to someone insulting people; select offending text, press reply
  • the reply box opens with the offending text already quoted
  • activating the appropriate macro will overwrite the initially existing text; that needs to be copy/pasted in the macro dialog box.

This could be avoided if the macro text would be inserted after the existing text in the reply box, rather than overwriting the existing comments.

@eritbh
Copy link
Member

eritbh commented Feb 12, 2017

Hmm, maybe we could introduce a token for any text that's already in the reply box? That way you could set macros up to include that text wherever it's relevant, and you could type out the custom part before confirming the rest of the macro.

Would probably end up extending info around macros.js:433 - maybe name the new token something like replytext, could just insert something like:

info.replytext = $this.closest('.usertext-edit').find('textarea').text()

@creesch thoughts?

@creesch
Copy link
Member

creesch commented Feb 13, 2017

The thing is, the macro doesn't overwrite whatever is in there... It opens up a popup you can move.

Having said that, a token for existing text is a good idea since in new modmail the macro will actually replace whatever is in the reply box...

We probably want the token to be part of TBUtils.getThingInfo if at all possible.

@eritbh
Copy link
Member

eritbh commented Feb 13, 2017 via email

@creesch
Copy link
Member

creesch commented Feb 13, 2017

Hrm, that is true. It might indeed be more appropriate in the macro itself.

I am not even sure it should be a token to be honest, maybe "prepend/append text from textarea" as a button. Though rereading the use case he can probably simply use {body} as token most of the times.

Ah well... Let's go for a token at first in the macro module itself it is simplest thing to do.

@eritbh
Copy link
Member

eritbh commented Feb 13, 2017 via email

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

No branches or pull requests

3 participants