-
Notifications
You must be signed in to change notification settings - Fork 2
/
richrestdoc-AMD.html
82 lines (79 loc) · 3.04 KB
/
richrestdoc-AMD.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/css/bootstrap.min.css" rel="stylesheet">
<link href="http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/css/bootstrap-responsive.min.css" rel="stylesheet">
<script src="http://requirejs.org/docs/release/2.1.9/minified/require.js"></script>
<script>
require.config({
baseUrl: "js",
paths: {
"jquery": "http://cdnjs.cloudflare.com/ajax/libs/jquery/1.9.1/jquery.min",
"bootstrap": "http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap",
"bootstrap-collapse": "http://cdnjs.cloudflare.com/ajax/libs/twitter-bootstrap/2.3.1/js/bootstrap-collapse",
"mustache": "http://cdnjs.cloudflare.com/ajax/libs/mustache.js/0.7.2/mustache.min"
},
// make bootstrap requirejs compatible
shim: {
'bootstrap' : ['jquery'],
'bootstrap-collapse' : ['bootstrap', 'jquery']
}
});
</script>
<title>RestDoc Rich Rendering Demo (AMD version)</title>
</head>
<body>
<div class="navbar navbar-fixed-bottom">
<div class="navbar-inner">
<ul class="nav pull-right">
<li><a href="#schemas-anchor">Schemas</a></li>
<li><a href="#headers-anchor">Headers</a></li>
<li><a href="#resources-anchor">Resources</a></li>
<li><a href="#params-anchor">Params</a></li>
<li><a href="#oauth2-anchor">Oauth2</a></li>
</ul>
</div>
</div>
<div class="container-fluid">
<div class="row-fluid">
<div class="span12"><h1>Project name</h1></div>
</div>
<div class="row-fluid">
<div class="span3">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li class="nav-header" id="schemaList">Schemas</li>
<li class="nav-header">Headers</li>
<li><a href="#headers-request-anchor" id="headerRequestList">Request</a></li>
<li><a href="#headers-response-anchor" id="headerResponseList">Response</a></li>
<li class="nav-header" id="resourceList">Resources</li>
<li class="nav-header" id="paramList">Params</li>
<li class="nav-header"><a href="#oauth2-anchor">Oauth2</a></li>
</ul>
</div>
</div>
<div class="span9">
<div class="row-fluid" id="rendered">
<h1>loading ...</h1>
</div>
</div>
</div>
<hr>
<footer>
<p>© Company 2013</p>
</footer>
</div>
<script type="text/javascript">
// "bootstrap", "bootstrap-collapse", and "mustache" have to be loaded additionally to enable advanced functionality of the renderer
require(["restdoc-render", "bootstrap", "bootstrap-collapse", "mustache"], function(renderer) {
renderer.render("test.json", undefined, $("#rendered"), function(restdoc) {
renderer.createSchemaList(restdoc, $("#schemaList"));
renderer.createResourceList(restdoc, $("#resourceList"));
renderer.createParamList(restdoc, $("#paramList"));
}, "GET");
});
</script>
</body>
</html>