X-Git-Url: https://git.mdrn.pl/edumed.git/blobdiff_plain/a556e8b9f74e52a0b5c7c6aa3ac32ae4becfaac3..02e15cdfe6d55f265169350c2418609090a93447:/edumed/static/js/annoy.js diff --git a/edumed/static/js/annoy.js b/edumed/static/js/annoy.js new file mode 100755 index 0000000..78c34e4 --- /dev/null +++ b/edumed/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);