-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
130 lines (124 loc) · 5.09 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
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>FS Check</title>
<link rel="stylesheet" href="//netdna.bootstrapcdn.com/bootstrap/3.1.1/css/bootstrap.min.css">
<style>
.opp-group {
padding: 20px 0;
}
.opp-group:not(:first-child) {
border-top: 1px solid #ccc;
}
</style>
<script src="//cdnjs.cloudflare.com/ajax/libs/jquery/2.1.1/jquery.min.js"></script>
<script src="fs-check.min.js"></script>
<script src="lang/en/fs-check-en.js"></script>
<script src="lang/es/fs-check-es.js"></script>
<script>
var opportunities = {};
$(document).ready(function(){
$.getJSON('docs/opportunities.json').done(function(oppsResponse){
opportunities = oppsResponse;
$.each(opportunities, function(key, opportunity){
$('#' + opportunity.type + '-list').append(
$('<a id="opp-' + key + '" href="#' + key + '" class="list-group-item">' + key + '</a>').click(function(){
$('.active').removeClass('active');
$(this).addClass('active');
displayOpportunity(opportunity);
})
);
});
if(location.hash && $('#opp-' + location.hash.substr(1))){
$('#opp-' + location.hash.substr(1)).click();
} else {
$('#left a.list-group-item:first').click();
}
});
$('#language').change(updateOppDisplay);
});
function displayOpportunity(opportunity){
var oppDOM = $('#opportunity'),
lang = $('#language').val();
FSCheck.translate(opportunity, lang);
$('.opp-title', oppDOM).html(opportunity.title);
$('.opp-type', oppDOM).html(opportunity.type);
$('.opp-description', oppDOM).html(opportunity.description);
$('.opp-help', oppDOM).html(displayHelpLinks(FSCheck.id(opportunity.checkId).help, lang));
$('.opp-gensearch', oppDOM).text(JSON.stringify(opportunity.gensearch, null, 2) || 'A gensearch object was not generated for this opportunity.');
}
function displayHelpLinks(links, lang){
var $list = $('<ul>');
$.each(links, function(i, helpId){
var help = FSCheck.help(helpId, lang);
$('<li>')
.append($('<a>').attr('href', help.url).attr('target', '_blank').text(help.title))
.appendTo($list);
});
return $list;
}
function updateOppDisplay(){
var oppId = $('#left .list-group-item.active').text();
displayOpportunity(opportunities[oppId]);
}
</script>
</head>
<body>
<div class="container">
<div id="header">
<h1>FS Check</h1>
<p>Explore example opportunties generated by the <a href="https://github.com/genealogysystems/fs-check#opportunities">checks</a>.</p>
</div>
<div class="row">
<div id="left" class="col-sm-3">
<div>
<select id="language" class="form-control">
<option value="en">English</option>
<option value="es">Español</option>
</select>
<br>
</div>
<div id="person-list" class="list-group">
<div class="list-group-item"><h4>Person</h4></div>
</div>
<div id="family-list" class="list-group">
<div class="list-group-item"><h4>Family</h4></div>
</div>
<div id="source-list" class="list-group">
<div class="list-group-item"><h4>Sources</h4></div>
</div>
<div id="problem-list" class="list-group">
<div class="list-group-item"><h4>Problems</h4></div>
</div>
<div id="cleanup-list" class="list-group">
<div class="list-group-item"><h4>Cleanup</h4></div>
</div>
</div>
<div id="opportunity" class="col-sm-9">
<div class="opp-group">
<h4 class="text-muted">Title</h4>
<h2><span class="opp-title"></span></h2>
</div>
<div class="opp-group">
<h4 class="text-muted">Type</h4>
<h4><code class="opp-type"></code></h4>
</div>
<div class="opp-group">
<h4 class="text-muted">Description</h4>
<div class="opp-description"></div>
</div>
<div class="opp-group">
<h4 class="text-muted">Help Links</h4>
<div class="opp-help"></div>
</div>
<div class="opp-group">
<h4 class="text-muted">Gensearch</h4>
<pre class="opp-gensearch"></pre>
</div>
</div>
</div>
</div>
<a href="https://github.com/genealogysystems/fs-check"><img style="position: absolute; top: 0; right: 0; border: 0;" src="https://camo.githubusercontent.com/365986a132ccd6a44c23a9169022c0b5c890c387/68747470733a2f2f73332e616d617a6f6e6177732e636f6d2f6769746875622f726962626f6e732f666f726b6d655f72696768745f7265645f6161303030302e706e67" alt="Fork me on GitHub" data-canonical-src="https://s3.amazonaws.com/github/ribbons/forkme_right_red_aa0000.png"></a>
</body>
</html>