Permalink
Fetching contributors…
Cannot retrieve contributors at this time
82 lines (75 sloc) 4.39 KB
<?php $base = $this->basePath(); ?>
<!DOCTYPE html>
<html>
<head>
<title>Swagger UI</title>
<link href='https://fonts.googleapis.com/css?family=Droid+Sans:400,700' rel='stylesheet' type='text/css'/>
<link href='<?php echo $base ?>/zf-apigility-documentation-swagger/css/highlight.default.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='<?php echo $base ?>/zf-apigility-documentation-swagger/css/screen.css' media='screen' rel='stylesheet' type='text/css'/>
<link href='<?php echo $base ?>/zf-apigility-documentation-swagger/css/custom.css' media='screen' rel='stylesheet' type='text/css'/>
<script src="<?php echo $base ?>/zf-apigility-documentation-swagger/lib/shred.bundle.js" type="text/javascript"></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/jquery-1.8.0.min.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/jquery.slideto.min.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/jquery.wiggle.min.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/jquery.ba-bbq.min.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/handlebars-1.0.0.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/underscore-min.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/backbone-min.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/swagger.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/swagger-ui.js' type='text/javascript'></script>
<script src='<?php echo $base ?>/zf-apigility-documentation-swagger/lib/highlight.7.3.pack.js' type='text/javascript'></script>
<script type="text/javascript">
$(function () {
window.swaggerUi = new SwaggerUi({
url: "<?php echo $this->url('zf-apigility/documentation', array('api' => $this->api)) ?>",
dom_id: "swagger-ui-container",
supportedSubmitMethods: ['get', 'post', 'put', 'delete'],
onComplete: function(swaggerApi, swaggerUi){
log("Loaded SwaggerUI")
$('pre code').each(function(i, e) {hljs.highlightBlock(e)});
},
onFailure: function(data) {
log("Unable to Load SwaggerUI");
},
docExpansion: "none"
});
var acceptHeader = {
apply: function(obj, authorizations) {
if (obj.url.match(/<?= preg_quote($this->url('zf-apigility/documentation', array('api' => null)), '/') ?>/)) {
obj.headers['Accept'] = 'application/vnd.swagger+json';
}
return true;
}
};
$('#auth-header-value').change(function() {
var key = $('#auth-header-value')[0].value;
console.log("key: " + key);
if(key && key.trim() != "") {
console.log("added key " + key);
window.authorizations.add("authorization-header", new ApiKeyAuthorization("Authorization", key, "header"));
}
});
// content-neg
window.authorizations.add("documentation-accept-header", acceptHeader);
window.swaggerUi.load();
});
</script>
</head>
<body>
<div id='header'>
<div class="swagger-ui-wrap">
<a id="logo" href="http://swagger.wordnik.com">swagger</a>
<form id='api_selector'>
<div class='input'><input placeholder="http://example.com/api" id="input_baseUrl" name="baseUrl" type="text"/></div>
<div class='input'><label for="auth-header-value">Authorization:</label> <input placeholder="Enter Authorization header value here" id="auth-header-value" name="auth-header-value" type="text"/></div>
<div class='input'><a id="explore" 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>
</body>
</html>