Skip to content

✨ amp-geo pre-release testing #14577

Merged
erwinmombay merged 6 commits intoampproject:masterfrom
jpettitt:ampgeo2
Apr 12, 2018
Merged

✨ amp-geo pre-release testing #14577
erwinmombay merged 6 commits intoampproject:masterfrom
jpettitt:ampgeo2

Conversation

@jpettitt
Copy link
Copy Markdown
Contributor

amp-geo WIP changes

  1. XSS sanitization fix to #amp-geo=XX
  2. Formatting for variable replacement
  3. Formatting for hotpatch geo variable

if (getMode(this.win).geoOverride &&
(isCanary(this.win) || getMode(this.win).localDev) &&
getMode(this.win).geoOverride.match(/\w+/)) {
getMode(this.win).geoOverride.match(/^\w+$/)) {
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

/^\w+$/.test(getMode(this.win).geoOverride) is faster (not capture created) and a bit more readable.

I'd consider adding this test at the end of the function and neutralizing this.country if it fails.

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.

this.country_ has a default value it picked up from the SCS hotpatch so I'm testing before I overwrite it. Will make the regex change.


body.amp-geo-group-anz {
transform: rotate(180deg);
transition: transform 0.5s 0.2s;
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

nit, remove leading 0s

@erwinmombay erwinmombay merged commit 8f6d46e into ampproject:master Apr 12, 2018
glevitzky pushed a commit that referenced this pull request Apr 27, 2018
* Fix sanitizer regex

* handlbars to indiclate templated hotpatch bar

* css fix  on example

* New test pattern per PR #14432

* fixes per pr comments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants