Put photo segment at top and trim slashes from urls.

This commit is contained in:
Jason A. Donenfeld
2011-05-09 09:42:17 -04:00
parent 6d75a3ed64
commit 99be279ae3
2 changed files with 14 additions and 10 deletions

View File

@ -281,10 +281,14 @@ $(document).ready(function() {
var album_cache = new Array();
$(window).hashchange(function() {
var new_album_cache = location.hash.substring(1);
if (new_album_cache.length && new_album_cache[0] == "!")
new_album_cache = new_album_cache.substring(1);
if (new_album_cache.length && new_album_cache[0] == "/")
new_album_cache = new_album_cache.substring(1);
if (new_album_cache.length) {
if (new_album_cache[0] == "!")
new_album_cache = new_album_cache.substring(1);
if (new_album_cache[0] == "/")
new_album_cache = new_album_cache.substring(1);
if (new_album_cache[new_album_cache.length - 1] == "/")
new_album_cache = new_album_cache.substring(0, new_album_cache.length - 1);
}
var index = new_album_cache.lastIndexOf("/");
if (index != -1 && index != new_album_cache.length - 1) {
previous_photo_cache = current_photo_cache;