Skip to content

Commit 554c374

Browse files
committed
updated auth example to display with try and no-try
1 parent 6378fc4 commit 554c374

File tree

2 files changed

+36
-28
lines changed

2 files changed

+36
-28
lines changed

docs/examples/auth.html

Lines changed: 19 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,13 @@
66
<script src="./load-rapidoc-and-other-common-scripts.js"></script>
77
</head>
88
<style>
9-
table {
10-
padding: 8px;
9+
td {
10+
padding: 2px 6px;
1111
}
1212
th {
13-
height: 36px;
1413
background-color: rgba(0, 0, 0, 0.2);
15-
text-align: left
16-
}
17-
tr {
18-
height: 28px;
14+
text-align: left;
15+
padding: 10px 6px;
1916
}
2017

2118
</style>
@@ -27,7 +24,19 @@
2724
allow-server-selection = "true"
2825
allow-authentication = "true"
2926
render-style="read"
27+
allow-try="false"
3028
>
29+
30+
<div slot="nav-logo">
31+
<div slot="nav-logo" style="width:100%; display: flex; flex-direction:column;">
32+
<div class="blue" style="text-align: center; padding: 20px 0 12px 0;"> Allow TRY </div>
33+
<div style="display: flex;justify-content: center; margin: 2px 0">
34+
<button class='btn medium' onclick="document.getElementById('thedoc').setAttribute('allow-try', 'true')" >True</button>
35+
<button class='btn medium' onclick="document.getElementById('thedoc').setAttribute('allow-try', 'false')" >False</button>
36+
</div>
37+
</div>
38+
</div>
39+
3140
<div slot='operations-top'>
3241
<div style="font-size:14px; border:0; border-radius:4px; padding:16px; margin:16px 75px">
3342
<h3>Programmatically Applying Security and Setting a API Server</h3>
@@ -39,9 +48,7 @@ <h3>Programmatically Applying Security and Setting a API Server</h3>
3948
RapiDoc provides you with two helper methods which you can use to supply security keys programatically. You can use one of these method based on the security scheme type
4049
</div>
4150
<table class="table" style="border:1px solid #444;width:100%">
42-
<tr> <th style="width:180px; height: 36px;
43-
background-color: rgba(0, 0, 0, 0.2);
44-
text-align: left;">SCHEME-TYPE</th><th>METHOD USED TO UPDATE</th></tr>
51+
<tr> <th style="width:180px;">SCHEME-TYPE</th><th>METHOD USED TO UPDATE</th></tr>
4552
<tr> <td>basic</td><td class="mono">setHttpUserNameAndPassword('http-basic', 'newUserName', 'newPassword')</td></tr>
4653
<tr> <td>other than basic</td><td class="mono" rowspan="3">setApiKey('api_key1', 'newApiToken')</td></tr>
4754
</table>
@@ -92,7 +99,8 @@ <h3>Programmatically Applying Security and Setting a API Server</h3>
9299
</td>
93100
</tr>
94101
<tr>
95-
<td colspan="2"><button class='size btn' style="width:200px; margin:auto" onclick='clearSecurityKeys(event)'>Clear all Keys</button></td>
102+
<td colspan="2" style="text-align: right;">
103+
<button class='size btn' style="display:inline; background-color:IndianRed" onclick='clearSecurityKeys(event)'>Clear All Keys</button></td>
96104
</tr>
97105
</table>
98106
<div style="margin:32px 0 16px 0; color:#777; font-weight:bold">

docs/index.css

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ h1,h2,h3 {
6060
margin-left:12px;
6161
}
6262
.hide-in-mobile { display:none; }
63-
.topbar{
63+
.topbar {
6464
padding: 6px 24px;
6565
}
6666

@@ -111,7 +111,7 @@ h1,h2,h3 {
111111
}
112112
}
113113

114-
.section-text{
114+
.section-text {
115115
background: url('./images/bg-shape1.svg') right top no-repeat;;
116116
}
117117
/*Shrinking for mobile*/
@@ -128,7 +128,7 @@ h1,h2,h3 {
128128
}
129129
}
130130

131-
.banner-content{
131+
.banner-content {
132132
font-weight: 300;
133133
}
134134
.banner-title {
@@ -142,7 +142,7 @@ h1,h2,h3 {
142142
justify-content: center;
143143
}
144144

145-
.logo{display:none}
145+
.logo { display:none }
146146
.code-block{
147147
font-size:12px;
148148
width:320px;
@@ -167,36 +167,36 @@ h1,h2,h3 {
167167
line-height: 40px;
168168
color: #fff;
169169
}
170-
.row{
170+
.row {
171171
display:flex;
172172
flex-direction: row;
173173
width:100%;
174174
justify-content: space-evenly;
175175
}
176-
.col{
176+
.col {
177177
display:flex;
178178
flex-direction: column;
179179
align-items: center;
180180
flex:1;
181181
}
182-
.footer{
182+
.footer {
183183
display:flex;
184184
flex-direction: row;
185185
background-color: #444;
186186
color:#ccc;
187187
}
188188

189-
.footer-item{
189+
.footer-item {
190190
padding: 5px 16px;
191191
}
192-
.footer-item a{
192+
.footer-item a {
193193
color:#ccc;
194194
}
195195

196-
.feature-list{
196+
.feature-list {
197197
text-align: left;
198198
}
199-
.container{
199+
.container {
200200
padding: 40px 64px;
201201
}
202202

@@ -209,29 +209,29 @@ h1,h2,h3 {
209209
min-height:150px;
210210
}
211211

212-
.feature{
212+
.feature {
213213
display:flex;
214214
flex:1;
215215
max-width:320px;
216216
min-width:320px;
217217
margin:0 8px 24px 8px;
218218
}
219219

220-
.feature-icon{
220+
.feature-icon {
221221
min-width:64px;
222222
min-height:64px;
223223
}
224224

225-
.feature-info{
225+
.feature-info {
226226
display:flex;
227227
flex-direction: column;
228228
margin-left:12px;
229229
text-align:left;
230230
font-size:16px;
231231
}
232232

233-
.feature-info .feature-title{ font-size:18px;}
234-
.feature-info .feature-descr{ font-size:14px;}
233+
.feature-info .feature-title{ font-size:18px; }
234+
.feature-info .feature-descr{ font-size:14px; }
235235

236236
.shadow1 {
237237
box-shadow: 0 2px 2px rgba(0,0,0,0.25);
@@ -249,7 +249,7 @@ h1,h2,h3 {
249249
width: 90px;
250250
height: 32px;
251251
padding: 2px;
252-
font-size: 13px;
252+
font-size: 12px;
253253
background-color: #008CBA;
254254
color: #fff;
255255
border: none;

0 commit comments

Comments
 (0)