summaryrefslogtreecommitdiffstats
path: root/tools/droiddoc
diff options
context:
space:
mode:
authorsmain@google.com <smain@google.com>2014-11-14 11:53:07 -0800
committersmain@google.com <smain@google.com>2014-11-14 11:53:07 -0800
commit6bdcb981ce098cae2fb9e690485ebaab47b2225a (patch)
tree1b9ec688d6ead7b45af3148bc7dd869ecfdd662e /tools/droiddoc
parent87e469ea87a7a3b3142f1d2efd89d602a3ede529 (diff)
downloadbuild-6bdcb981ce098cae2fb9e690485ebaab47b2225a.zip
build-6bdcb981ce098cae2fb9e690485ebaab47b2225a.tar.gz
build-6bdcb981ce098cae2fb9e690485ebaab47b2225a.tar.bz2
followup to recent cookie max-age change to remove parameter and use 2-year for all cookies
bug: 17781603 Change-Id: Id0da9d41e01c6a45672d1362fc1c5aa39e558904
Diffstat (limited to 'tools/droiddoc')
-rw-r--r--tools/droiddoc/templates-sdk/assets/js/docs.js25
1 files changed, 7 insertions, 18 deletions
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js
index 8daef7f..08a0222 100644
--- a/tools/droiddoc/templates-sdk/assets/js/docs.js
+++ b/tools/droiddoc/templates-sdk/assets/js/docs.js
@@ -658,7 +658,7 @@ function toggleFullscreen(enable) {
setTimeout(updateSidenavFixedWidth,delay); // need to wait a moment for css to switch
enabled = false;
}
- writeCookie("fullscreen", enabled, null, null);
+ writeCookie("fullscreen", enabled, null);
setNavBarLeftPos();
resizeNav(delay);
updateSideNavPosition();
@@ -819,7 +819,7 @@ function reInitScrollbars() {
function saveNavPanels() {
var basePath = getBaseUri(location.pathname);
var section = basePath.substring(1,basePath.indexOf("/",1));
- writeCookie("height", resizePackagesNav.css("height"), section, null);
+ writeCookie("height", resizePackagesNav.css("height"), section);
}
@@ -900,12 +900,10 @@ function readCookie(cookie) {
return 0;
}
-function writeCookie(cookie, val, section, age) {
+function writeCookie(cookie, val, section) {
if (val==undefined) return;
section = section == null ? "_" : "_"+section+"_";
- if (age == null) {
- var age = 2*365*24*60*60; // set max-age to 2 years
- }
+ var age = 2*365*24*60*60; // set max-age to 2 years
var cookieValue = cookie_namespace + section + cookie + "=" + val
+ "; max-age=" + age +"; path=/";
document.cookie = cookieValue;
@@ -1147,9 +1145,7 @@ function swapNav() {
nav_pref = NAV_PREF_TREE;
init_default_navtree(toRoot);
}
- var date = new Date();
- date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
- writeCookie("nav", nav_pref, "reference", date.toGMTString());
+ writeCookie("nav", nav_pref, "reference");
$("#nav-panels").toggle();
$("#panel-link").toggle();
@@ -1217,11 +1213,7 @@ function changeNavLang(lang) {
}
function changeLangPref(lang, submit) {
- var date = new Date();
- expires = date.toGMTString(date.setTime(date.getTime()+(10*365*24*60*60*1000)));
- // keep this for 50 years
- //alert("expires: " + expires)
- writeCookie("pref_lang", lang, null, expires);
+ writeCookie("pref_lang", lang, null);
// ####### TODO: Remove this condition once we're stable on devsite #######
// This condition is only needed if we still need to support legacy GAE server
@@ -2730,10 +2722,7 @@ function changeApiLevel() {
selectedLevel = parseInt($("#apiLevelSelector option:selected").val());
toggleVisisbleApis(selectedLevel, "body");
- var date = new Date();
- date.setTime(date.getTime()+(10*365*24*60*60*1000)); // keep this for 10 years
- var expiration = date.toGMTString();
- writeCookie(API_LEVEL_COOKIE, selectedLevel, null, expiration);
+ writeCookie(API_LEVEL_COOKIE, selectedLevel, null);
if (selectedLevel < minLevel) {
var thing = ($("#jd-header").html().indexOf("package") != -1) ? "package" : "class";