forked from IIIF/presentation-validator
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
182 lines (158 loc) · 7.53 KB
/
index.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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
<!DOCTYPE html>
<!--[if lt IE 7]> <html class="no-js lt-ie9 lt-ie8 lt-ie7"> <![endif]-->
<!--[if IE 7]> <html class="no-js lt-ie9 lt-ie8"> <![endif]-->
<!--[if IE 8]> <html class="no-js lt-ie9"> <![endif]-->
<!--[if gt IE 8]> <html class="no-js"> <!<![endif]-->
<head>
<meta charset="utf-8">
<title>Presentation API Validator — IIIF | International Image Interoperability Framework</title>
<meta name="description" content="International Image Interoperability Framework: A community driven image framework with well defined APIs for making the world’s image repositories interoperable and accessible">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<link rel="stylesheet" href="//iiif.io/css/normalize.min.css">
<link href='http://fonts.googleapis.com/css?family=Raleway:100,300,500' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Open+Sans:400,400italic,600,700' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Inconsolata' rel='stylesheet' type='text/css'>
<link href='http://fonts.googleapis.com/css?family=Lato' rel='stylesheet' type='text/css'>
<link rel="stylesheet" href="//iiif.io/css/main.css">
<style type="text/css">
#results {
background-color: #f5f5f5;
padding: 2em;
margin-left: 10px;
margin-top: 2em;
}
</style>
<link type="application/atom+xml" rel="alternate" href="//iiif.io/news/atom.xml"/>
<script src="//iiif.io/js/vendor/modernizr-2.6.2-respond-1.1.0.min.js"></script>
<script src="https://code.jquery.com/jquery-2.2.3.min.js" integrity="sha256-a23g1Nt4dtEYOj7bR+vTu7+T8VP13humZFBJNIYoEJo=" crossorigin="anonymous"></script>
<script src="//iiif.io/js/vendor/anchor.min.js"></script>
<script src="//iiif.io/js/anchor.js"></script>
</head>
<body>
<!--[if lt IE 7]>
<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>
<![endif]-->
<div class="header-container">
<header class="wrapper clearfix">
<a class="title" title="IIIF : International Image Interoperability Framework" href="//iiif.io/">Home</a>
</header>
</div>
<div class="sub-pages-container">
<div class="presentation-api clearfix">
<article>
<header>
<div class="wrapper"><h1>Presentation API Validator</h1></div>
</header>
<section class="wrapper">
<div>
This service will validate a IIIF Presentation API resource against the specification. Fill in the URL of your manifest, and it will try to parse it and issue errors for failed requirements, and warnings for recommendations that haven't been followed.
</div>
<div style="border: 1px solid black;margin-left: 10px; margin-top: 20px; padding: 10px">
<form id='manifest-validation-form' method="GET" action="validate">
URL of Manifest to Validate:<br/>
<input style="margin-left: 25px" type="text" name="url" size="80"><br/>
Select Presentation API Version:
<select name="version">
<option value="3.0">3.0</option>
<option value="2.1">2.1</option>
<option value="2.0">2.0</option>
<option value="1.0">1.0</option>
</select>
<br/>
<input type="submit" value="Go!" id="submit-url">
</form>
</div>
<div id='results' style="display: none;" >
<h3>Validation Results:</h3>
<hr/>
<div id='results-content'></div>
</div>
<br/>
<hr/>
<div style="margin-top:20px">
<b>Technical Note</b>
<p>
If you would like to use the validator programatically, there are two options:
</p>
<ul>
<li><a href="https://github.com/IIIF/presentation-validator">Download</a> the code from github and run it locally.</li>
<li>Use it online with JSON based output, by an HTTP GET to this endpoint:<br/>https://presentation-validator.iiif.io/validate?version=2.1&url=<i>manifest-url-here</i></li>
</ul>
</div>
</section>
</article>
</div>
</div>
<div class="footer-container">
<footer class="wrapper">
<ul>
<li>Feedback: <a href="mailto:[email protected]">[email protected]</a></li>
<li>Get involved: <a href="//iiif.io/community/#how-to-get-involved">Join IIIF</a>
</li>
</ul>
</footer>
</div>
<!-- AJAX code for form submission -->
<script type="text/javascript">
// Call out to the validation service and get a result
function handleSubmission(e) {
e.preventDefault();
var data = {
url: $("input[name='url']").val(),
version: $("select[name='version']").val()
}
$('#results-content').html('Processing ' + data.version + " validation...");
$('#results').show();
var url = $('#manifest-validation-form').attr("action");
$.getJSON(url,data,handleValidationResponse);
}
// Handle validation service response, render response block
function handleValidationResponse(data) {
str = '<div style="margin-left: 20px">'
str += '<div>URL Tested: '+ data.url + '</div><br/>'
if (data.okay) {
str += '<div><h2 style="color:green">Validated successfully</h2></div>'
} else {
if (data.errorList) {
for (var i = 0; i < data.errorList.length; i++) {
var error = data.errorList[i];
str+='<div>';
str+='<h2 style="color:red">' + error.title + '</h2>';
str+='<p><ul>';
str+='<li><b>Detail: </b> ' + error.detail + '</li>';
str+='<li><b>Path: </b>' + error.path + '</li>';
str+='<li><b>Description: </b>' + error.description + '</li>';
str+='</li></p>';
str+='<pre>';
str+= JSON.stringify(error.context);
str+='</pre>';
str+='</div>';
}
} else {
str += '<div><h2 style="color:red">Validation Error: '+data.error+'</h2></div>'
}
}
if (data.warnings && data.warnings.length){
str += '<div style="margin-top: 20px">Warnings:<ul>';
for(var i =0; i < data.warnings.length; i++) {
str+= '<li>'+data.warnings[i]+'</li>';
}
str += '</ul></div>';
}
str += '</div>';
$('#results-content').html(str);
$('#results').show();
}
// Set up event handler.
$('#submit-url').on("click", handleSubmission);
</script>
<script>
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
ga('create', 'UA-7219229-22', 'iiif.io');
ga('send', 'pageview');
</script>
</body>
</html>