diff options
author | BlueRaja <BlueRaja.admin@gmail.com> | 2015-05-07 23:14:47 -0500 |
---|---|---|
committer | BlueRaja <BlueRaja.admin@gmail.com> | 2015-05-07 23:14:47 -0500 |
commit | 3dc3919ce1b5336861979cde56884842615c967b (patch) | |
tree | f0a2418290cecd15f20c834bb071ffa9f3694b09 /js/globe.js | |
parent | 29e872fbc6c552ef02208fe9fa5416b69773aa38 (diff) | |
parent | c517b645c8723b5f4d20cbb91cbc4b9f45579cbb (diff) | |
download | pathery-3dc3919ce1b5336861979cde56884842615c967b.tar.xz |
Merge branch 'master' of git.raylu.net:pathery
Diffstat (limited to 'js/globe.js')
-rw-r--r-- | js/globe.js | 30 |
1 files changed, 30 insertions, 0 deletions
diff --git a/js/globe.js b/js/globe.js index 1dc61a0..0893f20 100644 --- a/js/globe.js +++ b/js/globe.js @@ -9,6 +9,36 @@ function hideSignin() { }
}
+
+function savePref(pref, value) {
+ setCookie('pref_'+pref, value, 9999);
+}
+
+//Cookie functions from w3schools.com
+function setCookie(c_name,value,exdays)
+{
+ var exdate=new Date();
+ exdate.setDate(exdate.getDate() + exdays);
+ var c_value=escape(value) + ((exdays==null) ? "" : "; expires="+exdate.toUTCString());
+ document.cookie=c_name + "=" + c_value;
+}
+function getCookie(c_name)
+{
+ var i,x,y,ARRcookies=document.cookie.split(";");
+ for (i=0;i<ARRcookies.length;i++)
+ {
+ x=ARRcookies[i].substr(0,ARRcookies[i].indexOf("="));
+ y=ARRcookies[i].substr(ARRcookies[i].indexOf("=")+1);
+ x=x.replace(/^\s+|\s+$/g,"");
+ if (x==c_name)
+ {
+ return unescape(y);
+ }
+ }
+ return "";
+}
+
+
//Make unselectable elements unselectable (hack for IE 9.0 and below, which doesn't support our CSS)
$(document).ready(function()
{
|