Greasy Fork

Greasy Fork is available in English.

Tapd 文档页面查看

tapd文档查看页面优化目录显示

当前为 2021-07-15 提交的版本,查看 最新版本

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Greasemonkey 油猴子Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Violentmonkey 暴力猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴Userscripts ,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey 篡改猴,才能安装此脚本。

您需要先安装一款用户脚本管理器扩展后才能安装此脚本。

(我已经安装了用户脚本管理器,让我安装!)

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展,比如 Stylus,才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

您需要先安装一款用户样式管理器扩展后才能安装此样式。

(我已经安装了用户样式管理器,让我安装!)

// ==UserScript==
// @author       YuXianwen
// @name         Tapd 文档页面查看
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  tapd文档查看页面优化目录显示
// @match        https://www.tapd.cn/59941941/documents/show/*
// @icon         https://www.google.com/s2/favicons?domain=tapd.cn
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    // Your code here...
    // 加载样式

    var style = document.createElement("style");
    style.type = "text/css";
    var text = document.createTextNode(`.wiki-toc{

    font-size: 14px;
    }

    .wiki-toc .category{
    display:none}
    .wiki-toc .content div div {
    padding:6px 0;

    }
    .wiki-toc .content div div:hover{
    background-color:#f5f2f2}
    `);

    style.appendChild(text);
    var head = document.getElementsByTagName("head")[0];
    head.appendChild(style);

    console.log('init')
    $('#toggleCategory').click();
    $('.detail-tab-ul').prepend('<li class="detail-tab-li" id="li-wiki-toc"><a rel="wiki-toc-tpl">目录</a></li>')

    var doc = $('.wiki-toc').clone()
    $('.wiki-toc').hide()
    var script=$('<script id="wiki-toc-tpl" type="text/html">这是目录<\/script>');

    $('body').append(script);
    $('#li-wiki-toc').on('click',function(){
         $("#detail-content").html(doc)
    })


        setTimeout(function(){
        $('#li-wiki-toc').click();
         $('.fd-comments').hide()
        })



})();