mirror of
https://github.com/jimeh/dlist.git
synced 2026-02-19 07:56:41 +00:00
- other general fixes to things a bit all over the place git-svn-id: file:///Users/jimeh/Desktop/dlist/trunk@12 a5845835-ea0f-0410-a762-dd0bfe9bfde8
30 lines
812 B
JavaScript
30 lines
812 B
JavaScript
|
|
function set_view (view) {
|
|
if (view != readCookie('dList_simple_viewMode')) {
|
|
createCookie('dList_simple_viewMode', view, 365);
|
|
document.location.href = '';
|
|
}
|
|
}
|
|
|
|
/* Cookie Related Functions */
|
|
function createCookie(name,value,days) {
|
|
if (days) {
|
|
var date = new Date();
|
|
date.setTime(date.getTime()+(days*24*60*60*1000));
|
|
var expires = "; expires="+date.toGMTString();
|
|
} else var expires = "";
|
|
document.cookie = name+"="+value+expires+"; path=/";
|
|
}
|
|
function readCookie(name) {
|
|
var nameEQ = name + "=";
|
|
var ca = document.cookie.split(';');
|
|
for(var i=0;i < ca.length;i++) {
|
|
var c = ca[i];
|
|
while (c.charAt(0)==' ') c = c.substring(1,c.length);
|
|
if (c.indexOf(nameEQ) == 0) return c.substring(nameEQ.length,c.length);
|
|
}
|
|
return null;
|
|
}
|
|
function eraseCookie(name) {
|
|
createCookie(name,"",-1);
|
|
} |