X-Git-Url: https://git.mdrn.pl/prawokultury.git/blobdiff_plain/fceff8de9a4a304549e5b4b3094f66071b9912ae..67d93435e2d22c6e5a4b3e89037e3adefbcc3084:/prawokultury/static/js/annoy.js diff --git a/prawokultury/static/js/annoy.js b/prawokultury/static/js/annoy.js new file mode 100755 index 0000000..78c34e4 --- /dev/null +++ b/prawokultury/static/js/annoy.js @@ -0,0 +1,40 @@ +(function($) { + $(function() { + + +var have_localstorage; +try { + localStorage.setItem("test", "test"); + localStorage.removeItem("test"); + have_localstorage = true; +} catch(e) { + have_localstorage = false; +} + + + +$("#annoy-on").click(function(e) { + e.preventDefault(); + $("#annoy").slideDown('fast'); + $(this).hide(); + if (have_localstorage) localStorage.removeItem("annoyed2013"); +}); + +$("#annoy-off").click(function() { + $("#annoy").slideUp('fast'); + $("#annoy-on").show(); + if (have_localstorage) localStorage["annoyed2013"] = true; +}); + + +if (have_localstorage) { + if (!localStorage["annoyed2013"]) { + $("#annoy-on").hide(); + $("#annoy").show(); + } +} + + + + }); +})(jQuery);