diff options
Diffstat (limited to 'tools/droiddoc/templates-sdk/assets/js/docs.js')
-rw-r--r-- | tools/droiddoc/templates-sdk/assets/js/docs.js | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/tools/droiddoc/templates-sdk/assets/js/docs.js b/tools/droiddoc/templates-sdk/assets/js/docs.js index a556f4f..8daef7f 100644 --- a/tools/droiddoc/templates-sdk/assets/js/docs.js +++ b/tools/droiddoc/templates-sdk/assets/js/docs.js @@ -900,16 +900,14 @@ function readCookie(cookie) { return 0; } -function writeCookie(cookie, val, section, expiration) { +function writeCookie(cookie, val, section, age) { if (val==undefined) return; section = section == null ? "_" : "_"+section+"_"; - if (expiration == null) { - var date = new Date(); - date.setTime(date.getTime()+(10*365*24*60*60*1000)); // default expiration is one week - expiration = date.toGMTString(); + if (age == null) { + var age = 2*365*24*60*60; // set max-age to 2 years } var cookieValue = cookie_namespace + section + cookie + "=" + val - + "; expires=" + expiration+"; path=/"; + + "; max-age=" + age +"; path=/"; document.cookie = cookieValue; } @@ -1988,7 +1986,7 @@ function search_changed(e, kd, toroot) // Search for matching JD docs - if (text.length >= 3) { + if (text.length >= 2) { // Regex to match only the beginning of a word var textRegex = new RegExp("\\b" + text.toLowerCase(), "g"); |