/*
* @title bookmarklet
* @description my bookmarklet
* @include http://*
* @license MIT License
* @require
*/
// cf. https://gist.github.com/cho45/875989
var styles = document.styleSheets;
for (var i = 0, it; it = styles[i]; i++) {
it.disabled = true;
}
var css = ' body { font-family: serif; font-size: 18pt; line-height: 1.5em; padding: 2em; -webkit-writing-mode: vertical-rl; writing-mode: vertical-rl; overflow-y: hidden; max-height: 40em; text-align: justify; box-shadow: 0 0 1em 0 rgba(0, 0, 0, 0.9); } ';
var style = document.createElement('style');
style.type = 'text/css';
style.appendChild(document.createTextNode(css));
document.querySelector('head').appendChild(style);
// bug for rendering ruby elements
document.body.innerHTML = document.body.innerHTML;
document.body.addEventListener('mousewheel', function (e) {
if (e.wheelDeltaX) {
document.body.scrollLeft -= e.wheelDeltaX;
} else {
document.body.scrollLeft += e.wheelDelta;
}
e.preventDefault();
}, false);