vvFilter

Filtering...

  1. // ==UserScript==
  2. // @name vvFilter
  3. // @namespace https://ru.wikipedia.org/wiki/User:Neolexx
  4. // @version 0.1
  5. // @description Filtering...
  6. // @author Neolexx
  7. // @match https://ru.wikipedia.org/*
  8. // @grant none
  9. // @license Beerware
  10. // ==/UserScript==
  11.  
  12. var CategorySection = $('catlinks');
  13.  
  14. if (!!CategorySection) {
  15. var CategoryLinks = CategorySection.getElementsByTagName('a');
  16. var found = false;
  17. for (var i = 0; i < CategoryLinks.length; i++) {
  18. if ( /Художники СССР/.test(CategoryLinks[i].title) ) {
  19. found = true;
  20. break;
  21. }
  22. }
  23. if (found) {
  24. var thumbs = $('bodyContent').getElementsByTagName('img');
  25. for (var i = 0; i < thumbs.length; i++) {
  26. if (thumbs[i].width >= 150) {
  27. thumbs[i].style.WebkitFilter = 'blur(10px)';
  28. thumbs[i].addEventListener('click', new Function('evt','this.style.WebkitFilter = "none";'), false);
  29. }
  30. }
  31. }
  32. }
  33.  
  34. function $(id) {
  35. return document.getElementById(id);
  36. }