Skip to content

Instantly share code, notes, and snippets.

@blaxter
Created May 28, 2009 22:15
Show Gist options
  • Save blaxter/119616 to your computer and use it in GitHub Desktop.
Save blaxter/119616 to your computer and use it in GitHub Desktop.
n 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);
}
function addExternalCss(url) {
var head = document.getElementsByTagName('head')[0];
if ( ! head ) { return; }
var link = document.createElement('link');
link.type = 'text/css';
link.rel = 'stylesheet';
link.href = url;
head.appendChild( link );
}
addGlobalStyle(
'body, html {' +
' width: 100%;' +
'}' +
'#content.wiki .wikipage { '+
' width: 100%;' +
'}'
);
addExternalCss(
"http://github.com/csexton/ristoink4trac/raw/e7d0f2c2d00a2d25f9a93e0db674844f3e76bc49/code.css"
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment