-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathindex.html
68 lines (61 loc) · 2.2 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
<!DOCTYPE html>
<html>
<head>
<meta content="text/html;charset=utf-8" http-equiv="Content-Type">
<meta content="utf-8" http-equiv="encoding">
<title>Tree of Life Wikidata</title>
<link rel="stylesheet" href="dist/themes/default/style.css" />
<link rel="stylesheet" href="style.css">
<script type="text/javascript" src="http://code.jquery.com/jquery-1.11.1.min.js"></script>
<script src="dist/jstree.min.js"></script>
</head>
<body>
<form name ="languages" Method ="get" ACTION ="language.php">
<Input type = 'Radio' Name ='lang' value= 'en'>English
<Input type = 'Radio' Name ='lang' value= 'de'>Deutsch
<Input type = 'Radio' Name ='lang' value= 'es'>Español
<Input type = 'Radio' Name ='lang' value= 'fr'>Français
<Input type = 'Radio' Name ='lang' value= 'tr'>Türkçe
<Input type = 'Radio' Name ='lang' value= 'pl'>Polski
<Input type = 'Radio' Name ='lang' value= 'ro'>Română
<Input type = "Submit" Name = "Submit" Value = "Select Language">
</form>
<h1>Wikidata's Tree of Life</h1>
<main>
<div id="tree_of_life"></div>
<div id="wikiframe">
<iframe src="https://m.wikidata.org/" name="wikilinkiframe"></iframe>
</object>
</div>
</main>
<script>
$(function () {
$('#tree_of_life').jstree({
'core' : {
'data' : {
'url' : function (node) { return 'data.php' },
'dataType': 'JSON',
'data' : function (node) {
return { 'entity_id' : node.id };
}
},
'themes' : {
'icons' : false
}
}
})
.on('changed.jstree', function (e, data) {
var i, j, r = [];
for(i = 0, j = data.selected.length; i < j; i++) {
r.push(data.instance.get_node(data.selected[i], true).find("a").attr("href"));
}
$("iframe").attr('src', r[0]);
});
});
</script>
<footer>
<p> Tree of Life <a href="https://github.com/frimelle/tree-of-life"> (Code)</a>, using Data from <a href=" https://www.wikidata.org">Wikidata</a>, bugs can be submitted to <a href="https://github.com/frimelle/tree-of-life/issues"> github </a> </p>
<p><a href="https://github.com/frimelle"> By Lucie-Aimée Kaffee </a></p>
</footer>
</body>
</html>