Skip to content

Commit 371638b

Browse files
committed
Fixed #92 -- correct some JavaScript in docs for "Releases" link.
1 parent 9eeb0e1 commit 371638b

1 file changed

Lines changed: 6 additions & 37 deletions

File tree

web/static/js/checkURL.js

Lines changed: 6 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -1,60 +1,29 @@
11
//Remove <ul> from Releases
2-
$('.toctree-l1 > a').each(function(){
3-
if($(this).html() == "Releases") {
4-
$(this).parent().html('<a class="reference internal" href="/latest/releases/">Releases</a>');
5-
}
6-
});
2+
$('.toctree-l1 > a:contains("Releases")').siblings().remove();
73

84
//Check URL
95
var path = window.location.href;
106
var pathName = path.split('/');
117
var num = pathName.length - 3;
12-
var gettingstarted, terms, client, server, contributing;
138

149
switch(pathName[num]) {
1510
case 'gettingstarted':
16-
//case at Getting Started
17-
$('.toctree-l1 > a').each(function(){
18-
if($(this).html() == "Getting Started") {
19-
$(this).attr('state', 'open');
20-
}
21-
});
11+
$('.toctree-l1 > a:contains("Getting Started")').attr('state', 'open');
2212
break;
2313
case 'terms':
24-
//case at Terms
25-
$('.toctree-l1 > a').each(function(){
26-
if($(this).html() == "Terms") {
27-
$(this).attr('state', 'open');
28-
}
29-
});
14+
$('.toctree-l1 > a:contains("Terms")').attr('state', 'open');
3015
break;
3116
case 'client':
32-
//case at Client Reference
33-
$('.toctree-l1 > a').each(function(){
34-
if($(this).html() == "Client Reference") {
35-
$(this).attr('state', 'open');
36-
}
37-
});
17+
$('.toctree-l1 > a:contains("Client Reference")').attr('state', 'open');
3818
break;
3919
case 'server':
40-
//case at Server Reference
41-
$('.toctree-l1 > a').each(function(){
42-
if($(this).html() == "Server Reference") {
43-
$(this).attr('state', 'open');
44-
}
45-
});
20+
$('.toctree-l1 > a:contains("Server Reference")').attr('state', 'open');
4621
break;
4722
case 'contributing':
48-
//case at Contributing
49-
$('.toctree-l1 > a').each(function(){
50-
if($(this).html() == "Contributing") {
51-
$(this).attr('state', 'open');
52-
}
53-
});
23+
$('.toctree-l1 > a:contains("Contributing")').attr('state', 'open');
5424
break;
5525
case 'releases':
5626
//code this out when releases gets filled out
5727
break;
5828
default:
5929
}
60-

0 commit comments

Comments
 (0)