Skip to content

Commit

Permalink
Merge pull request #928 from dvoytenko/experiments3
Browse files Browse the repository at this point in the history
Set cookie for the root path and update description
  • Loading branch information
dvoytenko committed Nov 13, 2015
2 parents 3663e4c + 73c5b6f commit 0d7bc48
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 5 deletions.
1 change: 1 addition & 0 deletions src/cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -58,5 +58,6 @@ export function getCookie(win, name) {
export function setCookie(win, name, value, expirationTime) {
win.document.cookie = encodeURIComponent(name) + '=' +
encodeURIComponent(value) +
'; path=/' +
'; expires=' + new Date(expirationTime).toUTCString();
}
2 changes: 1 addition & 1 deletion test/functional/test-cookies.js
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,6 @@ describe('getCookie', () => {
const doc = {};
setCookie({document: doc}, 'c&1', 'v&1', 1447383159853);
expect(doc.cookie).to.equal(
'c%261=v%261; expires=Fri, 13 Nov 2015 02:52:39 GMT');
'c%261=v%261; path=/; expires=Fri, 13 Nov 2015 02:52:39 GMT');
});
});
12 changes: 9 additions & 3 deletions tools/experiments/experiments.html
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,10 @@
color: orange;
}

.desc a {
color: #cc7a00;
}

a {
color: #3ab3eb;
text-decoration: none;
Expand Down Expand Up @@ -102,9 +106,11 @@ <h1>AMP Experiments</h1>
</section>

<section class="desc">
Please excercise caution. These features are not yet release to the public.
Some of these features might still be in the security or privacy reviews.
Please consult the documentation for each specific feature for details.
Please exercise caution. These experiments are not fully tested and might
contain bugs or have unexpected side effects. Please only activate them if
you work on the
<a href="https://github.com/ampproject/amphtml/">AMP project</a>
or plan to create AMP documents that use unreleased features.
</section>

<section class="content">
Expand Down
2 changes: 1 addition & 1 deletion tools/experiments/experiments.js
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@ function buildExperimentRow(experiment) {
tr.appendChild(tdId);

const tdName = document.createElement('td');
tdName.appendChild(buildLinkMaybe(experiment.name, experiment.spec));
tdName.textContent = experiment.name;
tr.appendChild(tdName);

const tdOn = document.createElement('td');
Expand Down

0 comments on commit 0d7bc48

Please sign in to comment.