swagger-extends

swagger 2.0 友好交互拓展工具

اعتبارا من 22-12-2019. شاهد أحدث إصدار.

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 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.

ستحتاج إلى تثبيت إضافة مثل Stylus لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتتمكن من تثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

ستحتاج إلى تثبيت إضافة لإدارة أنماط المستخدم لتثبيت هذا النمط.

(لدي بالفعل مثبت أنماط للمستخدم، دعني أقم بتثبيته!)

// ==UserScript==
// @name         swagger-extends
// @namespace    http://tampermonkey.net/
// @version      0.1
// @description  swagger 2.0 友好交互拓展工具
// @author       teeeemoji
// @include        /.*\/swagger-ui\.html.*/
// ==/UserScript==

function createDom(type, props, style) {
    const dom = document.createElement(type)
    Object.assign(dom, props)
    Object.assign(dom.style, style)
    return dom
}

const appStyle = createDom('link', {
    as: 'style',
    rel: 'stylesheet',
    type: 'text/css',
    href: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/css/app.1b90d6be.css'
})
const chunkStyle = createDom('link', {
    as: 'style',
    rel: 'stylesheet',
    type: 'text/css',
    href: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/css/chunk-vendors.417470db.css'
})
const eleWoff = createDom('link', {
    href: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/fonts/element-icons.woff'
})
const eleTtf = createDom('link', {
    href: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/css/chunk-vendors.css'
})
document.head.append(appStyle)
document.head.append(chunkStyle)
document.head.append(eleWoff)
document.head.append(eleTtf)

const appScript = createDom('script', {
    src: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/js/app.3b08f80f.js'
})
const chunkScript = createDom('script', {
    src: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/js/chunk-vendors.ce05b277.js'
})
document.body.append(appScript)
document.body.append(chunkScript)