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