isec style fix

fixing isec.pt styling issues

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         isec style fix
// @namespace    https://greasyfork.org/en/scripts/17110-isec-style-fix
// @version      20160821
// @description  fixing isec.pt styling issues
// @author       Ivo Barros
// @twitter      @L3v3L
// @homepage     http://ibarros.com/
// @match        http*://www.isec.pt/*
// @grant        none
// ==/UserScript==
/* jshint -W097 */
'use strict';

//replaces an image url with another url
function replaceImages(oldUrl, newUrl) {
    var imgs = document.getElementsByTagName('img');
    for (i = 0; i<imgs.length; i++) {
        imgs[i].src = imgs[i].src.replace(oldUrl, newUrl);
    }
}

var dropDownMenu = document.querySelectorAll('.dropdown-menu'), i;
for (i = 0; i < dropDownMenu.length; ++i) {
    dropDownMenu[i].style.margin = "0px";
}

replaceImages('http://www.isec.pt/custom/img/about/presidente/Foto_JorBar_siteISEC.jpg', 'https://pp.vk.me/c10868/v10868007/163/UddpNN7poTg.jpg');