Skip to content

Instantly share code, notes, and snippets.

@michaelefisher
Created May 4, 2015 21:51
Show Gist options
  • Save michaelefisher/ad380c6193777499d18f to your computer and use it in GitHub Desktop.
Save michaelefisher/ad380c6193777499d18f to your computer and use it in GitHub Desktop.
window.Krux || ((Krux = function() {
Krux.q.push(arguments);
}).q = []);
(function() {
function retrieve(n) {
var m, k = 'kx' + n;
if (window.localStorage) {
return window.localStorage[k] || "";
} else if (navigator.cookieEnabled) {
m = document.cookie.match(k + '=([^;]*)');
return (m && unescape(m[1])) || "";
} else {
return '';
}
}
Krux.user = retrieve('user');
Krux.segments = retrieve('segs') && retrieve('segs').split(',') || [];
})();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment