user documentation root is now stored in a cookie
svn: r9978 original commit: 1e9e508ec02be10f9a45450bdd6cf8292bb43682
This commit is contained in:
parent
290490a455
commit
a45e38adfc
|
@ -19,15 +19,25 @@ function SetCookie(key, val) {
|
||||||
key + "=" + escape(val) + "; expires="+ d.toGMTString() + "; path=/";
|
key + "=" + escape(val) + "; expires="+ d.toGMTString() + "; path=/";
|
||||||
}
|
}
|
||||||
|
|
||||||
function GotoPLTRoot() {
|
function GotoPLTRoot(ver) {
|
||||||
var u = GetCookie("PLT_Root");
|
var u = GetCookie("PLT_Root."+ver);
|
||||||
if (u == null) return true; // no cookie: use plain up link
|
if (u == null) return true; // no cookie: use plain up link
|
||||||
location = u;
|
location = u;
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
function SetPLTRoot() {
|
function SetPLTRoot(ver, relative) {
|
||||||
SetCookie("PLT_Root", location);
|
var root = location.protocol + "//" + location.host
|
||||||
|
+ NormalizePath(location.pathname.replace(/[^\/]*$/, relative));
|
||||||
|
SetCookie("PLT_Root."+ver, root);
|
||||||
|
}
|
||||||
|
|
||||||
|
normalize_rxs = [/\/\/+/g, /\/\.(\/|$)/, /\/[^\/]*\/\.\.(\/|$)/];
|
||||||
|
function NormalizePath(path) {
|
||||||
|
var tmp, i;
|
||||||
|
for (i = 0; i < normalize_rxs.length; i++)
|
||||||
|
while ((tmp = path.replace(normalize_rxs[i], "/")) != path) path = tmp;
|
||||||
|
return path;
|
||||||
}
|
}
|
||||||
|
|
||||||
function DoSearchKey(event, field) {
|
function DoSearchKey(event, field) {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user