Skip to content

swipe api#8357

Merged
chenshay merged 12 commits intoampproject:masterfrom
chenshay:doc
Mar 24, 2017
Merged

swipe api#8357
chenshay merged 12 commits intoampproject:masterfrom
chenshay:doc

Conversation

@chenshay
Copy link
Copy Markdown
Contributor

swipe api



/**
* @typedef {
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.

@typedef {{. One { for type and the second { to declare a struct :)

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

/**
* @typedef {
* type: string,
* touches: Array.<TouchData>,
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.

No periods in arrays.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

* @typedef {
* type: string,
* touches: Array.<TouchData>,
* changedTouches: Array.<TouchData>,
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.

touches and changedTouches are !Array<...>|undefined, right?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

* SwipeAPI is an interface the Viewer Swipe Protocol.
* @interface
*/
class SwipeAPI {
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.

Api

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

/**
* Notify viewer that swipe touch has started.
* @param {!EventData} e
* @param {boolean} rsvp always set to false
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.

No need to pass rsvp. It's implied here since the method doesn't have any @return.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

class SwipeAPI {
/**
* Notify viewer that swipe touch has started.
* @param {!EventData} e
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.

Since this is API, let's call it event.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

let EventData;

/**
* SwipeApi is an interface the Viewer Swipe Protocol.
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.

Document how to enable this protocol. I.e. #cap=swipe.


/**
* Update scroll lock state on viewer's request. When set to 'true',
* preventDefault will prevent vertical swiping. When set to 'false',
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.

Let's rewrite more conceptually: "when true - the scrolling will be locked in the document". B/c preventDefault or touch-action are implementation details which we shouldn't make promises for protocol.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

done

@chenshay chenshay merged commit efd4b06 into ampproject:master Mar 24, 2017
@chenshay chenshay deleted the doc branch March 24, 2017 21:12
lironzluf pushed a commit to lironzluf/amphtml that referenced this pull request Mar 28, 2017
* master: (34 commits)
  Prevent amp-carousel next/previous icons fade away on desktop (ampproject#8428)
  Turn on flag slidescroll-disable-css-snap” (ampproject#8436)
  Revert "temporarily turn off yarn (ampproject#8356)" (ampproject#8384)
  initial commit (ampproject#8404)
  Upgrades for Index Exchange amp-ad tags to report load statistics (ampproject#8054)
  amp-bind validation tweak (ampproject#8414)
  Fix an amp-instagram race condition (ampproject#8192)
  Use whitelist to restrict urlReplacement for scoped analytics element (ampproject#8360)
  Report active experiments in error logs (ampproject#8108)
  amp-bind: Catch exceptions in mutatedAttributesCallback (ampproject#8383)
  Fixing custom scroll-snap on IOS (ampproject#8391)
  Add experiment for using AmpContext class in integration.js (ampproject#8348)
  add (ampproject#8349)
  swipe api (ampproject#8357)
  skip 3 flaky tests (ampproject#8388)
  amp-bind: Expression complexity limit (ampproject#8321)
  add margin-bottom (ampproject#8350)
  Flying carpet: make container full viewport and center content (ampproject#8292)
  Service Registration: Document Click (ampproject#7882)
  Add a8ad (ampproject#8036)
  ...
mrjoro pushed a commit to mrjoro/amphtml that referenced this pull request Apr 28, 2017
* swipe api

* fix

* lint

* lint fix

* fix

* fix

* fix

* fix

* revert

* remove linter

* comment update

* updated documentation
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants