swagger-extends

swagger 2.0 友好交互拓展工具

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey, το Greasemonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Violentmonkey για να εγκαταστήσετε αυτόν τον κώδικα.

θα χρειαστεί να εγκαταστήσετε μια επέκταση όπως το Tampermonkey ή το Userscripts για να εγκαταστήσετε αυτόν τον κώδικα.

You will need to install an extension such as Tampermonkey to install this script.

Θα χρειαστεί να εγκαταστήσετε μια επέκταση διαχείρισης κώδικα χρήστη για να εγκαταστήσετε αυτόν τον κώδικα.

(Έχω ήδη έναν διαχειριστή κώδικα χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

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.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(Έχω ήδη έναν διαχειριστή στυλ χρήστη, επιτρέψτε μου να τον εγκαταστήσω!)

// ==UserScript==
// @name         swagger-extends
// @namespace    http://tampermonkey.net/
// @version      1.2
// @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.6b076305.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.c63c8862.css'
})
const eleWoff = createDom('link', {
    href: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/fonts/element-icons.535877f5.woff'
})
const eleTtf = createDom('link', {
    href: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/fonts/element-icons.732389de.ttf'
})
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.262594ef.js'
})
const chunkScript = createDom('script', {
    src: 'https://sf16-eacdn-tos.pstatp.com/obj/eaoffice/swagger-extends/js/chunk-vendors.9f96de28.js'
})
document.body.append(appScript)
document.body.append(chunkScript)