isec style fix

fixing isec.pt styling issues

  1. // ==UserScript==
  2. // @name isec style fix
  3. // @namespace https://greasyfork.org/en/scripts/17110-isec-style-fix
  4. // @version 20160821
  5. // @description fixing isec.pt styling issues
  6. // @author Ivo Barros
  7. // @twitter @L3v3L
  8. // @homepage http://ibarros.com/
  9. // @match http*://www.isec.pt/*
  10. // @grant none
  11. // ==/UserScript==
  12. /* jshint -W097 */
  13. 'use strict';
  14.  
  15. //replaces an image url with another url
  16. function replaceImages(oldUrl, newUrl) {
  17. var imgs = document.getElementsByTagName('img');
  18. for (i = 0; i<imgs.length; i++) {
  19. imgs[i].src = imgs[i].src.replace(oldUrl, newUrl);
  20. }
  21. }
  22.  
  23. var dropDownMenu = document.querySelectorAll('.dropdown-menu'), i;
  24. for (i = 0; i < dropDownMenu.length; ++i) {
  25. dropDownMenu[i].style.margin = "0px";
  26. }
  27.  
  28. replaceImages('http://www.isec.pt/custom/img/about/presidente/Foto_JorBar_siteISEC.jpg', 'https://pp.vk.me/c10868/v10868007/163/UddpNN7poTg.jpg');