Skip to content

Instantly share code, notes, and snippets.

@lpalli
Created June 19, 2010 12:05
Show Gist options
  • Save lpalli/444841 to your computer and use it in GitHub Desktop.
Save lpalli/444841 to your computer and use it in GitHub Desktop.
MediaWiki - H4 100% for Greasemonkey
// MediaWiki - H4 100%
// version 0.1 BETA!
// 2010-03-17
// Copyright (c) 2010, Luca Palli
// Released under the GPL license
// http://www.gnu.org/copyleft/gpl.html
//
// --------------------------------------------------------------------
//
// This is a Greasemonkey user script. To install it, you need
// Greasemonkey 0.3 or later: http://greasemonkey.mozdev.org/
// Then restart Firefox and revisit this script.
// Under Tools, there will be a new menu item to "Install User Script".
// Accept the default configuration and install.
//
// To uninstall, go to Tools/Manage User Scripts,
// select "MediaWiki - H4 100%", and click Uninstall.
//
// --------------------------------------------------------------------
//
// ==UserScript==
// @name MediaWiki - H4 100%
// @namespace http://monte-ceneri.org/
// @description Change the H4 font size to 100% and increase the line-height to preserve the page layout.
// @include http://wiki.inser.ch/wiki/*
// ==/UserScript==
function addGlobalStyle(css) {
var head, style;
head = document.getElementsByTagName('head')[0];
if (!head) { return; }
style = document.createElement('style');
style.type = 'text/css';
style.innerHTML = css;
head.appendChild(style);
}
addGlobalStyle('h4 { font-size: 100% ! important; line-height: 1.66em ! important; }');
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment