Skip to content

Commit

Permalink
Merge pull request #839 from altro3/udate_ui_scripts
Browse files Browse the repository at this point in the history
Update UI scripts
  • Loading branch information
graemerocher authored Nov 2, 2022
2 parents 27b9767 + e0c19d4 commit 786de00
Show file tree
Hide file tree
Showing 6 changed files with 823 additions and 710 deletions.
24 changes: 21 additions & 3 deletions openapi/src/main/resources/templates/rapidoc/index.html
Original file line number Diff line number Diff line change
@@ -1,14 +1,22 @@
<!doctype html>
<!-- Important: must specify, else rendering will be effected -->
<html>
<html lang="en">
<head>
<title>{{title}}</title>
<!-- Important: The Custom element uses utf8 characters -->
<meta charset='utf-8' />
<meta name='viewport' content='width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes' />
<script src='{{rapidoc.js.url.prefix}}rapidoc-min.js'></script>
<meta name="viewport" content="width=device-width,minimum-scale=1,initial-scale=1,user-scalable=yes">
<script defer="defer" src='{{rapidoc.js.url.prefix}}rapidoc-min.js'></script>
{{rapipdf.script}}
</head>
<script>
window.addEventListener('DOMContentLoaded', (event) => {
const docEl = document.getElementById('rapidoc');
docEl.addEventListener('before-try', (e) => {
e.detail.request.headers.append('AAA-BBB', 'CCC DDDD');
});
});
</script>
<body>
<rapi-doc id='rapidoc' {{rapidoc.attributes}}>{{rapipdf.tag}}</rapi-doc>
<script>
Expand All @@ -26,6 +34,16 @@
}
rapidoc.setAttribute('spec-url', contextPath + '{{specURL}}');
{{rapipdf.specurl}}
document.addEventListener('DOMContentLoaded', (event) => {
let docEl = document.getElementById("rapidoc");

// 2. before-try (Aborts all post calls)
docEl.addEventListener('before-try', (e) => {
if (e.detail.request.method === 'POST') {
e.detail.controller.abort();
}
});
})
</script>
</body>
</html>
1,494 changes: 795 additions & 699 deletions openapi/src/main/resources/templates/rapidoc/res/rapidoc-min.js

Large diffs are not rendered by default.

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

Large diffs are not rendered by default.

0 comments on commit 786de00

Please sign in to comment.