forked from FlominatorTM/WikiTree
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathArchion.js
More file actions
30 lines (25 loc) · 785 Bytes
/
Copy pathArchion.js
File metadata and controls
30 lines (25 loc) · 785 Bytes
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
javascript: var citation = "Archion";
for (
var i = 1;
(valNode = document.getElementsByClassName("breadcrumb-item mb-0")[i]);
i++
) {
citation += " > " + valNode.innerText;
}
var permaLinkDivs = document.getElementsByClassName("inner");
var permaLink;
if (null != permaLinkDivs && permaLinkDivs.length > 0) {
permaLinkDiv = permaLinkDivs[0];
permaLink = permaLinkDiv.getElementsByTagName("a")[0].innerText;
} else {
permaLink = prompt(
"Please enter permalink or enable permalink and try again"
);
}
if (permaLink != null) {
var select_id = document.getElementsByClassName("page-select")[0];
var imageName = select_id.options[select_id.selectedIndex].text;
citation += " > picture [" + permaLink + " " + imageName + "], #";
alert(citation);
}
void 0;