-
Notifications
You must be signed in to change notification settings - Fork 4
Expand file tree
/
Copy pathcheckURL.js
More file actions
47 lines (44 loc) · 1.43 KB
/
checkURL.js
File metadata and controls
47 lines (44 loc) · 1.43 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
//Remove <ul> from Releases
$('.toctree-l1 > a:contains("Releases")').siblings().remove();
//Check URL
var path = window.location.pathname.split('/');
var cleanedPath = $.grep(path,function(n){ return(n) });
// the second to last path segment is the section
// unless there's only 1 segment
if (cleanedPath.length == 1) {
path = cleanedPath[0];
} else {
path = cleanedPath[cleanedPath.length-2];
}
switch(path) {
case 'understanding_deis':
$('.toctree-l1 > a:contains("Understanding Deis")').attr('state', 'open');
break;
case 'installing_deis':
$('.toctree-l1 > a:contains("Installing Deis")').attr('state', 'open');
break;
case 'using_deis':
$('.toctree-l1 > a:contains("Using Deis")').attr('state', 'open');
break;
case 'managing_deis':
$('.toctree-l1 > a:contains("Managing Deis")').attr('state', 'open');
break;
case 'troubleshooting_deis':
$('.toctree-l1 > a:contains("Troubleshooting Deis")').attr('state', 'open');
break;
case 'customizing_deis':
$('.toctree-l1 > a:contains("Customizing Deis")').attr('state', 'open');
break;
case 'contributing':
$('.toctree-l1 > a:contains("Contributing")').attr('state', 'open');
break;
case 'reference':
case 'client':
case 'server':
case 'terms':
$('.toctree-l1 > a:contains("Reference Guide")').attr('state', 'open');
break;
default:
$('.toctree-l1 > a:contains("Version")').attr('state', 'close');
break;
}