-body.swagger-section #header {
+
+body.swagger-section #header , body.swagger-section #description{
padding:0 50px;
background-color:#F4F7E7;
}
+body.swagger-section #content {
+ padding:0 50px;
+}
+
+#swagger-ui-container {
+ clear: both;
+}
+
#header #banner, #header #menu{
margin-left:auto;
margin-right:auto;
<head>
<meta charset="UTF-8">
<title>Swagger UI</title>
+ <link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
<link rel="icon" type="image/png" href="images/favicon-32x32.png" sizes="32x32"/>
<link rel="icon" type="image/png" href="images/favicon-16x16.png" sizes="16x16"/>
<link href='webjars/springfox-swagger-ui/css/typography.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='webjars/springfox-swagger-ui/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='webjars/springfox-swagger-ui/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
+ <link href='css/cdm.css' rel='stylesheet' type='text/css' />
<link href='webjars/springfox-swagger-ui/css/reset.css' media='print' rel='stylesheet' type='text/css'/>
<link href='webjars/springfox-swagger-ui/css/print.css' media='print' rel='stylesheet' type='text/css'/>
<script src='webjars/springfox-swagger-ui/lib/jquery-1.8.0.min.js' type='text/javascript'></script>
<script src='webjars/springfox-swagger-ui/lib/highlight.7.3.pack.js' type='text/javascript'></script>
<script src='webjars/springfox-swagger-ui/lib/marked.js' type='text/javascript'></script>
<script src='webjars/springfox-swagger-ui/lib/swagger-oauth.js' type='text/javascript'></script>
+
<script src='webjars/springfox-swagger-ui/springfox.js' type='text/javascript'></script>
<script type="text/javascript">
</head>
<body class="swagger-section">
-<div id='header'>
- <div class="swagger-ui-wrap">
- <a id="logo" href="http://swagger.io">swagger</a>
-
- <form id='api_selector'>
- <div class='input'>
- <select id="select_baseUrl" name="select_baseUrl"/>
- </div>
- <div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/>
+ <div id="header">\r
+ <div id="banner">\r
+ <img src="../images/logo_edit.png">\r
+ <div id="title"><h1>CDM remote API</hi></div>\r
</div>
- <div class='input'><input placeholder="api_key" id="input_apiKey" name="apiKey" type="text"/></div>
- <div class='input'><a id="explore" href="#" data-sw-translate>Explore</a></div>
- </form>
+ <div id="menu">\r
+ <ul id="select_baseUrl">\r
+ </ul>\r
</div>
</div>
-<div id="message-bar" class="swagger-ui-wrap" data-sw-translate> </div>
-<div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+ <div id="description">\r
+ <div class="swagger-ui-wrap">\r
+ <!--\r
+ <h1>CDM remote REST service API</h1>\r
+ -->\r
+ </div>\r
+ </div>\r
+ <div id="content">\r
+ <div id="message-bar" class="swagger-ui-wrap"> </div>\r
+ <div id="swagger-ui-container" class="swagger-ui-wrap"></div>
+ </div>
</body>
</html>
}
};
window.springfox = springfox;
- window.oAuthRedirectUrl = springfox.baseUrl() + '/webjars/springfox-swagger-ui/o2c.html'
-
- $('#select_baseUrl').change(function() {
- window.swaggerUi.headerView.trigger('update-swagger-ui', {swagger-ui
- url: $('#select_baseUrl').val()
- });
- });
+ window.oAuthRedirectUrl = springfox.baseUrl() + 'doc//webjars/springfox-swagger-ui/o2c.html'
function maybePrefix(location, withRelativePath) {
var pat = /^https?:\/\//i;
if (pat.test(location)) {
- return location;swagger-ui
+ return location;
}
return withRelativePath + location;
}
+
+ function getUrlParam(key){
+ key = key.replace(/[*+?^$.\[\]{}()|\\\/]/g, "\\$&"); // escape RegEx meta chars
+ var match = location.search.match(new RegExp("[?&]"+key+"=([^&]+)(&|$)"));
+ return match && decodeURIComponent(match[1].replace(/\+/g, " "));
+ }
+
+ function menuItemId(groupName){
+ return 'menu_' + groupName.replace(/\s/g, "_");
+ }
$(document).ready(function() {
var relativeLocation = springfox.baseUrl();
$.getJSON(relativeLocation + "/swagger-resources", function(data) {
- var $menulist = $('#menu ul');
+ var $menulist = $('#select_baseUrl');
$menulist.empty();
$.each(data, function(i, resource) {
// <li id="menu_Generic_REST_API"><a href="?group=Generic+REST+API">Generic REST API</a></li>
- var id = 'menu_' + resource.name; // TODO replace whitespace by _
+ var id = menuItemId(resource.name);
var link = $('<a></a>')
.attr("href", maybePrefix(resource.location, relativeLocation))
.text(resource.name);
var option = $('<li></li>').attr("id", id).append(link);
$menulist.append(option);
});
- $menulist.change();
+ $('#select_baseUrl a').click(function(event) {
+ event.preventDefault()
+ window.swaggerUi.headerView.trigger(
+ 'update-swagger-ui',
+ {url: $(event.target).attr('href')}
+ );
+ });
+
+ var initialGroup = getUrlParam('group');
+ if(initialGroup) {
+ $('#' + menuItemId(initialGroup) + " a").click();
+ }
});
});
<meta http-equiv="refresh" content="0;url=doc/?group=Generic%20REST%20API">\r
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">\r
<title>CDM remote API</title>\r
- <link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>\r
- <link href='doc/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>\r
- <link href='doc/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>\r
- <link href='doc/css/cdm.css' media='screen' rel='stylesheet' type='text/css' />\r
- <link href='doc/css/reset.css' media='print' rel='stylesheet' type='text/css'/>\r
- <link href='doc/css/screen.css' media='print' rel='stylesheet' type='text/css'/>\r
- <link href='doc/css/cdm.css' media='print' rel='stylesheet' type='text/css' />\r
+ <link href='doc/https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>\r
+ <link rel="icon" type="image/png" href="doc/images/favicon-32x32.png" sizes="32x32"/>\r
+ <link rel="icon" type="image/png" href="doc/images/favicon-16x16.png" sizes="16x16"/>\r
+ <link href='doc/webjars/springfox-swagger-ui/css/typography.css' media='screen' rel='stylesheet' type='text/css'/>\r
+ <link href='doc/webjars/springfox-swagger-ui/css/reset.css' media='screen' rel='stylesheet' type='text/css'/>\r
+ <link href='doc/webjars/springfox-swagger-ui/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>\r
+ <link href='doc/css/cdm.css' rel='stylesheet' type='text/css' />\r
+ <link href='doc/webjars/springfox-swagger-ui/css/reset.css' media='print' rel='stylesheet' type='text/css'/>\r
+ <link href='doc/webjars/springfox-swagger-ui/css/print.css' media='print' rel='stylesheet' type='text/css'/>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/jquery-1.8.0.min.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/jquery.slideto.min.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/jquery.wiggle.min.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/jquery.ba-bbq.min.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/handlebars-2.0.0.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/underscore-min.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/backbone-min.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/swagger-ui.min.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/highlight.7.3.pack.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/marked.js' type='text/javascript'></script>\r
+ <script src='doc/webjars/springfox-swagger-ui/lib/swagger-oauth.js' type='text/javascript'></script>\r
</head>\r
<body class="swagger-section">\r
<div id="header">\r
If the automatic redirect is not working please click the below link:\r
</p>\r
<ul>\r
- <li><a href="doc/?group=Generic+REST+API">Documentation of the CDM remote API.</a>\r
+ <li><a href="doc/index.html?group=Generic+REST+API">Documentation of the CDM remote API.</a>\r
</div>\r
</div>\r
</body>\r