-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathVolksbund.js
More file actions
39 lines (34 loc) · 1.02 KB
/
Copy pathVolksbund.js
File metadata and controls
39 lines (34 loc) · 1.02 KB
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
javascript:
/* copies data from volksbund.de in any language version */
var citation = "[[Space:Volksbund_Deutsche_Kriegsgräberfürsorge|Volksbund Deutsche Kriegsgräberfürsorge]], ";
citation += document.getElementsByClassName('title')[0].innerText + ", ";
/* name */
citation += document.getElementsByClassName('detail-headline')[0].innerText;
var da = new Date();
var dateFormatted = da.toLocaleString("en-GB", {
day: 'numeric',
month: 'long',
year: 'numeric'
});
citation += " (" + window.location + " : accessed " + dateFormatted + ") citing: ";
tableText = document.getElementsByClassName('row overview')[0].innerText;
tableParts = tableText.split("\n");
for(var i=0;i<tableParts.length; i++)
{
if(tableParts[i].length > 1)
{
citation+=tableParts[i];
if(i+1 < tableParts.length)
{
if(tableParts[i+1] != "")
{
citation+=": ";
}
else
{
citation+=", ";
}
}
}
}
alert(citation);