-
Notifications
You must be signed in to change notification settings - Fork 4.1k
Document amp-access as a special target #9568
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
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
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ This is the name of the event that an element exposes. | |
|
|
||
| **targetId** | ||
| __required__ | ||
| This is the DOM id for the element you'd like to execute an action on in response to the event. In the following example, the `targetId` is the DOM id of the `amp-lightbox` target, `photo-slides`. | ||
| This is the DOM id for the element, or a predefined [special target](#special-targets) you'd like to execute an action on in response to the event. In the following example, the `targetId` is the DOM id of the `amp-lightbox` target, `photo-slides`. | ||
|
|
||
| ```html | ||
| <amp-lightbox id="photo-slides"></amp-lightbox> | ||
|
|
@@ -93,7 +93,6 @@ For example, the following is possible in AMP. | |
| </tr> | ||
| </table> | ||
|
|
||
|
|
||
| ### Input Elements (any that fires `change` and `input` event) | ||
|
|
||
| Including: `input[type=radio]`, `input[type=checkbox]`, `input[type=range]`, and `select`. | ||
|
|
@@ -144,7 +143,6 @@ Including: `input[type=radio]`, `input[type=checkbox]`, `input[type=range]`, and | |
| </tr> | ||
| </table> | ||
|
|
||
|
|
||
| ### amp-carousel[type="slides"] | ||
| <table> | ||
| <tr> | ||
|
|
@@ -353,9 +351,13 @@ Including: `input[type=radio]`, `input[type=checkbox]`, `input[type=range]`, and | |
| </tr> | ||
| </table> | ||
|
|
||
| ## `AMP` target | ||
| ## Special targets | ||
|
|
||
| The following are targets provided by the AMP system that have special requirements: | ||
|
|
||
| ### `AMP` | ||
|
|
||
| `AMP` target is a special target. It's provided by the AMP runtime and implements top-level | ||
| The `AMP` target is provided by the AMP runtime and implements top-level | ||
| actions that apply to the whole document. | ||
|
|
||
| <table> | ||
|
|
@@ -372,3 +374,13 @@ actions that apply to the whole document. | |
| <td>Updates <code>amp-bind</code>'s state. See <a href="../extensions/amp-bind/amp-bind.md#ampsetstate">details</a>.</td> | ||
| </tr> | ||
| </table> | ||
|
|
||
| ### `amp-access` | ||
|
|
||
| The `amp-access` target is provided by the [AMP Access extension](../extensions/amp-access/amp-access.md). | ||
|
|
||
| It's special because | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Would like @dvoytenko to confirm technical accuracy.
Contributor
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @zhangsu @bpaduch Thanks! Looks good. |
||
| 1. You can't give an arbitrary ID to this target. The target is always `amp-access`. | ||
| 2. The actions for `amp-access` are dynamic depending on the structure of the [AMP Access Configruation](../extensions/amp-access/amp-access.md#configuration). | ||
|
|
||
| See [details](../extensions/amp-access/amp-access.md#login-link) about using the `amp-access` target. | ||
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.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you add 1-2 sentences explaining what defines a target as "special"?
For example:
The following are targets provided by the AMP system that have special requirements:
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't see these changes committed. Did you push them?
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just amended my existing commit and did a force push because the new changes can still be considered in-scope of the existing commit. I can see the changes here.
I have the habit of not polluting the commit history with intermediate commits (that are addressing code review comments, for example) as I remember some people are pretty keen about this. Now, I haven't used Github for a while and maybe that's not recommended anymore (maybe it disrupts code reviews somehow)?