clumsyman / 69shu_chapter

// ==UserScript==
// @name         69shu_chapter
// @namespace    http://tampermonkey.net/
// @version      0.3.4
// @description  load multiple chapters
// @author       clumsyman
// @updateURL https://openuserjs.org/meta/clumsyman/69shu_chapter.meta.js
// @downloadURL https://openuserjs.org/install/clumsyman/69shu_chapter.user.js
// @copyright 2018, clumsyman (https://openuserjs.org//users/clumsyman)
// @license MIT
// @match        https://www.69shuba.com/txt/*/*
// @match        https://www.69shu.com/txt/*/*
// @grant        none
// ==/UserScript==

javascript:$(document).ready(function () {
try {
    var style = document.body.appendChild(document.createElement('style'));
    style.append(document.createTextNode([
        '.leftmenu.active { display: block; }',
        '.leftmenu, .yueduad1 { display: none; }',
        '.tools a { color: white; line-height: 48px; }',
        '.tools + header { top: -75px }',
        '.tools.active + header { top: 0 }',
        '.page1 { background: transparent; margin: 0; }',
        '@media (max-width: 720px) {',
            '.mybox { margin: 0; }',
            '.tools { bottom: -100px; padding: 0; margin-bottom: 0; }',
            '.tools.active { bottom: 0; }',
        '}',
        '@media (max-width: 990px) {',
            '.txtnav h1.hide720 { position: static; }',
        '}',
        '@media (max-width: 1200px) {',
            '.container { margin: auto; }',
        '}',
    ].join('\n')));

    var header = document.querySelector('header');
    header.removeAttribute("style");
    var page1 = document.querySelector('.page1');
    var tools = document.querySelector('.tools');
    tools.insertBefore(page1, tools.firstChild);
    tools.parentElement.appendChild(tools);
    tools.parentElement.appendChild(header);
    tools.classList.add('active');

    var window_hidemenu = window.hidemenu;
    var window_showmenu = window.showmenu;
    window.hidemenu = function() {
        window_hidemenu();
        $('.leftmenu').removeClass('active');
    };
    window.showmenu = function() {
        window_showmenu();
        $('.leftmenu').addClass('active');
    };
    $(window).unbind('scroll');
} catch(e) {
    alert(e + '\n' + e.stack);
}
});