Skip to content
This repository has been archived by the owner on Nov 30, 2021. It is now read-only.

Commit

Permalink
Fixed #92 -- correct some JavaScript in docs for "Releases" link.
Browse files Browse the repository at this point in the history
  • Loading branch information
mboersma committed Aug 15, 2013
1 parent 9eeb0e1 commit 371638b
Showing 1 changed file with 6 additions and 37 deletions.
43 changes: 6 additions & 37 deletions web/static/js/checkURL.js
@@ -1,60 +1,29 @@
//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>');
}
});
$('.toctree-l1 > a:contains("Releases")').siblings().remove();

//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');
}
});
$('.toctree-l1 > a:contains("Getting Started")').attr('state', 'open');
break;
case 'terms':
//case at Terms
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Terms") {
$(this).attr('state', 'open');
}
});
$('.toctree-l1 > a:contains("Terms")').attr('state', 'open');
break;
case 'client':
//case at Client Reference
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Client Reference") {
$(this).attr('state', 'open');
}
});
$('.toctree-l1 > a:contains("Client Reference")').attr('state', 'open');
break;
case 'server':
//case at Server Reference
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Server Reference") {
$(this).attr('state', 'open');
}
});
$('.toctree-l1 > a:contains("Server Reference")').attr('state', 'open');
break;
case 'contributing':
//case at Contributing
$('.toctree-l1 > a').each(function(){
if($(this).html() == "Contributing") {
$(this).attr('state', 'open');
}
});
$('.toctree-l1 > a:contains("Contributing")').attr('state', 'open');
break;
case 'releases':
//code this out when releases gets filled out
break;
default:
}

0 comments on commit 371638b

Please sign in to comment.