Skip to content

Commit

Permalink
current theme is saved in window.location.hash
Browse files Browse the repository at this point in the history
  • Loading branch information
gravityblast committed Jan 19, 2009
1 parent ea5d652 commit 7325124
Showing 1 changed file with 13 additions and 3 deletions.
16 changes: 13 additions & 3 deletions index.html
Expand Up @@ -9,9 +9,19 @@
<script type="text/javascript" charset="utf-8">
var Theme = {
activate: function(name) {
$('#current-theme').attr('href', 'themes/' + name + '/style.css');
window.location.hash = 'themes/' + name
Theme.loadCurrent();
},

loadCurrent: function() {
matches = window.location.hash.match(/#(.+)/);
if (matches && matches.length > 1) {
$('#current-theme').attr('href', matches[1] + '/style.css');
}
}
}
}

$(document).ready(Theme.loadCurrent);
</script>
</head>
<body>
Expand All @@ -25,7 +35,7 @@
</ul>
<div class="clear"></div>
</div>
<h1><a href="#">Wep App Theme</a></h1>
<h1><a href="index.html">Wep App Theme</a></h1>
<div id="main-navigation">
<ul>
<li><a href="#">Dashboard</a></li>
Expand Down

0 comments on commit 7325124

Please sign in to comment.