xaojoe126.com / Hide side

// ==UserScript==
// @name         Hide side
// @namespace    http://tampermonkey.net/
// @version      1.5.5
// @description  relayout pages on browsing webpages
// @author       Cube
// @match        *://*.cnblogs.com/*
// @match        *://*.csdn.net/*
// @match        *://zhidao.baidu.com/question/*
// @match        *://*.imooc.com/video/*
// @license      MIT
// @require      http://apps.bdimg.com/libs/jquery/2.1.4/jquery.min.js
// @grant        none
// ==/UserScript==

$(function() {
    var bak = document.documentElement.innerHTML;//页面备份

    //cnblogs
    if(/www.cnblogs.com/.test(location.href)){
        try{
            $('#sideBar').hide();
            $('#sidebar').hide();
            $("#leftcontent").hide();
            $("#leftmenu").hide();
            $("#content").css({"margin":"0 0"});
            $("#post_next_prev").clone(true).attr("id","UserAdd_").prependTo($("#cnblogs_post_body"));//上一页下一页 复制到文章开头
            $("#post_next_prev").clone(true).attr("id","UserAdd_").prependTo($("#mytopmenu"));//上一页下一页 复制到文章开头
        }catch(e){
            alert('脚本错误');
        }
    }
    //blog.csdn.net
    if(/blog.csdn.net/.test(location.href)){
        var myfun = function(){
            $("aside").hide();
            $("main").css({"float":"left"});
            var tool_box = $(".tool-box");
            tool_box.appendTo($(".article-title-box"));
            tool_box.find("li,button,svg,a[title!='手机看']").each(function(e,t){
                $(t).css({"color":"rgb(36, 255, 11)","background":"black"});
            });
            tool_box.css({"display":"contents"});
            $("main div.blog-content-box").after($(".tool-box").clone(true).attr("id","UserId"));
            $("div.article-header-box").css({"color":"red","background":"black"})
            $("div#article_content").css({"height":"","overflow":""});//显示更多
            $("div.hide-article-box").hide();//阅读更多
        };
        if(window.outerWidth * 3 < screen.width * 2){
            myfun();
        }
        $(window).resize(function(){
            if(window.outerWidth * 2 == screen.width){
                myfun();
            }else if(window.outerWidth == screen.width){
                document.documentElement.innerHTML = bak;
                //$("div#article_content.article_content.clearfix.csdn-tracking-statistics").css({"height":"","overflow":""});//显示更多
                //$("div#article_content.article_content.tracking-ad").css({"height":"","overflow":""});//显示更多
                $("div#article_content").css({"height":"","overflow":""});//显示更多
                $("div.hide-article-box").hide();//阅读更多
            }
        });
    }else if(/bbs.csdn.net/.test(location.href)){
        $("#bbs_detail_wrap").css({"height":"","overflow":""});
        $(".hide_topic_box").hide();
        $("dt.topic_l").css({"width":"10px"});
        $("dt.topic_l").hide();

    }

    //慕课网
    var l = $("div.section-list");
    var li = $(".course-menu.course-video-menu.clearfix.js-course-menu li")[2];
    $(li).after('<li class="course-menu-item"><a href="javascript:void(0)" id="ismenu">开启右侧目录</a></li>');
    $("#ismenu").click(function(){
        l.toggle();
    });

    //百度知道
    if(/zhidao.baidu.com\/question/.test(location.href)){
        $("#qb-content").css({"padding-left":"5px"});
        //$("#qb-content")[0].style.zoom = "120%";
        //$("#qb-content").css({"width":"" + (window.outerWidth*3/4) + "px"});
        //$("body")[0].style.zoom = "100%";
        //$("aside").hide();
    }
});