change, save & restore preferences
svn: r10072 original commit: e48b97a61cee744a309ffc08b0c530ec00ea2961
This commit is contained in:
parent
c51b4cf52e
commit
98d99e6e2d
|
@ -1,6 +1,6 @@
|
||||||
// Common functionality for PLT documentation pages
|
// Common functionality for PLT documentation pages
|
||||||
|
|
||||||
function GetCookie(key) {
|
function GetCookie(key, def) {
|
||||||
if (document.cookie.length <= 0) return null;
|
if (document.cookie.length <= 0) return null;
|
||||||
var cookiestrs = document.cookie.split(/; */);
|
var cookiestrs = document.cookie.split(/; */);
|
||||||
for (var i in cookiestrs) {
|
for (var i in cookiestrs) {
|
||||||
|
@ -9,7 +9,7 @@ function GetCookie(key) {
|
||||||
if (eql >= 0 && cur.substring(0,eql) == key)
|
if (eql >= 0 && cur.substring(0,eql) == key)
|
||||||
return unescape(cur.substring(eql+1));
|
return unescape(cur.substring(eql+1));
|
||||||
}
|
}
|
||||||
return null;
|
return def;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetCookie(key, val) {
|
function SetCookie(key, val) {
|
||||||
|
@ -28,7 +28,7 @@ function SetPLTRoot(ver, relative) {
|
||||||
|
|
||||||
// adding index.html works because of the above
|
// adding index.html works because of the above
|
||||||
function GotoPLTRoot(ver, relative) {
|
function GotoPLTRoot(ver, relative) {
|
||||||
var u = GetCookie("PLT_Root."+ver);
|
var u = GetCookie("PLT_Root."+ver, null);
|
||||||
if (u == null) return true; // no cookie: use plain up link
|
if (u == null) return true; // no cookie: use plain up link
|
||||||
// the relative path is optional, default goes to the toplevel start page
|
// the relative path is optional, default goes to the toplevel start page
|
||||||
if (!relative) relative = "index.html";
|
if (!relative) relative = "index.html";
|
||||||
|
@ -47,7 +47,7 @@ function NormalizePath(path) {
|
||||||
function DoSearchKey(event, field, ver) {
|
function DoSearchKey(event, field, ver) {
|
||||||
var val = field.value;
|
var val = field.value;
|
||||||
if (event && event.keyCode == 13 && val.indexOf("...search...") < 0) {
|
if (event && event.keyCode == 13 && val.indexOf("...search...") < 0) {
|
||||||
var u = GetCookie("PLT_Root."+ver);
|
var u = GetCookie("PLT_Root."+ver, null);
|
||||||
if (u == null) u = "../"; // default: go up
|
if (u == null) u = "../"; // default: go up
|
||||||
location = u + "search/index.html" + "?q=" + escape(val);
|
location = u + "search/index.html" + "?q=" + escape(val);
|
||||||
return false;
|
return false;
|
||||||
|
|
Loading…
Reference in New Issue
Block a user