--- /dev/null
+(function(){
+ 'use strict';
+
+ var NAVS = {
+ 'home': /^\/$/,
+ 'pb': /^\/pb\//,
+ 'ct': /^\/ct\//,
+ 'log': /^\/log\//,
+ 'account': /^\/account$/
+ };
+
+ $( document ).ready(function(){
+ var path = location.pathname;
+ for (var nav in NAVS)
+ if(path.match(NAVS[nav])) {
+ $('#nav-' + nav).addClass('active');
+ break;
+ }
+ });
+})();
<nav role="navigation">
<div class="container-fluid">
<ul class="nav nav-pills nav-justified">
-<li><a href="/">Gruntmaster 6000</a>
-<li><a href="/pb/">Problems</a>
-<li><a href="/ct/">Contests</a>
-<li><a href="/log/">Job log</a>
-<li><a href="/account">Account</a>
+<li id="nav-home"><a href="/">Gruntmaster 6000</a>
+<li id="nav-pb"><a href="/pb/">Problems</a>
+<li id="nav-ct"><a href="/ct/">Contests</a>
+<li id="nav-log"><a href="/log/">Job log</a>
+<li id="nav-account"><a href="/account">Account</a>
<li id="theme-selector" class="hidden"><a class="dropdown-toggle" data-toggle="dropdown"> Theme <span class="caret"></span></a>
<ul class="dropdown-menu" role="menu">
<li><a href="#" id="theme_slate">Gunmetal gray</a>