forked from WordPress/playground-tools
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Playground block: Add Open-in-New-Window feature (WordPress#326)
## What? Add ability to open a Playground block in a dedicated window. ### What it does Opening in a new window reflects the current file content in the code editor as well as the activation status (i.e., if the iframe is already activated, it will be auto-activated when opening a new window). ### What it doesn't do It doesn't relay WP data and state to the new window. Opening a new window starts with initial WP state. Related to WordPress#279 ## Why? Two reasons to add this are: 1. Users who rely on assistive technology have requested this because it is easier to interact with Playground as a dedicated, separate page. 2. Full-page Playground allows the user to work with both a larger code editor and a larger Playground iframe. ## How? This PR: - Adds support for a special query string to receive Playground block configuration and render it as a standalone page. - Adds an "Open in New Window" link to the Playground block on the front end, when not already running in a full-page context. ## Testing Instructions I've smoke tested with a variety of configuration, but I think the following are reasonable test instructions for review. We need to test these configurations: - Horizontal: Code editor side-by-side with preview - multiple files with error log - Vertical: Code editor above preview - multiple files with error log - No code editor Test by creating a post containing one of each configuration and doing the following with each: - Click the "Open in New Window" link and observe that the block contents are opened as a full-page in a new window. - If there is a code editor, make some changes, open again in a new window, and observe that the code changes are reflected in the new full-page window. - Activate the preview in the embedded block, click "Open in New Window", and observe that the new window auto-activates the preview.
- Loading branch information
1 parent
7a05ed0
commit 9cf72a0
Showing
4 changed files
with
233 additions
and
41 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters