summaryrefslogtreecommitdiffstats
path: root/js/globe.js
diff options
context:
space:
mode:
authorSnap <snapwilliam@gmail.com>2015-05-01 16:25:28 -0700
committerSnap <snapwilliam@gmail.com>2015-05-01 16:25:28 -0700
commite6b60448bc08df316daf220db8ecfddc58aefe84 (patch)
tree8ec936e42a24a68cb775eb75688eabe2f71c5a18 /js/globe.js
parent6001d7ef9b8b26fe388ea5965139d84bdd63ca22 (diff)
downloadpathery-e6b60448bc08df316daf220db8ecfddc58aefe84.tar.xz
Minor fixes and adjustments.
Moved Javascript in chat to: js/chat.js re-ordered script loading so Jquery loads first. Fixed cookie login issue.
Diffstat (limited to 'js/globe.js')
-rw-r--r--js/globe.js30
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()
{