-
Notifications
You must be signed in to change notification settings - Fork 295
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
refactored all the examples to use a common script loader
- Loading branch information
Showing
113 changed files
with
1,055 additions
and
2,894 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
34 changes: 34 additions & 0 deletions
34
docs/examples-theme/load-rapidoc-and-other-common-scripts.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
(function loadRapidocAndOtherCommonScripts() { | ||
// Google Analytics | ||
const gaScript = document.createElement('script'); | ||
gaScript.async = true; | ||
gaScript.src = 'https://www.googletagmanager.com/gtag/js?id=UA-132775238-1'; | ||
document.head.appendChild(gaScript); | ||
|
||
window.dataLayer = window.dataLayer || []; | ||
function gtag() { | ||
// eslint-disable-next-line prefer-rest-params | ||
window.dataLayer.push(arguments); | ||
} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-132775238-1'); | ||
|
||
// Include common StyleSheet used in all the examples | ||
const linkStylesheet = document.createElement('link'); | ||
linkStylesheet.setAttribute('href', '../index.css'); | ||
linkStylesheet.setAttribute('rel', 'stylesheet'); | ||
document.head.appendChild(linkStylesheet); | ||
|
||
// Load RapiDoc based on Mode (In local host load ) | ||
const isDev = window.location.hostname === 'localhost' || window.location.hostname === '127.0.0.1'; | ||
const script = document.createElement('script'); | ||
script.type = 'module'; | ||
|
||
if (isDev) { | ||
script.src = '../rapidoc-min.js'; | ||
} else { | ||
// In production, use the built file | ||
script.src = '../rapidoc-min.js'; | ||
} | ||
document.head.appendChild(script); | ||
}()); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,19 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src="https://www.googletagmanager.com/gtag/js?id=UA-132775238-1"></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-132775238-1'); | ||
</script> | ||
|
||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"> | ||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600&family=Roboto+Mono&display=swap" rel="stylesheet"> | ||
<script type="text/javascript" src="../rapidoc-min.js"></script> | ||
<script src="./load-rapidoc-and-other-common-scripts.js"></script> | ||
</head> | ||
<body> | ||
<rapi-doc spec-url="../specs/additional-props.yaml" | ||
allow-authentication = "false" | ||
show-info = "false" | ||
<rapi-doc spec-url="../specs/additional-props.yaml" | ||
show-header = "false" | ||
show-info = "false" | ||
allow-server-selection = "false" | ||
allow-authentication = "false" | ||
default-schema-tab = "schema" | ||
render-style = "read" | ||
allow-try = "false" | ||
regular-font = 'Open Sans' | ||
mono-font = "Roboto Mono" | ||
> </rapi-doc> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src='https://www.googletagmanager.com/gtag/js?id=UA-132775238-1'></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-132775238-1'); | ||
</script> | ||
<meta charset='utf-8'> | ||
<meta name='viewport' content='width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes'> | ||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600&family=Roboto+Mono&display=swap" rel="stylesheet"> | ||
<script type='text/javascript' src='../rapidoc-min.js'></script> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"> | ||
<script src="./load-rapidoc-and-other-common-scripts.js"></script> | ||
</head> | ||
<body> | ||
<rapi-doc spec-url="../specs/allof.yaml" | ||
allow-authentication = "false" | ||
allow-server-selection = "false" | ||
show-header = "false" | ||
show-info = "false" | ||
allow-server-selection = "false" | ||
allow-authentication = "false" | ||
default-schema-tab = "schema" | ||
render-style = "read" | ||
allow-try = "false" | ||
regular-font = 'Open Sans' | ||
mono-font = "Roboto Mono" | ||
> </rapi-doc> | ||
</body> | ||
</html> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,29 +1,18 @@ | ||
<!doctype html> | ||
<html> | ||
<head> | ||
<!-- Global site tag (gtag.js) - Google Analytics --> | ||
<script async src='https://www.googletagmanager.com/gtag/js?id=UA-132775238-1'></script> | ||
<script> | ||
window.dataLayer = window.dataLayer || []; | ||
function gtag(){dataLayer.push(arguments);} | ||
gtag('js', new Date()); | ||
gtag('config', 'UA-132775238-1'); | ||
</script> | ||
<meta charset='utf-8'> | ||
<meta name='viewport' content='width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes'> | ||
<link href="https://fonts.googleapis.com/css2?family=Open+Sans:wght@300;600&family=Roboto+Mono&display=swap" rel="stylesheet"> | ||
<script type='text/javascript' src='../rapidoc-min.js'></script> | ||
<meta charset="utf-8"> | ||
<meta name="viewport" content="width=device-width, minimum-scale=1, initial-scale=1, user-scalable=yes"> | ||
<script src="./load-rapidoc-and-other-common-scripts.js"></script> | ||
</head> | ||
<body> | ||
<rapi-doc spec-url="../specs/anyof.json" | ||
allow-server-selection = "false" | ||
allow-authentication = "false" | ||
show-info = "false" | ||
show-header = "false" | ||
show-info = "false" | ||
allow-server-selection = "false" | ||
allow-authentication = "false" | ||
default-schema-tab = "schema" | ||
render-style = "read" | ||
allow-try = "false" | ||
regular-font = 'Open Sans' | ||
mono-font = "Roboto Mono" | ||
> </rapi-doc> | ||
</body> | ||
</html> |
Oops, something went wrong.