You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Description
A button that can copy the script JSON to the clipboard. The language wouldn't matter.
Additional context
I got a feature request for the Pocket Grimoire to allow a script's JSON to be pasted directly. This seems to have been well received and, when I announced it, someone mentioned that being able to copy JSON from the script repository directly would be a cool addition.
The text was updated successfully, but these errors were encountered:
This is what I've tried to achieve with the JSON button that currently exists but I had trouble with this writing the JSON content to clipboard and hence why I write the API URL which is itself just the JSON content. It's possible that I'm using the wrong method and need to use .write() rather than .writeText().
So I've managed to get this working but not overly keen on the result #367
It basically results in the entire JSON being inserted as a Javascript element on the page. Going to hold off merging this and have a think about the solution.
FWIW, I think this would be a great feature and your implementation of it is roughly how I'd do it as well.
Moreover, I'd look at Angular CDK's implementation here (and wrapped here) which might serve as a good reference for making the added element hidden and subsequently removing it (as well as handling some browser-specific edge cases.)
Description
A button that can copy the script JSON to the clipboard. The language wouldn't matter.
Additional context
I got a feature request for the Pocket Grimoire to allow a script's JSON to be pasted directly. This seems to have been well received and, when I announced it, someone mentioned that being able to copy JSON from the script repository directly would be a cool addition.
The text was updated successfully, but these errors were encountered: