A copyright violation detector running on Wikimedia Cloud Services https://tools.wmflabs.org/copyvios/
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 

52 lines
1.5 KiB

  1. // Thanks to http://www.quirksmode.org/js/cookies.html for the cookie code.
  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. return c.substring(nameEQ.length, c.length);
  12. }
  13. }
  14. return null;
  15. }
  16. function set_cookie(name, value, days) {
  17. value = window.btoa(value);
  18. var path = window.location.pathname.split("/", 2)[1];
  19. if (days) {
  20. var date = new Date();
  21. date.setTime(date.getTime() + (days * 24 * 60 * 60 * 1000));
  22. var expires = "; expires=" + date.toGMTString();
  23. }
  24. else {
  25. var expires = "";
  26. }
  27. document.cookie = name + "=" + value + expires + "; path=/" + path;
  28. }
  29. function delete_cookie(name) {
  30. set_cookie(name, "", -1);
  31. }
  32. function copyvio_toggle_details(details) {
  33. link = document.getElementById("cv-result-detail-link");
  34. details = document.getElementById("cv-result-detail");
  35. if (link.innerHTML == "Show details:") {
  36. details.style.display = "block";
  37. link.innerHTML = "Hide details:";
  38. set_cookie("EarwigCVShowDetails", "True", 365);
  39. } else {
  40. details.style.display = "none";
  41. link.innerHTML = "Show details:";
  42. if (get_cookie("EarwigCVShowDetails")) {
  43. delete_cookie("EarwigCVShowDetails");
  44. }
  45. }
  46. }