summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2011-05-09 09:42:17 -0400
committerJason A. Donenfeld <Jason@zx2c4.com>2011-05-09 09:42:17 -0400
commit99be279ae3d6991ea5c0d813ebb5aa536b7631cc (patch)
tree56017fcebead6b451b6255ea2d5ee241be1b146c
parentTo work around Espen's corrupted image bug, we simply try to copy the image twice. The second time will usually work, unless the file is totally borked. (diff)
downloadPhotoFloat-99be279ae3d6991ea5c0d813ebb5aa536b7631cc.tar.xz
PhotoFloat-99be279ae3d6991ea5c0d813ebb5aa536b7631cc.zip
Put photo segment at top and trim slashes from urls.
-rw-r--r--web/index.html12
-rw-r--r--web/js/010-control.js12
2 files changed, 14 insertions, 10 deletions
diff --git a/web/index.html b/web/index.html
index e9b0b9a..a0b201e 100644
--- a/web/index.html
+++ b/web/index.html
@@ -10,12 +10,6 @@
</head>
<body>
<div id="title">Photos</div>
-<div id="album-view">
- <div id="thumbs">
- <div id="loading">Loading...</div>
- </div>
- <div id="subalbums"></div>
-</div>
<div id="photo-view">
<div id="photo-box">
<a id="next-photo"><img id="photo" /></a>
@@ -30,6 +24,12 @@
<a id="back">&lsaquo;</a>
<a id="next">&rsaquo;</a>
</div>
+<div id="album-view">
+ <div id="thumbs">
+ <div id="loading">Loading...</div>
+ </div>
+ <div id="subalbums"></div>
+</div>
<div id="error-overlay"></div>
<div id="error-text">Forgot my camera.</div>
diff --git a/web/js/010-control.js b/web/js/010-control.js
index 17cb8e2..f675508 100644
--- a/web/js/010-control.js
+++ b/web/js/010-control.js
@@ -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;