translate.txt translation on 10/19/2020
[gitmagic.git] / find_selflink.js
blobdb436db7d8534259692749f847049416b0b2f202
1 // From my own website(!)
2 //TODO: only do this for links in the table of contents menu
4 function find_selflink() {
5 var a = document.links;
6 var i = 0;
7 while (i < a.length) {
8 if (a[i].href == document.URL) {
9 var c;
10 var j;
11 var s_new = document.createElement("span");
12 s_new.className = "currentlink";
13 c = a[i].childNodes;
14 for (j=0; j<c.length; j++) {
15 s_new.appendChild(c[j]);
17 a[i].parentNode.replaceChild(s_new, a[i]);
18 } else {
19 i++;
23 if (a[i].href == document.URL) {
24 a[i].className = "currentlink";
25 if (0) {
26 var s_new = document.createElement("span");
27 s_new.className = "currentlink";
28 s_new.appendChild(a[i]);
29 a[i].parentNode.replaceChild(s_new, a[i]);
32 i++;
37 find_selflink();