Skip to content

Instantly share code, notes, and snippets.

@joseanpg
Created August 15, 2011 20:20
Show Gist options
  • Save joseanpg/1147739 to your computer and use it in GitHub Desktop.
Save joseanpg/1147739 to your computer and use it in GitHub Desktop.
document.documentElement.childNodes[0].innerHTML = '';
var pres = document.getElementsByTagName('PRE');
for(var j = 0, len = pres.length; j<len;j++) {
var sty= pres[j].style;
sty.border='1px solid black';
sty.padding='8px';
sty.marginLeft='32px';
}
var df = document.createDocumentFragment();
df.appendChild(document.createElement('H2')).appendChild(document.createTextNode(document.querySelector('#question-header a').childNodes[0].nodeValue))
var posts = document.querySelectorAll('div.post-text');
/* times = document.querySelectorAll('div.user-action-time span'); users = document.querySelectorAll('td.post-signature.owner div.user-details a');*/
for (var j=0,len = posts.length ;j<len;j++) {
var post = posts[j];
/*post.innerHTML = '<h4>'+users[j].innerHTML +'::'+ times[j].innerHTML + '</h4>'+post.innerHTML;*/
df.appendChild(post);
var sty = post.style;
sty.borderTop='2px solid grey';
sty.padding='16px';
}
var bod = document.body;
bod.style.marginTop='0px';
bod.innerHTML='<a style="text-decoration:none" href="'+location.href+'">'+location.href+'</a><hr/>';
bod.appendChild(df);
document.designMode='on';
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment