Adding Tab form support
This commit is contained in:
parent
7a83c6a00f
commit
1b5fbf8622
6 changed files with 987 additions and 0 deletions
58
www/extras/tabs/cookie.js
Normal file
58
www/extras/tabs/cookie.js
Normal file
|
|
@ -0,0 +1,58 @@
|
|||
/**
|
||||
* cookie.js
|
||||
* by Garrett Smith
|
||||
* Updated 11-29-2002
|
||||
*
|
||||
* getCookie function based upon:
|
||||
* Cookie API v1.0
|
||||
* http://www.dithered.com/javascript/cookies/index.html
|
||||
* maintained by Chris Nott (chris@NOSPAMdithered.com - remove NOSPAM)
|
||||
*/
|
||||
|
||||
// Write a cookie value based on the current directory.
|
||||
function setPageCookie(name, value) {
|
||||
document.cookie = name + "=" + escape(value) + "; path=" + getPath();
|
||||
}
|
||||
|
||||
// Retrieve a named cookie value
|
||||
function getCookie(name) {
|
||||
var dc = document.cookie;
|
||||
|
||||
// find beginning of cookie value in document.cookie
|
||||
var prefix = name + "=";
|
||||
var begin = dc.lastIndexOf(prefix);
|
||||
if (begin == -1) return null;
|
||||
|
||||
// find end of cookie value
|
||||
var end = dc.indexOf(";", begin);
|
||||
if (end == -1) end = dc.length;
|
||||
|
||||
// return cookie value
|
||||
return unescape(dc.substring(begin + prefix.length, end));
|
||||
}
|
||||
|
||||
function deletePageCookie(name, path) {
|
||||
var value = getCookie(name);
|
||||
if (value != null)
|
||||
document.cookie =
|
||||
name + "="
|
||||
+ "; path=" + getPath()
|
||||
+ "; expires=Thu, 01-Jan-70 00:00:01 GMT";
|
||||
return value;
|
||||
}
|
||||
|
||||
|
||||
function getFilename(){
|
||||
var href = window.location.href;
|
||||
var file = href.substring(href.lastIndexOf("/") +1);
|
||||
return file;
|
||||
}
|
||||
|
||||
function getPath(){
|
||||
var href = window.location.href;
|
||||
var path = href.substring(href.indexOf("//")+2);
|
||||
path = path.substring(path.indexOf("/"));
|
||||
path = path.substring(0, path.lastIndexOf("/")+1);
|
||||
|
||||
return path;
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue