-
Notifications
You must be signed in to change notification settings - Fork 378
Add paired browsing interface #3656
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
Merged
Merged
Changes from all commits
Commits
Show all changes
56 commits
Select commit
Hold shift + click to select a range
06e2f66
Add paired browsing admin menu bar item
pierlon aa416d9
Adapt 'AMP_To_AMP' paired browsing plugin developed by Weston
pierlon 3dc85b3
Disconnect AMP iframe if there are validation errors
pierlon eed7188
No need to check support mode if checking if its in paired mode
pierlon 44995bf
Add doc comment for `serve_paired_browsing_experience`
pierlon 3042b39
Fix lint errors
pierlon 80ef180
Fix trailing commas
pierlon 5bab275
Destructure `window` to retrieve global variables
pierlon 4497761
Add Paired Browsing navigation bar
pierlon fda81a0
Enqueue Paired Browsing app assets
pierlon 47c2b20
Remove redundant echo
pierlon 26d728e
Require generated assets from `wp-scripts`
pierlon f9e0e04
Use helpers from WordPress packages to make code DRY
pierlon 7d3983c
Escape text
pierlon 1416e5d
Add missing doc comment
pierlon dad775b
Remove any unnecessary query vars that could hamper for the paired br…
pierlon ce70fe7
Add paired browsing button to AMP Validated URL status metabox
pierlon b521903
Add the ability to exit paired browsing
pierlon 1c98628
Allow paired browsing while admin bar is not showing
pierlon f4e5365
Provide inline variables through `wp_localize_script`
pierlon 338535c
Make exit link accessible
pierlon f7fea3b
Add labels for iframes
pierlon 14e3ffc
Make labels noninteractive
pierlon 0eb64fc
Revert adding labels on iframes
pierlon c49975f
Lower the interval on checking for a disconnected iframe
pierlon 94f1c34
Underline exit link on hover
pierlon 8cef6af
Use horizontal ellipsis HTML code
pierlon deed1e3
Refactor escape of HTML
pierlon 2a0fe5d
Add titles for iframes
pierlon e931ba4
Prevent AMP iframe from loading twice
pierlon 1d2787f
Move paired browsing template to includes/templates
pierlon ab76768
No need to open paired browsing in a new template as there is now a l…
pierlon 9c96881
Ensure all scripts paired browsing interface depends upon is whitelisted
pierlon 1aad73e
Add skip links for iframes
pierlon e8fac2b
Use query selector for targeting iframes
pierlon d09d368
Move AMP logo into same list item of its label
pierlon 8bf8dc4
Underline exit link on focus
pierlon 2eb69af
Add labels for each iframe
pierlon d86ba3f
Show 'disconnected' overlay if AMP version of page is not available o…
pierlon 135115b
Make AMP document check more robust
pierlon b584f48
Remove AMP menu in non-AMP window
pierlon 072c29d
Use `__return_true` function for simplicity
pierlon 7d52f7d
Only create paired browsing item admin bar data if needed
pierlon 967e75a
Remove underline from iframe labels
pierlon b684aa2
Navigate parent window to disconnected client upon exiting
pierlon 671e6c0
Use gray background color for non-AMP half of screen
westonruter f56ab39
Let Non-AMP and AMP headings be links
westonruter 02aff70
Eliminate (redundant) Paired Browsing heading and Exit link
westonruter 72f761d
Use 'AMP Paired Browsing:' as prefix for document title
westonruter 05fc0b0
Merge branch 'develop' of github.com:ampproject/amp-wp into enhanceme…
westonruter 2097e41
Omit paired browsing admin bar item when invalid markup present
westonruter 42a4c92
Remove all validation query vars when entering paired browsing
westonruter 7824d05
Add helper method to get paired browsing URL and use in links up front
westonruter 53c78f4
Remove 'start' from paired browsing; use link instead of button
westonruter 0b2caa8
Remove extraneous method in favor of (temporary) closure
westonruter a13bddd
Add robots noindex/nofollow meta tag in paired browsing app
westonruter File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or 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 hidden or 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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,195 @@ | ||
| html, | ||
| body { | ||
| margin: 0; | ||
| padding: 0; | ||
| height: 100%; | ||
| width: 100%; | ||
| } | ||
|
|
||
| body { | ||
| display: flex; | ||
| flex-direction: column; | ||
| } | ||
|
|
||
| body * { | ||
| font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif; | ||
| } | ||
|
|
||
| #header { | ||
| height: 32px; | ||
| } | ||
|
|
||
| #header * { | ||
| color: #fff; | ||
| } | ||
|
|
||
| #header ul { | ||
| display: flex; | ||
| margin: 0; | ||
| padding: 0; | ||
| list-style: none; | ||
| height: 100%; | ||
| } | ||
|
|
||
| #header li { | ||
| align-items: center; | ||
| display: flex; | ||
| line-height: 1.5; | ||
| } | ||
|
|
||
| #header .iframe-label { | ||
| margin: 0 auto; | ||
| font-weight: 600; | ||
| width: 50%; | ||
| justify-content: center; | ||
| } | ||
|
|
||
| #header .iframe-label.amp { | ||
| background-color: #0075c2; | ||
| } | ||
|
|
||
| #header .iframe-label.non-amp { | ||
| background-color: #666; | ||
| } | ||
|
|
||
| .iframe-label a { | ||
| text-decoration: none; | ||
| } | ||
|
|
||
| .iframe-label .dashicons-migrate { | ||
| padding-left: 4px; | ||
| text-decoration: none; | ||
| vertical-align: text-top; | ||
| } | ||
|
|
||
| .iframe-label a:hover, | ||
| .iframe-label a:focus { | ||
| text-decoration: underline; | ||
| } | ||
|
|
||
| #non-amp, | ||
| #amp { | ||
| flex: 1 0 auto; | ||
| align-self: stretch; | ||
| } | ||
|
|
||
| #non-amp { | ||
| border-right: 1px solid #666; | ||
| } | ||
|
|
||
| #amp { | ||
| border-left: 1px solid #0075c2; | ||
| } | ||
|
|
||
| .container { | ||
| display: flex; | ||
| height: 100%; | ||
| } | ||
|
|
||
| iframe { | ||
| width: 100%; | ||
| height: 100%; | ||
| border: 0; | ||
| } | ||
|
|
||
| .disconnect-overlay { | ||
| display: none; | ||
| position: fixed; | ||
| width: 50%; | ||
| height: 100%; | ||
| overflow-y: auto; | ||
| background-color: rgba(0, 0, 0, 0.4); | ||
| text-align: center; | ||
| } | ||
|
|
||
| .disconnect-overlay::before { | ||
| content: " "; | ||
| display: inline-block; | ||
| vertical-align: middle; | ||
| height: 100%; | ||
| } | ||
|
|
||
| .disconnect-overlay.disconnected { | ||
| display: block; | ||
| } | ||
|
|
||
| .disconnect-overlay .dialog { | ||
| width: 480px; | ||
| background-color: #fff; | ||
| border-radius: 5px; | ||
| position: static; | ||
| margin: 20px 0; | ||
| padding: 0 20px; | ||
| display: inline-block; | ||
| vertical-align: middle; | ||
| pointer-events: auto; | ||
| } | ||
|
|
||
| .disconnect-overlay.amp { | ||
| left: 50%; | ||
| } | ||
|
|
||
| .disconnect-overlay .dialog .dialog-icon { | ||
| margin: 20px auto; | ||
| } | ||
|
|
||
| .disconnect-overlay .dialog .dialog-icon .dashicons-warning { | ||
| width: 80px; | ||
| height: 80px; | ||
| font-size: 80px; | ||
| color: #fe7f2d; | ||
| } | ||
|
|
||
| .disconnect-overlay .dialog .dialog-text { | ||
| font-size: 16px; | ||
| padding: 0 10px; | ||
| max-width: calc(100% - 20px); | ||
| overflow-wrap: break-word; | ||
| } | ||
|
|
||
| .disconnect-overlay .dialog .dialog-buttons { | ||
| margin-top: 13px; | ||
| padding: 13px 16px; | ||
| } | ||
|
|
||
| .disconnect-overlay .dialog .dialog-buttons button { | ||
| margin: 5px; | ||
| border: none; | ||
| box-shadow: none; | ||
| border-radius: 5px; | ||
| font-weight: 600; | ||
| font-size: 14px; | ||
| padding: 10px 24px; | ||
| cursor: pointer; | ||
| } | ||
|
|
||
| .skip-link { | ||
| position: absolute; | ||
| left: -9999rem; | ||
| top: 2.5rem; | ||
| z-index: 999999999; | ||
| } | ||
|
|
||
| .skip-link:focus { | ||
| display: block; | ||
| left: 6px; | ||
| top: 7px; | ||
| font-size: 14px; | ||
| font-weight: 600; | ||
| line-height: normal; | ||
| padding: 15px 23px 14px; | ||
| z-index: 100000; | ||
| right: auto; | ||
| background-color: #fff; | ||
| border-radius: 3px; | ||
| box-shadow: 0 0 2px 2px rgba(0, 0, 0, 0.6); | ||
| clip: auto; | ||
| clip-path: none; | ||
| color: #0075c2; | ||
| height: auto; | ||
| width: auto; | ||
| } | ||
|
|
||
| .hidden { | ||
| display: none; | ||
| } | ||
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.