Wyborcza Tweaks

Zastępuje wideo przyciskiem "kliknij aby obejrzeć film", przywraca kolor górnego paska na biały.

  1. // ==UserScript==
  2. // @name Wyborcza Tweaks
  3. // @description Zastępuje wideo przyciskiem "kliknij aby obejrzeć film", przywraca kolor górnego paska na biały.
  4. // @namespace wyborczapl.usability
  5. // @license MIT
  6. // @copyright claperius https://github.com/claperius
  7. // @version 3
  8. // @include http://wyborcza.pl
  9. // @include https://wyborcza.pl
  10. // @include http://wyborcza.pl/*
  11. // @include https://wyborcza.pl/*
  12. // @include http://*.wyborcza.pl/*
  13. // @include https://*.wyborcza.pl/*
  14. // @include http://wyborcza.biz/*
  15. // @include https://wyborcza.biz/*
  16. // @include http://*.wysokieobcasy.pl/*
  17. // @include http://wysokieobcasy.pl/*
  18. // @include https://*.wysokieobcasy.pl/*
  19. // @include https://wysokieobcasy.pl/*
  20. // @grant none
  21. // ==/UserScript==
  22.  
  23.  
  24.  
  25. function removeVideos() {
  26. var placeholder = document.createElement('div');
  27. placeholder.textContent = "Kliknij aby obejrzeć film";
  28. placeholder.style.setProperty("padding", "50px");
  29. placeholder.style.setProperty("margin", "auto");
  30. placeholder.style.setProperty("width", "100%");
  31. placeholder.style.setProperty("text-align", "center");
  32. placeholder.style.setProperty("border", "solid 1px #C0C0C0");
  33. placeholder.style.setProperty("background", "#F8F8F8");
  34. placeholder.style.setProperty("cursor", "pointer");
  35.  
  36. var docs = document.getElementsByClassName('wyborcza-player');
  37.  
  38. function onPlaceholderClick(e) {
  39. var num = e.currentTarget.getAttribute("number");
  40. docs[num].style.setProperty('display', 'block');
  41. e.currentTarget.remove();
  42. }
  43.  
  44. for(var i=0; i< docs.length; i++) {
  45. var doc = docs[i];
  46. placeholder.setAttribute("number", i);
  47. placeholder.addEventListener('click', onPlaceholderClick);
  48. doc.after(placeholder);
  49. doc.style.setProperty('display', 'none');
  50. }
  51. }
  52.  
  53. function bringColorsBack() {
  54. var wh = document.getElementById('wH_container');
  55. var ht = document.getElementById("wyborczaHat");
  56.  
  57. ht.style.setProperty("color", "black");
  58. ht.style.setProperty("background-color", "white");
  59.  
  60. wh.style.setProperty("color", "black");
  61. wh.style.setProperty("background-color", "white");
  62. }
  63.  
  64. function changeColorsWithTimeout() {
  65. for (var timeout=1000; timeout <= 3000; timeout += 1000) {
  66. window.setTimeout(bringColorsBack, timeout);
  67. }
  68. }
  69.  
  70. changeColorsWithTimeout();
  71. removeVideos();
  72.