Created
September 6, 2011 04:05
-
-
Save philipmat/1196552 to your computer and use it in GitHub Desktop.
Books24x7 page cleanup
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
d = document; | |
function p(n){return n.parentNode} | |
function $(x){return d.getElementById(x)} | |
function $t(x){return d.getElementsByTagName(x)} | |
function $c(x){return d.getElementsByClassName(x)} | |
function $r(n){p(n).removeChild(n)} | |
if (d.location.href.indexOf('mobile.books24x7') != -1 ) { | |
while($t('link').length != 1) { | |
l = $t('link'); | |
for(var i = 0; i < l.length; i++) if (l[i].href.indexOf('grison') == -1) $r(l[i]); | |
} | |
/* removes all navigation as well | |
while($c('b24-navmenu').length != 0) { | |
var l = $c('b24-navmenu')[0]; | |
$r(l); | |
} | |
//*/ | |
c = $c('chapter')[0]; | |
} else { | |
$r(p(p($('ctl00_logoline')))); | |
$r($('MenuTD')); | |
c = $c('admon-title'); | |
for(var i=0;i<c.length;i++) c[i].style.display='none'; | |
c = $('ctl00_ContentPlaceHolder1_ContentAreaUpdatePanel'); | |
} | |
n=p(c);n.appendChild(c); | |
while(n.childElementCount != 1) n.removeChild(n.children[0]); | |
// bookmarklet: | |
// javascript:(function() { ... })(); | |
// javascript:(function() { d = document; function p(n){return n.parentNode} function $(x){return d.getElementById(x)} function $t(x){return d.getElementsByTagName(x)} function $c(x){return d.getElementsByClassName(x)} function $r(n){p(n).removeChild(n)} if (d.location.href.indexOf('mobile.books24x7') != -1 ) { while($t('link').length != 1) { l = $t('link'); for(var i = 0; i < l.length; i++) if (l[i].href.indexOf('grison') == -1) $r(l[i]); } while($c('b24-navmenu').length != 0) { var l = $c('b24-navmenu')[0]; $r(l); } c = $c('chapter')[0]; } else { $r(p(p($('ctl00_logoline')))); $r($('MenuTD')); c = $c('admon-title'); for(var i=0;i<c.length;i++) c[i].style.display='none'; c = $('ctl00_ContentPlaceHolder1_ContentAreaUpdatePanel'); } n=p(c);n.appendChild(c); while(n.childElementCount != 1) n.removeChild(n.children[0]); })(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment