Skip to content

Commit

Permalink
update doc
Browse files Browse the repository at this point in the history
  • Loading branch information
blueswen committed Jul 16, 2022
1 parent 62c3284 commit c737c0a
Show file tree
Hide file tree
Showing 16 changed files with 261 additions and 214 deletions.
81 changes: 41 additions & 40 deletions docs/demo/build-in-multiple/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
<script id="__analytics">function __md_analytics(){function n(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],n("js",new Date),n("config","G-XYSWM3DNCQ"),document.addEventListener("DOMContentLoaded",function(){if(document.forms.search&&document.forms.search.query.addEventListener("blur",function(){this.value&&n("event","search",{search_term:this.value})}),document.forms.feedback){var e,a=document.forms.feedback;for(e of a.querySelectorAll("[type=submit]"))e.addEventListener("click",function(e){e.preventDefault();var t=document.location.pathname,e=this.getAttribute("data-md-value");n("event","feedback",{page:t,data:e}),a.firstElementChild.disabled=!0;e=a.querySelector(".md-feedback__note [data-md-value='"+e+"']");e&&(e.hidden=!1)}),a.hidden=!1}"undefined"!=typeof location$&&location$.subscribe(function(e){n("config","G-XYSWM3DNCQ",{page_path:e.pathname})})});var e=document.createElement("script");e.async=!0,e.src="https://www.googletagmanager.com/gtag/js?id=G-XYSWM3DNCQ",document.getElementById("__analytics").insertAdjacentElement("afterEnd",e)}</script>
<script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>
<link href="../../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><script src="../../assets/javascripts/glightbox.min.js"></script></head>
<link href="../../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><style>html.glightbox-open { overflow: initial; }</style><script src="../../assets/javascripts/glightbox.min.js"></script></head>
<body data-md-color-accent="" data-md-color-primary="" data-md-color-scheme="" dir="ltr">
<input autocomplete="off" class="md-toggle" data-md-toggle="drawer" id="__drawer" type="checkbox"/>
<input autocomplete="off" class="md-toggle" data-md-toggle="search" id="__search" type="checkbox"/>
Expand Down Expand Up @@ -221,10 +221,10 @@ <h2 id="markdown">Markdown</h2>
<a href="#__codelineno-0-5" id="__codelineno-0-5" name="__codelineno-0-5"></a>&lt;swagger-ui grouped name="Sample Third" src="./openapi-spec/sample-third.yaml"/&gt;
</code></pre></div>
<h2 id="multiple-oas-in-single-swagger-ui">Multiple OAS in single Swagger UI</h2>
<p><iframe frameborder="0" id="c7184bba" src="swagger-c7184bba.html" style="overflow:hidden;width:100%;" width="100%"></iframe>
<p><iframe class="swagger-ui-iframe" frameborder="0" id="8bb4c4ec" src="swagger-8bb4c4ec.html" style="overflow:hidden;width:100%;" width="100%"></iframe>
</p>
<h2 id="other-independent-swagger-ui">Other independent Swagger UI</h2>
<p><iframe frameborder="0" id="908d8886" src="swagger-908d8886.html" style="overflow:hidden;width:100%;" width="100%"></iframe></p>
<p><iframe class="swagger-ui-iframe" frameborder="0" id="0c50a7b3" src="swagger-0c50a7b3.html" style="overflow:hidden;width:100%;" width="100%"></iframe></p>
</article>
<script>var input,hash=location.hash.slice(1);hash.startsWith("__tabbed_")&&((input=document.getElementById(hash)).checked=!0)</script>
</div>
Expand Down Expand Up @@ -265,46 +265,47 @@ <h2 id="other-independent-swagger-ui">Other independent Swagger UI</h2>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["toc.integrate"], "search": "../../assets/javascripts/workers/search.720157f5.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.5e3df397.min.js"></script>
<script type="text/javascript">
update_swagger_ui_iframe_height = function (id) {
var iFrameID = document.getElementById(id);
if (iFrameID) {
full_height = (iFrameID.contentWindow.document.body.scrollHeight + 80) + "px";
iFrameID.height = full_height;
iFrameID.style.height = full_height;
}
<script>document$.subscribe(() => {
window.update_swagger_ui_iframe_height = function (id) {
var iFrameID = document.getElementById(id);
if (iFrameID) {
full_height = (iFrameID.contentWindow.document.body.scrollHeight + 80) + "px";
iFrameID.height = full_height;
iFrameID.style.height = full_height;
}
var scheme = document.body.getAttribute("data-md-color-scheme")
const options = {
childList: true,
attributes: true,
characterData: false,
subtree: false,
attributeFilter: ['data-md-color-scheme'],
attributeOldValue: false,
characterDataOldValue: false
};

const iframe_id_list = ["908d8886", "c7184bba"]

function color_scheme_callback(mutations) {
for (let mutation of mutations) {
if (mutation.attributeName === "data-md-color-scheme") {
scheme = document.body.getAttribute("data-md-color-scheme")
iframe_id_list.forEach((id) => {
var ele = document.getElementById(id);
if (ele) {
if (scheme === "slate") {
ele.contentWindow.enable_dark_mode();
} else {
ele.contentWindow.disable_dark_mode();
}
}

window.scheme = document.body.getAttribute("data-md-color-scheme")
const options = {
childList: true,
attributes: true,
characterData: false,
subtree: false,
attributeFilter: ['data-md-color-scheme'],
attributeOldValue: false,
characterDataOldValue: false
};
function color_scheme_callback(mutations) {
for (let mutation of mutations) {
if (mutation.attributeName === "data-md-color-scheme") {
scheme = document.body.getAttribute("data-md-color-scheme")
var iframe_list = document.getElementsByClassName("swagger-ui-iframe")
for(var i = 0; i < iframe_list.length; i++) {
var ele = iframe_list.item(i);
if (ele) {
if (scheme === "slate") {
ele.contentWindow.enable_dark_mode();
} else {
ele.contentWindow.disable_dark_mode();
}
})
}
}
}
}
observer = new MutationObserver(color_scheme_callback);
observer.observe(document.body, options);
</script><script type="text/javascript">const lightbox = GLightbox({"touchNavigation": true, "loop": true});</script></body>
}
observer = new MutationObserver(color_scheme_callback);
observer.observe(document.body, options);
})</script><script>document$.subscribe(() => {
const lightbox = GLightbox({"touchNavigation": true, "loop": true});
})</script></body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
}
const resize_ob = new ResizeObserver(function(entries) {
parent.update_swagger_ui_iframe_height("908d8886");
parent.update_swagger_ui_iframe_height("0c50a7b3");
});

// start observing for resize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,7 @@
}
}
const resize_ob = new ResizeObserver(function(entries) {
parent.update_swagger_ui_iframe_height("c7184bba");
parent.update_swagger_ui_iframe_height("8bb4c4ec");
});

// start observing for resize
Expand Down
81 changes: 41 additions & 40 deletions docs/demo/multiple/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
<script>__md_scope=new URL("../..",location),__md_hash=e=>[...e].reduce((e,_)=>(e<<5)-e+_.charCodeAt(0),0),__md_get=(e,_=localStorage,t=__md_scope)=>JSON.parse(_.getItem(t.pathname+"."+e)),__md_set=(e,_,t=localStorage,a=__md_scope)=>{try{t.setItem(a.pathname+"."+e,JSON.stringify(_))}catch(e){}}</script>
<script id="__analytics">function __md_analytics(){function n(){dataLayer.push(arguments)}window.dataLayer=window.dataLayer||[],n("js",new Date),n("config","G-XYSWM3DNCQ"),document.addEventListener("DOMContentLoaded",function(){if(document.forms.search&&document.forms.search.query.addEventListener("blur",function(){this.value&&n("event","search",{search_term:this.value})}),document.forms.feedback){var e,a=document.forms.feedback;for(e of a.querySelectorAll("[type=submit]"))e.addEventListener("click",function(e){e.preventDefault();var t=document.location.pathname,e=this.getAttribute("data-md-value");n("event","feedback",{page:t,data:e}),a.firstElementChild.disabled=!0;e=a.querySelector(".md-feedback__note [data-md-value='"+e+"']");e&&(e.hidden=!1)}),a.hidden=!1}"undefined"!=typeof location$&&location$.subscribe(function(e){n("config","G-XYSWM3DNCQ",{page_path:e.pathname})})});var e=document.createElement("script");e.async=!0,e.src="https://www.googletagmanager.com/gtag/js?id=G-XYSWM3DNCQ",document.getElementById("__analytics").insertAdjacentElement("afterEnd",e)}</script>
<script>"undefined"!=typeof __md_analytics&&__md_analytics()</script>
<link href="../../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><script src="../../assets/javascripts/glightbox.min.js"></script></head>
<link href="../../assets/stylesheets/glightbox.min.css" rel="stylesheet"/><style>html.glightbox-open { overflow: initial; }</style><script src="../../assets/javascripts/glightbox.min.js"></script></head>
<body data-md-color-accent="" data-md-color-primary="" data-md-color-scheme="" dir="ltr">
<input autocomplete="off" class="md-toggle" data-md-toggle="drawer" id="__drawer" type="checkbox"/>
<input autocomplete="off" class="md-toggle" data-md-toggle="search" id="__search" type="checkbox"/>
Expand Down Expand Up @@ -206,8 +206,8 @@ <h2 id="markdown">Markdown</h2>
<a href="#__codelineno-0-2" id="__codelineno-0-2" name="__codelineno-0-2"></a>&lt;swagger-ui src="https://petstore.swagger.io/v2/swagger.json"/&gt;
</code></pre></div>
<h2 id="swagger-ui">Swagger UI</h2>
<p><iframe frameborder="0" id="123cadff" src="swagger-123cadff.html" style="overflow:hidden;width:100%;" width="100%"></iframe>
<iframe frameborder="0" id="a71e52cc" src="swagger-a71e52cc.html" style="overflow:hidden;width:100%;" width="100%"></iframe></p>
<p><iframe class="swagger-ui-iframe" frameborder="0" id="c9ee033c" src="swagger-c9ee033c.html" style="overflow:hidden;width:100%;" width="100%"></iframe>
<iframe class="swagger-ui-iframe" frameborder="0" id="bf664e9f" src="swagger-bf664e9f.html" style="overflow:hidden;width:100%;" width="100%"></iframe></p>
</article>
<script>var input,hash=location.hash.slice(1);hash.startsWith("__tabbed_")&&((input=document.getElementById(hash)).checked=!0)</script>
</div>
Expand Down Expand Up @@ -261,46 +261,47 @@ <h2 id="swagger-ui">Swagger UI</h2>
</div>
<script id="__config" type="application/json">{"base": "../..", "features": ["toc.integrate"], "search": "../../assets/javascripts/workers/search.720157f5.min.js", "translations": {"clipboard.copied": "Copied to clipboard", "clipboard.copy": "Copy to clipboard", "search.config.lang": "en", "search.config.pipeline": "stopWordFilter", "search.config.separator": "[\\s\\-]+", "search.placeholder": "Search", "search.result.more.one": "1 more on this page", "search.result.more.other": "# more on this page", "search.result.none": "No matching documents", "search.result.one": "1 matching document", "search.result.other": "# matching documents", "search.result.placeholder": "Type to start searching", "search.result.term.missing": "Missing", "select.version.title": "Select version"}}</script>
<script src="../../assets/javascripts/bundle.5e3df397.min.js"></script>
<script type="text/javascript">
update_swagger_ui_iframe_height = function (id) {
var iFrameID = document.getElementById(id);
if (iFrameID) {
full_height = (iFrameID.contentWindow.document.body.scrollHeight + 80) + "px";
iFrameID.height = full_height;
iFrameID.style.height = full_height;
}
<script>document$.subscribe(() => {
window.update_swagger_ui_iframe_height = function (id) {
var iFrameID = document.getElementById(id);
if (iFrameID) {
full_height = (iFrameID.contentWindow.document.body.scrollHeight + 80) + "px";
iFrameID.height = full_height;
iFrameID.style.height = full_height;
}
var scheme = document.body.getAttribute("data-md-color-scheme")
const options = {
childList: true,
attributes: true,
characterData: false,
subtree: false,
attributeFilter: ['data-md-color-scheme'],
attributeOldValue: false,
characterDataOldValue: false
};

const iframe_id_list = ["123cadff", "a71e52cc"]

function color_scheme_callback(mutations) {
for (let mutation of mutations) {
if (mutation.attributeName === "data-md-color-scheme") {
scheme = document.body.getAttribute("data-md-color-scheme")
iframe_id_list.forEach((id) => {
var ele = document.getElementById(id);
if (ele) {
if (scheme === "slate") {
ele.contentWindow.enable_dark_mode();
} else {
ele.contentWindow.disable_dark_mode();
}
}

window.scheme = document.body.getAttribute("data-md-color-scheme")
const options = {
childList: true,
attributes: true,
characterData: false,
subtree: false,
attributeFilter: ['data-md-color-scheme'],
attributeOldValue: false,
characterDataOldValue: false
};
function color_scheme_callback(mutations) {
for (let mutation of mutations) {
if (mutation.attributeName === "data-md-color-scheme") {
scheme = document.body.getAttribute("data-md-color-scheme")
var iframe_list = document.getElementsByClassName("swagger-ui-iframe")
for(var i = 0; i < iframe_list.length; i++) {
var ele = iframe_list.item(i);
if (ele) {
if (scheme === "slate") {
ele.contentWindow.enable_dark_mode();
} else {
ele.contentWindow.disable_dark_mode();
}
})
}
}
}
}
observer = new MutationObserver(color_scheme_callback);
observer.observe(document.body, options);
</script><script type="text/javascript">const lightbox = GLightbox({"touchNavigation": true, "loop": true});</script></body>
}
observer = new MutationObserver(color_scheme_callback);
observer.observe(document.body, options);
})</script><script>document$.subscribe(() => {
const lightbox = GLightbox({"touchNavigation": true, "loop": true});
})</script></body>
</html>
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
}
const resize_ob = new ResizeObserver(function(entries) {
parent.update_swagger_ui_iframe_height("a71e52cc");
parent.update_swagger_ui_iframe_height("bf664e9f");
});

// start observing for resize
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@
}
}
const resize_ob = new ResizeObserver(function(entries) {
parent.update_swagger_ui_iframe_height("48438df1");
parent.update_swagger_ui_iframe_height("c9ee033c");
});

// start observing for resize
Expand Down
Loading

0 comments on commit c737c0a

Please sign in to comment.