Jian Li
Committed by Gerrit Code Review

Bump up swagger ui from 2.1.4 to 2.1.5

This commit bumps up swagger ui to 2.1.5 which fixes various bugs
of swagger ui 2.1.4.

Change-Id: I4f8d7f79b88cddada0148a8629e7ef4da9eac3a0
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
82 .swagger-section pre .vhdl .attribute, 82 .swagger-section pre .vhdl .attribute,
83 .swagger-section pre .clojure .attribute, 83 .swagger-section pre .clojure .attribute,
84 .swagger-section pre .coffeescript .property { 84 .swagger-section pre .coffeescript .property {
85 - color: #8888ff; 85 + color: #88F;
86 } 86 }
87 .swagger-section pre .keyword, 87 .swagger-section pre .keyword,
88 .swagger-section pre .id, 88 .swagger-section pre .id,
...@@ -120,9 +120,71 @@ ...@@ -120,9 +120,71 @@
120 .swagger-section pre .xml .cdata { 120 .swagger-section pre .xml .cdata {
121 opacity: 0.5; 121 opacity: 0.5;
122 } 122 }
123 +.swagger-section .hljs {
124 + display: block;
125 + overflow-x: auto;
126 + padding: 0.5em;
127 + background: #F0F0F0;
128 +}
129 +.swagger-section .hljs,
130 +.swagger-section .hljs-subst {
131 + color: #444;
132 +}
133 +.swagger-section .hljs-keyword,
134 +.swagger-section .hljs-attribute,
135 +.swagger-section .hljs-selector-tag,
136 +.swagger-section .hljs-meta-keyword,
137 +.swagger-section .hljs-doctag,
138 +.swagger-section .hljs-name {
139 + font-weight: bold;
140 +}
141 +.swagger-section .hljs-built_in,
142 +.swagger-section .hljs-literal,
143 +.swagger-section .hljs-bullet,
144 +.swagger-section .hljs-code,
145 +.swagger-section .hljs-addition {
146 + color: #1F811F;
147 +}
148 +.swagger-section .hljs-regexp,
149 +.swagger-section .hljs-symbol,
150 +.swagger-section .hljs-variable,
151 +.swagger-section .hljs-template-variable,
152 +.swagger-section .hljs-link,
153 +.swagger-section .hljs-selector-attr,
154 +.swagger-section .hljs-selector-pseudo {
155 + color: #BC6060;
156 +}
157 +.swagger-section .hljs-type,
158 +.swagger-section .hljs-string,
159 +.swagger-section .hljs-number,
160 +.swagger-section .hljs-selector-id,
161 +.swagger-section .hljs-selector-class,
162 +.swagger-section .hljs-quote,
163 +.swagger-section .hljs-template-tag,
164 +.swagger-section .hljs-deletion {
165 + color: #880000;
166 +}
167 +.swagger-section .hljs-title,
168 +.swagger-section .hljs-section {
169 + color: #880000;
170 + font-weight: bold;
171 +}
172 +.swagger-section .hljs-comment {
173 + color: #888888;
174 +}
175 +.swagger-section .hljs-meta {
176 + color: #2B6EA1;
177 +}
178 +.swagger-section .hljs-emphasis {
179 + font-style: italic;
180 +}
181 +.swagger-section .hljs-strong {
182 + font-weight: bold;
183 +}
123 .swagger-section .swagger-ui-wrap { 184 .swagger-section .swagger-ui-wrap {
124 line-height: 1; 185 line-height: 1;
125 font-family: "Droid Sans", sans-serif; 186 font-family: "Droid Sans", sans-serif;
187 + min-width: 760px;
126 max-width: 960px; 188 max-width: 960px;
127 margin-left: auto; 189 margin-left: auto;
128 margin-right: auto; 190 margin-right: auto;
...@@ -365,6 +427,7 @@ ...@@ -365,6 +427,7 @@
365 } 427 }
366 .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { 428 .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
367 display: block; 429 display: block;
430 + min-width: 230px;
368 margin: 0; 431 margin: 0;
369 padding: 0; 432 padding: 0;
370 } 433 }
...@@ -604,6 +667,7 @@ ...@@ -604,6 +667,7 @@
604 } 667 }
605 .swagger-section .swagger-ui-wrap .markdown pre code { 668 .swagger-section .swagger-ui-wrap .markdown pre code {
606 line-height: 1.6em; 669 line-height: 1.6em;
670 + overflow: auto;
607 } 671 }
608 .swagger-section .swagger-ui-wrap div.gist { 672 .swagger-section .swagger-ui-wrap div.gist {
609 margin: 20px 0 25px 0 !important; 673 margin: 20px 0 25px 0 !important;
...@@ -724,6 +788,9 @@ ...@@ -724,6 +788,9 @@
724 color: black; 788 color: black;
725 text-decoration: none; 789 text-decoration: none;
726 } 790 }
791 +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated {
792 + text-decoration: line-through;
793 +}
727 .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { 794 .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
728 text-decoration: underline; 795 text-decoration: underline;
729 } 796 }
...@@ -1115,18 +1182,122 @@ ...@@ -1115,18 +1182,122 @@
1115 } 1182 }
1116 .swagger-section .oauth_submit { 1183 .swagger-section .oauth_submit {
1117 text-align: center; 1184 text-align: center;
1185 + display: inline-block;
1186 +}
1187 +.swagger-section .authorize-wrapper {
1188 + margin: 15px 0 10px;
1189 +}
1190 +.swagger-section .authorize-wrapper_operation {
1191 + float: right;
1192 +}
1193 +.swagger-section .authorize__btn:hover {
1194 + text-decoration: underline;
1195 + cursor: pointer;
1196 +}
1197 +.swagger-section .authorize__btn_operation:hover .authorize-scopes {
1198 + display: block;
1199 +}
1200 +.swagger-section .authorize-scopes {
1201 + position: absolute;
1202 + margin-top: 20px;
1203 + background: #FFF;
1204 + border: 1px solid #ccc;
1205 + border-radius: 5px;
1206 + display: none;
1207 + font-size: 13px;
1208 + max-width: 300px;
1209 + line-height: 30px;
1210 + color: black;
1211 + padding: 5px;
1212 +}
1213 +.swagger-section .authorize-scopes .authorize__scope {
1214 + text-decoration: none;
1215 +}
1216 +.swagger-section .authorize__btn_operation {
1217 + height: 18px;
1218 + vertical-align: middle;
1219 + display: inline-block;
1220 + background: url(../images/explorer_icons.png) no-repeat;
1221 +}
1222 +.swagger-section .authorize__btn_operation_login {
1223 + background-position: 0 0;
1224 + width: 18px;
1225 + margin-top: -6px;
1226 + margin-left: 4px;
1227 +}
1228 +.swagger-section .authorize__btn_operation_logout {
1229 + background-position: -30px 0;
1230 + width: 18px;
1231 + margin-top: -6px;
1232 + margin-left: 4px;
1233 +}
1234 +.swagger-section #auth_container {
1235 + color: #fff;
1236 + display: inline-block;
1237 + border: none;
1238 + padding: 5px;
1239 + width: 87px;
1240 + height: 13px;
1241 +}
1242 +.swagger-section #auth_container .authorize__btn {
1243 + color: #fff;
1244 +}
1245 +.swagger-section .auth_container {
1246 + padding: 0 0 10px;
1247 + margin-bottom: 5px;
1248 + border-bottom: solid 1px #CCC;
1249 + font-size: 0.9em;
1250 +}
1251 +.swagger-section .auth_container .auth__title {
1252 + color: #547f00;
1253 + font-size: 1.2em;
1254 +}
1255 +.swagger-section .auth_container .basic_auth__label {
1256 + display: inline-block;
1257 + width: 60px;
1258 +}
1259 +.swagger-section .auth_container .auth__description {
1260 + color: #999999;
1261 + margin-bottom: 5px;
1262 +}
1263 +.swagger-section .auth_container .auth__button {
1264 + margin-top: 10px;
1265 + height: 30px;
1266 +}
1267 +.swagger-section .auth_container .key_auth__field {
1268 + margin: 5px 0;
1269 +}
1270 +.swagger-section .auth_container .key_auth__label {
1271 + display: inline-block;
1272 + width: 60px;
1118 } 1273 }
1119 .swagger-section .api-popup-dialog { 1274 .swagger-section .api-popup-dialog {
1120 - z-index: 10000;
1121 position: absolute; 1275 position: absolute;
1276 + display: none;
1277 +}
1278 +.swagger-section .api-popup-dialog-wrapper {
1279 + z-index: 1000;
1122 width: 500px; 1280 width: 500px;
1123 background: #FFF; 1281 background: #FFF;
1124 padding: 20px; 1282 padding: 20px;
1125 border: 1px solid #ccc; 1283 border: 1px solid #ccc;
1126 border-radius: 5px; 1284 border-radius: 5px;
1127 - display: none;
1128 font-size: 13px; 1285 font-size: 13px;
1129 color: #777; 1286 color: #777;
1287 + position: fixed;
1288 + top: 50%;
1289 + left: 50%;
1290 + transform: translate(-50%, -50%);
1291 +}
1292 +.swagger-section .api-popup-dialog-shadow {
1293 + position: fixed;
1294 + top: 0;
1295 + left: 0;
1296 + width: 100%;
1297 + height: 100%;
1298 + opacity: 0.2;
1299 + background-color: gray;
1300 + z-index: 900;
1130 } 1301 }
1131 .swagger-section .api-popup-dialog .api-popup-title { 1302 .swagger-section .api-popup-dialog .api-popup-title {
1132 font-size: 24px; 1303 font-size: 24px;
...@@ -1140,6 +1311,10 @@ ...@@ -1140,6 +1311,10 @@
1140 padding-left: 5px; 1311 padding-left: 5px;
1141 padding-bottom: 5px; 1312 padding-bottom: 5px;
1142 } 1313 }
1314 +.swagger-section .api-popup-dialog .api-popup-content {
1315 + max-height: 500px;
1316 + overflow-y: auto;
1317 +}
1143 .swagger-section .api-popup-dialog .api-popup-authbtn { 1318 .swagger-section .api-popup-dialog .api-popup-authbtn {
1144 height: 30px; 1319 height: 30px;
1145 } 1320 }
......
...@@ -82,7 +82,7 @@ ...@@ -82,7 +82,7 @@
82 .swagger-section pre .vhdl .attribute, 82 .swagger-section pre .vhdl .attribute,
83 .swagger-section pre .clojure .attribute, 83 .swagger-section pre .clojure .attribute,
84 .swagger-section pre .coffeescript .property { 84 .swagger-section pre .coffeescript .property {
85 - color: #8888ff; 85 + color: #88F;
86 } 86 }
87 .swagger-section pre .keyword, 87 .swagger-section pre .keyword,
88 .swagger-section pre .id, 88 .swagger-section pre .id,
...@@ -120,9 +120,71 @@ ...@@ -120,9 +120,71 @@
120 .swagger-section pre .xml .cdata { 120 .swagger-section pre .xml .cdata {
121 opacity: 0.5; 121 opacity: 0.5;
122 } 122 }
123 +.swagger-section .hljs {
124 + display: block;
125 + overflow-x: auto;
126 + padding: 0.5em;
127 + background: #F0F0F0;
128 +}
129 +.swagger-section .hljs,
130 +.swagger-section .hljs-subst {
131 + color: #444;
132 +}
133 +.swagger-section .hljs-keyword,
134 +.swagger-section .hljs-attribute,
135 +.swagger-section .hljs-selector-tag,
136 +.swagger-section .hljs-meta-keyword,
137 +.swagger-section .hljs-doctag,
138 +.swagger-section .hljs-name {
139 + font-weight: bold;
140 +}
141 +.swagger-section .hljs-built_in,
142 +.swagger-section .hljs-literal,
143 +.swagger-section .hljs-bullet,
144 +.swagger-section .hljs-code,
145 +.swagger-section .hljs-addition {
146 + color: #1F811F;
147 +}
148 +.swagger-section .hljs-regexp,
149 +.swagger-section .hljs-symbol,
150 +.swagger-section .hljs-variable,
151 +.swagger-section .hljs-template-variable,
152 +.swagger-section .hljs-link,
153 +.swagger-section .hljs-selector-attr,
154 +.swagger-section .hljs-selector-pseudo {
155 + color: #BC6060;
156 +}
157 +.swagger-section .hljs-type,
158 +.swagger-section .hljs-string,
159 +.swagger-section .hljs-number,
160 +.swagger-section .hljs-selector-id,
161 +.swagger-section .hljs-selector-class,
162 +.swagger-section .hljs-quote,
163 +.swagger-section .hljs-template-tag,
164 +.swagger-section .hljs-deletion {
165 + color: #880000;
166 +}
167 +.swagger-section .hljs-title,
168 +.swagger-section .hljs-section {
169 + color: #880000;
170 + font-weight: bold;
171 +}
172 +.swagger-section .hljs-comment {
173 + color: #888888;
174 +}
175 +.swagger-section .hljs-meta {
176 + color: #2B6EA1;
177 +}
178 +.swagger-section .hljs-emphasis {
179 + font-style: italic;
180 +}
181 +.swagger-section .hljs-strong {
182 + font-weight: bold;
183 +}
123 .swagger-section .swagger-ui-wrap { 184 .swagger-section .swagger-ui-wrap {
124 line-height: 1; 185 line-height: 1;
125 font-family: Helvetica, Arial, sans-serif; 186 font-family: Helvetica, Arial, sans-serif;
187 + min-width: 760px;
126 max-width: 960px; 188 max-width: 960px;
127 margin-left: auto; 189 margin-left: auto;
128 margin-right: auto; 190 margin-right: auto;
...@@ -365,6 +427,7 @@ ...@@ -365,6 +427,7 @@
365 } 427 }
366 .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav { 428 .swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
367 display: block; 429 display: block;
430 + min-width: 230px;
368 margin: 0; 431 margin: 0;
369 padding: 0; 432 padding: 0;
370 } 433 }
...@@ -604,6 +667,7 @@ ...@@ -604,6 +667,7 @@
604 } 667 }
605 .swagger-section .swagger-ui-wrap .markdown pre code { 668 .swagger-section .swagger-ui-wrap .markdown pre code {
606 line-height: 1.6em; 669 line-height: 1.6em;
670 + overflow: auto;
607 } 671 }
608 .swagger-section .swagger-ui-wrap div.gist { 672 .swagger-section .swagger-ui-wrap div.gist {
609 margin: 20px 0 25px 0 !important; 673 margin: 20px 0 25px 0 !important;
...@@ -724,6 +788,9 @@ ...@@ -724,6 +788,9 @@
724 color: black; 788 color: black;
725 text-decoration: none; 789 text-decoration: none;
726 } 790 }
791 +.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a.toggleOperation.deprecated {
792 + text-decoration: line-through;
793 +}
727 .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover { 794 .swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
728 text-decoration: underline; 795 text-decoration: underline;
729 } 796 }
...@@ -1115,18 +1182,122 @@ ...@@ -1115,18 +1182,122 @@
1115 } 1182 }
1116 .swagger-section .oauth_submit { 1183 .swagger-section .oauth_submit {
1117 text-align: center; 1184 text-align: center;
1185 + display: inline-block;
1186 +}
1187 +.swagger-section .authorize-wrapper {
1188 + margin: 15px 0 10px;
1189 +}
1190 +.swagger-section .authorize-wrapper_operation {
1191 + float: right;
1192 +}
1193 +.swagger-section .authorize__btn:hover {
1194 + text-decoration: underline;
1195 + cursor: pointer;
1196 +}
1197 +.swagger-section .authorize__btn_operation:hover .authorize-scopes {
1198 + display: block;
1199 +}
1200 +.swagger-section .authorize-scopes {
1201 + position: absolute;
1202 + margin-top: 20px;
1203 + background: #FFF;
1204 + border: 1px solid #ccc;
1205 + border-radius: 5px;
1206 + display: none;
1207 + font-size: 13px;
1208 + max-width: 300px;
1209 + line-height: 30px;
1210 + color: black;
1211 + padding: 5px;
1212 +}
1213 +.swagger-section .authorize-scopes .authorize__scope {
1214 + text-decoration: none;
1215 +}
1216 +.swagger-section .authorize__btn_operation {
1217 + height: 18px;
1218 + vertical-align: middle;
1219 + display: inline-block;
1220 + background: url(../images/explorer_icons.png) no-repeat;
1221 +}
1222 +.swagger-section .authorize__btn_operation_login {
1223 + background-position: 0 0;
1224 + width: 18px;
1225 + margin-top: -6px;
1226 + margin-left: 4px;
1227 +}
1228 +.swagger-section .authorize__btn_operation_logout {
1229 + background-position: -30px 0;
1230 + width: 18px;
1231 + margin-top: -6px;
1232 + margin-left: 4px;
1233 +}
1234 +.swagger-section #auth_container {
1235 + color: #fff;
1236 + display: inline-block;
1237 + border: none;
1238 + padding: 5px;
1239 + width: 87px;
1240 + height: 13px;
1241 +}
1242 +.swagger-section #auth_container .authorize__btn {
1243 + color: #fff;
1244 +}
1245 +.swagger-section .auth_container {
1246 + padding: 0 0 10px;
1247 + margin-bottom: 5px;
1248 + border-bottom: solid 1px #CCC;
1249 + font-size: 0.9em;
1250 +}
1251 +.swagger-section .auth_container .auth__title {
1252 + color: #547f00;
1253 + font-size: 1.2em;
1254 +}
1255 +.swagger-section .auth_container .basic_auth__label {
1256 + display: inline-block;
1257 + width: 60px;
1258 +}
1259 +.swagger-section .auth_container .auth__description {
1260 + color: #999999;
1261 + margin-bottom: 5px;
1262 +}
1263 +.swagger-section .auth_container .auth__button {
1264 + margin-top: 10px;
1265 + height: 30px;
1266 +}
1267 +.swagger-section .auth_container .key_auth__field {
1268 + margin: 5px 0;
1269 +}
1270 +.swagger-section .auth_container .key_auth__label {
1271 + display: inline-block;
1272 + width: 60px;
1118 } 1273 }
1119 .swagger-section .api-popup-dialog { 1274 .swagger-section .api-popup-dialog {
1120 - z-index: 10000;
1121 position: absolute; 1275 position: absolute;
1276 + display: none;
1277 +}
1278 +.swagger-section .api-popup-dialog-wrapper {
1279 + z-index: 1000;
1122 width: 500px; 1280 width: 500px;
1123 background: #FFF; 1281 background: #FFF;
1124 padding: 20px; 1282 padding: 20px;
1125 border: 1px solid #ccc; 1283 border: 1px solid #ccc;
1126 border-radius: 5px; 1284 border-radius: 5px;
1127 - display: none;
1128 font-size: 13px; 1285 font-size: 13px;
1129 color: #777; 1286 color: #777;
1287 + position: fixed;
1288 + top: 50%;
1289 + left: 50%;
1290 + transform: translate(-50%, -50%);
1291 +}
1292 +.swagger-section .api-popup-dialog-shadow {
1293 + position: fixed;
1294 + top: 0;
1295 + left: 0;
1296 + width: 100%;
1297 + height: 100%;
1298 + opacity: 0.2;
1299 + background-color: gray;
1300 + z-index: 900;
1130 } 1301 }
1131 .swagger-section .api-popup-dialog .api-popup-title { 1302 .swagger-section .api-popup-dialog .api-popup-title {
1132 font-size: 24px; 1303 font-size: 24px;
...@@ -1140,6 +1311,10 @@ ...@@ -1140,6 +1311,10 @@
1140 padding-left: 5px; 1311 padding-left: 5px;
1141 padding-bottom: 5px; 1312 padding-bottom: 5px;
1142 } 1313 }
1314 +.swagger-section .api-popup-dialog .api-popup-content {
1315 + max-height: 500px;
1316 + overflow-y: auto;
1317 +}
1143 .swagger-section .api-popup-dialog .api-popup-authbtn { 1318 .swagger-section .api-popup-dialog .api-popup-authbtn {
1144 height: 30px; 1319 height: 30px;
1145 } 1320 }
...@@ -1234,6 +1409,7 @@ ...@@ -1234,6 +1409,7 @@
1234 background-color: #bbb; 1409 background-color: #bbb;
1235 box-shadow: 0 2px 8px #777; 1410 box-shadow: 0 2px 8px #777;
1236 padding: 10px; 1411 padding: 10px;
1412 + height: 23px;
1237 } 1413 }
1238 .swagger-section #footer { 1414 .swagger-section #footer {
1239 color: #999; 1415 color: #999;
...@@ -1251,7 +1427,7 @@ ...@@ -1251,7 +1427,7 @@
1251 float: right; 1427 float: right;
1252 } 1428 }
1253 .swagger-section #api_selector .input { 1429 .swagger-section #api_selector .input {
1254 - display: block; 1430 + display: inline-block;
1255 clear: none; 1431 clear: none;
1256 float: left; 1432 float: left;
1257 margin: 0 10px 0 0; 1433 margin: 0 10px 0 0;
...@@ -1266,7 +1442,8 @@ ...@@ -1266,7 +1442,8 @@
1266 border-radius: 3px; 1442 border-radius: 3px;
1267 border: solid 2px #fff; 1443 border: solid 2px #fff;
1268 } 1444 }
1269 -.swagger-section #explore { 1445 +.swagger-section #explore,
1446 +.swagger-section #auth_container .authorize__btn {
1270 display: block; 1447 display: block;
1271 text-decoration: none; 1448 text-decoration: none;
1272 font-weight: bold; 1449 font-weight: bold;
...@@ -1281,19 +1458,27 @@ ...@@ -1281,19 +1458,27 @@
1281 -khtml-border-radius: 4px; 1458 -khtml-border-radius: 4px;
1282 border-radius: 4px; 1459 border-radius: 4px;
1283 } 1460 }
1284 -.swagger-section #explore:hover { 1461 +.swagger-section #explore:hover,
1462 +.swagger-section #auth_container .authorize__btn:hover {
1285 background-color: #CE5650; 1463 background-color: #CE5650;
1286 } 1464 }
1287 .swagger-section #header #logo { 1465 .swagger-section #header #logo {
1288 font-size: 1.6em; 1466 font-size: 1.6em;
1289 font-weight: bold; 1467 font-weight: bold;
1290 text-decoration: none; 1468 text-decoration: none;
1291 - background: transparent url(../images/onos-logo.png) no-repeat left center;
1292 - padding: 20px 0 20px 60px;
1293 color: white; 1469 color: white;
1294 } 1470 }
1471 +.swagger-section #header #logo .logo__img {
1472 + display: block;
1473 + float: left;
1474 + margin-top: 0px;
1475 +}
1476 +.swagger-section #header #logo .logo__title {
1477 + display: inline-block;
1478 + padding: 5px 0 0 10px;
1479 +}
1295 .swagger-section #header form#api_selector #selector { 1480 .swagger-section #header form#api_selector #selector {
1296 - width: 580px; 1481 + width: 700px;
1297 height: 28px; 1482 height: 28px;
1298 overflow: hidden; 1483 overflow: hidden;
1299 } 1484 }
...@@ -1329,3 +1514,7 @@ ...@@ -1329,3 +1514,7 @@
1329 .swagger-section .swagger-expand:before { 1514 .swagger-section .swagger-expand:before {
1330 content: "+"; 1515 content: "+";
1331 } 1516 }
1517 +.swagger-section .error {
1518 + outline-color: #cc0000;
1519 + background-color: #f2dede;
1520 +}
...\ No newline at end of file ...\ No newline at end of file
......
...@@ -10,18 +10,20 @@ ...@@ -10,18 +10,20 @@
10 <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/> 10 <link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
11 <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/> 11 <link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
12 <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/> 12 <link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
13 + <script src='lib/object-assign-pollyfill.js' type='text/javascript'></script>
13 <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script> 14 <script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
14 <script src='lib/jquery.slideto.min.js' type='text/javascript'></script> 15 <script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
15 <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script> 16 <script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
16 <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script> 17 <script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
17 <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script> 18 <script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
18 - <script src='lib/underscore-min.js' type='text/javascript'></script> 19 + <script src='lib/lodash.min.js' type='text/javascript'></script>
19 <script src='lib/backbone-min.js' type='text/javascript'></script> 20 <script src='lib/backbone-min.js' type='text/javascript'></script>
20 <script src='swagger-ui.js' type='text/javascript'></script> 21 <script src='swagger-ui.js' type='text/javascript'></script>
21 - <script src='lib/highlight.7.3.pack.js' type='text/javascript'></script> 22 + <script src='lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
23 + <script src='lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
24 + <script src='lib/jsoneditor.min.js' type='text/javascript'></script>
22 <script src='lib/marked.js' type='text/javascript'></script> 25 <script src='lib/marked.js' type='text/javascript'></script>
23 <script src='lib/swagger-oauth.js' type='text/javascript'></script> 26 <script src='lib/swagger-oauth.js' type='text/javascript'></script>
24 - <script src='lib/jsoneditor.min.js' type='text/javascript'></script>
25 27
26 <script type="text/javascript"> 28 <script type="text/javascript">
27 $(function () { 29 $(function () {
...@@ -31,6 +33,11 @@ ...@@ -31,6 +33,11 @@
31 } else { 33 } else {
32 url = "/onos/v1/docs/apis/onos/v1/swagger.json"; 34 url = "/onos/v1/docs/apis/onos/v1/swagger.json";
33 } 35 }
36 +
37 + hljs.configure({
38 + highlightSizeThreshold: 5000
39 + });
40 +
34 window.swaggerUi = new SwaggerUi({ 41 window.swaggerUi = new SwaggerUi({
35 url: url, 42 url: url,
36 validatorUrl : null, 43 validatorUrl : null,
...@@ -44,38 +51,14 @@ ...@@ -44,38 +51,14 @@
44 appName: "your-app-name" 51 appName: "your-app-name"
45 }); 52 });
46 } 53 }
47 -
48 - $('pre code').each(function(i, e) {
49 - hljs.highlightBlock(e)
50 - });
51 -
52 - addApiKeyAuthorization();
53 }, 54 },
54 onFailure: function(data) { 55 onFailure: function(data) {
55 log("Unable to Load SwaggerUI"); 56 log("Unable to Load SwaggerUI");
56 }, 57 },
57 docExpansion: "none", 58 docExpansion: "none",
58 - apisSorter: "alpha",
59 showRequestHeaders: false 59 showRequestHeaders: false
60 }); 60 });
61 61
62 - function addApiKeyAuthorization(){
63 - var key = encodeURIComponent($('#input_apiKey')[0].value);
64 - if(key && key.trim() != "") {
65 - var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
66 - window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
67 - log("added key " + key);
68 - }
69 - }
70 -
71 - $('#input_apiKey').change(addApiKeyAuthorization);
72 -
73 - // if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
74 - /*
75 - var apiKey = "myApiKeyXXXX123456789";
76 - $('#input_apiKey').val(apiKey);
77 - */
78 -
79 window.swaggerUi.load(); 62 window.swaggerUi.load();
80 63
81 function log() { 64 function log() {
...@@ -95,7 +78,7 @@ ...@@ -95,7 +78,7 @@
95 <body class="swagger-section"> 78 <body class="swagger-section">
96 <div id='header'> 79 <div id='header'>
97 <div class="swagger-ui-wrap"> 80 <div class="swagger-ui-wrap">
98 - <a id="logo" href="#"></a> 81 + <a id="logo" href="#"><img class="logo__img" alt="swagger" height="30" width="36" src="images/onos-logo.png" /></a>
99 <form id='api_selector'> 82 <form id='api_selector'>
100 <div class='input' id='selector'> 83 <div class='input' id='selector'>
101 <select onchange="selectApi()"> 84 <select onchange="selectApi()">
...@@ -107,14 +90,14 @@ ...@@ -107,14 +90,14 @@
107 </select> 90 </select>
108 </div> 91 </div>
109 <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div> 92 <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
110 - <div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div> 93 + <div id='auth_container'></div>
111 - <div class='input'><a id="explore" href="#">Explore</a></div> 94 + <div class='input'><a id="explore" class="header__btn" href="#">Explore</a></div>
112 </form> 95 </form>
113 </div> 96 </div>
114 </div> 97 </div>
115 98
116 <div id="message-bar" class="swagger-ui-wrap">&nbsp;</div> 99 <div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
117 <div id="swagger-ui-container" class="swagger-ui-wrap"></div> 100 <div id="swagger-ui-container" class="swagger-ui-wrap"></div>
118 -<div id="footer" class="swagger-ui-wrap"><a href="http://swagger.io/swagger-ui/">Swagger UI</a> adaptation</div> 101 +<div id="footer" class="swagger-ui-wrap"><a href="http://swagger.io/swagger-ui/">Swagger UI</a> (v2.1.5) adaptation</div>
119 </body> 102 </body>
120 </html> 103 </html>
......
This diff is collapsed. Click to expand it.
1 -var hljs=new function(){function l(o){return o.replace(/&/gm,"&amp;").replace(/</gm,"&lt;").replace(/>/gm,"&gt;")}function b(p){for(var o=p.firstChild;o;o=o.nextSibling){if(o.nodeName=="CODE"){return o}if(!(o.nodeType==3&&o.nodeValue.match(/\s+/))){break}}}function h(p,o){return Array.prototype.map.call(p.childNodes,function(q){if(q.nodeType==3){return o?q.nodeValue.replace(/\n/g,""):q.nodeValue}if(q.nodeName=="BR"){return"\n"}return h(q,o)}).join("")}function a(q){var p=(q.className+" "+q.parentNode.className).split(/\s+/);p=p.map(function(r){return r.replace(/^language-/,"")});for(var o=0;o<p.length;o++){if(e[p[o]]||p[o]=="no-highlight"){return p[o]}}}function c(q){var o=[];(function p(r,s){for(var t=r.firstChild;t;t=t.nextSibling){if(t.nodeType==3){s+=t.nodeValue.length}else{if(t.nodeName=="BR"){s+=1}else{if(t.nodeType==1){o.push({event:"start",offset:s,node:t});s=p(t,s);o.push({event:"stop",offset:s,node:t})}}}}return s})(q,0);return o}function j(x,v,w){var p=0;var y="";var r=[];function t(){if(x.length&&v.length){if(x[0].offset!=v[0].offset){return(x[0].offset<v[0].offset)?x:v}else{return v[0].event=="start"?x:v}}else{return x.length?x:v}}function s(A){function z(B){return" "+B.nodeName+'="'+l(B.value)+'"'}return"<"+A.nodeName+Array.prototype.map.call(A.attributes,z).join("")+">"}while(x.length||v.length){var u=t().splice(0,1)[0];y+=l(w.substr(p,u.offset-p));p=u.offset;if(u.event=="start"){y+=s(u.node);r.push(u.node)}else{if(u.event=="stop"){var o,q=r.length;do{q--;o=r[q];y+=("</"+o.nodeName.toLowerCase()+">")}while(o!=u.node);r.splice(q,1);while(q<r.length){y+=s(r[q]);q++}}}}return y+l(w.substr(p))}function f(q){function o(s,r){return RegExp(s,"m"+(q.cI?"i":"")+(r?"g":""))}function p(y,w){if(y.compiled){return}y.compiled=true;var s=[];if(y.k){var r={};function z(A,t){t.split(" ").forEach(function(B){var C=B.split("|");r[C[0]]=[A,C[1]?Number(C[1]):1];s.push(C[0])})}y.lR=o(y.l||hljs.IR,true);if(typeof y.k=="string"){z("keyword",y.k)}else{for(var x in y.k){if(!y.k.hasOwnProperty(x)){continue}z(x,y.k[x])}}y.k=r}if(w){if(y.bWK){y.b="\\b("+s.join("|")+")\\s"}y.bR=o(y.b?y.b:"\\B|\\b");if(!y.e&&!y.eW){y.e="\\B|\\b"}if(y.e){y.eR=o(y.e)}y.tE=y.e||"";if(y.eW&&w.tE){y.tE+=(y.e?"|":"")+w.tE}}if(y.i){y.iR=o(y.i)}if(y.r===undefined){y.r=1}if(!y.c){y.c=[]}for(var v=0;v<y.c.length;v++){if(y.c[v]=="self"){y.c[v]=y}p(y.c[v],y)}if(y.starts){p(y.starts,w)}var u=[];for(var v=0;v<y.c.length;v++){u.push(y.c[v].b)}if(y.tE){u.push(y.tE)}if(y.i){u.push(y.i)}y.t=u.length?o(u.join("|"),true):{exec:function(t){return null}}}p(q)}function d(D,E){function o(r,M){for(var L=0;L<M.c.length;L++){var K=M.c[L].bR.exec(r);if(K&&K.index==0){return M.c[L]}}}function s(K,r){if(K.e&&K.eR.test(r)){return K}if(K.eW){return s(K.parent,r)}}function t(r,K){return K.i&&K.iR.test(r)}function y(L,r){var K=F.cI?r[0].toLowerCase():r[0];return L.k.hasOwnProperty(K)&&L.k[K]}function G(){var K=l(w);if(!A.k){return K}var r="";var N=0;A.lR.lastIndex=0;var L=A.lR.exec(K);while(L){r+=K.substr(N,L.index-N);var M=y(A,L);if(M){v+=M[1];r+='<span class="'+M[0]+'">'+L[0]+"</span>"}else{r+=L[0]}N=A.lR.lastIndex;L=A.lR.exec(K)}return r+K.substr(N)}function z(){if(A.sL&&!e[A.sL]){return l(w)}var r=A.sL?d(A.sL,w):g(w);if(A.r>0){v+=r.keyword_count;B+=r.r}return'<span class="'+r.language+'">'+r.value+"</span>"}function J(){return A.sL!==undefined?z():G()}function I(L,r){var K=L.cN?'<span class="'+L.cN+'">':"";if(L.rB){x+=K;w=""}else{if(L.eB){x+=l(r)+K;w=""}else{x+=K;w=r}}A=Object.create(L,{parent:{value:A}});B+=L.r}function C(K,r){w+=K;if(r===undefined){x+=J();return 0}var L=o(r,A);if(L){x+=J();I(L,r);return L.rB?0:r.length}var M=s(A,r);if(M){if(!(M.rE||M.eE)){w+=r}x+=J();do{if(A.cN){x+="</span>"}A=A.parent}while(A!=M.parent);if(M.eE){x+=l(r)}w="";if(M.starts){I(M.starts,"")}return M.rE?0:r.length}if(t(r,A)){throw"Illegal"}w+=r;return r.length||1}var F=e[D];f(F);var A=F;var w="";var B=0;var v=0;var x="";try{var u,q,p=0;while(true){A.t.lastIndex=p;u=A.t.exec(E);if(!u){break}q=C(E.substr(p,u.index-p),u[0]);p=u.index+q}C(E.substr(p));return{r:B,keyword_count:v,value:x,language:D}}catch(H){if(H=="Illegal"){return{r:0,keyword_count:0,value:l(E)}}else{throw H}}}function g(s){var o={keyword_count:0,r:0,value:l(s)};var q=o;for(var p in e){if(!e.hasOwnProperty(p)){continue}var r=d(p,s);r.language=p;if(r.keyword_count+r.r>q.keyword_count+q.r){q=r}if(r.keyword_count+r.r>o.keyword_count+o.r){q=o;o=r}}if(q.language){o.second_best=q}return o}function i(q,p,o){if(p){q=q.replace(/^((<[^>]+>|\t)+)/gm,function(r,v,u,t){return v.replace(/\t/g,p)})}if(o){q=q.replace(/\n/g,"<br>")}return q}function m(r,u,p){var v=h(r,p);var t=a(r);if(t=="no-highlight"){return}var w=t?d(t,v):g(v);t=w.language;var o=c(r);if(o.length){var q=document.createElement("pre");q.innerHTML=w.value;w.value=j(o,c(q),v)}w.value=i(w.value,u,p);var s=r.className;if(!s.match("(\\s|^)(language-)?"+t+"(\\s|$)")){s=s?(s+" "+t):t}r.innerHTML=w.value;r.className=s;r.result={language:t,kw:w.keyword_count,re:w.r};if(w.second_best){r.second_best={language:w.second_best.language,kw:w.second_best.keyword_count,re:w.second_best.r}}}function n(){if(n.called){return}n.called=true;Array.prototype.map.call(document.getElementsByTagName("pre"),b).filter(Boolean).forEach(function(o){m(o,hljs.tabReplace)})}function k(){window.addEventListener("DOMContentLoaded",n,false);window.addEventListener("load",n,false)}var e={};this.LANGUAGES=e;this.highlight=d;this.highlightAuto=g;this.fixMarkup=i;this.highlightBlock=m;this.initHighlighting=n;this.initHighlightingOnLoad=k;this.IR="[a-zA-Z][a-zA-Z0-9_]*";this.UIR="[a-zA-Z_][a-zA-Z0-9_]*";this.NR="\\b\\d+(\\.\\d+)?";this.CNR="(\\b0[xX][a-fA-F0-9]+|(\\b\\d+(\\.\\d*)?|\\.\\d+)([eE][-+]?\\d+)?)";this.BNR="\\b(0b[01]+)";this.RSR="!|!=|!==|%|%=|&|&&|&=|\\*|\\*=|\\+|\\+=|,|\\.|-|-=|/|/=|:|;|<|<<|<<=|<=|=|==|===|>|>=|>>|>>=|>>>|>>>=|\\?|\\[|\\{|\\(|\\^|\\^=|\\||\\|=|\\|\\||~";this.BE={b:"\\\\[\\s\\S]",r:0};this.ASM={cN:"string",b:"'",e:"'",i:"\\n",c:[this.BE],r:0};this.QSM={cN:"string",b:'"',e:'"',i:"\\n",c:[this.BE],r:0};this.CLCM={cN:"comment",b:"//",e:"$"};this.CBLCLM={cN:"comment",b:"/\\*",e:"\\*/"};this.HCM={cN:"comment",b:"#",e:"$"};this.NM={cN:"number",b:this.NR,r:0};this.CNM={cN:"number",b:this.CNR,r:0};this.BNM={cN:"number",b:this.BNR,r:0};this.inherit=function(q,r){var o={};for(var p in q){o[p]=q[p]}if(r){for(var p in r){o[p]=r[p]}}return o}}();hljs.LANGUAGES.xml=function(a){var c="[A-Za-z0-9\\._:-]+";var b={eW:true,c:[{cN:"attribute",b:c,r:0},{b:'="',rB:true,e:'"',c:[{cN:"value",b:'"',eW:true}]},{b:"='",rB:true,e:"'",c:[{cN:"value",b:"'",eW:true}]},{b:"=",c:[{cN:"value",b:"[^\\s/>]+"}]}]};return{cI:true,c:[{cN:"pi",b:"<\\?",e:"\\?>",r:10},{cN:"doctype",b:"<!DOCTYPE",e:">",r:10,c:[{b:"\\[",e:"\\]"}]},{cN:"comment",b:"<!--",e:"-->",r:10},{cN:"cdata",b:"<\\!\\[CDATA\\[",e:"\\]\\]>",r:10},{cN:"tag",b:"<style(?=\\s|>|$)",e:">",k:{title:"style"},c:[b],starts:{e:"</style>",rE:true,sL:"css"}},{cN:"tag",b:"<script(?=\\s|>|$)",e:">",k:{title:"script"},c:[b],starts:{e:"<\/script>",rE:true,sL:"javascript"}},{b:"<%",e:"%>",sL:"vbscript"},{cN:"tag",b:"</?",e:"/?>",c:[{cN:"title",b:"[^ />]+"},b]}]}}(hljs);hljs.LANGUAGES.json=function(a){var e={literal:"true false null"};var d=[a.QSM,a.CNM];var c={cN:"value",e:",",eW:true,eE:true,c:d,k:e};var b={b:"{",e:"}",c:[{cN:"attribute",b:'\\s*"',e:'"\\s*:\\s*',eB:true,eE:true,c:[a.BE],i:"\\n",starts:c}],i:"\\S"};var f={b:"\\[",e:"\\]",c:[a.inherit(c,{cN:null})],i:"\\S"};d.splice(d.length,0,b,f);return{c:d,k:e,i:"\\S"}}(hljs);
...\ No newline at end of file ...\ No newline at end of file
This diff is collapsed. Click to expand it.
1 +'use strict';
2 +
3 +(function () {
4 + var configure, highlightBlock;
5 +
6 + configure = hljs.configure;
7 + // "extending" hljs.configure method
8 + hljs.configure = function _configure (options) {
9 + var size = options.highlightSizeThreshold;
10 +
11 + // added highlightSizeThreshold option to set maximum size
12 + // of processed string. Set to null if not a number
13 + hljs.highlightSizeThreshold = size === +size ? size : null;
14 +
15 + configure.call(this, options);
16 + };
17 +
18 + highlightBlock = hljs.highlightBlock;
19 +
20 + // "extending" hljs.highlightBlock method
21 + hljs.highlightBlock = function _highlightBlock (el) {
22 + var innerHTML = el.innerHTML;
23 + var size = hljs.highlightSizeThreshold;
24 +
25 + // check if highlightSizeThreshold is not set or element innerHTML
26 + // is less than set option highlightSizeThreshold
27 + if (size == null || size > innerHTML.length) {
28 + // proceed with hljs.highlightBlock
29 + highlightBlock.call(hljs, el);
30 + }
31 + };
32 +
33 +})();
34 +
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
1 +if (typeof Object.assign != 'function') {
2 + (function () {
3 + Object.assign = function (target) {
4 + 'use strict';
5 + if (target === undefined || target === null) {
6 + throw new TypeError('Cannot convert undefined or null to object');
7 + }
8 +
9 + var output = Object(target);
10 + for (var index = 1; index < arguments.length; index++) {
11 + var source = arguments[index];
12 + if (source !== undefined && source !== null) {
13 + for (var nextKey in source) {
14 + if (Object.prototype.hasOwnProperty.call(source, nextKey)) {
15 + output[nextKey] = source[nextKey];
16 + }
17 + }
18 + }
19 + }
20 + return output;
21 + };
22 + })();
23 +}
...@@ -250,11 +250,19 @@ function clientCredentialsFlow(scopes, tokenUrl, OAuthSchemeKey) { ...@@ -250,11 +250,19 @@ function clientCredentialsFlow(scopes, tokenUrl, OAuthSchemeKey) {
250 250
251 window.processOAuthCode = function processOAuthCode(data) { 251 window.processOAuthCode = function processOAuthCode(data) {
252 var OAuthSchemeKey = data.state; 252 var OAuthSchemeKey = data.state;
253 +
254 + // redirect_uri is required in auth code flow
255 + // see https://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-4.1.3
256 + var host = window.location;
257 + var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
258 + var defaultRedirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
259 + var redirectUrl = window.oAuthRedirectUrl || defaultRedirectUrl;
260 +
253 var params = { 261 var params = {
254 'client_id': clientId, 262 'client_id': clientId,
255 'code': data.code, 263 'code': data.code,
256 'grant_type': 'authorization_code', 264 'grant_type': 'authorization_code',
257 - 'redirect_uri': redirect_uri 265 + 'redirect_uri': redirectUrl
258 }; 266 };
259 267
260 if (clientSecret) { 268 if (clientSecret) {
...@@ -331,7 +339,8 @@ window.onOAuthComplete = function onOAuthComplete(token,OAuthSchemeKey) { ...@@ -331,7 +339,8 @@ window.onOAuthComplete = function onOAuthComplete(token,OAuthSchemeKey) {
331 } 339 }
332 } 340 }
333 }); 341 });
334 - window.swaggerUi.api.clientAuthorizations.add(OAuthSchemeKey, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header')); 342 + window.swaggerUi.api.clientAuthorizations.add(window.OAuthSchemeKey, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
343 + window.swaggerUi.load();
335 } 344 }
336 } 345 }
337 } 346 }
......
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
This diff could not be displayed because it is too large.