-
Notifications
You must be signed in to change notification settings - Fork 112
Expand file tree
/
Copy pathcheckURL.js
More file actions
60 lines (57 loc) · 1.46 KB
/
checkURL.js
File metadata and controls
60 lines (57 loc) · 1.46 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
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
//Remove <ul> from Releases
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Releases") {
$(this).parent().html('<a class="reference internal" href="/latest/releases/">Releases</a>');
}
});
//Check URL
var path = window.location.href;
var pathName = path.split('/');
var num = pathName.length - 3;
var gettingstarted, terms, client, server, contributing;
switch(pathName[num]) {
case 'gettingstarted':
//case at Getting Started
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Getting Started") {
$(this).attr('state', 'open');
}
});
break;
case 'terms':
//case at Terms
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Terms") {
$(this).attr('state', 'open');
}
});
break;
case 'client':
//case at Client Reference
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Client Reference") {
$(this).attr('state', 'open');
}
});
break;
case 'server':
//case at Server Reference
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Server Reference") {
$(this).attr('state', 'open');
}
});
break;
case 'contributing':
//case at Contributing
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Contributing") {
$(this).attr('state', 'open');
}
});
break;
case 'releases':
//code this out when releases gets filled out
break;
default:
}