merged from oauth2 branch

This commit is contained in:
Tony Tam
2014-03-19 21:50:31 -07:00
parent 1f6aa46e52
commit da63a33845
17 changed files with 1051 additions and 43 deletions

View File

@@ -710,6 +710,9 @@ table {
.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li a {
text-decoration: none;
}
.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.heading ul.options li.access {
color: black;
}
.swagger-ui-wrap ul#resources li.resource ul.endpoints li.endpoint ul.operations li.operation div.content {
border-top: none;
padding: 10px;
@@ -1031,6 +1034,132 @@ table {
.swagger-ui-wrap form.form_box p strong {
color: black;
}
.title {
font-style: bold;
}
.secondary_form {
display: none;
}
.main_image {
display: block;
margin-left: auto;
margin-right: auto;
}
.oauth_body {
margin-left: 100px;
margin-right: 100px;
}
.oauth_submit {
text-align: center;
}
.api-popup-dialog {
z-index: 10000;
position: absolute;
width: 500px;
background: #FFF;
padding: 20px;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
color: #777;
}
.api-popup-dialog .api-popup-title {
font-size: 24px;
padding: 10px 0;
}
.api-popup-dialog .api-popup-title {
font-size: 24px;
padding: 10px 0;
}
.api-popup-dialog p.error-msg {
padding-left: 5px;
padding-bottom: 5px;
}
.api-popup-dialog button.api-popup-authbtn {
height: 30px;
}
.api-popup-dialog button.api-popup-cancel {
height: 30px;
}
.api-popup-scopes {
padding: 10px 20px;
}
.api-popup-scopes li {
padding: 5px 0;
line-height: 20px;
}
.api-popup-scopes .api-scope-desc {
padding-left: 20px;
font-style: italic;
}
.api-popup-scopes li input {
position: relative;
top: 2px;
}
.api-popup-actions {
padding-top: 10px;
}
.access {
float: right;
}
.auth {
float: right;
}
#api_information_panel {
position: absolute;
background: #FFF;
border: 1px solid #ccc;
border-radius: 5px;
display: none;
font-size: 13px;
max-width: 300px;
line-height: 30px;
color: black;
padding: 5px;
}
#api_information_panel p .api-msg-enabled {
color: green;
}
#api_information_panel p .api-msg-disabled {
color: red;
}
.api-ic {
height: 18px;
vertical-align: middle;
display: inline-block;
background: url(../images/explorer_icons.png) no-repeat;
}
.ic-info {
background-position: 0 0;
width: 18px;
margin-top: -7px;
margin-left: 4px;
}
.ic-warning {
background-position: -60px 0;
width: 18px;
margin-top: -7px;
margin-left: 4px;
}
.ic-error {
background-position: -30px 0;
width: 18px;
margin-top: -7px;
margin-left: 4px;
}
.ic-off {
background-position: -90px 0;
width: 58px;
margin-top: -4px;
cursor: pointer;
}
.ic-on {
background-position: -160px 0;
width: 58px;
margin-top: -4px;
cursor: pointer;
}
#header {
background-color: #89bf04;
padding: 14px;

Binary file not shown.

After

Width:  |  Height:  |  Size: 5.6 KiB

View File

@@ -16,14 +16,23 @@
<script src='lib/swagger.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/swagger-oauth.js' type='text/javascript'></script-->
<script type="text/javascript">
// var clientId = "your-client-id";
// var realm = "your-realm";
$(function () {
window.swaggerUi = new SwaggerUi({
url: "http://petstore.swagger.wordnik.com/api/api-docs",
dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
onComplete: function(swaggerApi, swaggerUi){
log("Loaded SwaggerUI")
log("Loaded SwaggerUI");
/*if(typeof initOAuth == "function")
initOAuth();
*/
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
},
onFailure: function(data) {
@@ -65,14 +74,8 @@
</div>
</div>
<div id="message-bar" class="swagger-ui-wrap">
&nbsp;
</div>
<div id="swagger-ui-container" class="swagger-ui-wrap">
</div>
<div id="message-bar" class="swagger-ui-wrap">&nbsp;</div>
<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
</body>
</html>

15
src/main/html/o2c.html Normal file
View File

@@ -0,0 +1,15 @@
<script>
var qp = null;
if(window.location.hash) {
qp = location.hash.substring(1);
}
else {
qp = location.search.substring(1);
}
qp = qp ? JSON.parse('{"' + qp.replace(/&/g, '","').replace(/=/g,'":"') + '"}',
function(key, value) {
return key===""?value:decodeURIComponent(value) }
):{}
window.opener.onOAuthComplete(qp);
window.close();
</script>