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 @@
.swagger-section pre .vhdl .attribute,
.swagger-section pre .clojure .attribute,
.swagger-section pre .coffeescript .property {
color: #8888ff;
color: #88F;
}
.swagger-section pre .keyword,
.swagger-section pre .id,
......@@ -120,9 +120,71 @@
.swagger-section pre .xml .cdata {
opacity: 0.5;
}
.swagger-section .hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #F0F0F0;
}
.swagger-section .hljs,
.swagger-section .hljs-subst {
color: #444;
}
.swagger-section .hljs-keyword,
.swagger-section .hljs-attribute,
.swagger-section .hljs-selector-tag,
.swagger-section .hljs-meta-keyword,
.swagger-section .hljs-doctag,
.swagger-section .hljs-name {
font-weight: bold;
}
.swagger-section .hljs-built_in,
.swagger-section .hljs-literal,
.swagger-section .hljs-bullet,
.swagger-section .hljs-code,
.swagger-section .hljs-addition {
color: #1F811F;
}
.swagger-section .hljs-regexp,
.swagger-section .hljs-symbol,
.swagger-section .hljs-variable,
.swagger-section .hljs-template-variable,
.swagger-section .hljs-link,
.swagger-section .hljs-selector-attr,
.swagger-section .hljs-selector-pseudo {
color: #BC6060;
}
.swagger-section .hljs-type,
.swagger-section .hljs-string,
.swagger-section .hljs-number,
.swagger-section .hljs-selector-id,
.swagger-section .hljs-selector-class,
.swagger-section .hljs-quote,
.swagger-section .hljs-template-tag,
.swagger-section .hljs-deletion {
color: #880000;
}
.swagger-section .hljs-title,
.swagger-section .hljs-section {
color: #880000;
font-weight: bold;
}
.swagger-section .hljs-comment {
color: #888888;
}
.swagger-section .hljs-meta {
color: #2B6EA1;
}
.swagger-section .hljs-emphasis {
font-style: italic;
}
.swagger-section .hljs-strong {
font-weight: bold;
}
.swagger-section .swagger-ui-wrap {
line-height: 1;
font-family: "Droid Sans", sans-serif;
min-width: 760px;
max-width: 960px;
margin-left: auto;
margin-right: auto;
......@@ -365,6 +427,7 @@
}
.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
display: block;
min-width: 230px;
margin: 0;
padding: 0;
}
......@@ -604,6 +667,7 @@
}
.swagger-section .swagger-ui-wrap .markdown pre code {
line-height: 1.6em;
overflow: auto;
}
.swagger-section .swagger-ui-wrap div.gist {
margin: 20px 0 25px 0 !important;
......@@ -724,6 +788,9 @@
color: black;
text-decoration: none;
}
.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 {
text-decoration: line-through;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
text-decoration: underline;
}
......@@ -1115,18 +1182,122 @@
}
.swagger-section .oauth_submit {
text-align: center;
display: inline-block;
}
.swagger-section .authorize-wrapper {
margin: 15px 0 10px;
}
.swagger-section .authorize-wrapper_operation {
float: right;
}
.swagger-section .authorize__btn:hover {
text-decoration: underline;
cursor: pointer;
}
.swagger-section .authorize__btn_operation:hover .authorize-scopes {
display: block;
}
.swagger-section .authorize-scopes {
position: absolute;
margin-top: 20px;
background: #FFF;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
max-width: 300px;
line-height: 30px;
color: black;
padding: 5px;
}
.swagger-section .authorize-scopes .authorize__scope {
text-decoration: none;
}
.swagger-section .authorize__btn_operation {
height: 18px;
vertical-align: middle;
display: inline-block;
background: url(../images/explorer_icons.png) no-repeat;
}
.swagger-section .authorize__btn_operation_login {
background-position: 0 0;
width: 18px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section .authorize__btn_operation_logout {
background-position: -30px 0;
width: 18px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section #auth_container {
color: #fff;
display: inline-block;
border: none;
padding: 5px;
width: 87px;
height: 13px;
}
.swagger-section #auth_container .authorize__btn {
color: #fff;
}
.swagger-section .auth_container {
padding: 0 0 10px;
margin-bottom: 5px;
border-bottom: solid 1px #CCC;
font-size: 0.9em;
}
.swagger-section .auth_container .auth__title {
color: #547f00;
font-size: 1.2em;
}
.swagger-section .auth_container .basic_auth__label {
display: inline-block;
width: 60px;
}
.swagger-section .auth_container .auth__description {
color: #999999;
margin-bottom: 5px;
}
.swagger-section .auth_container .auth__button {
margin-top: 10px;
height: 30px;
}
.swagger-section .auth_container .key_auth__field {
margin: 5px 0;
}
.swagger-section .auth_container .key_auth__label {
display: inline-block;
width: 60px;
}
.swagger-section .api-popup-dialog {
z-index: 10000;
position: absolute;
display: none;
}
.swagger-section .api-popup-dialog-wrapper {
z-index: 1000;
width: 500px;
background: #FFF;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
color: #777;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.swagger-section .api-popup-dialog-shadow {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.2;
background-color: gray;
z-index: 900;
}
.swagger-section .api-popup-dialog .api-popup-title {
font-size: 24px;
......@@ -1140,6 +1311,10 @@
padding-left: 5px;
padding-bottom: 5px;
}
.swagger-section .api-popup-dialog .api-popup-content {
max-height: 500px;
overflow-y: auto;
}
.swagger-section .api-popup-dialog .api-popup-authbtn {
height: 30px;
}
......
......@@ -82,7 +82,7 @@
.swagger-section pre .vhdl .attribute,
.swagger-section pre .clojure .attribute,
.swagger-section pre .coffeescript .property {
color: #8888ff;
color: #88F;
}
.swagger-section pre .keyword,
.swagger-section pre .id,
......@@ -120,9 +120,71 @@
.swagger-section pre .xml .cdata {
opacity: 0.5;
}
.swagger-section .hljs {
display: block;
overflow-x: auto;
padding: 0.5em;
background: #F0F0F0;
}
.swagger-section .hljs,
.swagger-section .hljs-subst {
color: #444;
}
.swagger-section .hljs-keyword,
.swagger-section .hljs-attribute,
.swagger-section .hljs-selector-tag,
.swagger-section .hljs-meta-keyword,
.swagger-section .hljs-doctag,
.swagger-section .hljs-name {
font-weight: bold;
}
.swagger-section .hljs-built_in,
.swagger-section .hljs-literal,
.swagger-section .hljs-bullet,
.swagger-section .hljs-code,
.swagger-section .hljs-addition {
color: #1F811F;
}
.swagger-section .hljs-regexp,
.swagger-section .hljs-symbol,
.swagger-section .hljs-variable,
.swagger-section .hljs-template-variable,
.swagger-section .hljs-link,
.swagger-section .hljs-selector-attr,
.swagger-section .hljs-selector-pseudo {
color: #BC6060;
}
.swagger-section .hljs-type,
.swagger-section .hljs-string,
.swagger-section .hljs-number,
.swagger-section .hljs-selector-id,
.swagger-section .hljs-selector-class,
.swagger-section .hljs-quote,
.swagger-section .hljs-template-tag,
.swagger-section .hljs-deletion {
color: #880000;
}
.swagger-section .hljs-title,
.swagger-section .hljs-section {
color: #880000;
font-weight: bold;
}
.swagger-section .hljs-comment {
color: #888888;
}
.swagger-section .hljs-meta {
color: #2B6EA1;
}
.swagger-section .hljs-emphasis {
font-style: italic;
}
.swagger-section .hljs-strong {
font-weight: bold;
}
.swagger-section .swagger-ui-wrap {
line-height: 1;
font-family: Helvetica, Arial, sans-serif;
min-width: 760px;
max-width: 960px;
margin-left: auto;
margin-right: auto;
......@@ -365,6 +427,7 @@
}
.swagger-section .swagger-ui-wrap .model-signature ul.signature-nav {
display: block;
min-width: 230px;
margin: 0;
padding: 0;
}
......@@ -604,6 +667,7 @@
}
.swagger-section .swagger-ui-wrap .markdown pre code {
line-height: 1.6em;
overflow: auto;
}
.swagger-section .swagger-ui-wrap div.gist {
margin: 20px 0 25px 0 !important;
......@@ -724,6 +788,9 @@
color: black;
text-decoration: none;
}
.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 {
text-decoration: line-through;
}
.swagger-section .swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading h3 span.path a:hover {
text-decoration: underline;
}
......@@ -1115,18 +1182,122 @@
}
.swagger-section .oauth_submit {
text-align: center;
display: inline-block;
}
.swagger-section .authorize-wrapper {
margin: 15px 0 10px;
}
.swagger-section .authorize-wrapper_operation {
float: right;
}
.swagger-section .authorize__btn:hover {
text-decoration: underline;
cursor: pointer;
}
.swagger-section .authorize__btn_operation:hover .authorize-scopes {
display: block;
}
.swagger-section .authorize-scopes {
position: absolute;
margin-top: 20px;
background: #FFF;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
max-width: 300px;
line-height: 30px;
color: black;
padding: 5px;
}
.swagger-section .authorize-scopes .authorize__scope {
text-decoration: none;
}
.swagger-section .authorize__btn_operation {
height: 18px;
vertical-align: middle;
display: inline-block;
background: url(../images/explorer_icons.png) no-repeat;
}
.swagger-section .authorize__btn_operation_login {
background-position: 0 0;
width: 18px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section .authorize__btn_operation_logout {
background-position: -30px 0;
width: 18px;
margin-top: -6px;
margin-left: 4px;
}
.swagger-section #auth_container {
color: #fff;
display: inline-block;
border: none;
padding: 5px;
width: 87px;
height: 13px;
}
.swagger-section #auth_container .authorize__btn {
color: #fff;
}
.swagger-section .auth_container {
padding: 0 0 10px;
margin-bottom: 5px;
border-bottom: solid 1px #CCC;
font-size: 0.9em;
}
.swagger-section .auth_container .auth__title {
color: #547f00;
font-size: 1.2em;
}
.swagger-section .auth_container .basic_auth__label {
display: inline-block;
width: 60px;
}
.swagger-section .auth_container .auth__description {
color: #999999;
margin-bottom: 5px;
}
.swagger-section .auth_container .auth__button {
margin-top: 10px;
height: 30px;
}
.swagger-section .auth_container .key_auth__field {
margin: 5px 0;
}
.swagger-section .auth_container .key_auth__label {
display: inline-block;
width: 60px;
}
.swagger-section .api-popup-dialog {
z-index: 10000;
position: absolute;
display: none;
}
.swagger-section .api-popup-dialog-wrapper {
z-index: 1000;
width: 500px;
background: #FFF;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
color: #777;
position: fixed;
top: 50%;
left: 50%;
transform: translate(-50%, -50%);
}
.swagger-section .api-popup-dialog-shadow {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
opacity: 0.2;
background-color: gray;
z-index: 900;
}
.swagger-section .api-popup-dialog .api-popup-title {
font-size: 24px;
......@@ -1140,6 +1311,10 @@
padding-left: 5px;
padding-bottom: 5px;
}
.swagger-section .api-popup-dialog .api-popup-content {
max-height: 500px;
overflow-y: auto;
}
.swagger-section .api-popup-dialog .api-popup-authbtn {
height: 30px;
}
......@@ -1234,6 +1409,7 @@
background-color: #bbb;
box-shadow: 0 2px 8px #777;
padding: 10px;
height: 23px;
}
.swagger-section #footer {
color: #999;
......@@ -1251,7 +1427,7 @@
float: right;
}
.swagger-section #api_selector .input {
display: block;
display: inline-block;
clear: none;
float: left;
margin: 0 10px 0 0;
......@@ -1266,7 +1442,8 @@
border-radius: 3px;
border: solid 2px #fff;
}
.swagger-section #explore {
.swagger-section #explore,
.swagger-section #auth_container .authorize__btn {
display: block;
text-decoration: none;
font-weight: bold;
......@@ -1281,19 +1458,27 @@
-khtml-border-radius: 4px;
border-radius: 4px;
}
.swagger-section #explore:hover {
.swagger-section #explore:hover,
.swagger-section #auth_container .authorize__btn:hover {
background-color: #CE5650;
}
.swagger-section #header #logo {
font-size: 1.6em;
font-weight: bold;
text-decoration: none;
background: transparent url(../images/onos-logo.png) no-repeat left center;
padding: 20px 0 20px 60px;
color: white;
}
.swagger-section #header #logo .logo__img {
display: block;
float: left;
margin-top: 0px;
}
.swagger-section #header #logo .logo__title {
display: inline-block;
padding: 5px 0 0 10px;
}
.swagger-section #header form#api_selector #selector {
width: 580px;
width: 700px;
height: 28px;
overflow: hidden;
}
......@@ -1329,3 +1514,7 @@
.swagger-section .swagger-expand:before {
content: "+";
}
.swagger-section .error {
outline-color: #cc0000;
background-color: #f2dede;
}
\ No newline at end of file
......
......@@ -10,18 +10,20 @@
<link href='css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='css/reset.css' media='print' rel='stylesheet' type='text/css'/>
<link href='css/print.css' media='print' rel='stylesheet' type='text/css'/>
<script src='lib/object-assign-pollyfill.js' type='text/javascript'></script>
<script src='lib/jquery-1.8.0.min.js' type='text/javascript'></script>
<script src='lib/jquery.slideto.min.js' type='text/javascript'></script>
<script src='lib/jquery.wiggle.min.js' type='text/javascript'></script>
<script src='lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
<script src='lib/handlebars-2.0.0.js' type='text/javascript'></script>
<script src='lib/underscore-min.js' type='text/javascript'></script>
<script src='lib/lodash.min.js' type='text/javascript'></script>
<script src='lib/backbone-min.js' type='text/javascript'></script>
<script src='swagger-ui.js' type='text/javascript'></script>
<script src='lib/highlight.7.3.pack.js' type='text/javascript'></script>
<script src='lib/highlight.9.1.0.pack.js' type='text/javascript'></script>
<script src='lib/highlight.9.1.0.pack_extended.js' type='text/javascript'></script>
<script src='lib/jsoneditor.min.js' type='text/javascript'></script>
<script src='lib/marked.js' type='text/javascript'></script>
<script src='lib/swagger-oauth.js' type='text/javascript'></script>
<script src='lib/jsoneditor.min.js' type='text/javascript'></script>
<script type="text/javascript">
$(function () {
......@@ -31,6 +33,11 @@
} else {
url = "/onos/v1/docs/apis/onos/v1/swagger.json";
}
hljs.configure({
highlightSizeThreshold: 5000
});
window.swaggerUi = new SwaggerUi({
url: url,
validatorUrl : null,
......@@ -44,38 +51,14 @@
appName: "your-app-name"
});
}
$('pre code').each(function(i, e) {
hljs.highlightBlock(e)
});
addApiKeyAuthorization();
},
onFailure: function(data) {
log("Unable to Load SwaggerUI");
},
docExpansion: "none",
apisSorter: "alpha",
showRequestHeaders: false
});
function addApiKeyAuthorization(){
var key = encodeURIComponent($('#input_apiKey')[0].value);
if(key && key.trim() != "") {
var apiKeyAuth = new SwaggerClient.ApiKeyAuthorization("api_key", key, "query");
window.swaggerUi.api.clientAuthorizations.add("api_key", apiKeyAuth);
log("added key " + key);
}
}
$('#input_apiKey').change(addApiKeyAuthorization);
// if you have an apiKey you would like to pre-populate on the page for demonstration purposes...
/*
var apiKey = "myApiKeyXXXX123456789";
$('#input_apiKey').val(apiKey);
*/
window.swaggerUi.load();
function log() {
......@@ -95,7 +78,7 @@
<body class="swagger-section">
<div id='header'>
<div class="swagger-ui-wrap">
<a id="logo" href="#"></a>
<a id="logo" href="#"><img class="logo__img" alt="swagger" height="30" width="36" src="images/onos-logo.png" /></a>
<form id='api_selector'>
<div class='input' id='selector'>
<select onchange="selectApi()">
......@@ -107,14 +90,14 @@
</select>
</div>
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
<div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
<div class='input'><a id="explore" href="#">Explore</a></div>
<div id='auth_container'></div>
<div class='input'><a id="explore" class="header__btn" href="#">Explore</a></div>
</form>
</div>
</div>
<div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
<div id="footer" class="swagger-ui-wrap"><a href="http://swagger.io/swagger-ui/">Swagger UI</a> adaptation</div>
<div id="footer" class="swagger-ui-wrap"><a href="http://swagger.io/swagger-ui/">Swagger UI</a> (v2.1.5) adaptation</div>
</body>
</html>
......
This diff is collapsed. Click to expand it.
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
This diff is collapsed. Click to expand it.
'use strict';
(function () {
var configure, highlightBlock;
configure = hljs.configure;
// "extending" hljs.configure method
hljs.configure = function _configure (options) {
var size = options.highlightSizeThreshold;
// added highlightSizeThreshold option to set maximum size
// of processed string. Set to null if not a number
hljs.highlightSizeThreshold = size === +size ? size : null;
configure.call(this, options);
};
highlightBlock = hljs.highlightBlock;
// "extending" hljs.highlightBlock method
hljs.highlightBlock = function _highlightBlock (el) {
var innerHTML = el.innerHTML;
var size = hljs.highlightSizeThreshold;
// check if highlightSizeThreshold is not set or element innerHTML
// is less than set option highlightSizeThreshold
if (size == null || size > innerHTML.length) {
// proceed with hljs.highlightBlock
highlightBlock.call(hljs, el);
}
};
})();
This diff is collapsed. Click to expand it.
This diff is collapsed. Click to expand it.
if (typeof Object.assign != 'function') {
(function () {
Object.assign = function (target) {
'use strict';
if (target === undefined || target === null) {
throw new TypeError('Cannot convert undefined or null to object');
}
var output = Object(target);
for (var index = 1; index < arguments.length; index++) {
var source = arguments[index];
if (source !== undefined && source !== null) {
for (var nextKey in source) {
if (Object.prototype.hasOwnProperty.call(source, nextKey)) {
output[nextKey] = source[nextKey];
}
}
}
}
return output;
};
})();
}
......@@ -250,11 +250,19 @@ function clientCredentialsFlow(scopes, tokenUrl, OAuthSchemeKey) {
window.processOAuthCode = function processOAuthCode(data) {
var OAuthSchemeKey = data.state;
// redirect_uri is required in auth code flow
// see https://tools.ietf.org/html/draft-ietf-oauth-v2-31#section-4.1.3
var host = window.location;
var pathname = location.pathname.substring(0, location.pathname.lastIndexOf("/"));
var defaultRedirectUrl = host.protocol + '//' + host.host + pathname + '/o2c.html';
var redirectUrl = window.oAuthRedirectUrl || defaultRedirectUrl;
var params = {
'client_id': clientId,
'code': data.code,
'grant_type': 'authorization_code',
'redirect_uri': redirect_uri
'redirect_uri': redirectUrl
};
if (clientSecret) {
......@@ -331,7 +339,8 @@ window.onOAuthComplete = function onOAuthComplete(token,OAuthSchemeKey) {
}
}
});
window.swaggerUi.api.clientAuthorizations.add(OAuthSchemeKey, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
window.swaggerUi.api.clientAuthorizations.add(window.OAuthSchemeKey, new SwaggerClient.ApiKeyAuthorization('Authorization', 'Bearer ' + b, 'header'));
window.swaggerUi.load();
}
}
}
......
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.