Last active
February 14, 2020 10:35
-
-
Save roshanvid/14aafc95c90e2d9d8dec0eb615be1824 to your computer and use it in GitHub Desktop.
Prettify JOS Books
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
javascript:(function()%7Bif ((%5B"https%3A%2F%2Fccrma.stanford.edu%2F~jos%2Fmdft%2F"%2C"https%3A%2F%2Fccrma.stanford.edu%2F~jos%2Ffilters%2F"%2C"https%3A%2F%2Fccrma.stanford.edu%2F~jos%2Fpasp%2F"%2C"https%3A%2F%2Fccrma.stanford.edu%2F~jos%2Fsasp%2F"%5D.includes(document.location.href)) %26%26 (!document.querySelector('iframe%5Bname%3D"preview"%5D'))) %7Bvar d %3D document.createElement('iframe')%3Bd.name %3D 'preview'%3Bd.src %3D document.querySelector('ul a').href%3Bd.onload %3D function () %7Bvar style %3D document.createElement('style')%3Bstyle.innerHTML %3D %60body %7Bfont-family%3A "Palatino"%3B%7Daddress%2C body > strong%2C body > hr %7Bdisplay%3A none%3B%7D%60%3Bd.contentDocument.head.appendChild(style)%7D%3Bdocument.body.appendChild(d)%3Bdocument.querySelectorAll('li a').forEach(ele %3D> ele.setAttribute('target'%2C 'preview'))%3Bvar style %3D document.createElement('style')%3Bstyle.innerHTML %3D %60ul %7Bpadding-left%3A 20px%3B%7Dbody > strong%2C p%3Aempty%2C hr %7Bdisplay%3A none%3B%7Dh1%2Cp %7Btext-align%3A left%3B%7Dhtml %7Bbackground-color%3A var(--background-color)%3B%7Dhtml%2C body %7Bheight%3A 100%25%3Bwidth%3A 300px%3Bbox-sizing%3A border-box%3Bmargin%3A 0px%3Boverflow%3A scroll%3B%7Dbody %7Bpadding %3A 20px%3Bbackground%3A rgba(32%2C 91%2C 134%2C 0.21)%3Bfont-family%3A Avenir%3Bfont-size%3A 14px%3B%7Diframe %7Bposition%3A absolute%3Bleft%3A 300px%3Bbox-sizing%3A border-box%3Bpadding%3A 20px%3Btop%3A 0px%3Bheight%3A 100%25%3Bwidth%3A 800px%3Bborder%3A none%3B%7D%60%3Bdocument.head.appendChild(style)%3B%7D%7D)() |
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
if ((["https://ccrma.stanford.edu/~jos/mdft/", | |
"https://ccrma.stanford.edu/~jos/filters/", | |
"https://ccrma.stanford.edu/~jos/pasp/", | |
"https://ccrma.stanford.edu/~jos/sasp/" | |
].includes(document.location.href)) && (!document.querySelector('iframe[name="preview"]'))) { | |
var d = document.createElement('iframe'); | |
d.name = 'preview'; | |
d.src = document.querySelector('ul a').href; | |
d.onload = function () { | |
var style = document.createElement('style'); | |
style.innerHTML = ` | |
body { | |
font-family: "Palatino"; | |
} | |
address, body > strong, body > hr { | |
display: none; | |
}`; | |
d.contentDocument.head.appendChild(style) | |
}; | |
document.body.appendChild(d); | |
document.querySelectorAll('li a').forEach(ele => ele.setAttribute('target', 'preview')); | |
var style = document.createElement('style'); | |
style.innerHTML = ` | |
ul { | |
padding-left: 20px; | |
} | |
body > strong, p:empty, hr { | |
display: none; | |
} | |
h1,p { | |
text-align: left; | |
} | |
html { | |
background-color: var(--background-color); | |
} | |
html, body { | |
height: 100%; | |
width: 300px; | |
box-sizing: border-box; | |
margin: 0px; | |
overflow: scroll; | |
} | |
body { | |
padding : 20px; | |
background: rgba(32, 91, 134, 0.21); | |
font-family: Avenir; | |
font-size: 14px; | |
} | |
iframe { | |
position: absolute; | |
left: 300px; | |
box-sizing: border-box; | |
padding: 20px; | |
top: 0px; | |
height: 100%; | |
width: 800px; | |
border: none; | |
}`; | |
document.head.appendChild(style); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment