Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 17 additions & 5 deletions spec/amp-actions-and-events.md
Original file line number Diff line number Diff line change
Expand Up @@ -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>
Expand Down Expand Up @@ -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`.
Expand Down Expand Up @@ -144,7 +143,6 @@ Including: `input[type=radio]`, `input[type=checkbox]`, `input[type=range]`, and
</tr>
</table>


### amp-carousel[type="slides"]
<table>
<tr>
Expand Down Expand Up @@ -353,9 +351,13 @@ Including: `input[type=radio]`, `input[type=checkbox]`, `input[type=range]`, and
</tr>
</table>

## `AMP` target
## Special targets
Copy link
Copy Markdown

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:

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

Done.

Copy link
Copy Markdown

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?

Copy link
Copy Markdown
Member Author

@zhangsu zhangsu May 29, 2017

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)?


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>
Expand All @@ -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
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Would like @dvoytenko to confirm technical accuracy.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The 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.