Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat: add toggle preview json to copy to manifest.json #54

Open
wants to merge 2 commits into
base: main
Choose a base branch
from

Conversation

alexalannunes
Copy link

@alexalannunes alexalannunes commented May 17, 2021

I think that it's more easy to show a json snippet to developer can copy!

Demo

Copy link
Owner

@NotWoods NotWoods left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I like this feature idea! I'd like to replace some code with native tools that achieve the same effect. It would also be great to have some help text above/below the JSON that says where to put it. You can use:

Copy this JSON into the "icons" array of your Web App Manifest

@@ -297,6 +309,12 @@ <h2 id="modalTitle">Export</h2>
</label>
</div>

<div>
<a href="#" class="dialog-action-link" id="showPreviewArrayIcons">Show JSON</a>
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd like to use the <details>/<summary> elements instead to do the open/close without Javascript.

sizes: `${size}x${size}`,
}));

outputPreview.textContent = JSON.stringify(filteredJson, null, 2);
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updating the text is cheap enough that we can just change it everytime the selected checkboxes are changed. That also removes the need for a separate array, you can read sizeInputs.

@alexalannunes
Copy link
Author

Hi @NotWoods. I'm worning on it!

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.

None yet

2 participants