Skip to content

Added the ability to copy async base roll in forum format for quick c…#19

Open
kalebhermes wants to merge 1 commit intomouse0270:masterfrom
kalebhermes:master
Open

Added the ability to copy async base roll in forum format for quick c…#19
kalebhermes wants to merge 1 commit intomouse0270:masterfrom
kalebhermes:master

Conversation

@kalebhermes
Copy link
Copy Markdown

…opy pasting.

@mouse0270
Copy link
Copy Markdown
Owner

mouse0270 commented Aug 8, 2018

I actually don't understand the purpose of this... If you type out 1d6 + 3 on the forums the Async Dice roller would pick it up and highlight it.

Am I misunderstanding the purpose of this pull request?

EDIT: I just realized that if you dont use the ascii times character and an X my dice roller wont pick up the XdY x Z... I should update the script to include the "x"

@kalebhermes
Copy link
Copy Markdown
Author

I've just started playing in a Play-by-Post game, where the forum can roll dice for you. For example, if the DM asks for a perception roll, you'd type [roll]1d20+4[/roll] into the forum text field, and after submitting, the forum would roll that for you. I figured rather than typing something like that every time, it would be nice to be able to quickly copy text in that format right from the extensions roller.

@mouse0270
Copy link
Copy Markdown
Owner

Let me think about this. This pull request seems very specific and might be outside of what I want the extension scope to be.

Would you be able to send me the forum site you are using, I would be curious to check it out.

I am not saying I won't include this, I am just not sure if it really fits my personal goal of this extension so I would like to think about it. Also, I would like to improve the code, I am not really a fan of functions inside of functions. lol

@kalebhermes
Copy link
Copy Markdown
Author

The forum is the one built into D&DBeyond. I'll drop a comment in your thread for the extension to see what I'm talking about. I agree that cleaning it up is probably a good idea. I snagged this code pretty much whole cloth from StackOverflow anyway.

If it doesn't fit with your vision, that's totally understandable! I can pull this code out and drop it into a stand along extension!

@kalebhermes
Copy link
Copy Markdown
Author

Just pushed a new patch that stripped all of the extra fallback code. navigator.clipboard is supported by all modern browsers, so if a given browser doesn't support it, we just don't display the button, removing the need for all fallback code.

@mouse0270
Copy link
Copy Markdown
Owner

much nicer code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants