Skip to content

Commit

Permalink
chore: updated version
Browse files Browse the repository at this point in the history
  • Loading branch information
wll8 committed Jun 19, 2023
1 parent 13a90d1 commit c460ed9
Show file tree
Hide file tree
Showing 4 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion dist/try.js
Original file line number Diff line number Diff line change
Expand Up @@ -105,7 +105,7 @@ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len
}
function initCss() {
// reset swagger-ui css
$('head').append("\n <style>\n /* Set the position of swaggerBox with body as the relative element */\n body {\n position: relative;\n }\n @media print, screen and (max-width: 85rem) {\n .eIeJha,\n .dtUibw {\n padding: 4px;\n }\n }\n\n .swaggerBox.hide {\n visibility: hidden;\n cursor: none;\n width: 0;\n height: 0;\n }\n .swaggerBox.show {\n visibility: visible;\n cursor: initial;\n }\n\n /* Reset the style of swagger-ui */\n .swaggerBox .swagger-ui .wrapper {\n padding: 0;\n }\n .swaggerBox .swagger-ui .download-contents {\n top: -10px;\n right: 0;\n width: initial;\n }\n\n /* Disable api bar to avoid problems */\n .swaggerBox:not(.onlySwagger) .swagger-ui .opblock .opblock-summary {\n cursor: not-allowed;\n pointer-events: none;\n }\n\n /* Disable the api bar, but exclude the authorization button */\n .swaggerBox .swagger-ui .authorization__btn {\n cursor: initial;\n pointer-events: initial;\n }\n\n .swaggerBox {\n border-radius: 4px;\n background-color: #fff;\n width: 100%;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n }\n .swaggerBox:not(.onlySwagger) {\n overflow: hidden;\n }\n /* Hide some disturbing elements */\n .swaggerBox.pure:not(.onlySwagger) .swagger-ui .opblock-summary {\n visibility: hidden;\n padding: 0;\n }\n .swaggerBox.pure:not(.onlySwagger) .opblock-section thead,\n .swaggerBox.pure:not(.onlySwagger) .swagger-ui .opblock-summary * {\n display: none;\n }\n\n .swaggerBox:not(.onlySwagger) .swagger-ui .opblock .opblock-section-header,\n .swaggerBox:not(.onlySwagger) .btn.cancel,\n .swaggerBox:not(.onlySwagger) .try-out,\n .swaggerBox:not(.onlySwagger) .responses-inner>div>h4,\n .swaggerBox:not(.onlySwagger) :not(.live-responses-table).responses-table,\n .swaggerBox:not(.onlySwagger) .opblock-body > .opblock-description-wrapper {\n display: none;\n }\n\n .swaggerBox .tryBtn {\n margin-right: 10px;\n background-color: #fff;\n }\n </style>\n ");
$('head').append("\n <style>\n /* Set the position of swaggerBox with body as the relative element */\n body {\n position: relative;\n }\n @media print, screen and (max-width: 85rem) {\n .eIeJha,\n .dtUibw {\n padding: 4px;\n }\n }\n\n .swaggerBox.hide {\n visibility: hidden;\n cursor: none;\n width: 0;\n height: 0;\n }\n .swaggerBox.show {\n visibility: visible;\n cursor: initial;\n }\n\n /* Reset the style of swagger-ui */\n .swaggerBox .swagger-ui .wrapper {\n padding: 0;\n }\n .swaggerBox .swagger-ui .download-contents {\n top: -10px;\n right: 0;\n width: initial;\n }\n\n /* Disable api bar to avoid problems */\n .swaggerBox:not(.onlySwagger) .swagger-ui .opblock .opblock-summary {\n cursor: not-allowed;\n pointer-events: none;\n }\n\n /* Disable the api bar, but exclude the authorization button */\n .swaggerBox .swagger-ui .authorization__btn {\n cursor: initial;\n pointer-events: initial;\n }\n\n .swaggerBox {\n border-radius: 4px;\n background-color: #fff;\n width: 100%;\n height: 100vh;\n position: absolute;\n top: 0;\n left: 0;\n z-index: 1;\n }\n .swaggerBox:not(.onlySwagger) {\n overflow: hidden;\n }\n /* Hide some disturbing elements */\n .swaggerBox.pure:not(.onlySwagger) .swagger-ui .opblock-summary {\n visibility: hidden;\n padding: 0;\n }\n .swaggerBox.pure:not(.onlySwagger) .opblock-section thead,\n .swaggerBox.pure:not(.onlySwagger) .swagger-ui .opblock-summary * {\n display: none;\n }\n\n .swaggerBox:not(.onlySwagger) .swagger-ui .opblock .opblock-section-header,\n .swaggerBox:not(.onlySwagger) .btn.cancel,\n .swaggerBox:not(.onlySwagger) .try-out,\n .swaggerBox:not(.onlySwagger) .responses-inner>div>h4,\n .swaggerBox:not(.onlySwagger) :not(.live-responses-table).responses-table,\n .swaggerBox:not(.onlySwagger) .opblock-body > .opblock-description-wrapper {\n display: none;\n }\n .swaggerBox:not(.onlySwagger) .block div>span:last-child .operation-tag-content>span:last-child {\n display: block;\n margin-bottom: 100vh;\n }\n .swaggerBox .tryBtn {\n margin-right: 10px;\n background-color: #fff;\n }\n </style>\n ");
}
function initSwagger(swaggerOptions) {
// dom
Expand Down
2 changes: 1 addition & 1 deletion index.html
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
!window.initTryOptions.openApi && (delete window.initTryOptions.openApi);
</script>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.min.js"> </script>
<script src="https://cdn.jsdelivr.net/gh/wll8/[email protected].2/dist/try.js"></script>
<script src="https://cdn.jsdelivr.net/gh/wll8/[email protected].3/dist/try.js"></script>
<script>
// initTry(`https://petstore.swagger.io/v2/swagger.json`)
initTry({
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "redoc-try",
"version": "1.4.2",
"version": "1.4.3",
"description": "[👉 online preview](https://wll8.github.io/redoc-try/index.html)",
"main": "dist/try.js",
"env": {
Expand Down
2 changes: 1 addition & 1 deletion readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ Add `Try it out` function like [swagger](https://petstore.swagger.io/) on [redoc
<body>
<div id="redoc-container"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/bundles/redoc.standalone.min.js"> </script>
<script src="https://cdn.jsdelivr.net/gh/wll8/[email protected].2/dist/try.js"></script>
<script src="https://cdn.jsdelivr.net/gh/wll8/[email protected].3/dist/try.js"></script>
<script>
// initTry(`https://petstore.swagger.io/v2/swagger.json`)
initTry({
Expand Down

0 comments on commit c460ed9

Please sign in to comment.