READTHEDOCS.IO

try to take over the world!

Fra 28.05.2020. Se den seneste versjonen.

You will need to install an extension such as Tampermonkey, Greasemonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install a user script manager extension to install this script.

(I already have a user script manager, let me install it!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name         READTHEDOCS.IO
// @namespace    http://tampermonkey.net/
// @version      0.5
// @description  try to take over the world!
// @author       You
// @match        https://geotrellis.readthedocs.io/*
// ==/UserScript==

(function() {
    'use strict';

    //const $supWindow = window;
    window.onload = function() {
        var content = jQuery('.wy-nav-content');
        var parentDiv = content.parent();
        parentDiv[0].style.background = "#fff";
        content[0].style.float = 'left';
        content[0].style.background = 'darkkhaki';
        var copyContent = jQuery(`<div class="wy-nav-content copy" style="float: left;margin-left:20px;background: beige;">` + content[0].innerHTML + `<div>`);
        parentDiv.append(jQuery('<iframe id="copy"></iframe>'));
        setTimeout(function() {
            copy.contentWindow.document.getElementsByTagName('body')[0].innerHTML = `<div class="wy-nav-content" style="float: left;">` + content[0].innerHTML + "</div>";
            copy.contentWindow.document.getElementsByTagName('head')[0].innerHTML += `<link rel="stylesheet" href="../_static/css/theme.css" type="text/css">
<link rel="stylesheet" href="../_static/pygments.css" type="text/css">`;
            copy.style.height = content[0].clientHeight + "px";
            copy.style.width = (content[0].clientWidth + 50) + "px";
        });
        setTimeout(function() {
            jQuery('body').append(jQuery(`
<div id="fixLoc" style="position: fixed;right: 20px;top: 50%;font-size: xx-large;cursor: pointer;user-select: none;">
<div id="justLocUp" style="background: cadetblue;border-radius: 10px;padding: 5px;">上</div>
<div id="closeFixLoc" style="margin-top: 5px;background: cadetblue;border-radius: 10px;padding: 5px;">关</div>
<div id="justLocDown" style="margin-top: 5px;background: cadetblue;border-radius: 10px;padding: 5px;">下</div>
</div>`));
            jQuery("#closeFixLoc").on("click",function() {
                jQuery("#fixLoc")[0].style.display = "none";
            });
            let currentLoc = 0;
            let justLoc = function(tar) {
                let cloc = currentLoc + tar * 50;
                if (cloc < 0) {
                    return;
                } else {
                    content[0].style.marginTop = cloc + "px"
                    currentLoc = cloc;
                }
            }
            jQuery("#justLocUp").on("click",function() {
                justLoc(-1);
            });
            jQuery("#justLocDown").on("click",function() {
                justLoc(1);
            });
        });
    }
    // Your code here...
})();