index.html 2.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <!DOCTYPE html>
  2. <!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
  3. <!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
  4. <!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
  5. <!--[if gt IE 8]><!--> <html class="no-js"> <!--<![endif]-->
  6. <head>
  7. <meta charset="utf-8">
  8. <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  9. <title></title>
  10. <meta name="description" content="">
  11. <meta name="viewport" content="width=device-width">
  12. <style>
  13. thead th {
  14. text-align: left;
  15. border-bottom: 1px solid #000;
  16. }
  17. th, td {
  18. padding: 0.5em 1em 0 1em;
  19. font-family: 'Courier New', Courier, monospace;
  20. }
  21. </style>
  22. <script src="https://cdnjs.cloudflare.com/ajax/libs/jquery/3.4.1/jquery.min.js"></script>
  23. <script>
  24. var generateDocsRow = function(x) {
  25. var html = '<tr><td>' + x + '</td>';
  26. html += '<td><a href="branches/' + x + '">Docs</a></td>';
  27. html += '<td><a href="branches/' + x + '/openapi.yaml">OpenAPI spec</a></td></tr>';
  28. return html;
  29. };
  30. $(function() {
  31. $.getJSON(
  32. 'branches.json',
  33. function(data) {
  34. var list = $('#version-list');
  35. var html = '<thead><th>Version</th><th></th><th></th></thead><tbody>';
  36. html += generateDocsRow('master');
  37. data.forEach(function(x) {
  38. if (x != 'master') {
  39. html += generateDocsRow(x);
  40. }
  41. });
  42. html += '</tbody>'
  43. list.append(html);
  44. $('#loading').hide();
  45. },
  46. function(err) {
  47. console.log(err);
  48. }
  49. );
  50. });
  51. </script>
  52. </head>
  53. <body>
  54. <!--[if lt IE 7]>
  55. <p class="chromeframe">You are using an <strong>outdated</strong> browser. Please <a href="http://browsehappy.com/">upgrade your browser</a> or <a href="http://www.google.com/chromeframe/?redirect=true">activate Google Chrome Frame</a> to improve your experience.</p>
  56. <![endif]-->
  57. <h2>MiLight Hub REST API Documentation</h2>
  58. <hr />
  59. <table id="version-list"></table>
  60. <i id="loading">Loading...</i>
  61. </body>
  62. </html>