JAL-2189 license header
[jalview.git] / examples / biojson-doc / tests / test.html
1 <!--
2  * Jalview - A Sequence Alignment Editor and Viewer ($$Version-Rel$$)
3  * Copyright (C) $$Year-Rel$$ The Jalview Authors
4  * 
5  * This file is part of Jalview.
6  * 
7  * Jalview is free software: you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License 
9  * as published by the Free Software Foundation, either version 3
10  * of the License, or (at your option) any later version.
11  *  
12  * Jalview is distributed in the hope that it will be useful, but 
13  * WITHOUT ANY WARRANTY; without even the implied warranty 
14  * of MERCHANTABILITY or FITNESS FOR A PARTICULAR 
15  * PURPOSE.  See the GNU General Public License for more details.
16  * 
17  * You should have received a copy of the GNU General Public License
18  * along with Jalview.  If not, see <http://www.gnu.org/licenses/>.
19  * The Jalview Authors are detailed in the 'AUTHORS' file.
20  -->
21 <!DOCTYPE html>
22 <html>
23 <head>
24     <title>Docson Test</title>
25     <meta charset="utf-8">
26     <link rel="stylesheet" href="../css/docson.css">
27     <script src="../lib/require.js"></script></head>
28     <style>
29         body {
30             font-family: verdana, helvetica;
31         }
32     </style>
33 </head>
34 <body>
35 <script charset="utf-8">
36     var tests = [ "invoice$Invoice", "enum", "schema","additionalProperties", "address", "fstab", "basic", "not", "oneOf", "anyOf", "allOf", "example2", "properties", "ref"]
37     require.config({ baseUrl: ".."});
38     require(["docson", "lib/jquery"], function(docson) {
39         docson.templateBaseUrl="../templates";
40         $(function() {
41             $.each(tests, function(k, test) {
42                 var block = $("<div/>");
43                 var segments = test.split("$");
44                 $("body").append("<h2>"+segments[0]+"</h2>");
45                 $("body").append(block);
46                 $.get(segments[0]+".json").done(function(items) {
47                     $.each(items, function(k, item) {
48                         var element = $("<div/>");
49                         block.append(element);
50                         if(!item.schema.description) {
51                             item.schema.description = item.description;
52                         }
53                         docson.doc(element, item.schema, segments[1]);
54                     });
55                 });
56             });
57         });
58     });
59 </script>
60 </body>
61 </html>