forked from prateekbh/amphtml
-
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.
✨ [Story bookend] Created amp-story-social-share (ampproject#33077)
* Created social-share * Remove empty social share extension * Fixed validation * Updated validation * Updated validation rule to pass test * Remove comment * Updated tests * Added tests
- Loading branch information
1 parent
e36bcd1
commit d94427b
Showing
9 changed files
with
279 additions
and
18 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,52 @@ | ||
<!doctype html> | ||
<html amp lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<script async src="https://cdn.ampproject.org/v0.js"></script> | ||
<script async custom-element="amp-story" | ||
src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script> | ||
<title>My Story</title> | ||
<meta name="viewport" | ||
content="width=device-width,minimum-scale=1,initial-scale=1"> | ||
<link rel="canonical" href="bookend.html"> | ||
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> | ||
<style amp-custom> | ||
body { | ||
font-family: 'Roboto', sans-serif; | ||
} | ||
amp-story-page { | ||
background-color: white; | ||
} | ||
</style> | ||
</head> | ||
|
||
<body> | ||
<amp-story | ||
title="Bookend amp-story example" | ||
publisher="The AMP Team" | ||
publisher-logo-src="https://example.com/logo/1x1.png" | ||
poster-portrait-src="https://example.com/my-story/poster/3x4.jpg" | ||
poster-square-src="https://example.com/my-story/poster/1x1.jpg" | ||
poster-landscape-src="https://example.com/my-story/poster/4x3.jpg" | ||
standalone> | ||
|
||
<amp-story-page id="cover"> | ||
<amp-story-grid-layer template="vertical"> | ||
<h1>Check the share providers</h1> | ||
<h2>Should show Facebook and Whatsapp</h2> | ||
</amp-story-grid-layer> | ||
</amp-story-page> | ||
|
||
<amp-story-social-share layout="nodisplay"> | ||
<script type="application/json"> | ||
{ | ||
"shareProviders": [ | ||
"facebook", | ||
"whatsapp" | ||
] | ||
} | ||
</script> | ||
</amp-story-social-share> | ||
</amp-story> | ||
</body> | ||
</html> |
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
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
45 changes: 45 additions & 0 deletions
45
extensions/amp-story/1.0/test/validator-amp-story-social-share.html
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
<!doctype html> | ||
<html amp lang="en"> | ||
<head> | ||
<meta charset="utf-8"> | ||
<script async src="https://cdn.ampproject.org/v0.js"></script> | ||
<script async custom-element="amp-story" | ||
src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script> | ||
<title>My Story</title> | ||
<meta name="viewport" | ||
content="width=device-width,minimum-scale=1,initial-scale=1"> | ||
<link rel="canonical" href="bookend.html"> | ||
<style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> | ||
<style amp-custom> | ||
body { | ||
font-family: 'Roboto', sans-serif; | ||
} | ||
amp-story-page { | ||
background-color: white; | ||
} | ||
</style> | ||
</head> | ||
<body> | ||
<amp-story standalone title="My Story" | ||
publisher="The AMP Team" | ||
publisher-logo-src="https://example.com/logo/1x1.png" | ||
poster-portrait-src="https://example.com/my-story/poster/3x4.jpg"> | ||
<amp-story-page id="cover"> | ||
<amp-story-grid-layer template="vertical"> | ||
<h1>Validation test for social-share providers</h1> | ||
</amp-story-grid-layer> | ||
</amp-story-page> | ||
<!-- Valid social share tag --> | ||
<amp-story-social-share layout="nodisplay"> | ||
<script type="application/json"> | ||
{ | ||
"shareProviders": [ | ||
"facebook", | ||
"whatsapp" | ||
] | ||
} | ||
</script> | ||
</amp-story-social-share> | ||
</amp-story> | ||
</body> | ||
</html> |
46 changes: 46 additions & 0 deletions
46
extensions/amp-story/1.0/test/validator-amp-story-social-share.out
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
PASS | ||
| <!doctype html> | ||
| <html amp lang="en"> | ||
| <head> | ||
| <meta charset="utf-8"> | ||
| <script async src="https://cdn.ampproject.org/v0.js"></script> | ||
| <script async custom-element="amp-story" | ||
| src="https://cdn.ampproject.org/v0/amp-story-1.0.js"></script> | ||
| <title>My Story</title> | ||
| <meta name="viewport" | ||
| content="width=device-width,minimum-scale=1,initial-scale=1"> | ||
| <link rel="canonical" href="bookend.html"> | ||
| <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> | ||
| <style amp-custom> | ||
| body { | ||
| font-family: 'Roboto', sans-serif; | ||
| } | ||
| amp-story-page { | ||
| background-color: white; | ||
| } | ||
| </style> | ||
| </head> | ||
| <body> | ||
| <amp-story standalone title="My Story" | ||
| publisher="The AMP Team" | ||
| publisher-logo-src="https://example.com/logo/1x1.png" | ||
| poster-portrait-src="https://example.com/my-story/poster/3x4.jpg"> | ||
| <amp-story-page id="cover"> | ||
| <amp-story-grid-layer template="vertical"> | ||
| <h1>Validation test for social-share providers</h1> | ||
| </amp-story-grid-layer> | ||
| </amp-story-page> | ||
| <!-- Valid social share tag --> | ||
| <amp-story-social-share layout="nodisplay"> | ||
| <script type="application/json"> | ||
| { | ||
| "shareProviders": [ | ||
| "facebook", | ||
| "whatsapp" | ||
| ] | ||
| } | ||
| </script> | ||
| </amp-story-social-share> | ||
| </amp-story> | ||
| </body> | ||
| </html> |
Oops, something went wrong.