PostHider: moved to localstorage

This commit is contained in:
asiekierka 2012-12-24 13:16:12 +01:00
parent ba1a4fc182
commit 7839d53b3a
3 changed files with 4 additions and 77 deletions

View file

@ -2,11 +2,11 @@ function phGetCookieName(id) {
return "ph_hide_" + id;
}
function phPostHidden(id) {
return ($.cookie(phGetCookieName(id)) != null);
return (localStorage.getItem(phGetCookieName(id)) != null);
}
function phPostToggle(id) {
if(phPostHidden(id)) { $.cookie(phGetCookieName(id),null); }
else { $.cookie(phGetCookieName(id),"yes"); }
if(phPostHidden(id)) { localStorage.removeItem(phGetCookieName(id)); }
else { localStorage.setItem(phGetCookieName(id),"yes"); }
}
function phGetInnerText(id) {
if(phPostHidden(id)) { return "[+]"; }