A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
Vous ne pouvez pas sélectionner plus de 25 sujets Les noms de sujets doivent commencer par une lettre ou un nombre, peuvent contenir des tirets ('-') et peuvent comporter jusqu'à 35 caractères.
 
 
 
 
 

47 lignes
1.3 KiB

  1. // Partially based on http://www.quirksmode.org/js/cookies.html
  2. function get_cookie(name) {
  3. var nameEQ = name + "=";
  4. var ca = document.cookie.split(";");
  5. for (var i = 0; i < ca.length; i++) {
  6. var c = ca[i];
  7. while (c.charAt(0) == " ") {
  8. c = c.substring(1, c.length);
  9. }
  10. if (c.indexOf(nameEQ) == 0) {
  11. var value = window.atob(c.substring(nameEQ.length, c.length));
  12. if (value.indexOf("--ets1") == 0) {
  13. return value.substring("--ets1".length, value.length);
  14. }
  15. }
  16. }
  17. return null;
  18. }
  19. function set_cookie_with_date(name, value, date) {
  20. value = window.btoa("--ets1" + value);
  21. var path = window.location.pathname.split("/", 2)[1];
  22. if (date) {
  23. var expires = "; expires=" + date.toUTCString();
  24. }
  25. else {
  26. var expires = "";
  27. }
  28. document.cookie = name + "=" + value + expires + "; path=/" + path;
  29. }
  30. function set_cookie(name, value, days) {
  31. if (days) {
  32. var date = new Date();
  33. date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
  34. set_cookie_with_date(name, value, date);
  35. }
  36. else {
  37. set_cookie_with_date(name, value);
  38. }
  39. }
  40. function delete_cookie(name) {
  41. set_cookie(name, "", -1);
  42. }