From b7298ae6bc46648fadfd223a30224dd5555b97b8 Mon Sep 17 00:00:00 2001 From: "Jason A. Donenfeld" Date: Mon, 9 May 2011 05:01:24 -0400 Subject: [PATCH] Sensiable error policy. --- web/css/000-controls.css | 16 +++++++++++++++- web/index.html | 3 ++- web/js/010-control.js | 17 +++++++++++------ 3 files changed, 28 insertions(+), 8 deletions(-) diff --git a/web/css/000-controls.css b/web/css/000-controls.css index 7fcdb0f..7c85be8 100644 --- a/web/css/000-controls.css +++ b/web/css/000-controls.css @@ -156,9 +156,23 @@ a:hover { text-align: center; } -#error { +#error-overlay, #error-text { + position: fixed; + top: 0; + left: 0; + width: 100%; + height: 100%; display: none; +} +#error-overlay { + background-color: #000000; + opacity: 0.8; + -ms-filter:"progid:DXImageTransform.Microsoft.Alpha(Opacity=80)"; + filter: alpha(opacity=80); +} +#error-text { text-align: center; + position: fixed; padding-top: 20%; font-size: 4em; font-weight: bold; diff --git a/web/index.html b/web/index.html index df3ee77..38267a0 100644 --- a/web/index.html +++ b/web/index.html @@ -30,7 +30,8 @@ -
Forgot my camera.
+
+
Forgot my camera.
diff --git a/web/js/010-control.js b/web/js/010-control.js index ea9550e..dbf7cfc 100644 --- a/web/js/010-control.js +++ b/web/js/010-control.js @@ -49,6 +49,7 @@ $(document).ready(function() { }); } function albumLoaded(album) { + undie(); $("#loading").hide(); album_cache[cachePath(album.path)] = album; current_album = album; @@ -141,9 +142,10 @@ $(document).ready(function() { function showPhoto() { currentPhoto(); if (current_photo == null) { - $(document.body).html("Wrong picture."); + die(); return; } + undie(); var maxSize = 800; var width = current_photo.size[0]; var height = current_photo.size[1]; @@ -245,18 +247,21 @@ $(document).ready(function() { $.ajax({ type: "GET", url: "cache/" + album + ".json", - error: die, success: callback }); } function albumThumbFinder(album, callback) { fetchAlbumForThumb(album, function(fetchedAlbum) { albumForThumbIteration(fetchedAlbum, callback); }); } + function die() { - $("#album-view").hide(); - $("#photo-view").hide(); - $("#title").hide(); - $("#error").fadeIn(5000); + $("#error-overlay").fadeIn(500); + $("#error-text").fadeIn(2500); + $("body, html").css("overflow", "hidden"); + } + function undie() { + $("#error-text, #error-overlay").fadeOut(500); + $("body, html").css("overflow", "auto"); } var current_album_cache = null;