您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
2021/6/3下午11:25:37
当前为
// ==UserScript== // @name 抖店开放平台脚本 // @namespace Violentmonkey Scripts // @match https://op.jinritemai.com/docs/api-docs/* // @grant none // @version 1.0 // @author - // @description 2021/6/3下午11:25:37 // @require https://cdn.bootcdn.net/ajax/libs/jquery/3.6.0/jquery.js // ==/UserScript== (function () { const defaultStyle = ` #yixi__noti_container {position:fixed;top:100px;left:10px;z-index:99;} .yixi__noti_msg {display:none;padding:10px 20px;font-size:14px;font-weight:bold;color:#fff;margin-bottom:10px;background:rgba(0,0,0,0.6);border-radius:10px;cursor:pointer;} `; const insertStyle = () => { const style = document.createElement("style"); style.appendChild(document.createTextNode(defaultStyle)); document.getElementsByTagName('head')[0].appendChild(style); } insertStyle(); setTimeout(() => { 'use strict'; // 设置wrapper,移除宽度限制 const wrapper = $($('main.ant-layout-content div[class^=wrapper]')[1]); wrapperSetting(wrapper); // 设置content,移除宽度限制 const content = wrapper.find('div[class^=content]'); contentSetting(content); // 设置table,增加折叠 const table_list = content.find('table'); console.log(table_list); tableListSetting(table_list); const pre_list = content.find('pre'); console.log(pre_list); preListSetting(pre_list); }, 2000); const wrapperSetting = (wrapper) => { wrapper.css('width', '100%').css('padding', '0 64px'); } const contentSetting = (content) => { content.css('max-width', '100%'); } const tableListSetting = (table_list) => { table_list.each((index, table) => { const table_q = $(table); const table_title = table_q.prev(); table_title.on('click', () => { const table_body = table_q.children('tbody'); if (table_body.css('display') == 'none') { table_body.css('display', ''); popNotification(`显示${table_title.text().replace('(已隐藏)', '')}`); table_title.text(table_title.text().replace('(已隐藏)', '')); } else { table_body.css('display', 'none'); popNotification(`隐藏${table_title.text()}`); table_title.text(table_title.text() + '(已隐藏)'); } }); // 公共参数直接折叠 const table_body = table_q.children('tbody'); if (table_title.text() == '公共参数') { table_body.css('display', 'none'); table_title.text(table_title.text() + '(已隐藏)'); } }); } const preListSetting = (pre_list) => { pre_list.each((index, pre) => { const pre_q = $(pre); const pre_title = pre_q.prev(); pre_title.on('click', () => { if (pre_q.css('display') == 'none') { pre_q.css('display', ''); popNotification(`显示${pre_title.text().replace('(已隐藏)', '')}`); pre_title.text(pre_title.text().replace('(已隐藏)', '')); } else { pre_q.css('display', 'none'); popNotification(`隐藏${pre_title.text()}`); pre_title.text(pre_title.text() + '(已隐藏)'); } }) }); } const popNotification = (msg, duration=1000) => { $('#yixi__noti_container').length == 0 && $('body').append('<div id="yixi__noti_container"></div>') let $msgBox = $(`<div class="yixi__noti_msg">${msg}</div>`) $('#yixi__noti_container').append($msgBox) $msgBox.slideDown(100) setTimeout(() => { $msgBox.fadeOut(500) }, duration) setTimeout(() => { $msgBox.remove() }, duration + 500) } })();
QingJ © 2025
镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址