-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathvalidate.html
154 lines (130 loc) · 5.88 KB
/
validate.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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Bioschemas Registry & Validator</title>
<link rel="icon" type="icon/png" href="img/favicon.png">
<!-- Google Font -->
<link href='https://fonts.googleapis.com/css?family=Noto+Sans' rel='stylesheet' type='text/css'>
<!-- d3.js framework -->
<script type="text/javascript" src="https://d3js.org/d3.v3.min.js" charset="utf-8"></script>
<link rel="stylesheet" href="stylesheet.css" media="screen" title="no title" charset="utf-8">
</head>
<body>
<div style="display: inline-block; padding: 1em 0;">
<a href="index.html"><img class="rotation" src="img/square_logo2.png" alt="Bioschemas" style="width: 10%; height: 10%;"></a>
<a href="index.html"><img src="img/logo_3.png" alt="Bioschemas" style="width: 40%; height: 40%;"></a>
</div>
<div class="navbar">
<div class="navbar_links">
<a href="index.html" class="page-link">
<div class="nav_buttons">Home</div>
</a>
<a href="websites_registry/index.html" class="page-link">
<div class="nav_buttons">Registry</div>
</a>
<a href="tester.html" class="page-link">
<div class="nav_buttons">Test Website</div>
</a>
<a href="validate.html" class="page-link">
<div class="nav_buttons" id="nav_active">Submit Website</div>
</a>
</div>
</div>
<h2>Test And Submit A Website</h2>
<p>With the Submit tool you can test a specific URL for its compliance with the Bioschemas specifications and submit it to the Registry for public consultation. You can also choose to test all the children links for that page (links with the same root URL) as well as scraping your URL for one specific Bioschemas type (Event, Organization, Person, Training Material).</p>
<div id="mainDiv">
<h3>Website URL: </h3>
<input type="text" id="url_input" class="inputs"><br>
<h3>Website Name: </h3>
<input type="text" id="name_input" class="inputs"><br>
<h5>If you choose not to provide a name for the URL you are testing, the <em>title</em> field content from the tested website will be used as its name.</h5>
<label>
<input type="checkbox" id="link_input" style="display: inline;"> Validate children links too
</label>
<!--and save the results
<label>
<input type="radio" name="arrangeChild" value="single" disabled> individually
</label>
or
<label>
<input type="radio" name="arrangeChild" value="altogether" disabled> altogether
</label>-->
<br>
<p>Scrape a specific Bioschemas type:
<select name="types" id="types_menu">
<option value="all" selected>All Types</option>
<option value="Event">Events</option>
<option value="Organization">Organizations</option>
<option value="Person">Persons</option>
<option value="Training">Training Materials</option>
</select>
</p>
<label>
<input type="checkbox" id="checkMail">Mail notification when the process is done
<input type="text" id="textMail" class="inputs" placeholder="[email protected]" disabled>
</label>
<br>
<button type="submit" id="submitBtn" class="buttons">Validate!</button>
</div>
<div id="response"></div>
<!-- jQuery -->
<script type="text/javascript" src="https://code.jquery.com/jquery-2.2.3.min.js"></script>
<script type="text/javascript">
/*document.getElementById("link_input").onclick = function () {
var el = document.getElementsByName("arrangeChild");
if (this.checked) {
for (var i = 0; i < el.length; i++) {
el[i].disabled = false;
}
el[0].checked = true;
} else {
for (var i = 0; i < el.length; i++) {
el[i].disabled = true;
}
}
};*/
$("#checkMail").on("click", function () {
var target = document.getElementById("textMail");
if (target.hasAttribute("disabled")) {
target.removeAttribute("disabled");
} else {
target.setAttribute("disabled", true);
}
});
$("#submitBtn").on("click", function () {
var urlToVal = $("#url_input").val();
var nameToVal = $("#name_input").val();
var linkToVal;
var mailText;
if ($("#link_input").is(":checked")) {
linkToVal = 0;
} else {
linkToVal = 1;
}
var typeToVal = $("#types_menu").val();
if ($("#checkMail").is(":checked")) {
mailText = $("#textMail").val();
} else {
mailText = "_";
}
if (urlToVal == "") {
alert("You need to provide a valid URL to validate!");
} else if (nameToVal == "") {
var r = confirm("If you don't provide a name for your website, the title field content from the tested website will be used as its name.");
if (r == true) {
$("#mainDiv").fadeOut(1000);
$.get("validate_url.php", {url : urlToVal, nome : "_", link : linkToVal, types : typeToVal, mail : mailText});
$("#response").append("<p>Thanks for using this service!</p>");
$("#response").append("<p>You can view the validation results on the <a href='websites_registry/index.html' title='Registry'>Registry</a> page.</p>");
}
} else {
$("#mainDiv").fadeOut(1000);
$.get("validate_url.php", {url : urlToVal, nome : nameToVal, link : linkToVal, types : typeToVal, mail : mailText});
$("#response").append("<p>Thanks for using this service!</p>");
$("#response").append("<p>You can view the validation results on the <a href='websites_registry/index.html' title='Registry'>Registry</a> page.</p>");
}
});
</script>
</body>
</html>